Index: trunk/MESOSCALE/DOC/README
===================================================================
--- trunk/MESOSCALE/DOC/README	(revision 206)
+++ 	(revision )
@@ -1,121 +1,0 @@
-------------------------------
- LMD Martian Mesoscale Model
-------------------------------
-       Technical note   
-------------------------------
-
-Authors: 
-A. Spiga and F. Forget
-Laboratoire de Meteorologie Dynamique
-Universite Pierre et Marie Curie
-BP 99
-4 place Jussieu
-75252 PARIS CEDEX 5
-FRANCE
-
-IMPORTANT NOTICE:
-Please refer to the authors in any publication using the model.
-
-Correspondance:
-spiga@lmd.jussieu.fr
-forget@lmd.jussieu.fr
-
-------------------------------
-
-Credits: 
-- NCEP/NCAR WRF development team http://www.wrf-model.org/index.php
-- EuroMars team (LMD ~ OU/Univ. Oxford - IAA)
-
-Support : 
-- European Space Agency (ESA)
-- Centre National d'Etudes Spatiales (CNES)
-
-------------------------------
-------------------------------
-
-------------------------------
-   Description of the model
-------------------------------
-
-Please refer to the report "Design and Performance of the LMD Martian Mesoscale Model"
-
-------------------------------
-   Installation of the model
-------------------------------
-
-1. copy the LMD Martian Mesoscale sources on a disk with 400 Mo of free space 
-> cp LMD_MM_MARS.tar.gz ***my_disk***
-
-2. unzip the archive file, download WRF sources and prepare directories and files for compilation
-**** REQUIREMENTS:
-**** - you must be connected to the internet
-> tar xzvf LMD_MM_MARS.tar.gz
-> cd LMD_MM_MARS
-> ./prepare
-
-3. compile the model
-**** REQUIREMENTS:
-**** - you must have either pgf90 or g95 installed in your computer
-**** - you must have compiled NETCDF libraries and define the environment variable $NETCDF
-> ./makemeso 
-
-------------------------------
-   Structure of the model
-------------------------------
-SIMU  		>> contains a test case and several useful scripts
-SRC  		>> contains sources of the model, the pre- and post-processing utilities
-WPS_GEOG  	>> contains static data (topography, albedo, thermal inertia)
-build_static    >> a script to build a minimal dataset for initialization of static data 
-copy_model      >> a script to link the model sources and avoid duplicates
-makemeso        >> the main compilation script
-prepare         >> a script to run right after you deflated the .tar.gz file
-
-SRC/ARWpost     		>> post-processing utilities (maps, etc ...)
-SRC/INIT_SIMPLE_TEST.tar.gz  	>> a simple idealized case study
-SRC/PREP_MARS  			>> pre-processing utilities : convert GCM outputs
-SRC/WPS  			>> the main pre-processing system : define domain and interpolate meteorological and static data
-SRC/WRFV2  			>> the folder containing WRF sources and LMD physics sources
-SRC/datesave   			>> a reminder of the version you use
-SRC/g95.tar.gz  		>> fix for some problems that may appear with g95
-SRC/mac.tar.gz  		>> scripts and fixes to run the model on MACs
-SRC/save_all  			>> a script to save the sources and create a .tar.gz archive 
-SRC/saved			>> a reminder of the files in the version you use
-
-------------------------------
-       Run a test case
-------------------------------
-
-1. edit the file ./SRC/WRFV2/meso_datafile.h to change the datafile path
-
-2. compile the model with g95 with specific number of grid points
-> ./makemeso < SIMU/TESTCASE/makemeso_x51_y51_z61_d1_t1_p1   (an example with g95)
-
-3. link the executable
-> cd SIMU/TESTCASE
-> ln -sf ../../g95_??_single/wrf_x51_y51_z61_d1_t1_p1.exe wrf.exe
-
-4. extract the pre-generated initial and boundary conditions
-> tar xzvf wrfinput.tar.gz
-
-5. run the simulation
-> nohup wrf.exe > log_wrf &
-
-6. check the model behavior during the run
-> vi log_wrf           (check model's messages during the run)
-> ./elapsed            (a script to evaluate elapsed simulation time)
-
-The model results are in the 'wrfout_d01_2024-07-01_06:00:00' NETCDF file
-
-NB: 
-- simulation settings can be changed in namelist.input
-- physics settings can be changed in callphys.def
-
-------------------------------
-  Installation of utilities
-------------------------------
-
-4. download and build static data (topography, albedo, thermal inertia)
-**** REQUIREMENTS:
-**** - you must be connected to the internet
-> ./build_static
-
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/WRFV2-gfortran-x86_64-2.patch
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/WRFV2-gfortran-x86_64-2.patch	(revision 206)
+++ 	(revision )
@@ -1,361 +1,0 @@
---- WRFV2.original/arch/configure.defaults	2007-10-05 16:16:41.329127000 +0200
-+++ WRFV2/arch/configure.defaults	2008-09-03 20:18:02.656065000 +0200
-@@ -10943,5 +10943,358 @@
- 	$(RM) $*.b
- 	$(FC) -c $(PROMOTION) $(FCBASEOPTS) $(MODULE_DIRS) $*.f90
- 
-+###########################################################
-+#ARCH    PC Linux x86_64 (IA64 and AMD Opteron), GNU Fortran compiler, DM-Parallel  (RSL, MPICH, Allows nesting)
-+#
-+DMPARALLEL      =       1
-+MAX_PROC        =       1024
-+FC              =       mpif90
-+LD              =       mpif90
-+CC              =       mpicc
-+SCC             =       gcc
-+SFC             =       gfortran
-+RWORDSIZE       =       $(NATIVE_RWORDSIZE)
-+PROMOTION       =       
-+CFLAGS          =       -DDM_PARALLEL -DWRF_RSL_IO \
-+                        -DMAXDOM_MAKE=$(MAX_DOMAINS) -DMAXPROC_MAKE=$(MAX_PROC) -I../external/RSL/RSL \
-+                        -DLANDREAD_STUB
-+FCOPTIM         =       #-Mipa=fast
-+FCDEBUG         =       #-g
-+FCBASEOPTS      =       -w $(FCDEBUG) -ffree-form -ffree-line-length-none
-+FCFLAGS         =       $(FCOPTIM) $(FCBASEOPTS)
-+ARCHFLAGS       =       -DGRIB1 CONFIGURE_GRIB2_FLAG -DINTIO -DWRF_RSL_IO -DRSL -DDM_PARALLEL \
-+                        -DIWORDSIZE=4 -DDWORDSIZE=8 -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=4 CONFIGURE_NETCDF_FLAG \
-+                        -DLIMIT_ARGS -DLANDREAD_STUB
-+# machine-specific flags needed to link in ESMF library (C++ run-time-library, etc.)
-+ESMF_LIB_FLAGS  =
-+ESMF_IO_LIB     =       ESMFIOLIB
-+ESMF_IO_LIB_EXT =       ESMFIOEXTLIB
-+INCLUDE_MODULES =       -J../main -I../main -I../external/io_netcdf -I../external/io_int -I../external/esmf_time_f90 \
-+                        -I../external -I../frame -I../share -I../phys -I../inc -I../chem
-+PERL            =       perl
-+REGISTRY        =       Registry
-+LIB             =       CONFIGURE_NETCDF_LIB_PATH -L../external/RSL/RSL -lrsl \
-+                        -L../external/io_grib1 -lio_grib1 \
-+                        CONFIGURE_GRIB2_LIB \
-+                        -L../external/io_grib_share -lio_grib_share \
-+                        -L../external/io_int -lwrfio_int \
-+                        ../frame/module_internal_header_util.o ../frame/pack_utils.o -L../external/esmf_time_f90 -lesmf_time
-+LDFLAGS         =       CONFIGURE_LDFLAGS
-+ENVCOMPDEFS     =       CONFIGURE_COMPILEFLAGS
-+CPP             =       /lib/cpp -C -P -traditional
-+POUND_DEF       =       -DNO_RRTM_PHYSICS  -traditional $(COREDEFS) -DNONSTANDARD_SYSTEM -DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN) -DMAX_DOMAINS_F=$(MAX_DOMAINS)
-+CPPFLAGS        =       -I$(LIBINCLUDE) -C -P $(ARCHFLAGS) -I../external/RSL/RSL -C -P `cat ../inc/dm_comm_cpp_flags` $(ENVCOMPDEFS) $(POUND_DEF)
-+AR              =       ar ru
-+M4              =       m4 -B 14000
-+RANLIB          =       ranlib
-+NETCDFPATH      =       CONFIGURE_NETCDF_PATH
-+CC_TOOLS        =       cc
-+
-+externals : wrf_ioapi_includes CONFIGURE_WRFIO_NF wrfio_grib_share wrfio_grib1 CONFIGURE_WRFIO_GRIB2 ../external/RSL/RSL/librsl.a wrfio_int gen_comms.c module_dm.F esmf_time
-+
-+gen_comms.c : ../external/RSL/gen_comms.c
-+	( /bin/cp ../tools/gen_comms_warning ../tools/gen_comms.c ; \
-+	cat ../external/RSL/gen_comms.c >> ../tools/gen_comms.c )
-+
-+module_dm.F : ../external/RSL/module_dm.F
-+	( /bin/cp module_dm_warning module_dm.F ; cat ../external/RSL/module_dm.F >> module_dm.F )
-+
-+wrfio_nf :
-+	( cd ../external/io_netcdf ; \
-+	make NETCDFPATH=CONFIGURE_NETCDF_PATH RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(FC) $(PROMOTION) $(FCFLAGS) -w" TRADFLAG="-traditional" )
-+
-+wrfio_int :
-+	( cd ../external/io_int ; \
-+	make CC="$(CC)" RANLIB="$(RANLIB)" CPP="$(CPP)" SFC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" FC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" all )
-+
-+wrfio_grib_share :
-+	( cd ../external/io_grib_share ; \
-+	make CC="$(SCC)" CFLAGS="$(CFLAGS)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
-+
-+wrfio_grib1 :
-+	( cd ../external/io_grib1 ; \
-+	make CC="$(SCC)" CFLAGS="$(CFLAGS)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
-+
-+wrfio_grib2 :
-+	( cd ../external/io_grib2 ; \
-+	make CC="$(SCC)" CFLAGS="$(CFLAGS) CONFIGURE_GRIB2_INC" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" FIXED="-Mfixed" archive)
-+
-+esmf_time :
-+	( cd ../external/esmf_time_f90 ; \
-+	make FC="$(FC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" RANLIB="$(RANLIB)" CPP="$(CPP) -I../../inc -I. $(POUND_DEF)" )
-+
-+../external/RSL/RSL/librsl.a :
-+	( cd ../external/RSL/RSL ; make CC="$(CC)" FC="$(FC) $(PROMOTION)" MAX_DOMAINS=$(MAX_DOMAINS) MAX_PROC=$(MAX_PROC) LEARN_BCAST=-DLEARN_BCAST linux )
-+
-+# compile these without high optimization to speed compile
-+solve_interface.o : solve_interface.F
-+shift_domain_em.o : shift_domain_em.F
-+module_io_mm5.o : module_io_mm5.F
-+module_si_io.o : module_si_io.F
-+module_io_wrf.o : module_io_wrf.F
-+module_domain.o : module_domain.F
-+module_start.o : module_start.F
-+module_initialize.o : module_initialize.F
-+module_initialize_b_wave.o : module_initialize_b_wave.F
-+module_initialize_hill2d_x.o : module_initialize_hill2d_x.F
-+module_initialize_quarter_ss.o : module_initialize_quarter_ss.F
-+module_initialize_squall2d_x.o : module_initialize_squall2d_x.F
-+module_initialize_squall2d_y.o : module_initialize_squall2d_y.F
-+module_initialize_real.o : module_initialize_real.F
-+module_dm.o : module_dm.F
-+start_domain.o : start_domain.F
-+mediation_integrate.o : mediation_integrate.F
-+module_configure.o : module_configure.F
-+
-+solve_interface.o                                              \
-+shift_domain_em.o                                              \
-+module_io_mm5.o module_si_io.o module_io_wrf.o module_domain.o \
-+module_start.o module_initialize.o module_initialize_b_wave.o  \
-+module_initialize_hill2d_x.o module_initialize_quarter_ss.o    \
-+module_initialize_squall2d_x.o module_initialize_squall2d_y.o  \
-+mediation_integrate.o \
-+module_configure.o                                             \
-+module_initialize_real.o module_dm.o start_domain.o :
-+	$(RM) $@
-+	$(SED_FTN) $*.F > $*.b
-+	$(CPP) -I../inc $(CPPFLAGS) $*.b  > $*.f90
-+	$(RM) $*.b
-+	$(FC) -c $(PROMOTION) $(FCBASEOPTS) $(MODULE_DIRS) $*.f90
-+
-+
-+###########################################################
-+#ARCH    PC Linux x86_64 (IA64 and Opteron), GNU Fortran compiler   (Single-threaded, RSL, Allows nesting)
-+#
-+DMPARALLEL      =       1
-+MAX_PROC        =       1024
-+FC              =       gfortran
-+LD              =       gfortran
-+CC              =       gcc
-+SCC		=	$(CC)
-+SFC             =       gfortran
-+RWORDSIZE       =       $(NATIVE_RWORDSIZE)
-+FCOPTIM		=       #-O3 -funroll-loops -ftree-vectorize -ftree-loop-linear
-+FCDEBUG		=	#-g
-+FCBASEOPTS      =       -w $(FCDEBUG) -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4
-+FCFLAGS         =       $(FCOPTIM) $(FCBASEOPTS)
-+ARCHFLAGS       =       -DGRIB1 -DINTIO -DWRF_RSL_IO -DRSL -DDM_PARALLEL \
-+                        -DIWORDSIZE=4 -DDWORDSIZE=8 -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=4 CONFIGURE_NETCDF_FLAG \
-+			-DLIMIT_ARGS -DSTUBMPI
-+PROMOTION	=
-+CFLAGS          =       -DLANDREADSTUB -DDM_PARALLEL -DWRF_RSL_IO \
-+                        -DMAXDOM_MAKE=$(MAX_DOMAINS) -DMAXPROC_MAKE=$(MAX_PROC) -I../external/RSL/RSL $(ARCHFLAGS)
-+# machine-specific flags needed to link in ESMF library (C++ run-time-library, etc.)
-+ESMF_LIB_FLAGS  =       
-+ESMF_IO_LIB     =       ESMFIOLIB
-+ESMF_IO_LIB_EXT =       ESMFIOEXTLIB
-+INCLUDE_MODULES =       -J../main -I../main -I../external/io_netcdf -I../external/io_int -I../external/esmf_time_f90 \
-+                        -I../external -I../frame -I../share -I../phys -I../chem -I../inc
-+PERL            =       perl
-+REGISTRY        =       Registry
-+LIB             =       CONFIGURE_NETCDF_LIB_PATH -L../external/RSL/RSL -lrsl \
-+                        -L../external/io_grib1 -lio_grib1 \
-+			-L../external/io_int -lwrfio_int \
-+			-L../external/io_grib_share -lio_grib_share \
-+			../frame/module_internal_header_util.o ../frame/pack_utils.o -L../external/esmf_time_f90 -lesmf_time 
-+LDFLAGS         =       $(FCFLAGS) CONFIGURE_LDFLAGS -fconvert=big-endian
-+ENVCOMPDEFS	=	CONFIGURE_COMPILEFLAGS
-+CPP             =       /lib/cpp -C -P -traditional
-+POUND_DEF	=	-DNO_RRTM_PHYSICS  $(COREDEFS) -DNONSTANDARD_SYSTEM -DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN) -DMAX_DOMAINS_F=$(MAX_DOMAINS)
-+CPPFLAGS        =       -I$(LIBINCLUDE) -C -P $(ARCHFLAGS) -I../external/RSL/RSL -C -P `cat ../inc/dm_comm_cpp_flags` $(ENVCOMPDEFS) $(POUND_DEF)
-+AR              =       ar ru
-+M4              =       m4 -B 14000
-+RANLIB          =       ranlib
-+NETCDFPATH	=	CONFIGURE_NETCDF_PATH
-+CC_TOOLS        =       cc
-+
-+externals : wrf_ioapi_includes CONFIGURE_WRFIO_NF wrfio_grib_share wrfio_grib1 ../external/RSL/RSL/librsl.a wrfio_int gen_comms.c module_dm.F esmf_time
-+
-+gen_comms.c : ../external/RSL/gen_comms.c
-+	( /bin/cp ../tools/gen_comms_warning ../tools/gen_comms.c ; \
-+          cat ../external/RSL/gen_comms.c >> ../tools/gen_comms.c )
-+
-+module_dm.F : ../external/RSL/module_dm.F
-+	( /bin/cp module_dm_warning module_dm.F ; cat ../external/RSL/module_dm.F >> module_dm.F )
-+
-+wrfio_nf : 
-+	( cd ../external/io_netcdf ; \
-+	  make NETCDFPATH=CONFIGURE_NETCDF_PATH RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(FC) $(PROMOTION) $(FCFLAGS) -w" TRADFLAG="-traditional" )
-+
-+wrfio_grib_share :
-+	( cd ../external/io_grib_share ; \
-+          make CC="$(SCC)" CFLAGS="$(CFLAGS)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
-+
-+wrfio_grib1 :
-+	( cd ../external/io_grib1 ; \
-+          make CC="$(SCC)" CFLAGS="$(CFLAGS)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
-+
-+wrfio_grib2 :
-+	( cd ../external/io_grib2 ; \
-+          make CC="$(SCC)" CFLAGS="$(CFLAGS) CONFIGURE_GRIB2_INC" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" FIXED="-Mfixed" archive)
-+
-+wrfio_int : 
-+	( cd ../external/io_int ; \
-+          make CC="$(CC)" RANLIB="$(RANLIB)" CPP="$(CPP)" SFC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" FC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" all )
-+
-+esmf_time : 
-+	( cd ../external/esmf_time_f90 ; \
-+	  make FC="$(FC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" RANLIB="$(RANLIB)" CPP="$(CPP) -I../../inc -I. $(POUND_DEF)" )
-+
-+../external/RSL/RSL/librsl.a :
-+	( cd ../external/RSL/RSL ; make CC="$(CC)" CFLAGS='-DSTUBS' FC="$(FC) $(PROMOTION)" FFLAGS='' MAX_DOMAINS=$(MAX_DOMAINS) MAX_PROC=$(MAX_PROC) LEARN_BCAST=-DLEARN_BCAST stub )
-+
-+# compile these without high optimization to speed compile
-+solve_interface.o : solve_interface.F
-+shift_domain_em.o : shift_domain_em.F
-+module_io_mm5.o : module_io_mm5.F
-+module_si_io.o : module_si_io.F
-+module_io_wrf.o : module_io_wrf.F
-+module_domain.o : module_domain.F
-+module_start.o : module_start.F
-+module_initialize.o : module_initialize.F
-+module_initialize_b_wave.o : module_initialize_b_wave.F
-+module_initialize_hill2d_x.o : module_initialize_hill2d_x.F
-+module_initialize_quarter_ss.o : module_initialize_quarter_ss.F
-+module_initialize_squall2d_x.o : module_initialize_squall2d_x.F
-+module_initialize_squall2d_y.o : module_initialize_squall2d_y.F
-+module_initialize_real.o : module_initialize_real.F
-+module_dm.o : module_dm.F
-+start_domain.o : start_domain.F
-+mediation_integrate.o : mediation_integrate.F
-+module_configure.o : module_configure.F
-+
-+solve_interface.o                                              \
-+shift_domain_em.o                                              \
-+module_io_mm5.o module_si_io.o module_io_wrf.o module_domain.o \
-+module_start.o module_initialize.o module_initialize_b_wave.o  \
-+module_initialize_hill2d_x.o module_initialize_quarter_ss.o    \
-+module_initialize_squall2d_x.o module_initialize_squall2d_y.o  \
-+module_configure.o                                             \
-+mediation_integrate.o \
-+module_initialize_real.o module_dm.o start_domain.o :
-+	$(RM) $@
-+	$(SED_FTN) $*.F > $*.b 
-+	$(CPP) -I../inc $(CPPFLAGS) $*.b  > $*.f90
-+	$(RM) $*.b
-+	$(FC) -c $(PROMOTION) $(FCBASEOPTS) $(MODULE_DIRS) $*.f90
-+
-+
-+###########################################################
-+#ARCH     PC Linux x86_64 (IA64 and Opteron), GNU Fortran compiler  DM-Parallel (RSL_LITE, OpenMPI, Allows nesting)
-+#
-+DMPARALLEL      =       1
-+MAX_PROC        =       1024
-+FC              =       mpif90
-+LD              =       mpif90
-+CC              =       mpicc
-+SCC		=	gcc
-+SFC             =       gfortran
-+RWORDSIZE       =       $(NATIVE_RWORDSIZE)
-+PROMOTION	=	
-+CFLAGS          =       -DDM_PARALLEL \
-+                        -DMAXDOM_MAKE=$(MAX_DOMAINS) -DMAXPROC_MAKE=$(MAX_PROC) -I../external/RSL_LITE
-+FCOPTIM		=	
-+FCDEBUG		=	
-+FCBASEOPTS      =       -w $(FCDEBUG) -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4
-+FCFLAGS         =       $(FCOPTIM) $(FCBASEOPTS)
-+ARCHFLAGS       =       -DGRIB1 CONFIGURE_GRIB2_FLAG -DINTIO -DDM_PARALLEL \
-+                        -DIWORDSIZE=4 -DDWORDSIZE=8 -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=4 CONFIGURE_NETCDF_FLAG \
-+			-DLIMIT_ARGS -DNMM_NEST=$(WRF_NMM_NEST)
-+# machine-specific flags needed to link in ESMF library (C++ run-time-library, etc.)
-+ESMF_LIB_FLAGS  =       
-+ESMF_IO_LIB     =       ESMFIOLIB
-+ESMF_IO_LIB_EXT =       ESMFIOEXTLIB
-+INCLUDE_MODULES =       -J../main -I../main -I../external/io_netcdf -I../external/io_int -I../external/esmf_time_f90 \
-+                        -I../external -I../frame -I../share -I../phys -I../chem -I../inc
-+PERL            =       perl
-+REGISTRY        =       Registry
-+LIB             =       CONFIGURE_NETCDF_LIB_PATH -L../external/RSL_LITE -lrsl_lite \
-+                        -L../external/io_grib1 -lio_grib1 \
-+                        CONFIGURE_GRIB2_LIB \
-+                        -L../external/io_grib_share -lio_grib_share \
-+			-L../external/io_int -lwrfio_int \
-+			../frame/module_internal_header_util.o ../frame/pack_utils.o -L../external/esmf_time_f90 -lesmf_time 
-+LDFLAGS         =       $(FCFLAGS) CONFIGURE_LDFLAGS -fconvert=big-endian
-+ENVCOMPDEFS	=	CONFIGURE_COMPILEFLAGS
-+CPP             =       /lib/cpp -C -P -traditional
-+POUND_DEF	=	-DNO_RRTM_PHYSICS  -traditional $(COREDEFS) -DNONSTANDARD_SYSTEM -DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN) -DMAX_DOMAINS_F=$(MAX_DOMAINS)
-+CPPFLAGS        =       -I$(LIBINCLUDE) -C -P $(ARCHFLAGS) -I../external/RSL_LITE -C -P `cat ../inc/dm_comm_cpp_flags` $(ENVCOMPDEFS) $(POUND_DEF)
-+AR              =       ar ru
-+M4              =       m4 -B 14000
-+RANLIB          =       ranlib
-+NETCDFPATH	=	CONFIGURE_NETCDF_PATH
-+CC_TOOLS        =       cc
-+
-+externals : wrf_ioapi_includes CONFIGURE_WRFIO_NF wrfio_grib_share wrfio_grib1 CONFIGURE_WRFIO_GRIB2 ../external/RSL_LITE/librsl_lite.a wrfio_int gen_comms.c module_dm.F esmf_time
-+
-+gen_comms.c : ../external/RSL_LITE/gen_comms.c
-+	( /bin/cp ../tools/gen_comms_warning ../tools/gen_comms.c ; \
-+          cat ../external/RSL_LITE/gen_comms.c >> ../tools/gen_comms.c )
-+
-+module_dm.F : ../external/RSL_LITE/module_dm.F
-+	( /bin/cp module_dm_warning module_dm.F ; cat ../external/RSL_LITE/module_dm.F >> module_dm.F )
-+
-+wrfio_nf : 
-+	( cd ../external/io_netcdf ; \
-+	  make NETCDFPATH=CONFIGURE_NETCDF_PATH RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(FC) $(PROMOTION) $(FCFLAGS) -w" TRADFLAG="-traditional" )
-+
-+wrfio_grib_share :
-+	( cd ../external/io_grib_share ; \
-+          make CC="$(SCC)" CFLAGS="$(CFLAGS)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
-+
-+wrfio_grib1 :
-+	( cd ../external/io_grib1 ; \
-+          make CC="$(SCC)" CFLAGS="$(CFLAGS)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
-+
-+wrfio_grib2 :
-+	( cd ../external/io_grib2 ; \
-+          make CC="$(SCC)" CFLAGS="$(CFLAGS) CONFIGURE_GRIB2_INC" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" FIXED="-Mfixed" archive)
-+
-+wrfio_int : 
-+	( cd ../external/io_int ; \
-+          make CC="$(CC)" RANLIB="$(RANLIB)" CPP="$(CPP)" SFC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" FC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" all )
-+
-+esmf_time : 
-+	( cd ../external/esmf_time_f90 ; \
-+	  make FC="$(FC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" RANLIB="$(RANLIB)" CPP="$(CPP) -I../../inc -I. $(POUND_DEF)" )
-+
-+../external/RSL_LITE/librsl_lite.a :
-+	( cd ../external/RSL_LITE ; make CC="$(CC)" FC="$(FC) $(FCFLAGS) $(PROMOTION) -byteswapio" MAX_DOMAINS=$(MAX_DOMAINS) MAX_PROC=$(MAX_PROC) LEARN_BCAST=-DLEARN_BCAST )
-+
-+# compile these without high optimization to speed compile
-+solve_interface.o : solve_interface.F
-+shift_domain_em.o : shift_domain_em.F
-+module_io_mm5.o : module_io_mm5.F
-+module_si_io.o : module_si_io.F
-+module_io_wrf.o : module_io_wrf.F
-+module_domain.o : module_domain.F
-+module_start.o : module_start.F
-+module_initialize.o : module_initialize.F
-+module_initialize_b_wave.o : module_initialize_b_wave.F
-+module_initialize_hill2d_x.o : module_initialize_hill2d_x.F
-+module_initialize_quarter_ss.o : module_initialize_quarter_ss.F
-+module_initialize_squall2d_x.o : module_initialize_squall2d_x.F
-+module_initialize_squall2d_y.o : module_initialize_squall2d_y.F
-+module_initialize_real.o : module_initialize_real.F
-+module_dm.o : module_dm.F
-+start_domain.o : start_domain.F
-+mediation_integrate.o : mediation_integrate.F
-+module_configure.o : module_configure.F
-+
-+solve_interface.o                                              \
-+shift_domain_em.o                                              \
-+module_io_mm5.o module_si_io.o module_io_wrf.o module_domain.o \
-+module_start.o module_initialize.o module_initialize_b_wave.o  \
-+module_initialize_hill2d_x.o module_initialize_quarter_ss.o    \
-+module_initialize_squall2d_x.o module_initialize_squall2d_y.o  \
-+module_configure.o                                             \
-+mediation_integrate.o \
-+module_initialize_real.o module_dm.o start_domain.o :
-+	$(RM) $@
-+	$(SED_FTN) $*.F > $*.b 
-+	$(CPP) -I../inc $(CPPFLAGS) $*.b  > $*.f90
-+	$(RM) $*.b
-+	$(FC) -c $(PROMOTION) $(FCBASEOPTS) $(MODULE_DIRS) $*.f90
-+
- ##################################################################
- #ARCH  NULL
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/co2clouds_module_initialize_quarter_ss.F
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/co2clouds_module_initialize_quarter_ss.F	(revision 206)
+++ 	(revision )
@@ -1,965 +1,0 @@
-!IDEAL:MODEL_LAYER:INITIALIZATION
-!
-
-!  This MODULE holds the routines which are used to perform various initializations
-!  for the individual domains.  
-
-!  This MODULE CONTAINS the following routines:
-
-!  initialize_field_test - 1. Set different fields to different constant
-!                             values.  This is only a test.  If the correct
-!                             domain is not found (based upon the "id")
-!                             then a fatal error is issued.               
-
-!-----------------------------------------------------------------------
-
-MODULE module_initialize
-
-   USE module_domain
-   USE module_io_domain
-   USE module_state_description
-   USE module_model_constants
-   USE module_bc
-   USE module_timing
-   USE module_configure
-   USE module_init_utilities
-#ifdef DM_PARALLEL
-   USE module_dm
-#endif
-
-
-CONTAINS
-
-
-!-------------------------------------------------------------------
-! this is a wrapper for the solver-specific init_domain routines.
-! Also dereferences the grid variables and passes them down as arguments.
-! This is crucial, since the lower level routines may do message passing
-! and this will get fouled up on machines that insist on passing down
-! copies of assumed-shape arrays (by passing down as arguments, the 
-! data are treated as assumed-size -- ie. f77 -- arrays and the copying
-! business is avoided).  Fie on the F90 designers.  Fie and a pox.
-
-   SUBROUTINE init_domain ( grid )
-
-   IMPLICIT NONE
-
-   !  Input data.
-   TYPE (domain), POINTER :: grid 
-   !  Local data.
-   INTEGER                :: dyn_opt 
-   INTEGER :: idum1, idum2
-
-   CALL nl_get_dyn_opt( 1, dyn_opt )
-   
-   CALL set_scalar_indices_from_config ( head_grid%id , idum1, idum2 )
-
-   IF (      dyn_opt .eq. 1 &
-        .or. dyn_opt .eq. 2 &
-        .or. dyn_opt .eq. 3 &
-                                       ) THEN
-     CALL init_domain_rk( grid &
-!
-#include <em_actual_new_args.inc>
-!
-                        )
-
-   ELSE
-     WRITE(0,*)' init_domain: unknown or unimplemented dyn_opt = ',dyn_opt
-     CALL wrf_error_fatal ( ' init_domain: unknown or unimplemented dyn_opt ' )
-   ENDIF
-
-   END SUBROUTINE init_domain
-
-!-------------------------------------------------------------------
-
-   SUBROUTINE init_domain_rk ( grid &
-!
-# include <em_dummy_new_args.inc>
-!
-)
-   IMPLICIT NONE
-
-   !  Input data.
-   TYPE (domain), POINTER :: grid
-
-# include <em_dummy_new_decl.inc>
-
-   TYPE (grid_config_rec_type)              :: config_flags
-
-   !  Local data
-   INTEGER                             ::                       &
-                                  ids, ide, jds, jde, kds, kde, &
-                                  ims, ime, jms, jme, kms, kme, &
-                                  its, ite, jts, jte, kts, kte, &
-                                  i, j, k
-
-   ! Local data
-
-   INTEGER, PARAMETER :: nl_max = 1000
-   REAL, DIMENSION(nl_max) :: zk, p_in, theta, rho, u, v, qv, pd_in
-   INTEGER :: nl_in
-
-
-   INTEGER :: icm,jcm, ii, im1, jj, jm1, loop, error, fid, nxc, nyc
-   REAL    :: u_mean,v_mean, f0, p_surf, p_level, qvf, z_at_v, z_at_u
-   REAL    :: z_scale, xrad, yrad, zrad, rad, delt, cof1, cof2
-!   REAL, EXTERNAL :: interp_0
-   REAL    :: hm
-   REAL    :: pi
-
-!  stuff from original initialization that has been dropped from the Registry 
-   REAL    :: vnu, xnu, xnus, dinit0, cbh, p0_temp, t0_temp, zd, zt
-   REAL    :: qvf1, qvf2, pd_surf
-   INTEGER :: it
-   real :: thtmp, ptmp, temp(3)
-
-   LOGICAL :: moisture_init
-   LOGICAL :: stretch_grid, dry_sounding
-
-  INTEGER :: xs , xe , ys , ye
-  REAL :: mtn_ht
-   LOGICAL, EXTERNAL :: wrf_dm_on_monitor
-
-!!MARS
- REAL :: lon_input, lat_input, alt_input, tsurf_input
-!!MARS
-
-
-#ifdef DM_PARALLEL
-#    include <em_data_calls.inc>
-#endif
-
-
-   SELECT CASE ( model_data_order )
-         CASE ( DATA_ORDER_ZXY )
-   kds = grid%sd31 ; kde = grid%ed31 ;
-   ids = grid%sd32 ; ide = grid%ed32 ;
-   jds = grid%sd33 ; jde = grid%ed33 ;
-
-   kms = grid%sm31 ; kme = grid%em31 ;
-   ims = grid%sm32 ; ime = grid%em32 ;
-   jms = grid%sm33 ; jme = grid%em33 ;
-
-   kts = grid%sp31 ; kte = grid%ep31 ;   ! note that tile is entire patch
-   its = grid%sp32 ; ite = grid%ep32 ;   ! note that tile is entire patch
-   jts = grid%sp33 ; jte = grid%ep33 ;   ! note that tile is entire patch
-         CASE ( DATA_ORDER_XYZ )
-   ids = grid%sd31 ; ide = grid%ed31 ;
-   jds = grid%sd32 ; jde = grid%ed32 ;
-   kds = grid%sd33 ; kde = grid%ed33 ;
-
-   ims = grid%sm31 ; ime = grid%em31 ;
-   jms = grid%sm32 ; jme = grid%em32 ;
-   kms = grid%sm33 ; kme = grid%em33 ;
-
-   its = grid%sp31 ; ite = grid%ep31 ;   ! note that tile is entire patch
-   jts = grid%sp32 ; jte = grid%ep32 ;   ! note that tile is entire patch
-   kts = grid%sp33 ; kte = grid%ep33 ;   ! note that tile is entire patch
-         CASE ( DATA_ORDER_XZY )
-   ids = grid%sd31 ; ide = grid%ed31 ;
-   kds = grid%sd32 ; kde = grid%ed32 ;
-   jds = grid%sd33 ; jde = grid%ed33 ;
-
-   ims = grid%sm31 ; ime = grid%em31 ;
-   kms = grid%sm32 ; kme = grid%em32 ;
-   jms = grid%sm33 ; jme = grid%em33 ;
-
-   its = grid%sp31 ; ite = grid%ep31 ;   ! note that tile is entire patch
-   kts = grid%sp32 ; kte = grid%ep32 ;   ! note that tile is entire patch
-   jts = grid%sp33 ; jte = grid%ep33 ;   ! note that tile is entire patch
-
-   END SELECT
-
-
-   stretch_grid = .true.
-!   stretch_grid = .false.
-
-   delt = 3.
-   delt = 10.
-!   z_scale = .50
-   z_scale = .40
-
-!!!MARS
-!!!MARS
-!  open(unit=16,file='input_vert',form='formatted',status='old')
-!  rewind(16) 
-!  read(16,*) delt, z_scale
-!  write(6,*) 'delt, z_scale are  ', delt, z_scale
-!  close(16)
-!!!MARS
-!!!MARS
-
-   pi = 2.*asin(1.0)
-   write(6,*) ' pi is ',pi
-   nxc = (ide-ids)/2
-   nyc = (jde-jds)/2
-
-   CALL model_to_grid_config_rec ( grid%id , model_config_rec , config_flags )
-
-! here we check to see if the boundary conditions are set properly
-
-   CALL boundary_condition_check( config_flags, bdyzone, error, grid%id )
-
-   moisture_init = .true.
-
-    grid%itimestep=0
-
-#ifdef DM_PARALLEL
-   CALL wrf_dm_bcast_bytes( icm , IWORDSIZE )
-   CALL wrf_dm_bcast_bytes( jcm , IWORDSIZE )
-#endif
-
-    CALL nl_set_mminlu(1, '    ')
-    CALL nl_set_iswater(1,0)
-    CALL nl_set_cen_lat(1,40.)
-    CALL nl_set_cen_lon(1,-105.)
-    CALL nl_set_truelat1(1,0.)
-    CALL nl_set_truelat2(1,0.)
-    CALL nl_set_moad_cen_lat (1,0.)
-    CALL nl_set_stand_lon (1,0.)
-    CALL nl_set_map_proj(1,0)
-
-
-!  here we initialize data we currently is not initialized 
-!  in the input data
-
-    DO j = jts, jte
-      DO i = its, ite
-         grid%msft(i,j)     = 1.
-         grid%msfu(i,j)     = 1.
-         grid%msfv(i,j)     = 1.
-         grid%sina(i,j)     = 0.
-         grid%cosa(i,j)     = 1.
-         grid%e(i,j)        = 0.
-         grid%f(i,j)        = 0.         !! MARS: put coriolis here if needed
-
-      END DO
-   END DO
-
-    DO j = jts, jte
-    DO k = kts, kte
-      DO i = its, ite
-         grid%em_ww(i,k,j)     = 0.
-      END DO
-   END DO
-   END DO
-
-   grid%step_number = 0
-
-! set up the grid
-
-   IF (stretch_grid) THEN ! exponential stretch for eta (nearly constant dz)
-     DO k=1, kde
-      grid%em_znw(k) = (exp(-(k-1)/float(kde-1)/z_scale) - exp(-1./z_scale))/ &
-                                (1.-exp(-1./z_scale))
-     ENDDO
-   ELSE
-     DO k=1, kde
-      grid%em_znw(k) = 1. - float(k-1)/float(kde-1)
-     ENDDO
-   ENDIF
-
-!!MARS
-!!MARS
-  open(unit=12,file='levels',form='formatted',status='old')
-  rewind(12)
-  DO k=1, kde
-  read(12,*) grid%em_znw(k)
-  write(6,*) 'read level ', k,grid%em_znw(k)
-  ENDDO
-  close(12)
-!!MARS
-!!MARS
-  
-
-!   print *, 'coucou'
-!   stop
-
-   DO k=1, kde-1
-    grid%em_dnw(k) = grid%em_znw(k+1) - grid%em_znw(k)
-    grid%em_rdnw(k) = 1./grid%em_dnw(k)
-    grid%em_znu(k) = 0.5*(grid%em_znw(k+1)+grid%em_znw(k))
-   ENDDO
-   DO k=2, kde-1
-    grid%em_dn(k) = 0.5*(grid%em_dnw(k)+grid%em_dnw(k-1))
-    grid%em_rdn(k) = 1./grid%em_dn(k)
-    grid%em_fnp(k) = .5* grid%em_dnw(k  )/grid%em_dn(k)
-    grid%em_fnm(k) = .5* grid%em_dnw(k-1)/grid%em_dn(k)
-   ENDDO
-
-   cof1 = (2.*grid%em_dn(2)+grid%em_dn(3))/(grid%em_dn(2)+grid%em_dn(3))*grid%em_dnw(1)/grid%em_dn(2) 
-   cof2 =     grid%em_dn(2)        /(grid%em_dn(2)+grid%em_dn(3))*grid%em_dnw(1)/grid%em_dn(3) 
-   grid%cf1  = grid%em_fnp(2) + cof1
-   grid%cf2  = grid%em_fnm(2) - cof1 - cof2
-   grid%cf3  = cof2       
-
-   grid%cfn  = (.5*grid%em_dnw(kde-1)+grid%em_dn(kde-1))/grid%em_dn(kde-1)
-   grid%cfn1 = -.5*grid%em_dnw(kde-1)/grid%em_dn(kde-1)
-   grid%rdx = 1./config_flags%dx
-   grid%rdy = 1./config_flags%dy
-
-!  get the sounding from the ascii sounding file, first get dry sounding and 
-!  calculate base state
-
-  dry_sounding = .true.
-  IF ( wrf_dm_on_monitor() ) THEN
-  write(6,*) ' getting dry sounding for base state '
-
-  CALL get_sounding( zk, p_in, pd_in, theta, rho, u, v, qv, dry_sounding, nl_max, nl_in )
-  ENDIF
-  CALL wrf_dm_bcast_real( zk , nl_max )
-  CALL wrf_dm_bcast_real( p_in , nl_max )
-  CALL wrf_dm_bcast_real( pd_in , nl_max )
-  CALL wrf_dm_bcast_real( theta , nl_max )
-  CALL wrf_dm_bcast_real( rho , nl_max )
-  CALL wrf_dm_bcast_real( u , nl_max )
-  CALL wrf_dm_bcast_real( v , nl_max )
-  CALL wrf_dm_bcast_real( qv , nl_max )
-  CALL wrf_dm_bcast_integer ( nl_in , 1 ) 
-
-  write(6,*) ' returned from reading sounding, nl_in is ',nl_in
-
-!  find ptop for the desired ztop (ztop is input from the namelist),
-!  and find surface pressure
-
-  grid%p_top = interp_0( p_in, zk, config_flags%ztop, nl_in )
-
-!!MARS
-!!MARS
-  open(unit=14,file='input_coord',form='formatted',status='old')
-  rewind(14)
-  read(14,*) lon_input
-  read(14,*) lat_input
-  close(14)
-  write(6,*) ' lon is ',lon_input
-  write(6,*) ' lat is ',lat_input
-!!MARS
-!!MARS
-
-!!MARS
-!!MARS
-  open(unit=18,file='input_more',form='formatted',status='old')
-  rewind(18)
-  read(18,*) alt_input, tsurf_input
-  close(18)
-  write(6,*) ' alt is ',alt_input
-  write(6,*) ' tsurf is ',tsurf_input
-!!MARS
-!!MARS
-
-  DO j=jts,jte
-  DO i=its,ite
-!!MARS
-    grid%ht(i,j) = alt_input
-    grid%tsk(i,j) = tsurf_input
-!!MARS
-    grid%xlat(i,j) = lat_input
-    grid%xlong(i,j) = lon_input
-    grid%mars_emiss(i,j)=0.95
-    grid%mars_cice(i,j)=0.
-    grid%slpx(i,j) = 0.
-    grid%slpy(i,j) = 0.
-!!MARS
-  ENDDO
-  ENDDO
-
-!   print *, 'coucou'
-!   stop
-
-
-  xs=ide/2 -3
-  xs=ids   -3
-  xe=xs + 6
-  ys=jde/2 -3
-  ye=ys + 6
-  mtn_ht = 500
-#ifdef MTN
-  DO j=max(ys,jds),min(ye,jde-1)
-  DO i=max(xs,ids),min(xe,ide-1)
-     grid%ht(i,j) = mtn_ht * 0.25 * &
-               ( 1. + COS ( 2*pi/(xe-xs) * ( i-xs ) + pi ) ) * &
-               ( 1. + COS ( 2*pi/(ye-ys) * ( j-ys ) + pi ) )
-  ENDDO
-  ENDDO
-#endif
-#ifdef EW_RIDGE
-  DO j=max(ys,jds),min(ye,jde-1)
-  DO i=ids,ide
-     grid%ht(i,j) = mtn_ht * 0.50 * &
-               ( 1. + COS ( 2*pi/(ye-ys) * ( j-ys ) + pi ) )
-  ENDDO
-  ENDDO
-#endif
-#ifdef NS_RIDGE
-  DO j=jds,jde
-  DO i=max(xs,ids),min(xe,ide-1)
-     grid%ht(i,j) = mtn_ht * 0.50 * &
-               ( 1. + COS ( 2*pi/(xe-xs) * ( i-xs ) + pi ) )
-  ENDDO
-  ENDDO
-#endif
-  DO j=jts,jte
-  DO i=its,ite
-    grid%em_phb(i,1,j) = g * grid%ht(i,j)
-    grid%em_ph0(i,1,j) = g * grid%ht(i,j)
-  ENDDO
-  ENDDO
-
-  DO J = jts, jte
-  DO I = its, ite
-
-    p_surf = interp_0( p_in, zk, grid%em_phb(i,1,j)/g, nl_in )
-    grid%em_mub(i,j) = p_surf-grid%p_top
-
-!  this is dry hydrostatic sounding (base state), so given grid%em_p (coordinate),
-!  interp theta (from interp) and compute 1/rho from eqn. of state
-
-    DO K = 1, kte-1
-      p_level = grid%em_znu(k)*(p_surf - grid%p_top) + grid%p_top
-      grid%em_pb(i,k,j) = p_level
-      grid%em_t_init(i,k,j) = interp_0( theta, p_in, p_level, nl_in ) - t0
-      grid%em_alb(i,k,j) = (r_d/p1000mb)*(grid%em_t_init(i,k,j)+t0)*(grid%em_pb(i,k,j)/p1000mb)**cvpm
-    ENDDO
-
-!  calc hydrostatic balance (alternatively we could interp the geopotential from the
-!  sounding, but this assures that the base state is in exact hydrostatic balance with
-!  respect to the model eqns.
-
-    DO k  = 2,kte
-      grid%em_phb(i,k,j) = grid%em_phb(i,k-1,j) - grid%em_dnw(k-1)*grid%em_mub(i,j)*grid%em_alb(i,k-1,j)
-    ENDDO
-
-  ENDDO
-  ENDDO
-
-  IF ( wrf_dm_on_monitor() ) THEN
-    write(6,*) ' ptop is ',grid%p_top
-    write(6,*) ' base state grid%em_mub(1,1), p_surf is ',grid%em_mub(1,1),grid%em_mub(1,1)+grid%p_top
-  ENDIF
-
-!  calculate full state for each column - this includes moisture.
-
-  write(6,*) ' getting moist sounding for full state '
-  dry_sounding = .false.
-  CALL get_sounding( zk, p_in, pd_in, theta, rho, u, v, qv, dry_sounding, nl_max, nl_in )
-
-  DO J = jts, min(jde-1,jte)
-  DO I = its, min(ide-1,ite)
-
-!  At this point grid%p_top is already set. find the DRY mass in the column 
-!  by interpolating the DRY pressure.  
-
-   pd_surf = interp_0( pd_in, zk, grid%em_phb(i,1,j)/g, nl_in )
-
-!  compute the perturbation mass and the full mass
-
-    grid%em_mu_1(i,j) = pd_surf-grid%p_top - grid%em_mub(i,j)
-    grid%em_mu_2(i,j) = grid%em_mu_1(i,j)
-    grid%em_mu0(i,j) = grid%em_mu_1(i,j) + grid%em_mub(i,j)
-
-! given the dry pressure and coordinate system, interp the potential
-! temperature and qv
-
-    do k=1,kde-1
-
-      p_level = grid%em_znu(k)*(pd_surf - grid%p_top) + grid%p_top
-
-      moist(i,k,j,P_QV) = interp_0( qv, pd_in, p_level, nl_in )
-      grid%em_t_1(i,k,j)          = interp_0( theta, pd_in, p_level, nl_in ) - t0
-      grid%em_t_2(i,k,j)          = grid%em_t_1(i,k,j)
-      
-
-    enddo
-
-!  integrate the hydrostatic equation (from the RHS of the bigstep
-!  vertical momentum equation) down from the top to get grid%em_p.
-!  first from the top of the model to the top pressure
-
-    k = kte-1  ! top level
-
-    qvf1 = 0.5*(moist(i,k,j,P_QV)+moist(i,k,j,P_QV))
-    qvf2 = 1./(1.+qvf1)
-    qvf1 = qvf1*qvf2
-
-!    grid%em_p(i,k,j) = - 0.5*grid%em_mu_1(i,j)/grid%em_rdnw(k)
-    grid%em_p(i,k,j) = - 0.5*(grid%em_mu_1(i,j)+qvf1*grid%em_mub(i,j))/grid%em_rdnw(k)/qvf2
-    qvf = 1. + rvovrd*moist(i,k,j,P_QV)
-    grid%em_alt(i,k,j) = (r_d/p1000mb)*(grid%em_t_1(i,k,j)+t0)*qvf* &
-                (((grid%em_p(i,k,j)+grid%em_pb(i,k,j))/p1000mb)**cvpm)
-    grid%em_al(i,k,j) = grid%em_alt(i,k,j) - grid%em_alb(i,k,j)
-
-!  down the column
-
-    do k=kte-2,1,-1
-      qvf1 = 0.5*(moist(i,k,j,P_QV)+moist(i,k+1,j,P_QV))
-      qvf2 = 1./(1.+qvf1)
-      qvf1 = qvf1*qvf2
-      grid%em_p(i,k,j) = grid%em_p(i,k+1,j) - (grid%em_mu_1(i,j) + qvf1*grid%em_mub(i,j))/qvf2/grid%em_rdn(k+1)
-      qvf = 1. + rvovrd*moist(i,k,j,P_QV)
-      grid%em_alt(i,k,j) = (r_d/p1000mb)*(grid%em_t_1(i,k,j)+t0)*qvf* &
-                  (((grid%em_p(i,k,j)+grid%em_pb(i,k,j))/p1000mb)**cvpm)
-      grid%em_al(i,k,j) = grid%em_alt(i,k,j) - grid%em_alb(i,k,j)
-    enddo
-
-!  this is the hydrostatic equation used in the model after the
-!  small timesteps.  In the model, grid%em_al (inverse density)
-!  is computed from the geopotential.
-
-
-    grid%em_ph_1(i,1,j) = 0.
-    DO k  = 2,kte
-      grid%em_ph_1(i,k,j) = grid%em_ph_1(i,k-1,j) - (1./grid%em_rdnw(k-1))*(       &
-                   (grid%em_mub(i,j)+grid%em_mu_1(i,j))*grid%em_al(i,k-1,j)+ &
-                    grid%em_mu_1(i,j)*grid%em_alb(i,k-1,j)  )
-                                                   
-      grid%em_ph_2(i,k,j) = grid%em_ph_1(i,k,j) 
-      grid%em_ph0(i,k,j) = grid%em_ph_1(i,k,j) + grid%em_phb(i,k,j)
-    ENDDO
-
-    IF ( wrf_dm_on_monitor() ) THEN
-    if((i==2) .and. (j==2)) then
-     write(6,*) ' grid%em_ph_1 calc ',grid%em_ph_1(2,1,2),grid%em_ph_1(2,2,2),&
-                              grid%em_mu_1(2,2)+grid%em_mub(2,2),grid%em_mu_1(2,2), &
-                              grid%em_alb(2,1,2),grid%em_al(1,2,1),grid%em_rdnw(1)
-    endif
-    ENDIF
-
-  ENDDO
-  ENDDO
-
-!#if 0
-
-!  thermal perturbation to kick off convection
-
-  write(6,*) ' nxc, nyc for perturbation ',nxc,nyc
-  write(6,*) ' delt for perturbation ',delt
-
-  DO J = jts, min(jde-1,jte)
-!    yrad = config_flags%dy*float(j-nyc)/10000.
-!! NO FUCKIN' BUBBLE !!
-yrad = 0.
-    DO I = its, min(ide-1,ite)
-!      xrad = config_flags%dx*float(i-nxc)/10000.
-!! NO FUCKIN' BUBBLE !!
-xrad = 0.
-      DO K = 1, kte-1
-
-!  put in preturbation theta (bubble) and recalc density.  note,
-!  the mass in the column is not changing, so when theta changes,
-!  we recompute density and geopotential
-
-!        zrad = 0.5*(grid%em_ph_1(i,k,j)+grid%em_ph_1(i,k+1,j)  &
-!                   +grid%em_phb(i,k,j)+grid%em_phb(i,k+1,j))/g
-!        zrad = (zrad-1500.)/1500.
-!! NO FUCKIN' BUBBLE !!
-zrad = 0.        
-        RAD=SQRT(xrad*xrad+yrad*yrad+zrad*zrad)
-        IF(RAD <= 1.) THEN
-!! NO FUCKIN' BUBBLE !!
-!           grid%em_t_1(i,k,j)=grid%em_t_1(i,k,j)+delt*COS(.5*PI*RAD)**2
-           grid%em_t_2(i,k,j)=grid%em_t_1(i,k,j)
-           qvf = 1. + rvovrd*moist(i,k,j,P_QV)
-           grid%em_alt(i,k,j) = (r_d/p1000mb)*(grid%em_t_1(i,k,j)+t0)*qvf* &
-                        (((grid%em_p(i,k,j)+grid%em_pb(i,k,j))/p1000mb)**cvpm)
-           grid%em_al(i,k,j) = grid%em_alt(i,k,j) - grid%em_alb(i,k,j)
-        ENDIF
-      ENDDO
-
-!  rebalance hydrostatically
-
-      DO k  = 2,kte
-        grid%em_ph_1(i,k,j) = grid%em_ph_1(i,k-1,j) - (1./grid%em_rdnw(k-1))*(       &
-                     (grid%em_mub(i,j)+grid%em_mu_1(i,j))*grid%em_al(i,k-1,j)+ &
-                      grid%em_mu_1(i,j)*grid%em_alb(i,k-1,j)  )
-                                                   
-        grid%em_ph_2(i,k,j) = grid%em_ph_1(i,k,j) 
-        grid%em_ph0(i,k,j) = grid%em_ph_1(i,k,j) + grid%em_phb(i,k,j)
-      ENDDO
-
-    ENDDO
-  ENDDO
-
-!#endif
-
-   IF ( wrf_dm_on_monitor() ) THEN
-   write(6,*) ' grid%em_mu_1 from comp ', grid%em_mu_1(1,1)
-   write(6,*) ' full state sounding from comp, ph, grid%em_p, grid%em_al, grid%em_t_1, qv '
-   do k=1,kde-1
-     write(6,'(i3,1x,5(1x,1pe10.3))') k, grid%em_ph_1(1,k,1)+grid%em_phb(1,k,1), &
-                                      grid%em_p(1,k,1)+grid%em_pb(1,k,1), grid%em_alt(1,k,1), &
-                                      grid%em_t_1(1,k,1)+t0, moist(1,k,1,P_QV)
-   enddo
-
-   write(6,*) ' pert state sounding from comp, grid%em_ph_1, pp, alp, grid%em_t_1, qv '
-   do k=1,kde-1
-     write(6,'(i3,1x,5(1x,1pe10.3))') k, grid%em_ph_1(1,k,1), &
-                                      grid%em_p(1,k,1), grid%em_al(1,k,1), &
-                                      grid%em_t_1(1,k,1), moist(1,k,1,P_QV)
-   enddo
-   ENDIF
-
-! interp v
-
-  DO J = jts, jte
-  DO I = its, min(ide-1,ite)
-
-    IF (j == jds) THEN
-      z_at_v = grid%em_phb(i,1,j)/g
-    ELSE IF (j == jde) THEN
-      z_at_v = grid%em_phb(i,1,j-1)/g
-    ELSE
-      z_at_v = 0.5*(grid%em_phb(i,1,j)+grid%em_phb(i,1,j-1))/g
-    END IF
-    p_surf = interp_0( p_in, zk, z_at_v, nl_in )
-
-    DO K = 1, kte-1
-      p_level = grid%em_znu(k)*(p_surf - grid%p_top) + grid%p_top
-      grid%em_v_1(i,k,j) = interp_0( v, p_in, p_level, nl_in )
-      grid%em_v_2(i,k,j) = grid%em_v_1(i,k,j)
-    ENDDO
-
-  ENDDO
-  ENDDO
-
-! interp u
-
-  DO J = jts, min(jde-1,jte)
-  DO I = its, ite
-
-    IF (i == ids) THEN
-      z_at_u = grid%em_phb(i,1,j)/g
-    ELSE IF (i == ide) THEN
-      z_at_u = grid%em_phb(i-1,1,j)/g
-    ELSE
-      z_at_u = 0.5*(grid%em_phb(i,1,j)+grid%em_phb(i-1,1,j))/g
-    END IF
-
-    p_surf = interp_0( p_in, zk, z_at_u, nl_in )
-
-    DO K = 1, kte-1
-      p_level = grid%em_znu(k)*(p_surf - grid%p_top) + grid%p_top
-      grid%em_u_1(i,k,j) = interp_0( u, p_in, p_level, nl_in )
-      grid%em_u_2(i,k,j) = grid%em_u_1(i,k,j)
-    ENDDO
-
-  ENDDO
-  ENDDO
-
-!  set w
-
-  DO J = jts, min(jde-1,jte)
-  DO K = kts, kte
-  DO I = its, min(ide-1,ite)
-    grid%em_w_1(i,k,j) = 0.
-    grid%em_w_2(i,k,j) = 0.
-  ENDDO
-  ENDDO
-  ENDDO
-
-!  set a few more things
-
-  DO J = jts, min(jde-1,jte)
-  DO K = kts, kte-1
-  DO I = its, min(ide-1,ite)
-    grid%h_diabatic(i,k,j) = 0.
-  ENDDO
-  ENDDO
-  ENDDO
-
-  IF ( wrf_dm_on_monitor() ) THEN
-  DO k=1,kte-1
-    grid%em_t_base(k) = grid%em_t_1(1,k,1)
-    grid%qv_base(k) = moist(1,k,1,P_QV)
-    grid%u_base(k) = grid%em_u_1(1,k,1)
-    grid%v_base(k) = grid%em_v_1(1,k,1)
-    grid%z_base(k) = 0.5*(grid%em_phb(1,k,1)+grid%em_phb(1,k+1,1)+grid%em_ph_1(1,k,1)+grid%em_ph_1(1,k+1,1))/g
-  ENDDO
-  ENDIF
-  CALL wrf_dm_bcast_real( grid%em_t_base , kte )
-  CALL wrf_dm_bcast_real( grid%qv_base , kte )
-  CALL wrf_dm_bcast_real( grid%u_base , kte )
-  CALL wrf_dm_bcast_real( grid%v_base , kte )
-  CALL wrf_dm_bcast_real( grid%z_base , kte )
-
-  DO J = jts, min(jde-1,jte)
-  DO I = its, min(ide-1,ite)
-     thtmp   = grid%em_t_2(i,1,j)+t0
-     ptmp    = grid%em_p(i,1,j)+grid%em_pb(i,1,j)
-     temp(1) = thtmp * (ptmp/p1000mb)**rcp
-     thtmp   = grid%em_t_2(i,2,j)+t0
-     ptmp    = grid%em_p(i,2,j)+grid%em_pb(i,2,j)
-     temp(2) = thtmp * (ptmp/p1000mb)**rcp
-     thtmp   = grid%em_t_2(i,3,j)+t0
-     ptmp    = grid%em_p(i,3,j)+grid%em_pb(i,3,j)
-     temp(3) = thtmp * (ptmp/p1000mb)**rcp
-
-!!MARS
-!     grid%tsk(I,J)=grid%cf1*temp(1)+grid%cf2*temp(2)+grid%cf3*temp(3)
-     grid%tmn(I,J)=grid%tsk(I,J)-0.5
-!!!MARS
-!!TODO: passer la valeur a partir des donnees
-!grid%mars_tsoil(I,:,J)=grid%tsk(I,J)
-!!!MARS
-  ENDDO
-  ENDDO
-
- END SUBROUTINE init_domain_rk
-
-   SUBROUTINE init_module_initialize
-   END SUBROUTINE init_module_initialize
-
-!---------------------------------------------------------------------
-
-!  test driver for get_sounding
-!
-!      implicit none
-!      integer n
-!      parameter(n = 1000)
-!      real zk(n),p(n),theta(n),rho(n),u(n),v(n),qv(n),pd(n)
-!      logical dry
-!      integer nl,k
-!
-!      dry = .false.
-!      dry = .true.
-!      call get_sounding( zk, p, pd, theta, rho, u, v, qv, dry, n, nl )
-!      write(6,*) ' input levels ',nl
-!      write(6,*) ' sounding '
-!      write(6,*) '  k  height(m)  press (Pa) pd(Pa) theta (K) den(kg/m^3)  u(m/s)     v(m/s)    qv(g/g) '
-!      do k=1,nl
-!        write(6,'(1x,i3,8(1x,1pe10.3))') k, zk(k), p(k), pd(k), theta(k), rho(k), u(k), v(k), qv(k)
-!      enddo
-!      end
-!
-!---------------------------------------------------------------------------
-
-      subroutine get_sounding( zk, p, p_dry, theta, rho, &
-                               u, v, qv, dry, nl_max, nl_in )
-      implicit none
-
-      integer nl_max, nl_in
-      real zk(nl_max), p(nl_max), theta(nl_max), rho(nl_max), &
-           u(nl_max), v(nl_max), qv(nl_max), p_dry(nl_max)
-      logical dry
-
-      integer n
-      parameter(n=1000)
-      logical debug
-      parameter( debug = .true.)
-
-! input sounding data
-
-      real p_surf, th_surf, qv_surf
-      real pi_surf, pi(n)
-      real h_input(n), th_input(n), qv_input(n), u_input(n), v_input(n)
-
-      !! special MARS
-      real r_input(n)
-      real cp_input(n)
-      real cv_input(n)
-      real cvpm_input(n)
-      real pfile_input(n)
-      real t_input(n)
-      real rhofile_input(n)
-      !! special MARS
-
-! diagnostics
-
-      real rho_surf, p_input(n), rho_input(n)
-      real pm_input(n)  !  this are for full moist sounding
-
-! local data
-
-      real p1000mb,cv,cp,r,cvpm,g
-!      parameter (p1000mb = 1.e+05, r = 287, cp = 1003., cv = cp-r, cvpm = -cv/cp, g=9.81 )
-      parameter (p1000mb = 610., r = 192., cp = 844.6, cv = cp-r, cvpm = -cv/cp, g=3.72)
-      integer k, it, nl
-      real qvf, qvf1, dz
-
-!  first, read the sounding
-
-      call read_sounding( p_surf, th_surf, qv_surf, &
-                          h_input, th_input, qv_input, u_input, v_input, r_input, cp_input, pfile_input, t_input, rhofile_input, n, nl, debug )
-
-
-      !! special MARS
-      do k=1,nl
-        cv_input(k) = cp_input(k) - r_input(k)
-        cvpm_input(k) = - cv_input(k) / cp_input(k)
-      enddo
-      !! special MARS
-
-      if(dry) then
-       do k=1,nl
-         qv_input(k) = 0.
-       enddo
-      endif
-
-      if(debug) write(6,*) ' number of input levels = ',nl
-
-        nl_in = nl
-        if(nl_in .gt. nl_max ) then
-          write(6,*) ' too many levels for input arrays ',nl_in,nl_max
-          call wrf_error_fatal ( ' too many levels for input arrays ' )
-        end if
-
-!  compute diagnostics,
-!  first, convert qv(g/kg) to qv(g/g)
-
-      do k=1,nl
-        qv_input(k) = 0.001*qv_input(k)
-      enddo
-
-      p_surf = 100.*p_surf  ! convert to pascals
-      qvf = 1. + rvovrd*qv_input(1) 
-!      rho_surf = 1./((r/p1000mb)*th_surf*qvf*((p_surf/p1000mb)**cvpm))
-!      pi_surf = (p_surf/p1000mb)**(r/cp)
-      rho_surf =  1./((r_input(1)/p1000mb)*th_surf*qvf*((p_surf/p1000mb)**cvpm_input(1)))
-      pi_surf = (p_surf/p1000mb)**(r_input(1)/cp_input(1))
-
-
-      if(debug) then
-        write(6,*) ' surface density is ',rho_surf
-        write(6,*) ' surface pi is      ',pi_surf
-      end if
-
-
-!  integrate moist sounding hydrostatically, starting from the
-!  specified surface pressure
-!  -> first, integrate from surface to lowest level
-
-          qvf = 1. + rvovrd*qv_input(1) 
-          qvf1 = 1. + qv_input(1)
-          rho_input(1) = rho_surf
-          dz = h_input(1)
-          do it=1,10
-!!MARS MARS
-            pm_input(1) = p_surf !&
-!                    - 0.5*dz*(rho_surf+rho_input(1))*g*qvf1
-!            rho_input(1) = 1./((r/p1000mb)*th_input(1)*qvf*((pm_input(1)/p1000mb)**cvpm))
-!! special MARS
-             rho_input(1) = 1./((r_input(1)/p1000mb)*th_input(1)*qvf*((pm_input(1)/p1000mb)**cvpm_input(1)))
-          enddo
-
-! integrate up the column
-
-          do k=2,nl
-            rho_input(k) = rho_input(k-1)
-!            dz = h_input(k)-h_input(k-1)
-! special MARS
-            dz = r_input(k) * t_input(k) * (- p_input(k) + p_input(k-1)) / p_input(k) / g
-!            dz = - cp_input(k) * (- t_input(k) + t_input(k-1)) / g
-            qvf1 = 0.5*(2.+(qv_input(k-1)+qv_input(k)))
-            qvf = 1. + rvovrd*qv_input(k)   ! qv is in g/kg here
- 
-            do it=1,10
-              pm_input(k) = pm_input(k-1) &
-                      - 0.5*dz*(rho_input(k)+rho_input(k-1))*g*qvf1
-!              rho_input(k) = 1./((r/p1000mb)*th_input(k)*qvf*((pm_input(k)/p1000mb)**cvpm))
-!! special MARS
-              rho_input(k) = 1./((r_input(k)/p1000mb)*th_input(k)*qvf*((pm_input(k)/p1000mb)**cvpm_input(k)))
-              !!
-      print *, p_input(k), pm_input(k), ((r_input(k)/p1000mb)*th_input(k)*qvf*((pm_input(k)/p1000mb)**cvpm_input(k))), k          
-            enddo
-          enddo
-
-!  we have the moist sounding
-
-!  next, compute the dry sounding using p at the highest level from the
-!  moist sounding and integrating down.
-
-        p_input(nl) = pm_input(nl)
-
-          do k=nl-1,1,-1
-            dz = h_input(k+1)-h_input(k)
-            p_input(k) = p_input(k+1) + 0.5*dz*(rho_input(k)+rho_input(k+1))*g
-          enddo
-
-
-        do k=1,nl
-
-          zk(k) = h_input(k)
-          !p(k) = pm_input(k)
-          !p_dry(k) = p_input(k)
-          p(k) = pfile_input(k)
-          p_dry(k) = pfile_input(k)
-          theta(k) = th_input(k)
-          !rho(k) = rho_input(k)
-          rho(k) = rhofile_input(k)
-          u(k) = u_input(k)
-          v(k) = v_input(k)
-          qv(k) = qv_input(k)
-
-        enddo
-
-     if(debug) then
-      write(6,*) ' sounding '
-      write(6,*) '  k  height(m)  press (Pa) pd(Pa) theta (K) den(kg/m^3)  u(m/s)     v(m/s)    qv(g/g) '
-      do k=1,nl
-        write(6,'(1x,i3,8(1x,1pe10.3))') k, zk(k), p(k), p_dry(k), theta(k), rho(k), u(k), v(k), qv(k)
-      enddo
-
-     end if
-
-      end subroutine get_sounding
-
-!-------------------------------------------------------
-
-      subroutine read_sounding( ps,ts,qvs,h,th,qv,u,v,r,cp,p,t,rho,n,nl,debug )
-      implicit none
-      integer n,nl
-      real ps,ts,qvs,h(n),th(n),qv(n),u(n),v(n),r(n),cp(n),p(n),t(n),rho(n) 
-      logical end_of_file
-      logical debug
-
-      integer k
-
-      open(unit=10,file='input_sounding',form='formatted',status='old')
-      rewind(10)
-      read(10,*) ps, ts, qvs
-      if(debug) then
-        write(6,*) ' input sounding surface parameters '
-        write(6,*) ' surface pressure (mb) ',ps
-        write(6,*) ' surface pot. temp (K) ',ts
-        write(6,*) ' surface mixing ratio (g/kg) ',qvs
-      end if
-
-      end_of_file = .false.
-      k = 0
-
-      do while (.not. end_of_file)
-
-        read(10,*,end=100) h(k+1), th(k+1), qv(k+1), u(k+1), v(k+1)
-        k = k+1
-        if(debug) write(6,'(1x,i3,5(1x,e10.3))') k, h(k), th(k), qv(k), u(k), v(k)
-        go to 110
- 100    end_of_file = .true.
- 110    continue
-      enddo
-
-
-      !!! special MARS
-      open(unit=11,file='input_therm',form='formatted',status='old')
-      rewind(11)
-      end_of_file = .false.
-      k = 0
-      do while (.not. end_of_file)
-
-        read(11,*,end=101) r(k+1), cp(k+1), p(k+1), rho(k+1), t(k+1) 
-        write(*,*) k, r(k+1), cp(k+1), p(k+1), rho(k+1), t(k+1)
-        k = k+1
-        go to 112
- 101    end_of_file = .true.
- 112    continue
-      enddo
-      !!! special MARS
-
-
-
-      nl = k
-
-      close(unit=10,status = 'keep')
-
-      end subroutine read_sounding
-
-END MODULE module_initialize
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/estimations
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/estimations	(revision 206)
+++ 	(revision )
@@ -1,4 +1,0 @@
-\item (base) 64 bits, 1 processeur, domaine 50x50x50, résolution 7 km, sans traceurs : 0.4 h/jour.
-\item (traceurs) 64 bits, 4 processeurs, domaine 201x201x61, résolution 20km, 2 traceurs : 8 h/jour.
-\item (domaines emboîtés) 64 bits, 4 processeurs, 3 domaines 155x155x61, résolutions 36 km, 9 km, 2 km, sans traceurs : 20 h/jour.
-\item (LES) 64 bits, 1 processeur, domaine 150x150x71, résolution 100 m, sans traceurs :  11 h/h.
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/gnu_64.configure
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/gnu_64.configure	(revision 206)
+++ 	(revision )
@@ -1,4 +1,0 @@
-  14.  PC Linux x86_64 (IA64 and AMD Opteron), GNU Fortran compiler, DM-Parallel  (RSL, MPICH, Allows nesting)
-  15.  PC Linux x86_64 (IA64 and Opteron), GNU Fortran compiler   (Single-threaded, RSL, Allows nesting)
-  16.  PC Linux x86_64 (IA64 and Opteron), GNU Fortran compiler  DM-Parallel (RSL_LITE, OpenMPI, Allows nesting)
-
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/gnu_64.configure.wrf
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/gnu_64.configure.wrf	(revision 206)
+++ 	(revision )
@@ -1,256 +1,0 @@
-# configure.wrf
-#
-# This file was automatically generated by the configure script in the
-# top level directory. You may make changes to the settings in this
-# file but be aware they will be overwritten each time you run configure.
-# Ordinarily, it is necessary to run configure once, when the code is
-# first installed.
-#
-# To permanently change options, change the settings for your platform
-# in the file arch/configure.defaults then rerun configure.
-#
-SHELL           =       /bin/sh
-DEVTOP          =       `pwd`
-LIBINCLUDE      =       .
-.SUFFIXES: .F .i .o .f90 .c
-
-#### Get core settings from environment (set in compile script)
-#### Note to add a core, this has to be added to.
-
-COREDEFS = -DEM_CORE=$(WRF_EM_CORE) \
-           -DNMM_CORE=$(WRF_NMM_CORE) -DNMM_MAX_DIM=2600 \
-	   -DCOAMPS_CORE=$(WRF_COAMPS_CORE) \
-           -DEXP_CORE=$(WRF_EXP_CORE)
-
-#### Single location for defining total number of domains.  You need
-#### at least 1 + 2*(number of total nests).  For example, 1 coarse
-#### grid + three fine grids = 1 + 2(3) = 7, so MAX_DOMAINS=7.
-
-MAX_DOMAINS	=	21
-
-#### DM buffer length for the configuration flags.
-
-CONFIG_BUF_LEN	=	16384
-
-
-##############################################################################
-#### The settings in this section are defaults that may be overridden by the 
-#### architecture-specific settings in the next section.  
-##############################################################################
-
-##############################################################################
-#### NOTE:  Do not modify these default values here.  To override these 
-####        values, make changes after "Architecture specific settings".  
-##############################################################################
-
-#### Native size (in bytes) of Fortran REAL data type on this architecture ####
-#### Note:  to change real wordsize (for example, to promote REALs from 
-####        4-byte to 8-byte), modify the definition of RWORDSIZE in the 
-####        section following "Architecture specific settings".  Do not 
-####        change NATIVE_RWORDSIZE as is it architecture-specific.  
-NATIVE_RWORDSIZE = 4
-
-#### Default sed command and script for Fortran source files ####
-SED_FTN = sed -f ../arch/standard.sed
-
-# Hack to work around $(PWD) not changing during OSF1 build.  
-# $(IO_GRIB_SHARE_DIR) is reset during the OSF1 build only.  
-IO_GRIB_SHARE_DIR = 
-
-#### ESMF switches                 ####
-#### These are set up by Config.pl ####
-# switch to use separately installed ESMF library for coupling:  1==true
-ESMF_COUPLING       = 0
-# select dependences on module_utility.o
-ESMF_MOD_DEPENDENCE = ../external/esmf_time_f90/module_utility.o
-# select -I options for separately installed ESMF library, if present
-ESMF_MOD_INC        = 
-# select -I options for external/io_esmf vs. external/esmf_time_f90
-ESMF_IO_INC         = -I../external/esmf_time_f90
-# select cpp token for external/io_esmf vs. external/esmf_time_f90
-ESMF_IO_DEFS        = 
-# select build target for external/io_esmf vs. external/esmf_time_f90
-ESMF_TARGET         = esmf_time
-
-##############################################################################
-
-
-#### Architecture specific settings ####
-
-# Settings for PC Linux x86_64 (IA64 and Opteron), GNU Fortran compiler   (Single-threaded, RSL, Allows nesting)
-#
-DMPARALLEL      =       1
-MAX_PROC        =       1024
-FC              =       gfortran
-LD              =       gfortran
-CC              =       gcc -DFSEEKO64_OK 
-SCC		=	$(CC)
-SFC             =       gfortran
-RWORDSIZE       =       $(NATIVE_RWORDSIZE)
-FCOPTIM		=       #-O3 -funroll-loops #-ftree-vectorize -ftree-loop-linear
-FCDEBUG		=	#-g
-FCBASEOPTS      =       -fno-second-underscore -w $(FCDEBUG) -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4
-FCFLAGS         =       $(FCOPTIM) $(FCBASEOPTS)
-ARCHFLAGS       =       -DGRIB1 -DINTIO -DWRF_RSL_IO -DRSL -DDM_PARALLEL \
-                        -DIWORDSIZE=4 -DDWORDSIZE=8 -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=4 -DNETCDF \
-			-DLIMIT_ARGS -DSTUBMPI
-PROMOTION	=
-CFLAGS          =       -DLANDREADSTUB -DDM_PARALLEL -DWRF_RSL_IO \
-                        -DMAXDOM_MAKE=$(MAX_DOMAINS) -DMAXPROC_MAKE=$(MAX_PROC) -I../external/RSL/RSL $(ARCHFLAGS)
-# machine-specific flags needed to link in ESMF library (C++ run-time-library, etc.)
-ESMF_LIB_FLAGS  =       
-ESMF_IO_LIB     =       -L../external/esmf_time_f90 -lesmf_time
-ESMF_IO_LIB_EXT =       -L../../external/esmf_time_f90 -lesmf_time
-INCLUDE_MODULES =       -J../main -I../main -I../external/io_netcdf -I../external/io_int -I../external/esmf_time_f90 \
-                        -I../external -I../frame -I../share -I../phys -I../chem -I../inc
-PERL            =       perl
-REGISTRY        =       Registry
-LIB             =       -L../external/io_netcdf -lwrfio_nf -L/donnees/aslmd/MODELES/NETCDF/gfortran_64/netcdf-3.6.1//lib -lnetcdf -L../external/RSL/RSL -lrsl \
-                        -L../external/io_grib1 -lio_grib1 \
-			-L../external/io_int -lwrfio_int \
-			-L../external/io_grib_share -lio_grib_share \
-			../frame/module_internal_header_util.o ../frame/pack_utils.o -L../external/esmf_time_f90 -lesmf_time -L../mars_lmd/libo -llmd /donnees/aslmd/MODELES/NETCDF/gfortran_64/netcdf-3.6.1//lib/libnetcdf.a 
-LDFLAGS         =       $(FCFLAGS)  -fconvert=big-endian
-ENVCOMPDEFS	=	
-WRF_CHEM	=	0 
-CPP             =       /lib/cpp -C -P -traditional
-POUND_DEF	=	-DNO_RRTM_PHYSICS  $(COREDEFS) -DNONSTANDARD_SYSTEM -DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN) -DMAX_DOMAINS_F=$(MAX_DOMAINS)
-CPPFLAGS        =       -I$(LIBINCLUDE) -C -P $(ARCHFLAGS) -I../external/RSL/RSL -C -P `cat ../inc/dm_comm_cpp_flags` $(ENVCOMPDEFS) $(POUND_DEF)
-AR              =       ar ru
-M4              =       m4 -B 14000
-RANLIB          =       ranlib
-NETCDFPATH	=	/donnees/aslmd/MODELES/NETCDF/gfortran_64/netcdf-3.6.1/
-CC_TOOLS        =       cc
-
-externals : wrf_ioapi_includes wrfio_nf wrfio_grib_share wrfio_grib1 ../external/RSL/RSL/librsl.a wrfio_int gen_comms.c module_dm.F esmf_time
-
-gen_comms.c : ../external/RSL/gen_comms.c
-	( /bin/cp ../tools/gen_comms_warning ../tools/gen_comms.c ; \
-          cat ../external/RSL/gen_comms.c >> ../tools/gen_comms.c )
-
-module_dm.F : ../external/RSL/module_dm.F
-	( /bin/cp module_dm_warning module_dm.F ; cat ../external/RSL/module_dm.F >> module_dm.F )
-
-wrfio_nf : 
-	( cd ../external/io_netcdf ; \
-	  make NETCDFPATH=/donnees/aslmd/MODELES/NETCDF/gfortran_64/netcdf-3.6.1/ RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(FC) $(PROMOTION) $(FCFLAGS) -w" TRADFLAG="-traditional" )
-
-wrfio_grib_share :
-	( cd ../external/io_grib_share ; \
-          make CC="$(SCC)" CFLAGS="$(CFLAGS)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
-
-wrfio_grib1 :
-	( cd ../external/io_grib1 ; \
-          make CC="$(SCC)" CFLAGS="$(CFLAGS)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
-
-wrfio_grib2 :
-	( cd ../external/io_grib2 ; \
-          make CC="$(SCC)" CFLAGS="$(CFLAGS) " RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" FIXED="-Mfixed" archive)
-
-wrfio_int : 
-	( cd ../external/io_int ; \
-          make CC="$(CC)" RANLIB="$(RANLIB)" CPP="$(CPP)" SFC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" FC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" all )
-
-esmf_time : 
-	( cd ../external/esmf_time_f90 ; \
-	  make FC="$(FC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" RANLIB="$(RANLIB)" CPP="$(CPP) -I../../inc -I. $(POUND_DEF)" )
-
-../external/RSL/RSL/librsl.a :
-	( cd ../external/RSL/RSL ; make CC="$(CC)" CFLAGS='-DSTUBS' FC="$(FC) $(PROMOTION)" FFLAGS='' MAX_DOMAINS=$(MAX_DOMAINS) MAX_PROC=$(MAX_PROC) LEARN_BCAST=-DLEARN_BCAST stub )
-
-# compile these without high optimization to speed compile
-solve_interface.o : solve_interface.F
-shift_domain_em.o : shift_domain_em.F
-module_io_mm5.o : module_io_mm5.F
-module_si_io.o : module_si_io.F
-module_io_wrf.o : module_io_wrf.F
-module_domain.o : module_domain.F
-module_start.o : module_start.F
-module_initialize.o : module_initialize.F
-module_initialize_b_wave.o : module_initialize_b_wave.F
-module_initialize_hill2d_x.o : module_initialize_hill2d_x.F
-module_initialize_quarter_ss.o : module_initialize_quarter_ss.F
-module_initialize_squall2d_x.o : module_initialize_squall2d_x.F
-module_initialize_squall2d_y.o : module_initialize_squall2d_y.F
-module_initialize_real.o : module_initialize_real.F
-module_dm.o : module_dm.F
-start_domain.o : start_domain.F
-mediation_integrate.o : mediation_integrate.F
-module_configure.o : module_configure.F
-
-solve_interface.o                                              \
-shift_domain_em.o                                              \
-module_io_mm5.o module_si_io.o module_io_wrf.o module_domain.o \
-module_start.o module_initialize.o module_initialize_b_wave.o  \
-module_initialize_hill2d_x.o module_initialize_quarter_ss.o    \
-module_initialize_squall2d_x.o module_initialize_squall2d_y.o  \
-module_configure.o                                             \
-mediation_integrate.o \
-module_initialize_real.o module_dm.o start_domain.o :
-	$(RM) $@
-	$(SED_FTN) $*.F > $*.b 
-	$(CPP) -I../inc $(CPPFLAGS) $*.b  > $*.f90
-	$(RM) $*.b
-	$(FC) -c $(PROMOTION) $(FCBASEOPTS) $(MODULE_DIRS) $*.f90
-
-
-###########################################################
-
-# These sub-directory builds are identical across all architectures
-wrfio_esmf :
-	( cd ../external/io_esmf ; \
-	make FC="$(FC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS) $(ESMF_MOD_INC)" RANLIB="$(RANLIB)" CPP="$(CPP) $(POUND_DEF) " )
-
-
-#
-#	Macros, these should be generic for all machines
-
-LN	=	ln -sf
-MAKE	=	make -i -r
-RM	= 	rm -f
-
-#	There is probably no reason to modify these rules
-
-wrf_ioapi_includes :
-	( cd ../external/ioapi_share ; \
-	$(MAKE) NATIVE_RWORDSIZE="$(NATIVE_RWORDSIZE)" RWORDSIZE="$(RWORDSIZE)" )
-
-.F.i:
-	$(RM) $@
-	$(CPP) -I../inc $(CPPFLAGS) $*.F > $@
-	mv $*.i $(DEVTOP)/pick/$*.f90
-	cp $*.F $(DEVTOP)/pick
-
-.F.o:
-	$(RM) $@
-	$(SED_FTN) $*.F > $*.b 
-	$(CPP) -I../inc $(CPPFLAGS) $*.b  > $*.f90
-	$(RM) $*.b
-	$(FC) -c $(FCFLAGS) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $*.f90
-#PGI	if [ ! -e $@ ] ; then \
-#PGI	sleep 10 ; $(FC) -c $(FCFLAGS) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $*.f90 ; \
-#PGI	fi
-#PGI	if [ ! -e $@ ] ; then \
-#PGI	sleep 10 ; $(FC) -c $(FCFLAGS) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $*.f90 ; \
-#PGI	fi
-
-.F.f90:
-	$(RM) $@
-	$(SED_FTN) $*.F > $*.b 
-	$(CPP) -I../inc $(CPPFLAGS) $*.b  > $@
-	$(RM) $*.b
-
-.f90.o:
-	$(RM) $@
-	$(FC) -c $(FCFLAGS) $(PROMOTION) $(FCSUFFIX) $*.f90
-#PGI	if [ ! -e $@ ] ; then \
-#PGI	sleep 10 ; $(FC) -c $(FCFLAGS) $(PROMOTION) $(FCSUFFIX) $*.f90 ; \
-#PGI	fi
-#PGI	if [ ! -e $@ ] ; then \
-#PGI	sleep 10 ; $(FC) -c $(FCFLAGS) $(PROMOTION) $(FCSUFFIX) $*.f90 ; \
-#PGI	fi
-
-.c.o:
-	$(RM) $@
-	$(CC) -c $(CFLAGS) $*.c
-
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/gnu_64_single.txt
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/gnu_64_single.txt	(revision 206)
+++ 	(revision )
@@ -1,53 +1,0 @@
-gnu simple en 64 bits sur huchard, etc...
--------------------
-
-choix 99 de makemeso pour le moment
-
-
-**** segmentation fault dans le cas de la montagne 2D ****
-
-
-
-autre possibilite: essayer les librairies NETCDF4.0 d'Ehouarn
-
-
-essai sans O3
-NB: on a juste a modifier SRC/WRFV2/configure.defaults.gfortran64
->>> NE REGLE PAS LE PB
-
-
-IL Y A UN PROBLEME AVEC LES VALEURS CALCULEES...
-ou: Floating exception sur auric
-
-
-../mars_lmd/libo/liblmd.a(physdem1.o): In function `physdem1_':
-physdem1.F:(.text+0x6bb): undefined reference to `nf_put_var_real_'
-physdem1.F:(.text+0x74a): undefined reference to `nf_put_var_real_'
-physdem1.F:(.text+0x7d9): undefined reference to `nf_put_var_real_'
-physdem1.F:(.text+0x868): undefined reference to `nf_put_var_real_'
-physdem1.F:(.text+0x8f7): undefined reference to `nf_put_var_real_'
-../mars_lmd/libo/liblmd.a(physdem1.o):physdem1.F:(.text+0x986): more undefined
-references to `nf_put_var_real_' follow
-../mars_lmd/libo/liblmd.a(meso_readtesassim.o): In function
-`meso_readtesassim_':
-meso_readtesassim.F90:(.text+0x1224): undefined reference to
-`nf_get_var_real_'
-meso_readtesassim.F90:(.text+0x14cc): undefined reference to
-`nf_get_var_real_'
-meso_readtesassim.F90:(.text+0x179a): undefined reference to
-`nf_get_var_real_'
-meso_readtesassim.F90:(.text+0x17dd): undefined reference to
-`nf_get_var_real_'
-../mars_lmd/libo/liblmd.a(readtesassim.o): In function `readtesassim_':
-readtesassim.F90:(.text+0x11ec): undefined reference to `nf_get_var_real_'
-../mars_lmd/libo/liblmd.a(readtesassim.o):readtesassim.F90:(.text+0x121b):
-more undefined references to `nf_get_var_real_' follow
-collect2: ld returned 1 exit status
-make[1]: [em_wrf] Error 1 (ignored)
-
-
->>>> corrige en ajoutant dans makemeso
-
-                       sed s+"-L../mars_lmd/libo -llmd"+"-L../mars_lmd/libo
--llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah
-configure.wrf ;;
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars0
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars0	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars0	(revision 207)
@@ -0,0 +1,116 @@
+##General options
+##~~~~~~~~~~~~~~~
+#Run with or without tracer transport ?
+tracer=.false.
+
+#Diurnal cycle ?  if diurnal=False, diurnal averaged solar heating
+diurnal=.true.
+
+#Seasonal cycle ? if season=False, Ls stays constant, to value set in "start"
+season = .true.   
+
+#write some more output on the screen ?
+lwrite = .false.    
+
+#Save statistics in file "stats.nc" ?
+callstats =.false.
+
+#Save EOF profiles in file "profiles" for Climate Database?
+calleofdump = .false.
+
+## Dust scenario. Used if the dust is prescribed (i.e. if tracer=F or active=F)
+## ~~~~~~~~~~~~~
+#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario,
+#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)
+#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)
+#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)
+#  =26 Mars Year 26 from TES assimilation
+iaervar = 26 
+# Dust opacity at 700 Pa (when constant, i.e. for the iaervar=1 case)
+tauvis=0.2
+# Dust vertical distribution: 
+# (=0: old distrib. (Pollack90), =1: top set by "topdustref",
+#  =2: Viking scenario; =3 MGS scenario)
+iddist  = 3
+# Dust top altitude (km). (Matters only if iddist=1)
+topdustref = 55.
+
+## Physical Parameterizations :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# call radiative transfer ?
+callrad   = .true.
+# call NLTE radiative schemes ?   matters only if callrad=T
+callnlte = .false.
+# call CO2 NIR absorption ?   matters only if callrad=T
+callnirco2 = .true.
+# call turbulent vertical diffusion ?
+calldifv  = .true.
+# call convective adjustment ?
+calladj  = .true.
+# call CO2 condensation ?
+callcond =.true.
+# call thermal conduction in the soil ?
+callsoil = .true.
+# call Lott's gravity wave/subgrid topography scheme ?
+calllott  = .false.
+# Impose polar cap surface albedos as observed by TES?
+TESicealbedo = .true.
+
+## Radiative transfer options :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# the rad.transfer is computed every "iradia" physical timestep
+iradia    = 6
+# Output of the exchange coefficient mattrix ? for diagnostic only
+callg2d  = .false.
+# Rayleigh scattering : (should be .false. for now)
+rayleigh  = .false.
+
+## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# DUST: Transported dust ? (if >0, use 'dustbin' dust bins)
+dustbin    = 0
+# DUST: Radiatively active dust ? (matters if dustbin>0)
+active  = .false.
+# DUST: use mass and number mixing ratios to predict dust size ?
+doubleq   = .false. 
+# DUST: lifted by GCM surface winds ?
+lifting = .false. 
+# DUST: lifted by dust devils ?
+callddevil = .false.
+# DUST: Scavenging by CO2 snowfall ?
+scavenging = .false.
+# DUST/WATERICE: Gravitationnal sedimentation ?
+sedimentation = .false.
+# WATERICE: Radiatively active transported atmospheric water ice ?
+activice   = .false.
+# WATER: Compute water cycle
+water = .false.
+# WATER: current permanent caps at both poles. True IS RECOMMENDED
+#        (with .true., North cap is a source of water and South pole
+#         is a cold trap)
+caps  = .false.
+# PHOTOCHEMISTRY: include chemical species 
+photochem  = .false.
+
+## Thermospheric options (relevant if tracer=T) :
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# call thermosphere ?
+callthermos = .false.
+# WATER: included without cycle (only if water=.false.)
+thermoswater = .false.
+# call thermal conduction ? (only if callthermos=.true.)
+callconduct = .false.
+# call EUV heating ? (only if callthermos=.true.)
+calleuv=.false.
+# call molecular viscosity ? (only if callthermos=.true.)
+callmolvis = .false.
+# call molecular diffusion ? (only if callthermos=.true.)
+callmoldiff = .false.
+# call thermospheric photochemistry ? (only if callthermos=.true.)
+thermochem = .false.
+# date for solar flux calculation: (1985 < date < 2002)
+## (Solar min=1996.4 ave=1993.4 max=1990.6)
+solarcondate = 1993.4
+       
+
+
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars0.ideal
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars0.ideal	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars0.ideal	(revision 207)
@@ -0,0 +1,119 @@
+##General options
+##~~~~~~~~~~~~~~~
+#Directory where external input files are
+datadir = /san/work/colaitis/datafile/ 
+
+#Run with or without tracer transport ?
+tracer=.false.
+
+#Diurnal cycle ?  if diurnal=False, diurnal averaged solar heating
+diurnal=.true.
+
+#Seasonal cycle ? if season=False, Ls stays constant, to value set in "start"
+season = .true.   
+
+#write some more output on the screen ?
+lwrite = .false.    
+
+#Save statistics in file "stats.nc" ?
+callstats =.false.
+
+#Save EOF profiles in file "profiles" for Climate Database?
+calleofdump = .false.
+
+## Dust scenario. Used if the dust is prescribed (i.e. if tracer=F or active=F)
+## ~~~~~~~~~~~~~
+#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario,
+#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)
+#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)
+#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)
+#  =26 Mars Year 26 from TES assimilation
+iaervar = 1 
+# Dust opacity at 700 Pa (when constant, i.e. for the iaervar=1 case)
+tauvis = 0.5
+# Dust vertical distribution: 
+# (=0: old distrib. (Pollack90), =1: top set by "topdustref",
+#  =2: Viking scenario; =3 MGS scenario)
+iddist  = 3
+# Dust top altitude (km). (Matters only if iddist=1)
+topdustref = 55.
+
+## Physical Parameterizations :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# call radiative transfer ?
+callrad   = .true.
+# call NLTE radiative schemes ?   matters only if callrad=T
+callnlte = .false.
+# call CO2 NIR absorption ?   matters only if callrad=T
+callnirco2 = .false.
+# call turbulent vertical diffusion ?
+calldifv  = .true.
+# call convective adjustment ?
+calladj  = .false.
+# call CO2 condensation ?
+callcond =.true.
+# call thermal conduction in the soil ?
+callsoil = .true.
+# call Lott's gravity wave/subgrid topography scheme ?
+calllott  = .false.
+# Impose polar cap surface albedos as observed by TES?
+TESicealbedo = .false.
+
+## Radiative transfer options :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# the rad.transfer is computed every "iradia" physical timestep
+iradia    = 6
+# Output of the exchange coefficient mattrix ? for diagnostic only
+callg2d  = .false.
+# Rayleigh scattering : (should be .false. for now)
+rayleigh  = .false.
+
+## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# DUST: Transported dust ? (if >0, use 'dustbin' dust bins)
+dustbin    = 0
+# DUST: Radiatively active dust ? (matters if dustbin>0)
+active  = .false.
+# DUST: use mass and number mixing ratios to predict dust size ?
+doubleq   = .false. 
+# DUST: lifted by GCM surface winds ?
+lifting = .false. 
+# DUST: lifted by dust devils ?
+callddevil = .false.
+# DUST: Scavenging by CO2 snowfall ?
+scavenging = .false.
+# DUST/WATERICE: Gravitationnal sedimentation ?
+sedimentation = .false.
+# WATERICE: Radiatively active transported atmospheric water ice ?
+activice   = .false.
+# WATER: Compute water cycle
+water = .false.
+# WATER: current permanent caps at both poles. True IS RECOMMENDED
+#        (with .true., North cap is a source of water and South pole
+#         is a cold trap)
+caps  = .false.
+# PHOTOCHEMISTRY: include chemical species 
+photochem  = .false.
+
+## Thermospheric options (relevant if tracer=T) :
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# call thermosphere ?
+callthermos = .false.
+# WATER: included without cycle (only if water=.false.)
+thermoswater = .false.
+# call thermal conduction ? (only if callthermos=.true.)
+callconduct = .false.
+# call EUV heating ? (only if callthermos=.true.)
+calleuv=.false.
+# call molecular viscosity ? (only if callthermos=.true.)
+callmolvis = .false.
+# call molecular diffusion ? (only if callthermos=.true.)
+callmoldiff = .false.
+# call thermospheric photochemistry ? (only if callthermos=.true.)
+thermochem = .false.
+# date for solar flux calculation: (1985 < date < 2002)
+## (Solar min=1996.4 ave=1993.4 max=1990.6)
+solarcondate = 1993.4
+       
+
+
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars1
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars1	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars1	(revision 207)
@@ -0,0 +1,116 @@
+##General options
+##~~~~~~~~~~~~~~~
+#Run with or without tracer transport ?
+tracer=.true.
+
+#Diurnal cycle ?  if diurnal=False, diurnal averaged solar heating
+diurnal=.true.
+
+#Seasonal cycle ? if season=False, Ls stays constant, to value set in "start"
+season = .true.   
+
+#write some more output on the screen ?
+lwrite = .false.    
+
+#Save statistics in file "stats.nc" ?
+callstats =.false.
+
+#Save EOF profiles in file "profiles" for Climate Database?
+calleofdump = .false.
+
+## Dust scenario. Used if the dust is prescribed (i.e. if tracer=F or active=F)
+## ~~~~~~~~~~~~~
+#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario,
+#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)
+#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)
+#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)
+#  =26 Mars Year 26 from TES assimilation
+iaervar = 26 
+# Dust opacity at 700 Pa (when constant, i.e. for the iaervar=1 case)
+tauvis=0.2
+# Dust vertical distribution: 
+# (=0: old distrib. (Pollack90), =1: top set by "topdustref",
+#  =2: Viking scenario; =3 MGS scenario)
+iddist  = 3
+# Dust top altitude (km). (Matters only if iddist=1)
+topdustref = 55.
+
+## Physical Parameterizations :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# call radiative transfer ?
+callrad   = .true.
+# call NLTE radiative schemes ?   matters only if callrad=T
+callnlte = .false.
+# call CO2 NIR absorption ?   matters only if callrad=T
+callnirco2 = .true.
+# call turbulent vertical diffusion ?
+calldifv  = .true.
+# call convective adjustment ?
+calladj  = .true.
+# call CO2 condensation ?
+callcond =.true.
+# call thermal conduction in the soil ?
+callsoil = .true.
+# call Lott's gravity wave/subgrid topography scheme ?
+calllott  = .false.
+# Impose polar cap surface albedos as observed by TES?
+TESicealbedo = .true.
+
+## Radiative transfer options :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# the rad.transfer is computed every "iradia" physical timestep
+iradia    = 6
+# Output of the exchange coefficient mattrix ? for diagnostic only
+callg2d  = .false.
+# Rayleigh scattering : (should be .false. for now)
+rayleigh  = .false.
+
+## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# DUST: Transported dust ? (if >0, use 'dustbin' dust bins)
+dustbin    = 0
+# DUST: Radiatively active dust ? (matters if dustbin>0)
+active  = .false.
+# DUST: use mass and number mixing ratios to predict dust size ?
+doubleq   = .false. 
+# DUST: lifted by GCM surface winds ?
+lifting = .false. 
+# DUST: lifted by dust devils ?
+callddevil = .false.
+# DUST: Scavenging by CO2 snowfall ?
+scavenging = .false.
+# DUST/WATERICE: Gravitationnal sedimentation ?
+sedimentation = .true.
+# WATERICE: Radiatively active transported atmospheric water ice ?
+activice   = .false.
+# WATER: Compute water cycle
+water = .true.
+# WATER: current permanent caps at both poles. True IS RECOMMENDED
+#        (with .true., North cap is a source of water and South pole
+#         is a cold trap)
+caps  = .false.
+# PHOTOCHEMISTRY: include chemical species 
+photochem  = .false.
+
+## Thermospheric options (relevant if tracer=T) :
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# call thermosphere ?
+callthermos = .false.
+# WATER: included without cycle (only if water=.false.)
+thermoswater = .false.
+# call thermal conduction ? (only if callthermos=.true.)
+callconduct = .false.
+# call EUV heating ? (only if callthermos=.true.)
+calleuv=.false.
+# call molecular viscosity ? (only if callthermos=.true.)
+callmolvis = .false.
+# call molecular diffusion ? (only if callthermos=.true.)
+callmoldiff = .false.
+# call thermospheric photochemistry ? (only if callthermos=.true.)
+thermochem = .false.
+# date for solar flux calculation: (1985 < date < 2002)
+## (Solar min=1996.4 ave=1993.4 max=1990.6)
+solarcondate = 1993.4
+       
+
+
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars11
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars11	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars11	(revision 207)
@@ -0,0 +1,116 @@
+##General options
+##~~~~~~~~~~~~~~~
+#Run with or without tracer transport ?
+tracer=.true.
+
+#Diurnal cycle ?  if diurnal=False, diurnal averaged solar heating
+diurnal=.true.
+
+#Seasonal cycle ? if season=False, Ls stays constant, to value set in "start"
+season = .true.   
+
+#write some more output on the screen ?
+lwrite = .false.    
+
+#Save statistics in file "stats.nc" ?
+callstats =.false.
+
+#Save EOF profiles in file "profiles" for Climate Database?
+calleofdump = .false.
+
+## Dust scenario. Used if the dust is prescribed (i.e. if tracer=F or active=F)
+## ~~~~~~~~~~~~~
+#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario,
+#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)
+#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)
+#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)
+#  =26 Mars Year 26 from TES assimilation
+iaervar = 26 
+# Dust opacity at 700 Pa (when constant, i.e. for the iaervar=1 case)
+tauvis=0.2
+# Dust vertical distribution: 
+# (=0: old distrib. (Pollack90), =1: top set by "topdustref",
+#  =2: Viking scenario; =3 MGS scenario)
+iddist  = 3
+# Dust top altitude (km). (Matters only if iddist=1)
+topdustref = 55.
+
+## Physical Parameterizations :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# call radiative transfer ?
+callrad   = .true.
+# call NLTE radiative schemes ?   matters only if callrad=T
+callnlte = .false.
+# call CO2 NIR absorption ?   matters only if callrad=T
+callnirco2 = .true.
+# call turbulent vertical diffusion ?
+calldifv  = .true.
+# call convective adjustment ?
+calladj  = .true.
+# call CO2 condensation ?
+callcond =.true.
+# call thermal conduction in the soil ?
+callsoil = .true.
+# call Lott's gravity wave/subgrid topography scheme ?
+calllott  = .false.
+# Impose polar cap surface albedos as observed by TES?
+TESicealbedo = .true.
+
+## Radiative transfer options :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# the rad.transfer is computed every "iradia" physical timestep
+iradia    = 6
+# Output of the exchange coefficient mattrix ? for diagnostic only
+callg2d  = .false.
+# Rayleigh scattering : (should be .false. for now)
+rayleigh  = .false.
+
+## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# DUST: Transported dust ? (if >0, use 'dustbin' dust bins)
+dustbin    = 2
+# DUST: Radiatively active dust ? (matters if dustbin>0)
+active  = .false.
+# DUST: use mass and number mixing ratios to predict dust size ?
+doubleq   = .true. 
+# DUST: lifted by GCM surface winds ?
+lifting = .true. 
+# DUST: lifted by dust devils ?
+callddevil = .false.
+# DUST: Scavenging by CO2 snowfall ?
+scavenging = .false.
+# DUST/WATERICE: Gravitationnal sedimentation ?
+sedimentation = .true.
+# WATERICE: Radiatively active transported atmospheric water ice ?
+activice   = .false.
+# WATER: Compute water cycle
+water = .true.
+# WATER: current permanent caps at both poles. True IS RECOMMENDED
+#        (with .true., North cap is a source of water and South pole
+#         is a cold trap)
+caps  = .false. #.true.
+# PHOTOCHEMISTRY: include chemical species 
+photochem  = .false.
+
+## Thermospheric options (relevant if tracer=T) :
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# call thermosphere ?
+callthermos = .false.
+# WATER: included without cycle (only if water=.false.)
+thermoswater = .false.
+# call thermal conduction ? (only if callthermos=.true.)
+callconduct = .false.
+# call EUV heating ? (only if callthermos=.true.)
+calleuv=.false.
+# call molecular viscosity ? (only if callthermos=.true.)
+callmolvis = .false.
+# call molecular diffusion ? (only if callthermos=.true.)
+callmoldiff = .false.
+# call thermospheric photochemistry ? (only if callthermos=.true.)
+thermochem = .false.
+# date for solar flux calculation: (1985 < date < 2002)
+## (Solar min=1996.4 ave=1993.4 max=1990.6)
+solarcondate = 1993.4
+       
+
+
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars11_radact
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars11_radact	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars11_radact	(revision 207)
@@ -0,0 +1,119 @@
+##General options
+##~~~~~~~~~~~~~~~
+#Directory where external input files are
+datadir = /san/home/spiga/DATAFILE/ 
+
+#Run with or without tracer transport ?
+tracer=.true.
+
+#Diurnal cycle ?  if diurnal=False, diurnal averaged solar heating
+diurnal=.true.
+
+#Seasonal cycle ? if season=False, Ls stays constant, to value set in "start"
+season = .true.   
+
+#write some more output on the screen ?
+lwrite = .false.    
+
+#Save statistics in file "stats.nc" ?
+callstats =.false.
+
+#Save EOF profiles in file "profiles" for Climate Database?
+calleofdump = .false.
+
+## Dust scenario. Used if the dust is prescribed (i.e. if tracer=F or active=F)
+## ~~~~~~~~~~~~~
+#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario,
+#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)
+#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)
+#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)
+#  =26 Mars Year 26 from TES assimilation
+iaervar = 26 
+# Dust opacity at 700 Pa (when constant, i.e. for the iaervar=1 case)
+tauvis=0.2
+# Dust vertical distribution: 
+# (=0: old distrib. (Pollack90), =1: top set by "topdustref",
+#  =2: Viking scenario; =3 MGS scenario)
+iddist  = 3
+# Dust top altitude (km). (Matters only if iddist=1)
+topdustref = 55.
+
+## Physical Parameterizations :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# call radiative transfer ?
+callrad   = .true.
+# call NLTE radiative schemes ?   matters only if callrad=T
+callnlte = .false.
+# call CO2 NIR absorption ?   matters only if callrad=T
+callnirco2 = .true.
+# call turbulent vertical diffusion ?
+calldifv  = .true.
+# call convective adjustment ?
+calladj  = .true.
+# call CO2 condensation ?
+callcond =.true.
+# call thermal conduction in the soil ?
+callsoil = .true.
+# call Lott's gravity wave/subgrid topography scheme ?
+calllott  = .false.
+# Impose polar cap surface albedos as observed by TES?
+TESicealbedo = .true.
+
+## Radiative transfer options :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# the rad.transfer is computed every "iradia" physical timestep
+iradia    = 6
+# Output of the exchange coefficient mattrix ? for diagnostic only
+callg2d  = .false.
+# Rayleigh scattering : (should be .false. for now)
+rayleigh  = .false.
+
+## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# DUST: Transported dust ? (if >0, use 'dustbin' dust bins)
+dustbin    = 2
+# DUST: Radiatively active dust ? (matters if dustbin>0)
+active  = .true.
+# DUST: use mass and number mixing ratios to predict dust size ?
+doubleq   = .true. 
+# DUST: lifted by GCM surface winds ?
+lifting = .true. 
+# DUST: lifted by dust devils ?
+callddevil = .false.
+# DUST: Scavenging by CO2 snowfall ?
+scavenging = .false.
+# DUST/WATERICE: Gravitationnal sedimentation ?
+sedimentation = .true.
+# WATERICE: Radiatively active transported atmospheric water ice ?
+activice   = .true.
+# WATER: Compute water cycle
+water = .true.
+# WATER: current permanent caps at both poles. True IS RECOMMENDED
+#        (with .true., North cap is a source of water and South pole
+#         is a cold trap)
+caps  = .true.
+# PHOTOCHEMISTRY: include chemical species 
+photochem  = .false.
+
+## Thermospheric options (relevant if tracer=T) :
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# call thermosphere ?
+callthermos = .false.
+# WATER: included without cycle (only if water=.false.)
+thermoswater = .false.
+# call thermal conduction ? (only if callthermos=.true.)
+callconduct = .false.
+# call EUV heating ? (only if callthermos=.true.)
+calleuv=.false.
+# call molecular viscosity ? (only if callthermos=.true.)
+callmolvis = .false.
+# call molecular diffusion ? (only if callthermos=.true.)
+callmoldiff = .false.
+# call thermospheric photochemistry ? (only if callthermos=.true.)
+thermochem = .false.
+# date for solar flux calculation: (1985 < date < 2002)
+## (Solar min=1996.4 ave=1993.4 max=1990.6)
+solarcondate = 1993.4
+       
+
+
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars2
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars2	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars2	(revision 207)
@@ -0,0 +1,116 @@
+##General options
+##~~~~~~~~~~~~~~~
+#Run with or without tracer transport ?
+tracer=.true.
+
+#Diurnal cycle ?  if diurnal=False, diurnal averaged solar heating
+diurnal=.true.
+
+#Seasonal cycle ? if season=False, Ls stays constant, to value set in "start"
+season = .true.   
+
+#write some more output on the screen ?
+lwrite = .false.    
+
+#Save statistics in file "stats.nc" ?
+callstats =.false.
+
+#Save EOF profiles in file "profiles" for Climate Database?
+calleofdump = .false.
+
+## Dust scenario. Used if the dust is prescribed (i.e. if tracer=F or active=F)
+## ~~~~~~~~~~~~~
+#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario,
+#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)
+#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)
+#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)
+#  =26 Mars Year 26 from TES assimilation
+iaervar = 26 
+# Dust opacity at 700 Pa (when constant, i.e. for the iaervar=1 case)
+tauvis=0.2
+# Dust vertical distribution: 
+# (=0: old distrib. (Pollack90), =1: top set by "topdustref",
+#  =2: Viking scenario; =3 MGS scenario)
+iddist  = 3
+# Dust top altitude (km). (Matters only if iddist=1)
+topdustref = 55.
+
+## Physical Parameterizations :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# call radiative transfer ?
+callrad   = .true.
+# call NLTE radiative schemes ?   matters only if callrad=T
+callnlte = .false.
+# call CO2 NIR absorption ?   matters only if callrad=T
+callnirco2 = .true.
+# call turbulent vertical diffusion ?
+calldifv  = .true.
+# call convective adjustment ?
+calladj  = .true.
+# call CO2 condensation ?
+callcond =.true.
+# call thermal conduction in the soil ?
+callsoil = .true.
+# call Lott's gravity wave/subgrid topography scheme ?
+calllott  = .false.
+# Impose polar cap surface albedos as observed by TES?
+TESicealbedo = .true.
+
+## Radiative transfer options :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# the rad.transfer is computed every "iradia" physical timestep
+iradia    = 6
+# Output of the exchange coefficient mattrix ? for diagnostic only
+callg2d  = .false.
+# Rayleigh scattering : (should be .false. for now)
+rayleigh  = .false.
+
+## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# DUST: Transported dust ? (if >0, use 'dustbin' dust bins)
+dustbin    = 1
+# DUST: Radiatively active dust ? (matters if dustbin>0)
+active  = .false.
+# DUST: use mass and number mixing ratios to predict dust size ?
+doubleq   = .false.
+# DUST: lifted by GCM surface winds ?
+lifting = .true. #.false.
+# DUST: lifted by dust devils ?
+callddevil = .false.
+# DUST: Scavenging by CO2 snowfall ?
+scavenging = .false.
+# DUST/WATERICE: Gravitationnal sedimentation ?
+sedimentation = .true.
+# WATERICE: Radiatively active transported atmospheric water ice ?
+activice   = .false.
+# WATER: Compute water cycle
+water = .false. #.true.
+# WATER: current permanent caps at both poles. True IS RECOMMENDED
+#        (with .true., North cap is a source of water and South pole
+#         is a cold trap)
+caps  = .false. #.true.
+# PHOTOCHEMISTRY: include chemical species 
+photochem  = .false.
+
+## Thermospheric options (relevant if tracer=T) :
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# call thermosphere ?
+callthermos = .false.
+# WATER: included without cycle (only if water=.false.)
+thermoswater = .false.
+# call thermal conduction ? (only if callthermos=.true.)
+callconduct = .false.
+# call EUV heating ? (only if callthermos=.true.)
+calleuv=.false.
+# call molecular viscosity ? (only if callthermos=.true.)
+callmolvis = .false.
+# call molecular diffusion ? (only if callthermos=.true.)
+callmoldiff = .false.
+# call thermospheric photochemistry ? (only if callthermos=.true.)
+thermochem = .false.
+# date for solar flux calculation: (1985 < date < 2002)
+## (Solar min=1996.4 ave=1993.4 max=1990.6)
+solarcondate = 1993.4
+       
+
+
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars3
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars3	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/callphys.def.mars3	(revision 207)
@@ -0,0 +1,119 @@
+##General options
+##~~~~~~~~~~~~~~~
+#Directory where external input files are
+datadir = /san/home/spiga/DATAFILE/ 
+
+#Run with or without tracer transport ?
+tracer=.true.
+
+#Diurnal cycle ?  if diurnal=False, diurnal averaged solar heating
+diurnal=.true.
+
+#Seasonal cycle ? if season=False, Ls stays constant, to value set in "start"
+season = .true.   
+
+#write some more output on the screen ?
+lwrite = .false.    
+
+#Save statistics in file "stats.nc" ?
+callstats =.false.
+
+#Save EOF profiles in file "profiles" for Climate Database?
+calleofdump = .false.
+
+## Dust scenario. Used if the dust is prescribed (i.e. if tracer=F or active=F)
+## ~~~~~~~~~~~~~
+#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario,
+#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)
+#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)
+#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)
+#  =26 Mars Year 26 from TES assimilation
+iaervar = 26 
+# Dust opacity at 700 Pa (when constant, i.e. for the iaervar=1 case)
+tauvis=0.2
+# Dust vertical distribution: 
+# (=0: old distrib. (Pollack90), =1: top set by "topdustref",
+#  =2: Viking scenario; =3 MGS scenario)
+iddist  = 3
+# Dust top altitude (km). (Matters only if iddist=1)
+topdustref = 55.
+
+## Physical Parameterizations :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# call radiative transfer ?
+callrad   = .true.
+# call NLTE radiative schemes ?   matters only if callrad=T
+callnlte = .false.
+# call CO2 NIR absorption ?   matters only if callrad=T
+callnirco2 = .true.
+# call turbulent vertical diffusion ?
+calldifv  = .true.
+# call convective adjustment ?
+calladj  = .true.
+# call CO2 condensation ?
+callcond =.true.
+# call thermal conduction in the soil ?
+callsoil = .true.
+# call Lott's gravity wave/subgrid topography scheme ?
+calllott  = .false.
+# Impose polar cap surface albedos as observed by TES?
+TESicealbedo = .true.
+
+## Radiative transfer options :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# the rad.transfer is computed every "iradia" physical timestep
+iradia    = 6
+# Output of the exchange coefficient mattrix ? for diagnostic only
+callg2d  = .false.
+# Rayleigh scattering : (should be .false. for now)
+rayleigh  = .false.
+
+## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# DUST: Transported dust ? (if >0, use 'dustbin' dust bins)
+dustbin    = 2
+# DUST: Radiatively active dust ? (matters if dustbin>0)
+active  = .true. #.false.
+# DUST: use mass and number mixing ratios to predict dust size ?
+doubleq   = .true. #.false.
+# DUST: lifted by GCM surface winds ?
+lifting = .true. #.false.
+# DUST: lifted by dust devils ?
+callddevil = .false.
+# DUST: Scavenging by CO2 snowfall ?
+scavenging = .false.
+# DUST/WATERICE: Gravitationnal sedimentation ?
+sedimentation = .true.
+# WATERICE: Radiatively active transported atmospheric water ice ?
+activice   = .false.
+# WATER: Compute water cycle
+water = .false. #.true.
+# WATER: current permanent caps at both poles. True IS RECOMMENDED
+#        (with .true., North cap is a source of water and South pole
+#         is a cold trap)
+caps  = .false. #.true.
+# PHOTOCHEMISTRY: include chemical species 
+photochem  = .false.
+
+## Thermospheric options (relevant if tracer=T) :
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# call thermosphere ?
+callthermos = .false.
+# WATER: included without cycle (only if water=.false.)
+thermoswater = .false.
+# call thermal conduction ? (only if callthermos=.true.)
+callconduct = .false.
+# call EUV heating ? (only if callthermos=.true.)
+calleuv=.false.
+# call molecular viscosity ? (only if callthermos=.true.)
+callmolvis = .false.
+# call molecular diffusion ? (only if callthermos=.true.)
+callmoldiff = .false.
+# call thermospheric photochemistry ? (only if callthermos=.true.)
+thermochem = .false.
+# date for solar flux calculation: (1985 < date < 2002)
+## (Solar min=1996.4 ave=1993.4 max=1990.6)
+solarcondate = 1993.4
+       
+
+
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/namelist.input
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/namelist.input	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/namelist.input	(revision 207)
@@ -0,0 +1,66 @@
+ &time_control
+ start_year       = 2024,    !! (p1) Start Martian Year (20XX for MY XX)
+ start_month      = 05,      !! (p1) Start Martian Month
+ start_day        = 01,      !! (p1) Start Martian Day
+ start_hour       = 01,      !! (p1) Start Martian Hour (at longitude 0)
+ end_year         = 2024,    !! (p1) End Martian Year (20XX for MY XX)
+ end_month        = 05,      !! (p1) End Martian Month
+ end_day          = 09,      !! (p1) End Martian Day
+ end_hour         = 01,      !! (p1) End Martian Hour (at longitude 0)
+ history_interval    = 37,   !! Frequency of outputs (37 --> 3700s = 1 Martian hour)  
+ frames_per_outfile  = 24,   !! Size of time dimension in files 
+ restart          = .false.  !! (*) Output restart files ?
+ restart_interval = 8880     !! (*) Frequency of output restart files ?
+ io_form_history  = 2        !! (*) Choice of NETCDF for ouputs
+ io_form_restart  = 2        !! (*) Choice of NETCDF for ouputs     
+ io_form_input    = 2        !! (*) Choice of NETCDF for ouputs
+ io_form_boundary = 2        !! (*) Choice of NETCDF for ouputs
+ debug_level      = 0        !! (*) Verbose level
+ /
+
+ &domains
+ time_step   = 20            !! Dynamical timestep  
+ dx = 30000,                 !! (p2) Horizontal resolution
+ dy = 30000,                 !! (p2) Horizontal resolution (should be equal to dx)
+ e_we   = 121,               !! (r)(p2) Number of longitude grid points
+ e_sn   = 121,               !! (r)(p2) Number of latitude grid points
+ e_vert = 61,                !! (r)(p2) Number of vertical levels
+ p_top_requested = 5         !! (p3) Chosen value of pressure at the top of the model
+ !!
+ !! OPTIONAL
+ !!
+ num_metgrid_levels = 26     !! (p1) number of vertical levels in GCM inputs (+1)
+ /
+
+ &physics
+ mars = 11  
+ num_soil_layers = 18 !!! NOUVELLE PHYSIQUE
+ !!
+ !! OPTIONAL
+ !!
+ /
+
+ &dynamics
+ tiso = 100.
+ pd_scalar = T    !!! tres IMPORTANT, sinon valeurs negatives 
+ !!!
+ !!! OPTIONAL
+ !!!
+ !non_hydrostatic = F,        !! Integrate in non-hydrostatic/hydrostatic mode
+ !                            !! --- necessaire pour garder un pas de tps long
+ !                            !! --- et parce qu'un bout d'Arsia est au bord
+ /
+
+ &bdy_control
+ /
+
+ &grib2
+ /
+
+ &fdda
+ /
+
+ &namelist_quilt              !! (*)
+ nio_tasks_per_group = 0,     !! (*)
+ nio_groups = 1,              !! (*)
+ /                            !! (*)
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/namelist.wps
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/namelist.wps	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/namelist.wps	(revision 207)
@@ -0,0 +1,38 @@
+&share				      	
+ wrf_core = 'ARW',                    !!   [do not modify: choice of dynamical core]
+ max_dom = 1 !! (r)(n)(p2) Total number of domains
+ start_date = '2024-05-01_01:00:00','2024-05-01_01:00:00','2024-05-01_01:00:00'   !! YYYY-MM-DD_HH:mm:ss start date
+ end_date   = '2024-05-09_01:00:00','2024-05-01_01:00:00','2024-05-01_01:00:00'   !! YYYY-MM-DD_HH:mm:ss end date
+ interval_seconds = 3700 !! (p2) Frequency of large-scale fields update (s)
+ io_form_geogrid = 2,                 !!   [do not modify: choice of NETCDF outputs]	
+ debug_level = 0,                     !! verbose level of the programs 
+ opt_output_from_geogrid_path='./'    !! location of the geogrid outputs
+/
+
+
+&geogrid
+ parent_id = 0, !! (n)(p2) Associated parent domain
+ parent_grid_ratio = 1, !! (n)(p2) Ratio of horizontal resolution parent/nest
+ i_parent_start = 0, !! (n)(p2) x-position of the bottom-left nest corner
+ j_parent_start = 0, !! (n)(p2) y-position of the bottom-left nest corner
+  e_we   = 121,                !! (r)(p2) Number of longitude grid points
+  e_sn   = 121,                !! (r)(p2) Number of latitude grid points
+ dx = 30000
+ dy = 30000
+ geog_data_res     = '64ppd_noHRti',       !! choice of static data sources
+                                            !! NB: possible: '64ppd', '32ppd', ...
+                                            !! NB: please glance at geogrid/GEOGRID.TBL
+ map_proj = 'mercator',           !! map projection: 'mercator', 'lambert' or 'polar'
+ ref_lat   =  10.,            !! north latitude of the center of the domain 
+ ref_lon   =  -125.,            !! east longitude of the center of the domain
+ truelat1  =  10.,            !! (lambert or polar) lat position of projection cone
+ truelat2  =  0.0,                !!   [do not modify]
+ stand_lon =  -125.,            !! (lambert or polar) lon position of projection cone
+ geog_data_path = './WPS_GEOG',   !!   [do not modify: symbolic link in the WPS folder]
+/
+
+&metgrid
+ fg_name = './WPSFEED/LMD'        !!   [do not modify: symbolic link in the WPS folder]
+ io_form_metgrid = 2,             !!   [do not modify: choice of NETCDF outputs]
+ opt_output_from_metgrid_path='./WRFFEED/current'  !!   [do not modify: symbolic link]
+/
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/run.def
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/run.def	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/newphys_tracers/run.def	(revision 207)
@@ -0,0 +1,2 @@
+# some definitions for the physics, in file 'callphys.def'
+INCLUDEDEF=callphys.def
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/rename
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/rename	(revision 206)
+++ 	(revision )
@@ -1,8 +1,0 @@
-#! /bin/bash
-
-for fich in $(cat ye) ; do
-
-  mv $fich $(echo $fich | tr ":" "z")
-
-done
-
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/timestep
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/timestep	(revision 206)
+++ 	(revision )
@@ -1,11 +1,0 @@
-20  25
-20  20
-10  10
-10  25
-5   10
-0.1 0.5
-2   10
-0.5  1
-75  74
-60  74
-250 185  
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/build_static
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/build_static	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/build_static	(revision 207)
@@ -0,0 +1,75 @@
+#! /bin/bash
+
+cd WPS_GEOG
+
+cp -rf res/albedo_TES .
+cd albedo_TES
+echo get TES albedo from PDS
+echo 1/2
+wget http://pds-geosciences.wustl.edu/geo/mgs-m-tes-special-v1/global_albedo_8ppd.img . > /dev/null 2>&1
+echo 2/2
+wget http://pds-geosciences.wustl.edu/geo/mgs-m-tes-special-v1/global_albedo_8ppd.lbl . > /dev/null 2>&1
+ls -l ./ | grep global_albedo*
+echo building... please wait
+./tesalbedo_build.m
+\rm global_albedo*
+cd ..
+
+cp -rf res/thermal_TES .
+cd thermal_TES
+echo get TES thermal inertia from Univ. Colorado
+echo 1/2
+wget http://lasp.colorado.edu/inertia/2007/NBmap2007.bin . > /dev/null 2>&1
+echo 2/2
+wget http://lasp.colorado.edu/inertia/2007/NBmap2007s.jpg . > /dev/null 2>&1
+ls -l ./ | grep NBmap2007*
+echo building... please wait
+./testhermal_build.m
+\rm NBmap2007*
+cd ..
+
+cp -rf res/mola_topo32 .
+cd mola_topo32
+echo get MOLA 32 topography from PDS ... this could be long
+echo 1/2
+wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg032/megt90n000fb.img . > /dev/null 2>&1
+echo 2/2
+wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg032/megt90n000fb.lbl . > /dev/null 2>&1
+ls -l ./ | grep megt*
+echo building... please wait
+./mola_build.m
+\rm megt*
+cd ..
+
+### remove this line if you want to generate MOLA 64 
+exit
+
+cp -rf res/mola_topo64 .
+cd mola_topo64
+echo get MOLA 64 topography from PDS ... this could be very long
+ls -l ./ | grep megt*
+echo 1/8
+wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt90n000gb.img . > /dev/null 2>&1
+echo 2/8
+wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt90n000gb.lbl . > /dev/null 2>&1
+echo 3/8
+wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt90n180gb.img . > /dev/null 2>&1
+echo 4/8
+wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt90n180gb.lbl . > /dev/null 2>&1
+echo 5/8
+wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt00n000gb.img . > /dev/null 2>&1
+echo 6/8
+wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt00n000gb.lbl . > /dev/null 2>&1
+echo 7/8
+wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt00n180gb.img . > /dev/null 2>&1
+echo 8/8
+wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt00n180gb.lbl . > /dev/null 2>&1
+echo building... please wait
+./mola_buildNE.m  
+./mola_buildNW.m  
+./mola_buildSE.m  
+./mola_buildSW.m
+\rm megt*
+cd ..
+
+exit
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/copy_model
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/copy_model	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/copy_model	(revision 207)
@@ -0,0 +1,155 @@
+#! /bin/bash
+
+
+echo '*** linking sources from ...'
+WRFSRC=$PWD/SRC/
+echo $WRFSRC
+echo '*** to ...'
+HERE=$PWD
+echo $HERE
+
+
+#mkdir WPS
+#cd WPS
+#ln -sf $WRFSRC/WPS/wps_mars .
+#ln -sf $WRFSRC/WPS/switch_WPS_Mars .
+#cd ..
+
+mkdir WRFV2
+ln -sf $WRFSRC/prepare_ini .
+
+cd WRFV2 
+
+echo '*** start defining folders and links'
+ln -sf $WRFSRC/WRFV2/clean . 
+ln -sf $WRFSRC/WRFV2/compile .
+#ln -sf $WRFSRC/WRFV2/makemeso .
+ln -sf $WRFSRC/WRFV2/configure .
+ln -sf $WRFSRC/WRFV2/Makefile .
+ln -sf $WRFSRC/WRFV2/mars.sed* .
+ln -sf $WRFSRC/WRFV2/*.h .
+ln -sf $WRFSRC/WRFV2/configure.defaults.* .
+ln -sf $WRFSRC/WRFV2/call_meso_inifis?.inc .
+ln -sf $WRFSRC/WRFV2/call_meso_physiq?.inc .
+
+#\rm meso_dimphys.h
+#cp $WRFSRC/WRFV2/meso_dimphys.h .
+#cp $WRFSRC/WRFV2/call_*.inc .
+#cp $WRFSRC/WRFV2/custom*.inc .
+mkdir Registry
+ln -sf $WRFSRC/WRFV2/Registry/* Registry/
+mkdir arch
+ln -sf $WRFSRC/WRFV2/arch/* arch/
+mkdir dyn_em
+ln -sf $WRFSRC/WRFV2/dyn_em/* dyn_em/
+mkdir dyn_exp
+ln -sf $WRFSRC/WRFV2/dyn_exp/* dyn_exp/
+mkdir dyn_nmm
+ln -sf $WRFSRC/WRFV2/dyn_nmm/* dyn_nmm/
+mkdir frame
+ln -sf $WRFSRC/WRFV2/frame/* frame/
+mkdir inc
+ln -sf $WRFSRC/WRFV2/inc/* inc/
+mkdir main
+ln -sf $WRFSRC/WRFV2/main/* main/
+mkdir phys
+ln -sf $WRFSRC/WRFV2/phys/* phys/
+mkdir run
+ln -sf $WRFSRC/WRFV2/run/* run/
+mkdir share
+ln -sf $WRFSRC/WRFV2/share/* share/
+mkdir tools
+ln -sf $WRFSRC/WRFV2/tools/* tools/
+\rm tools/DOMAIN_TIME_TEST
+\rm tools/CodeBase
+mkdir tools/DOMAIN_TIME_TEST
+ln -sf $WRFSRC/WRFV2/tools/DOMAIN_TIME_TEST/* tools/DOMAIN_TIME_TEST/
+mkdir tools/CodeBase
+ln -sf $WRFSRC/WRFV2/tools/CodeBase/* tools/CodeBase/
+mkdir external
+ln -sf $WRFSRC/WRFV2/external/Makefile external/
+mkdir external/io_int
+ln -sf $WRFSRC/WRFV2/external/io_int/* external/io_int/
+mkdir external/esmf_time_f90
+ln -sf $WRFSRC/WRFV2/external/esmf_time_f90/* external/esmf_time_f90/
+mkdir external/io_netcdf
+ln -sf $WRFSRC/WRFV2/external/io_netcdf/* external/io_netcdf/
+mkdir external/io_grib1
+ln -sf $WRFSRC/WRFV2/external/io_grib1/* external/io_grib1/
+\rm external/io_grib1/MEL_grib1
+\rm external/io_grib1/WGRIB
+\rm external/io_grib1/build
+\rm external/io_grib1/grib1_util
+mkdir external/io_grib1/MEL_grib1
+ln -sf $WRFSRC/WRFV2/external/io_grib1/MEL_grib1/* external/io_grib1/MEL_grib1/
+mkdir external/io_grib1/WGRIB
+ln -sf $WRFSRC/WRFV2/external/io_grib1/WGRIB/* external/io_grib1/WGRIB/
+mkdir external/io_grib1/grib1_util
+ln -sf $WRFSRC/WRFV2/external/io_grib1/grib1_util/* external/io_grib1/grib1_util/
+mkdir external/io_grib1/build
+mkdir external/io_grib_share
+ln -sf $WRFSRC/WRFV2/external/io_grib_share/* external/io_grib_share/
+\rm external/io_grib_share/build
+mkdir external/io_grib_share/build
+ln -sf $WRFSRC/WRFV2/external/io_grib_share/build/* external/io_grib_share/build/
+mkdir external/ioapi_share
+ln -sf $WRFSRC/WRFV2/external/ioapi_share/* external/ioapi_share/
+mkdir external/io_phdf5
+ln -sf $WRFSRC/WRFV2/external/io_phdf5/* external/io_phdf5/
+mkdir external/RSL_LITE
+ln -sf $WRFSRC/WRFV2/external/RSL_LITE/* external/RSL_LITE/
+mkdir external/io_grib2
+ln -sf $WRFSRC/WRFV2/external/io_grib2/* external/io_grib2/
+\rm external/io_grib2/bacio-1.3
+\rm external/io_grib2/g2lib
+mkdir external/io_grib2/bacio-1.3
+ln -sf $WRFSRC/WRFV2/external/io_grib2/bacio-1.3/* external/io_grib2/bacio-1.3/
+mkdir external/io_grib2/g2lib
+ln -sf $WRFSRC/WRFV2/external/io_grib2/g2lib/* external/io_grib2/g2lib/
+mkdir external/io_pnetcdf
+ln -sf $WRFSRC/WRFV2/external/io_pnetcdf/* external/io_pnetcdf/
+mkdir external/RSL
+ln -sf $WRFSRC/WRFV2/external/RSL/* external/RSL/
+\rm external/RSL/RSL
+mkdir external/RSL/RSL
+ln -sf $WRFSRC/WRFV2/external/RSL/RSL/* external/RSL/RSL/
+mkdir external/io_esmf
+ln -sf $WRFSRC/WRFV2/external/io_esmf/* external/io_esmf/
+mkdir external/io_mcel
+ln -sf $WRFSRC/WRFV2/external/io_mcel/* external/io_mcel/
+mkdir mars_lmd
+mkdir mars_lmd/libf
+ln -sf $WRFSRC/WRFV2/mars_lmd/makegcm* mars_lmd/
+ln -sf $WRFSRC/WRFV2/mars_lmd/create_make_gcm mars_lmd/
+#ln -sf $WRFSRC/WRFV2/mars_lmd/makefile mars_lmd/
+ln -sf $WRFSRC/WRFV2/mars_lmd/libf/duplicate* mars_lmd/libf/
+ln -sf $WRFSRC/WRFV2/mars_lmd/libf/generate* mars_lmd/libf/
+
+mkdir mars_lmd/libf/grid
+ln -sf $WRFSRC/WRFV2/mars_lmd/libf/grid/* mars_lmd/libf/grid/
+mkdir mars_lmd/libf/phymars
+ln -sf $WRFSRC/WRFV2/mars_lmd/libf/phymars/* mars_lmd/libf/phymars/
+mkdir mars_lmd/libf/dyn3d
+ln -sf $WRFSRC/WRFV2/mars_lmd/libf/dyn3d/* mars_lmd/libf/dyn3d/
+mkdir mars_lmd/libf/aeronomars
+ln -sf $WRFSRC/WRFV2/mars_lmd/libf/aeronomars/* mars_lmd/libf/aeronomars/
+mkdir mars_lmd/libf/bibio
+ln -sf $WRFSRC/WRFV2/mars_lmd/libf/bibio/* mars_lmd/libf/bibio/
+mkdir mars_lmd/libo
+#touch mars_lmd/makefile
+
+mkdir test
+mkdir test/em_real
+mkdir test/em_quarter_ss
+ln -sf $WRFSRC/WRFV2/test/em_real/* test/em_real/
+
+cd mars_lmd/libf/phymars/
+\rm dimphys.h
+#ln -sf ../../../meso_dimphys.h dimphys.h
+cd ../../..
+
+echo '*** end'
+
+
+
+
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/datesave
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/datesave	(revision 206)
+++ 	(revision )
@@ -1,1 +1,0 @@
-Mon Jan 24 21:14:16 CET 2011
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/prepare
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/prepare	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/prepare	(revision 207)
@@ -0,0 +1,76 @@
+#! /bin/bash
+
+#---------------------------------------#
+# A script to install the model         #
+#---------------------------------------#
+# Author: Aymeric Spiga - November 2008 #
+#---------------------------------------#
+
+
+touch download_log
+
+mkdir SRC
+cd SRC/
+
+mv ../g95.tar.gz .
+mv ../mac.tar.gz .
+mv ../datesave .
+mv ../saved .
+mv ../INIT_SIMPLE_TEST.tar.gz .
+mv ../POSTPROC.tar.gz .
+
+echo 1/8 get WRF sources
+wget http://www.mmm.ucar.edu/wrf/src/WRFV2.2.TAR.gz . >> ../download_log 2>> ../download_log
+tar xzvf WRFV2.2.TAR.gz > /dev/null
+\rm WRFV2.2.TAR.gz 
+## patch
+wget http://www.mmm.ucar.edu/wrf/src/fix/rsl_bcast.c . >> ../download_log 2>> ../download_log
+mv -f rsl_bcast.c WRFV2/external/RSL_LITE/
+wget http://www.mmm.ucar.edu/wrf/src/fix/solve_em.F.fix . >> ../download_log 2>> ../download_log
+mv -f solve_em.F.fix WRFV2/dyn_em/solve_em.F
+## patch
+
+echo 2/8 get WPS sources
+wget wget http://www.mmm.ucar.edu/wrf/src/WPSV2.2.TAR.gz . >> ../download_log 2>> ../download_log
+tar xzvf WPSV2.2.TAR.gz > /dev/null
+\rm WPSV2.2.TAR.gz
+
+echo 3/8 get WRF modified Martian sources
+mv ../sources_Mars.tar.gz .
+tar xzvf sources_Mars.tar.gz > /dev/null
+cp -rf save/* WRFV2/
+\rm -rf save
+\rm sources_Mars.tar.gz 
+
+echo 4/8 get WPS modified Martian sources
+mv ../WPS.tar.gz .
+tar xzvf WPS.tar.gz > /dev/null
+cd WPS
+#cp -f /donnees/aslmd/WRF/SRC/WPS/wps_mars/switch_WPS_Mars .
+./switch_WPS_Mars
+cd ..
+\rm WPS.tar.gz
+
+echo 5/8 get ARWpost for Mars
+mv ../ARWpost.tar.gz .
+tar xzvf ARWpost.tar.gz > /dev/null
+\rm ARWpost.tar.gz
+
+echo 6/8 get PREP_MARS
+mv ../PREP_MARS.tar.gz .
+tar xzvf PREP_MARS.tar.gz > /dev/null
+\rm PREP_MARS.tar.gz
+
+cd ..
+
+echo 7/8 get surface data utilities
+tar xzvf WPS_GEOG.tar.gz > /dev/null
+wget http://web.lmd.jussieu.fr/~forget/datagcm/datafile/dust_tes.nc . >> ./download_log 2>> ./download_log
+mv dust_tes.nc WPS_GEOG/
+\rm WPS_GEOG.tar.gz
+
+echo 8/8 get run utilies
+tar xzvf SIMU.tar.gz > /dev/null
+\rm SIMU.tar.gz
+
+echo ok
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/prepare_ini
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/prepare_ini	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/prepare_ini	(revision 207)
@@ -0,0 +1,100 @@
+#! /bin/bash
+
+#---------------------------------------#
+# A script to install the preproc tools #
+#---------------------------------------#
+# Author: Aymeric Spiga - November 2008 #
+#---------------------------------------#
+
+
+echo "If you use new physics, few modifications will be needed"
+
+
+if [[ "${LMDMOD}" = "" ]]
+then
+    echo "No LMDMOD defined...assuming default folders"
+    LMDMOD=$PWD"/../.."
+fi
+
+
+###############
+tmpdir=$LMDMOD/TMPDIR
+lmdmeso=$LMDMOD/LMD_MM_MARS
+sourceprepmars=$lmdmeso"/SRC/PREP_MARS"
+sourcewps=$lmdmeso"/SRC/WPS"
+###############
+
+echo create tmpdir directories
+mkdir $tmpdir/WPSFEED 2> /dev/null
+mkdir $tmpdir/WRFFEED 2> /dev/null
+#mkdir $tmpdir/WRFFEED/current 2> /dev/null
+mkdir $tmpdir/GCMINI 2> /dev/null
+
+here=$PWD
+\rm -rf $here/PREP_MARS $here/WPS 2> /dev/null
+
+echo link PREP_MARS in $here
+
+mkdir $here/PREP_MARS
+cd $here/PREP_MARS
+ln -sf ${sourceprepmars}/* .
+ln -sf $tmpdir/WPSFEED .
+ln -sf $tmpdir/GCMINI/diagfi.nc input_diagfi.nc
+cd $here
+
+echo prepare WPS in $here
+
+	####### done in prepare
+	###cd ${sourcewps}
+	###cp ${sourcewps}/wps_mars/switch_WPS_Mars ${sourcewps}
+	###./switch_WPS_Mars
+
+cd ${here}
+mkdir $here/WPS
+cd ${here}/WPS
+ln -sf ${sourcewps}/compile .
+ln -sf ${sourcewps}/configure .
+ln -sf ${sourcewps}/clean .
+ln -sf ${sourcewps}/arch .
+ln -sf $tmpdir/WPSFEED .
+ln -sf $tmpdir/WRFFEED .
+
+mkdir ${here}/WPS/geogrid
+cd ${here}/WPS/geogrid
+	#cp -f ${sourcewps}/geogrid/GEOGRID.TBL.ARW GEOGRID.TBL
+	#echo "attention GEOGRID.TBL n est pas le bon !!!!"
+ln -sf ${sourcewps}/wps_mars/geogrid/GEOGRID.TBL.ARW_Mars GEOGRID.TBL
+cp -f ${sourcewps}/geogrid/Makefile .
+mkdir src
+cd src
+ln -sf ${sourcewps}/geogrid/src/* .  
+cd ${here}/WPS  
+
+mkdir ${here}/WPS/metgrid
+cd ${here}/WPS/metgrid
+	#cp -f ${sourcewps}/metgrid/METGRID.TBL.ARW METGRID.TBL
+	#echo "attention METGRID.TBL n est pas le bon !!!!"
+ln -sf ${sourcewps}/wps_mars/metgrid/METGRID.TBL.ARW_MarsBase_newphys METGRID.TBL
+cp -f ${sourcewps}/metgrid/Makefile .
+mkdir src
+cd src
+ln -sf ${sourcewps}/metgrid/src/* .
+cd ${here}/WPS
+
+##
+## examples and plots
+##
+#ln -sf ${sourcewps}/wps_mars/out_geo.pro .
+ln -sf ${sourcewps}/wps_mars/namelist.wps* .
+#ln -sf ${lmdmeso}/SRC/ARWpost/idl/colorbar__define.pro .
+#ln -sf ${lmdmeso}/SRC/ARWpost/idl/colorbar.pro .
+#ln -sf ${lmdmeso}/SRC/ARWpost/idl/map_latlon.pro .
+
+#
+# link to static data
+#
+ln -sf ${lmdmeso}/WPS_GEOG .
+
+exit
+
+
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/prepare_offline
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/prepare_offline	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/prepare_offline	(revision 207)
@@ -0,0 +1,84 @@
+#! /bin/bash
+
+#---------------------------------------#
+# A script to install the model         #
+#---------------------------------------#
+# Author: Aymeric Spiga - November 2008 #
+#---------------------------------------#
+
+
+touch download_log
+
+mkdir SRC
+cd SRC/
+
+cp -f ../../dl.tar.gz .
+
+mv ../g95.tar.gz .
+mv ../mac.tar.gz .
+mv ../datesave .
+mv ../saved .
+mv ../INIT_SIMPLE_TEST.tar.gz .
+
+###########################
+gunzip dl.tar.gz
+tar xf dl.tar
+cp -rf dl/* .
+rm -rf dl 
+rm -rf dl.tar
+###########################
+
+echo 1/8 get WRF sources
+gunzip  WRFV2.2.TAR.gz  > /dev/null
+tar xf  WRFV2.2.TAR     > /dev/null
+\rm     WRFV2.2.TAR 
+## patch
+mv -f rsl_bcast.c WRFV2/external/RSL_LITE/
+mv -f solve_em.F.fix WRFV2/dyn_em/solve_em.F
+## patch
+
+echo 2/8 get WPS sources
+gunzip  WPSV2.2.TAR.gz  > /dev/null
+tar xf  WPSV2.2.TAR     > /dev/null
+\rm     WPSV2.2.TAR
+
+echo 3/8 get WRF modified Martian sources
+mv ../sources_Mars.tar.gz .
+gunzip  sources_Mars.tar.gz  > /dev/null
+tar xf  sources_Mars.tar     > /dev/null
+cp -rf save/* WRFV2/
+\rm -rf save
+\rm     sources_Mars.tar 
+
+echo 4/8 get WPS modified Martian sources
+mv ../WPS.tar.gz .
+gunzip  WPS.tar.gz  > /dev/null
+tar xf  WPS.tar     > /dev/null
+\rm     WPS.tar
+
+echo 5/8 get ARWpost for Mars
+mv ../ARWpost.tar.gz .
+gunzip  ARWpost.tar.gz  > /dev/null
+tar xf  ARWpost.tar     > /dev/null
+\rm     ARWpost.tar
+
+echo 6/8 get PREP_MARS
+mv ../PREP_MARS.tar.gz .
+gunzip  PREP_MARS.tar.gz  > /dev/null
+tar xf  PREP_MARS.tar     > /dev/null
+\rm     PREP_MARS.tar
+
+cd ..
+
+echo 7/8 get surface data utilities
+gunzip  WPS_GEOG.tar.gz  > /dev/null
+tar xf  WPS_GEOG.tar     > /dev/null
+mv SRC/dust_tes.nc WPS_GEOG/
+\rm     WPS_GEOG.tar
+
+echo 8/8 get run utilies
+gunzip  SIMU.tar.gz      > /dev/null
+tar xf  SIMU.tar         > /dev/null
+\rm     SIMU.tar
+
+echo ok
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/save_all
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/save_all	(revision 207)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/save_all	(revision 207)
@@ -0,0 +1,82 @@
+#! /bin/bash
+
+
+### must do something to remove .svn in save files 
+### find * */* */*/* -iname .svn
+
+echo Saving LMD_MM_MARS !
+
+mkdir clean
+
+cd SRC
+
+  cd WRFV2
+    save_changes
+    mv sources_Mars.tar.gz ../../clean/
+    mv saved ../../clean/
+  cd ..
+
+  tar czvf ARWpost.tar.gz ARWpost
+  mv ARWpost.tar.gz ../clean/
+
+  #tar czvf INIT_SIMPLE_TEST.tar.gz INIT_SIMPLE_TEST
+  #mv INIT_SIMPLE_TEST.tar.gz ../clean/
+  cp INIT_SIMPLE_TEST.tar.gz ../clean/
+
+  tar czvf PREP_MARS.tar.gz PREP_MARS
+  mv PREP_MARS.tar.gz ../clean/
+
+  tar czvf WPS.tar.gz WPS/switch* WPS/wps_mars
+  mv WPS.tar.gz ../clean/
+
+  #tar czvf g95.tar.gz g95
+  #mv g95.tar.gz ../clean/
+  cp g95.tar.gz ../clean/
+
+  #tar czvf mac.tar.gz mac
+  #mv mac.tar.gz ../clean/
+  cp mac.tar.gz ../clean/
+
+  tar czvf POSTPROC.tar.gz POSTPROC
+  mv POSTPROC.tar.gz ../clean/
+
+
+cd ..
+
+tar czvf SIMU.tar.gz SIMU
+mv SIMU.tar.gz clean/
+
+tar czvf WPS_GEOG.tar.gz WPS_GEOG/res WPS_GEOG/*_GCM
+mv WPS_GEOG.tar.gz clean/
+
+#cd WPS_GEOG
+#cd not_used
+#save_wps_geog
+#mv -f WPS_GEOG.tar.gz ../../clean/
+#cd ../..
+
+cp copy_model clean/
+cp save_all clean/
+cp makemeso clean/
+cp prepare clean/
+cp build_static clean/
+cp prepare_ini clean/
+cp prepare_post clean/
+cp prepare_offline clean/
+
+date > clean/datesave
+cp -f clean/datesave SRC/
+cp -f clean/saved SRC/
+
+#mv clean `date +LMD_MM_MARS_%Y_%m_%d`
+mv clean LMD_MM_MARS
+
+tar czvf `date +LMD_MM_MARS_%Y_%m_%d.tar.gz` LMD_MM_MARS #`date +LMD_MM_MARS_%Y_%m_%d` 
+rm -rf LMD_MM_MARS #`date +LMD_MM_MARS_%Y_%m_%d`
+
+if [[ -d TESTCASE ]]
+then
+tar czvf DATA.tar.gz TESTCASE
+mv DATA.tar.gz LMD_MM_MARS_TESTCASE.tar.gz
+fi
+
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/saved
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/saved	(revision 206)
+++ 	(revision )
@@ -1,1378 +1,0 @@
-BACKUP info:
---------------
-aslmd
-Mon Jan 24 21:14:10 CET 2011
---------------
-save/
-save/configure.wrf.backup
-save/configure.wrf_Mars
-save/configure.wrf_MPICH
-save/configure.wrf_regular
-save/wash_away
-save/save_changes
-save/dyn_em_save
-save/external_save
-save/mars_lmd_save
-save/phys_save
-save/Registry_save
-save/share_save
-save/meso_callkeys.h
-save/meso_datafile.h
-save/meso_datafile.h~
-save/mars.sed
-save/configure.defaults.fix64nest
-save/configure.defaults.gfortran64
-save/dyn_em/
-save/dyn_em/diff_module_diffusion_em
-save/dyn_em/diff_module_em
-save/dyn_em/module_em.F
-save/dyn_em/diff_module_initialize_hill2d_x
-save/dyn_em/diff_module_initialize_real
-save/dyn_em/diff_solve_em
-save/dyn_em/diff_start_em
-save/dyn_em/start_em.F
-save/dyn_em/solve_em.F
-save/dyn_em/module_big_step_utilities_em.F
-save/dyn_em/Makefile
-save/dyn_em/module_diffusion_em.F
-save/dyn_em/module_initialize_quarter_ss.F
-save/dyn_em/module_initialize_quarter_ss.F_gcm
-save/dyn_em/module_initialize_quarter_ss.F_ref
-save/dyn_em/diff_Makefile
-save/dyn_em/module_initialize_hill2d_x.F
-save/dyn_em/module_initialize_real.F
-save/dyn_em/module_initialize_real_method1_2interp.F
-save/dyn_em/module_initialize_real_method2_1param1interp.F
-save/dyn_em/diff_module_big_step_utilities_em
-save/call_meso_inifis1.inc
-save/call_meso_inifis2.inc
-save/call_meso_inifis3.inc
-save/call_meso_inifis4.inc
-save/call_meso_inifis.inc
-save/call_meso_physiq1.inc
-save/call_meso_physiq2.inc
-save/call_meso_physiq3.inc
-save/call_meso_physiq4.inc
-save/call_meso_physiq.inc
-save/custom_user.inc
-save/external/
-save/external/esmf_time_f90/
-save/external/esmf_time_f90/diff_ESMF_TimeMgr
-save/external/esmf_time_f90/diff_Meat
-save/external/esmf_time_f90/diff_Test1
-save/external/esmf_time_f90/ESMF_Calendar.F90
-save/external/esmf_time_f90/ESMF_TimeMgr.inc
-save/external/esmf_time_f90/Meat.F90
-save/external/esmf_time_f90/Test1.F90
-save/external/esmf_time_f90/diff_ESMF_Calendar
-save/mars_lmd/
-save/mars_lmd/create_make_gcm
-save/mars_lmd/error_libc
-save/mars_lmd/liste_des_sources_f77
-save/mars_lmd/liste_des_sources_f90
-save/mars_lmd/makefile
-save/mars_lmd/makefile_init
-save/mars_lmd/libf/
-save/mars_lmd/libf/bibio/
-save/mars_lmd/libf/bibio/from36.F
-save/mars_lmd/libf/bibio/ini36.F
-save/mars_lmd/libf/bibio/cvmgp.F
-save/mars_lmd/libf/bibio/cvmgt.F
-save/mars_lmd/libf/bibio/isitor.F
-save/mars_lmd/libf/bibio/lmdstd.h
-save/mars_lmd/libf/bibio/lnblnk.F
-save/mars_lmd/libf/bibio/mywrite.F
-save/mars_lmd/libf/bibio/readcoord.F
-save/mars_lmd/libf/bibio/readstd.F
-save/mars_lmd/libf/bibio/to36.F
-save/mars_lmd/libf/bibio/gather.F
-save/mars_lmd/libf/bibio/writestd.F
-save/mars_lmd/libf/bibio/ilsum.F
-save/mars_lmd/libf/bibio/isamax.F
-save/mars_lmd/libf/bibio/ismax.F
-save/mars_lmd/libf/bibio/ismin.F
-save/mars_lmd/libf/bibio/mxm.F
-save/mars_lmd/libf/bibio/mxva.F
-save/mars_lmd/libf/bibio/mxv.F
-save/mars_lmd/libf/bibio/scatter.F
-save/mars_lmd/libf/bibio/scopy.F
-save/mars_lmd/libf/bibio/scopyi.F
-save/mars_lmd/libf/bibio/sdot.F
-save/mars_lmd/libf/bibio/ssum.F
-save/mars_lmd/libf/bibio/uniplot.F
-save/mars_lmd/libf/bibio/wheneq.F
-save/mars_lmd/libf/bibio/cbrt.F
-save/mars_lmd/libf/bibio/mxva.F_old
-save/mars_lmd/libf/bibio/.svn/
-save/mars_lmd/libf/bibio/.svn/text-base/
-save/mars_lmd/libf/bibio/.svn/text-base/cbrt.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/cvmgp.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/cvmgt.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/from36.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/gather.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/ilsum.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/ini36.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/isamax.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/isitor.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/ismax.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/ismin.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/lmdstd.h.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/lnblnk.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/mxm.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/mxv.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/mxva.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/mxva.F_old.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/mywrite.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/readcoord.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/readstd.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/scatter.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/scopy.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/scopyi.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/sdot.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/ssum.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/to36.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/uniplot.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/wheneq.F.svn-base
-save/mars_lmd/libf/bibio/.svn/text-base/writestd.F.svn-base
-save/mars_lmd/libf/bibio/.svn/prop-base/
-save/mars_lmd/libf/bibio/.svn/props/
-save/mars_lmd/libf/bibio/.svn/tmp/
-save/mars_lmd/libf/bibio/.svn/tmp/text-base/
-save/mars_lmd/libf/bibio/.svn/tmp/prop-base/
-save/mars_lmd/libf/bibio/.svn/tmp/props/
-save/mars_lmd/libf/bibio/.svn/entries
-save/mars_lmd/libf/bibio/.svn/format
-save/mars_lmd/libf/bibio/.svn/all-wcprops
-save/mars_lmd/libf/grid/
-save/mars_lmd/libf/grid/dimension/
-save/mars_lmd/libf/grid/dimension/makdim
-save/mars_lmd/libf/grid/dimension/dimensions.50.t1
-save/mars_lmd/libf/grid/dimension/dimensions.99.t1
-save/mars_lmd/libf/grid/dimension/dimensions.190.t1
-save/mars_lmd/libf/grid/dimension/dimensions.49.t1
-save/mars_lmd/libf/grid/dimension/dimensions.149.t1
-save/mars_lmd/libf/grid/dimension/dimensions.100.t1
-save/mars_lmd/libf/grid/dimension/dimensions.1.t1
-save/mars_lmd/libf/grid/dimension/dimensions.25.t1
-save/mars_lmd/libf/grid/dimension/dimensions.24.t1
-save/mars_lmd/libf/grid/dimension/dimensions.51.t1
-save/mars_lmd/libf/grid/dimension/dimensions.30.t1
-save/mars_lmd/libf/grid/dimension/dimensions.59.t1
-save/mars_lmd/libf/grid/dimension/dimensions.60.t1
-save/mars_lmd/libf/grid/dimension/dimensions.74.t1
-save/mars_lmd/libf/grid/dimension/dimensions.64.t1
-save/mars_lmd/libf/grid/dimension/dimensions.69.t1
-save/mars_lmd/libf/grid/dimension/dimensions.73.t1
-save/mars_lmd/libf/grid/dimension/dimensions.70.t1
-save/mars_lmd/libf/grid/dimension/dimensions.71.t1
-save/mars_lmd/libf/grid/dimension/dimensions.61.t1
-save/mars_lmd/libf/grid/dimension/dimensions.12.t1
-save/mars_lmd/libf/grid/dimension/dimensions.61.t2
-save/mars_lmd/libf/grid/dimension/dimensions.60.t2
-save/mars_lmd/libf/grid/dimension/dimensions.25.t2
-save/mars_lmd/libf/grid/dimension/dimensions.24.t2
-save/mars_lmd/libf/grid/dimension/dimensions.50.t2
-save/mars_lmd/libf/grid/dimension/dimensions.30.t2
-save/mars_lmd/libf/grid/dimension/dimensions.26.t2
-save/mars_lmd/libf/grid/dimension/dimensions.10.t1
-save/mars_lmd/libf/grid/dimension/dimensions.34.t1
-save/mars_lmd/libf/grid/dimension/dimensions.3.t1
-save/mars_lmd/libf/grid/dimension/dimensions.44.t1
-save/mars_lmd/libf/grid/dimension/dimensions.39.t1
-save/mars_lmd/libf/grid/dimension/dimensions.29.t1
-save/mars_lmd/libf/grid/dimension/dimensions.144.t1
-save/mars_lmd/libf/grid/dimension/dimensions.200.t1
-save/mars_lmd/libf/grid/dimension/dimensions.150.t1
-save/mars_lmd/libf/grid/dimension/dimensions.180.t1
-save/mars_lmd/libf/grid/dimension/.svn/
-save/mars_lmd/libf/grid/dimension/.svn/text-base/
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.1.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.10.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.100.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.12.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.144.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.149.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.150.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.180.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.190.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.200.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.24.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.24.t2.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.25.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.25.t2.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.26.t2.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.29.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.3.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.30.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.30.t2.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.34.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.39.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.44.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.49.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.50.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.50.t2.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.51.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.59.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.60.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.60.t2.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.61.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.61.t2.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.64.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.69.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.70.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.71.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.73.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.74.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.99.t1.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/text-base/makdim.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/prop-base/
-save/mars_lmd/libf/grid/dimension/.svn/prop-base/makdim.svn-base
-save/mars_lmd/libf/grid/dimension/.svn/props/
-save/mars_lmd/libf/grid/dimension/.svn/tmp/
-save/mars_lmd/libf/grid/dimension/.svn/tmp/text-base/
-save/mars_lmd/libf/grid/dimension/.svn/tmp/prop-base/
-save/mars_lmd/libf/grid/dimension/.svn/tmp/props/
-save/mars_lmd/libf/grid/dimension/.svn/entries
-save/mars_lmd/libf/grid/dimension/.svn/format
-save/mars_lmd/libf/grid/dimension/.svn/all-wcprops
-save/mars_lmd/libf/grid/fxy_new.h
-save/mars_lmd/libf/grid/fxyprim.h
-save/mars_lmd/libf/grid/fxy_reg.h
-save/mars_lmd/libf/grid/fxy_sin.h
-save/mars_lmd/libf/grid/.svn/
-save/mars_lmd/libf/grid/.svn/text-base/
-save/mars_lmd/libf/grid/.svn/text-base/fxy_new.h.svn-base
-save/mars_lmd/libf/grid/.svn/text-base/fxy_reg.h.svn-base
-save/mars_lmd/libf/grid/.svn/text-base/fxy_sin.h.svn-base
-save/mars_lmd/libf/grid/.svn/text-base/fxyprim.h.svn-base
-save/mars_lmd/libf/grid/.svn/prop-base/
-save/mars_lmd/libf/grid/.svn/props/
-save/mars_lmd/libf/grid/.svn/tmp/
-save/mars_lmd/libf/grid/.svn/tmp/text-base/
-save/mars_lmd/libf/grid/.svn/tmp/prop-base/
-save/mars_lmd/libf/grid/.svn/tmp/props/
-save/mars_lmd/libf/grid/.svn/entries
-save/mars_lmd/libf/grid/.svn/format
-save/mars_lmd/libf/grid/.svn/all-wcprops
-save/mars_lmd/libf/phymars/
-save/mars_lmd/libf/phymars/aerave.F
-save/mars_lmd/libf/phymars/aerdata.h
-save/mars_lmd/libf/phymars/aerice.h.005
-save/mars_lmd/libf/phymars/blendrad.F
-save/mars_lmd/libf/phymars/calldrag_noro.F
-save/mars_lmd/libf/phymars/callradite.F
-save/mars_lmd/libf/phymars/callsedim.F
-save/mars_lmd/libf/phymars/callsedim2q.F
-save/mars_lmd/libf/phymars/aerdust.h
-save/mars_lmd/libf/phymars/co2snow.F
-save/mars_lmd/libf/phymars/comcstfi.h
-save/mars_lmd/libf/phymars/comdiurn.h
-save/mars_lmd/libf/phymars/comg1d.h
-save/mars_lmd/libf/phymars/comgeomfi.h
-save/mars_lmd/libf/phymars/watercloud.F
-save/mars_lmd/libf/phymars/sugwd.F
-save/mars_lmd/libf/phymars/comorbit.h
-save/mars_lmd/libf/phymars/lwu.F
-save/mars_lmd/libf/phymars/growthrate.F
-save/mars_lmd/libf/phymars/tabfi.F
-save/mars_lmd/libf/phymars/comsaison.h
-save/mars_lmd/libf/phymars/phyetat0.F
-save/mars_lmd/libf/phymars/convadj.F
-save/mars_lmd/libf/phymars/cvmgp.F
-save/mars_lmd/libf/phymars/cvmgt.F
-save/mars_lmd/libf/phymars/datareadnc.F
-save/mars_lmd/libf/phymars/dedd.F
-save/mars_lmd/libf/phymars/dimradmars.h
-save/mars_lmd/libf/phymars/drag_noro.F
-save/mars_lmd/libf/phymars/dustdevil.F
-save/mars_lmd/libf/phymars/dustlift.F
-save/mars_lmd/libf/phymars/eofdump.F
-save/mars_lmd/libf/phymars/eofdump.h
-save/mars_lmd/libf/phymars/ineofdump.F
-save/mars_lmd/libf/phymars/flusv.F
-save/mars_lmd/libf/phymars/yomlw.h
-save/mars_lmd/libf/phymars/aerice.h.01
-save/mars_lmd/libf/phymars/gwprofil.F
-save/mars_lmd/libf/phymars/gwstress.F
-save/mars_lmd/libf/phymars/lwflux.F
-save/mars_lmd/libf/phymars/lwmain.F
-save/mars_lmd/libf/phymars/ismax.F
-save/mars_lmd/libf/phymars/meso_testphys1d.F
-save/mars_lmd/libf/phymars/iniorbit.F
-save/mars_lmd/libf/phymars/vdifc.F
-save/mars_lmd/libf/phymars/meso_readtesassim.F90
-save/mars_lmd/libf/phymars/wstats.F90
-save/mars_lmd/libf/phymars/lwi.F
-save/mars_lmd/libf/phymars/param_slope_full.F90
-save/mars_lmd/libf/phymars/ismin.F
-save/mars_lmd/libf/phymars/lwxb.F
-save/mars_lmd/libf/phymars/lwb.F
-save/mars_lmd/libf/phymars/lwdiff.F
-save/mars_lmd/libf/phymars/lwxd.F
-save/mars_lmd/libf/phymars/lwxn.F
-save/mars_lmd/libf/phymars/aerice.h.02
-save/mars_lmd/libf/phymars/lwtt.F
-save/mars_lmd/libf/phymars/aerice.h.03
-save/mars_lmd/libf/phymars/aerice.h.04
-save/mars_lmd/libf/phymars/aerice.h.05
-save/mars_lmd/libf/phymars/aerice.h.10
-save/mars_lmd/libf/phymars/mucorr.F
-save/mars_lmd/libf/phymars/mufract.F
-save/mars_lmd/libf/phymars/newcondens.F
-save/mars_lmd/libf/phymars/tracer.h
-save/mars_lmd/libf/phymars/initracer.F
-save/mars_lmd/libf/phymars/watercap.h
-save/mars_lmd/libf/phymars/aerice.h
-save/mars_lmd/libf/phymars/newsedim.F
-save/mars_lmd/libf/phymars/nirco2abs.F
-save/mars_lmd/libf/phymars/nltecool.F
-save/mars_lmd/libf/phymars/aerdust.h.clan91
-save/mars_lmd/libf/phymars/nltedata.h
-save/mars_lmd/libf/phymars/nlteparams.h
-save/mars_lmd/libf/phymars/nlthermeq.F
-save/mars_lmd/libf/phymars/orbite.F
-save/mars_lmd/libf/phymars/orodrag.F
-save/mars_lmd/libf/phymars/orosetup.F
-save/mars_lmd/libf/phymars/fisice.h
-save/mars_lmd/libf/phymars/physdem1.F
-save/mars_lmd/libf/phymars/planete.h
-save/mars_lmd/libf/phymars/profile.F
-save/mars_lmd/libf/phymars/scatter.F
-save/mars_lmd/libf/phymars/scopyi.F
-save/mars_lmd/libf/phymars/soil.F
-save/mars_lmd/libf/phymars/solang.F
-save/mars_lmd/libf/phymars/solarlong.F
-save/mars_lmd/libf/phymars/statto.h
-save/mars_lmd/libf/phymars/suaer.F
-save/mars_lmd/libf/phymars/sulw.F
-save/mars_lmd/libf/phymars/blackl.F
-save/mars_lmd/libf/phymars/vdif_cd.F
-save/mars_lmd/libf/phymars/def_var.F90
-save/mars_lmd/libf/phymars/surfdat.h
-save/mars_lmd/libf/phymars/surfini.F
-save/mars_lmd/libf/phymars/swmain.F
-save/mars_lmd/libf/phymars/swr.F
-save/mars_lmd/libf/phymars/swrayleigh.F
-save/mars_lmd/libf/phymars/uniplot.F
-save/mars_lmd/libf/phymars/vdif_kc.F
-save/mars_lmd/libf/phymars/vlz_fi.F
-save/mars_lmd/libf/phymars/watersat.F
-save/mars_lmd/libf/phymars/callkeys.h
-save/mars_lmd/libf/phymars/writeg1d.F
-save/mars_lmd/libf/phymars/yoegwd.h
-save/mars_lmd/libf/phymars/yomaer.h
-save/mars_lmd/libf/phymars/zerophys.F
-save/mars_lmd/libf/phymars/mkstat.F90
-save/mars_lmd/libf/phymars/inistats.F
-save/mars_lmd/libf/phymars/aerdust.h.ocke97
-save/mars_lmd/libf/phymars/readtesassim.F90
-save/mars_lmd/libf/phymars/multipl.F
-save/mars_lmd/libf/phymars/datafile.h
-save/mars_lmd/libf/phymars/meso_physiq.F
-save/mars_lmd/libf/phymars/meso_writediagfi.F
-save/mars_lmd/libf/phymars/meso_inifis.F
-save/mars_lmd/libf/phymars/meso_dustopacity.F
-save/mars_lmd/libf/phymars/param_slope.F90
-save/mars_lmd/libf/phymars/meso_dimphys.h_ref
-save/mars_lmd/libf/phymars/meso_physiq.F_old
-save/mars_lmd/libf/phymars/meso_physiq.F~
-save/mars_lmd/libf/phymars/slope.h
-save/mars_lmd/libf/phymars/param_slope.F90~
-save/mars_lmd/libf/phymars/param_slope_full.F90~
-save/mars_lmd/libf/phymars/slope.h~
-save/mars_lmd/libf/phymars/callradite.F~
-save/mars_lmd/libf/phymars/vdifc.F~
-save/mars_lmd/libf/phymars/fill_save.inc
-save/mars_lmd/libf/phymars/fill_save_2d.F90
-save/mars_lmd/libf/phymars/wrf_output_2d.h
-save/mars_lmd/libf/phymars/wrf_output_3d.h
-save/mars_lmd/libf/phymars/dimphys.h
-save/mars_lmd/libf/phymars/dimradmars.h~
-save/mars_lmd/libf/phymars/lwu.F~
-save/mars_lmd/libf/phymars/.svn/
-save/mars_lmd/libf/phymars/.svn/text-base/
-save/mars_lmd/libf/phymars/.svn/text-base/aerave.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/aerdata.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/aerdust.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/aerdust.h.clan91.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/aerdust.h.ocke97.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.005.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.01.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.02.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.03.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.04.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.05.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.10.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/blackl.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/blendrad.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/dedd.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/calldrag_noro.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/callkeys.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/callradite.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/callsedim.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/callsedim2q.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/co2snow.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/comcstfi.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/comdiurn.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/comg1d.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/comgeomfi.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/comorbit.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/comsaison.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/convadj.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/cvmgp.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/cvmgt.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/datafile.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/datareadnc.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/def_var.F90.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/dimphys.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/dimradmars.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/drag_noro.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/dustdevil.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/dustlift.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/eofdump.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/eofdump.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/fill_save.inc.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/fill_save_2d.F90.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/fisice.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/flusv.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/growthrate.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/gwprofil.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/gwstress.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/ineofdump.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/iniorbit.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/inistats.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/initracer.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/ismax.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/ismin.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/lwb.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/lwdiff.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/lwflux.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/lwi.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/lwmain.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/lwtt.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/lwu.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/lwxb.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/lwxd.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/lwxn.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/meso_dimphys.h_ref.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/meso_dustopacity.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/meso_inifis.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/meso_physiq.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/meso_physiq.F_old.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/meso_readtesassim.F90.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/meso_testphys1d.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/meso_writediagfi.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/mkstat.F90.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/mucorr.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/mufract.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/multipl.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/newcondens.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/newsedim.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/nirco2abs.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/nltecool.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/nltedata.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/nlteparams.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/nlthermeq.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/orbite.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/orodrag.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/orosetup.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/param_slope.F90.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/param_slope_full.F90.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/phyetat0.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/physdem1.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/planete.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/profile.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/readtesassim.F90.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/scatter.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/scopyi.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/slope.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/soil.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/solang.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/solarlong.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/statto.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/suaer.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/sugwd.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/sulw.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/surfdat.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/surfini.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/swmain.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/swr.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/swrayleigh.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/tabfi.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/tracer.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/uniplot.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/vdif_cd.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/vdif_kc.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/vdifc.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/vlz_fi.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/watercap.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/watercloud.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/watersat.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/wrf_output_2d.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/wrf_output_3d.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/writeg1d.F.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/wstats.F90.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/yoegwd.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/yomaer.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/yomlw.h.svn-base
-save/mars_lmd/libf/phymars/.svn/text-base/zerophys.F.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/
-save/mars_lmd/libf/phymars/.svn/prop-base/aerdata.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/callkeys.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/comcstfi.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/comdiurn.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/comg1d.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/comgeomfi.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/comorbit.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/comsaison.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/datafile.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/dimradmars.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/eofdump.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/meso_dimphys.h_ref.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/nltedata.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/nlteparams.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/planete.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/statto.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/surfdat.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/yoegwd.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/yomaer.h.svn-base
-save/mars_lmd/libf/phymars/.svn/prop-base/yomlw.h.svn-base
-save/mars_lmd/libf/phymars/.svn/props/
-save/mars_lmd/libf/phymars/.svn/tmp/
-save/mars_lmd/libf/phymars/.svn/tmp/text-base/
-save/mars_lmd/libf/phymars/.svn/tmp/prop-base/
-save/mars_lmd/libf/phymars/.svn/tmp/props/
-save/mars_lmd/libf/phymars/.svn/entries
-save/mars_lmd/libf/phymars/.svn/format
-save/mars_lmd/libf/phymars/.svn/all-wcprops
-save/mars_lmd/libf/aeronomars/
-save/mars_lmd/libf/aeronomars/calchim.F
-save/mars_lmd/libf/aeronomars/chemthermos.F
-save/mars_lmd/libf/aeronomars/ch.F
-save/mars_lmd/libf/aeronomars/chimiedata.h
-save/mars_lmd/libf/aeronomars/column.F
-save/mars_lmd/libf/aeronomars/concentrations.F
-save/mars_lmd/libf/aeronomars/conc.h
-save/mars_lmd/libf/aeronomars/conduction.F
-save/mars_lmd/libf/aeronomars/dtridgl.F
-save/mars_lmd/libf/aeronomars/euvheat.F
-save/mars_lmd/libf/aeronomars/flujo.F
-save/mars_lmd/libf/aeronomars/getch.F
-save/mars_lmd/libf/aeronomars/hrtherm.F
-save/mars_lmd/libf/aeronomars/inichim.F
-save/mars_lmd/libf/aeronomars/inichim_newstart.F
-save/mars_lmd/libf/aeronomars/inichim_readcallphys.F
-save/mars_lmd/libf/aeronomars/init_chimie_B.F
-save/mars_lmd/libf/aeronomars/interpfast.F
-save/mars_lmd/libf/aeronomars/intrplf.F
-save/mars_lmd/libf/aeronomars/inv.F
-save/mars_lmd/libf/aeronomars/jthermcalc.F
-save/mars_lmd/libf/aeronomars/moldiffcoeff.F
-save/mars_lmd/libf/aeronomars/moldiff.F
-save/mars_lmd/libf/aeronomars/molvis.F
-save/mars_lmd/libf/aeronomars/paramfoto.F
-save/mars_lmd/libf/aeronomars/param.h
-save/mars_lmd/libf/aeronomars/param_read.F
-save/mars_lmd/libf/aeronomars/param_v3.h
-save/mars_lmd/libf/aeronomars/perosat.F
-save/mars_lmd/libf/aeronomars/phdisrate.F
-save/mars_lmd/libf/aeronomars/photochemist_B.F
-save/mars_lmd/libf/aeronomars/thermosphere.F
-save/mars_lmd/libf/aeronomars/calchim.F~
-save/mars_lmd/libf/aeronomars/conduction.F~
-save/mars_lmd/libf/aeronomars/molvis.F~
-save/mars_lmd/libf/aeronomars/.svn/
-save/mars_lmd/libf/aeronomars/.svn/text-base/
-save/mars_lmd/libf/aeronomars/.svn/text-base/calchim.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/ch.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/chemthermos.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/chimiedata.h.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/column.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/conc.h.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/concentrations.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/conduction.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/dtridgl.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/euvheat.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/flujo.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/getch.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/hrtherm.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/inichim.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/inichim_newstart.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/inichim_readcallphys.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/init_chimie_B.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/interpfast.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/intrplf.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/inv.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/jthermcalc.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/moldiff.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/moldiffcoeff.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/molvis.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/param.h.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/param_read.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/param_v3.h.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/paramfoto.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/perosat.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/phdisrate.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/photochemist_B.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/text-base/thermosphere.F.svn-base
-save/mars_lmd/libf/aeronomars/.svn/prop-base/
-save/mars_lmd/libf/aeronomars/.svn/props/
-save/mars_lmd/libf/aeronomars/.svn/tmp/
-save/mars_lmd/libf/aeronomars/.svn/tmp/text-base/
-save/mars_lmd/libf/aeronomars/.svn/tmp/prop-base/
-save/mars_lmd/libf/aeronomars/.svn/tmp/props/
-save/mars_lmd/libf/aeronomars/.svn/entries
-save/mars_lmd/libf/aeronomars/.svn/format
-save/mars_lmd/libf/aeronomars/.svn/all-wcprops
-save/mars_lmd/libf/dyn3d/
-save/mars_lmd/libf/dyn3d/angtot.h
-save/mars_lmd/libf/dyn3d/clesph0.h
-save/mars_lmd/libf/dyn3d/comav.h
-save/mars_lmd/libf/dyn3d/comconst.h
-save/mars_lmd/libf/dyn3d/comdiss.h
-save/mars_lmd/libf/dyn3d/comdissip.h
-save/mars_lmd/libf/dyn3d/comdissipn.h
-save/mars_lmd/libf/dyn3d/comdissnew.h
-save/mars_lmd/libf/dyn3d/comgeom2.h
-save/mars_lmd/libf/dyn3d/comgeom.h
-save/mars_lmd/libf/dyn3d/comvert.h
-save/mars_lmd/libf/dyn3d/control.h
-save/mars_lmd/libf/dyn3d/description.h
-save/mars_lmd/libf/dyn3d/ener.h
-save/mars_lmd/libf/dyn3d/gradsdef.h
-save/mars_lmd/libf/dyn3d/logic.h
-save/mars_lmd/libf/dyn3d/paramet.h
-save/mars_lmd/libf/dyn3d/para_netcdf.h
-save/mars_lmd/libf/dyn3d/serre.h
-save/mars_lmd/libf/dyn3d/sponge.h
-save/mars_lmd/libf/dyn3d/temps.h
-save/mars_lmd/libf/dyn3d/tracstoke.h
-save/mars_lmd/libf/dyn3d/.svn/
-save/mars_lmd/libf/dyn3d/.svn/text-base/
-save/mars_lmd/libf/dyn3d/.svn/text-base/angtot.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/clesph0.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/comav.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/comconst.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/comdiss.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/comdissip.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/comdissipn.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/comdissnew.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/comgeom.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/comgeom2.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/comvert.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/control.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/description.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/ener.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/gradsdef.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/logic.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/paramet.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/para_netcdf.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/serre.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/sponge.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/temps.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/text-base/tracstoke.h.svn-base
-save/mars_lmd/libf/dyn3d/.svn/prop-base/
-save/mars_lmd/libf/dyn3d/.svn/props/
-save/mars_lmd/libf/dyn3d/.svn/tmp/
-save/mars_lmd/libf/dyn3d/.svn/tmp/text-base/
-save/mars_lmd/libf/dyn3d/.svn/tmp/prop-base/
-save/mars_lmd/libf/dyn3d/.svn/tmp/props/
-save/mars_lmd/libf/dyn3d/.svn/entries
-save/mars_lmd/libf/dyn3d/.svn/format
-save/mars_lmd/libf/dyn3d/.svn/all-wcprops
-save/mars_lmd/libf/must_keep
-save/mars_lmd/libf/zz_not_used/
-save/mars_lmd/libf/zz_not_used/filtrez/
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/Root
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/Repository
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/Entries
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/Tag
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/text-base/
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/text-base/Entries.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/text-base/Repository.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/text-base/Root.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/text-base/Tag.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/prop-base/
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/props/
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/tmp/
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/tmp/text-base/
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/tmp/prop-base/
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/tmp/props/
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/entries
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/format
-save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/all-wcprops
-save/mars_lmd/libf/zz_not_used/filtrez/coefils.h
-save/mars_lmd/libf/zz_not_used/filtrez/acc.F
-save/mars_lmd/libf/zz_not_used/filtrez/eigen.F
-save/mars_lmd/libf/zz_not_used/filtrez/eigen_sort.F
-save/mars_lmd/libf/zz_not_used/filtrez/filtreg.F
-save/mars_lmd/libf/zz_not_used/filtrez/inifgn.F
-save/mars_lmd/libf/zz_not_used/filtrez/inifilr.F
-save/mars_lmd/libf/zz_not_used/filtrez/jacobi.F
-save/mars_lmd/libf/zz_not_used/filtrez/parafilt.h
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/acc.F.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/coefils.h.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/eigen.F.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/eigen_sort.F.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/filtreg.F.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/inifgn.F.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/inifilr.F.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/jacobi.F.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/parafilt.h.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/acc.F.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/coefils.h.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/eigen.F.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/eigen_sort.F.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/filtreg.F.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/inifgn.F.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/inifilr.F.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/jacobi.F.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/parafilt.h.svn-base
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/props/
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/tmp/
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/tmp/text-base/
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/tmp/prop-base/
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/tmp/props/
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/entries
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/format
-save/mars_lmd/libf/zz_not_used/filtrez/.svn/all-wcprops
-save/mars_lmd/libf/zz_not_used/dyn3d/
-save/mars_lmd/libf/zz_not_used/dyn3d/LISEZMOI
-save/mars_lmd/libf/zz_not_used/dyn3d/abort_gcm.F
-save/mars_lmd/libf/zz_not_used/dyn3d/addfi.F
-save/mars_lmd/libf/zz_not_used/dyn3d/addit.F
-save/mars_lmd/libf/zz_not_used/dyn3d/adv_h2o.F
-save/mars_lmd/libf/zz_not_used/dyn3d/advect.F
-save/mars_lmd/libf/zz_not_used/dyn3d/amont.F
-save/mars_lmd/libf/zz_not_used/dyn3d/amont_qsat.F
-save/mars_lmd/libf/zz_not_used/dyn3d/angtot.h
-save/mars_lmd/libf/zz_not_used/dyn3d/anldoppler2.F
-save/mars_lmd/libf/zz_not_used/dyn3d/bernoui.F
-save/mars_lmd/libf/zz_not_used/dyn3d/caldyn.F
-save/mars_lmd/libf/zz_not_used/dyn3d/caldyn0.F
-save/mars_lmd/libf/zz_not_used/dyn3d/calfis.F
-save/mars_lmd/libf/zz_not_used/dyn3d/lect_start_archive.F
-save/mars_lmd/libf/zz_not_used/dyn3d/clesph0.h
-save/mars_lmd/libf/zz_not_used/dyn3d/coefpoly.F
-save/mars_lmd/libf/zz_not_used/dyn3d/comav.h
-save/mars_lmd/libf/zz_not_used/dyn3d/comconst.h
-save/mars_lmd/libf/zz_not_used/dyn3d/comdiss.h
-save/mars_lmd/libf/zz_not_used/dyn3d/comdissip.h
-save/mars_lmd/libf/zz_not_used/dyn3d/divgrad22.F
-save/mars_lmd/libf/zz_not_used/dyn3d/comdissipn.h
-save/mars_lmd/libf/zz_not_used/dyn3d/comgeom.h
-save/mars_lmd/libf/zz_not_used/dyn3d/comdissnew.h
-save/mars_lmd/libf/zz_not_used/dyn3d/comgeom2.h
-save/mars_lmd/libf/zz_not_used/dyn3d/comvert.h
-save/mars_lmd/libf/zz_not_used/dyn3d/control.h
-save/mars_lmd/libf/zz_not_used/dyn3d/convflu.F
-save/mars_lmd/libf/zz_not_used/dyn3d/convmas.F
-save/mars_lmd/libf/zz_not_used/dyn3d/coordij.F
-save/mars_lmd/libf/zz_not_used/dyn3d/covcont.F
-save/mars_lmd/libf/zz_not_used/dyn3d/covnat.F
-save/mars_lmd/libf/zz_not_used/dyn3d/disvert.orig
-save/mars_lmd/libf/zz_not_used/dyn3d/defrun_new.F
-save/mars_lmd/libf/zz_not_used/dyn3d/description.h
-save/mars_lmd/libf/zz_not_used/dyn3d/diagadv.F
-save/mars_lmd/libf/zz_not_used/dyn3d/dissip.F
-save/mars_lmd/libf/zz_not_used/dyn3d/disvert.F
-save/mars_lmd/libf/zz_not_used/dyn3d/diverg.F
-save/mars_lmd/libf/zz_not_used/dyn3d/diverg_gam.F
-save/mars_lmd/libf/zz_not_used/dyn3d/divergf.F
-save/mars_lmd/libf/zz_not_used/dyn3d/divergst.F
-save/mars_lmd/libf/zz_not_used/dyn3d/divgrad.F
-save/mars_lmd/libf/zz_not_used/dyn3d/divgrad2.F
-save/mars_lmd/libf/zz_not_used/dyn3d/newstart.F
-save/mars_lmd/libf/zz_not_used/dyn3d/dteta1.F
-save/mars_lmd/libf/zz_not_used/dyn3d/dudv1.F
-save/mars_lmd/libf/zz_not_used/dyn3d/dudv2.F
-save/mars_lmd/libf/zz_not_used/dyn3d/dump2d.F
-save/mars_lmd/libf/zz_not_used/dyn3d/dynetat0.F
-save/mars_lmd/libf/zz_not_used/dyn3d/dynredem.F
-save/mars_lmd/libf/zz_not_used/dyn3d/logic.h
-save/mars_lmd/libf/zz_not_used/dyn3d/ener.h
-save/mars_lmd/libf/zz_not_used/dyn3d/enercin.F
-save/mars_lmd/libf/zz_not_used/dyn3d/exner.F
-save/mars_lmd/libf/zz_not_used/dyn3d/exnerF
-save/mars_lmd/libf/zz_not_used/dyn3d/exner_hyb.F
-save/mars_lmd/libf/zz_not_used/dyn3d/flumass.F
-save/mars_lmd/libf/zz_not_used/dyn3d/fluxstoke.F
-save/mars_lmd/libf/zz_not_used/dyn3d/fxhyp.F
-save/mars_lmd/libf/zz_not_used/dyn3d/fxy.F
-save/mars_lmd/libf/zz_not_used/dyn3d/fxyhyper.F
-save/mars_lmd/libf/zz_not_used/dyn3d/fxysinus.F
-save/mars_lmd/libf/zz_not_used/dyn3d/fyhyp.F
-save/mars_lmd/libf/zz_not_used/dyn3d/gcm.F
-save/mars_lmd/libf/zz_not_used/dyn3d/geopot.F
-save/mars_lmd/libf/zz_not_used/dyn3d/gr_dyn_fi.F
-save/mars_lmd/libf/zz_not_used/dyn3d/gr_fi_dyn.F
-save/mars_lmd/libf/zz_not_used/dyn3d/grad.F
-save/mars_lmd/libf/zz_not_used/dyn3d/grid_noro1.F
-save/mars_lmd/libf/zz_not_used/dyn3d/gr_int_dyn.F
-save/mars_lmd/libf/zz_not_used/dyn3d/gr_u_scal.F
-save/mars_lmd/libf/zz_not_used/dyn3d/gr_v_scal.F
-save/mars_lmd/libf/zz_not_used/dyn3d/gradiv.F
-save/mars_lmd/libf/zz_not_used/dyn3d/gradiv2.F
-save/mars_lmd/libf/zz_not_used/dyn3d/gradsdef.h
-save/mars_lmd/libf/zz_not_used/dyn3d/grid_atob.F
-save/mars_lmd/libf/zz_not_used/dyn3d/grid_noro.F
-save/mars_lmd/libf/zz_not_used/dyn3d/ini_archive.F
-save/mars_lmd/libf/zz_not_used/dyn3d/groupe.F
-save/mars_lmd/libf/zz_not_used/dyn3d/groupeun.F
-save/mars_lmd/libf/zz_not_used/dyn3d/heavyside.F
-save/mars_lmd/libf/zz_not_used/dyn3d/iniav.F
-save/mars_lmd/libf/zz_not_used/dyn3d/iniconst.F
-save/mars_lmd/libf/zz_not_used/dyn3d/inidissip.F
-save/mars_lmd/libf/zz_not_used/dyn3d/inigeom.F
-save/mars_lmd/libf/zz_not_used/dyn3d/inigrads.F
-save/mars_lmd/libf/zz_not_used/dyn3d/iniinterp_h.F
-save/mars_lmd/libf/zz_not_used/dyn3d/initial0.F
-save/mars_lmd/libf/zz_not_used/dyn3d/write_archive.F
-save/mars_lmd/libf/zz_not_used/dyn3d/iniwrite.F
-save/mars_lmd/libf/zz_not_used/dyn3d/integrd.F
-save/mars_lmd/libf/zz_not_used/dyn3d/interp_horiz.F
-save/mars_lmd/libf/zz_not_used/dyn3d/interp_vert.F
-save/mars_lmd/libf/zz_not_used/dyn3d/laplacien.F
-save/mars_lmd/libf/zz_not_used/dyn3d/laplacien_gam.F
-save/mars_lmd/libf/zz_not_used/dyn3d/laplacien_rot.F
-save/mars_lmd/libf/zz_not_used/dyn3d/laplacien_rotgam.F
-save/mars_lmd/libf/zz_not_used/dyn3d/lectflux.F
-save/mars_lmd/libf/zz_not_used/dyn3d/massbar.F
-save/mars_lmd/libf/zz_not_used/dyn3d/massbarxy.F
-save/mars_lmd/libf/zz_not_used/dyn3d/massdair.F
-save/mars_lmd/libf/zz_not_used/dyn3d/minmax.F
-save/mars_lmd/libf/zz_not_used/dyn3d/multipl.F
-save/mars_lmd/libf/zz_not_used/dyn3d/multscal.F
-save/mars_lmd/libf/zz_not_used/dyn3d/netcdf.inc
-save/mars_lmd/libf/zz_not_used/dyn3d/start2archive.F
-save/mars_lmd/libf/zz_not_used/dyn3d/paramet.h
-save/mars_lmd/libf/zz_not_used/dyn3d/nxgrad.F
-save/mars_lmd/libf/zz_not_used/dyn3d/vanleer.F
-save/mars_lmd/libf/zz_not_used/dyn3d/nxgrad_gam.F
-save/mars_lmd/libf/zz_not_used/dyn3d/nxgradst.F
-save/mars_lmd/libf/zz_not_used/dyn3d/nxgraro2.F
-save/mars_lmd/libf/zz_not_used/dyn3d/nxgrarot.F
-save/mars_lmd/libf/zz_not_used/dyn3d/para_netcdf.h
-save/mars_lmd/libf/zz_not_used/dyn3d/pression.F
-save/mars_lmd/libf/zz_not_used/dyn3d/ps_amontF
-save/mars_lmd/libf/zz_not_used/dyn3d/psextbar.F
-save/mars_lmd/libf/zz_not_used/dyn3d/ran1.F
-save/mars_lmd/libf/zz_not_used/dyn3d/rotat_nfil.F
-save/mars_lmd/libf/zz_not_used/dyn3d/rotat.F
-save/mars_lmd/libf/zz_not_used/dyn3d/rotatf.F
-save/mars_lmd/libf/zz_not_used/dyn3d/rotatst.F
-save/mars_lmd/libf/zz_not_used/dyn3d/scal_wind.F
-save/mars_lmd/libf/zz_not_used/dyn3d/serre.h
-save/mars_lmd/libf/zz_not_used/dyn3d/sortvarc.F
-save/mars_lmd/libf/zz_not_used/dyn3d/sortvarc0.F
-save/mars_lmd/libf/zz_not_used/dyn3d/spline.F
-save/mars_lmd/libf/zz_not_used/dyn3d/splint.F
-save/mars_lmd/libf/zz_not_used/dyn3d/sponge.F
-save/mars_lmd/libf/zz_not_used/dyn3d/sponge.h
-save/mars_lmd/libf/zz_not_used/dyn3d/temps.h
-save/mars_lmd/libf/zz_not_used/dyn3d/test_period.F
-save/mars_lmd/libf/zz_not_used/dyn3d/testharm.F
-save/mars_lmd/libf/zz_not_used/dyn3d/tourpot.F
-save/mars_lmd/libf/zz_not_used/dyn3d/traceur.F
-save/mars_lmd/libf/zz_not_used/dyn3d/tracstoke.h
-save/mars_lmd/libf/zz_not_used/dyn3d/tracvl.F
-save/mars_lmd/libf/zz_not_used/dyn3d/vitvert.F
-save/mars_lmd/libf/zz_not_used/dyn3d/vlsplt.F
-save/mars_lmd/libf/zz_not_used/dyn3d/vlspltqs.F
-save/mars_lmd/libf/zz_not_used/dyn3d/wind_scal.F
-save/mars_lmd/libf/zz_not_used/dyn3d/wrgrads.F
-save/mars_lmd/libf/zz_not_used/dyn3d/xvik.F
-save/mars_lmd/libf/zz_not_used/dyn3d/readhead_NC.F
-save/mars_lmd/libf/zz_not_used/dyn3d/anl_stats-diag.F
-save/mars_lmd/libf/zz_not_used/dyn3d/anl_mcdstats.F
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/LISEZMOI.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/abort_gcm.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/addfi.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/addit.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/adv_h2o.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/advect.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/amont.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/amont_qsat.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/angtot.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/anl_mcdstats.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/anl_stats-diag.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/anldoppler2.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/bernoui.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/caldyn.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/caldyn0.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/calfis.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/clesph0.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/coefpoly.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comav.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comconst.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comdiss.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comdissip.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comdissipn.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comdissnew.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comgeom.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comgeom2.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comvert.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/control.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/convflu.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/convmas.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/coordij.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/covcont.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/covnat.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/ener.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/defrun_new.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/description.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/diagadv.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/dissip.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/disvert.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/disvert.orig.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/diverg.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/diverg_gam.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/divergf.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/divergst.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/divgrad.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/divgrad2.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/divgrad22.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/dteta1.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/dudv1.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/dudv2.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/dump2d.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/dynetat0.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/dynredem.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/enercin.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/exner.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/exnerF.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/exner_hyb.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/flumass.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/fluxstoke.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/fxhyp.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/fxy.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/fxyhyper.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/fxysinus.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/fyhyp.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gcm.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/geopot.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gr_dyn_fi.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gr_fi_dyn.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gr_int_dyn.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gr_u_scal.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gr_v_scal.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/grad.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gradiv.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gradiv2.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gradsdef.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/grid_atob.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/grid_noro.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/grid_noro1.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/groupe.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/groupeun.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/heavyside.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/ini_archive.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/iniav.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/iniconst.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/inidissip.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/inigeom.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/inigrads.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/iniinterp_h.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/initial0.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/iniwrite.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/integrd.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/interp_horiz.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/interp_vert.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/laplacien.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/laplacien_gam.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/laplacien_rot.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/laplacien_rotgam.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/lect_start_archive.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/lectflux.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/logic.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/massbar.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/massbarxy.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/massdair.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/minmax.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/multipl.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/multscal.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/netcdf.inc.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/newstart.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/nxgrad.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/nxgrad_gam.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/nxgradst.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/nxgraro2.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/nxgrarot.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/para_netcdf.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/paramet.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/pression.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/ps_amontF.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/psextbar.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/ran1.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/readhead_NC.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/rotat.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/rotat_nfil.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/rotatf.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/rotatst.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/scal_wind.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/serre.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/sortvarc.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/sortvarc0.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/spline.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/splint.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/sponge.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/sponge.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/start2archive.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/temps.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/test_period.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/testharm.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/tourpot.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/traceur.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/tracstoke.h.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/tracvl.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/vanleer.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/vitvert.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/vlsplt.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/vlspltqs.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/wind_scal.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/wrgrads.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/write_archive.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/xvik.F.svn-base
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/prop-base/
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/props/
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/tmp/
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/tmp/text-base/
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/tmp/prop-base/
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/tmp/props/
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/entries
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/format
-save/mars_lmd/libf/zz_not_used/dyn3d/.svn/all-wcprops
-save/mars_lmd/libf/zz_not_used/grid/
-save/mars_lmd/libf/zz_not_used/grid/dimension/
-save/mars_lmd/libf/zz_not_used/grid/dimension/makdim
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.32.t2
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.25.t2
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.32.t2
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.32.t12
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.32.t13
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.32.t14
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.24.25.t2
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.25.t14
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.72.36.32.t2
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.54.t2
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.54.t14
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.32.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/makdim.bak
-save/mars_lmd/libf/zz_not_used/grid/dimension/makdim.moi
-save/mars_lmd/libf/zz_not_used/grid/dimension/makdim.n
-save/mars_lmd/libf/zz_not_used/grid/dimension/makdim.old
-save/mars_lmd/libf/zz_not_used/grid/dimension/makdimphy
-save/mars_lmd/libf/zz_not_used/grid/dimension/makntrac
-save/mars_lmd/libf/zz_not_used/grid/dimension/ntraceur.1
-save/mars_lmd/libf/zz_not_used/grid/dimension/ntraceur.5
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.32.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.325.t2
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.24.25.t14
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.24.32.t14
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.24.32.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.24.25.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.60.t14
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.60.t12
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.32.t14
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.60.t60
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.60.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.25.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.50.t14
-save/mars_lmd/libf/zz_not_used/grid/dimension/makdim~
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.34.60.t14
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.24.t2
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.25.t-p
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.50.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.50.t13
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.50.t14
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.t14
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.1.1.32.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.50.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.50.t14
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.t2
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.2.t14
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.32.t15
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.10.48.55.t6
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.50.t15
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.1.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.50.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.50.t15
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.25.t2
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.25.t15
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.25.t32
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.t15
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.32.25.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.32.25.t2
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.24.25.t15
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.176.90.18.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.25.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.40.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.201.2.40.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.60.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.30.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.45.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.20.t1
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.1.1.32.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.1.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.10.48.55.t6.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.24.25.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.24.25.t14.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.24.25.t15.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.24.25.t2.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.24.32.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.24.32.t14.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.32.25.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.32.25.t2.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.2.t14.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.176.90.18.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.20.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.201.2.40.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.25.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.25.t15.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.25.t2.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.25.t32.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.30.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.32.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.32.t14.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.32.t2.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.50.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.50.t13.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.50.t14.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.60.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.60.t12.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.60.t14.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.60.t60.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.34.60.t14.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.t14.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.t15.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.t2.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.40.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.45.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.50.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.50.t14.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.50.t15.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.60.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.24.t2.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.25.t-p.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.25.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.25.t14.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.25.t2.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.32.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.32.t12.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.32.t13.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.32.t14.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/makdim.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.32.t15.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.32.t2.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.325.t2.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.50.t1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.50.t14.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.50.t15.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.54.t14.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.54.t2.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.72.36.32.t2.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/makdim.bak.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/makdim.moi.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/makdim.n.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/makdim.old.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/makdimphy.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/makntrac.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/ntraceur.1.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/ntraceur.5.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/prop-base/
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/prop-base/makdim.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/prop-base/makdim.bak.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/prop-base/makdim.moi.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/prop-base/makdim.old.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/prop-base/makdimphy.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/prop-base/makntrac.svn-base
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/props/
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/tmp/
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/tmp/text-base/
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/tmp/prop-base/
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/tmp/props/
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/entries
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/format
-save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/all-wcprops
-save/mars_lmd/libf/zz_not_used/grid/fxy_new.h
-save/mars_lmd/libf/zz_not_used/grid/fxy_reg.h
-save/mars_lmd/libf/zz_not_used/grid/fxy_sin.h
-save/mars_lmd/libf/zz_not_used/grid/fxyprim.h
-save/mars_lmd/libf/zz_not_used/grid/.svn/
-save/mars_lmd/libf/zz_not_used/grid/.svn/text-base/
-save/mars_lmd/libf/zz_not_used/grid/.svn/text-base/fxy_new.h.svn-base
-save/mars_lmd/libf/zz_not_used/grid/.svn/text-base/fxy_reg.h.svn-base
-save/mars_lmd/libf/zz_not_used/grid/.svn/text-base/fxy_sin.h.svn-base
-save/mars_lmd/libf/zz_not_used/grid/.svn/text-base/fxyprim.h.svn-base
-save/mars_lmd/libf/zz_not_used/grid/.svn/prop-base/
-save/mars_lmd/libf/zz_not_used/grid/.svn/props/
-save/mars_lmd/libf/zz_not_used/grid/.svn/tmp/
-save/mars_lmd/libf/zz_not_used/grid/.svn/tmp/text-base/
-save/mars_lmd/libf/zz_not_used/grid/.svn/tmp/prop-base/
-save/mars_lmd/libf/zz_not_used/grid/.svn/tmp/props/
-save/mars_lmd/libf/zz_not_used/grid/.svn/entries
-save/mars_lmd/libf/zz_not_used/grid/.svn/format
-save/mars_lmd/libf/zz_not_used/grid/.svn/all-wcprops
-save/mars_lmd/libf/zz_not_used/.svn/
-save/mars_lmd/libf/zz_not_used/.svn/text-base/
-save/mars_lmd/libf/zz_not_used/.svn/prop-base/
-save/mars_lmd/libf/zz_not_used/.svn/props/
-save/mars_lmd/libf/zz_not_used/.svn/tmp/
-save/mars_lmd/libf/zz_not_used/.svn/tmp/text-base/
-save/mars_lmd/libf/zz_not_used/.svn/tmp/prop-base/
-save/mars_lmd/libf/zz_not_used/.svn/tmp/props/
-save/mars_lmd/libf/zz_not_used/.svn/entries
-save/mars_lmd/libf/zz_not_used/.svn/format
-save/mars_lmd/libf/zz_not_used/.svn/all-wcprops
-save/mars_lmd/libf/duplicate2
-save/mars_lmd/libf/duplicate1
-save/mars_lmd/libf/generate2
-save/mars_lmd/libf/duplicate3
-save/mars_lmd/libf/generate3
-save/mars_lmd/libf/LMDZ.MARS.source.txt
-save/mars_lmd/libf/generate4
-save/mars_lmd/libf/duplicate4
-save/mars_lmd/libf/.svn/
-save/mars_lmd/libf/.svn/text-base/
-save/mars_lmd/libf/.svn/text-base/LMDZ.MARS.source.txt.svn-base
-save/mars_lmd/libf/.svn/text-base/duplicate1.svn-base
-save/mars_lmd/libf/.svn/text-base/duplicate2.svn-base
-save/mars_lmd/libf/.svn/text-base/duplicate3.svn-base
-save/mars_lmd/libf/.svn/text-base/duplicate4.svn-base
-save/mars_lmd/libf/.svn/text-base/generate2.svn-base
-save/mars_lmd/libf/.svn/text-base/generate3.svn-base
-save/mars_lmd/libf/.svn/text-base/generate4.svn-base
-save/mars_lmd/libf/.svn/text-base/must_keep.svn-base
-save/mars_lmd/libf/.svn/prop-base/
-save/mars_lmd/libf/.svn/prop-base/duplicate1.svn-base
-save/mars_lmd/libf/.svn/prop-base/duplicate2.svn-base
-save/mars_lmd/libf/.svn/prop-base/duplicate3.svn-base
-save/mars_lmd/libf/.svn/prop-base/duplicate4.svn-base
-save/mars_lmd/libf/.svn/prop-base/generate2.svn-base
-save/mars_lmd/libf/.svn/prop-base/generate3.svn-base
-save/mars_lmd/libf/.svn/prop-base/generate4.svn-base
-save/mars_lmd/libf/.svn/props/
-save/mars_lmd/libf/.svn/tmp/
-save/mars_lmd/libf/.svn/tmp/text-base/
-save/mars_lmd/libf/.svn/tmp/prop-base/
-save/mars_lmd/libf/.svn/tmp/props/
-save/mars_lmd/libf/.svn/entries
-save/mars_lmd/libf/.svn/format
-save/mars_lmd/libf/.svn/all-wcprops
-save/mars_lmd/libo/
-save/mars_lmd/libo/log_compile_phys
-save/mars_lmd/libo/LINUXfastI._70_t1_reg/
-save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/
-save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/text-base/
-save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/prop-base/
-save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/props/
-save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/tmp/
-save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/tmp/text-base/
-save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/tmp/prop-base/
-save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/tmp/props/
-save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/entries
-save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/format
-save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/all-wcprops
-save/mars_lmd/libo/.svn/
-save/mars_lmd/libo/.svn/text-base/
-save/mars_lmd/libo/.svn/text-base/log_compile_phys.svn-base
-save/mars_lmd/libo/.svn/prop-base/
-save/mars_lmd/libo/.svn/props/
-save/mars_lmd/libo/.svn/tmp/
-save/mars_lmd/libo/.svn/tmp/text-base/
-save/mars_lmd/libo/.svn/tmp/prop-base/
-save/mars_lmd/libo/.svn/tmp/props/
-save/mars_lmd/libo/.svn/entries
-save/mars_lmd/libo/.svn/format
-save/mars_lmd/libo/.svn/all-wcprops
-save/mars_lmd/tmp90
-save/mars_lmd/tmp77
-save/mars_lmd/makegcm_g95
-save/mars_lmd/tmp
-save/mars_lmd/makegcm_pgf
-save/mars_lmd/makegcm_mpi
-save/mars_lmd/makegcm_ifort
-save/mars_lmd/makegcm_pgf~
-save/mars_lmd/makegcm_mpifort
-save/mars_lmd/makegcm_mpi~
-save/mars_lmd/makegcm_gnu
-save/mars_lmd/makegcm_mpifort~
-save/mars_lmd/.svn/
-save/mars_lmd/.svn/text-base/
-save/mars_lmd/.svn/text-base/create_make_gcm.svn-base
-save/mars_lmd/.svn/text-base/error_libc.svn-base
-save/mars_lmd/.svn/text-base/liste_des_sources_f77.svn-base
-save/mars_lmd/.svn/text-base/liste_des_sources_f90.svn-base
-save/mars_lmd/.svn/text-base/makefile.svn-base
-save/mars_lmd/.svn/text-base/makefile_init.svn-base
-save/mars_lmd/.svn/text-base/makegcm_g95.svn-base
-save/mars_lmd/.svn/text-base/makegcm_gnu.svn-base
-save/mars_lmd/.svn/text-base/makegcm_ifort.svn-base
-save/mars_lmd/.svn/text-base/makegcm_mpi.svn-base
-save/mars_lmd/.svn/text-base/makegcm_mpifort.svn-base
-save/mars_lmd/.svn/text-base/makegcm_pgf.svn-base
-save/mars_lmd/.svn/text-base/tmp.svn-base
-save/mars_lmd/.svn/text-base/tmp77.svn-base
-save/mars_lmd/.svn/text-base/tmp90.svn-base
-save/mars_lmd/.svn/prop-base/
-save/mars_lmd/.svn/prop-base/create_make_gcm.svn-base
-save/mars_lmd/.svn/prop-base/makegcm_g95.svn-base
-save/mars_lmd/.svn/prop-base/makegcm_gnu.svn-base
-save/mars_lmd/.svn/prop-base/makegcm_ifort.svn-base
-save/mars_lmd/.svn/prop-base/makegcm_mpi.svn-base
-save/mars_lmd/.svn/prop-base/makegcm_mpifort.svn-base
-save/mars_lmd/.svn/prop-base/makegcm_pgf.svn-base
-save/mars_lmd/.svn/props/
-save/mars_lmd/.svn/tmp/
-save/mars_lmd/.svn/tmp/text-base/
-save/mars_lmd/.svn/tmp/prop-base/
-save/mars_lmd/.svn/tmp/props/
-save/mars_lmd/.svn/entries
-save/mars_lmd/.svn/format
-save/mars_lmd/.svn/all-wcprops
-save/phys/
-save/phys/diff_module_physics_init
-save/phys/Makefile
-save/phys/module_physics_init.F
-save/phys/module_lmd_driver.F
-save/phys/diff_module_physics_addtendc
-save/phys/diff_Makefile
-save/phys/module_physics_addtendc.F
-save/Registry/
-save/Registry/diff
-save/Registry/Registry.EM
-save/Registry/Registry.EMref
-save/Registry/Registry.EM_MARS
-save/Registry/Registry.EM_MARS0
-save/Registry/Registry.EM_MARS0~
-save/Registry/Registry.EM_MARS1
-save/Registry/Registry.EM_MARS1_watercycle
-save/Registry/Registry.EM_MARS2
-save/Registry/Registry.EM_dust
-save/Registry/Registry.EM_water
-save/Registry/Registry.bash
-save/share/
-save/share/module_date_time.F
-save/share/diff_module_model_constants
-save/share/module_model_constants.F
-save/share/module_model_constants.F_gcm
-save/share/module_model_constants.F_ref
-save/share/mediation_integrate.F
-save/share/diff_module_date_time
-save/share/diff_mediation_integrate
-save/main/
-save/main/real_em.F
-save/frame/
-save/frame/module_domain.F
Index: trunk/MESOSCALE/LMD_MM_MARS/build_static
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/build_static	(revision 206)
+++ 	(revision )
@@ -1,75 +1,0 @@
-#! /bin/bash
-
-cd WPS_GEOG
-
-cp -rf res/albedo_TES .
-cd albedo_TES
-echo get TES albedo from PDS
-echo 1/2
-wget http://pds-geosciences.wustl.edu/geo/mgs-m-tes-special-v1/global_albedo_8ppd.img . > /dev/null 2>&1
-echo 2/2
-wget http://pds-geosciences.wustl.edu/geo/mgs-m-tes-special-v1/global_albedo_8ppd.lbl . > /dev/null 2>&1
-ls -l ./ | grep global_albedo*
-echo building... please wait
-./tesalbedo_build.m
-\rm global_albedo*
-cd ..
-
-cp -rf res/thermal_TES .
-cd thermal_TES
-echo get TES thermal inertia from Univ. Colorado
-echo 1/2
-wget http://lasp.colorado.edu/inertia/2007/NBmap2007.bin . > /dev/null 2>&1
-echo 2/2
-wget http://lasp.colorado.edu/inertia/2007/NBmap2007s.jpg . > /dev/null 2>&1
-ls -l ./ | grep NBmap2007*
-echo building... please wait
-./testhermal_build.m
-\rm NBmap2007*
-cd ..
-
-cp -rf res/mola_topo32 .
-cd mola_topo32
-echo get MOLA 32 topography from PDS ... this could be long
-echo 1/2
-wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg032/megt90n000fb.img . > /dev/null 2>&1
-echo 2/2
-wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg032/megt90n000fb.lbl . > /dev/null 2>&1
-ls -l ./ | grep megt*
-echo building... please wait
-./mola_build.m
-\rm megt*
-cd ..
-
-### remove this line if you want to generate MOLA 64 
-exit
-
-cp -rf res/mola_topo64 .
-cd mola_topo64
-echo get MOLA 64 topography from PDS ... this could be very long
-ls -l ./ | grep megt*
-echo 1/8
-wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt90n000gb.img . > /dev/null 2>&1
-echo 2/8
-wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt90n000gb.lbl . > /dev/null 2>&1
-echo 3/8
-wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt90n180gb.img . > /dev/null 2>&1
-echo 4/8
-wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt90n180gb.lbl . > /dev/null 2>&1
-echo 5/8
-wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt00n000gb.img . > /dev/null 2>&1
-echo 6/8
-wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt00n000gb.lbl . > /dev/null 2>&1
-echo 7/8
-wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt00n180gb.img . > /dev/null 2>&1
-echo 8/8
-wget http://pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg064/megt00n180gb.lbl . > /dev/null 2>&1
-echo building... please wait
-./mola_buildNE.m  
-./mola_buildNW.m  
-./mola_buildSE.m  
-./mola_buildSW.m
-\rm megt*
-cd ..
-
-exit
Index: trunk/MESOSCALE/LMD_MM_MARS/copy_model
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/copy_model	(revision 206)
+++ 	(revision )
@@ -1,153 +1,0 @@
-#! /bin/bash
-
-
-echo '*** linking sources from ...'
-WRFSRC=$PWD/SRC/
-echo $WRFSRC
-echo '*** to ...'
-HERE=$PWD
-echo $HERE
-
-
-#mkdir WPS
-#cd WPS
-#ln -sf $WRFSRC/WPS/wps_mars .
-#ln -sf $WRFSRC/WPS/switch_WPS_Mars .
-#cd ..
-
-mkdir WRFV2
-cd WRFV2 
-
-echo '*** start defining folders and links'
-ln -sf $WRFSRC/WRFV2/clean . 
-ln -sf $WRFSRC/WRFV2/compile .
-#ln -sf $WRFSRC/WRFV2/makemeso .
-ln -sf $WRFSRC/WRFV2/configure .
-ln -sf $WRFSRC/WRFV2/Makefile .
-ln -sf $WRFSRC/WRFV2/mars.sed* .
-ln -sf $WRFSRC/WRFV2/*.h .
-ln -sf $WRFSRC/WRFV2/configure.defaults.* .
-ln -sf $WRFSRC/WRFV2/call_meso_inifis?.inc .
-ln -sf $WRFSRC/WRFV2/call_meso_physiq?.inc .
-
-#\rm meso_dimphys.h
-#cp $WRFSRC/WRFV2/meso_dimphys.h .
-#cp $WRFSRC/WRFV2/call_*.inc .
-#cp $WRFSRC/WRFV2/custom*.inc .
-mkdir Registry
-ln -sf $WRFSRC/WRFV2/Registry/* Registry/
-mkdir arch
-ln -sf $WRFSRC/WRFV2/arch/* arch/
-mkdir dyn_em
-ln -sf $WRFSRC/WRFV2/dyn_em/* dyn_em/
-mkdir dyn_exp
-ln -sf $WRFSRC/WRFV2/dyn_exp/* dyn_exp/
-mkdir dyn_nmm
-ln -sf $WRFSRC/WRFV2/dyn_nmm/* dyn_nmm/
-mkdir frame
-ln -sf $WRFSRC/WRFV2/frame/* frame/
-mkdir inc
-ln -sf $WRFSRC/WRFV2/inc/* inc/
-mkdir main
-ln -sf $WRFSRC/WRFV2/main/* main/
-mkdir phys
-ln -sf $WRFSRC/WRFV2/phys/* phys/
-mkdir run
-ln -sf $WRFSRC/WRFV2/run/* run/
-mkdir share
-ln -sf $WRFSRC/WRFV2/share/* share/
-mkdir tools
-ln -sf $WRFSRC/WRFV2/tools/* tools/
-\rm tools/DOMAIN_TIME_TEST
-\rm tools/CodeBase
-mkdir tools/DOMAIN_TIME_TEST
-ln -sf $WRFSRC/WRFV2/tools/DOMAIN_TIME_TEST/* tools/DOMAIN_TIME_TEST/
-mkdir tools/CodeBase
-ln -sf $WRFSRC/WRFV2/tools/CodeBase/* tools/CodeBase/
-mkdir external
-ln -sf $WRFSRC/WRFV2/external/Makefile external/
-mkdir external/io_int
-ln -sf $WRFSRC/WRFV2/external/io_int/* external/io_int/
-mkdir external/esmf_time_f90
-ln -sf $WRFSRC/WRFV2/external/esmf_time_f90/* external/esmf_time_f90/
-mkdir external/io_netcdf
-ln -sf $WRFSRC/WRFV2/external/io_netcdf/* external/io_netcdf/
-mkdir external/io_grib1
-ln -sf $WRFSRC/WRFV2/external/io_grib1/* external/io_grib1/
-\rm external/io_grib1/MEL_grib1
-\rm external/io_grib1/WGRIB
-\rm external/io_grib1/build
-\rm external/io_grib1/grib1_util
-mkdir external/io_grib1/MEL_grib1
-ln -sf $WRFSRC/WRFV2/external/io_grib1/MEL_grib1/* external/io_grib1/MEL_grib1/
-mkdir external/io_grib1/WGRIB
-ln -sf $WRFSRC/WRFV2/external/io_grib1/WGRIB/* external/io_grib1/WGRIB/
-mkdir external/io_grib1/grib1_util
-ln -sf $WRFSRC/WRFV2/external/io_grib1/grib1_util/* external/io_grib1/grib1_util/
-mkdir external/io_grib1/build
-mkdir external/io_grib_share
-ln -sf $WRFSRC/WRFV2/external/io_grib_share/* external/io_grib_share/
-\rm external/io_grib_share/build
-mkdir external/io_grib_share/build
-ln -sf $WRFSRC/WRFV2/external/io_grib_share/build/* external/io_grib_share/build/
-mkdir external/ioapi_share
-ln -sf $WRFSRC/WRFV2/external/ioapi_share/* external/ioapi_share/
-mkdir external/io_phdf5
-ln -sf $WRFSRC/WRFV2/external/io_phdf5/* external/io_phdf5/
-mkdir external/RSL_LITE
-ln -sf $WRFSRC/WRFV2/external/RSL_LITE/* external/RSL_LITE/
-mkdir external/io_grib2
-ln -sf $WRFSRC/WRFV2/external/io_grib2/* external/io_grib2/
-\rm external/io_grib2/bacio-1.3
-\rm external/io_grib2/g2lib
-mkdir external/io_grib2/bacio-1.3
-ln -sf $WRFSRC/WRFV2/external/io_grib2/bacio-1.3/* external/io_grib2/bacio-1.3/
-mkdir external/io_grib2/g2lib
-ln -sf $WRFSRC/WRFV2/external/io_grib2/g2lib/* external/io_grib2/g2lib/
-mkdir external/io_pnetcdf
-ln -sf $WRFSRC/WRFV2/external/io_pnetcdf/* external/io_pnetcdf/
-mkdir external/RSL
-ln -sf $WRFSRC/WRFV2/external/RSL/* external/RSL/
-\rm external/RSL/RSL
-mkdir external/RSL/RSL
-ln -sf $WRFSRC/WRFV2/external/RSL/RSL/* external/RSL/RSL/
-mkdir external/io_esmf
-ln -sf $WRFSRC/WRFV2/external/io_esmf/* external/io_esmf/
-mkdir external/io_mcel
-ln -sf $WRFSRC/WRFV2/external/io_mcel/* external/io_mcel/
-mkdir mars_lmd
-mkdir mars_lmd/libf
-ln -sf $WRFSRC/WRFV2/mars_lmd/makegcm* mars_lmd/
-ln -sf $WRFSRC/WRFV2/mars_lmd/create_make_gcm mars_lmd/
-#ln -sf $WRFSRC/WRFV2/mars_lmd/makefile mars_lmd/
-ln -sf $WRFSRC/WRFV2/mars_lmd/libf/duplicate* mars_lmd/libf/
-ln -sf $WRFSRC/WRFV2/mars_lmd/libf/generate* mars_lmd/libf/
-
-mkdir mars_lmd/libf/grid
-ln -sf $WRFSRC/WRFV2/mars_lmd/libf/grid/* mars_lmd/libf/grid/
-mkdir mars_lmd/libf/phymars
-ln -sf $WRFSRC/WRFV2/mars_lmd/libf/phymars/* mars_lmd/libf/phymars/
-mkdir mars_lmd/libf/dyn3d
-ln -sf $WRFSRC/WRFV2/mars_lmd/libf/dyn3d/* mars_lmd/libf/dyn3d/
-mkdir mars_lmd/libf/aeronomars
-ln -sf $WRFSRC/WRFV2/mars_lmd/libf/aeronomars/* mars_lmd/libf/aeronomars/
-mkdir mars_lmd/libf/bibio
-ln -sf $WRFSRC/WRFV2/mars_lmd/libf/bibio/* mars_lmd/libf/bibio/
-mkdir mars_lmd/libo
-#touch mars_lmd/makefile
-
-mkdir test
-mkdir test/em_real
-mkdir test/em_quarter_ss
-ln -sf $WRFSRC/WRFV2/test/em_real/* test/em_real/
-
-cd mars_lmd/libf/phymars/
-\rm dimphys.h
-#ln -sf ../../../meso_dimphys.h dimphys.h
-cd ../../..
-
-echo '*** end'
-
-
-
-
Index: trunk/MESOSCALE/LMD_MM_MARS/download_log
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/download_log	(revision 206)
+++ 	(revision )
@@ -1,681 +1,0 @@
---2011-01-24 12:16:29--  http://www.mmm.ucar.edu/wrf/src/WRFV2.2.TAR.gz
-Resolving www.mmm.ucar.edu... 128.117.88.210
-Connecting to www.mmm.ucar.edu|128.117.88.210|:80... connected.
-HTTP request sent, awaiting response... 200 OK
-Length: 23101614 (22M) [application/x-gzip]
-Saving to: `WRFV2.2.TAR.gz'
-
-     0K .......... .......... .......... .......... ..........  0%  108K 3m29s
-    50K .......... .......... .......... .......... ..........  0%  324K 2m19s
-   100K .......... .......... .......... .......... ..........  0%  326K 1m55s
-   150K .......... .......... .......... .......... ..........  0%  330K 1m43s
-   200K .......... .......... .......... .......... ..........  1% 11.3M 83s
-   250K .......... .......... .......... .......... ..........  1% 10.2M 69s
-   300K .......... .......... .......... .......... ..........  1%  341K 68s
-   350K .......... .......... .......... .......... ..........  1% 10.9M 60s
-   400K .......... .......... .......... .......... ..........  1% 1.27M 55s
-   450K .......... .......... .......... .......... ..........  2%  448K 54s
-   500K .......... .......... .......... .......... ..........  2% 10.7M 50s
-   550K .......... .......... .......... .......... ..........  2% 11.4M 45s
-   600K .......... .......... .......... .......... ..........  2% 11.3M 42s
-   650K .......... .......... .......... .......... ..........  3% 11.0M 39s
-   700K .......... .......... .......... .......... ..........  3%  371K 40s
-   750K .......... .......... .......... .......... ..........  3% 11.3M 38s
-   800K .......... .......... .......... .......... ..........  3% 10.0M 36s
-   850K .......... .......... .......... .......... ..........  3% 11.2M 34s
-   900K .......... .......... .......... .......... ..........  4% 11.4M 32s
-   950K .......... .......... .......... .......... ..........  4% 1.85M 31s
-  1000K .......... .......... .......... .......... ..........  4%  450K 32s
-  1050K .......... .......... .......... .......... ..........  4% 10.9M 30s
-  1100K .......... .......... .......... .......... ..........  5% 10.1M 29s
-  1150K .......... .......... .......... .......... ..........  5% 11.3M 28s
-  1200K .......... .......... .......... .......... ..........  5% 10.8M 27s
-  1250K .......... .......... .......... .......... ..........  5% 11.4M 26s
-  1300K .......... .......... .......... .......... ..........  5% 11.3M 25s
-  1350K .......... .......... .......... .......... ..........  6% 11.0M 24s
-  1400K .......... .......... .......... .......... ..........  6% 11.4M 23s
-  1450K .......... .......... .......... .......... ..........  6% 11.3M 22s
-  1500K .......... .......... .......... .......... ..........  6% 10.9M 21s
-  1550K .......... .......... .......... .......... ..........  7%  463K 22s
-  1600K .......... .......... .......... .......... ..........  7% 10.9M 22s
-  1650K .......... .......... .......... .......... ..........  7% 10.6M 21s
-  1700K .......... .......... .......... .......... ..........  7% 9.79M 20s
-  1750K .......... .......... .......... .......... ..........  7% 11.3M 20s
-  1800K .......... .......... .......... .......... ..........  8% 11.0M 19s
-  1850K .......... .......... .......... .......... ..........  8% 11.3M 19s
-  1900K .......... .......... .......... .......... ..........  8% 8.24M 18s
-  1950K .......... .......... .......... .......... ..........  8% 11.3M 18s
-  2000K .......... .......... .......... .......... ..........  9% 11.4M 17s
-  2050K .......... .......... .......... .......... ..........  9% 11.0M 17s
-  2100K .......... .......... .......... .......... ..........  9% 11.3M 17s
-  2150K .......... .......... .......... .......... ..........  9%  472K 17s
-  2200K .......... .......... .......... .......... ..........  9% 10.9M 17s
-  2250K .......... .......... .......... .......... .......... 10% 11.3M 16s
-  2300K .......... .......... .......... .......... .......... 10% 11.4M 16s
-  2350K .......... .......... .......... .......... .......... 10% 11.0M 16s
-  2400K .......... .......... .......... .......... .......... 10% 11.3M 15s
-  2450K .......... .......... .......... .......... .......... 11% 11.0M 15s
-  2500K .......... .......... .......... .......... .......... 11% 11.3M 15s
-  2550K .......... .......... .......... .......... .......... 11% 11.0M 14s
-  2600K .......... .......... .......... .......... .......... 11% 11.1M 14s
-  2650K .......... .......... .......... .......... .......... 11% 11.4M 14s
-  2700K .......... .......... .......... .......... .......... 12% 11.3M 14s
-  2750K .......... .......... .......... .......... .......... 12% 10.9M 13s
-  2800K .......... .......... .......... .......... .......... 12% 11.5M 13s
-  2850K .......... .......... .......... .......... .......... 12% 11.3M 13s
-  2900K .......... .......... .......... .......... .......... 13% 11.0M 13s
-  2950K .......... .......... .......... .......... .......... 13% 11.4M 13s
-  3000K .......... .......... .......... .......... .......... 13% 10.6M 12s
-  3050K .......... .......... .......... .......... .......... 13% 11.0M 12s
-  3100K .......... .......... .......... .......... .......... 13% 11.4M 12s
-  3150K .......... .......... .......... .......... .......... 14%  721K 12s
-  3200K .......... .......... .......... .......... .......... 14% 11.2M 12s
-  3250K .......... .......... .......... .......... .......... 14% 11.2M 12s
-  3300K .......... .......... .......... .......... .......... 14% 11.0M 12s
-  3350K .......... .......... .......... .......... .......... 15% 11.3M 11s
-  3400K .......... .......... .......... .......... .......... 15% 11.0M 11s
-  3450K .......... .......... .......... .......... .......... 15% 11.0M 11s
-  3500K .......... .......... .......... .......... .......... 15% 11.3M 11s
-  3550K .......... .......... .......... .......... .......... 15% 11.3M 11s
-  3600K .......... .......... .......... .......... .......... 16% 11.0M 11s
-  3650K .......... .......... .......... .......... .......... 16% 11.3M 10s
-  3700K .......... .......... .......... .......... .......... 16% 11.4M 10s
-  3750K .......... .......... .......... .......... .......... 16% 10.3M 10s
-  3800K .......... .......... .......... .......... .......... 17% 11.3M 10s
-  3850K .......... .......... .......... .......... .......... 17% 11.0M 10s
-  3900K .......... .......... .......... .......... .......... 17% 11.4M 10s
-  3950K .......... .......... .......... .......... .......... 17% 11.3M 10s
-  4000K .......... .......... .......... .......... .......... 17% 10.8M 9s
-  4050K .......... .......... .......... .......... .......... 18% 10.9M 9s
-  4100K .......... .......... .......... .......... .......... 18% 11.1M 9s
-  4150K .......... .......... .......... .......... .......... 18% 10.2M 9s
-  4200K .......... .......... .......... .......... .......... 18%  729K 9s
-  4250K .......... .......... .......... .......... .......... 19% 11.1M 9s
-  4300K .......... .......... .......... .......... .......... 19% 11.0M 9s
-  4350K .......... .......... .......... .......... .......... 19% 11.4M 9s
-  4400K .......... .......... .......... .......... .......... 19% 10.8M 9s
-  4450K .......... .......... .......... .......... .......... 19% 11.3M 9s
-  4500K .......... .......... .......... .......... .......... 20% 10.6M 9s
-  4550K .......... .......... .......... .......... .......... 20% 11.0M 9s
-  4600K .......... .......... .......... .......... .......... 20% 11.3M 8s
-  4650K .......... .......... .......... .......... .......... 20% 11.4M 8s
-  4700K .......... .......... .......... .......... .......... 21% 11.0M 8s
-  4750K .......... .......... .......... .......... .......... 21% 11.2M 8s
-  4800K .......... .......... .......... .......... .......... 21% 11.2M 8s
-  4850K .......... .......... .......... .......... .......... 21% 10.3M 8s
-  4900K .......... .......... .......... .......... .......... 21% 11.3M 8s
-  4950K .......... .......... .......... .......... .......... 22% 11.4M 8s
-  5000K .......... .......... .......... .......... .......... 22% 11.0M 8s
-  5050K .......... .......... .......... .......... .......... 22% 11.3M 8s
-  5100K .......... .......... .......... .......... .......... 22% 10.2M 8s
-  5150K .......... .......... .......... .......... .......... 23% 11.4M 7s
-  5200K .......... .......... .......... .......... .......... 23%  740K 8s
-  5250K .......... .......... .......... .......... .......... 23% 9.09M 8s
-  5300K .......... .......... .......... .......... .......... 23% 10.2M 7s
-  5350K .......... .......... .......... .......... .......... 23% 9.22M 7s
-  5400K .......... .......... .......... .......... .......... 24% 11.0M 7s
-  5450K .......... .......... .......... .......... .......... 24% 11.4M 7s
-  5500K .......... .......... .......... .......... .......... 24% 11.3M 7s
-  5550K .......... .......... .......... .......... .......... 24% 11.0M 7s
-  5600K .......... .......... .......... .......... .......... 25% 11.4M 7s
-  5650K .......... .......... .......... .......... .......... 25% 11.3M 7s
-  5700K .......... .......... .......... .......... .......... 25% 11.0M 7s
-  5750K .......... .......... .......... .......... .......... 25% 11.4M 7s
-  5800K .......... .......... .......... .......... .......... 25% 11.0M 7s
-  5850K .......... .......... .......... .......... .......... 26% 11.3M 7s
-  5900K .......... .......... .......... .......... .......... 26% 11.4M 7s
-  5950K .......... .......... .......... .......... .......... 26% 11.0M 7s
-  6000K .......... .......... .......... .......... .......... 26% 11.3M 7s
-  6050K .......... .......... .......... .......... .......... 27% 11.4M 6s
-  6100K .......... .......... .......... .......... .......... 27% 11.0M 6s
-  6150K .......... .......... .......... .......... .......... 27% 11.2M 6s
-  6200K .......... .......... .......... .......... .......... 27% 11.4M 6s
-  6250K .......... .......... .......... .......... .......... 27%  735K 6s
-  6300K .......... .......... .......... .......... .......... 28% 9.48M 6s
-  6350K .......... .......... .......... .......... .......... 28% 10.8M 6s
-  6400K .......... .......... .......... .......... .......... 28% 8.63M 6s
-  6450K .......... .......... .......... .......... .......... 28% 11.3M 6s
-  6500K .......... .......... .......... .......... .......... 29% 11.0M 6s
-  6550K .......... .......... .......... .......... .......... 29% 11.4M 6s
-  6600K .......... .......... .......... .......... .......... 29% 11.3M 6s
-  6650K .......... .......... .......... .......... .......... 29% 11.0M 6s
-  6700K .......... .......... .......... .......... .......... 29% 11.4M 6s
-  6750K .......... .......... .......... .......... .......... 30% 11.3M 6s
-  6800K .......... .......... .......... .......... .......... 30% 10.8M 6s
-  6850K .......... .......... .......... .......... .......... 30% 11.4M 6s
-  6900K .......... .......... .......... .......... .......... 30% 11.3M 6s
-  6950K .......... .......... .......... .......... .......... 31% 11.0M 6s
-  7000K .......... .......... .......... .......... .......... 31% 11.4M 6s
-  7050K .......... .......... .......... .......... .......... 31% 11.0M 6s
-  7100K .......... .......... .......... .......... .......... 31% 11.3M 5s
-  7150K .......... .......... .......... .......... .......... 31% 11.4M 5s
-  7200K .......... .......... .......... .......... .......... 32% 11.0M 5s
-  7250K .......... .......... .......... .......... .......... 32%  754K 5s
-  7300K .......... .......... .......... .......... .......... 32% 8.98M 5s
-  7350K .......... .......... .......... .......... .......... 32% 9.05M 5s
-  7400K .......... .......... .......... .......... .......... 33% 9.06M 5s
-  7450K .......... .......... .......... .......... .......... 33% 9.99M 5s
-  7500K .......... .......... .......... .......... .......... 33% 11.0M 5s
-  7550K .......... .......... .......... .......... .......... 33% 11.1M 5s
-  7600K .......... .......... .......... .......... .......... 33% 11.4M 5s
-  7650K .......... .......... .......... .......... .......... 34% 11.0M 5s
-  7700K .......... .......... .......... .......... .......... 34% 11.3M 5s
-  7750K .......... .......... .......... .......... .......... 34% 11.0M 5s
-  7800K .......... .......... .......... .......... .......... 34% 11.4M 5s
-  7850K .......... .......... .......... .......... .......... 35% 11.3M 5s
-  7900K .......... .......... .......... .......... .......... 35% 11.0M 5s
-  7950K .......... .......... .......... .......... .......... 35% 11.4M 5s
-  8000K .......... .......... .......... .......... .......... 35% 11.3M 5s
-  8050K .......... .......... .......... .......... .......... 35% 9.66M 5s
-  8100K .......... .......... .......... .......... .......... 36% 11.4M 5s
-  8150K .......... .......... .......... .......... .......... 36% 11.3M 5s
-  8200K .......... .......... .......... .......... .......... 36% 11.0M 5s
-  8250K .......... .......... .......... .......... .......... 36%  785K 5s
-  8300K .......... .......... .......... .......... .......... 37% 7.02M 5s
-  8350K .......... .......... .......... .......... .......... 37% 9.81M 5s
-  8400K .......... .......... .......... .......... .......... 37% 9.94M 5s
-  8450K .......... .......... .......... .......... .......... 37% 8.62M 5s
-  8500K .......... .......... .......... .......... .......... 37% 10.5M 5s
-  8550K .......... .......... .......... .......... .......... 38% 11.0M 5s
-  8600K .......... .......... .......... .......... .......... 38% 10.9M 5s
-  8650K .......... .......... .......... .......... .......... 38% 11.3M 4s
-  8700K .......... .......... .......... .......... .......... 38% 11.4M 4s
-  8750K .......... .......... .......... .......... .......... 39% 11.0M 4s
-  8800K .......... .......... .......... .......... .......... 39% 11.3M 4s
-  8850K .......... .......... .......... .......... .......... 39% 11.4M 4s
-  8900K .......... .......... .......... .......... .......... 39% 11.0M 4s
-  8950K .......... .......... .......... .......... .......... 39% 11.3M 4s
-  9000K .......... .......... .......... .......... .......... 40% 10.8M 4s
-  9050K .......... .......... .......... .......... .......... 40% 10.6M 4s
-  9100K .......... .......... .......... .......... .......... 40% 11.1M 4s
-  9150K .......... .......... .......... .......... .......... 40% 11.0M 4s
-  9200K .......... .......... .......... .......... .......... 41% 10.3M 4s
-  9250K .......... .......... .......... .......... .......... 41% 11.3M 4s
-  9300K .......... .......... .......... .......... .......... 41%  777K 4s
-  9350K .......... .......... .......... .......... .......... 41% 8.31M 4s
-  9400K .......... .......... .......... .......... .......... 41% 9.04M 4s
-  9450K .......... .......... .......... .......... .......... 42% 9.29M 4s
-  9500K .......... .......... .......... .......... .......... 42% 9.34M 4s
-  9550K .......... .......... .......... .......... .......... 42% 10.9M 4s
-  9600K .......... .......... .......... .......... .......... 42% 11.2M 4s
-  9650K .......... .......... .......... .......... .......... 42% 11.1M 4s
-  9700K .......... .......... .......... .......... .......... 43% 10.2M 4s
-  9750K .......... .......... .......... .......... .......... 43% 11.3M 4s
-  9800K .......... .......... .......... .......... .......... 43% 11.4M 4s
-  9850K .......... .......... .......... .......... .......... 43% 11.0M 4s
-  9900K .......... .......... .......... .......... .......... 44% 11.3M 4s
-  9950K .......... .......... .......... .......... .......... 44% 11.4M 4s
- 10000K .......... .......... .......... .......... .......... 44% 10.6M 4s
- 10050K .......... .......... .......... .......... .......... 44% 11.3M 4s
- 10100K .......... .......... .......... .......... .......... 44% 10.7M 4s
- 10150K .......... .......... .......... .......... .......... 45% 11.0M 4s
- 10200K .......... .......... .......... .......... .......... 45% 11.2M 4s
- 10250K .......... .......... .......... .......... .......... 45% 11.0M 4s
- 10300K .......... .......... .......... .......... .......... 45%  800K 4s
- 10350K .......... .......... .......... .......... .......... 46% 7.11M 4s
- 10400K .......... .......... .......... .......... .......... 46% 8.61M 4s
- 10450K .......... .......... .......... .......... .......... 46% 10.0M 4s
- 10500K .......... .......... .......... .......... .......... 46% 8.99M 4s
- 10550K .......... .......... .......... .......... .......... 46% 9.34M 4s
- 10600K .......... .......... .......... .......... .......... 47% 10.6M 3s
- 10650K .......... .......... .......... .......... .......... 47% 11.2M 3s
- 10700K .......... .......... .......... .......... .......... 47% 11.0M 3s
- 10750K .......... .......... .......... .......... .......... 47% 11.3M 3s
- 10800K .......... .......... .......... .......... .......... 48% 11.1M 3s
- 10850K .......... .......... .......... .......... .......... 48% 10.3M 3s
- 10900K .......... .......... .......... .......... .......... 48% 11.4M 3s
- 10950K .......... .......... .......... .......... .......... 48% 10.4M 3s
- 11000K .......... .......... .......... .......... .......... 48% 11.3M 3s
- 11050K .......... .......... .......... .......... .......... 49% 11.4M 3s
- 11100K .......... .......... .......... .......... .......... 49% 11.0M 3s
- 11150K .......... .......... .......... .......... .......... 49% 11.3M 3s
- 11200K .......... .......... .......... .......... .......... 49% 11.4M 3s
- 11250K .......... .......... .......... .......... .......... 50% 11.0M 3s
- 11300K .......... .......... .......... .......... .......... 50% 11.3M 3s
- 11350K .......... .......... .......... .......... .......... 50%  788K 3s
- 11400K .......... .......... .......... .......... .......... 50% 7.36M 3s
- 11450K .......... .......... .......... .......... .......... 50% 9.89M 3s
- 11500K .......... .......... .......... .......... .......... 51% 9.09M 3s
- 11550K .......... .......... .......... .......... .......... 51% 9.36M 3s
- 11600K .......... .......... .......... .......... .......... 51% 9.24M 3s
- 11650K .......... .......... .......... .......... .......... 51% 11.0M 3s
- 11700K .......... .......... .......... .......... .......... 52% 10.5M 3s
- 11750K .......... .......... .......... .......... .......... 52% 11.5M 3s
- 11800K .......... .......... .......... .......... .......... 52% 11.0M 3s
- 11850K .......... .......... .......... .......... .......... 52% 11.4M 3s
- 11900K .......... .......... .......... .......... .......... 52% 11.3M 3s
- 11950K .......... .......... .......... .......... .......... 53% 10.9M 3s
- 12000K .......... .......... .......... .......... .......... 53% 10.9M 3s
- 12050K .......... .......... .......... .......... .......... 53% 10.8M 3s
- 12100K .......... .......... .......... .......... .......... 53% 11.0M 3s
- 12150K .......... .......... .......... .......... .......... 54% 11.4M 3s
- 12200K .......... .......... .......... .......... .......... 54% 11.0M 3s
- 12250K .......... .......... .......... .......... .......... 54% 11.3M 3s
- 12300K .......... .......... .......... .......... .......... 54% 11.4M 3s
- 12350K .......... .......... .......... .......... .......... 54%  810K 3s
- 12400K .......... .......... .......... .......... .......... 55% 6.48M 3s
- 12450K .......... .......... .......... .......... .......... 55% 9.74M 3s
- 12500K .......... .......... .......... .......... .......... 55% 8.95M 3s
- 12550K .......... .......... .......... .......... .......... 55% 9.92M 3s
- 12600K .......... .......... .......... .......... .......... 56% 8.88M 3s
- 12650K .......... .......... .......... .......... .......... 56% 9.83M 3s
- 12700K .......... .......... .......... .......... .......... 56% 11.2M 3s
- 12750K .......... .......... .......... .......... .......... 56% 9.76M 3s
- 12800K .......... .......... .......... .......... .......... 56% 11.0M 3s
- 12850K .......... .......... .......... .......... .......... 57% 11.3M 3s
- 12900K .......... .......... .......... .......... .......... 57% 11.0M 3s
- 12950K .......... .......... .......... .......... .......... 57% 11.4M 3s
- 13000K .......... .......... .......... .......... .......... 57% 11.3M 3s
- 13050K .......... .......... .......... .......... .......... 58% 11.0M 2s
- 13100K .......... .......... .......... .......... .......... 58% 11.4M 2s
- 13150K .......... .......... .......... .......... .......... 58% 11.3M 2s
- 13200K .......... .......... .......... .......... .......... 58% 11.0M 2s
- 13250K .......... .......... .......... .......... .......... 58% 11.4M 2s
- 13300K .......... .......... .......... .......... .......... 59% 11.3M 2s
- 13350K .......... .......... .......... .......... .......... 59% 10.6M 2s
- 13400K .......... .......... .......... .......... .......... 59%  797K 2s
- 13450K .......... .......... .......... .......... .......... 59% 7.35M 2s
- 13500K .......... .......... .......... .......... .......... 60% 9.17M 2s
- 13550K .......... .......... .......... .......... .......... 60% 9.48M 2s
- 13600K .......... .......... .......... .......... .......... 60% 8.82M 2s
- 13650K .......... .......... .......... .......... .......... 60% 9.63M 2s
- 13700K .......... .......... .......... .......... .......... 60% 10.8M 2s
- 13750K .......... .......... .......... .......... .......... 61% 10.1M 2s
- 13800K .......... .......... .......... .......... .......... 61% 11.0M 2s
- 13850K .......... .......... .......... .......... .......... 61% 11.2M 2s
- 13900K .......... .......... .......... .......... .......... 61% 10.8M 2s
- 13950K .......... .......... .......... .......... .......... 62% 11.3M 2s
- 14000K .......... .......... .......... .......... .......... 62% 11.3M 2s
- 14050K .......... .......... .......... .......... .......... 62% 11.0M 2s
- 14100K .......... .......... .......... .......... .......... 62% 10.6M 2s
- 14150K .......... .......... .......... .......... .......... 62% 10.5M 2s
- 14200K .......... .......... .......... .......... .......... 63% 11.4M 2s
- 14250K .......... .......... .......... .......... .......... 63% 11.3M 2s
- 14300K .......... .......... .......... .......... .......... 63% 11.0M 2s
- 14350K .......... .......... .......... .......... .......... 63% 11.4M 2s
- 14400K .......... .......... .......... .......... .......... 64%  828K 2s
- 14450K .......... .......... .......... .......... .......... 64% 6.40M 2s
- 14500K .......... .......... .......... .......... .......... 64% 8.74M 2s
- 14550K .......... .......... .......... .......... .......... 64% 9.17M 2s
- 14600K .......... .......... .......... .......... .......... 64% 9.50M 2s
- 14650K .......... .......... .......... .......... .......... 65% 8.98M 2s
- 14700K .......... .......... .......... .......... .......... 65% 9.97M 2s
- 14750K .......... .......... .......... .......... .......... 65% 10.2M 2s
- 14800K .......... .......... .......... .......... .......... 65% 10.6M 2s
- 14850K .......... .......... .......... .......... .......... 66% 10.8M 2s
- 14900K .......... .......... .......... .......... .......... 66% 10.5M 2s
- 14950K .......... .......... .......... .......... .......... 66% 11.4M 2s
- 15000K .......... .......... .......... .......... .......... 66% 9.67M 2s
- 15050K .......... .......... .......... .......... .......... 66% 11.3M 2s
- 15100K .......... .......... .......... .......... .......... 67% 11.4M 2s
- 15150K .......... .......... .......... .......... .......... 67% 10.9M 2s
- 15200K .......... .......... .......... .......... .......... 67% 11.3M 2s
- 15250K .......... .......... .......... .......... .......... 67% 11.4M 2s
- 15300K .......... .......... .......... .......... .......... 68% 11.0M 2s
- 15350K .......... .......... .......... .......... .......... 68% 11.3M 2s
- 15400K .......... .......... .......... .......... .......... 68% 10.3M 2s
- 15450K .......... .......... .......... .......... .......... 68%  821K 2s
- 15500K .......... .......... .......... .......... .......... 68% 6.79M 2s
- 15550K .......... .......... .......... .......... .......... 69% 9.43M 2s
- 15600K .......... .......... .......... .......... .......... 69% 8.39M 2s
- 15650K .......... .......... .......... .......... .......... 69% 9.83M 2s
- 15700K .......... .......... .......... .......... .......... 69% 10.2M 2s
- 15750K .......... .......... .......... .......... .......... 70% 10.3M 2s
- 15800K .......... .......... .......... .......... .......... 70% 9.22M 2s
- 15850K .......... .......... .......... .......... .......... 70% 10.8M 2s
- 15900K .......... .......... .......... .......... .......... 70% 10.6M 2s
- 15950K .......... .......... .......... .......... .......... 70% 11.3M 2s
- 16000K .......... .......... .......... .......... .......... 71% 9.87M 2s
- 16050K .......... .......... .......... .......... .......... 71% 11.3M 2s
- 16100K .......... .......... .......... .......... .......... 71% 10.8M 2s
- 16150K .......... .......... .......... .......... .......... 71% 10.7M 2s
- 16200K .......... .......... .......... .......... .......... 72% 11.4M 2s
- 16250K .......... .......... .......... .......... .......... 72% 10.3M 2s
- 16300K .......... .......... .......... .......... .......... 72% 11.0M 1s
- 16350K .......... .......... .......... .......... .......... 72% 11.3M 1s
- 16400K .......... .......... .......... .......... .......... 72% 11.4M 1s
- 16450K .......... .......... .......... .......... .......... 73%  848K 1s
- 16500K .......... .......... .......... .......... .......... 73% 6.34M 1s
- 16550K .......... .......... .......... .......... .......... 73% 8.45M 1s
- 16600K .......... .......... .......... .......... .......... 73% 7.79M 1s
- 16650K .......... .......... .......... .......... .......... 74% 11.1M 1s
- 16700K .......... .......... .......... .......... .......... 74% 9.29M 1s
- 16750K .......... .......... .......... .......... .......... 74% 9.72M 1s
- 16800K .......... .......... .......... .......... .......... 74% 10.2M 1s
- 16850K .......... .......... .......... .......... .......... 74% 10.4M 1s
- 16900K .......... .......... .......... .......... .......... 75% 10.5M 1s
- 16950K .......... .......... .......... .......... .......... 75% 9.62M 1s
- 17000K .......... .......... .......... .......... .......... 75% 11.4M 1s
- 17050K .......... .......... .......... .......... .......... 75% 10.7M 1s
- 17100K .......... .......... .......... .......... .......... 76% 11.3M 1s
- 17150K .......... .......... .......... .......... .......... 76% 11.0M 1s
- 17200K .......... .......... .......... .......... .......... 76% 10.7M 1s
- 17250K .......... .......... .......... .......... .......... 76% 10.0M 1s
- 17300K .......... .......... .......... .......... .......... 76% 11.0M 1s
- 17350K .......... .......... .......... .......... .......... 77% 11.4M 1s
- 17400K .......... .......... .......... .......... .......... 77% 11.3M 1s
- 17450K .......... .......... .......... .......... .......... 77% 11.0M 1s
- 17500K .......... .......... .......... .......... .......... 77%  836K 1s
- 17550K .......... .......... .......... .......... .......... 78% 6.77M 1s
- 17600K .......... .......... .......... .......... .......... 78% 7.86M 1s
- 17650K .......... .......... .......... .......... .......... 78% 9.37M 1s
- 17700K .......... .......... .......... .......... .......... 78% 9.23M 1s
- 17750K .......... .......... .......... .......... .......... 78% 10.3M 1s
- 17800K .......... .......... .......... .......... .......... 79% 10.1M 1s
- 17850K .......... .......... .......... .......... .......... 79% 10.2M 1s
- 17900K .......... .......... .......... .......... .......... 79% 9.84M 1s
- 17950K .......... .......... .......... .......... .......... 79% 10.1M 1s
- 18000K .......... .......... .......... .......... .......... 80% 7.54M 1s
- 18050K .......... .......... .......... .......... .......... 80% 7.13M 1s
- 18100K .......... .......... .......... .......... .......... 80% 11.2M 1s
- 18150K .......... .......... .......... .......... .......... 80% 10.5M 1s
- 18200K .......... .......... .......... .......... .......... 80% 11.2M 1s
- 18250K .......... .......... .......... .......... .......... 81% 11.4M 1s
- 18300K .......... .......... .......... .......... .......... 81% 11.0M 1s
- 18350K .......... .......... .......... .......... .......... 81% 11.2M 1s
- 18400K .......... .......... .......... .......... .......... 81% 11.0M 1s
- 18450K .......... .......... .......... .......... .......... 82% 11.4M 1s
- 18500K .......... .......... .......... .......... .......... 82%  930K 1s
- 18550K .......... .......... .......... .......... .......... 82% 5.96M 1s
- 18600K .......... .......... .......... .......... .......... 82% 7.86M 1s
- 18650K .......... .......... .......... .......... .......... 82% 7.84M 1s
- 18700K .......... .......... .......... .......... .......... 83% 10.7M 1s
- 18750K .......... .......... .......... .......... .......... 83% 8.49M 1s
- 18800K .......... .......... .......... .......... .......... 83% 11.0M 1s
- 18850K .......... .......... .......... .......... .......... 83% 10.7M 1s
- 18900K .......... .......... .......... .......... .......... 83% 9.26M 1s
- 18950K .......... .......... .......... .......... .......... 84% 10.9M 1s
- 19000K .......... .......... .......... .......... .......... 84% 9.96M 1s
- 19050K .......... .......... .......... .......... .......... 84% 7.68M 1s
- 19100K .......... .......... .......... .......... .......... 84% 6.94M 1s
- 19150K .......... .......... .......... .......... .......... 85% 10.6M 1s
- 19200K .......... .......... .......... .......... .......... 85% 11.4M 1s
- 19250K .......... .......... .......... .......... .......... 85% 10.5M 1s
- 19300K .......... .......... .......... .......... .......... 85% 11.3M 1s
- 19350K .......... .......... .......... .......... .......... 85% 11.4M 1s
- 19400K .......... .......... .......... .......... .......... 86% 9.57M 1s
- 19450K .......... .......... .......... .......... .......... 86% 11.3M 1s
- 19500K .......... .......... .......... .......... .......... 86% 5.63M 1s
- 19550K .......... .......... .......... .......... .......... 86%  881K 1s
- 19600K .......... .......... .......... .......... .......... 87% 10.8M 1s
- 19650K .......... .......... .......... .......... .......... 87% 11.0M 1s
- 19700K .......... .......... .......... .......... .......... 87% 5.83M 1s
- 19750K .......... .......... .......... .......... .......... 87% 11.3M 1s
- 19800K .......... .......... .......... .......... .......... 87% 11.0M 1s
- 19850K .......... .......... .......... .......... .......... 88% 11.4M 1s
- 19900K .......... .......... .......... .......... .......... 88% 10.9M 1s
- 19950K .......... .......... .......... .......... .......... 88% 10.9M 1s
- 20000K .......... .......... .......... .......... .......... 88% 11.3M 1s
- 20050K .......... .......... .......... .......... .......... 89% 11.2M 1s
- 20100K .......... .......... .......... .......... .......... 89% 6.82M 1s
- 20150K .......... .......... .......... .......... .......... 89% 10.9M 1s
- 20200K .......... .......... .......... .......... .......... 89% 10.8M 1s
- 20250K .......... .......... .......... .......... .......... 89% 10.0M 1s
- 20300K .......... .......... .......... .......... .......... 90% 11.4M 0s
- 20350K .......... .......... .......... .......... .......... 90% 11.0M 0s
- 20400K .......... .......... .......... .......... .......... 90% 9.42M 0s
- 20450K .......... .......... .......... .......... .......... 90% 11.4M 0s
- 20500K .......... .......... .......... .......... .......... 91% 11.0M 0s
- 20550K .......... .......... .......... .......... .......... 91%  948K 0s
- 20600K .......... .......... .......... .......... .......... 91% 3.86M 0s
- 20650K .......... .......... .......... .......... .......... 91% 11.0M 0s
- 20700K .......... .......... .......... .......... .......... 91% 6.12M 0s
- 20750K .......... .......... .......... .......... .......... 92% 10.9M 0s
- 20800K .......... .......... .......... .......... .......... 92% 10.9M 0s
- 20850K .......... .......... .......... .......... .......... 92% 10.5M 0s
- 20900K .......... .......... .......... .......... .......... 92% 11.4M 0s
- 20950K .......... .......... .......... .......... .......... 93% 11.0M 0s
- 21000K .......... .......... .......... .......... .......... 93% 11.3M 0s
- 21050K .......... .......... .......... .......... .......... 93% 11.0M 0s
- 21100K .......... .......... .......... .......... .......... 93% 11.4M 0s
- 21150K .......... .......... .......... .......... .......... 93% 7.09M 0s
- 21200K .......... .......... .......... .......... .......... 94% 10.1M 0s
- 21250K .......... .......... .......... .......... .......... 94% 11.3M 0s
- 21300K .......... .......... .......... .......... .......... 94% 9.94M 0s
- 21350K .......... .......... .......... .......... .......... 94% 11.0M 0s
- 21400K .......... .......... .......... .......... .......... 95% 11.1M 0s
- 21450K .......... .......... .......... .......... .......... 95% 9.29M 0s
- 21500K .......... .......... .......... .......... .......... 95% 11.0M 0s
- 21550K .......... .......... .......... .......... .......... 95% 6.50M 0s
- 21600K .......... .......... .......... .......... .......... 95%  881K 0s
- 21650K .......... .......... .......... .......... .......... 96% 8.56M 0s
- 21700K .......... .......... .......... .......... .......... 96% 7.09M 0s
- 21750K .......... .......... .......... .......... .......... 96% 9.39M 0s
- 21800K .......... .......... .......... .......... .......... 96% 11.3M 0s
- 21850K .......... .......... .......... .......... .......... 97% 10.6M 0s
- 21900K .......... .......... .......... .......... .......... 97% 10.0M 0s
- 21950K .......... .......... .......... .......... .......... 97% 11.3M 0s
- 22000K .......... .......... .......... .......... .......... 97% 11.4M 0s
- 22050K .......... .......... .......... .......... .......... 97% 11.0M 0s
- 22100K .......... .......... .......... .......... .......... 98% 11.3M 0s
- 22150K .......... .......... .......... .......... .......... 98% 7.28M 0s
- 22200K .......... .......... .......... .......... .......... 98% 9.42M 0s
- 22250K .......... .......... .......... .......... .......... 98% 11.3M 0s
- 22300K .......... .......... .......... .......... .......... 99% 10.9M 0s
- 22350K .......... .......... .......... .......... .......... 99% 11.2M 0s
- 22400K .......... .......... .......... .......... .......... 99% 11.3M 0s
- 22450K .......... .......... .......... .......... .......... 99% 9.07M 0s
- 22500K .......... .......... .......... .......... .......... 99% 11.2M 0s
- 22550K ..........                                            100% 11.8M=4.9s
-
-2011-01-24 12:16:36 (4.52 MB/s) - `WRFV2.2.TAR.gz' saved [23101614/23101614]
-
---2011-01-24 12:16:36--  http://./
-Resolving .... failed: Name or service not known.
-wget: unable to resolve host address `.'
-FINISHED --2011-01-24 12:16:36--
-Downloaded: 1 files, 22M in 4.9s (4.52 MB/s)
---2011-01-24 12:16:45--  http://www.mmm.ucar.edu/wrf/src/fix/rsl_bcast.c
-Resolving www.mmm.ucar.edu... 128.117.88.210
-Connecting to www.mmm.ucar.edu|128.117.88.210|:80... connected.
-HTTP request sent, awaiting response... 200 OK
-Length: 19131 (19K) [text/x-c]
-Saving to: `rsl_bcast.c'
-
-     0K .......... ........                                   100% 59.9K=0.3s
-
-2011-01-24 12:16:45 (59.9 KB/s) - `rsl_bcast.c' saved [19131/19131]
-
---2011-01-24 12:16:45--  http://./
-Resolving .... failed: Name or service not known.
-wget: unable to resolve host address `.'
-FINISHED --2011-01-24 12:16:45--
-Downloaded: 1 files, 19K in 0.3s (59.9 KB/s)
---2011-01-24 12:16:45--  http://www.mmm.ucar.edu/wrf/src/fix/solve_em.F.fix
-Resolving www.mmm.ucar.edu... 128.117.88.210
-Connecting to www.mmm.ucar.edu|128.117.88.210|:80... connected.
-HTTP request sent, awaiting response... 200 OK
-Length: 165706 (162K) [text/x-fortran]
-Saving to: `solve_em.F.fix'
-
-     0K .......... .......... .......... .......... .......... 30%  107K 1s
-    50K .......... .......... .......... .......... .......... 61%  322K 0s
-   100K .......... .......... .......... .......... .......... 92%  326K 0s
-   150K .......... .                                          100% 11.4M=0.8s
-
-2011-01-24 12:16:46 (208 KB/s) - `solve_em.F.fix' saved [165706/165706]
-
---2011-01-24 12:16:46--  http://./
-Resolving .... failed: Name or service not known.
-wget: unable to resolve host address `.'
-FINISHED --2011-01-24 12:16:46--
-Downloaded: 1 files, 162K in 0.8s (208 KB/s)
---2011-01-24 12:16:47--  http://wget/
-Resolving wget... failed: Name or service not known.
-wget: unable to resolve host address `wget'
---2011-01-24 12:16:47--  http://www.mmm.ucar.edu/wrf/src/WPSV2.2.TAR.gz
-Resolving www.mmm.ucar.edu... 128.117.88.210
-Connecting to www.mmm.ucar.edu|128.117.88.210|:80... connected.
-HTTP request sent, awaiting response... 200 OK
-Length: 507263 (495K) [application/x-gzip]
-Saving to: `WPSV2.2.TAR.gz'
-
-     0K .......... .......... .......... .......... .......... 10%  108K 4s
-    50K .......... .......... .......... .......... .......... 20%  323K 2s
-   100K .......... .......... .......... .......... .......... 30%  326K 2s
-   150K .......... .......... .......... .......... .......... 40%  330K 1s
-   200K .......... .......... .......... .......... .......... 50% 11.4M 1s
-   250K .......... .......... .......... .......... .......... 60% 11.0M 1s
-   300K .......... .......... .......... .......... .......... 70%  338K 0s
-   350K .......... .......... .......... .......... .......... 80% 11.3M 0s
-   400K .......... .......... .......... .......... .......... 90%  343K 0s
-   450K .......... .......... .......... .......... .....     100% 11.3M=1.2s
-
-2011-01-24 12:16:48 (401 KB/s) - `WPSV2.2.TAR.gz' saved [507263/507263]
-
---2011-01-24 12:16:48--  http://./
-Resolving .... failed: Name or service not known.
-wget: unable to resolve host address `.'
-FINISHED --2011-01-24 12:16:48--
-Downloaded: 1 files, 495K in 1.2s (401 KB/s)
---2011-01-24 12:16:57--  http://web.lmd.jussieu.fr/~forget/datagcm/datafile/dust_tes.nc
-Resolving web.lmd.jussieu.fr... 134.157.47.81
-Connecting to web.lmd.jussieu.fr|134.157.47.81|:80... connected.
-HTTP request sent, awaiting response... 200 OK
-Length: 6939852 (6.6M) [application/x-netcdf]
-Saving to: `dust_tes.nc'
-
-     0K .......... .......... .......... .......... ..........  0% 2.43M 3s
-    50K .......... .......... .......... .......... ..........  1% 11.0M 2s
-   100K .......... .......... .......... .......... ..........  2% 11.3M 1s
-   150K .......... .......... .......... .......... ..........  2% 11.3M 1s
-   200K .......... .......... .......... .......... ..........  3% 11.0M 1s
-   250K .......... .......... .......... .......... ..........  4% 11.0M 1s
-   300K .......... .......... .......... .......... ..........  5% 11.3M 1s
-   350K .......... .......... .......... .......... ..........  5% 9.26M 1s
-   400K .......... .......... .......... .......... ..........  6% 11.3M 1s
-   450K .......... .......... .......... .......... ..........  7% 11.3M 1s
-   500K .......... .......... .......... .......... ..........  8% 10.3M 1s
-   550K .......... .......... .......... .......... ..........  8% 11.3M 1s
-   600K .......... .......... .......... .......... ..........  9% 11.4M 1s
-   650K .......... .......... .......... .......... .......... 10% 10.5M 1s
-   700K .......... .......... .......... .......... .......... 11% 11.3M 1s
-   750K .......... .......... .......... .......... .......... 11% 10.7M 1s
-   800K .......... .......... .......... .......... .......... 12% 11.3M 1s
-   850K .......... .......... .......... .......... .......... 13% 10.8M 1s
-   900K .......... .......... .......... .......... .......... 14% 6.21M 1s
-   950K .......... .......... .......... .......... .......... 14% 6.76M 1s
-  1000K .......... .......... .......... .......... .......... 15% 11.0M 1s
-  1050K .......... .......... .......... .......... .......... 16% 11.3M 1s
-  1100K .......... .......... .......... .......... .......... 16% 10.9M 1s
-  1150K .......... .......... .......... .......... .......... 17% 10.8M 1s
-  1200K .......... .......... .......... .......... .......... 18% 10.8M 1s
-  1250K .......... .......... .......... .......... .......... 19% 11.2M 1s
-  1300K .......... .......... .......... .......... .......... 19% 10.6M 1s
-  1350K .......... .......... .......... .......... .......... 20% 10.8M 1s
-  1400K .......... .......... .......... .......... .......... 21% 4.59M 1s
-  1450K .......... .......... .......... .......... .......... 22% 10.8M 1s
-  1500K .......... .......... .......... .......... .......... 22% 11.0M 1s
-  1550K .......... .......... .......... .......... .......... 23% 10.8M 1s
-  1600K .......... .......... .......... .......... .......... 24% 10.8M 1s
-  1650K .......... .......... .......... .......... .......... 25% 10.8M 1s
-  1700K .......... .......... .......... .......... .......... 25% 10.8M 1s
-  1750K .......... .......... .......... .......... .......... 26% 11.4M 1s
-  1800K .......... .......... .......... .......... .......... 27% 10.7M 1s
-  1850K .......... .......... .......... .......... .......... 28% 6.28M 1s
-  1900K .......... .......... .......... .......... .......... 28% 10.5M 1s
-  1950K .......... .......... .......... .......... .......... 29% 11.3M 1s
-  2000K .......... .......... .......... .......... .......... 30% 10.8M 0s
-  2050K .......... .......... .......... .......... .......... 30% 6.73M 0s
-  2100K .......... .......... .......... .......... .......... 31% 11.0M 0s
-  2150K .......... .......... .......... .......... .......... 32% 10.9M 0s
-  2200K .......... .......... .......... .......... .......... 33% 11.0M 0s
-  2250K .......... .......... .......... .......... .......... 33% 10.9M 0s
-  2300K .......... .......... .......... .......... .......... 34% 10.8M 0s
-  2350K .......... .......... .......... .......... .......... 35% 3.65M 0s
-  2400K .......... .......... .......... .......... .......... 36% 11.3M 0s
-  2450K .......... .......... .......... .......... .......... 36% 3.10M 0s
-  2500K .......... .......... .......... .......... .......... 37% 2.93M 0s
-  2550K .......... .......... .......... .......... .......... 38% 11.2M 0s
-  2600K .......... .......... .......... .......... .......... 39% 11.3M 0s
-  2650K .......... .......... .......... .......... .......... 39% 11.3M 0s
-  2700K .......... .......... .......... .......... .......... 40% 11.2M 0s
-  2750K .......... .......... .......... .......... .......... 41% 10.4M 0s
-  2800K .......... .......... .......... .......... .......... 42% 11.2M 0s
-  2850K .......... .......... .......... .......... .......... 42% 11.2M 0s
-  2900K .......... .......... .......... .......... .......... 43% 10.1M 0s
-  2950K .......... .......... .......... .......... .......... 44% 11.0M 0s
-  3000K .......... .......... .......... .......... .......... 45% 10.8M 0s
-  3050K .......... .......... .......... .......... .......... 45% 9.58M 0s
-  3100K .......... .......... .......... .......... .......... 46% 11.0M 0s
-  3150K .......... .......... .......... .......... .......... 47% 11.0M 0s
-  3200K .......... .......... .......... .......... .......... 47% 10.8M 0s
-  3250K .......... .......... .......... .......... .......... 48% 10.8M 0s
-  3300K .......... .......... .......... .......... .......... 49% 3.66M 0s
-  3350K .......... .......... .......... .......... .......... 50% 11.3M 0s
-  3400K .......... .......... .......... .......... .......... 50% 2.03M 0s
-  3450K .......... .......... .......... .......... .......... 51% 11.2M 0s
-  3500K .......... .......... .......... .......... .......... 52% 10.7M 0s
-  3550K .......... .......... .......... .......... .......... 53% 11.3M 0s
-  3600K .......... .......... .......... .......... .......... 53% 11.2M 0s
-  3650K .......... .......... .......... .......... .......... 54% 11.3M 0s
-  3700K .......... .......... .......... .......... .......... 55% 10.1M 0s
-  3750K .......... .......... .......... .......... .......... 56% 8.50M 0s
-  3800K .......... .......... .......... .......... .......... 56% 11.0M 0s
-  3850K .......... .......... .......... .......... .......... 57% 11.2M 0s
-  3900K .......... .......... .......... .......... .......... 58% 10.8M 0s
-  3950K .......... .......... .......... .......... .......... 59% 10.8M 0s
-  4000K .......... .......... .......... .......... .......... 59% 11.3M 0s
-  4050K .......... .......... .......... .......... .......... 60% 10.8M 0s
-  4100K .......... .......... .......... .......... .......... 61% 10.6M 0s
-  4150K .......... .......... .......... .......... .......... 61% 10.8M 0s
-  4200K .......... .......... .......... .......... .......... 62% 10.8M 0s
-  4250K .......... .......... .......... .......... .......... 63% 11.3M 0s
-  4300K .......... .......... .......... .......... .......... 64% 3.32M 0s
-  4350K .......... .......... .......... .......... .......... 64% 11.1M 0s
-  4400K .......... .......... .......... .......... .......... 65% 10.9M 0s
-  4450K .......... .......... .......... .......... .......... 66% 11.3M 0s
-  4500K .......... .......... .......... .......... .......... 67% 10.6M 0s
-  4550K .......... .......... .......... .......... .......... 67% 3.31M 0s
-  4600K .......... .......... .......... .......... .......... 68% 11.2M 0s
-  4650K .......... .......... .......... .......... .......... 69% 11.2M 0s
-  4700K .......... .......... .......... .......... .......... 70% 11.0M 0s
-  4750K .......... .......... .......... .......... .......... 70% 3.03M 0s
-  4800K .......... .......... .......... .......... .......... 71% 11.2M 0s
-  4850K .......... .......... .......... .......... .......... 72% 11.0M 0s
-  4900K .......... .......... .......... .......... .......... 73% 10.8M 0s
-  4950K .......... .......... .......... .......... .......... 73% 11.4M 0s
-  5000K .......... .......... .......... .......... .......... 74% 10.8M 0s
-  5050K .......... .......... .......... .......... .......... 75% 10.8M 0s
-  5100K .......... .......... .......... .......... .......... 75% 10.5M 0s
-  5150K .......... .......... .......... .......... .......... 76% 11.4M 0s
-  5200K .......... .......... .......... .......... .......... 77% 10.9M 0s
-  5250K .......... .......... .......... .......... .......... 78% 3.60M 0s
-  5300K .......... .......... .......... .......... .......... 78% 11.1M 0s
-  5350K .......... .......... .......... .......... .......... 79% 10.8M 0s
-  5400K .......... .......... .......... .......... .......... 80% 11.0M 0s
-  5450K .......... .......... .......... .......... .......... 81% 10.8M 0s
-  5500K .......... .......... .......... .......... .......... 81% 10.8M 0s
-  5550K .......... .......... .......... .......... .......... 82% 10.6M 0s
-  5600K .......... .......... .......... .......... .......... 83% 11.3M 0s
-  5650K .......... .......... .......... .......... .......... 84% 11.0M 0s
-  5700K .......... .......... .......... .......... .......... 84% 1.03M 0s
-  5750K .......... .......... .......... .......... .......... 85% 11.2M 0s
-  5800K .......... .......... .......... .......... .......... 86% 11.2M 0s
-  5850K .......... .......... .......... .......... .......... 87% 11.3M 0s
-  5900K .......... .......... .......... .......... .......... 87% 11.2M 0s
-  5950K .......... .......... .......... .......... .......... 88% 11.2M 0s
-  6000K .......... .......... .......... .......... .......... 89% 11.0M 0s
-  6050K .......... .......... .......... .......... .......... 90% 10.7M 0s
-  6100K .......... .......... .......... .......... .......... 90% 11.3M 0s
-  6150K .......... .......... .......... .......... .......... 91% 10.8M 0s
-  6200K .......... .......... .......... .......... .......... 92% 11.3M 0s
-  6250K .......... .......... .......... .......... .......... 92% 10.4M 0s
-  6300K .......... .......... .......... .......... .......... 93% 11.0M 0s
-  6350K .......... .......... .......... .......... .......... 94% 10.8M 0s
-  6400K .......... .......... .......... .......... .......... 95% 10.8M 0s
-  6450K .......... .......... .......... .......... .......... 95% 11.3M 0s
-  6500K .......... .......... .......... .......... .......... 96% 10.8M 0s
-  6550K .......... .......... .......... .......... .......... 97% 10.8M 0s
-  6600K .......... .......... .......... .......... .......... 98% 10.5M 0s
-  6650K .......... .......... .......... .......... .......... 98% 11.4M 0s
-  6700K .......... .......... .......... .......... .......... 99% 4.88M 0s
-  6750K .......... .......... .......                         100% 11.4M=0.8s
-
-2011-01-24 12:16:59 (8.38 MB/s) - `dust_tes.nc' saved [6939852/6939852]
-
---2011-01-24 12:16:59--  http://./
-Resolving .... failed: Name or service not known.
-wget: unable to resolve host address `.'
-FINISHED --2011-01-24 12:16:59--
-Downloaded: 1 files, 6.6M in 0.8s (8.38 MB/s)
Index: trunk/MESOSCALE/LMD_MM_MARS/makemeso
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/makemeso	(revision 206)
+++ trunk/MESOSCALE/LMD_MM_MARS/makemeso	(revision 207)
@@ -174,4 +174,10 @@
 	      tra=1	 
             fi
+            if [[ "${phys}" == "newphys_" ]]
+            then
+              echo "How many types of scatterer are you using ? 1 [dust] or 2 [dust + water ice]" ; read scat
+            else
+              scat=1 ## dummy stuff
+            fi
          fi
   # folder
@@ -185,8 +191,8 @@
         if [[ "${scenario}" == "" ]]
         then
-          sed s+"mars_lmd"+"mars_lmd_new"+g             copy_model > copy_model_tmp
+          sed s+"mars_lmd"+"mars_lmd_new"+g             SRC/copy_model > copy_model_tmp
         else
           echo SCENARIO ${scenario} DID YOU INCLUDE THE SPECIFIC folder ? ; read dummy 
-          sed s+"mars_lmd"+"mars_lmd_new_${scenario}"+g copy_model > copy_model_tmp
+          sed s+"mars_lmd"+"mars_lmd_new_${scenario}"+g SRC/copy_model > copy_model_tmp
              if [[ "${config}" == "les" ]] 
              then
@@ -217,12 +223,11 @@
      cd Registry ; Registry.bash ; cd ..
     else
-     #./copy_model
          if [[ "${config}" == "les" ]] 
          then
            ### NB: With physics: LES folder // Without physics : LESnophys_ folder
            ### ---- because differences in 'modif' folder ----
-           sed s+"PWD/SRC/"+"PWD/SRC/LES$phys/"+g copy_model > copy_model_tmp
+           sed s+"PWD/SRC/"+"PWD/SRC/LES$phys/"+g SRC/copy_model > copy_model_tmp
          else
-           cp copy_model copy_model_tmp
+           cp SRC/copy_model copy_model_tmp
          fi   
      chmod 755 copy_model_tmp
@@ -265,10 +270,4 @@
             fi
     fi 
-  fi
-  if [[ "${phys}" == "newphys_" ]]
-  then
-     echo "How many scatterers are you using : 1,2,..." ; read scat
-  else
-     scat=1 ## dummy stuff
   fi
 
Index: trunk/MESOSCALE/LMD_MM_MARS/prepare
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/prepare	(revision 206)
+++ 	(revision )
@@ -1,76 +1,0 @@
-#! /bin/bash
-
-#---------------------------------------#
-# A script to install the model         #
-#---------------------------------------#
-# Author: Aymeric Spiga - November 2008 #
-#---------------------------------------#
-
-
-touch download_log
-
-mkdir SRC
-cd SRC/
-
-mv ../g95.tar.gz .
-mv ../mac.tar.gz .
-mv ../datesave .
-mv ../saved .
-mv ../INIT_SIMPLE_TEST.tar.gz .
-mv ../POSTPROC.tar.gz .
-
-echo 1/8 get WRF sources
-wget http://www.mmm.ucar.edu/wrf/src/WRFV2.2.TAR.gz . >> ../download_log 2>> ../download_log
-tar xzvf WRFV2.2.TAR.gz > /dev/null
-\rm WRFV2.2.TAR.gz 
-## patch
-wget http://www.mmm.ucar.edu/wrf/src/fix/rsl_bcast.c . >> ../download_log 2>> ../download_log
-mv -f rsl_bcast.c WRFV2/external/RSL_LITE/
-wget http://www.mmm.ucar.edu/wrf/src/fix/solve_em.F.fix . >> ../download_log 2>> ../download_log
-mv -f solve_em.F.fix WRFV2/dyn_em/solve_em.F
-## patch
-
-echo 2/8 get WPS sources
-wget wget http://www.mmm.ucar.edu/wrf/src/WPSV2.2.TAR.gz . >> ../download_log 2>> ../download_log
-tar xzvf WPSV2.2.TAR.gz > /dev/null
-\rm WPSV2.2.TAR.gz
-
-echo 3/8 get WRF modified Martian sources
-mv ../sources_Mars.tar.gz .
-tar xzvf sources_Mars.tar.gz > /dev/null
-cp -rf save/* WRFV2/
-\rm -rf save
-\rm sources_Mars.tar.gz 
-
-echo 4/8 get WPS modified Martian sources
-mv ../WPS.tar.gz .
-tar xzvf WPS.tar.gz > /dev/null
-cd WPS
-#cp -f /donnees/aslmd/WRF/SRC/WPS/wps_mars/switch_WPS_Mars .
-./switch_WPS_Mars
-cd ..
-\rm WPS.tar.gz
-
-echo 5/8 get ARWpost for Mars
-mv ../ARWpost.tar.gz .
-tar xzvf ARWpost.tar.gz > /dev/null
-\rm ARWpost.tar.gz
-
-echo 6/8 get PREP_MARS
-mv ../PREP_MARS.tar.gz .
-tar xzvf PREP_MARS.tar.gz > /dev/null
-\rm PREP_MARS.tar.gz
-
-cd ..
-
-echo 7/8 get surface data utilities
-tar xzvf WPS_GEOG.tar.gz > /dev/null
-wget http://web.lmd.jussieu.fr/~forget/datagcm/datafile/dust_tes.nc . >> ./download_log 2>> ./download_log
-mv dust_tes.nc WPS_GEOG/
-\rm WPS_GEOG.tar.gz
-
-echo 8/8 get run utilies
-tar xzvf SIMU.tar.gz > /dev/null
-\rm SIMU.tar.gz
-
-echo ok
Index: trunk/MESOSCALE/LMD_MM_MARS/prepare_ini
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/prepare_ini	(revision 206)
+++ 	(revision )
@@ -1,100 +1,0 @@
-#! /bin/bash
-
-#---------------------------------------#
-# A script to install the preproc tools #
-#---------------------------------------#
-# Author: Aymeric Spiga - November 2008 #
-#---------------------------------------#
-
-
-echo "If you use new physics, few modifications will be needed"
-
-
-if [[ "${LMDMOD}" = "" ]]
-then
-    echo "No LMDMOD defined...assuming default folders"
-    LMDMOD=$PWD"/../.."
-fi
-
-
-###############
-tmpdir=$LMDMOD/TMPDIR
-lmdmeso=$LMDMOD/LMD_MM_MARS
-sourceprepmars=$lmdmeso"/SRC/PREP_MARS"
-sourcewps=$lmdmeso"/SRC/WPS"
-###############
-
-echo create tmpdir directories
-mkdir $tmpdir/WPSFEED 2> /dev/null
-mkdir $tmpdir/WRFFEED 2> /dev/null
-#mkdir $tmpdir/WRFFEED/current 2> /dev/null
-mkdir $tmpdir/GCMINI 2> /dev/null
-
-here=$PWD
-\rm -rf $here/PREP_MARS $here/WPS 2> /dev/null
-
-echo link PREP_MARS in $here
-
-mkdir $here/PREP_MARS
-cd $here/PREP_MARS
-ln -sf ${sourceprepmars}/* .
-ln -sf $tmpdir/WPSFEED .
-ln -sf $tmpdir/GCMINI/diagfi.nc input_diagfi.nc
-cd $here
-
-echo prepare WPS in $here
-
-	####### done in prepare
-	###cd ${sourcewps}
-	###cp ${sourcewps}/wps_mars/switch_WPS_Mars ${sourcewps}
-	###./switch_WPS_Mars
-
-cd ${here}
-mkdir $here/WPS
-cd ${here}/WPS
-ln -sf ${sourcewps}/compile .
-ln -sf ${sourcewps}/configure .
-ln -sf ${sourcewps}/clean .
-ln -sf ${sourcewps}/arch .
-ln -sf $tmpdir/WPSFEED .
-ln -sf $tmpdir/WRFFEED .
-
-mkdir ${here}/WPS/geogrid
-cd ${here}/WPS/geogrid
-	#cp -f ${sourcewps}/geogrid/GEOGRID.TBL.ARW GEOGRID.TBL
-	#echo "attention GEOGRID.TBL n est pas le bon !!!!"
-ln -sf ${sourcewps}/wps_mars/geogrid/GEOGRID.TBL.ARW_Mars GEOGRID.TBL
-cp -f ${sourcewps}/geogrid/Makefile .
-mkdir src
-cd src
-ln -sf ${sourcewps}/geogrid/src/* .  
-cd ${here}/WPS  
-
-mkdir ${here}/WPS/metgrid
-cd ${here}/WPS/metgrid
-	#cp -f ${sourcewps}/metgrid/METGRID.TBL.ARW METGRID.TBL
-	#echo "attention METGRID.TBL n est pas le bon !!!!"
-ln -sf ${sourcewps}/wps_mars/metgrid/METGRID.TBL.ARW_MarsBase_newphys METGRID.TBL
-cp -f ${sourcewps}/metgrid/Makefile .
-mkdir src
-cd src
-ln -sf ${sourcewps}/metgrid/src/* .
-cd ${here}/WPS
-
-##
-## examples and plots
-##
-#ln -sf ${sourcewps}/wps_mars/out_geo.pro .
-ln -sf ${sourcewps}/wps_mars/namelist.wps* .
-#ln -sf ${lmdmeso}/SRC/ARWpost/idl/colorbar__define.pro .
-#ln -sf ${lmdmeso}/SRC/ARWpost/idl/colorbar.pro .
-#ln -sf ${lmdmeso}/SRC/ARWpost/idl/map_latlon.pro .
-
-#
-# link to static data
-#
-ln -sf ${lmdmeso}/WPS_GEOG .
-
-exit
-
-
Index: trunk/MESOSCALE/LMD_MM_MARS/prepare_offline
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/prepare_offline	(revision 206)
+++ 	(revision )
@@ -1,84 +1,0 @@
-#! /bin/bash
-
-#---------------------------------------#
-# A script to install the model         #
-#---------------------------------------#
-# Author: Aymeric Spiga - November 2008 #
-#---------------------------------------#
-
-
-touch download_log
-
-mkdir SRC
-cd SRC/
-
-cp -f ../../dl.tar.gz .
-
-mv ../g95.tar.gz .
-mv ../mac.tar.gz .
-mv ../datesave .
-mv ../saved .
-mv ../INIT_SIMPLE_TEST.tar.gz .
-
-###########################
-gunzip dl.tar.gz
-tar xf dl.tar
-cp -rf dl/* .
-rm -rf dl 
-rm -rf dl.tar
-###########################
-
-echo 1/8 get WRF sources
-gunzip  WRFV2.2.TAR.gz  > /dev/null
-tar xf  WRFV2.2.TAR     > /dev/null
-\rm     WRFV2.2.TAR 
-## patch
-mv -f rsl_bcast.c WRFV2/external/RSL_LITE/
-mv -f solve_em.F.fix WRFV2/dyn_em/solve_em.F
-## patch
-
-echo 2/8 get WPS sources
-gunzip  WPSV2.2.TAR.gz  > /dev/null
-tar xf  WPSV2.2.TAR     > /dev/null
-\rm     WPSV2.2.TAR
-
-echo 3/8 get WRF modified Martian sources
-mv ../sources_Mars.tar.gz .
-gunzip  sources_Mars.tar.gz  > /dev/null
-tar xf  sources_Mars.tar     > /dev/null
-cp -rf save/* WRFV2/
-\rm -rf save
-\rm     sources_Mars.tar 
-
-echo 4/8 get WPS modified Martian sources
-mv ../WPS.tar.gz .
-gunzip  WPS.tar.gz  > /dev/null
-tar xf  WPS.tar     > /dev/null
-\rm     WPS.tar
-
-echo 5/8 get ARWpost for Mars
-mv ../ARWpost.tar.gz .
-gunzip  ARWpost.tar.gz  > /dev/null
-tar xf  ARWpost.tar     > /dev/null
-\rm     ARWpost.tar
-
-echo 6/8 get PREP_MARS
-mv ../PREP_MARS.tar.gz .
-gunzip  PREP_MARS.tar.gz  > /dev/null
-tar xf  PREP_MARS.tar     > /dev/null
-\rm     PREP_MARS.tar
-
-cd ..
-
-echo 7/8 get surface data utilities
-gunzip  WPS_GEOG.tar.gz  > /dev/null
-tar xf  WPS_GEOG.tar     > /dev/null
-mv SRC/dust_tes.nc WPS_GEOG/
-\rm     WPS_GEOG.tar
-
-echo 8/8 get run utilies
-gunzip  SIMU.tar.gz      > /dev/null
-tar xf  SIMU.tar         > /dev/null
-\rm     SIMU.tar
-
-echo ok
Index: trunk/MESOSCALE/LMD_MM_MARS/prepare_post
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/prepare_post	(revision 206)
+++ 	(revision )
@@ -1,29 +1,0 @@
-#! /bin/bash
-
-mkdir ARWpost/
-cd ARWpost
-
-ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/clean .
-ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/compile .
-ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/configure .
-ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/arch .
-ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/clean .
-ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/change_bottom* .
-ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/idl/* .
-
-mkdir src
-cd src
-ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/src/* .
-cd ..
-
-cp $LMDMOD/LMD_MM_MARS/SRC/g95.tar.gz .
-tar xzf g95.tar.gz
-more g95/fix* | sed s+"LIBVIS5D"+"#LIBVIS5D"+g | sed s+"-DV5D"+"#-DV5D"+g >> arch/configure.defaults
-rm -rf g95*
-
-#configure
-#compile
-#change rm *.png in gw.pro
-#save gw.def	
-#modif ps2png	
-#change demo
Index: trunk/MESOSCALE/LMD_MM_MARS/save_all
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/save_all	(revision 206)
+++ 	(revision )
@@ -1,82 +1,0 @@
-#! /bin/bash
-
-
-### must do something to remove .svn in save files 
-### find * */* */*/* -iname .svn
-
-echo Saving LMD_MM_MARS !
-
-mkdir clean
-
-cd SRC
-
-  cd WRFV2
-    save_changes
-    mv sources_Mars.tar.gz ../../clean/
-    mv saved ../../clean/
-  cd ..
-
-  tar czvf ARWpost.tar.gz ARWpost
-  mv ARWpost.tar.gz ../clean/
-
-  #tar czvf INIT_SIMPLE_TEST.tar.gz INIT_SIMPLE_TEST
-  #mv INIT_SIMPLE_TEST.tar.gz ../clean/
-  cp INIT_SIMPLE_TEST.tar.gz ../clean/
-
-  tar czvf PREP_MARS.tar.gz PREP_MARS
-  mv PREP_MARS.tar.gz ../clean/
-
-  tar czvf WPS.tar.gz WPS/switch* WPS/wps_mars
-  mv WPS.tar.gz ../clean/
-
-  #tar czvf g95.tar.gz g95
-  #mv g95.tar.gz ../clean/
-  cp g95.tar.gz ../clean/
-
-  #tar czvf mac.tar.gz mac
-  #mv mac.tar.gz ../clean/
-  cp mac.tar.gz ../clean/
-
-  tar czvf POSTPROC.tar.gz POSTPROC
-  mv POSTPROC.tar.gz ../clean/
-
-
-cd ..
-
-tar czvf SIMU.tar.gz SIMU
-mv SIMU.tar.gz clean/
-
-tar czvf WPS_GEOG.tar.gz WPS_GEOG/res WPS_GEOG/*_GCM
-mv WPS_GEOG.tar.gz clean/
-
-#cd WPS_GEOG
-#cd not_used
-#save_wps_geog
-#mv -f WPS_GEOG.tar.gz ../../clean/
-#cd ../..
-
-cp copy_model clean/
-cp save_all clean/
-cp makemeso clean/
-cp prepare clean/
-cp build_static clean/
-cp prepare_ini clean/
-cp prepare_post clean/
-cp prepare_offline clean/
-
-date > clean/datesave
-cp -f clean/datesave SRC/
-cp -f clean/saved SRC/
-
-#mv clean `date +LMD_MM_MARS_%Y_%m_%d`
-mv clean LMD_MM_MARS
-
-tar czvf `date +LMD_MM_MARS_%Y_%m_%d.tar.gz` LMD_MM_MARS #`date +LMD_MM_MARS_%Y_%m_%d` 
-rm -rf LMD_MM_MARS #`date +LMD_MM_MARS_%Y_%m_%d`
-
-if [[ -d TESTCASE ]]
-then
-tar czvf DATA.tar.gz TESTCASE
-mv DATA.tar.gz LMD_MM_MARS_TESTCASE.tar.gz
-fi
-
Index: trunk/MESOSCALE/NOTES.txt
===================================================================
--- trunk/MESOSCALE/NOTES.txt	(revision 206)
+++ 	(revision )
@@ -1,211 +1,0 @@
-
-kvdif ne sert a rien dans le mesoscale martien, en raison de l'appel a la
-physique et MY
-
-Venus_est_dans_SOURCES_FORTRAN
-
-dire que si pb il faut regradre les premiers pas de temps
-
-adapter runmeso pour les runs ideal et les ???
-
-faire comme storm mais avec les pour eviter les recouvrements
-user manual
-
-il faut creer TMPDIR puis GCMINI WPSFEED WRFFEED actuellement
-
-changer la gestion topo dans LES comme fait dans modele general
-
-	13min_si_Registry_modifie     
-	15min_makemeso_moins_f        
-	1min_phys_plus_dyn_chgtresol  
-
-	PD_SCALAR est T par defaut desormais !!
-
-
-	il faudrait regler le prob du Registry dans le LES
-il y a un souci avec les variables liees a l'eau et d'autres
-
-	---anciennes notes lES sur gnome pb avec ideal.exe
-	## jusque 201 OK avec ideal.exe sequentiel
-	## ensuite il vaut mieux utiliser
-	## mpirun -n 4 ideal.exe
-	## le MP_STACK_SIZE est dans le bashrc
-
-
-
-concat.e puis localtime.e puis
-localtime.e (tres long) puis concatnc.e pour avoir en ls
-le resultat doit etre strider a 10... sinon bug affichage
-
-ncwa -O -v mtot,icetot -a longitude -d longitude,-179.0,179.0 diagfi.nc yeye.nc
-ncwa -O -v mtot -a longitude -d longitude,-180.0,180.0 concat_LT.nc mawd.nc
-(si trop gros faire ncrcat -v mtot -d Time,,,2 concat_LT.nc yorgl.nc)
-
-resumee
---> localtime.e tres long
---> concatnc.e en ls tres court
---> renomme le fichier
---> ncwa -O -v mtot,Time -a longitude -d longitude,-180.0,180.0 gcm_LT14_a035.nc mawd_a035.nc 
-
-	A FAIRE:::: mettre des flags precompilo dans les meso_
-	les reporter dans makegcm
-
-changer le renormalisation dans aeropacity ????
-on ne laisse pas aerosol comme le lifting veut qu'il soit !
-tenter des taux de soulevement pour que taudust_tmp soit les obs
-en prescivant une dust bomb fixe d opacite, on aura au moins la structure verticale
-
-	tester traceurs radiativement actifs avec la nouvelle physique ?????
-
-	A FAIRE: PB LES sur iDATAPLEX (les points HFX nuls) (pas de soucis sur ciclad)
-METTRE SUR LE svn LA BASE d'ETATS INITIAUX ????
-
-more than 4 procs w/ nest ??? y reflechir
-	-----------------------------------------------------------------------
-	-- si possible comment determiner taille ?
-	nproc doit diviser e_we-1 (1er nest)
-	grid_ratio doit diviser e_we-1 +4 (1er nest)
-	soit e_we=ye+1
-	grid_ratio divise ye+4 et nproc divise ye
-	soit nproc=8, ye=8*i
-	ainsi il existe j tel que 8i + 4 = 3j ou encore 4*[2i+1] = 3j
-	verifie par exemple si 2i+1 est multiple de 3
-	il suffit donc de trouver un multiple impair de 3 et de deduire i
-	par exemple 2i+1=33 >>>> i=16
-	>>>> e_we = 129 pour le 1er nest (et ajouter 4 pour les suivants)
-	------------------------------------------------------------------------
-
-	ne pas utiliser le FASTCASE avec traceurs (instabilites en haut)
-            ces instabilites sont cependant reglees si on augmente radt a 10 par exemple
-
-	pour le cycle de l'eau c'est OK de regler caps=F dans le mesoscale
-	sauf si on commence a devoiler la calotte permanente nord
-	---> corrige, scenario caps specifique au mesoscale
-
-	NE SERAIT-CE PAS MIEUX DE TOUT TRANSMETTRE AUX BORNES ???
-	tous les traceurs, pas seulement vapor
-
-
-	- attention il faut les trois MARS sinon il s arrete sans message clair
-	- attention a ne pas lancer le modele s il est deja lance
-	- important que pd_scalar soit a T ... le mettre par defaut ????
-
-
-ROUTINES a AJOUTER sont dans COMMON_GCM
-- passer aux nouveaux makegcm [en commun avec Ehouarn si on veut le nouveau
-  readtesassim qui est en F90]
-- il faut tester le nest pour verifier les lignes trop longues
-
-	(ok) lier gr_fi_dyn qui est dans dyn3d
-	(ok) regler le pb du nouveau readtesassim (ou alors le lier tout simplement ou
-	  l'appeler meso_readtesassim)
-	(ok) regler le pb meso_dustlift (le lier dans makemeso comme point precedent)
-	     (car le souci c que dustlift est appele dans vdifc)
-
-	RESTE a ADAPTER le LES a la NOUVELLE PHYSIQUE
-	il y a normalement peu a faire
-	reste a faire egalement le -DNEWPHYS pour le LES
-
-	attention pb d'affichage des valeurs dans le fichier texte avec LES ???
-	bien que les valeurs du fichier soient tout a fait raisonnables
-	... n'est-ce pas un effet de bord cache ????
-
-
-	apres fusion, le LES est reconnu par module_lmd_driver lorsque diff_opt=2 km_opt=2
-
-
-	-attention PB si on ne sort pas HFX et USTM (note dans le Registry)
-	-il faut run.def nouvelle physique [c est meme ce qui est utilise par runmeso]
-	- IL FAUT SE PENCHER SUR LE FAIT QU'ON INDIQUE q2val=0 dans lmd_driver ....
-
------------------------
-ATTENTION NOUVELLE PHYSIQUE
-Oui, c'est quelque chose qu'il faut probablement changer partout 
-maintenant que la version de pgf90 à changé (sur les machines du LMD).
-Avec cette nouvelle version (7.1-6), le '-fast' est plus agressif 
-qu'avant (et inclue entre autre les horribles '-Mvect=sse -Mscalarsse' 
-qui dégradent la précision de certains calculs pour accélérer le code); 
-je préconise de ne plus s'en servir. Bon d'accord, je n'ai pas fait une 
-étude approfondie de l'impact de '-fast', mais j'ai vu qu'avec, 
-j'obtenais des résultats différents lorsque je changeais simplement 
-l'ordre des traceurs...
-
-Aymeric Spiga wrote:
-> je détecte ces changements d'option de compilation ; ont-ils de
-> l'importance ?
->
-> Aymeric
->
-> < #   set optim90=" -fast"
-> < #   set optimtru90=" -fast -c -Mfree "
-> < #   set optim90=" -O2 -Munroll=c:1 -Mnoframe -Mcache_align"
-> < #   set optimtru90=" -O2 -Munroll=c:1 -Mnoframe -Mcache_align"
-> <    set optim90=" -O2 -Munroll -Mcache_align"
-> <    set optimtru90=" -O2 -Munroll -Mcache_align"
-> ---
->   
->>    set optim90=" -fast"
->>    set optimtru90=" -fast -c -Mfree "
-------------------------------
-
-
-	- attention a cp et R, normaliser une bonne fois pour toutes
-	- il manque sur le SVN les cas idealises
-- il manque sur le SVN les scripts MPI
-	- il faut recompiler les librairies NETCDF
-	- mettre la nouvelle physique
-	- mettre les DEF du meso-echelle
-
-	- modele ok sur auric
-- modele pas ok sur ciclad avec pgf2010, erreur inedite un seul module manquant
-	- modele LES OK sur ciclad
-	- modele LES ok sur auric
-
-	24/01/2011
-	tests g95 en 64bits natif sur systeme Linux
-	-- modifications de makemeso, tests
-	-- tout est OK sauf les libraires NETCDF, probleme d'underscore
-	-- OK avec libraires maison compilees avec g95 standard sur flores [et tourne OK]
-
-
-
-	mpi_64_pgf7_ncdf4_mpi1.2.txt
-	- probleme lors de la compilation de solve_em : LINUX runs out of memory [huchard]
-	- IL FAUT COMPILER SUR auric
-	nougaro est lent a la compilation, utiliser surtout auric
-
-
-
-
-______________________________________________________
-
-
-PB MPI
-/donnees/aslmd/MODELES/MPI/mpich2-1.2.1p1_PGF7/lib/libmpich.a(simple_pmi.o):
-In function `PMI_Init':
-simple_pmi.c:(.text+0x15c0): warning: Using 'gethostbyname' in statically
-linked applications requires at runtime the shared libraries from the glibc
-version used for linking
-/donnees/aslmd/MODELES/MPI/mpich2-1.2.1p1_PGF7/lib/libmpich.a(simple_pmi.o):
-In function `PMI_Init':
-simple_pmi.c:(.text+0x15c0): warning: Using 'gethostbyname' in statically
-linked applications requires at runtime the shared libraries from the glibc
-version used for linking
-/donnees/aslmd/MODELES/MPI/mpich2-1.2.1p1_PGF7/lib/libmpich.a(simple_pmi.o):
-In function `PMI_Init':
-simple_pmi.c:(.text+0x15c0): warning: Using 'gethostbyname' in statically
-linked applications requires at runtime the shared libraries from the glibc
-version used for linking
-/donnees/aslmd/MODELES/MPI/mpich2-1.2.1p1_PGF7/lib/libmpich.a(simple_pmi.o):
-In function `PMI_Init':
-simple_pmi.c:(.text+0x15c0): warning: Using 'gethostbyname' in statically
-linked applications requires at runtime the shared libraries from the glibc
-version used for linking
-
-
-POSSIBLE mars.sed
-
-s+ *../frame/module_internal_header_util.o ../frame/pack_utils.o
--L../external/esmf_time_f90 -lesmf_time+& -L../mars_lmd/libo -llmd
--Mmpi=mpich2+g
-
Index: trunk/MESOSCALE_DEV/DOC/README
===================================================================
--- trunk/MESOSCALE_DEV/DOC/README	(revision 207)
+++ trunk/MESOSCALE_DEV/DOC/README	(revision 207)
@@ -0,0 +1,121 @@
+------------------------------
+ LMD Martian Mesoscale Model
+------------------------------
+       Technical note   
+------------------------------
+
+Authors: 
+A. Spiga and F. Forget
+Laboratoire de Meteorologie Dynamique
+Universite Pierre et Marie Curie
+BP 99
+4 place Jussieu
+75252 PARIS CEDEX 5
+FRANCE
+
+IMPORTANT NOTICE:
+Please refer to the authors in any publication using the model.
+
+Correspondance:
+spiga@lmd.jussieu.fr
+forget@lmd.jussieu.fr
+
+------------------------------
+
+Credits: 
+- NCEP/NCAR WRF development team http://www.wrf-model.org/index.php
+- EuroMars team (LMD ~ OU/Univ. Oxford - IAA)
+
+Support : 
+- European Space Agency (ESA)
+- Centre National d'Etudes Spatiales (CNES)
+
+------------------------------
+------------------------------
+
+------------------------------
+   Description of the model
+------------------------------
+
+Please refer to the report "Design and Performance of the LMD Martian Mesoscale Model"
+
+------------------------------
+   Installation of the model
+------------------------------
+
+1. copy the LMD Martian Mesoscale sources on a disk with 400 Mo of free space 
+> cp LMD_MM_MARS.tar.gz ***my_disk***
+
+2. unzip the archive file, download WRF sources and prepare directories and files for compilation
+**** REQUIREMENTS:
+**** - you must be connected to the internet
+> tar xzvf LMD_MM_MARS.tar.gz
+> cd LMD_MM_MARS
+> ./prepare
+
+3. compile the model
+**** REQUIREMENTS:
+**** - you must have either pgf90 or g95 installed in your computer
+**** - you must have compiled NETCDF libraries and define the environment variable $NETCDF
+> ./makemeso 
+
+------------------------------
+   Structure of the model
+------------------------------
+SIMU  		>> contains a test case and several useful scripts
+SRC  		>> contains sources of the model, the pre- and post-processing utilities
+WPS_GEOG  	>> contains static data (topography, albedo, thermal inertia)
+build_static    >> a script to build a minimal dataset for initialization of static data 
+copy_model      >> a script to link the model sources and avoid duplicates
+makemeso        >> the main compilation script
+prepare         >> a script to run right after you deflated the .tar.gz file
+
+SRC/ARWpost     		>> post-processing utilities (maps, etc ...)
+SRC/INIT_SIMPLE_TEST.tar.gz  	>> a simple idealized case study
+SRC/PREP_MARS  			>> pre-processing utilities : convert GCM outputs
+SRC/WPS  			>> the main pre-processing system : define domain and interpolate meteorological and static data
+SRC/WRFV2  			>> the folder containing WRF sources and LMD physics sources
+SRC/datesave   			>> a reminder of the version you use
+SRC/g95.tar.gz  		>> fix for some problems that may appear with g95
+SRC/mac.tar.gz  		>> scripts and fixes to run the model on MACs
+SRC/save_all  			>> a script to save the sources and create a .tar.gz archive 
+SRC/saved			>> a reminder of the files in the version you use
+
+------------------------------
+       Run a test case
+------------------------------
+
+1. edit the file ./SRC/WRFV2/meso_datafile.h to change the datafile path
+
+2. compile the model with g95 with specific number of grid points
+> ./makemeso < SIMU/TESTCASE/makemeso_x51_y51_z61_d1_t1_p1   (an example with g95)
+
+3. link the executable
+> cd SIMU/TESTCASE
+> ln -sf ../../g95_??_single/wrf_x51_y51_z61_d1_t1_p1.exe wrf.exe
+
+4. extract the pre-generated initial and boundary conditions
+> tar xzvf wrfinput.tar.gz
+
+5. run the simulation
+> nohup wrf.exe > log_wrf &
+
+6. check the model behavior during the run
+> vi log_wrf           (check model's messages during the run)
+> ./elapsed            (a script to evaluate elapsed simulation time)
+
+The model results are in the 'wrfout_d01_2024-07-01_06:00:00' NETCDF file
+
+NB: 
+- simulation settings can be changed in namelist.input
+- physics settings can be changed in callphys.def
+
+------------------------------
+  Installation of utilities
+------------------------------
+
+4. download and build static data (topography, albedo, thermal inertia)
+**** REQUIREMENTS:
+**** - you must be connected to the internet
+> ./build_static
+
Index: trunk/MESOSCALE_DEV/DOC/SRC/Makefile
===================================================================
--- trunk/MESOSCALE_DEV/DOC/SRC/Makefile	(revision 207)
+++ trunk/MESOSCALE_DEV/DOC/SRC/Makefile	(revision 207)
@@ -0,0 +1,40 @@
+PROJ = user_manual
+
+dvi: $(PROJ).tex *.tex
+	latex -interaction nonstopmode $(PROJ).tex
+
+all_format: dvi pdf ps
+
+clean:
+	-rm -f $(PROJ).log $(PROJ).aux $(PROJ).dvi $(PROJ).mtc* $(PROJ).bbl $(PROJ).blg
+
+run: $(PROJ).dvi
+	xdvi $(PROJ).dvi &
+
+#pdf: $(PROJ).dvi
+#	dvipdf $(PROJ).dvi
+
+check: $(PROJ).tex *.tex
+	make clean
+	pdflatex $(PROJ).tex
+	pdflatex $(PROJ).tex
+
+pdf: $(PROJ).tex *.tex
+	make clean
+	pdflatex $(PROJ).tex
+	bibtex $(PROJ)
+	pdflatex $(PROJ).tex
+	pdflatex $(PROJ).tex
+	#xpdf $(PROJ).pdf
+
+ps: $(PROJ).dvi
+	dvips -t letter $(PROJ).dvi
+
+#all: $(PROJ).tex
+#	cp /u/forget/TXT/BIBLIO/newfred.bib newfred.bib_backup
+#	pdflatex $(PROJ)
+#	bibtex $(PROJ)
+#	pdflatex $(PROJ)
+#	pdflatex $(PROJ)
+#	cp $(PROJ).pdf /u/aslmd/WWW/antichambre
+#	#acroread $(PROJ).pdf
Index: trunk/MESOSCALE_DEV/DOC/SRC/annales.sty
===================================================================
--- trunk/MESOSCALE_DEV/DOC/SRC/annales.sty	(revision 207)
+++ trunk/MESOSCALE_DEV/DOC/SRC/annales.sty	(revision 207)
@@ -0,0 +1,4448 @@
+%%%
+% Ami lecteur, bonjour !
+%
+% Ce fichier regroupe les commandes utilisées par les Éditions H&K pour
+% l'élaboration des Annales des Concours. Si vous êtes auteur dans cette
+% collection, vous trouverez de nombreuses explications dans la documentation
+% que vous avez téléchargée par ftp, ou sur www.h-k.fr/annales.
+%
+% Les auteurs des Annales des Concours sont explicitement autorisés à
+% réutiliser tout ou partie de ce fichier pour leurs travaux personnels 
+% à but non commercial (mémoire, rapport, thèse, etc.).
+% 
+% Si vous n'avez pas participé aux Annales des Concours, veuillez contacter
+% directement les Éditions H&K (contact@h-k.fr) si vous souhaitez utiliser
+% ce fichier.
+%
+% Les macros proposées ci-dessous ont nécessité des centaines d'heures de
+% travail. Elles ne sont pas dans le domaine public, hormis l'environnement
+% \breakbox.
+%
+%                                                         Seb.
+%
+%
+% Le mainteneur du fichier peut toujours être joint à l'adresse
+% annales.sty@H-K.fr
+%
+% 2001.11.03:	* Migration de certains \mathop vers \DeclareMathOperator.
+%               * Ajout des symboles chimiques à deux lettres (\Al, etc.).
+%               * Ajout de [t] et d'une option dans {rcl}.
+% 2001.11.27:	* Correction d'un bug dans \leftcentersright.
+% 2001.12.06:	* Ajout de \Me, \liq, \sol, \gaz et \Equilibre.
+% 2001.12.07: 	* Ajout de l'option [t] dans \leqsystsimple.
+%               * Ajout de \Image.
+% 2001.12.08:	* Changement de police pour \apriori et ses amis.
+% 2001.12.11:	* Ajout de \abs pour les valeurs absolues.
+% 2002.02.21:	* Ajout de \Dpc et \DPC (Teteph)
+% 2002.04.19:	* Ajout de \note
+% 2002.04.20:	* Passage de fancyheadings à fancyhdr (suggestion de JJ).
+% 2002.04.21:	* Création \(leftcenters|centers|ref)numero (JJ).
+% 2002.04.22:	* Ajout de \accolades et \paa (David Chapot, JJ).
+% 2002.05.12:	* Retrait d'un espace dans \cf.
+%               * Retrait des \left et \right dans \intn (Walter).
+% 2002.05.16:	* Correction de \RX et \CX (Jean).
+% 2002.05.17:	* Ajout du package {tabularx} (JJ).
+% 2002.05.24:	* Retrait de {tabularx}.
+% 2002.05.31:	* Correction de \ANcenters et \ANencadre (JJ).
+% 2002.06.14:	* Modification de \enonce pour faire des hachures.
+% 2002.06.19:	* Modification de \celsius (BBR).
+%               * Création de la commande \angstrom (BBR, Teteph).
+% 2002.06.24:	* Modification de \Star (Alex).
+% 2002.06.25:	* Création de \conc et \Kzero (Alex).
+% 2002.06.26:	* Création de \serie (Walter).
+% 2002.06.27:	* Création de \butyl et \Bu (Alex).
+% 2002.06.28:	* Modification de \ANcenters et \ANencadre (Alex).
+% 2002.06.30:	* Modification de \degres (BBR).
+% 2002.07.04:	* Modification de \celsius (Nico).
+% 2002.07.08:	* Modification de \etc (JJ).
+% 2002.07.08:	* Modification de \cf: droit, point (Émilia).
+% 2002.07.12:	* Ajout de \intnn (Mathieu).
+% 2002.07.16:	* Abandon de fancyhdr pour fancyheadings à cause des titres
+%                 courants dans les annexes (JJ).
+% 2002.08.14:	* Découpage du fichier en trois morceaux indépendants:
+%                 déclarations, mise en page et commandes scientifiques.
+%               * Réécriture de la plupart des commentaires contextuels.
+% 2003.02.12:	* Cas des arguments vides dans \intff et al (Walter).
+% 2003.03.05:	* Modification de la commande \partie (Paul).
+% 2003.03.10:	* Remplacement des \mathbb par des \mathBB (Paul).
+% 2003.03.18:   * Ajout de la commande \reperes (VF).
+% 2003.05.05:	* Passage à des titres courants centrés (Paul).
+% 2003.05.11:	* Ajout de \mathaccent"17E (JJ).
+% 2003.05.21:	* Ajout de \ir, \jr, \ex et \exi (Paul et VF).
+% 2003.05.26:	* Ajout de \OIInt (TTF, ST) et de \sulfate (Manu).
+% 2003.05.27:	* Ajout de \vectux, \vectuy, \vectuz, \vectex, \vectey,
+%                 \vectez, \vux, \vuy, \vuz, \vex, \vey et \vez.
+% 2003.06.01:	* Ajout de \suite et \liste (Paul).
+% 2003.06.06:	* Ajout de dsfont.sty pour \mathds{1}.
+% 2003.06.28:	* Création de \petito et \grando (JJ, Walter, Paul).
+% 2003.06.29:	* Ajout de \pmgras (Mike).
+% 2003.06.30:	* Création de \Sumt (Walter).
+% 2003.10.16:	* Ajout de \NoAutoSpaceBeforeFDP dans \codesource (Walter).
+% 2003.10.23:	* Ajout de \NoAutoSpaceBeforeFDP dans \web.
+% 2003.12.07:	* Ajout de \encadreminipage (Aurélien).
+% 2003.12.08:	* Ajout de \graphicspath
+% 2004.02.19:	* Ajout de \Produit (Paul, Céline).
+% 2004.02.21:	* Ajout de \scalar (Céline).
+% 2004.02.27:	* Amélioration de \intff et ses amis (Céline).
+% 2004.03.06:	* Redéfinition de \bs (Seb, Céline).
+% 2004.03.08:	* Amélioration de \leftcentersright et ses dérivés: l'argument
+%                 du milieu est maintenant centré dans la page, pas dans
+%                 l'environnement (Céline, Paul).
+% 2004.03.09:	* Bug-fix dans \Sum (portée de \ensuremath) (Céline).
+% 2004.03.15:   * Ajout de \ofg pour les guillemets français (Manu).
+% 2004.03.16:   * Passage de fancyheadings à fancyhdr.
+% 2004.03.18:   * Ajout des environnements {egalites}, {inegalites:leq}, 
+%                 {inegalites:geq}, {calculs}, {calculs:rcl}, 
+%                 {calculs:rcl:extracol} et {calculs:latotale}
+%                 (Céline, Paul, Seb, JB)
+% 2004.03.20:   * Modification de la commande \note; par défaut, elle
+%                 rajoute un numéro à l'endroit où on l'appelle et avec
+%                 l'option 0 ou simple elle reprend son ancien
+%                 comportement (JJ)
+%               * Amélioration de \Sum, \SUM et \Int (JJ)
+%               * Modification des commandes \partie, \Partie et
+%                 \Indications pour pouvoir obtenir les petites
+%                 capitales même avec aeguill (JJ)
+% 2004.03.22:   * Changement de l'option d'alignement par défaut dans
+%                 les environnements {systsimple} et dérivés
+%               * \finalementcenters donne désormais « Finalement, » au 
+%                 lieu de « Finalement: » .
+%               * Modification des tailles du papier et des marges (Seb).
+% 2004.03.25:	* Modification de la légende des sommaires croisés.
+% 2004.03.29:	* Ajout de \Rdeux, \Rtrois, \Cdeux et \Ctrois.
+% 2004.04.01:	* Ajout de \centersminipage (Seb).
+% 2004.04.03:   * Transfert des commandes pour les sommaires croisés
+%                 vers les fichiers concernés.
+% 2004.04.04:	* Retrait de {aeguill}.
+% 2004.04.08:   * Bug-fix dans un commentaire (Seb).
+% 2004.04.09:   * Suppression du commentaire sur l'installation TeX
+%                 d'Ulm (FX).
+% 2004.04.18:	* Ajout de \notemark et \notetext pour pouvoir utiliser
+%                 \note dans n'importe quel environnement.
+%               * Ajout de \arraybox pour remplacer \EncadreDansTableau.
+% 2004.04.20:   * Ajout de \typeout dans \EncadreDansTableau (Teteph).
+% 2004.04.23:	* Abandon de la police Times dans \partie.
+%               * Ajout de l'option dans \donccenters et ses amis.
+% 2004.04.30:	* Ajout de \DecimalMathComma (Paul).
+% 2004.05.04:	* Passage à \StandardMathComma par défaut (Teteph).
+% 2004.05.05:	* Correction d'un bug dans \leftcentersright.
+% 2004.05.08:	* Ajout de \aq (FX).
+% 2004.05.14:	* Ajout de \null dans les \qetq.
+%               * Modification de \leftcentersright: l'argument est
+%                 toujours centré dans la page, sauf dans les
+%                 {remarque} (Manu).
+%               * Ajout de \textegras, \textgras, \gras, \nongras,
+%                 modification de \mathBB, \mathscr, 
+%                 \partie et \Partie (Walter).
+% 2004.05.15:   * Ajout de \thallium et \Tl (Alex).
+%               * Ajout de \Pzero et \czero (FX).
+%               * Ajout de \base.
+% 2004.05.16:   * Ajout de \Rb et \rubidium (Tiphaine).
+% 2004.05.17:	* \mathscr renommé en \mathscrchoice (Seb).
+% 2004.05.18:	* Ajout de \Iint et \IInt. Modification des longueurs
+%                 dans \oiint et \OIInt (Marc, Paul).
+% 2004.05.19:	* Ajout de \deltar et \deltaf (Alex).
+% 2004.05.20:	* Ajout de \Avogadro et \avogadro (JJ).
+% 2004.05.21:	* Retrait de \Avogadro et \avogadro pour ne pas
+%                 privilégier de notation.
+% 2004.05.22:	* Ajout de \exmi (Aurélien).
+%               * Ajout de \Ce et \cerium (Alex).
+% 2004.05.26:	* Redéfinition de \venonce (Alex).
+% 2004.05.27:	* Ajout de \uvect (Aurélien).
+%               * Ajout de \encadrenumero et \leftencadrenumero (Aurélien).
+% 2004.05.28:	* Ajout de \vectu (Aurélien).
+% 2004.05.31:	* Ajout de \Zr et \zirconium (Nicolas).
+% 2004.06.09:	* Amélioration de \simple, \double, \triple (FX).
+% 2004.06.11:   * Amélioration de \pm et \pmgras (Vincent).
+% 2004.06.14:   * Retrait de \typeout dans \EncadreDansTableau.
+% 2004.06.17:   * Ajout de \indenter (Teteph).
+%               * Modification de \centers pour proteger l'argument central
+%                 (Teteph).
+% 2004.07.01:   * Ajout d'une option à \titre (Teteph).
+% 2004.07.02:   * Modification de \petito et \grando (David, Seb).
+% 2004.07.03:   * Ajout de \ajusterletitrecourant.
+% 2004.07.05:   * Remplacement de \LeTitre par \LeTitreCourant dans les
+%                 commandes \titresommaire, \JusteNumeroPage, \mkTitreCourant.
+% 2004.11.02:   * Amélioration de \pm et \pmgras (Emmanuel).
+%               * Changement du \renewcommand en \def dans la définition de
+%                 \degres car la commande \degres n'existe plus sur clipper
+%                 à l'ENS.
+% 2004.12.09:   * Ajout de \xspace dans les définitions des raccourcis
+%                 \droite, \plan, \cercle, etc (Seb).
+%               * Ajout d'une bascule (\CentersOnPage (défaut) et 
+%                 \CentersOnItems) pour que \centers centre soit par rapport à
+%                 la page soit par rapport à l'{itemize}. Cette bascule est
+%                 remise à sa valeur par défaut dans la commande \titre (Seb). 
+% 2004.12.17:   * Ajout de \arcdecercle (JJ).
+% 2005.01.02:   * Ajout de \email (Seb).
+% 2005.05.06:   * Ajout de \partieentieresup (Sam).
+% 2005.05.07:   * Ajout de \oeuf et \oeufs (Seb).
+% 2005.05.24:   * Ajout de \maitre (Seb).
+%               * Amélioration de \madame, \mademoiselle, \docteur, \maitre.
+% 2005.05.30:   * Ajout de \Iiint et \IIInt (Teteph).
+% 2005.06.05:   * Ajout de \matricedd.
+% 2005.06.07:   * Ajout des \xspace dans \R, \C et commandes similaires.
+% 2005.06.28:   * Amélioration de \pa (Vincent).
+% 2005.06.29:   * Amélioration de \pac et \paa (Teteph).
+% 2005.07.08:   * Ajout de \Sm, \samarium, \Eu, \europium (Alex).
+% 2005.07.12:   * Ajout de \tdemi, \ttiers, \tquart (Alex).
+%               * Mise à jour de la légende des sommaires croisés.
+% 2005.07.15:   * Modification des commandes à base de \mathBB: l'ajout de
+%                 \xspace faisait buguer la version étoilée (David).
+%				* Ajout du package longtable et modification du sommaire
+%                 (JJ).
+% 2006.03.28:   * Modification des marges due au changement de format (pas de 
+%                 changement de la taille du texte) (JJ).
+% 2006.05.12:   * Ajout de \dessinpgf pour les courbes créées avec les 
+%                 extensions LaTeX PGF et TikZ (Teteph).
+% 2006.05.14:   * Ajout de \indicatrice.
+%               * Changement de la définition de \ronde et \angstrom (Seb, 
+%                 JJ).
+% 2006.05.16:   * Ajout de \soeur, \soeurs, \Soeur, \Soeurs (Sattisvar).
+% 2006.05.23:   * Ajout de \vcol (Aurélien, Frédéric).
+%               * Amélioration de \moyenne (Teteph).
+% 2006.05.25:   * Ajout de \souspartie (Teteph, Seb).
+% 2006.05.31:   * Ajout de \transp (Aurélien, Seb).
+% 2006.06.02:   * Ajout de \fem et \AO (Aurélien, Seb).
+%               * Modification de \transp (qui devient synonyme de \trans).
+% 2006.06.06:   * Modification de \f@thousandsep, utilisée dans \nombre.
+%               * Ajout de \nb, raccourci pour \nombre.
+% 2006.06.12:   * Modification des tailles des marges (Alex).
+% 2006.06.14:   * Bug-fix de l'alignement de {QCM} (Aurélien).
+% 2006.06.18:   * Ajout du test sur les . et - dans \souspartie.
+% 2006.06.27:   * Ajout d'un argument optionnel à \norme (Teteph).
+% 2006.07.07:   * Modification de \partie et \Partie.
+% 2006.07.08:   * Annulation de la modification de \partie et \Partie 
+%                 (Teteph).
+% 2006.07.08:   * Amélioration de \dessinpgf (Teteph).
+% 2006.07.09:   * Ajout de \kdonne (Alex).
+% 2006.07.11:   * Modification des commandes pour les sommaires: ajout de 
+%                 \tdmtabular, \tdmoutils, \tdmtitresommaire et \tdmConcours.
+% 2006.07.11:   * Modification de la légende des sommaires croisés.
+%%%
+
+%\documentclass[twoside]{article}
+%\documentclass[twoside]{report}
+
+
+%!!!!!!!!!!!!!!!!!!!!!!!!!!                  !!!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!!   Les packages   !!!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!!                  !!!!!!!!!!!!!!!!!!!!!!!!!!
+
+%% Les packages à charger en standard.
+
+
+
+\usepackage[utf8]{inputenc}
+\usepackage[english,french]{babel}
+
+%\usepackage{times}
+
+%\usepackage[frenchb]{babel}	% Typo francaise.
+%\FrenchItemizeSpacingfalse	% Pour avoir des \bullet dans les {itemize}
+            				% et ne pas dérégler les espaces verticaux.
+\usepackage[OT1]{fontenc}	% Accents codés dans la fonte.
+%\usepackage[T1]{fontenc}	% Accents codés dans la fonte.
+%\usepackage[latin1]{inputenc}	% Accents 8 bits dans le fichier.
+\usepackage{vmargin}		% Régler la taille de la feuille.
+\usepackage{fancyhdr}		% Régler le titre courant et le bas de page.
+%\usepackage{fancyheadings}
+\usepackage{calc}	    	% Faire des calculs sur les longueurs.
+\usepackage{ifthen}		    % Faire des tests if/then/else.
+\usepackage{pifont}		    % La police \ding.
+\usepackage{supertabular}	% Les grands tableaux.
+\usepackage{longtable}
+\usepackage{multicol}		% Plusieurs colonnes.
+\usepackage{wrapfig}		% Dessins dans le texte.
+\usepackage{fancybox}		% Boîtes avec une ombre pour les parties.
+\usepackage{rotating}		% Pour tourner un texte.
+\usepackage{xspace}		    % Ajuster l'espace après des mots.
+
+
+
+%% Les packages pour les maths.
+
+\usepackage{amsmath}	% Les symboles les plus fréquents.
+\usepackage{amssymb}	% Des symboles.
+\usepackage{amsfonts}	% Des fontes, eg pour \mathbb.
+\usepackage{verbatim}	% Pour les codes sources en informatique.
+\usepackage{mathrsfs}	% Des lettres majuscules cursives (\mathscr).
+%\usepackage{dsfont}
+
+%% Les packages pour les dessins.
+
+\usepackage{array}
+\usepackage{curves}
+\usepackage{epic}
+\usepackage{eepic}
+\usepackage{epsfig}
+\usepackage{graphics}
+\graphicspath{{PS/}}
+
+
+
+
+
+%!!!!!!!!!!!!!!!!!!!!!!                          !!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!   Présentation globale   !!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!                          !!!!!!!!!!!!!!!!!!!!!!
+
+%% Une taille standard pour le texte.
+
+%        % Pour centrer le texte sur la page (utilisation courante).
+%\setpapersize{custom}{21.5cm}{26.5cm}
+%\setmarginsrb{43mm}{10mm}{43mm}{15mm}{10mm}{6mm}{0mm}{10mm}
+
+		% Pour envoyer à l'imprimeur.
+		% Nouveau format 17x25, sans changement de la taille du texte
+		% Rajout des 5mm à l'extérieur (13.5 -> 18.5mm),
+		% en haut (1 -> 3.5mm) et en bas (4 -> 6.5mm).
+		% Attention, lors de l'export en postscript, il faut alors passer
+		% l'option -T17cm,25cm à dvips.
+		% En TeTeX 3, il faut également l'option -tunknown pour dvips.
+%\setpapersize{custom}{17cm}{25cm}
+%\setmarginsrb{22.5mm}{3.5mm}{18.5mm}{6.5mm}{10mm}{6mm}{0mm}{10mm}
+
+        % Pour pouvoir utiliser un zoom=3 dans xdvi.
+        % Couplé à l'option -rv de xdvi, cela permet d'éviter les migraines
+        % après $n$ heures devant l'écran.
+%\setpapersize{custom}{12.9cm}{24.5cm}
+%\setmarginsrb{0mm}{1mm}{0mm}{4mm}{10mm}{6mm}{0mm}{10mm}
+
+%%		% Obsolète.
+%%      % Pour envoyer à l'imprimeur.
+%%      % Attention, lors de l'export en postscript, il faut alors passer
+%%      % l'option -T16.5cm,24.5cm à dvips.
+%%\setpapersizeobsolete{custom}{16.5cm}{24.5cm}
+%%\setmarginsrbobsolete{22.5mm}{1mm}{13.5mm}{4mm}{10mm}{6mm}{0mm}{10mm}
+		
+
+\newcommand{\latex}{\LaTeX}
+
+%% Pour que la virgule devienne un séparateur décimal.
+\providecommand\DecimalMathComma{\iflanguage{frenchb}%
+                                 {\mathcode`\,="013B}{}%
+   \addto\extrasfrenchb{\mathcode`\,="013B}}
+
+\providecommand\StandardMathComma{\mathcode`\,="613B%
+   \addto\extrasfrenchb{\mathcode`\,="613B}}
+
+\StandardMathComma
+
+%% Un hack pour que l'espace avant les doubles ponctuations soit un demi-espace.
+
+\makeatletter
+\declare@shorthand{frenchb}{:}{%
+    \ifhmode
+      \ifdim\lastskip>\z@
+        \unskip\penalty\@M\thinspace
+      \else
+        \FDP@thinspace
+      \fi
+    \fi
+    \string:}
+\makeatother
+
+
+
+%!!!!!!!!!!!!!!!!!!!!!!                          !!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!   Présentation globale   !!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!                          !!!!!!!!!!!!!!!!!!!!!!
+
+%% Les notes dans la marge.
+
+\newcounter{ifnote}
+\setcounter{ifnote}{1}		% Accepter les notes dans la marge
+%\setcounter{ifnote}{0}		% Refuser  les notes dans la marge
+
+%% Les traits horizontaux pour l'alignement horizontal des énoncés.
+
+\newcounter{IfAlignementEnonces}
+%\setcounter{IfAlignementEnonces}{1}	% Mettre les hachures
+\setcounter{IfAlignementEnonces}{0}	% Ne pas mettre les hachures
+
+%% Les équations numérotées.
+
+\newcounter{Corrige}
+%\newcounter{Chapter}
+\newcounter{Equation}[Corrige]
+%\newcounter{Equation}[Chapter]
+
+
+%%%%%%%%%
+%% AYM %%
+%%%%%%%%%
+
+%%%%% debut macro %%%%
+\makeatletter
+\@addtoreset{Equation}{chapter}
+\renewcommand\theEquation{\thechapter.\arabic{Equation}}
+\makeatother
+%%%%%% fin macro %%%%
+
+
+
+%!!!!!!!!!!!!!!!!!!!!                               !!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!   Mise en page d'un corrigé   !!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!                               !!!!!!!!!!!!!!!!!!!!
+
+%% Le titre courant.
+
+\pagestyle{fancy}
+%\lhead[\thepage]{\footnotesize\LeTitre}
+%\chead[]{}
+%\rhead[\footnotesize\LeTitre]{\thepage}
+\lhead[\thepage]{}
+\chead[\footnotesize\LeTitreCourant]{\footnotesize\LeTitreCourant}
+\rhead[]{\thepage}
+\lfoot[]{}
+\cfoot[]{}
+\rfoot[]{}
+
+%% Le titre du corrigé.
+
+% La variable dans laquelle est stockée le titre
+\newcommand{\LeTitre}{} % Redéfini dans \titre
+\newcommand{\LeTitreCourant}{CHANGER LE TITRE !!!}
+
+% Afficher le titre.
+\newcommand{\Titre}{
+	\begin{center}
+	{\bfseries\Large \LeTitre}
+	\end{center}
+	\vskip 1 cm
+	}
+
+% Synthèse : on n'appelle qu'une seule commande.
+%\newcommand{\titre}[1]{
+%	\renewcommand{\LeTitre}{#1}
+%	\Titre
+%	\stepcounter{Corrige}	% pour \centersnumero
+%        \renewcommand{\labelitemi}{\ensuremath{\bullet}}
+%	}
+
+\newcommand{\titre}[2][]{%
+    \ifthenelse{\equal{#1}{}}{%
+        \renewcommand{\LeTitreCourant}{#2}%
+    }{%
+        \renewcommand{\LeTitreCourant}{#1}%
+    }%
+    \renewcommand{\LeTitre}{#2}%
+    \Titre%
+	\CentersOnPage
+    \stepcounter{Corrige}%   % pour \centersnumero
+        \renewcommand{\labelitemi}{\ensuremath{\bullet}}%
+    }
+
+\newcommand{\ajusterletitrecourant}[1]{%
+	\renewcommand{\LeTitreCourant}{#1}%
+}
+
+%% Quelques commandes de mise en forme.
+
+% Des parties qui se voient bien.
+% Exemple: 
+%	\partie{
+%		Première partie\\[4mm]
+%		Les pincettes optiques
+%	}
+\newcommand{\partie}[1]{%
+	\vspace*{\smallskipamount}%
+	\begin{center}\large\textegras{\scshape #1}\end{center}%
+}
+%\newcommand{\partie}[1]{%
+%	\null\vspace*{\smallskipamount}%
+%	\nopagebreak[4]%
+%	\begin{center}\large\textegras{\scshape #1}\end{center}%
+%}
+
+% Lorsque le titre comporte un numéro (II. \quad Mon titre), on ne peut pas
+% facilement combiner « \partie » et « \\ » à cause de l'alignement vertical.
+% En pareil cas, on peut utiliser \Partie, qui prend deux arguments:
+%	* le numéro de la partie
+%	* le texte
+% Exemple:
+%	\Partie{I}{Mon titre}
+% Bonus: si le titre est long, il sera automatiquement coupé pour passer à
+% la ligne. On peut bien sûr toujours forcer le passage à la ligne à un
+% endroit précis en utilisant « \\ ».
+% Enfin, on peut passer un argument optionnel spécifiant la largeur souhaitée
+% pour le texte: \Partie[6cm]{I}{Mon titre}. Veillez à ne pas utiliser des
+% longueurs trop grandes.
+\newlength{\PartieWidth}
+\newcommand{\Partie}[3][8cm]{%
+    \settowidth{\PartieWidth}{{\large\textegras{\scshape #3}}}%
+    \ifthenelse{\lengthtest{\PartieWidth > #1}}{%
+        \setlength{\PartieWidth}{#1}%
+    }{}%
+    \vspace*{\smallskipamount}%
+    \begin{center}%
+    {\large\textgras{#2.}}{\normalsize\quad}%
+    \begin{minipage}[t]{\PartieWidth}%
+    {\large\textgras{\scshape #3}}%
+    \end{minipage}%
+    \end{center}%
+}
+%\newcommand{\Partie}[3][8cm]{%
+%    \settowidth{\PartieWidth}{{\large\textegras{\scshape #3}}}%
+%    \ifthenelse{\lengthtest{\PartieWidth > #1}}{%
+%        \setlength{\PartieWidth}{#1}%
+%    }{}%
+%    \null\vspace*{\smallskipamount}%
+%	\nopagebreak[4]%
+%    \begin{center}%
+%    {\large\textgras{#2.}}{\normalsize\quad}%
+%    \begin{minipage}[t]{\PartieWidth}%
+%    {\large\textgras{\scshape #3}}%
+%    \end{minipage}%
+%    \end{center}%
+%}
+
+% Des sous-parties standardisées.
+% Si le premier argument contient un point ou un tiret, il est écrit tel quel,
+% sinon il est suivi d'un point.
+% Exemples:
+% \souspartie{1}{Étude d'une fonction}
+%   1. Étude d'une fonction
+% \souspartie{1.2}{Étude d'une fonction}
+%   1.2 Étude d'une fonction
+% \souspartie{1-2}{Étude d'une fonction}
+%   1-2 Étude d'une fonction
+
+\newif\iftiret
+\newif\ifpoint
+
+\def\testtiret{%
+    \futurelet\next\testtiretsuivant%
+}
+\def\testtiretbis#1{%
+    \testtiret%
+}
+\def\testtiretsuivant{%
+    \ifx\next\endoftesttiret\def\endoftesttiret{}%
+    \else\if\next-\tirettrue%
+         \fi%
+         \expandafter\testtiretbis%
+    \fi%
+}
+
+\def\testpoint{%
+    \futurelet\next\testpointsuivant%
+}
+\def\testpointbis#1{%
+    \testpoint%
+}
+\def\testpointsuivant{%
+    \ifx\next\endoftestpoint\def\endoftestpoint{}%
+    \else\if\next.\pointtrue%
+         \fi%
+         \expandafter\testpointbis%
+    \fi%
+}
+
+
+\def\souspartie#1#2{%
+    \vskip\bigskipamount%
+    \ifthenelse{\equal{#1}{}}{%
+        \centers{\textbf{{#1}\quad {#2}}}%
+    }{%
+        \tiretfalse\pointfalse%
+        \testtiret#1\endoftesttiret%
+        \testpoint#1\endoftestpoint%
+        \iftiret \centers{\textbf{{#1}\quad {#2}}}%
+        \else \ifpoint \centers{\textbf{{#1}\quad {#2}}}%
+              \else \centers{\textbf{{#1}.\quad {#2}}}%
+              \fi%
+        \fi%
+        \tiretfalse%
+        \pointfalse%
+    }%
+    \vskip\bigskipamount%
+}
+
+%\newcommand{\souspartie}[2]{%
+%        \vskip\bigskipamount%
+%        \centers{\textbf{{#1}.\quad {#2}}}
+%%        \centers{\textbf{{#1}\quad {#2}}}
+%        \vskip\medskipamount%
+%}
+
+% Pour le cas particulier des indications, il est souhaitable de limiter
+% l'espace avant et après \partie. La commande \Indications est là pour ça.
+\newcommand{\Indications}{% 
+	\vspace{-2mm}% 
+	\centers[0]{{\large\textbf{\scshape Indications}}}% 
+	\medskip 
+}      
+
+% Numéroter les questions.
+\newcommand{\question}[1]{\noindent\fbox{\bfseries#1}}
+
+% Les QCM de l'ENAC.
+%
+% À l'ENAC, le candidat doit répondre à un QCM; pour chaque question, il doit
+% noircir, sur sa feuille de réponse, les rectangles qui correspondent aux
+% affirmations exactes. Les commandes ci-dessous permettent de simuler la
+% feuille de réponse au sein du corrigé.
+%
+% Exemple (les réponses 1 et 4 sont exactes):
+%	\begin{QCM}
+%	\vrai{1}
+%	\vrai{4}
+%	\end{QCM}
+
+\newenvironment{QCM}
+        {
+        \begin{center}
+        \setlength{\unitlength}{1pt}
+%        \begin{picture}(190,15)(0,-15)
+        \begin{picture}(180,15)(0,-15)
+        \allinethickness{0.5pt}
+        \multiput(0,0)(40,0){5}{\line(1,0){20}}
+        \multiput(0,-5)(40,0){5}{\line(1,0){20}}
+        \multiput(0,0)(20,0){10}{\line(0,-1){5}}
+        \put(10,-15){\makebox[0pt]{A}}
+        \put(50,-15){\makebox[0pt]{B}}
+        \put(90,-15){\makebox[0pt]{C}}
+        \put(130,-15){\makebox[0pt]{D}}
+        \put(170,-15){\makebox[0pt]{E}}
+        }
+        {
+        \end{picture} 
+        \end{center}
+        }
+\newcounter{lareponse}
+\newcommand{\vrai}[1]{
+        \setcounter{lareponse}{#1}
+        \addtocounter{lareponse}{-1}  
+        \setcounter{lareponse}{\value{lareponse}*40}
+        \put(\thelareponse,0){\rule[-5pt]{20pt}{5pt}}
+        }
+
+%!!!!!!!!!!!!                                              !!!!!!!!!!!!
+%!!!!!!!!!!!!   Les pages de présentation et les annexes   !!!!!!!!!!!!
+%!!!!!!!!!!!!                                              !!!!!!!!!!!!
+
+% Insérer une page d'énoncé scannée.
+\newcommand{\enonce}[2][0]{%
+        \noindent%
+        \epsfig{file=#2,angle=#1,width=\linewidth,clip=}%
+        \ifthenelse{\value{IfAlignementEnonces} = 1}{%   
+                \begin{picture}(0,0)%
+                \multiput(-400,600)(0,-9){70}{\line(1,0){500}}%
+                \end{picture}%
+        }%
+        {}%
+}
+%\newcommand{\venonce}[2][20.3]{\noindent\centers{\epsfig{file=#2,%
+%	height=#1cm,clip=}}}
+
+% Lorsque les pages d'énoncé ont un rapport hauteur/largeur supérieur à
+% celui d'une page d'Annales, l'utilisation de \enonce entraîne un
+% overfull vbox. Pour éviter cela on utilise \venonce qui fixe la hauteur
+% de la figure incluse et non la largeur. C'est moche mais on n'a pas le
+% choix.
+
+\newcommand{\venonce}[2][21.25]{%
+    \ifthenelse{\value{IfAlignementEnonces} = 1}{%
+        \noindent\centers{\epsfig{file=#2, height=20.8  cm, clip=}}%
+        \begin{picture}(0,0)%
+        \multiput(-50,600)(0,-9){70}{\line(1,0){500}}%
+        \end{picture}%
+    }{%
+        \noindent\centers{\epsfig{file=#2, height=#1cm, clip=}}%
+    }%
+}
+
+
+%% Pour le sommaire.
+\newlength{\Sujet}
+\newlength{\Resume}
+\newlength{\Enonces}
+\newlength{\Corriges}
+\setlength{\Enonces}{7mm} 
+\setlength{\Corriges}{7mm}
+
+\newcommand{\tdmtitresommaire}[1]{
+%	\renewcommand{\LeTitre}{#1}
+	\renewcommand{\LeTitreCourant}{#1}
+	\stepcounter{Corrige}	% pour \centersnumero
+        \renewcommand{\labelitemi}{\ensuremath{\bullet}}
+	\begin{tdmtabular}
+		\mbox{}&\mbox{}\hfill{\bfseries\Large 
+			Sommaire}\hfill\mbox{}&\mbox{}&\mbox{}\\ \\
+	\end{tdmtabular}
+	}
+
+\newenvironment{tdmtabular}{%
+    \begin{tabular}{
+            p{\Sujet}     % Le sujet
+            p{\Resume}       % Les infos
+            p{\Enonces}      % Les pages des énoncés
+            p{\Corriges}}     % Les pages des corrigés
+    }{%
+    \end{tabular}%
+}
+
+% L'espace entre chaque épreuve d'un concours se règle via la commande
+% \tdmspace. Elle vaut 0pt par défaut (et peut devenir négative).
+\newlength{\tdmspace}
+\setlength{\tdmspace}{0pt}
+
+% L'espace entre le résumé et les outils se règle via la longueur suivante,
+% valant \sk par défaut:
+\newlength{\tdmintraspace}
+\setlength{\tdmintraspace}{3pt plus 1pt minus 1pt}
+
+% L'espace avant le titre des concours se règle via
+% \tdmEspaceAvantTitreConcours et vaut 1mm par défaut.
+\newlength{\tdmEspaceAvantTitreConcours}
+\setlength{\tdmEspaceAvantTitreConcours}{1mm}
+
+% De même pour l'espace après les titres des concours, avec 2mm comme valeur
+% par défaut.
+\newlength{\tdmEspaceApresTitreConcours}
+\setlength{\tdmEspaceApresTitreConcours}{2mm}
+
+\newcommand{\tdmoutils}[1]{\par\vskip\tdmintraspace{{\small\slshape#1}}}
+
+\newcommand{\tdmConcours}[1]{%
+    &\mbox{}\hfill{\bfseries\textsc{#1}}\hfill\mbox{}%
+    &&\\[\tdmEspaceApresTitreConcours]%
+}
+
+\newcommand{\tdmPolytechnique}{\tdmConcours{Polytechnique}}
+\newcommand{\tdmXENS}{\tdmConcours{X\ensuremath{\mathgras{/}}ENS}}
+\newcommand{\tdmPetitesMines}{\tdmConcours{Mines}}
+\newcommand{\tdmMines}{\tdmConcours{Mines-Ponts}}
+\newcommand{\tdmENAC}{\tdmConcours{E.N.A.C.}}
+\newcommand{\tdmCentrale}{\tdmConcours{Centrale-Supélec}}
+\newcommand{\tdmCCP}{
+	&\mbox{}\hfill{\bfseries\textsc{Concours Communs}}\hfill\mbox{}&&
+		\\[0.5mm]
+	&\mbox{}\hfill{\bfseries\textsc{Polytechniques}}\hfill\mbox{}%
+		&&\\[\tdmEspaceApresTitreConcours]
+}
+
+\newcommand{\PagesEnoncesCorriges}{
+        && \mbox{}\hfill \begin{sideways}Énoncé\end{sideways}
+        &  \mbox{}\hfill \begin{sideways}Corrigé\end{sideways}
+	\\
+	}
+
+%\newcommand{\Annexes}{\Concours{Annexes}}
+\newcommand{\Annexes}{\Concours{Formulaires}}
+
+% Les commandes obsolètes.
+\newcommand{\outils}[1]{\sk\newline{\small\slshape#1}}
+
+\newenvironment{sommaire}
+%	{\begin{supertabular}{
+	{\begin{longtable}{
+			p{\Sujet}     % Le sujet
+			p{\Resume}       % Les infos
+			p{\Enonces}      % Les pages des énoncés
+			p{\Corriges}     % Les pages des corrigés
+	        }
+	}
+%	{\end{supertabular}}
+	{\end{longtable}}
+
+\newcommand{\titresommaire}[1]{
+%	\renewcommand{\LeTitre}{#1}
+	\renewcommand{\LeTitreCourant}{#1}
+	\stepcounter{Corrige}	% pour \centersnumero
+        \renewcommand{\labelitemi}{\ensuremath{\bullet}}
+	\begin{sommaire}
+		\mbox{}&\mbox{}\hfill{\bfseries\Large 
+			Sommaire}\hfill\mbox{}&\mbox{}&\mbox{}\\ \\
+	\end{sommaire}
+	}
+
+%\newlength{\ConcoursSkip}
+%\newcommand{\Concours}[1]
+%	{&\mbox{}\hskip\ConcoursSkip{\bfseries\textsc{#1}}&&\\ \\}
+\newcommand{\Concours}[1]
+	{&\mbox{}\hfill{\bfseries\textsc{#1}}\hfill\mbox{}&&\\ \\}
+
+\newcommand{\Polytechnique}{\Concours{Polytechnique}}
+\newcommand{\XENS}{\Concours{X\ensuremath{\mathgras{/}}ENS}}
+\newcommand{\PetitesMines}{\Concours{Mines}}
+\newcommand{\Mines}{\Concours{Mines-Ponts}}
+\newcommand{\ENAC}{\Concours{E.N.A.C.}}
+\newcommand{\Centrale}{\Concours{Centrale-Supélec}}
+%\newcommand{\CCP}{\Concours{
+%	\mbox{}\hskip-3mm
+%	\begin{minipage}[t]{4cm}
+%	Concours Communs\newline Polytechniques
+%	\end{minipage}
+%	}}
+\newcommand{\CCP}{
+	&\mbox{}\hfill{\bfseries\textsc{Concours Communs}}\hfill\mbox{}&&
+		\\[0.5mm]
+	&\mbox{}\hfill{\bfseries\textsc{Polytechniques}}\hfill\mbox{}&&\\ \\
+}
+
+%% Pour le sommaire croisé.
+\newlength{\TitreCouche}
+
+% Pour 2004
+\newcommand{\LegendeSommaire}{\begin{turn}{270}%
+        \raisebox{2.6cm}{%
+                \begin{tabular}{@{}c@{\,}l@{\quad}l@{}}
+                \raisebox{0pt}{\scriptsize\ding{172}}
+                                &:& 1 fois depuis 1999          \\[-2mm]
+                \raisebox{-1pt}{\ding{173}}
+                                &:& 2 fois depuis 1999          \\[-2mm]
+                \vdots          &&                              \\[-2mm]
+                \raisebox{-4pt}{\LARGE\ding{176}}
+                                &:& 5 fois depuis 1999          \\
+                \raisebox{0pt}{\scriptsize\ding{182}}
+                               &:& 1 fois depuis 1999 dont 2004
+							        \\[-2mm]
+                \raisebox{-1pt}{\ding{183}}
+                                &:& 2 fois depuis 1999 dont 2004          
+                                                                \\[-2mm]
+                \vdots          &&                              \\[-2mm]
+                \raisebox{-5.5pt}{\huge\ding{187}}
+                                &:& 6 fois depuis 1999 dont 2004
+                \end{tabular}%
+        }
+        \end{turn}%
+        }
+
+% Pour 2005
+\newcommand{\LegendeSommaireCinq}{\begin{turn}{270}%
+        \raisebox{2.6cm}{%
+                \begin{tabular}{@{}c@{\,}l@{\quad}l@{}}
+                \raisebox{0pt}{\scriptsize\ding{172}, \scriptsize\ding{173}}
+                                &:& 1 ou 2 fois depuis 1999          \\[-2mm]
+                \raisebox{-1pt}{\ding{174}}
+                                &:& 3 fois depuis 1999          \\[-2mm]
+                \vdots          &&                              \\[-2mm]
+                \raisebox{-4pt}{\LARGE\ding{177}}
+                                &:& 6 fois depuis 1999          \\
+                \raisebox{0pt}{\scriptsize\ding{182}, \scriptsize\ding{183}}
+                               &:& 1 ou 2 fois depuis 1999 dont 2005
+                                    \\[-2mm]
+                \raisebox{-1pt}{\ding{184}}
+                                &:& 3 fois depuis 1999 dont 2005
+                                                                \\[-2mm]
+                \vdots          &&                              \\[-2mm]
+                \raisebox{-5.5pt}{\huge\ding{188}}
+                                &:& 7 fois depuis 1999 dont 2005
+                \end{tabular}%
+        }
+        \end{turn}%
+		}
+
+% Pour 2006
+% On cesse d'utiliser les commandes \scriptsize, ..., \huge, et on utilise une 
+% échelle linéaire.
+% Le plus petit rond mesure 1mm, le plus grand 3mm: on place les autres 
+% à intervalles réguliers entre les deux.
+
+% La valeur de 1/(annee-1999+1) pour déterminer les intervalles.
+\newlength{\tailleminsommairecroise}
+\newlength{\taillemaxsommairecroise}
+\newlength{\intervallesommairecroise}
+\newlength{\hauteursommairecroise}
+\newlength{\grandehauteursommairecroise}
+\newlength{\longueursommairecroise}
+
+\setlength{\tailleminsommairecroise}{1mm}
+\setlength{\taillemaxsommairecroise}{2mm}
+
+\newcommand{\LegendeSommaireCroise}[1]{%
+	\ifthenelse{\equal{#1}{2006}}{%
+		\begin{turn}{270}%
+        \raisebox{2.6cm}{%
+        	\begin{tabular}{@{}c@{\,}l@{\quad}l@{}}
+            \raisebox{0pt}{\resizebox{%
+			\tailleminsommairecroise+\intervallesommairecroise}{!}{%
+			\ding{172}}}
+                                &:& 1 fois depuis 1999          \\[-2mm]
+            \raisebox{-1pt}{\resizebox{%
+			\tailleminsommairecroise+2\intervallesommairecroise}{!}{%
+			\ding{173}}}%
+                                &:& 2 fois depuis 1999          \\[-2mm]
+                \vdots          &&                              \\[-2mm]
+                \raisebox{-4pt}{\resizebox{%
+				\tailleminsommairecroise+7\intervallesommairecroise}{!}{%
+				\ding{178}}}%
+                                &:& 7 fois depuis 1999          \\
+                \raisebox{0pt}{\resizebox{%
+				\tailleminsommairecroise+\intervallesommairecroise}{!}{%
+				\ding{182}}}
+                               &:& 1 fois depuis 1999 dont 2006
+                                    \\[-2mm]
+                \raisebox{-1pt}{\resizebox{%
+				\tailleminsommairecroise+2\intervallesommairecroise}{!}{%
+				\ding{183}}}
+                                &:& 2 fois depuis 1999 dont 2006
+                                                                \\[-2mm]
+                \vdots          &&                              \\[-2mm]
+                \raisebox{-5.5pt}{\resizebox{%
+				\tailleminsommairecroise+8\intervallesommairecroise}{!}{%
+				\ding{189}}}
+                                &:& 8 fois depuis 1999 dont 2006
+                \end{tabular}%
+        }
+        \end{turn}%
+	}{%
+	% else: l'an prochain
+	}
+}
+
+\newcommand{\presentation}[1]{ 
+        \mbox{}
+        \thispagestyle{empty}
+        \vfill
+        \centers{{\bfseries\Huge #1}}
+        \mbox{}
+        \vskip2cm
+        \mbox{}
+        \vfill
+        \mbox{}
+        \newpage
+}
+\newcommand{\formulaires}{\presentation{Formulaires}}
+
+\newcommand{\presentationCCP}[1]{
+        \mbox{}
+        \thispagestyle{empty}
+        \vfill
+        \centers{{\bfseries\Huge Concours Communs}}
+        \centers{{\bfseries\Huge Polytechniques}}
+        \mbox{}
+        \vskip2cm
+        \mbox{}
+        \vfill
+        \mbox{}
+        \newpage
+}
+
+% L'ISBN.
+\newcommand{\ISBN}{XXXXXXXXXXXX}
+
+% Aligner dans les annexes de maths.
+\newlength{\alignelength}
+\newcommand{\aligne}[3]{%
+        \settowidth{\alignelength}{#2}%
+        #2%
+        \hskip-\alignelength%  
+        \hskip #1 cm%
+        #3%
+        }
+
+% N'indiquer que le numéro de page dans le titre courant (annexes).
+\newcommand{\JusteNumeroPage}{
+%	\renewcommand{\LeTitre}{}
+	\renewcommand{\LeTitreCourant}{}
+	\renewcommand{\headrulewidth}{0pt}
+%	\setlength{\headrulewidth}{0pt}
+	}
+
+% Utiliser à nouveau un titre courant complet (annexes).
+\newcommand{\mkTitreCourant}[1]{
+%	\renewcommand{\LeTitre}{#1}
+	\renewcommand{\LeTitreCourant}{#1}
+	\renewcommand{\headrulewidth}{0.5pt}
+%	\setlength{\headrulewidth}{0.5pt}
+	}
+
+% « Insérer une page blanche. » Plus utile depuis 1999...
+\newcommand{\pageblanche}[1][\thepage]{\thispagestyle{empty}  
+        \mbox{} \vskip 2 cm%
+        \Centers{{\bfseries\huge Ne pas imprimer}}\par%
+        \Centers{{\bfseries\huge Insérer une page blanche}}%
+        \vskip 3 cm%
+        \Centers{{\bfseries\huge Page #1}}%
+        \clearpage
+        }
+
+
+%!!!!!!!!!!!!!!!!!!!!!                             !!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!   Des commandes pratiques   !!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!                             !!!!!!!!!!!!!!!!!!!!!
+
+%% On ne veut pas que les lettres majuscules soient inclinées dans les
+%% formules mathématiques.
+
+\mathcode`A="7041 \mathcode`B="7042 \mathcode`C="7043 \mathcode`D="7044
+\mathcode`E="7045 \mathcode`F="7046 \mathcode`G="7047 \mathcode`H="7048
+\mathcode`I="7049 \mathcode`J="704A \mathcode`K="704B \mathcode`L="704C
+\mathcode`M="704D \mathcode`N="704E \mathcode`O="704F \mathcode`P="7050
+\mathcode`Q="7051 \mathcode`R="7052 \mathcode`S="7053 \mathcode`T="7054
+\mathcode`U="7055 \mathcode`V="7056 \mathcode`W="7057 \mathcode`X="7058
+\mathcode`Y="7059 \mathcode`Z="705A
+
+
+%% Rendre les guillemets ('«' et '»') actifs.
+%%
+%% Attention, cela implique de ne pas mettre d'espace après '«'
+%% ni avant '»' dans le code source.
+%%
+%% Exemple de composition correcte: «comme ceci».
+
+%\catcode`\«=\active
+%\catcode`\»=\active
+%\def«{\og\ignorespaces}
+%\def»{{\fg}}
+
+\newcommand{\ofg}[1]{\og{}#1\fg{}}
+
+% L'environnement {remarque}.
+
+% Le test \ifremarque est utile pour \leftcentersright.
+\newif\ifremarque
+
+\newenvironment{remarque}
+        {\remarquetrue\bigskip\noindent\begin{filet}}   % Voir plus bas.
+        {\end{filet}\bigskip\remarquefalse}
+
+% L'environnement {indications}. Le nom « custom-itemize » est plus 
+% « générique »...
+\newenvironment{custom-itemize}[1]%
+	{%
+	\begin{list}{}%
+		{%
+		\settowidth{\labelwidth}{#1}%
+		\setlength{\leftmargin}{\labelwidth+\labelsep}%
+		}%
+        }%
+        {\end{list}}
+\newenvironment{indications}[1]{\begin{custom-itemize}{#1}}%
+	{\end{custom-itemize}}
+
+% Insérer une ligne de séparation horizontale.
+\newcommand{\separation}{\begin{center}\rule{3 cm}{1 pt}\end{center}}
+\newcommand{\Separation}{\separation}
+
+% Indenter les paragraphes dans une minipage.
+
+\newlength{\longueurindentation}
+\setlength{\longueurindentation}{\parindent}
+
+\newcommand{\indenter}{\hskip\longueurindentation}
+
+
+
+% La communication entre auteurs et relecteurs est un facteur très
+% important dans la qualité finale des Annales. Les commandes suivantes
+% servent à la faciliter.
+%
+% Lorsque l'auteur souhaite poser une question à ses relecteurs
+% scientifiques, ou leur expliquer pourquoi il n'est pas d'accord avec
+% telle ou telle proposition, ou encore pour dialoguer avec le relecteur
+% typographique, le moyen « immédiat » est d'écrire, dans un courrier
+% électronique, quelque chose comme « page 7, question I.4.b, paragraphe
+% 2, ligne 7, je pense que ··· ». Ce n'est pas très ergonomique !
+%
+% La commande \note permet d'ajouter un commentaire directement dans le
+% corrigé ou, plutôt, dans la marge du corrigé. De la sorte, la question
+% ou le commentaire est vu par le relecteur (scientifique ou typo)
+% directement dans le contexte: finis les allers et retours entre le
+% corrigé et le mail. C'est bien plus pratique pour tout le monde.
+%
+% L'équipe des Annales a défini deux manières de présenter les notes.
+% La commande \notesimple met le commentaire dans la marge; \notenumero
+% indique en outre un numéro bien visible. Si vous écrivez toutes vos
+% remarques avec \note, vous obtenez par défaut l'effet de \notenumero,
+% mais vous pouvez obtenir le même rendu que par \notesimple avec
+% l'option 0 ou simple.
+%
+% Exemple:
+% [···] ce qui se résout\notenumero{résoud ou résout?} en [···]
+%
+% Un inconvénient de ces différentes commandes est qu'elles ne peuvent
+% pas s'écrire dans certains environnements. Pour pallier ce
+% problème, vous disposez des commandes \notemark et \notetext. Elles
+% s'utilisent sur le même modèle que \footnotemark et \footnotetext.
+% Pour repérer un endroit dans un environnement, il suffit d'utiliser 
+% \notemark qui place le numéro dans le texte (de la même manière que
+% \notenumero). Pour ensuite écrire la note correspondante, il faut
+% utiliser la commande \notetext en dehors de l'environnement, soit
+% avant soit après; elle comportera le même numéro. 
+%
+% Vous pouvez utiliser plusieurs \notemark dans le même environnement.
+% La numérotation sera respectée à condition d'écrire les \notetext
+% dans le même ordre (mais certains peuvent être avant l'environnement 
+% et les suivants après, cela n'a pas d'importance).
+%
+% Vous pouvez utiliser dans votre corrigé à la fois des \note et
+% \notetext; la numérotation sera correcte sous réserve que vous
+% preniez garde à ce qu'il y ait autant de \notemark que de \notetext
+% entre deux occurences de \note.
+%
+% Exemple : 
+% [...]\notetext{résoud ou résout ?}
+% \begin{remarque}
+% [···] ce qui se résout\notemark en [···] 
+% \end{remarque}
+%
+% Dans quelques rares cas (\partie, \Partie, \arraybox, \vect, \rest
+% principalement), lors d'une utilisation de \notemark, le compteur
+% sera incrémenté d'une unité de trop. Ceci est dû aux \settowidth ou
+% \settoheight de ces commandes. Il faut donc éviter d'utiliser
+% \notemark dans ces circonstances.
+%
+% Important : pour toutes ces commandes, il ne faut pas laisser d'espace
+% avant le '\' sinon l'espace final sera trop grand.
+
+
+\reversemarginpar
+\marginparwidth 3.1cm
+
+
+\newcounter{Note}[page]
+\setcounter{Note}{0}
+
+\newcounter{notesimple}
+\setcounter{notesimple}{0}
+
+% Pour les environnements hostiles
+\newcounter{notemark}
+\setcounter{notemark}{0}
+\newcounter{notemarkref}
+\setcounter{notemarkref}{0}
+\newcounter{notetext}
+\setcounter{notetext}{0}
+\newcounter{notetextref}
+\setcounter{notetextref}{0}
+
+% Les compteurs \*ref servent à se rappeler où on en est, par exemple
+% dans le cas où plusieurs \notemark se suivent avant l'apparition du
+% premier \notetext; il faut en effet que le numéro de celui-ci
+% corresponde au numéro du premier \notemark.
+
+\newcommand{\notemark}{%
+	\ifthenelse{\equal{\value{notemark}}{\value{notemarkref}}}{%
+        		%on est au debut de l'environnement (premiere note)
+        	\refstepcounter{notemark}%
+        	\refstepcounter{notemarkref}%
+        	\setcounter{Note}{\value{notemark}}%
+       }{%
+        		%notes suivantes
+        	\refstepcounter{notemark}%
+        	\setcounter{Note}{\value{notemark}}%
+	}%
+			%on prepare la suite
+	\setcounter{notetextref}{\value{notemarkref}}%
+			%on écrit le numéro
+	\begin{picture}(0,0)%
+        	\put(-3,-3){\LARGE\theNote}
+	\end{picture}\xspace
+}
+
+\newcommand{\notetextbase}[1]{%
+        \ifthenelse{\value{ifnote} = 1}{%
+        \marginpar{\notedebasenumero{#1}}%
+        }{}%
+}
+
+\newcommand{\notetext}[1]{
+	\ifthenelse{\equal{\value{notetext}}{\value{notetextref}}}{%
+        		%on est a la première note
+        	\refstepcounter{notetext}%
+        	\refstepcounter{notetextref}%
+        	\setcounter{Note}{\value{notetext}}
+        }{
+       			 %notes suivantes
+        	\refstepcounter{notetext}%
+        	\setcounter{Note}{\value{notetext}}
+	}%
+			%on prepare la suite
+\setcounter{notemarkref}{\value{notetextref}}%
+\notetextbase{#1}%
+}
+
+
+
+\newcommand{\notedebase}[1]{%
+	\raggedright%
+        \footnotesize%
+        \vskip-0.5\baselineskip
+        \rule[-1.4mm]{\linewidth}{0.5pt}
+        \rule[1.4mm]{\linewidth}{0.5pt} \\%
+        \vskip-0.5\baselineskip
+        #1 \\%
+        \vskip-\baselineskip
+        \rule[-1.4mm]{\linewidth}{0.5pt}
+        \rule[1.4mm]{\linewidth}{0.5pt} \\%
+}
+
+\newcommand{\notedebasenumero}[1]{%
+	{\LARGE\theNote}
+	\notedebase{#1}%
+}
+
+\newcommand{\notesimple}[1]{%
+	\ifthenelse{\value{ifnote} = 1}{%
+	\marginpar{\notedebase{#1}}%	
+	}{}%
+}
+
+\newcommand{\notenumero}[1]{%
+        \ifthenelse{\value{ifnote} = 1}{%
+        \refstepcounter{Note}%
+        \setcounter{notemarkref}{\value{Note}}%
+        \setcounter{notetextref}{\value{Note}}%
+        \setcounter{notemark}{\value{Note}}%
+        \setcounter{notetext}{\value{Note}}%
+        \begin{picture}(0,0)%
+        \put(-3,-3){\LARGE\theNote}
+        \end{picture}%
+        \ifthenelse{\isodd{\value{Note}}}{%
+        	\protect\reversemarginpar%
+	      	\marginpar[{\notedebasenumero{#1}}]{\notedebasenumero{#1}}}{%
+           	\protect\normalmarginpar%
+       		\marginpar[{\notedebasenumero{#1}}]{\notedebasenumero{#1}}}%
+        }{}%
+}
+
+\newcommand{\typo}[1]{\notenumero{#1}}
+
+\newcommand{\note}[2][1]{%
+	\ifthenelse{\equal{#1}{0} \or \equal{#1}{simple}}{%
+                \setcounter{notesimple}{1}%
+        }{}%
+	%
+	\ifthenelse{\value{notesimple} = 0}{%
+		\notenumero{#2}%
+	}{%
+		\notesimple{#2}%
+	}
+}
+
+
+
+%!!!!!!!!!!!!!!!!!!!                                 !!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!   Petits raccourcis pratiques   !!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!                                 !!!!!!!!!!!!!!!!!!!
+
+% Les espaces verticaux et horizontaux.
+\newcommand{\sk}{\smallskip}
+\newcommand{\mk}{\medskip}
+\newcommand{\bk}{\bigskip}
+\newcommand{\vk}{\vskip 1.5 cm}
+\newcommand{\hk}{\hskip 1 cm\relax}
+\newcommand{\marge}{\noindent}
+\newcommand{\dquad}{\hskip.5em\relax}
+
+% Quelques raccourcis pour des expressions, en italique ou pas.
+\newcommand{\mkemph}[1]{\text{\emph{#1}}\xspace}
+\newcommand{\etc}{etc.\xspace}
+\newcommand{\apriori}{a priori\xspace}
+\newcommand{\afortiori}{a fortiori\xspace}
+\newcommand{\ie}{\mkemph{ie}}
+\newcommand{\infine}{in fine\xspace}
+\newcommand{\ssi}{\mkemph{ssi}}
+\newcommand{\cf}{cf.\xspace}
+\newcommand{\tiret}{\textbf{--}\xspace} % plus épais que la normale
+
+% Mettre du texte en \texttt.
+\newcommand{\ttt}[1]{\texttt{#1}}
+\newcommand{\web}[1]{%
+    \NoAutoSpaceBeforeFDP%  Pas d'espace avant les ':' et ';'
+	\makeatletter%
+	\texttt{#1}%
+	\makeatother%
+    \AutoSpaceBeforeFDP%
+} % Gère '@'.
+
+% Pour les adresses email.
+% Exemple: \email{contact}{H-K.fr}
+\newcommand{\email}[2]{%
+    \texttt{#1}%
+    {\fontfamily{ptm}\selectfont\at}%
+    \texttt{#2}%
+    }
+
+% Quelques raccourcis.
+\newcommand{\mbx}[1]{\mbox{#1}}	% Anti-goliotages...
+\newcommand{\unentoure}{\ding{172}}
+\newcommand{\deuxentoure}{\ding{173}}
+\newcommand{\troisentoure}{\ding{174}}
+\newcommand{\quatreentoure}{\ding{175}}
+\newcommand{\cinqentoure}{\ding{176}}
+
+% Les « e dans l'o » de merde et autres raccourcis standards.
+\newcommand{\coeur}{c{\oe}ur\xspace}
+\newcommand{\Coeur}{C{\oe}ur\xspace}
+\newcommand{\coeurs}{c{\oe}urs\xspace}
+\newcommand{\Coeurs}{C{\oe}urs\xspace}
+\newcommand{\choeur}{ch{\oe}ur\xspace}
+\newcommand{\Choeur}{Ch{\oe}ur\xspace}
+\newcommand{\choeurs}{ch{\oe}urs\xspace}
+\newcommand{\Choeurs}{Ch{\oe}urs\xspace}
+\newcommand{\oeuvre}{{\oe}uvre\xspace}
+\newcommand{\Oeuvre}{{\OE}uvre\xspace}
+\newcommand{\oeuvres}{{\oe}uvres\xspace}
+\newcommand{\Oeuvres}{{\OE}uvres\xspace}
+\newcommand{\oeil}{{\oe}il\xspace}
+\newcommand{\Oeil}{{\OE}il\xspace}
+\newcommand{\oeuf}{{\oe}uf\xspace}
+\newcommand{\oeufs}{{\oe}ufs\xspace}
+\newcommand{\noeud}{n{\oe}ud\xspace}
+\newcommand{\noeuds}{n{\oe}uds\xspace}
+\newcommand{\Noeud}{N{\oe}ud\xspace}
+\newcommand{\Noeuds}{N{\oe}uds\xspace}
+\newcommand{\soeur}{s{\oe}ur\xspace}
+\newcommand{\soeurs}{s{\oe}urs\xspace}
+\newcommand{\Soeur}{S{\oe}ur\xspace}
+\newcommand{\Soeurs}{S{\oe}urs\xspace}
+\newcommand{\voeu}{v{\oe}u\xspace}
+\newcommand{\Voeu}{V{\oe}u\xspace}
+\newcommand{\voeux}{v{\oe}ux\xspace}
+\newcommand{\Voeux}{V{\oe}ux\xspace}
+%\newcommand{\madame}{M${}^{{\rm me}}$\xspace}   
+\newcommand{\madame}{M\textsuperscript{me}\xspace}   
+\newcommand{\Mme}{\madame}
+%\newcommand{\mademoiselle}{M${}^{{\rm lle}}$\xspace}
+\newcommand{\mademoiselle}{M\textsuperscript{lle}\xspace}
+\newcommand{\mamzelle}{\mademoiselle}   
+\newcommand{\Melle}{\mademoiselle}   
+%\newcommand{\docteur}{D${}^{{\rm r}}$\xspace}
+\newcommand{\docteur}{D\textsuperscript{r}\xspace}
+\newcommand{\Dr}{\docteur}
+\newcommand{\HK}{H{\footnotesize\&}K\xspace}
+	% Attention, cela ne marche que pour la taille standard.
+%\newcommand{\maitre}{M${}^{{\rm e}}$\xspace}
+\newcommand{\maitre}{M\textsuperscript{e}\xspace}
+
+%!!!!!!!!!!!!!!                                           !!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!   Commandes spécifiques de mise en page   !!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!                                           !!!!!!!!!!!!!!
+
+% Faire des tableaux dans lesquels les lignes sont bien espacées.
+% Cet environnement « éloigne » toutes les lignes d'un tableau, ce qui peut
+% être utile lorsque les lignes sont systématiquement séparées par des traits.
+%
+% L'argument optionnel permet d'adapter le taux d'éloignement.
+%
+% Pour écarter les lignes horizontales autour d'une ligne particulière du
+% tableau, plutôt que pour tout le tableau, on utilisera plutôt \vphantom,
+% comme dans les exemples ci-dessous:
+%	\vphantom{$\Sum{}{}$}
+%	\vphantom{$\Int{}{}$}
+%	\vphantom{$\Sum{0}{1}$}
+%	\vphantom{\rule{1cm}{1cm}}
+%
+% Exemple :	\begin{ltab}
+%		\begin{tabular}···\end{tabular}
+%		\end{ltab}
+
+\newenvironment{ltab}[1][2]{%
+        \renewcommand{\arraystretch}{#1}}{%
+        \renewcommand{\arraystretch}{1}}
+
+% Pour placer deux {minipage} côte à côte de manière à optimiser l'espace
+% horizontal disponible, il faut spécifier des largeurs dont la somme fait
+% la largeur de la page. Une manière plus pratique est de ne spécifier que
+% la largeur de la première {minipage} et d'utiliser \complete comme 
+% ci-dessous pour spécifier la largeur de la deuxième.
+%
+% Attention à ne pas oublier le \noindent, sinon LaTeX vous avertira d'un
+% 'Overfull hbox'.
+%
+% Exemple:	\noindent
+%		\begin{minipage}{5cm}···\end{minipage}
+%		\begin{minipage}{\complete{5}}···\end{minipage}
+%
+% Exemple:	\noindent
+%		\begin{minipage}{5cm}···\end{minipage}
+%		\hskip1cm
+%		\begin{minipage}{\complete{6}}···\end{minipage}
+
+\newcommand{\complete}[1]{\linewidth - #1 cm - 3 pt}
+
+% Pour les dessins avec LaTeX.
+%
+% Cet environnement permet d'augmenter proprement la taille des traits
+% dans un dessin fait avec latex. Le paramètre à passer peut prendre n'importe
+% quelle valeur positive. Une valeur de 0.5 correspond à ne rien changer à 
+% l'épaisseur des traits. Une valeur de 2.5 correspond à multiplier
+% l'épaisseur des traits par 5, etc.
+%
+% ATTENTION: le positionnement des figures dépend de la version de LaTeX
+% lorsque \allinethickness est utilisé. Autrement dit, n'utilisez JAMAIS cet
+% environnement pour des traits qui doivent être placés finement, comme des
+% axes d'un repère, des hachures ou encore en chimie organique.
+%
+% Exemple:	\begin{epaisseur}{1}	% Doubler l'épaisseur des traits
+%		\begin{picture}(0,0)···\end{picture}
+%		\end{epaisseur}
+
+\newenvironment{epaisseur}[1]
+        {\allinethickness{#1 pt}}
+        {\allinethickness{0.5 pt}}
+
+% On souhaite parfois ajouter des annotations sur une courbe réalisée avec
+% gnuplot (par exemple). Une solution pratique est d'inclure cette courbe
+% (au format postscript) avec \epsfig puis de créer un dessin de taille
+% nulle (\begin{picture}(0,0)), dans lequel on ajoute les éléments souhaités
+% (comme un vecteur (\vector) ou une valeur, $\pi$, etc.) grâce à la commande
+% \put de LaTeX. Le problème avec cette méthode est qu'il faut deviner les
+% « bonnes coordonnées » du point en lequel on souhaite placer un élément.
+% Pour faciliter cette recherche des coordonnées, la commande \reperes dessine
+% des graduations sur un repère virtuel. Ces graduations sont espacées de
+% 10 points en 10 points, avec des traits plus grands pour les cinquantaines
+% et les centaines. La commande \reperes prend un argument optionnel, qui est
+% le nombre de graduations souhaité. La valeur par défaut est 20.
+%
+% Exemple:	\begin{picture}(0,0)
+%		\reperes[15]
+%		\put(37,48){$\f{\pi}{2}$}	% Comment trouver (37,48) ?
+%		\end{picture}
+%
+% Attention, cette commande a vocation à être temporaire, elle ne sert qu'à
+% trouver des coordonnées. N'oubliez pas de l'effacer de votre fichier une
+% fois votre dessin terminé.
+
+\newcounter{cinquantaine}
+\newcounter{centaine}
+\newcommand{\reperes}[1][20]{
+	\ifthenelse{\value{ifnote} = 1}{%
+		\setcounter{cinquantaine}{#1/5+1}%
+		\setcounter{centaine}{#1/10+1}%
+		\multiput(0,0)(10,0){#1}{\line(0,1){1}}%
+		\multiput(0,0)(10,0){#1}{\line(0,-1){1}}%
+		\multiput(0,0)(0,10){#1}{\line(1,0){1}}%
+		\multiput(0,0)(0,10){#1}{\line(-1,0){1}}%
+		\multiput(0,0)(-10,0){#1}{\line(0,1){1}}%
+		\multiput(0,0)(-10,0){#1}{\line(0,-1){1}}%
+		\multiput(0,0)(0,-10){#1}{\line(1,0){1}}%
+		\multiput(0,0)(0,-10){#1}{\line(-1,0){1}}%
+		\multiput(0,0)(50,0){\thecinquantaine}{\line(0,1){3}}%
+		\multiput(0,0)(50,0){\thecinquantaine}{\line(0,-1){3}}%
+		\multiput(0,0)(0,50){\thecinquantaine}{\line(1,0){3}}%
+		\multiput(0,0)(0,50){\thecinquantaine}{\line(-1,0){3}}%
+		\multiput(0,0)(-50,0){\thecinquantaine}{\line(0,1){3}}%
+		\multiput(0,0)(-50,0){\thecinquantaine}{\line(0,-1){3}}%
+		\multiput(0,0)(0,-50){\thecinquantaine}{\line(1,0){3}}%
+		\multiput(0,0)(0,-50){\thecinquantaine}{\line(-1,0){3}}%
+		\multiput(0,0)(100,0){\thecentaine}{\line(0,1){5}}%
+		\multiput(0,0)(100,0){\thecentaine}{\line(0,-1){5}}%
+		\multiput(0,0)(0,100){\thecentaine}{\line(1,0){5}}%
+		\multiput(0,0)(0,100){\thecentaine}{\line(-1,0){5}}%
+		\multiput(0,0)(-100,0){\thecentaine}{\line(0,1){5}}%
+		\multiput(0,0)(-100,0){\thecentaine}{\line(0,-1){5}}%
+		\multiput(0,0)(0,-100){\thecentaine}{\line(1,0){5}}%
+		\multiput(0,0)(0,-100){\thecentaine}{\line(-1,0){5}}%
+	}%
+	{}%
+}
+
+% Pour créer des courbes, vous pouvez utiliser les extensions LaTeX PGF et
+% TikZ (à la manière de l'environnement {picture}, mais beaucoup plus 
+% puissantes). Attention, ce cas est un peu particulier, car il vous est 
+% impossible de les utiliser directement dans le corrigé, il vous faut créer 
+% un fichier à part que vous placerez ensuite dans le sous-répertoire PS/ de 
+% votre corrigé.
+%
+% Pour plus d'informations, consultez la Doc à ce sujet:
+% http://auteurs.h-k.fr/annales/Doc/Graphique/Utiliser_l_extension_PGF_Ti.html
+%
+% Voici un exemple minimal:
+%
+% \input{annales.sty}
+% \usepackage{tikz}
+% \pagestyle{empty}
+% \begin{document}
+% 
+% \begin{dessinpgf}{1cm}{.05cm}
+%	\draw [->] (-2,0) -- (2,0) node [pos=1, below] {$\log x$};
+%	\draw [->] (0,-50) -- (0,20) node [pos=1, left] {$G$};
+%	\draw [dashed] (-2,12) -- (0,12) -- (1.5,-48) node
+%		[pos=.65,above,sloped] {$-40\U{dB/dec}$};
+%	\draw (0,12) node [right] {$G_0 $};
+%	\draw plot [samples=200,id=exp1,domain=-2:1.5] function {12.0 -10.0*
+%		log10((1.0-10.**(2.*x))**2 + 22.47*10.**(2.*x))};
+% \end{dessinpgf}
+%
+% \end{document}
+
+\newenvironment{dessinpgf}[3][]{%
+		\begin{tikzpicture}[#1]%
+		\pgfsetxvec{\pgfpoint{#2}{0pt}}%
+		\pgfsetyvec{\pgfpoint{0pt}{#3}}%
+	}{%
+		\end{tikzpicture}%
+}
+
+
+% \mathbf ne suffit pas toujours à mettre en gras. En pareil cas, on peut
+% avoir recours à \mathgras. Il ne vaut toutefois mieux pas l'utiliser
+% systématiquement, car il ralentit la compilation du corrigé.
+%
+% Exemple : $a \mathgras{=} b$.
+% 
+% Deux autres avantages: d'une part, tout texte en indice ou en exposant
+% est automatiquement en gras; d'autre part, la police reste la même (ce
+% qui n'est pas le cas avec \mathbf).  
+
+\newcommand{\mathgras}[1]{\grastrue\ensuremath{%
+	{\text{\mathversion{bold}\ensuremath{#1}}}%
+	}\grasfalse}
+
+% Pour tout mettre en gras, on peut aussi utiliser \textegras ou \gras
+% et \nongras, qui présentent l'avantage d'obtenir les lettres
+% n'existant pas en gras.
+%
+% Exemple: \textegras{On a $a = b$.}
+% 	   \gras On a $a = b$. \nongras
+%
+% Ces commandes sont dues à Walter et présentes dans la définition de
+% \partie, \Partie et des commandes à base de \mathBB.
+
+\newcommand{\textegras}[1]{\grastrue\textbf{\mathversion{bold}#1}\grasfalse}%
+\newcommand{\textgras}[1]{\textegras{#1}}
+\newcommand{\gras}{\grastrue\bfseries\mathversion{bold}}%
+\newcommand{\nongras}{\grasfalse\mathversion{normal}\normalfont}
+
+\newif\ifgras
+
+% Numéroter les parties et sous-parties (annexes).
+\renewcommand{\thesection}{\Roman{section}}
+\renewcommand{\thesubsection}{\arabic{subsection}}
+
+% Pour commencer sur une page de droite et laisser proprement une page
+% blanche en cas de besoin.
+\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}}
+
+% Des points de suspension sans limite de longueur.
+\def\leaderfill{\leaders\hbox to 1ex{\hss.\hss}\hfill}
+
+% Un peu spécieux, mais en fait pratique pour les annexes de maths.
+\newcommand{\es}[1]{\ensuremath{#1}}
+
+% Insérer une page de séparation, qui contient par exemple « Annexes » en
+% énorme centré sur la page.
+\newcommand{\pageseparation}[1]{%   
+	\thispagestyle{empty}
+        \mbox{}\vfill
+        \begin{center}
+        {\bfseries\Huge #1}
+        \end{center}\vfill
+        }
+
+% Pour le tableau des constantes en chimie.
+\newenvironment{deuxcolonnes}%
+        {\setlength{\columnsep}{8 mm}%
+        \setlength{\columnseprule}{0.5 pt}%
+        \begin{multicols}{2}}%
+        {\end{multicols}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%                                     %%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%   Pour l'environnement {remarque}   %%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%                                     %%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\makeatletter
+
+\newbox\bk@bxb
+\newbox\bk@bxa
+\newif\if@bkcont 
+\newif\ifbkcount
+\newcount\bk@lcnt
+
+\def\breakboxskip{2pt}
+\def\breakboxparindent{1.8em}
+\def\margesep{1cm}	% Écart entre la marge de gauche et le filet.
+\def\intervalle{1mm}	% Écart supplémentaire entre le filet et le texte.
+
+\def\filet{\vskip\breakboxskip\relax
+\setbox\bk@bxb\vbox\bgroup
+\advance\linewidth -\fboxrule
+\advance\linewidth -\margesep
+\advance\linewidth -\intervalle
+\advance\linewidth -\fboxsep
+\hsize\linewidth\@parboxrestore
+\parindent\breakboxparindent\relax}
+
+% \@tempdimb: amount of vertical skip 
+% between the first line (\bk@bxa) and the rest (\bk@bxb)
+\def\bk@split{%
+\@tempdimb\ht\bk@bxb % height of original box
+\advance\@tempdimb\dp\bk@bxb 
+\setbox\bk@bxa\vsplit\bk@bxb to\z@ % split it
+\setbox\bk@bxa\vbox{\unvbox\bk@bxa}% recover height & depth of \bk@bxa
+\setbox\@tempboxa\vbox{\copy\bk@bxa\copy\bk@bxb}% naive concatenation
+\advance\@tempdimb-\ht\@tempboxa 
+\advance\@tempdimb-\dp\@tempboxa}% gap between two boxes
+ 
+
+% \@tempdima: height of the first line (\bk@bxa) + fboxsep
+\def\bk@addfsepht{%
+     \setbox\bk@bxa\vbox{\vskip\fboxsep\box\bk@bxa}}
+
+\def\bk@addskipht{%
+     \setbox\bk@bxa\vbox{\vskip\@tempdimb\box\bk@bxa}}
+
+% \@tempdima: depth of the first line (\bk@bxa) + fboxsep
+\def\bk@addfsepdp{%
+     \@tempdima\dp\bk@bxa
+%     \advance\@tempdima\fboxsep
+     \dp\bk@bxa\@tempdima}
+
+% \@tempdima: depth of the first line (\bk@bxa) + vertical skip
+\def\bk@addskipdp{%
+     \@tempdima\dp\bk@bxa
+     \advance\@tempdima\@tempdimb
+     \dp\bk@bxa\@tempdima}
+
+\def\bk@line{%
+    \hbox to \linewidth{\ifbkcount\smash{\llap{\the\bk@lcnt\ }}\fi
+    \hskip\margesep
+    \vrule \@width\fboxrule\hskip\fboxsep
+    \hskip\intervalle
+    \box\bk@bxa\hfil
+%    \hskip\fboxsep
+	}}
+
+\def\endfilet{\egroup
+\ifhmode\par\fi{\noindent\bk@lcnt\@ne 
+\@bkconttrue\baselineskip\z@\lineskiplimit\z@
+\lineskip\z@\vfuzz\maxdimen
+\bk@split\bk@addfsepht\bk@addskipdp
+\ifvoid\bk@bxb      % Only one line
+\def\bk@fstln{\bk@addfsepdp
+%\vbox{\hrule\@height\fboxrule\bk@line\hrule\@height\fboxrule}}%
+\vbox{\bk@line}}%
+\else               % More than one line
+%\def\bk@fstln{\vbox{\hrule\@height\fboxrule\bk@line}\hfil
+\def\bk@fstln{\vbox{\bk@line}\hfil
+\advance\bk@lcnt\@ne
+\loop 
+ \bk@split\bk@addskipdp\leavevmode
+\ifvoid\bk@bxb      % The last line
+ \@bkcontfalse\bk@addfsepdp
+% \vtop{\bk@line\hrule\@height\fboxrule}%
+ \vtop{\bk@line}%
+\else               % 2,...,(n-1)
+ \bk@line
+\fi
+ \hfil\advance\bk@lcnt\@ne
+\if@bkcont\repeat}%
+\fi
+\leavevmode\bk@fstln\par}\vskip\breakboxskip\relax}
+
+\bkcountfalse
+
+\makeatother
+
+
+%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!             !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   Centrer   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!             !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+% LaTeX prévoit un mécanisme pour centrer les équations: $$···$$ (ou, de 
+% manière équivalente, \[···\]). Ces commandes doivent être proscrites dans un
+% travail en commun, parce que l'espace vertical placé avant et après 
+% ces environnements change d'un site à l'autre, de sorte qu'il n'est pas 
+% possible de préserver une mise en page soignée.
+%
+% En remplacement, voici une série de commandes plus générales (elles 
+% permettent de centrer n'importe quoi: texte, formule, tableau, dessin, etc.).
+%
+% Supposons que l'on veuille simplement centrer une formule sur la page, comme
+% ceci:
+%
+%				x_0 = 7
+%
+% On pourra utiliser la commande \centers.
+%
+% Exemple: \centers{$ x_0 = 7 $}
+%	   \centers{Ceci est un texte centré}
+%
+% On peut vouloir y ajouter un petit mot de liaison en début de ligne, collé
+% à la marge, en particulier dans une suite de calculs, comme ceci:
+%
+% d'où				x_0 = 7
+%
+% On pourra alors utiliser \leftcenters.
+%
+% Exemple: \leftcenters{ d'où }{ $x_0 = 7$ }
+%
+% Il est aussi parfois utile de placer du texte à droite de la ligne, collé
+% à la marge, comme ceci:
+%
+% d'où				x_0 = 7					(2)
+%
+% On utilisera dans ce cas \leftcentersright.
+%
+% Exemple: \leftcentersright{ d'où }{ $x_0 = 7$ }{ \deux }
+%
+% Et si l'on ne souhaite rien placer à gauche, on dispose de \centersright.
+%
+% Pour toutes ces commandes, le texte du milieu est parfaitement centré sur
+% la page quels que soient les deux autres arguments de \leftcentersright.
+%
+% Attention dès lors au risque de chevauchement: puisque le texte à gauche ne
+% « pousse » pas celui du milieu vers la droite, ces deux textes peuvent très
+% bien se chevaucher s'ils sont tous deux suffisamment longs. LaTeX ne vous
+% préviendra pas, il faudra le déceler vous-même en regardant une version
+% compilée. Cela ne devrait en général poser aucun problème.
+%
+% Les trois commandes précédentes admettent une variante en remplaçant
+% 'centers' par 'encadre'; dans ce cas, le texte à centrer sera encadré.
+%
+% Exemple: \leftencadre{ En conclusion, }{ $A=0$ }
+%
+% Enfin, tous ces environnements (aussi bien avec 'centers' qu'avec 'encadre'
+% laissent un espace vertical avant et après eux. Cet espace est, par défaut,
+% équivalent à un \medskip. Mais vous pouvez le changer en passant un argument
+% optionnel.
+%
+% Exemple:	\centers[0]	<==> 	Pas d'espace
+%		\centers[1]	<==>	Laisser un \smallskip
+%		\centers[2]	<==>	Laisser un \medskip
+%		\centers[3]	<==>	Laisser un \bigskip
+%		\centers[4]	<==>	Laisser 1 cm
+%
+% L'espace laissé avant et l'espace laissé après sont toujours identiques.
+
+% L'ancienne commande \centers centrait par rapport à l'{itemize} (ou 
+% l'environnement en cours) plutôt que par rapport à la page. On dispose
+% d'une bascule pour passer d'un mode à l'autre.
+
+\newcounter{Centers}
+\setcounter{Centers}{0}
+
+\newcommand{\CentersOnPage}{\setcounter{Centers}{0}}
+\newcommand{\CentersOnItems}{\setcounter{Centers}{1}}
+
+\newcommand{\leftcentersright}[4][2]{%
+	\ifthenelse{\equal{\value{Centers}}{0}}{%
+		\leftcentersrightonpage[#1]{#2}{#3}{#4}%
+	}{
+		\leftcentersrightonitems[#1]{#2}{#3}{#4}%		
+	}
+}
+
+\newcounter{vcenterstest}
+\newlength{\leftlength}
+\newlength{\rightlength}
+\newlength{\vcentersskip}
+\newcommand{\leftcentersrightonitems}[4][2]{%
+	\settowidth{\leftlength}{#2}%
+	\settowidth{\rightlength}{#4}%
+	\setcounter{vcenterstest}{#1}%
+	\ifthenelse{\value{vcenterstest} = 0}
+		{\setlength{\vcentersskip}{0pt}}{}%
+	\ifthenelse{\value{vcenterstest} = 1}
+		{\setlength{\vcentersskip}{\smallskipamount}}{}%
+	\ifthenelse{\value{vcenterstest} = 2}
+		{\setlength{\vcentersskip}{\medskipamount}}{}%
+	\ifthenelse{\value{vcenterstest} = 3}
+		{\setlength{\vcentersskip}{\bigskipamount}}{}%
+	\ifthenelse{\value{vcenterstest} = 4}
+		{\setlength{\vcentersskip}{1cm}}{}%
+		% On laisse un espace vertical défini par l'argument
+		% optionnel #1
+	\vskip\vcentersskip
+		% On place #2 et on recule de sa longueur
+	\noindent#2\hskip-\leftlength%
+		% On centre #3
+	\hfill#3\hfill%
+		% On va au bout de la ligne, on recule de la longueur de #4 et
+		% on place #4
+	\mbox{}\hskip-\rightlength#4%
+		% On laisse un espace vertical défini par l'argument
+		% optionnel #1
+	\vskip\vcentersskip%
+}
+
+%\newlength{\leftlength}
+%\newlength{\rightlength}
+\newlength{\calculskip}
+\newcommand{\calculvskip}[1]{% 
+  \ifthenelse{#1 = 0}{\setlength{\calculskip}{0pt}}{}%
+  \ifthenelse{#1 = 1}{\setlength{\calculskip}{\smallskipamount}}{}%
+  \ifthenelse{#1 = 2}{\setlength{\calculskip}{\medskipamount}}{}%
+  \ifthenelse{#1 = 3}{\setlength{\calculskip}{\bigskipamount}}{}%
+  \ifthenelse{#1 = 4}{\setlength{\calculskip}{1cm}}{}%
+  \vskip\calculskip
+} 
+
+\newcommand{\leftcentersrightonpage}[4][2]{%
+	\settowidth{\leftlength}{#2}%
+	\settowidth{\rightlength}{#4}%
+		% On laisse un espace vertical défini par l'argument
+		% optionnel #1
+	\calculvskip{#1}
+        % On place #2 et on recule de sa longueur
+		% Amélioration par Céline: la ligne suivante fait en sorte
+		% que l'argument du milieu soit toujours bien centré sur la
+		% page, plutôt que centré dans l'environnement (sauf
+		% dans une {remarque}, à la demande de Manu).
+	\noindent#2\hskip-\leftlength%
+%	\hskip\linewidth\hskip-\textwidth%
+	\ifremarque{}\else\hskip\linewidth\hskip-\textwidth\fi%
+		% On centre #3
+	\hfill{#3}\hfill
+		% On va au bout de la ligne, on recule de la longueur de #4 et
+		% on place #4
+	\mbox{}\hskip-\rightlength#4%
+		% On laisse un espace vertical défini par l'argument
+		% optionnel #1
+	\vskip\calculskip%
+}
+
+\newcommand{\centers}[2][2]{\leftcentersright[#1]{}{#2}{}}
+\newcommand{\leftcenters}[3][2]{\leftcentersright[#1]{#2}{#3}{}}
+\newcommand{\centersright}[3][2]{\leftcentersright[#1]{}{#2}{#3}}
+\newcommand{\leftencadreright}[4][2]{\leftcentersright[#1]{#2}{\fbox{#3}}{#4}}
+\newcommand{\encadre}[2][2]{\leftcentersright[#1]{}{\fbox{#2}}{}}
+\newcommand{\leftencadre}[3][2]{\leftcentersright[#1]{#2}{\fbox{#3}}{}}
+\newcommand{\encadreright}[3][2]{\leftcentersright[#1]{}{\fbox{#2}}{#3}}
+\newcommand{\remandcenters}[3][2]{\leftcentersright[#1]{#2}{#3}{}} % Synonyme
+\newcommand{\centrer}[2][2]{\leftcentersright[#1]{}{#2}{}}	% Synonyme
+\newcommand{\Centers}[2][2]{\leftcentersright[#1]{}{#2}{}}	% Synonyme
+
+
+
+% Pour encadrer un texte trop long pour tenir sur une seule ligne, il faut
+% inclure ce texte dans une {minipage}. La commande \encadreminipage prend
+% deux arguments: la largeur de la {minipage}, puis le texte. On peut
+% également inclure un argument optionnel pour régler l'espace avant et après
+% la {minipage}.
+%
+% Exemple:	\encadreminipage{8cm}{texte ··· texte}
+
+\newcommand{\encadreminipage}[3][2]{%
+	\leftcentersright[#1]{}{\fbox{%
+		\begin{minipage}{#2} #3 \end{minipage}%
+	}}{}%
+}
+
+\newcommand{\centersminipage}[3][2]{%
+        \leftcentersright[#1]{}{%
+                \begin{minipage}{#2} #3 \end{minipage}%
+        }{}%
+}
+
+%!!!!!!!!!!!!!!!!!!!!                              !!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!   Raccourcis de correction   !!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!                              !!!!!!!!!!!!!!!!!!!!
+
+% Les raccourcis ci-dessous sont surtout utiles pour corriger le travail
+% d'une tierce personne. Rien ne vous empêche néanmoins de les utiliser.
+
+\newcommand{\donccenters}[2][2]{\leftcenters[#1]{donc}{#2}}
+\newcommand{\doucenters}[2][2]{\leftcenters[#1]{d'où}{#2}}
+\newcommand{\carcenters}[2][2]{\leftcenters[#1]{car}{#2}}
+\newcommand{\cadcenters}[2][2]{\leftcenters[#1]{c'est-à-dire}{#2}}
+\newcommand{\puiscenters}[2][2]{\leftcenters[#1]{puis}{#2}}
+\newcommand{\ainsicenters}[2][2]{\leftcenters[#1]{Ainsi,}{#2}}
+\newcommand{\depluscenters}[2][2]{\leftcenters[#1]{De plus,}{#2}}
+\newcommand{\aveccenters}[2][2]{\leftcenters[#1]{avec}{#2}}
+\newcommand{\soitcenters}[2][2]{\leftcenters[#1]{soit}{#2}}
+\newcommand{\alorscenters}[2][2]{\leftcenters[#1]{alors}{#2}}
+\newcommand{\maiscenters}[2][2]{\leftcenters[#1]{mais}{#2}}
+\newcommand{\commecenters}[2][2]{\leftcenters[#1]{Comme}{#2}}
+\newcommand{\ailleurscenters}[2][2]{\leftcenters[#1]{Par ailleurs,}{#2}}
+\newcommand{\orcenters}[2][2]{\leftcenters[#1]{Or,}{#2}}
+\newcommand{\etcenters}[2][2]{\leftcenters[#1]{et}{#2}}
+\newcommand{\deduitcenters}[2][2]{\leftcenters[#1]{On en déduit}{#2}}
+\newcommand{\parsuitecenters}[2][2]{\leftcenters[#1]{Par suite,}{#2}}
+\newcommand{\parcsqcenters}[2][2]{\leftcenters[#1]{Par conséquent,}{#2}}
+\newcommand{\ilvientcenters}[2][2]{\leftcenters[#1]{Il vient}{#2}}
+\newcommand{\conclusioncenters}[2][2]{\leftcenters[#1]{Conclusion :}{#2}}
+\newcommand{\finalementcenters}[2][2]{\leftcenters[#1]{Finalement,}{#2}}
+\newcommand{\ANcenters}[2][2]{\leftcenters[#1]{\textit{Application
+	numérique\/}\,:}{#2}}
+%
+\newcommand{\doncencadre}[2][2]{\leftencadre[#1]{donc}{#2}}
+\newcommand{\douencadre}[2][2]{\leftencadre[#1]{d'où}{#2}}
+\newcommand{\carencadre}[2][2]{\leftencadre[#1]{car}{#2}}
+\newcommand{\cadencadre}[2][2]{\leftencadre[#1]{c'est-à-dire}{#2}}
+\newcommand{\puisencadre}[2][2]{\leftencadre[#1]{puis}{#2}}
+\newcommand{\ainsiencadre}[2][2]{\leftencadre[#1]{Ainsi,}{#2}}
+\newcommand{\deplusencadre}[2][2]{\leftencadre[#1]{De plus,}{#2}}
+\newcommand{\avecencadre}[2][2]{\leftencadre[#1]{avec}{#2}}
+\newcommand{\soitencadre}[2][2]{\leftencadre[#1]{soit}{#2}}
+\newcommand{\alorsencadre}[2][2]{\leftencadre[#1]{alors}{#2}}
+\newcommand{\maisencadre}[2][2]{\leftencadre[#1]{mais}{#2}}
+\newcommand{\ailleursencadre}[2][2]{\leftencadre[#1]{Par ailleurs,}{#2}}
+\newcommand{\orencadre}[2][2]{\leftencadre[#1]{Or}{#2}}
+\newcommand{\etencadre}[2][2]{\leftencadre[#1]{et}{#2}}
+\newcommand{\deduitencadre}[2][2]{\leftencadre[#1]{On en déduit}{#2}}
+\newcommand{\parsuiteencadre}[2][2]{\leftencadre[#1]{Par suite,}{#2}}
+\newcommand{\parcsqencadre}[2][2]{\leftencadre[#1]{Par conséquent,}{#2}}
+\newcommand{\ilvientencadre}[2][2]{\leftencadre[#1]{Il vient}{#2}}
+\newcommand{\conclusionencadre}[2][2]{\leftencadre[#1]{Conclusion :}{#2}}
+\newcommand{\finalementencadre}[2][2]{\leftencadre[#1]{Finalement,}{#2}}
+\newcommand{\ANencadre}[2][2]{\leftencadre[#1]{\textit{Application
+	numérique\/}\,:}{#2}}
+
+% Les exposants.
+\newcommand{\moinsun}{\ensuremath{{}^{-1}}}
+\newcommand{\moinsdeux}{\ensuremath{{}^{-2}}}
+\newcommand{\moinstrois}{\ensuremath{{}^{-3}}}
+
+
+
+%!!!!!!!!!!!!!!!!!!!!!                             !!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!   Calculs et commentaires   !!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!                             !!!!!!!!!!!!!!!!!!!!!
+
+% Les outils de cette section sont une généralisation de \leftcentersright
+% et des environnements du type {systsimple}. L'idée est de pouvoir:
+%
+%       * centrer des calculs sur la page
+%       * écrire un commentaire spécifique à une ligne, collé à la marge gauche
+%       * écrire un commentaire spécifique à une ligne, collé à la marge droite
+%
+% Visuellement, le rendu pourrait ressembler à ceci:
+%
+% On sait que                    a = b
+% et                             b = c              d'après la question IV.2.c
+% donc                           a = c                        par transitivité
+% En outre,                      d = c
+% c'est-à-dire                   c = d
+% d'où                           a = d              en rassemblant les calculs
+%
+% On ne peut pas se contenter d'utiliser \leftcentersright à chaque ligne,
+% car les signes '=' ne seraient alors pas alignés. Il est nécessaire
+% d'utiliser un tableau ({array}) pour garantir leur alignement.
+%
+% Nous allons voir plusieurs environnements, du plus simple au plus général.
+%
+% Les commandes de cette section ont été écrites par Céline.
+
+% D'abord, quelques routines et déclarations.
+
+\newsavebox{\boite}
+\def\debutcom{\begin{lrbox}{\boite}}
+\def\fincomg{\end{lrbox}\makebox[0cm][l]{\usebox{\boite}}%
+             \hskip\linewidth\hskip-\textwidth}
+\def\fincomd{\end{lrbox}\makebox[0cm][r]{\usebox{\boite}}}
+
+
+% L'environnement {egalites} réalise l'illustration donnée en préambule.
+% Voici un exemple d'utilisation :
+%
+% \begin{egalites}
+%     On a   & a & b &              \\
+%     et     & b & c & (question 3) \\
+%     donc   & a & c &              \\
+% \end{egalites}
+%
+% ce qui produit:
+%
+% On a                            a = b
+% et                              b = c                           (question 3)
+% donc                            a = c
+%
+% Remarquez que l'environnement {egalites} utilise un tableau à 4 colonnes.
+% La première et la dernière sont réservées aux commentaires: on peut donc
+% y écrire du texte en français. En revanche, la deuxième et la troisième
+% servent pour les mathématiques: il n'est pas besoin de préciser les $ du
+% mode maths, ils sont inclus pour vous. (Plus précisément, il ne faut pas
+% les indiquer dans votre code, sinon vous annulez leur effet.)
+%
+% {egalites}, comme tous les autres environnements de cette section, possède
+% une propriété bien sympathique: les colonnes collées à la marge sont
+% « infiniment extensibles », c'est-à-dire que contrairement à la coutume,
+% elles ne réservent pas une place fixe calculées sur la largeur de l'élément
+% le plus large. Ainsi, on peut tout à fait obtenir:
+%
+% On a               a = b + c + d + e + f + g + h + i + j + k + l
+% et             u + v = x + y                  d'après la question précédente
+% donc  age(capitaine) = 30                          (même si ça dépend quand)
+%
+% (Ce qu'il faut remarquer, c'est que la colonne comportant le paquet
+% d'additions « mord » sur la colonne des commentaires sans que cela gêne
+% cette dernière.)
+%
+% Tout comme \leftcentersright et ses dérivés (\centers, \leftcenters, etc.),
+% l'environnement {egalites} accepte un argument optionnel, qui permet de
+% régler les espaces verticaux avant et après. Pour laisser un argument plus
+% grand que la normale, on écrirait donc:
+%
+% \begin{egalites}[3]   % Valeur par défaut: 2.
+%                       % Valeur maximale: 4.
+%
+% Et pour ne laisser aucun espace avant ni après:
+%
+% \begin{egalites}[0]
+%
+% L'espace entre les lignes du calcul peut en outre être géré très finement,
+% ligne par ligne, en utilisant l'argument optionnel de '\\', selon la
+% procédure classique:
+%
+% \begin{egalites}
+%     On a   & a & b &              \\[2mm]
+%     et     & b & c & (question 3) \\[4mm]
+%     donc   & a & c &              \\
+% \end{egalites}
+%
+% Enfin, sachez que l'environnement {egalites} (comme les suivants) n'est
+% pas compatible avec \leftcentersright ou l'un de ses dérivés. On ne peut
+% donc _pas_ écrire \centers{\begin{egalites} ··· \end{egalites}}.
+% Ce serait d'ailleurs tout à fait inutile. Si vous pensez en avoir
+% véritablement besoin un jour, utilisez simplement une {minipage}.
+
+\newenvironment{calculs:base}[2][2]{%
+	% On laisse un espace vertical défini par l'argument optionnel #1
+  	\calculvskip{#1}
+  	\noindent
+  	\begin{tabular*}{\linewidth}[t]%
+    		{@{}>{\debutcom}l<{\fincomg}@{\extracolsep{\fill}}%
+      		>{$}r<{$}%
+      		@{$\ #2\ $}%
+      		@{\extracolsep{0pt}}>{$}l<{$}%
+      		@{\extracolsep{\fill}}>{\debutcom}r<{\fincomd}@{}}
+	}{%
+  	\end{tabular*}%
+  	\vskip\calculskip
+}
+
+\newenvironment{egalites}[1][2]{%
+	\begin{calculs:base}[#1]{=}}{%
+	\end{calculs:base}
+}
+
+% Autre cas fréquent: le symbole de relation entre les membres de gauche et
+% de droite n'est pas '=', mais '\leq', ou '\geq'. On dispose de deux
+% environnements pour répondre à ce besoin:
+%
+% \begin{inegalites:leq}
+%     On a   & a & b &              \\[2mm]
+%     et     & b & c & (question 3) \\[2mm]
+%     donc   & a & c &              \\
+% \end{inegalites:leq}
+%
+% \begin{inegalites:geq}
+%     On a   & a & b &              \\[2mm]
+%     et     & b & c & (question 3) \\[2mm]
+%     donc   & a & c &              \\
+% \end{inegalites:geq}
+%
+% Le premier cas étant de loin le plus fréquent, il est également accessible
+% par la version abrégée {inegalites}:
+%
+% \begin{inegalites}
+%     On a   & a & b &              \\[2mm]
+%     et     & b & c & (question 3) \\[2mm]
+%     donc   & a & c &              \\
+% \end{inegalites}
+
+\newenvironment{inegalites}{%
+	\begin{inegalites:leq}}{%
+	\end{inegalites:leq}
+}
+
+\newenvironment{inegalites:leq}[1][2]{%
+	\begin{calculs:base}[#1]{\leq}}{%
+	\end{calculs:base}
+}
+
+\newenvironment{inegalites:geq}[1][2]{%
+	\begin{calculs:base}[#1]{\geq}}{%
+	\end{calculs:base}
+}
+
+% Les environnements précédents sont pratiques, mais ils sont loin de couvrir
+% tous les cas. Bien souvent, le symbole de relation change en cours de
+% calcul, ce qui nécessite un environnement plus général: {calculs}.
+%
+% Dans cet environnement, vous devez préciser le symbole de relation à chaque
+% ligne, dans une colonne à part:
+%
+% \begin{calculs}
+%     On a   & a &  =   & b &              \\
+%     et     & b & \leq & c & (question 3) \\
+%     donc   & a & \leq & c &              \\
+% \end{calculs}
+%
+% Le principe est inchangé pour les autres colonnes.
+
+\newenvironment{calculs}[1][2]%
+        {\begin{calculs:rcl}[#1]{r}{c}{l}}%
+        {\end{calculs:rcl}}
+
+% Lorsque les calculs se compliquent, il est parfois souhaitable de ne pas
+% suivre les consignes générales d'alignement, qui veulent que la colonne
+% de gauche (dans les calculs, ie celle qui précède le symbole de relation)
+% soit justifiée à droite, et la colonne de droite justifiée à gauche.
+%
+% LaTeX utilise les lettres
+%   * l (left)
+%   * c (center)
+%   * r (right)
+% pour classer les types d'alignements. La règle classique est donc
+% r (colonne de gauche) puis c (symbole de relation) puis l (colonne de droite).
+%
+% L'environnement {calculs:rcl} fonctionne comme {calculs}, hormis qu'il
+% exige trois paramètres, en plus de l'argument optionnel; ces paramètres
+% règleront pour vous la justification des colonnes.
+%
+% \begin{calculs:rcl}{c}{c}{l}
+%     On a   & a & = & b &              \\[2mm]
+%     et     & b & = & c & (question 3) \\[2mm]
+%     donc   & a & = & c &              \\
+% \end{calculs:rcl}
+%
+% Remarquez qu'il n'est pas possible de changer l'alignement des colonnes
+% ligne par ligne: ceci est une limitation de LaTeX.
+
+\newenvironment{calculs:rcl}[4][2]{%
+	% On laisse un espace vertical défini par l'argument
+        % optionnel #1
+	\calculvskip{#1}
+  	\noindent
+  	\begin{tabular*}{\linewidth}[t]%
+  		{@{}>{\debutcom}l<{\fincomg}@{\extracolsep{\fill}}
+		>{$}#2<{$}@{\extracolsep{0pt}}%
+		>{$\ }#3<{\ $}%
+      		@{\extracolsep{0pt}}>{$}#4<{$}%
+      		@{\extracolsep{\fill}}>{\debutcom}r<{\fincomd}@{}}%
+	}{%
+  	\end{tabular*}%
+  	\vskip\calculskip
+}
+
+% Occasionnellement, il arrive que l'on ait besoin de séparer en deux morceaux
+% la colonne de droite dans un calcul. Cela peut avoir lieu dans deux cas:
+%
+%   1° lorsqu'une ligne est trop longue;
+%   2° lorsque le membre de droite comporte deux termes bien distincts.
+%
+% Le premier cas n'est pas traité ici. En revanche, pour le deuxième, c'est
+% simple: il suffit de diviser la colonne de droite en deux colonnes ou, ce
+% qui revient au même, à introduire une colonne supplémentaire entre la
+% colonne des relations et la colonne des commentaires collés à la marge de
+% droite.
+%
+% Voici un exemple d'utilisation:
+%
+% \begin{calculs:rcl:extracol}{r}{c}{l}{l}
+%     On a   & a   &  =   & b_1 & + b_2 &               \\[2mm]
+%     et     & b_1 & \leq & c   &       & (question 3a) \\[2mm]
+%            & b_2 & \leq & d   &       & (question 3b) \\[2mm]
+%     donc   & a   & \leq & c   & + d   &               \\
+% \end{calculs:rcl:extracol}
+%
+% Dans cet exemple, imaginez bien sûr que b_1, b_2, c et d sont des
+% expressions plutôt complexes: il va de soi que vous n'avez pas besoin
+% de cet environnement pour additionner des termes de petite taille.
+
+\newenvironment{calculs:rcl:extracol}[5][2]{%
+	\calculvskip{#1}
+ 	\noindent
+	\begin{tabular*}{\linewidth}[t]%
+                {@{}>{\debutcom}l<{\fincomg}@{\extracolsep{\fill}}%
+		>{$}#2<{$}@{\extracolsep{0pt}}%
+		>{$\ }#3<{\ $}@{\extracolsep{0pt}}%
+		>{$}#4<{$}@{\extracolsep{0pt}}%
+      		>{$\null}#5<{$}%
+      		@{\extracolsep{\fill}}>{\debutcom}r<{\fincomd}@{}}%
+}{%
+  	\end{tabular*}%
+  	\vskip\calculskip
+}
+
+% Aucun des environnements précédents ne répond pleinement à vos besoins ?
+% Vos calculs sont abominables au-delà de toute norme ?
+% Nous avons la solution.
+%
+% L'environnement {calculs:rcl:extracol} vous ouvrait une colonne
+% supplémentaire mais imposait encore que le symbole se trouve dans la
+% deuxième (sans compter celle des commentaires collés à la marge de gauche).
+%
+% Avec {calculs:latotale}, vous disposez de 5 colonnes garanties sans
+% restriction, en plus des deux colonnes qui servent aux commentaires collés
+% aux marges. Vous pouvez les utiliser comme bon vous semble pour créer
+% des dispositions adaptées à vos besoins.
+%
+% Attention, le corollaire de cette liberté est que les espaces autour des
+% relations (=, \leq, etc.) ne sont plus réglés pour vous, vous allez devoir
+% les placer à la main en les faisant précéder et suivre d'un espace
+% (remplacer '=' par '\ =\ \null'). Voici un exemple d'utilisation:
+%
+% \begin{calculs:latotale}[3]{c}{l}{c}{l}{l}
+%     On a   & a & + b & \ = \    \null & c & + d &               \\[2mm]
+%     et     & a & + c & \ = \    \null & e & + d & (question 3a) \\[4mm]
+%     donc   & a & - b & \ \leq \ \null & f &     &               \\
+% \end{calculs:latotale}
+%
+% Plus simplement, vous pouvez aussi régler ces espaces pour toute la
+% colonne d'un coup à l'aide de '<' et '>'. Dans l'exemple précédent,
+% cela donnerait:
+%
+% \begin{calculs:latotale}[3]{c}{l}{>{\ }c<{\ }}{l}{l}
+%     On a   & a & + b & =    & c & + d &               \\[2mm]
+%     et     & a & + c & =    & e & + d & (question 3a) \\[4mm]
+%     donc   & a & - b & \leq & f &     &               \\
+% \end{calculs:latotale}
+
+\newenvironment{calculs:latotale}[6][2]{%
+  	\calculvskip{#1}
+  	\noindent
+  	\begin{tabular*}{\linewidth}[t]%
+    	        {@{}>{\debutcom}l<{\fincomg}@{\extracolsep{\fill}}%
+      		>{$\null}#2<{$}@{\extracolsep{0pt}}%
+      		>{$\null}#3<{$}@{\extracolsep{0pt}}%
+      		>{$\null}#4<{$}%
+      		@{\extracolsep{0pt}}>{$\null}#5<{$}%
+     		@{\extracolsep{0pt}}>{$\null}#6<{$}%
+      		@{\extracolsep{\fill}}>{\debutcom}r<{\fincomd}@{}}%
+}{%
+  	\end{tabular*}%
+  	\vskip\calculskip
+}
+
+% Bravo d'avoir lu jusque-là ! Pour vous en remercier, voici une petite
+% astuce: les séparateurs '&' n'ont pas besoin d'être précisés lorsqu'ils
+% précèdent immédiatement le retour à la ligne '\\'. Autrement dit, si
+% vous ne collez pas de commentaire à la marge de droite, vous pouvez
+% vous éviter de taper un '&' et, surtout, vous éviter de compter ces
+% symboles.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%                                  %%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%   Le langage des mathématiques   %%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%                                  %%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%!!!!!!!!!!!!!!!!!!!!!!!!!!                   !!!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!!   Les fractions   !!!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!!                   !!!!!!!!!!!!!!!!!!!!!!!!!!
+
+% La taille des fractions doit s'adapter au contexte: grandes dans une 
+% équation, petites en exposant ou en indice. La commande \f gère pour vous
+% tous les cas.
+%
+% Exemple : $ \f{1}{2} $
+%	    $ x^{\f{3}{2}} $
+%	    $ \Int{0}{ \f{pi}{2} } \cos²t \dt $
+\newcommand{\f}[2]{{\ensuremath{%
+	\mathchoice%
+	{\dfrac{#1}{#2}}
+    {\dfrac{#1}{#2}}
+	{\frac{#1}{#2}}
+	{\frac{#1}{#2}}
+}}}
+
+% Dans le texte, on a souvent envie d'écrire 1/2 plutôt que \f{1}{2}.
+% La macro \tf permet de corriger rapidement un \f malheureux.
+% Exemple: $ \tf{1}{\sqrt{2}} $  <==>  $1 / \sqrt{2}$
+\newcommand{\tf}[2]{\ensuremath{#1/#2}}
+
+% Quelques raccourcis pour les infortunés qui utilisent un clavier azerty.
+\newcommand{\demi}{\ensuremath{\f{1}{2}}\xspace}
+\newcommand{\tdemi}{\ensuremath{1/2}\xspace}
+\newcommand{\tiers}{\ensuremath{\f{1}{3}}\xspace}
+\newcommand{\ttiers}{\ensuremath{1/3}\xspace}
+\newcommand{\quart}{\ensuremath{\f{1}{4}}\xspace}
+\newcommand{\tquart}{\ensuremath{1/4}\xspace}
+
+%!!!!!!!!!!!!!!!!!!!!!!!!!                     !!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!   Les parenthèses   !!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!                     !!!!!!!!!!!!!!!!!!!!!!!!!
+
+% Pour indiquer des parenthèses autour d'une grosse expression, il peut
+% parfois être utile d'utiliser une macro plutôt que la commande explicite,
+% qui est \left(···\right).
+%
+% Exemple: $ \pa{ \Int{0}{1} f(t) \dt }^{\f{1}{2}} $
+%
+% Attention, il ne faut pas utiliser cette macro dans les deux cas suivants:
+%
+% * Autour d'une lettre seule, comme dans $f\pa(x)$: l'espace après
+%   le $f$ ne serait pas bon. Utiliser simplement $f(x)$.
+%
+% * Autour d'un vecteur seul, comme dans $\pa{\vect{E}}$. Il est
+%   normal et souhaitable que la flèche dépasse des parenthèses.
+%   Utiliser simplement $(\vect{E})$. S'il y a une fraction,
+%   préférez $ \pa{ \f{1}{2} \vect{E} } $ à
+%            $ \pa{ \f{\vect{E}}{2} $.
+%
+% En résumé, n'utilisez \pa que lorsque vous en avez vraiment besoin, ce qui
+% n'est pas le cas courant.
+%
+% La commande \pa possède une option pour corriger facilement des
+% parenthèses trop grandes:
+% \pa[0] supprime les parenthèses
+% \pa[1] les transforme en parenthèses simples
+% \pa[2-5] les transforme en parenthèses de plus en plus grandes 
+
+%\newcommand{\pa}[1]{\ensuremath{\left(#1\right)}}
+\newcommand{\pa}[2][9]{%
+	\ifthenelse{#1 = 0}
+		{\ensuremath{#2}}{}%
+	\ifthenelse{#1 = 1}
+		{\ensuremath{(#2)}}{}%
+	\ifthenelse{#1 = 2}
+		{\ensuremath{\big(#2\big)}}{}%
+	\ifthenelse{#1 = 3}
+		{\ensuremath{\Big(#2\Big)}}{}%
+	\ifthenelse{#1 = 4}
+		{\ensuremath{\bigg(#2\bigg)}}{}%
+	\ifthenelse{#1 = 5}
+		{\ensuremath{\Bigg(#2\Bigg)}}{}%
+	\ifthenelse{#1 = 9}
+		{\ensuremath{\left(#2\right)}}{}%
+}
+
+% Des parenthèses autour d'une fraction (très très pratique !).
+% Exemple: $ \paf{1}{2} $
+\newcommand{\paf}[2]{\ensuremath{\left(\f{#1}{#2}\right)}}
+
+% Et l'analogue de \tf pour les parenthèses autour d'une fraction:
+\newcommand{\patf}[2]{\ensuremath{\left({#1}/{#2}\right)}}
+
+% On peut aussi vouloir des crochets de la bonne taille plutôt que des 
+% parenthèses (analogue de \pa: mêmes recommandations).
+% Exemple: $\crochets{ \f{1}{2} x \ln x }$
+%\newcommand{\crochets}[1]{\ensuremath{\left[#1\right]}}
+%\newcommand{\pac}[1]{\ensuremath{\crochets{#1}}}		% Synonyme
+\newcommand{\crochets}[2][9]{%
+	\ifthenelse{#1 = 0}
+		{\ensuremath{#2}}{}%
+	\ifthenelse{#1 = 1}
+		{\ensuremath{[#2]}}{}%
+	\ifthenelse{#1 = 2}
+		{\ensuremath{\big[#2\big]}}{}%
+	\ifthenelse{#1 = 3}
+		{\ensuremath{\Big[#2\Big]}}{}%
+	\ifthenelse{#1 = 4}
+		{\ensuremath{\bigg[#2\bigg]}}{}%
+	\ifthenelse{#1 = 5}
+		{\ensuremath{\Bigg[#2\Bigg]}}{}%
+	\ifthenelse{#1 = 9}
+		{\ensuremath{\left[#2\right]}}{}%
+}
+\newcommand{\pac}[2][9]{\ensuremath{\crochets[#1]{#2}}}		% Synonyme
+
+% Ou pourquoi pas des accolades (analogue de \pa: mêmes recommandations).
+%\newcommand{\accolades}[1]{\ensuremath{\left\{#1\right\}}}
+%\newcommand{\paa}[1]{\ensuremath{\accolades{#1}}}		% Synonyme
+\newcommand{\accolades}[2][9]{%
+	\ifthenelse{#1 = 0}
+		{\ensuremath{#2}}{}%
+	\ifthenelse{#1 = 1}
+		{\ensuremath{\{#2\}}}{}%
+	\ifthenelse{#1 = 2}
+		{\ensuremath{\big\{#2\big\}}}{}%
+	\ifthenelse{#1 = 3}
+		{\ensuremath{\Big\{#2\Big\}}}{}%
+	\ifthenelse{#1 = 4}
+		{\ensuremath{\bigg\{#2\bigg\}}}{}%
+	\ifthenelse{#1 = 5}
+		{\ensuremath{\Bigg\{#2\Bigg\}}}{}%
+	\ifthenelse{#1 = 9}
+		{\ensuremath{\left\{#2\right\}}}{}%
+}
+\newcommand{\paa}[2][9]{\ensuremath{\accolades[#1]{#2}}}		% Synonyme
+
+% Ou encore des barres pour les valeurs absolues (analogue de \pa: mêmes
+% recommandations).
+%\newcommand{\abs}[1]{\ensuremath{\left|#1\right|}}
+\newcommand{\abs}[2][9]{%
+	\ifthenelse{#1 = 0}
+		{\ensuremath{#2}}{}%
+	\ifthenelse{#1 = 1}
+		{\ensuremath{|#2|}}{}%
+	\ifthenelse{#1 = 2}
+		{\ensuremath{\big|#2\big|}}{}%
+	\ifthenelse{#1 = 3}
+		{\ensuremath{\Big|#2\Big|}}{}%
+	\ifthenelse{#1 = 4}
+		{\ensuremath{\bigg|#2\bigg|}}{}%
+	\ifthenelse{#1 = 5}
+		{\ensuremath{\Bigg|#2\Bigg|}}{}%
+	\ifthenelse{#1 = 9}
+		{\ensuremath{\left|#2\right|}}{}%
+}
+
+% Pour virer des parenthèses quand on corrige un fichier.
+\newcommand{\nopa}[1]{\ensuremath{#1}}
+
+% Pour transformer \pa en parenthèses simples.
+\newcommand{\cpa}[1]{\ensuremath{(#1)}}
+
+%!!!!!!!!!!!!!!!                                        !!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!   Quelques conventions et raccourcis   !!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!                                        !!!!!!!!!!!!!!!
+
+% Les constantes.
+\newcommand{\cte}{\ensuremath{C^{\mbox{\scriptsize{te}}}}}
+\newcommand{\Cte}{\cte}						% Synonyme
+
+% La force électromotrice.
+\newcommand{\fem}{f.é.m.\xspace}
+
+% L'amplificateur opérationnel.
+\newcommand{\AO}{AO\xspace}
+
+% La fonction indicatrice.
+\newcommand{\indicatrice}{\ensuremath{\mathds{1}}}
+
+% Les espaces de séparation pour les milliers.
+% Exemple:
+% $\nombre{1234567}$ a le même effet que $1\,234\,567$.
+\makeatletter
+\def\f@thousandsep{\ifmmode\mskip3mu\else\penalty\@M\kern.3em\fi}
+\makeatother
+\newcommand{\nb}[1]{\nombre{#1}}
+
+% « Grand O » et « petit o » sont dans un bateau.
+% 
+% Exemples:
+%       En 0, $\sin x = x + \petito(x)$.
+% 
+%       $f(x) = x + \petito[x\to0](x)$.
+%
+% La première forme est celle recommandée, mais lorsque le contexte est
+% flou, on peut utiliser l'argument optionnel pour préciser comment il faut
+% entendre le « o ».
+%
+% Dans tous les cas, n'écrivez pas « x \to 0 » sous un signe égal.
+
+%\newcommand{\petito}[1][]{\ensuremath{\underset{#1}{\text{o}}}}
+%\newcommand{\grando}[1][]{\ensuremath{\underset{#1}{\text{O}}}}
+
+\newcommand{\petito}[1][]{%
+    \ifthenelse{%
+        \equal{#1}{}%
+    }{%
+        \ensuremath{\text{o}}%
+    }{%
+        \ensuremath{\underset{#1}{\text{o}}}%
+    }%
+}
+
+\newcommand{\grando}[1][]{%
+    \ifthenelse{%
+        \equal{#1}{}%
+    }{%
+        \ensuremath{\text{O}}%
+    }{%
+        \ensuremath{\underset{#1}{\text{O}}}%
+    }%
+}
+
+% Les deux commandes suivantes sont obsolètes; elles ne sont laissées que pour
+% la compatibilité ascendante. Veuillez ne pas les utiliser.
+\newcommand{\pto}[1]{\ensuremath{\text{o}\left ( #1 \right )}}
+\newcommand{\gdo}[1]{\ensuremath{O\left ( #1 \right )}}
+
+% La probabilité d'un événement.
+% Exemple: $ \proba{X} $
+\newcommand{\proba}[1]{\ensuremath{\text{Pr}\left(#1\right)}}
+
+% Les chapeaux et les tildes doivent avoir une bonne taille pour être bien
+% visibles et éviter ainsi les confusions.
+\renewcommand{\hat}[1]{\ensuremath{\widehat{#1}}}
+\renewcommand{\tilde}[1]{\ensuremath{\widetilde{#1}}}
+
+% Dessiner un arrondi au-dessus d'un groupe de lettres, disons 'AB',
+% pour signifier que l'on considère un arc de cercle d'extrémités A et B.
+% Exemple: \arcdecercle{AB}
+
+\newlength{\longueurarcdecercle}
+\newcommand{\arcdecercle}[1]{\ensuremath{%
+    \settowidth{\longueurarcdecercle}{\ensuremath{#1}}%
+    \overset{%
+        \mbox{%
+                \resizebox{\longueurarcdecercle}{4pt}{%
+                        \rotatebox{90}{\ensuremath{\hskip-1pt)}}%
+                }%
+        }%
+    }{#1}%
+}}
+
+% Plus et moins l'infini.
+%
+% Lorsque l'on écrit $+\infty$, le plus est trop gros. On fait la même 
+% remarque avec $-\infty$. Pour contourner ce problème, vous pouvez utiliser
+% des macros spécifiques à ces cas-là.
+%
+% Exemple: $ \sqrt{n} \tvn \pinf $
+%
+% Attention, n'utilisez jamais \plus et \moins dans vos corrigés.
+% Ces macros n'existent que pour définir \pinf et \minf et quelques autres
+% bidouilles comme \Rplus.
+% Ne les utilisez pas à la place de + et - dans les opérations courantes !
+
+\newcommand{\plus}{\mbox{\protect\raisebox{.2mm}{\tiny{\ensuremath{+}}}}}
+\newcommand{\moins}{\mbox{\protect\raisebox{.2mm}{\tiny{\ensuremath{-}}}}}
+\newcommand{\pinf}{\plus\ensuremath{\infty}}
+\newcommand{\minf}{\moins\ensuremath{\infty}}
+
+% Le « plus ou moins » (\pm) de LaTeX est vraiment trop laid.
+\newlength{\pmlength} 
+\settowidth{\pmlength}{{\scriptsize$+$}}
+\newlength{\pmsmalllength}
+\settowidth{\pmsmalllength}{{\tiny$+$}}
+%\renewcommand{\pm}{%
+%        \mathop{\raisebox{0.8mm}{{\scriptsize\ensuremath{+}}}%
+%        \hskip-\pmlength%
+%        \raisebox{-0.4mm}{{\scriptsize\ensuremath{-}}}}%
+%}
+\renewcommand{\pm}{%
+    \mathchoice{%
+            \mathop{\raisebox{0.528ex}{{\scriptsize\ensuremath{+}}}%
+            \hskip-\pmlength%
+            \raisebox{-0.264ex}{{\scriptsize\ensuremath{-}}}}%
+    }{%
+            \mathop{\raisebox{0.528ex}{{\scriptsize\ensuremath{+}}}%
+            \hskip-\pmlength%
+            \raisebox{-0.264ex}{{\scriptsize\ensuremath{-}}}}%
+    }{%
+            \mathop{\raisebox{0.528ex}{{\tiny\ensuremath{+}}}%
+            \hskip-\pmsmalllength\hskip-0.035ex%
+            \raisebox{-0.14ex}{{\tiny\ensuremath{-}}}}%
+    }{%
+            \mathop{\raisebox{0.528ex}{{\tiny\ensuremath{+}}}%
+            \hskip-\pmsmalllength\hskip-0.035ex%
+            \raisebox{-0.14ex}{{\tiny\ensuremath{-}}}}%
+    }
+}
+
+% La commande \pm précédente ne passe pas bien en \mathgras... En voici
+% une version spécialement prévue dans ce cas.
+\newlength{\pmgraslength} 
+\settowidth{\pmgraslength}{{\scriptsize\ensuremath{\mathgras{$+$}}}}
+\newlength{\pmgrassmalllength}
+\settowidth{\pmgrassmalllength}{{\tiny\ensuremath{\mathgras{$+$}}}}
+%\newcommand{\pmgras}{%
+%        \mathop{\raisebox{0.8mm}{{\scriptsize\ensuremath{\mathgras{+}}}}%
+%        \hskip-\pmgraslength%
+%		\hskip-0.9pt%
+%        \raisebox{-0.6mm}{{\scriptsize\ensuremath{\mathgras{-}}}}}%
+%}
+\newcommand{\pmgras}{%
+    \mathchoice{%
+        \mathop{\raisebox{0.528ex}{{\scriptsize\ensuremath{\mathgras{+}}}}%
+            \hskip-\pmgraslength%
+            \hskip-0.9pt%
+        \raisebox{-0.396ex}{{\scriptsize\ensuremath{\mathgras{-}}}}}%
+    }{%
+        \mathop{\raisebox{0.528ex}{{\scriptsize\ensuremath{\mathgras{+}}}}%
+            \hskip-\pmgraslength%
+            \hskip-0.9pt%
+        \raisebox{-0.396ex}{{\scriptsize\ensuremath{\mathgras{-}}}}}%
+    }{%
+        \mathop{\raisebox{0.528ex}{{\tiny\ensuremath{\mathgras{+}}}}%
+            \hskip-\pmgrassmalllength%
+            \hskip-0.739pt%
+        \raisebox{-0.22ex}{{\tiny\ensuremath{\mathgras{-}}}}}%
+    }{%
+        \mathop{\raisebox{0.528ex}{{\tiny\ensuremath{\mathgras{+}}}}%
+            \hskip-\pmgrassmalllength%
+            \hskip-0.739pt%
+        \raisebox{-0.22ex}{{\tiny\ensuremath{\mathgras{-}}}}}%
+    }
+}
+
+
+% Idéalement, le « e » de l'exponentielle et le « i » des complexes devraient
+% être composés en romain (« droit »). Ceci est facultatif dans les Annales,
+% parce que la composition est rendue moins intuitive.
+% Toutefois, pour simplifier la composition des auteurs qui souhaitent suivre
+% cette louable convention, les commandes suivantes peuvent être utiles.
+%
+% Exemples: 	La fonction $f \colon x \mapsto \ex{x+1}$ etc.
+%		La «racine carrée» de $-1$ est notée \ir.
+%		La racine troisième de l'unité est notée $\jr$.
+%		$1 + \ir = \sqrt{2} \: \exi{\pi / 4}$.
+
+\newcommand{\ir}{\ensuremath{\mathrm{i}}\xspace}	% « i romain »
+\newcommand{\jr}{\ensuremath{\mathrm{j}}\xspace}	% « j romain »
+\newcommand{\ex}[1]{\ensuremath{\mathrm{e}^{\,#1}}\xspace}
+\newcommand{\exi}[1]{\ensuremath{\mathrm{e}^{\,\mathrm{i}\,#1}}\xspace}
+\newcommand{\exmi}[1]{\ensuremath{\mathrm{e}^{\,-\mathrm{i}\,#1}}\xspace}
+
+% Le principe de récurrence est un outil puissant pour résoudre de nombreux
+% problèmes. Parfois, il suffit de l'invoquer pour conclure: « On en déduit,
+% par une récurrence immédiate, que tous les chats sont gris. » 
+% Toutefois, dès lors que la récurrence doit être explicitement déroulée, il
+% faut mettre ses étapes en valeur, avec {itemize} et les commandes 
+% ci-dessous.
+%
+% Exemple:
+%	Montrons que la propriété:
+%
+%	\centers{$
+%		\PP(n): \quad u_n \geq 0
+%		$}
+%
+%	\marge est vraie pour tout $n \geq 0$.
+%
+%	\begin{itemize}
+%
+%	\item $\recz$ est vraie par hypothèse.
+%	\item $\rec{n}{n+1}$: blabla
+%	\item \leftcenters{\underline{Conclusion}:}{$
+%		\forall n \geq 0    \qquad    u_n \geq 0
+%		$}
+%
+%	\end{itemize}
+
+\newcommand{\PP}{\ensuremath{\mathscrchoice{P}}}
+\newcommand{\QQ}{\ensuremath{\mathscrchoice{Q}}}
+	% Quand \PP est déjà utilisé, ou pour une famille de polynômes...
+\newcommand{\rec}[2]{\underline{\ensuremath{\mathscrchoice{P}(#1) \imply%
+        \mathscrchoice{P}(#2)}}}
+	% $\rec{n}{n+1}$ <==> \underline{$\PP{n}\imply\PP{n+1}$}
+\newcommand{\recz}[1][0]{\underline{\ensuremath{\mathscrchoice{P}(#1)}}\xspace}
+	% L'initialisation de la récurrence.
+	% On écrit $\recz[2]$ pour partir de $n=2$.
+	% Si on ne précise pas d'argument optionnel, la valeur 0 est utilisée.
+
+% Donner la bonne tête aux symboles courants: sacrés amerloques !
+\renewcommand{\leq}{\ensuremath{\leqslant}}
+\renewcommand{\geq}{\ensuremath{\geqslant}}
+\renewcommand{\le}{\ensuremath{\leq}}				% Synonyme
+\renewcommand{\ge}{\ensuremath{\geq}}				% Synonyme
+\renewcommand{\epsilon}{\ensuremath{\varepsilon}}
+\newcommand{\eps}{\epsilon}
+\renewcommand{\setminus}{\smallsetminus}	% $\R \setminus \Q$
+%\newcommand{\bs}{\ensuremath{\backslash}}	% Quand \setminus est trop petit
+\newcommand{\bs}{\texttt{\symbol{92}}}
+
+
+% \phi et \varphi.
+% Neuf fois sur dix, c'est \varphi que l'on veut dessiner, ce qui mérite un
+% raccourci.
+\newcommand{\ph}{\ensuremath{\varphi}}
+
+% Une moyenne bien présentée.
+% Exemple: $ \moyenne{ \vectE } $
+%\newcommand{\moyenne}[1]{\ensuremath{\left\langle#1\right\rangle}}
+\newcommand{\moyenne}[2][9]{%
+	\ifthenelse{#1 = 0}
+		{\ensuremath{#2}}{}%
+	\ifthenelse{#1 = 1}
+		{\ensuremath{\langle#2\rangle}}{}%
+	\ifthenelse{#1 = 2}
+		{\ensuremath{\big\langle#2\big\rangle}}{}%
+	\ifthenelse{#1 = 3}
+		{\ensuremath{\Big\langle#2\Big\rangle}}{}%
+	\ifthenelse{#1 = 4}
+		{\ensuremath{\bigg\langle#2\bigg\rangle}}{}%
+	\ifthenelse{#1 = 5}
+		{\ensuremath{\Bigg\langle#2\Bigg\rangle}}{}%
+	\ifthenelse{#1 = 9}
+		{\ensuremath{\left\langle#2\right\rangle}}{}%
+}
+
+% Pour placer une conjonction entre deux termes dans une formule centrée.
+\newcommand{\qetq}{\quad\text{et}\quad\null}
+\newcommand{\qqetqq}{\qquad\text{et}\qquad\null}
+\newcommand{\qcarq}{\quad\text{car}\quad\null}
+\newcommand{\qqcarqq}{\qquad\text{car}\qquad\null}
+\newcommand{\qavecq}{\quad\text{avec}\quad\null}
+\newcommand{\qqavecqq}{\qquad\text{avec}\qquad\null}
+
+% Lorsque l'on définit une fonction, on a besoin de:
+%	* son nom
+%	* l'ensemble de départ
+%	* l'ensemble d'arrivée
+%	* le nom de la variable
+%	* l'expression de la fonction
+% On veut alors obtenir un tableau dont la première ligne concerne les
+% ensembles, la deuxième les transformations de la variable, une accolade
+% à gauche et le nom de la variable devant. C'est ce que fait \fonction.
+%
+% Exemple: $ \fonction{f}{ \R }{ \Z }{ x }{ \partieentiere{x} } $
+
+\newcommand{\fonction}[5]{%
+        \ensuremath{#1\colon
+        \left\{\hskip -1.5 mm
+        \begin{array}{c@{\ }c@{\ }l}
+        \medskip #2 & \longrightarrow & #3 \\
+        #4 & \longmapsto & #5 \\
+        \end{array}
+        \right .
+        }}
+
+% Pour dessiner la restriction d'une fonction à un ensemble, la coutume est
+% de placer le nom de la fonction, une barre verticale et en indice, 
+% l'ensemble dans lequel on fait vivre la restriction. C'est l'objet de cette 
+% commande.
+%
+% Exemple: $ \rest{f}{ \Z } $
+
+\newlength{\restsubwidth}
+\newlength{\restsubheight}
+\newlength{\restsubmoreheight}
+\setlength{\restsubmoreheight}{4 pt}
+\newcommand{\rest}[2]{%
+        \settowidth{\restsubwidth}{\ensuremath{#2}}
+        \settoheight{\restsubheight}{\ensuremath{{}_{#2}}}
+        \ensuremath{{#1\hskip 0.5 pt}_{\vrule\kern2pt\parbox[b][%
+        \the\restsubheight +
+                \the\restsubmoreheight][b]{\the\restsubwidth}{%
+                        \ensuremath{{}_{#2}}}}}
+        }
+
+% Les combinaisons peuvent être notées à la française ou à l'anglaise.
+% Le mérite de cette dernière apparaît lorsque les arguments sont trop
+% grands pour une simple lettre C. 
+%
+% Rappel: à la française, on indique le 'n' (nombre total d'éléments) en bas 
+% et le 'p' (nombre d'éléments à choisir) en haut. À l'anglaise, c'est 
+% l'inverse.
+%
+% Exemple: $ \Comb{n}{p} $	À la française
+%	   $ \comb{n}{p} $	À l'anglaise
+
+\newcommand{\Comb}[2]{\ensuremath{C_{#1}^{#2}}}
+\newcommand{\comb}[2]{\ensuremath{\begin{pmatrix}#1\\#2\\\end{pmatrix}}}
+
+% La partie entière peut être écrite à l'américaine plutôt qu'avec 
+% l'énigmatique fonction 'E'. C'est efficace...
+\newcommand{\partieentiere}[1]{\ensuremath{\left\lfloor#1\right\rfloor}}
+\newcommand{\partieentieresup}[1]{\ensuremath{\left\lceil#1\right\rceil}}
+
+%!!!!!!!!!!!!!!!!!                                    !!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!   Intégrales, sommes et produits   !!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!                                    !!!!!!!!!!!!!!!!!
+
+% À la main, on dessine toujours des intégrales ayant la même taille.
+% Dans l'édition française, c'est assez standard; ce sont les anglo-saxons
+% qui adaptent la taille de leurs intégrales au contexte (leurs intégrales
+% sont plus petites dans le texte). Pour avoir toujours une intégrale de 
+% taille standard, on dispose de la commande \Int, qui prend deux arguments:
+% ses bornes.
+%
+% Exemple: $ \Int{0}{\f \pi 2} \sin t \dt $
+%
+% Exemple: $ \Int{}{} \ln t \dt $
+%
+% Attention, il ne faut jamais utiliser \int dans les Annales.
+
+\newcommand{\Int}[2]{\ensuremath{\mathchoice%
+	{{\displaystyle\int_{#1}^{#2}}}
+	{{\displaystyle\int_{#1}^{#2}}}
+	{\int_{#1}^{#2}}
+	{\int_{#1}^{#2}}
+	}}
+
+% Les éléments différentiels.
+%
+% Ils doivent être composés avec un 'd' droit. On dispose pour cela de la 
+% commande \dd.
+%
+% Exemple: $ \dd x $
+%
+% Cette commande convient parfaitement à une dérivée temporelle, par exemple.
+%
+% Exemple: $ \f{\dd f}{\dd t} $
+%
+% Dans les intégrales, il faut aussi laisser un peu d'espace avant l'élément
+% différentiel; les commandes suivantes (\dx, \dt, etc.) incluent cet espace.
+%
+% Exemple: $ \Int{0}{1} f(t) \dt $
+%
+% Attention toutefois, il ne faut pas les utiliser lorsque l'élément 
+% différentiel fait partie d'une fraction. En pareil cas on en revient à '\:'
+% pour l'espace et à \dd pour le 'd' droit.
+%
+% Exemple: $ \Int{0}{1} f(t) \: \f{\dd t}{2} $
+
+\newcommand{\dd}{\ensuremath{\mathrm{d}}}
+\newcommand{\dt}{\ensuremath{\:\dd t}}
+\newcommand{\dx}{\ensuremath{\:\dd x}}
+\newcommand{\dy}{\ensuremath{\:\dd y}}
+\newcommand{\dz}{\ensuremath{\:\dd z}}
+\newcommand{\du}{\ensuremath{\:\dd u}}
+\newcommand{\dv}{\ensuremath{\:\dd v}}
+\newcommand{\dr}{\ensuremath{\:\dd r}}
+\newcommand{\dS}{\ensuremath{\,\dd\!\vect{S}}}		% Élément de surface
+\newcommand{\dl}{\ensuremath{\,\dd\!\vect{\ell}}}	% Élément de longueur
+\newcommand{\dT}{\ensuremath{\:\dd T}}			% Températures
+\newcommand{\dtheta}{\ensuremath{\:\dd \theta}}
+\newcommand{\dphi}{\ensuremath{\:\dd \varphi}}
+\newcommand{\dtau}{\ensuremath{\:\dd \tau}}
+\newcommand{\dV}{\ensuremath{\:\dd V}}
+
+% Les sommes.
+%
+% De même que \Int doit être préférée à \int, \Sum doit être préférée à \sum.
+% Cette commande dessine un 'sigma' qui est presque toujours de la bonne
+% taille.
+% 
+% Exemple:  $ \Sum{k=1}{n} \f{1}{k} = \ln n + \gamma + \petito(1) $
+%
+% Pour les séries (« la série 'sigma' u_n converge »), dans lesquelles on ne
+% précise pas les bornes, l'utilisation de \Sum avec des arguments vides
+% (c'est-à-dire \Sum{}{}) ne donne pas un bon rendu en mode texte car cette
+% commande laisse inévitablement un espace vertical au-dessus et en dessous
+% d'elle. On préfèrera alors la commande \serie, qui est faite pour cela, et
+% pour cela uniquement.
+%
+% Exemple: La série $ \serie u_n $ converge.
+%
+% Enfin, bien que ce ne soit pas recommandé par H&K (car cela rend confus la
+% distinction entre une série et une somme partielle), vous pouvez être amené
+% à préciser l'indice de sommation dans la série; vous seriez alors tenté
+% d'écrire quelque chose comme $\Sum{k \geq 0}{} u_k$. L'ennui, c'est que,
+% comme précédemment, \Sum laissera au-dessus d'elle un espace indésirable.
+% Vous pouvez l'éliminer grâce à la commande \smash.
+%
+% Exemple: La série $\smash[t]{ \Sum{k \geq 0}{} u_k }$ converge.
+%
+% Attention, la commande \serie doit être proscrite dès que vous souhaitez
+% utiliser un indice ou un exposant.
+
+\newcommand{\Sum}[2]{\ensuremath{\textstyle{\sum\limits_{#1}^{#2}}}}
+\newcommand{\serie}{\ensuremath{\smash{\Sum{}{}}}}
+
+\newcommand{\Sumt}[2]{\protect\Sumtproto{#1}{#2}}
+\newcommand{\Sumtproto}[2]{%
+        \ifthenelse{%
+                \equal{#1}{}
+        }{%
+                \ifthenelse{%
+                        \equal{#2}{}%
+                }{%
+                        \ensuremath{\sum}%
+                }{%
+                        \smash[b]{\ensuremath{\sum\limits_{#1}^{#2}}}%
+                }
+        }{%
+                \ensuremath{\sum\limits}_{#1}^{#2}%
+        }%
+}
+
+% Il y a quelques cas où l'on souhaite dessiner un symbole de sommation plus
+% grand que la normale, par exemple s'il est suivi d'une intégrale.
+%
+% Exemple: $ \SUM{k=1}{n}   \f{1}{k}   \Int{}{} f_n(t) \dt $
+
+\newcommand{\SUM}[2]{\ensuremath{{\displaystyle\sum\limits_{#1}^{#2}}}}
+
+% Dans la même veine que « \Sum vs \sum » et « \Int vs \int », on peut vouloir
+% écrire un produit autrement qu'avec \prod (commande prédéfinie), qui ne se
+% comporte pas comme on l'attend.
+%
+% Exemple: $ \Prod{k=1}{n} k = n\,! $
+
+\newcommand{\PI}[2]{\ensuremath{%
+	\mathop{\mbox{\Large\ensuremath{\Pi}}}\limits_{#1}^{#2}}}
+\newcommand{\Prod}[2]{\PI{#1}{#2}}			% Synonyme préférable
+
+% La commande précédente produit un symbole dont le bas est aligné sur la       
+% ligne de référence; or, on s'attend d'habitude à ce que les symboles          
+% mathématiques soient centrés sur cette ligne. Si c'est ce deuxième            
+% comportement qui est souhaité, c'est la commande suivante qu'il faut          
+% utiliser.                                                                     
+                                                                                
+\newcommand{\Produit}[2]{\ensuremath{\prod\limits_{#1}^{#2}}}
+
+%!!!!!!!!!!!!!!!!!!!!!                            !!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!   Limites et équivalents   !!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!                            !!!!!!!!!!!!!!!!!!!!!
+
+% Les limites.
+%
+% Pour indiquer qu'une variable tend vers une valeur, on peut utiliser \to,
+% comme dans $ x \to x_0$. Pour indiquer ensuite que f(x) tend vers \ell 
+% lorsque x tend vers x_0, on a envie de représenter une longue flèche portant
+% en dessous la mention $x \to x_0$.
+%
+% Exemple: $ f(x)  \tv{x \to x_0}  \ell $
+%
+% Lorsque la variable est $n$ est tend vers l'infini, on a un raccourci.
+%
+% Exemples: 	$ u_n \tvn \ell $
+%		$ u_k \tvn[k] \ell $
+
+\newcommand{\tv}[1]{\ensuremath{\xrightarrow[#1]{}}}
+\newcommand{\tvn}[1][n]{\ensuremath{\tv{#1 \to \infty}}}
+
+% Indiquer une limite avec « lim » pose un problème car, par défaut, la 
+% commande prédéfinie \lim ne met pas bien en dessous ce que l'on aimerait
+% qui soit en dessous. On utilise plutôt \limt.
+%
+% Exemple: $ \limt_{x \to 0} \f{\sin x}{x} = 1 $
+\newcommand{\limt}{\ensuremath{\lim\limits}}
+
+% De même, on veut pouvoir, au besoin préciser quelque chose comme $x \to 0$
+% en dessous du symbole « équivalent ».
+% Exemple: $ \f{\sin x}{x} \Sim_{x \to 0} 1 $
+\newcommand{\Sim}{\ensuremath{\mathop{\sim}\limits}}
+
+%!!!!!!!!!!!!!!!!!!!!!                            !!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!   Ensembles et relations   !!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!                            !!!!!!!!!!!!!!!!!!!!!
+
+% Pour l'intersection de deux ensembles, LaTeX fournit la commande \cap, comme 
+% dans $A \cap B$. Pour dessiner l'intersection d'une famille d'ensembles, on
+% a envie de placer un indice et un exposant; c'est ce que permettent les 
+% commandes \inter et \Inter.
+%
+% Exemple: $ \inter{k=1}{n} A_k $
+% 	   $ \Inter{k=1}{n} A_k $
+%
+% Le premier s'utilise plutôt dans le texte et le deuxième plutôt dans les
+% formules centrées, mais cela dépend aussi du contexte, c'est-à-dire des
+% ensembles considérés. \inter peut très bien être utilisé dans une équation
+% centrée.
+%
+% Les remarques et exemples précédents s'appliquent directement à \union et
+% \Union, qui généralisent la commande prédéfinie \cup (comme dans $A \cup B$).
+
+\newcommand{\inter}[2]{\ensuremath{\bigcap\limits_{#1}^{#2}}}
+\newcommand{\Inter}[2]{\ensuremath{\displaystyle\bigcap_{#1}^{#2}}}
+\newcommand{\union}[2]{\ensuremath{\bigcup\limits_{#1}^{#2}}}
+\newcommand{\Union}[2]{\ensuremath{\displaystyle\bigcup_{#1}^{#2}}}
+
+% Le complémentaire d'un ensemble (sans préciser l'ensemble de référence)
+% peut être noté par \compl.
+% Exemple: $ \compl{A} $
+\newcommand{\compl}[1]{\ensuremath{\sideset{^{\text{c}}}{}%
+        {\mathop{#1}\nolimits}}}
+
+% Quand on écrit un ensemble en extension, il faut préciser le domaine 
+% d'existence de la variable, en séparant cette précision de ce qui précède
+% au moyen d'une barre verticale. Il est alors bon de laisser un espace avant
+% et après cette barre: c'est ce que fait la commande \|.
+%
+% Exemple: $ \{ x\in\R    \|    \sin x = 0}    =    \pi\Z $
+%
+% Lorsque la hauteur de la barre doit s'adapter à des accolades de grande 
+% taille, on ne peut pas utiliser \|. Il faut alors procéder à la main.
+%
+% Exemple: 	$\left\{ 
+%			\left. \Sum{k=1}{n} (-1)^k/k \ \right|\ 
+%		        n \in \Nstar 
+%		\right\}$ 
+%
+% ce qui peut également s'écrire:
+%
+%		$\left\{ \Sum{k=1}{n} (-1)^k/k 	\ \right|\
+% 		n \in \Nstar \left.\vphantom{\Sum{k=1}{n}} \right\}$
+%
+% On peut aussi utiliser directement le constructeur \Big pour imposer la
+% taille des délimiteurs.
+%
+% Exemple: $\Big\{ \Sum{k=1}{n} (-1)^k/k   \ \Big|\    n \in \Nstar   \Big\} $
+
+\renewcommand{\|}{\ensuremath{\:|\:}}   
+
+% Les mathématiques utilisent beaucoup les listes, en particulier en algèbre
+% linéaire, par exemple pour décrire une base. Composer ces listes peut être
+% automatisé, puisque l'on n'a en général besoin que du nom de la famille 
+% ('e'), et éventuellement des indices de début et de fin, comme dans
+% (e_1 , ... , e_n).
+%
+% Exemples: 	
+%		\liste{x}	-> (x_1,x_2,...,x_n)
+%		\liste[p]{x}	-> (x_1,x_2,...,x_p)
+%		\liste*{x}	-> (x_0,x_1,...,x_n)
+%		\liste*[p]{x}	-> (x_0,x_1,...,x_p)
+%
+% Remarque: d'un point de vue sémantique, il serait plus logique d'utiliser
+% la forme étoilée pour les listes qui commencent à 1, mais comme ce sont
+% ces dernières qui sont les plus fréquentes, on leur réserve la commande
+% la plus simple.
+
+\makeatletter
+\newif\if@ListeStar
+\global\@ListeStartrue
+
+\newcommand{\liste}{%
+	\@ifstar{\global\@ListeStartrue\@liste}%
+		{\global\@ListeStarfalse\@liste}%
+}
+
+\newcommand{\@liste}[2][n]{%
+	\if@ListeStar%
+		\left({#2}_0,{#2}_1,\ldots,{#2}_{#1}\right)%
+	\else%
+		\left({#2}_1,{#2}_2,\ldots,{#2}_{#1}\right)%
+	\fi\@ListeStarfalse%
+}
+\makeatother
+
+% Les commandes suivantes ne sont gardées que pour la compatibilité
+% ascendante. Elles sont néanmoins fonctionnelles, mais n'acceptent pas
+% de forme étoilée.
+\newcommand{\xlist}[2]{\ensuremath{\left({#1}_1,\ldots,{#1}_{#2}\right)}}
+\newcommand{\xliste}[2]{\xlist{#1}{#2}}				% Synonyme
+\newcommand{\nlist}[1]{\xlist{#1}{n}}
+\newcommand{\mlist}[1]{\xlist{#1}{m}}
+\newcommand{\plist}[1]{\xlist{#1}{p}}
+\newcommand{\rlist}[1]{\xlist{#1}{r}}
+\newcommand{\nliste}[1]{\nlist{#1}}				% Synonyme
+\newcommand{\mliste}[1]{\mlist{#1}}				% Synonyme
+\newcommand{\pliste}[1]{\plist{#1}}				% Synonyme
+\newcommand{\rliste}[1]{\rlist{#1}}				% Synonyme
+
+% Les deux grandes manières utilisées en prépa pour noter les suites sont de
+% la forme $(u_n)$ et $(u_n)_{n\in\N}$. La première (sans les indices) est 
+% généralement préférable, tant que le contexte permet de lever toute
+% ambiguïté sur ce qui serait en indice dans la notation complète.
+% Toutefois, il est parfois utile de préciser les indices, par exemple dans
+% les résultats encadrés. On pourra alors soit composer les indices
+% « à la main », soit avec la commande \suite.
+%
+% Exemples:	\suite{u}	-> (u_n)_{n\in\N}
+%		\suite*{u}	-> (u_n)_{n\in\N^*}
+%		\suite[k]{u}	-> (u_k)_{k\in\N}
+%		\suite*[k]{u}	-> (u_k)_{k\in\N^*}
+
+\makeatletter
+\newif\if@SuiteStar
+\global\@SuiteStartrue
+
+\newcommand{\suite}{%
+	\@ifstar{\global\@SuiteStartrue\@suite}%
+		{\global\@SuiteStarfalse\@suite}%
+}
+
+\newcommand{\@suite}[2][n]{%
+	\if@SuiteStar%
+		\left(#2_{#1}\right)_{#1\in\N^*}%
+	\else%
+		\left(#2_{#1}\right)_{#1\in\N}%
+	\fi\@SuiteStarfalse%
+}
+\makeatother
+
+
+%% Quelques ensembles classiques.
+
+% On n'utilise pas cette commande, elle pose problème avec le \xspace: \N*
+% renvoie N* et non N^*.
+
+% La commande \mathBB est proposée par Paul; elle est construite sur la base
+% de la commande usuelle \mathbb, mais pour obtenir la version étoilée 
+% (« R étoile »), il suffit de placer une étoile après le symbole, sans
+% chapeau. 
+% Exemple:	\N*	est équivalent à \mathbb{N}^{*}
+
+\makeatletter
+\newif\if@laststared
+\global\@laststaredtrue
+\newcommand{\mathBB}[1]{%
+        \@ifstar%
+        {\global\@laststaredtrue\m@thBB{#1}}%
+        {\global\@laststaredfalse\m@thBB{#1}}% 
+}
+\newcommand{\m@thBB}[1]{%
+	\if@laststared{\ensuremath{%
+		{\ifgras\pmb{\mathbb{#1}^{*}}\else\mathbb{#1}^{*}\fi}}\xspace}%
+	\else{\ensuremath{%
+		{\ifgras\pmb{\mathbb{#1}}\else\mathbb{#1}\fi}}\xspace}% 
+	\fi%
+	\@laststaredfalse% 
+}
+\makeatother
+
+\renewcommand{\emptyset}{\ensuremath{\varnothing}\xspace}	% L'ensemble vide
+
+\makeatletter
+%\newcommand{\N}{\ensuremath{\mathBB{N}}\xspace}        % Entiers
+\newcommand{\N}{%
+    \@ifnextchar*%
+        {\ensuremath{\mathBB{N}}}%
+        {\ensuremath{\mathbb{N}}\xspace}
+}
+%\newcommand{\Z}{\ensuremath{\mathBB{Z}}\xspace}        % Entiers relatifs
+\newcommand{\Z}{%
+    \@ifnextchar*%
+        {\ensuremath{\mathBB{Z}}}%
+        {\ensuremath{\mathbb{Z}}\xspace}
+}
+%\newcommand{\Q}{\ensuremath{\mathBB{Q}}\xspace}        % Rationnels
+\newcommand{\Q}{%
+    \@ifnextchar*%
+        {\ensuremath{\mathBB{Q}}}%
+        {\ensuremath{\mathbb{Q}}\xspace}
+}
+%\newcommand{\R}{\ensuremath{\mathBB{R}}\xspace}        % Réels
+\newcommand{\R}{%
+    \@ifnextchar*%
+        {\ensuremath{\mathBB{R}}}%
+        {\ensuremath{\mathbb{R}}\xspace}
+}
+%\newcommand{\C}{\ensuremath{\mathBB{C}}\xspace}        % Complexes
+\newcommand{\C}{%
+    \@ifnextchar*%
+        {\ensuremath{\mathBB{C}}}%
+        {\ensuremath{\mathbb{C}}\xspace}
+}
+\newcommand{\Nstar}{\ensuremath{\N*}\xspace}
+\newcommand{\Zstar}{\ensuremath{\Z*}\xspace}
+\newcommand{\Zdeux}{\ensuremath{\Z^2}\xspace}
+\newcommand{\Ztrois}{\ensuremath{\Z^3}\xspace}
+\newcommand{\Qstar}{\ensuremath{\Q*}\xspace}
+\newcommand{\Rstar}{\ensuremath{\R*}\xspace}
+\newcommand{\Rdeux}{\ensuremath{\R^2}\xspace}
+\newcommand{\Rtrois}{\ensuremath{\R^3}\xspace}
+\newcommand{\Cstar}{\ensuremath{\C*}\xspace}
+\newcommand{\Cdeux}{\ensuremath{\C^2}\xspace}
+\newcommand{\Ctrois}{\ensuremath{\C^3}\xspace}
+\newcommand{\Rplus}{\ensuremath{\R_{\plus}}\xspace}
+\newcommand{\Rmoins}{\ensuremath{\R_{\moins}}\xspace}
+\newcommand{\Rplusstar}{\ensuremath{\Rplus^*}\xspace}
+\newcommand{\Rmoinsstar}{\ensuremath{\Rmoins^*}\xspace}
+\newcommand{\Rplusetoile}{\ensuremath{\Rplusstar}\xspace}
+\newcommand{\Rmoinsetoile}{\ensuremath{\Rmoinsstar}\xspace}
+
+% Les nombres complexes de module 1 (Groupe Unimodulaire)
+%\newcommand{\GU}{\mathBB{U}}
+\newcommand{\GU}{%
+    \@ifnextchar*%
+        {\ensuremath{\mathBB{U}}}%
+        {\ensuremath{\mathbb{U}}\xspace}
+}
+
+% Un corps quelconque.
+%\newcommand{\K}{\mathBB{K}}
+\newcommand{\K}{%
+    \@ifnextchar*%
+        {\ensuremath{\mathBB{K}}}%
+        {\ensuremath{\mathbb{K}}\xspace}
+}
+\newcommand{\corps}{\K}                 % Synonyme
+
+% Les anneaux cycliques.
+\newcommand{\ZZ}[1][\ensuremath{n}]{\ensuremath{\mathBB{Z}/#1\mathBB{Z}}}
+
+    % \ZZ[n] --> Z/nZ
+    % \ZZ[2] --> Z/2Z
+    % \ZZ    --> Z/nZ
+\newcommand{\zpz}{\ensuremath{\ZZ[p]}}
+\newcommand{\znz}{\ensuremath{\ZZ[n]}}
+\newcommand{\zpzstar}{\ensuremath{\zpz^*}}
+
+% Les anneaux de polynômes.
+% Exemple: $ P \in \CX    \implique    P \in \RX $
+\newcommand{\RX}{\ensuremath{\mathBB{R}[X]}}
+\newcommand{\CX}{\ensuremath{\mathBB{C}[X]}}
+\newcommand{\zpzx}{\ensuremath{\zpz[X]}}
+
+% Le groupe symétrique.
+%\newcommand{\sym}{\ensuremath{\mathBB{S}}}         % Au choix
+\newcommand{\sym}{%
+    \@ifnextchar*%
+        {\ensuremath{\mathBB{S}}}%
+        {\ensuremath{\mathbb{S}}\xspace}
+}
+\newcommand{\GS}{\ensuremath{\mathfrak{S}}}         % Au choix
+\newcommand{\SG}{\ensuremath{\mathfrak{S}}}         % Synonyme
+
+% Une notation affreuse parfois rencontrée pour l'ensemble des nombres
+% premiers.
+%\renewcommand{\P}{\ensuremath{\mathBB{P}}}
+\renewcommand{\P}{%
+    \@ifnextchar*%
+        {\ensuremath{\mathBB{P}}}%
+        {\ensuremath{\mathbb{P}}\xspace}
+}
+\makeatother
+
+% L'anneau des matrices.
+% Exemple: $ A \in \M_n(\R) $
+\newcommand{\M}{\ensuremath{\mathscrchoice{M}}}
+
+%% Des symboles d'ensemble avec des lettres rondes.
+
+\DeclareSymbolFont{rsfs}{U}{rsfs}{m}{n}
+\DeclareSymbolFontAlphabet{\tmpmathscr}{rsfs}
+\newcommand{\mathscrchoice}[1]{%
+        \ifgras\pmb{\tmpmathscr{#1}}\else\tmpmathscr{#1}\fi}
+
+\newcommand{\aire}{\ensuremath{\mathcal{A}}\xspace}
+\newcommand{\alphabet}{\ensuremath{\mathcal{A}}\xspace}
+\newcommand{\arbre}{\ensuremath{\mathcal{A}}\xspace}
+\newcommand{\base}{\ensuremath{\mathscrchoice{B}}\xspace}
+\newcommand{\courbe}{\ensuremath{\mathscrchoice{C}}\xspace}
+\newcommand{\cercle}{\ensuremath{\mathscrchoice{C}}\xspace}
+\newcommand{\Cun}{\ensuremath{\mathscrchoice{C}^1}\xspace}	% $f$ est de classe \Cun
+\newcommand{\Cinfini}{\ensuremath{\mathscrchoice{C}^{\infty}}\xspace}
+\newcommand{\classe}{\ensuremath{\mathscrchoice{C}}\xspace}	% $f$ est de classe $\classe^4$
+\newcommand{\courbef}{\ensuremath{\mathscrchoice{C}_f}\xspace} % La courbe représentative
+\newcommand{\domaine}{\ensuremath{\mathscrchoice{D}}\xspace}
+\newcommand{\droite}{\ensuremath{\mathscrchoice{D}}\xspace}
+\newcommand{\Def}{\ensuremath{\mathscrchoice{D}}\xspace}	% \def est réservé par TeX
+\newcommand{\deff}{\ensuremath{\mathscrchoice{D}_f}\xspace}	% $ \deff = \intoo{0}{1} $
+\newcommand{\ens}{\ensuremath{\mathscrchoice{E}}\xspace}	% Un ensemble
+\newcommand{\G}{\ensuremath{\mathscrchoice{G}}\xspace}	% La constante de gravitation
+\newcommand{\Lin}{\ensuremath{\mathscrchoice{L}}\xspace}	% $ u \in \Lin(E,F) $
+\newcommand{\mixte}{\ensuremath{\mathscrchoice{M}}\xspace}	% Le produit mixte
+\newcommand{\plan}{\ensuremath{\mathscrchoice{P}}\xspace}
+\newcommand{\II}{\ensuremath{\mathscrchoice{I}}\xspace}	% Pour les idéaux
+\newcommand{\solset}{\ensuremath{\mathscrchoice{S}}\xspace}	% Ensemble des solutions
+\newcommand{\volume}{\ensuremath{\mathscrchoice{V}}\xspace}  % Volumes
+
+% Des droites parallèles.
+% Exemple: $\droite_1 \parallele \droite_2$
+\newcommand{\parallele}{{\ensuremath{/ \hskip -1mm /}}}
+\renewcommand{\parallel}{\parallele}
+
+% Les intervalles.
+%
+% Bien composer un intervalle n'est pas facile: il faut adapter la taille des
+% crochets et bien espacer le délimiteur central, qui doit être un 
+% point-virgule. On dispose de commandes qui prennent tout cela en charge.
+% On précise si les intervalles sont Ouverts ou Fermés à gauche et à droite,
+% puis les valeurs des bornes.
+%
+% Exemple:	\intff{0}{1}	<==>	[0;1]
+% 		\intof{0}{1}	<==>	]0;1]
+% 		\intfo{0}{1}	<==>	[0;1[
+% 		\intoo{0}{1}	<==>	]0;1[
+%
+% Si le membre de gauche (resp. de droite) est omis, il est remplacé par
+% -\infty (resp. +\infty).
+%
+% Pour les intervalles d'entiers, on peut ajouter une barre verticale dans les
+% crochets, et les bornes doivent alors être incluses dans l'ensemble. La 
+% taille de ces crochets modifiés ne dépend pas des arguments; en cas de 
+% besoin, utiliser la notation ensembliste.
+%
+% Exemple: $ \forall k \in \intn{0}{n-1}    \quad    |u_k| < 1 $
+
+\newcommand{\TestGauche}[1]{\ifthenelse{\equal{#1}{}}{\minf}{#1}}
+\newcommand{\TestDroite}[1]{\ifthenelse{\equal{#1}{}}{\pinf}{#1}}
+\newcommand{\intff}[2]{\ensuremath{\left [ \, \protect\TestGauche{#1} \,;%
+	\protect\TestDroite{#2} \, \right ] }}
+\newcommand{\intof}[2]{\ensuremath{\left ] \, \protect\TestGauche{#1} \,;%
+	\protect\TestDroite{#2} \, \right ] }}
+\newcommand{\intfo}[2]{\ensuremath{\left [ \, \protect\TestGauche{#1} \,;%
+	\protect\TestDroite{#2} \, \right [ }}
+\newcommand{\intoo}[2]{\ensuremath{\left ] \, \protect\TestGauche{#1} \,;%
+	\protect\TestDroite{#2} \, \right [ }}
+
+%\newcommand{\intff}[2]{\ensuremath{\left [ \, #1 \,; #2 \, \right ] }}
+%\newcommand{\intfo}[2]{\ensuremath{\left [ \, #1 \,; #2 \, \right [ }}
+%\newcommand{\intof}[2]{\ensuremath{\left ] \, #1 \,; #2 \, \right ] }}
+%\newcommand{\intoo}[2]{\ensuremath{\left ] \, #1 \,; #2 \, \right [ }}
+
+\newcommand{\intn}[2]{\ensuremath{[\![ \, #1 \,;\, #2 \,]\!]}}
+\newcommand{\intnn}[2]{\intn{#1}{#2}}				% Synonyme
+
+% L'intérieur d'un ensemble est noté avec \ronde ou \interieur.
+% Exemple: $ \ronde{A} $
+%\newcommand{\ronde}[1]{\ensuremath{\overset{\circ}{#1}}}
+\newcommand{\ronde}[1]{\ensuremath{\mathring{#1}}}
+\newcommand{\interieur}[1]{\ronde{#1}}				% Synonyme
+% Une alternative pour les ensembles notés par une lettre minuscule:
+% \mathaccent0023{a}
+
+%!!!!!!!!!!!!!!!!!!!!!!!!!!                  !!!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!!   Numérotation   !!!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!!                  !!!!!!!!!!!!!!!!!!!!!!!!!!
+
+% Il peut être très utile de numéroter une équation pour y faire aisément 
+% référence ensuite, soit explicitement avec les commandes ci-dessous, soit
+% avec la commande \centersnumero (décrite juste après).
+%
+% Exemple : \leftcentersright{par suite}{$
+%		f = g² + h²
+%		$}{\deux}.
+%
+% La commande de base est \numero; elle accepte un argument.
+%
+% Exemple: $ \numero{17} $
+%
+% Pour faire simple, des raccourcis qui utilisent cette macro sont déjà prévus
+% (\un <==> \numero{1}).
+
+\newcommand{\numero}[1]{\ensuremath{\mathbf{(#1)}}\xspace}
+\newcommand{\un}{\numero{1}}
+\newcommand{\deux}{\numero{2}}
+\newcommand{\trois}{\numero{3}}
+\newcommand{\quatre}{\numero{4}} 
+\newcommand{\cinq}{\numero{5}}   
+\newcommand{\E}{\numero{E}}
+\newcommand{\F}{\numero{F}}
+\newcommand{\Star}{\ensuremath{(\mathgras{*})}\xspace}
+\newcommand{\sys}{\numero{S}}
+
+% Les commandes à base de \numero, pour simples et pratiques qu'elles soient,
+% posent un problème lorsque les équations sont nombreuses car les relectures
+% scientifiques viendront peut-être tout chambouler. Il peut dont être 
+% pratique d'utiliser une numérotation automatique.
+%
+% Dans une copie, ceci est toujours fait en mettant un numéro à droite d'une
+% équation centrée. C'est ce que font les commandes ci-dessous, en étendant
+% les commandes comme \centers et en reprenant les mêmes idées que dans les
+% \label et \ref de LaTeX.
+%
+% Exemple: \centersnumero{$f=g$}{petit:nom}
+% 	(···)
+% 	Or, d'après l'équation \numeroref{petit:nom}, blablabla.
+%
+% Exemple: \leftcentersnumero{d'où}{$f=g$}{deuxieme:nom}
+%	(···)
+%	Or, d'après l'équation \numeroref{deuxieme:equation}, blablabla.
+%
+% Notez que l'on ne peut pas utiliser d'accent dans le petit nom que l'on 
+% affecte ('petit:nom' ou 'deuxieme:nom').
+
+\newcommand{\centersnumero}[3][2]{%
+	\refstepcounter{Equation}%
+	\centersright[#1]{#2}{\numero{\theEquation}\label{\theCorrige:#3}}%
+	}
+\newcommand{\leftcentersnumero}[4][2]{%
+	\refstepcounter{Equation}%
+	\leftcentersright[#1]{#2}{#3}{%
+		\numero{\theEquation}\label{\theCorrige:#4}%
+	}%
+}
+\newcommand{\encadrenumero}[3][2]{%
+    \refstepcounter{Equation}%
+    \encadreright[#1]{#2}{\numero{\theEquation}\label{\theCorrige:#3}}%
+    }
+\newcommand{\leftencadrenumero}[4][2]{%
+    \refstepcounter{Equation}%
+    \leftencadreright[#1]{#2}{#3}{%
+        \numero{\theEquation}\label{\theCorrige:#4}%
+    }%
+}
+\newcommand{\numeroref}[1]{\numero{\ref{\theCorrige:#1}}}
+
+
+%!!!!!!!!!!!!!!!!!!!!                              !!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!   Logique et mathématiques   !!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!                              !!!!!!!!!!!!!!!!!!!!
+
+% Les symboles qui peuvent être utiles à tout le monde sont \implique et \eq.
+% Exemple: $ \PP(n)    \implique    \PP(n+1) $
+% Exemple: On a montré $(i) \implique (ii)$ et $(ii) \implique (i)$,
+%	   donc $(i) \eq (ii)$.
+\newcommand{\implique}{\ensuremath{\Longrightarrow}}
+\newcommand{\imply}{\implique}					% Synonyme
+\newcommand{\eq}{\ensuremath{\Longleftrightarrow}}
+\newcommand{\SSI}{\ensuremath{\Longleftrightarrow}}		% Synonyme
+
+% « Être en relation avec » se note « A \mathscrchoice{R} B ».
+% Exemple: $ A \relation B $
+\newcommand{\relation}{\ensuremath{\mathscrchoice{R}}}
+
+% Enfin, les symboles logiques classiques sont utiles pour les épreuves
+% d'informatique. Partout ailleurs, il faut leur préférer les expressions
+% rédigées complètes, en particulier dans les ensembles.
+% Exemple: $ A \implique B    \qquad \eq \qquad    \non B \ou A $
+% Exemple: $ \{ \pgcd(i,j) \| i \in A \text{ et } i \in B \} $
+\newcommand{\ou}{\ensuremath{\vee}}
+\newcommand{\et}{\ensuremath{\wedge}}
+\newcommand{\non}{\ensuremath{\neg}}
+\newcommand{\donne}{\ensuremath{\longrightarrow}}
+\newcommand{\tauto}{\ensuremath{\vdash}}
+
+%!!!!!!!!!!!!!!!!!                                    !!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!   Algèbre linéaire et bilinéaire   !!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!                                    !!!!!!!!!!!!!!!!!
+
+% Quelques raccourcis pour manipuler les nombres complexes.
+\newcommand{\barre}[1]{\ensuremath{\overline{#1}}}		% Conjugué
+\newcommand{\Arg}{\ensuremath{\mathop{\rm Arg\,}\nolimits}}	% Argument
+\renewcommand{\Re}{\ensuremath{\mathop{\text{Re}\,}\nolimits}}
+\renewcommand{\Im}{\ensuremath{\mathop{\text{Im}\,}\nolimits}}
+\newcommand{\Rez}{\ensuremath{\Re}}  				% Synonyme
+\newcommand{\Imz}{\ensuremath{\Im}} 				% Synonyme
+\newcommand{\im}{\ensuremath{\Imz}} 				% Synonyme
+
+% Les produits scalaires.
+%
+% Ils doivent être notés avec la même convention que dans l'énoncé.
+% Les deux notations les plus répandues utilisent des parenthèses et des
+% délimiteurs en coin:
+%
+% (u|v), (\vect{AB}|\vect{CD}).
+% <u|v>, <\vect{AB}|\vect{CD}>.
+%
+% Vous disposez de deux commandes pour les composer rapidement et proprement:
+%
+%   $\scalaire{u}{v}$                     pour (u|v)
+%   $\scalaire{ \vect{AB} }{ \vect{CD} }$
+%
+%   $\scalar{u}{v}$                       pour <u|v>
+%   $\scalar{ \vect{AB} }{ \vect{CD} }$
+%
+% Ne changez pas de notation au fil de votre corrigé !
+%
+% NB: dans la majorité des cas, il ne faut pas adapter la taille
+% des parenthèses à leur argument. En particulier, il est normal
+% que les flèches des vecteurs dépassent des parenthèses du produit scalaire.
+% Si toutefois vous avez besoin d'adapter la taille des parenthèses,
+% utilisez une syntaxe de ce genre:
+%
+%   \left(
+%       \left. \f{1}{2} u \:\right| v
+%   \right)
+%
+% ce qui peut aussi s'écrire:
+%
+%   \left( \f{1}{2} u \:\right|
+%   \left . \vphantom{\f{1}{2}} v \right)
+%
+% Si vous trouvez que ces parenthèses sont trop grandes, utilisez le
+% constructeur \Big:
+%
+% Exemple: $ \Big(    \Sum{k=0}{n} e_k    \:\Big|\:    e_{i_0}    \Big) $
+
+\newcommand{\scalaire}[2]{\ensuremath{(#1\|#2)}}
+\newcommand{\scalar}[2]{\ensuremath{\langle #1\|#2 \rangle}}
+
+% Les normes.
+%
+% La commande standard est \norme, qui doit être utilisée dans pratiquement
+% tous les cas. Il est normal et souhaitable que la flèche déborde des barres
+% verticales.
+%
+% Exemple: $ \norme{ \vect{AB} } $
+%
+% Il y a toutefois quelques cas pour lesquels on a vraiment besoin de barres
+% plus grandes, qui couvrent tout l'argument. On utilise alors \bignorme.
+%
+% Exemple: $ \bignorme{    \f{1}{2}   \vect{u}    } $
+%
+% Évitez de diviser un vecteur par un scalaire, comme dans $\f{\vect u}{2}$.
+%
+% Enfin, le sup d'un endomorphisme sur la boule unité se note avec trois 
+% barres verticales.
+%
+% Exemple: $ \trinorme{u} $
+
+%\newcommand{\norme}[1]{\ensuremath{\Arrowvert #1 \Arrowvert}}
+
+\newcommand{\norme}[2][1]{%
+    \ifthenelse{#1 = 0}
+        {\ensuremath{#2}}{}%
+    \ifthenelse{#1 = 1}
+        {\ensuremath{\Arrowvert #2\Arrowvert}}{}%
+    \ifthenelse{#1 = 2}
+        {\ensuremath{\big\Arrowvert#2\big\Arrowvert}}{}%
+    \ifthenelse{#1 = 3}
+        {\ensuremath{\Big\Arrowvert#2\Big\Arrowvert}}{}%
+    \ifthenelse{#1 = 4}
+        {\ensuremath{\bigg\Arrowvert#2\bigg\Arrowvert}}{}%
+    \ifthenelse{#1 = 5}
+        {\ensuremath{\Bigg\Arrowvert#2\Bigg\Arrowvert}}{}%
+    \ifthenelse{#1 = 9}
+        {\ensuremath{\left\Arrowvert#2\right\Arrowvert}}{}%
+}
+
+
+\newcommand{\bignorme}[1]{\ensuremath{\left\Arrowvert #1 \right\Arrowvert}}
+\newcommand{\trinorme}[1]{\ensuremath{|\hskip -1 pt|\hskip -1 pt| #1%
+	|\hskip -1 pt|\hskip -1 pt|}}
+
+% Dessiner une matrice ou un déterminant peut se faire avec les environnements
+% {matrice} et {determinant}.
+%
+% Exemple: $\begin{matrice}	$\begin{determinant}
+%		1 & 0 \\ 		1 & 0 \\
+%		0 & 1 \\		0 & 1 \\
+%	    \end{matrice}$	 \end{determinant}$
+%
+% La transposée d'une matrice nommée par une lettre se note avec \trans.
+%
+% Exemple: $ \trans{A} $
+%
+% Pour indiquer des points de suspension qui descendent la première diagonale,
+% LaTeX fournir \ddots (down dots). Il fournit également \cdots pour les 
+% points de suspension horizontaux et \vdots pour les points de 
+% suspension verticaux. Pour indiquer des points de suspension qui remontent 
+% la deuxième diagonale, on peut utiliser \udots.
+%
+% Exemple: $\begin{matrice}
+%		   0   & \cdots &    0   &    1   \\
+%		\vdots & \udots & \udots &    0   \\
+%		   0   & \udots & \udots & \vdots \\
+%		   1   &    0   & \cdots &    0   \\
+%	    \end{matrice}$
+
+\newenvironment{matrice}%
+	{\begin{pmatrix}}%
+	{\end{pmatrix}}
+\newenvironment{determinant}%
+	{\begin{vmatrix}}%
+	{\end{vmatrix}}
+
+% La commande \matricedd simplifie la composition de matrices (2,2). Elle
+% prend quatre arguments qui sont les quatre coefficients de la matrice, lus
+% ligne par ligne.
+%
+% Exemple: \matricedd{\exi{\theta}}{0}{0}{\exmi{\theta}}
+%
+\newcommand{\matricedd}[4]{%
+        \ensuremath{\begin{matrice}
+                #1 & #2 \\
+                #3 & #4 \\
+        \end{matrice}}
+}
+
+% Le raccourci \vcol permet de dessiner facilement un vecteur colonne.
+%
+% Exemple:
+%   \vcol{ x \\ y \\ z } produit: / x \
+%                                 | y |
+%                                 \ z /
+%
+% On peut placer un nombre quelconque de lignes: \vcol{x\\ y} fait un
+% vecteur à deux lignes, tandis que \vcol{x\\ y\\ z\\ t} utilise quatre 
+% lignes.
+%
+% Enfin, on peut espacer les lignes en utilisant l'argument optionnel de
+% '\\':
+% $\vcol{\f{1}{2}(X+1)\\[2mm] X²}$
+
+\newcommand{\vcol}[1]{\ensuremath{\begin{pmatrix}#1\end{pmatrix}}}
+
+%% Pour les matrices
+\newcommand{\udots}{\ensuremath{\hskip 2pt \raisebox{1pt}{.} \hskip 1pt%
+        \raisebox{4pt}{.} \hskip 1pt \raisebox{7pt}{.} \hskip 2pt}}
+	% up-dots, le symérique de \ddots sur la diagonale.
+%\newcommand{\transp}[1]{%
+%    \ensuremath{%
+%        {\vphantom{#1}}^t #1%
+%    }%
+%}
+\newcommand{\trans}[1]{\ensuremath{\sideset{^t}{}%
+        {\mathop{\mathstrut #1}}}}
+\newcommand{\transp}[1]{\trans{#1}}
+	% La transposée d'une matrice : $\trans{A}$.
+
+
+%!!!!!!!!!!!!!!!!!!!!!                            !!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!   Analyse différentielle   !!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!                            !!!!!!!!!!!!!!!!!!!!!
+
+% Les physiciens et les chimistes ont besoin de beaucoup de dérivées 
+% partielles ou totales, avec la notation par les éléments différentiels.
+% Toutes les commandes ci-dessous s'utilisent de la même manière, en donnant
+% en premier argument la fonction à dériver et en deuxième argument la 
+% variable par rapport à laquelle on dérive. Je représente les « d rond » par 
+% un ð, faute de mieux sur le clavier; l'apparence sera toutefois correcte
+% dans LaTeX.
+
+% Commençons par un synonyme.
+\newcommand{\drond}{\ensuremath{\partial}}
+
+% df
+% --	Exemple: $ \ddf{f}{x} $
+% dx
+\newcommand{\ddf}[2]{\ensuremath{\f{\dd#1}{\dd#2}}}
+
+% df
+% --	Exemple: $ \ddt{f} $		On dérive par rapport à t.
+% dt
+\newcommand{\ddt}[1]{\ddf{#1}{t}}
+
+% d²f
+% --	Exemple: $ \ddxx{f}{x} $
+% dx²
+\newcommand{\ddxx}[2]{\ensuremath{\f{\dd^2{}#1}{\dd{}{#2}^2}}}
+
+% d²f
+% --	Exemple: $ \ddtt{f} $		On dérive 2 fois par rapport à t.
+% dt²
+\newcommand{\ddtt}[1]{\ensuremath{\ddxx{#1}{t}}}
+
+% ðf
+% --	Exemple: $ \Dp{f}{x} $
+% ðx
+\newcommand{\Dp}[2]{\ensuremath{\f{\partial#1}{\partial#2}}} 
+
+% ðf
+% --	Exemple: $ \Dpt{f} $		On dérive par rappor à t.
+% ðt
+\newcommand{\Dpt}[1]{\ensuremath{\Dp{#1}{t}}}
+
+% ð²f
+% ---	Exemple: $ \DDp{f}{x} $
+% ðx²
+\newcommand{\DDp}[2]{\ensuremath{\f{\partial^2#1}{\partial{#2}^2}}}
+
+% / ðf \
+%|  --  |	Exemple: $ \DP{f}{x} $
+% \ ðx /	Ces parenthèses peuvent être utiles pour placer des indices.
+\newcommand{\DP}[2]{\ensuremath{\left(\f{\partial#1}{\partial#2}\right)}}
+
+% ð² f
+% ----	Exemple: $\Dpc{f}{x}{y}$	Dérivée partielle croisée.
+% ðxðy
+\newcommand{\Dpc}[3]{\ensuremath\f{\partial^2#1}{\partial#2\,\partial#3}}
+\newcommand{\DCP}[3]{\ensuremath{\Dpc{#1}{#2}{#3}}}		% Synonyme
+
+%  / ð² f \
+% |  ----  |	Exemple: $\DPC{f}{x}{y}$
+%  \ ðxðy /
+\newcommand{\DPC}[3]{\ensuremath{\left(\Dpc{#1}{#2}{#3}\right)}}
+
+% Les intégrales de contour doivent être « grandes », comme \Int, même dans le
+% texte. Au lieu de préciser '\displaystyle' à chaque occurrence, on peut
+% profiter de la commande \Oint.
+\newcommand{\Oint}{\displaystyle\oint}
+
+% Bizarrement, il n'y a pas de symbole prédéfini pour les intégrales de 
+% surface.
+\newcommand{\oiint}{\ensuremath{\mathop{{\displaystyle%
+%        \int \hskip -3 mm \int%
+%        \hskip -4.7 mm \bigcirc\ }}\limits}}
+        \int\mkern -15.37mu \int%
+        \mkern -24.08mu \bigcirc\ }}\limits}}
+
+% La même chose, mais avec un indice à l'intégrale ($\OIInt{\Sigma}$).
+\newcommand{\OIInt}[1]{\ensuremath{\mathop{{%
+	\displaystyle%
+	\bigcirc%
+%	 \hskip -4.7 mm \int%
+%        \hskip -3 mm \int_{#1}%
+	\mkern -24.08mu \int%
+        \mkern -15.37mu \int_{#1}%
+}}}}%
+
+\newcommand{\Iint}{\ensuremath{\mathop{{\displaystyle%
+        \int \mkern -15.37mu \int}}\limits}}
+
+% La même chose, mais avec un indice à l'intégrale ($\IInt{\Sigma}$).
+\newcommand{\IInt}[1]{\ensuremath{\mathop{{%
+        \displaystyle%
+        \int\mkern -15.37mu \int_{#1}%
+}}}}%
+
+\newcommand{\Iiint}{\ensuremath{\mathop{{\displaystyle%
+        \int \mkern -15.37mu \int \mkern -15.37mu \int}}\limits}}
+
+% La même chose, mais avec un indice à l'intégrale ($\IIInt{\Sigma}$).
+\newcommand{\IIInt}[1]{\ensuremath{\mathop{{%
+        \displaystyle%
+        \int\mkern -15.37mu \int \mkern -15.37mu \int_{#1}%
+}}}}%
+
+%!!!!!!!!!!!!!!!!!!!!!!!!!!!!               !!!!!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!!!!   Géométrie   !!!!!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!!!!               !!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+% Dessiner des vecteurs est très difficile. La commande LaTeX standard, 
+% \overrightarrow, ne produit pas un résultat satisfaisant sur les lettres 
+% majuscules. Pour pallier ce manque, on peut utiliser la commande \vect.
+%
+% Exemple: $\vect{AB}$
+%	   $\vect{u}$
+%
+% Ce type de flèche doit être utilisé en toute circonstance, sauf une: lorsque
+% le vecteur est placé en exposant (notamment en optique), on utiliser plutôt
+% \svect, qui sert précisément et uniquement à cela.
+%
+% Exemple pour les vecteurs en exposant: $e^{ i\,\svect{k} \cdot \svect{r} }$
+
+\newlength{\moreinterligne}
+\setlength{\moreinterligne}{5.5 pt}
+\newlength{\letterarrowvskip}
+\setlength{\letterarrowvskip}{-1.5 pt}
+\newlength{\vectlength}
+\newlength{\vectheight}
+\newlength{\boxlength}
+\newcommand{\vect}[1]{%
+        \settowidth{\vectlength}{\ensuremath{#1}}%
+        \settoheight{\vectheight}{\ensuremath{#1}}%
+        \settowidth{\boxlength}{%
+	        \ensuremath{%
+        	\overrightarrow{%
+		        \parbox[b][\the\vectheight + \letterarrowvskip][b]{%
+				\the\vectlength%
+			}{\ensuremath{#1}}%
+		}%
+		}%
+        }
+        \parbox[b][\the\vectheight + \moreinterligne][b]{\the\boxlength}{%
+	        \ensuremath{%
+		        \overset{\hbox to \the\boxlength{\rightarrowfill}}{%
+	        	\parbox[b][\the\vectheight + \letterarrowvskip][b]{
+				\the\vectlength%
+			}{\ensuremath{#1}}%
+			}%
+		}%
+        }
+}
+
+\newlength{\smoreinterligne}
+\setlength{\smoreinterligne}{5.5 pt}
+\newlength{\sletterarrowvskip}
+\setlength{\sletterarrowvskip}{0 pt}
+\newlength{\svectlength}
+\newlength{\svectheight}
+\newlength{\sboxlength}
+\newlength{\sebtemp}
+\newcommand{\svect}[1]{% 
+        \settowidth{\svectlength}{\mbox{\scriptsize{\ensuremath{#1}}}}%
+        \settoheight{\svectheight}{\mbox{\scriptsize{\ensuremath{#1}}}}%
+        \settowidth{\sboxlength}{%
+	        \ensuremath{%
+	        \overrightarrow{%
+		        \parbox[b][\the\svectheight + \sletterarrowvskip][b]{%
+				\the\svectlength%
+			}%
+        		{\mbox{\scriptsize{\ensuremath{#1}}}}%
+		}%
+		}%
+        }
+	\parbox[b][\the\svectheight + \smoreinterligne][b]{\the\sboxlength}{%
+	        \ensuremath{%
+		\overrightarrow{%
+		        \parbox[b][\the\svectheight + \sletterarrowvskip][b]{%
+				\the\svectlength%
+			}%
+	        	{\mbox{\scriptsize{\ensuremath{#1}}}}%
+		}%
+		}%
+	}
+}
+
+% \vec (pour les petits arguments) est remplacé par \vect.
+\renewcommand{\vec}[1]{\ensuremath{\vect{#1}}}
+
+% Pour les vecteurs complexes 
+\newcommand{\uvect}[1]{\ensuremath{\underline{\vect{#1}}}}
+\newcommand{\vectu}[1]{\ensuremath{\vect{\underline{#1}}}}
+
+% Exceptionnellement, on peut vouloir utiliser \vec pour les *indices*.
+\newcommand{\oldvec}{\mathaccent"17E }
+
+% Les vecteurs usuels ont un petit nom.
+%	\vecti, \vectj, \vectk: la base usuelle de \R³
+%	\vectE: le champ électrique
+%	\vectB: le champ magnétique
+\newcommand{\vecti}{\ensuremath{\vect{\imath}}}
+\newcommand{\vectj}{\ensuremath{\vect{\jmath}}}
+\newcommand{\vectk}{\ensuremath{\vect{k}}}
+\newcommand{\vectux}{\ensuremath{\vect{u_x}}}
+\newcommand{\vectuy}{\ensuremath{\vect{u_y}}}
+\newcommand{\vectuz}{\ensuremath{\vect{u_z}}}
+\newcommand{\vectex}{\ensuremath{\vect{e_x}}}
+\newcommand{\vectey}{\ensuremath{\vect{e_y}}}
+\newcommand{\vectez}{\ensuremath{\vect{e_z}}}
+\newcommand{\vux}{\ensuremath{\vect{u_x}}}
+\newcommand{\vuy}{\ensuremath{\vect{u_y}}}
+\newcommand{\vuz}{\ensuremath{\vect{u_z}}}
+\newcommand{\vex}{\ensuremath{\vect{e_x}}}
+\newcommand{\vey}{\ensuremath{\vect{e_y}}}
+\newcommand{\vez}{\ensuremath{\vect{e_z}}}
+\newcommand{\vectE}{\ensuremath{\vect{E}}}
+\newcommand{\vectB}{\ensuremath{\vect{B}}}
+
+% Le produit vectoriel
+% Exemple: $ \vecti \vectoriel \vectj = \vectk $
+\newcommand{\vectoriel}{\ensuremath{\wedge}}
+
+% Les mesures algébriques, par exemple pour compter si une distance doit être
+% considérée comme positive ou négative. Utile en optique.
+% Exemple: $ \alg{AB} $
+\newcommand{\alg}[1]{\ensuremath{\overline{#1}}}
+
+
+%!!!!!!!!!!!!!!!!!!!!!!!!!                    !!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!   Les opérateurs   !!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!                    !!!!!!!!!!!!!!!!!!!!!!!!!
+
+% Les ensembles.
+\newcommand{\card}{\ensuremath{\mathop{\rm Card\,}\nolimits}}
+\newcommand{\Min}{\ensuremath{\mathop{\,\rm Min\,}\limits}}  
+\newcommand{\Max}{\ensuremath{\mathop{\,\rm Max\,}\limits}}
+\newcommand{\Maj}{\ensuremath{\mathop{\,\rm Maj\,}\limits}}
+\newcommand{\Inf}{\ensuremath{\mathop{\,\rm Inf\,}\limits}}
+\newcommand{\Sup}{\ensuremath{\mathop{\,\rm Sup\,}\limits}}  
+
+% Arithmétique.
+\newcommand{\pgcd}{\ensuremath{\mathop{\rm pgcd\,}\nolimits}}
+\renewcommand{\gcd}{\pgcd}
+\newcommand{\ppcm}{\ensuremath{\mathop{\rm ppcm\,}\nolimits}}
+\newcommand{\ord}{\ensuremath{\mathop{\rm ord\,}\nolimits}} % Ordre d'un groupe
+
+% L'identité.
+\newcommand{\id}{\ensuremath{\mathop{\rm id\,}\nolimits}}
+\newcommand{\Id}{\ensuremath{\mathop{\rm Id\,}\nolimits}}
+
+% Les opérateurs vectoriels.
+\renewcommand{\div}{\ensuremath{\mathop{\rm div\,}\nolimits}}
+\newcommand{\rot}{\ensuremath{\mathop{\vect{\rm rot}\,}\nolimits}} 
+\newcommand{\grad}{\ensuremath{\mathop{\vect{\rm grad}\,}\nolimits}}
+
+% Polynômes,
+\DeclareMathOperator{\val}{val\,}	% \deg est prédéfini
+
+% Algèbre.
+\DeclareMathOperator{\Ker}{Ker\,}
+\renewcommand{\ker}{\Ker}					% Synonyme
+\DeclareMathOperator{\Image}{Im\,}
+\DeclareMathOperator{\spectre}{sp\,}
+
+\DeclareMathOperator{\Vect}{Vect\,}	% Ne pas confondre avec \vect
+\DeclareMathOperator{\rg}{rg\,}		% Le rang
+\DeclareMathOperator{\tr}{Tr\,}		% La trace
+\DeclareMathOperator{\trace}{Tr\,}	% La trace aussi
+\DeclareMathOperator{\Mat}{Mat\,}	% Uniquement pour les expressions 
+					% comme $\Mat_{\nliste{e}}(u)$.
+\DeclareMathOperator{\Pass}{Pass\,}	% Matrice de passage
+\newcommand{\orthogonal}[1]{\ensuremath{{#1}^{\perp}}}	% $ \orthogonal{E} $
+
+% Fonctions trigonométrique et réciproques
+\DeclareMathOperator{\sh}{sh\,}
+\DeclareMathOperator{\ch}{ch\,}
+\renewcommand{\sinh}{\sh}					% Synonyme
+\renewcommand{\cosh}{\ch}					% Synonyme
+\renewcommand{\th}{\ensuremath{\mathop{\rm th\,}\nolimits}}
+\renewcommand{\coth}{\ensuremath{\mathop{\rm coth\,}\nolimits}}
+%
+\DeclareMathOperator{\argsh}{Argsh\,}
+\DeclareMathOperator{\argch}{Argch\,}
+\DeclareMathOperator{\argth}{Argth\,}
+\DeclareMathOperator{\argcoth}{Argcoth\,}
+\newcommand{\Argsh}{\argsh}					% Synonyme
+\newcommand{\Argch}{\argch}					% Synonyme
+\newcommand{\Argth}{\argth}					% Synonyme
+\newcommand{\Argcoth}{\argcoth}					% Synonyme
+%
+\DeclareMathOperator{\cotan}{cotan\,}
+\renewcommand{\arcsin}{\ensuremath{\mathop{\rm Arcsin\,}\nolimits}}
+\renewcommand{\arccos}{\ensuremath{\mathop{\rm Arccos\,}\nolimits}}
+\renewcommand{\arctan}{\ensuremath{\mathop{\rm Arctan\,}\nolimits}}
+\DeclareMathOperator{\arccot}{Arccot\,}
+\newcommand{\arccotan}{\arccot}					% Synonyme
+	% Rien n'est prévu si vous ne prenez pas l'argument *principal*.
+	% Si vous tenez absolument à chercher les ennuis, utilisez \text...
+\newcommand{\Arcsin}{\arcsin}					% Synonyme
+\newcommand{\Arccos}{\arccos}					% Synonyme
+\newcommand{\Arctan}{\arctan}					% Synonyme
+\newcommand{\Arccot}{\arccot}					% Synonyme
+\newcommand{\Arccotan}{\arccotan}				% Synonyme
+%
+\DeclareMathOperator{\sinc}{sinc\,}
+
+%!!!!!!!!!!!!!!!!!!!!!!!!!!                  !!!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!!   Les tableaux   !!!!!!!!!!!!!!!!!!!!!!!!!!
+%!!!!!!!!!!!!!!!!!!!!!!!!!!                  !!!!!!!!!!!!!!!!!!!!!!!!!!
+
+% Dessiner des équations alignées, un système, un tableau de variation, etc., 
+% c'est plutôt difficile. À la base, tout est construit sur l'environnement
+% standard {array}. Les environnement ci-dessous lui passent des options pour
+% traiter la plupart des cas courants.
+%
+% Exemple: $\begin{syst}
+%		a & b+2 \\	Dessine un système avec une grande accolade
+%		b &  1  \\	à gauche. Le '&' est remplacé par un '='.
+%	    \end{syst}$	
+%
+% Exemple: $\begin{systsimple}
+%		a & b+2 \\	Comme le précédent, mais sans l'accolade
+%		b &  1  \\	à gauche.
+%	    \end{systsimple}$
+%
+% Exemple: $\begin{varsyst}		Comme {syst}, sauf que le '=' est 
+%		3   & \leq & \pi \\	remplacé par ce qui est entre les '&',
+%		\pi & \leq &  4  \\	soit, dans l'exemple, le symbole 
+%	    \end{varsyst}$		« inférieur ou égal ».
+%
+% Exemple: $\begin{leqsystsimple}
+%		a & b+2 \\	Comme {systsimple}, mais en remplaçant le signe
+%		b &  1  \\	'=' par un « inférieur ou égal ».
+%	    \end{leqsystsimple}$
+%
+% Exemple : $f(x) = 
+%		\begin{accolade}
+%		\f{\sin x}{x} & \text{si }   x\neq 0 \\[3mm]
+%		       1      & \text{sinon}         \\
+%		\end{accolade}$
+%		On pourrait aussi utiliser l'environnement standard {cases}.
+%
+% Exemple: $\begin{rcl}
+% 		|f| &   =  & |g + h|             \\
+% 		|f| & \leq & |g| + |h|           \\
+% 		|f| & \leq & \Max |g| + \Max |h| \\
+%	    \end{rcl}$
+% À utiliser lorsque le symbole central change à chaque ligne.
+%
+% Lorsqu'aucun de ces environnements ne peut vous satisfaire, il faut créer
+% un tableau {array} en lui passant des arguments: une lettre par colonne
+% ('c' pour centrer, 'l' pour aligner à gauche et 'r' pour aligner à droite)
+% et on peut remplacer l'espace intercolonnes par un argument entre @{···}.
+%
+% Exemple: $\begin{array}{r @{\ \geq\ } l}
+%		a & b \\	Dessine un tableau dans lequel on insère entre
+%		c & d \\	la première et la deuxième colonne le symbole
+%	    \end{array}$	« supérieur ou égal ».
+
+\newenvironment{syst}[1][r]%
+	{\ensuremath{\left \{ \hskip -1.5 mm \begin{array}{#1@{\ =\ }l}}}%
+	{\end{array}\right.}
+\newenvironment{systsimple}[1][r]%
+	{\ensuremath{\begin{array}[t]{#1@{\ =\ }l}}}%
+	{\end{array}}
+\newenvironment{varsyst}[1][r]%
+	{\ensuremath{\left \{ \hskip -1.5 mm%
+	 \begin{array}{#1@{\ }c@{\ }l}}}%
+	{\end{array}\right.}
+\newenvironment{accolade}[1][r]%
+	{\ensuremath{\left \{ \hskip -1.5 mm \begin{array}{#1@{\quad}l}}}%
+	{\end{array}\right.}
+\newenvironment{leqsystsimple}[1][r]%
+	{\ensuremath{\begin{array}[t]{#1@{\ \leq\ }l}}}%
+	{\end{array}}
+\newenvironment{rcl}[1][r]%
+	{\ensuremath{\begin{array}[t]{#1@{\ }c@{\ }l}}}%
+	{\end{array}}
+
+% Dans les tableaux de variation, on a souvent besoin d'insérer deux barres
+% verticales pour indiquer les « zones interdites ».
+\newcommand{\barres}{\ensuremath{\vline\:\vline}}
+
+% Lorsque l'on réalise un long calcul, il est parfois souhaitable d'encadrer
+% sa dernière ligne. Un cas fréquent est celui des équation-bilan. 
+% La commande suivante permet de réaliser cela. Son premier (resp.
+% dernier) argument est la première (resp. dernière) colonne qui doit
+% être encadrée. Elle dispose également de trois arguments optionnels
+% entre ces deux arguments qui permettent d'encadrer plus de deux
+% colonnes.
+%
+% Exemple: $\begin{array}{r @{\ =\ } l}
+%		a + 1 & 7 - 3 \\
+%		  a   & 4 - 1 \\
+%		\arraybox{a}{3} \\
+%	    \end{array}$
+%
+% Exemple: $\begin{array}{r @{\ } = @{\ } l}
+%               a + 1 & = & 7 - 3 \\
+%                 a   & = & 4 - 1 \\
+%               \arraybox{a}[=]{3} \\
+%           \end{array}$
+
+\newlength{\boxrulewidth}
+\setlength{\boxrulewidth}{.4pt}
+\newlength{\boxrulesep}
+\setlength{\boxrulesep}{1mm}
+
+\newlength{\gauchelong}
+\newlength{\droitelong}
+\newlength{\colonnealong}
+\newlength{\colonneblong}
+\newlength{\colonneclong}
+
+\newlength{\maxhaut}
+\newlength{\maxbas}
+
+\newcommand{\writeifexist}[1]{%
+        \ifthenelse{\equal{#1}{\null}}{\null}{#1&}%
+}
+
+\newcommand{\lengthifexist}[2]{%
+       \ifthenelse{\not\equal{#1}{\null}}{%
+                \settowidth{#2}{$#1$}
+                }{\setlength{#2}{0cm}}%
+}
+
+\makeatletter
+
+\def\arraybox#1{
+    \@ifnextchar[%]
+    	{\iarraybox{#1}}%
+    	{\ivarraybox{#1}{\null}{\null}[\null]}}
+
+\def\iarraybox#1[#2]{%
+    \@ifnextchar[%]
+    	{\iiarraybox{#1}{#2}}%
+    	{\ivarraybox{#1}{#2}{\null}[\null]}}
+
+\def\iiarraybox#1#2[#3]{%
+    \@ifnextchar[%]
+  	  {\iiiarraybox{#1}{#2}{#3}}%
+    	{\ivarraybox{#1}{#2}{#3}[\null]}}
+
+\def\iiiarraybox#1#2#3[#4]{%
+    \@ifnextchar[%]
+  	  {\ivarraybox{#1}{#2}{#3}[#4]\relax}%
+    	{\ivarraybox{#1}{#2}{#3}[#4]}}%
+
+\def\ivarraybox#1#2#3[#4]#5{%
+        \settowidth{\gauchelong}{$#1\ $}%
+        \settoheight{\maxhaut}{$#1#2#3#4#5$}
+        \settodepth{\maxbas}{$#1#2#3#4#5$}
+        \lengthifexist{#2}{\colonnealong}%
+        \lengthifexist{#3}{\colonneblong}%
+        \lengthifexist{#4}{\colonneclong}%
+%
+        \raisebox{-\maxbas-\boxrulewidth-\boxrulesep}{%
+                \rule{\boxrulewidth}{%
+                \maxbas+\maxhaut+2\boxrulewidth+2\boxrulesep}}%
+        \raisebox{\maxhaut+\boxrulesep}{%
+                \makebox[0cm][l]{\rule{%
+                \gauchelong+\colonnealong+\colonneblong+\colonneclong}{%
+                \boxrulewidth}}}%
+        \raisebox{-\maxbas-\boxrulewidth-\boxrulesep}{%
+                \makebox[0cm][l]{\rule{%
+                \gauchelong+\colonnealong+\colonneblong+\colonneclong}{%
+                \boxrulewidth}}}%
+        \hskip\boxrulesep%
+        #1&%
+   		\writeifexist{#2}%
+		\writeifexist{#3}%
+        \writeifexist{#4}%
+%
+        #5%
+				% il faut les remettre apres le & il semblerait...
+        \settowidth{\droitelong}{$#5\ \eq $}
+        \settoheight{\maxhaut}{$#1#2#3#4#5$}
+        \settodepth{\maxbas}{$#1#2#3#4#5$}
+%
+        \hskip\boxrulesep%
+        \hskip-\droitelong%
+        \raisebox{\maxhaut+\boxrulesep}{%
+                \makebox[0cm][l]{\rule{\droitelong}{\boxrulewidth}}}
+        \raisebox{-\maxbas-\boxrulesep-\boxrulewidth}{%
+                \makebox[0cm][l]{\rule{\droitelong}{\boxrulewidth}}}
+        \hskip\droitelong%
+        \raisebox{-\maxbas-\boxrulesep-\boxrulewidth}{%
+                \rule{\boxrulewidth}{%
+                \maxbas+\maxhaut+2\boxrulesep+2\boxrulewidth}}
+}
+
+\makeatother
+
+% La commande \arraybox comporte un bug connu mais que nous ne savons pas
+% résoudre. Il est possible de remplacer dans un tableau l'espace entre les
+% colonnes par n'importe quoi d'autre à l'aide de '@'. Or, lorsqu'on remplace
+% dans un tableau de plus de trois colonnes cet espace par quelque chose de
+% plus grand, par exemple « @{\ =\ } », la boîte produite par \arraybox
+% ne ferme pas bien, il reste un « jour » horizontal. (Si vous avez une
+% idée pour corriger ce problème, envoyez-nous un mail à annales.sty@H-K.fr !)
+%
+% Si vous rencontrez ce cas, vous pouvez utiliser la commande suivante,
+% \EncadreDansTableau, qui marche toujours (mais qui est moins
+% ergonomique). 
+%
+% Son premier argument est une longueur, en points, dont il faut 
+% décaler le cadre vers la gauche. Son deuxième argument est le même code 
+% que celui de la dernière ligne du tableau, en changeant les '&' par ce
+% qu'ils sont censés représenter. Il faut placer cette commande avant le
+% code qui correspond à la dernière ligne du tableau.
+%
+% Exemple: $\begin{array}{r @{\ =\ } l}
+%               a + 1 & 7 - 3 \\
+%                 a   & 4 - 1 \\
+%               \EncadreDansTableau{5}{a \ =\  3} a & 3 \\
+%           \end{array}$
+
+\newcommand{\EncadreDansTableau}[2]{%
+%	\typeout{^^JEncadreDansTableau est obsolete, veuillez
+%	utiliser arraybox SVP.^^J}
+        \begin{picture}(0,0)%
+        \put(-#1,0){\fbox{\ensuremath{\hphantom{#2}\vphantom{#2}}}}%
+        \end{picture}%
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%                 %%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%   La physique   %%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%                 %%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Les unités.
+
+% Présenter les unités correctement peut être pénible sans une macro 
+% appropriée car d'un côté il faut que les lettres (m, kg, etc.) apparaissent
+% comme dans le texte, et de l'autre on souhaite utiliser des exposants.
+% La macro \U est faite pour cela.
+%
+% Exemple: $ g = 9,81 \U{m^2 s^{-1}} $
+
+\newcommand{\U}[1]{\ensuremath{\mathrm{~#1}}}
+
+% Le cas particulier des Angström doit être traité à part pour avoir un
+% bon rendu.
+%
+% Exemple: $ \ell = 2 \U{\Angstrom} $
+%\newlength{\angstromlength}
+%\settowidth{\angstromlength}{A}
+%\setlength{\angstromlength}{\angstromlength / 2 + 0.003mm}
+%\newcommand{\angstrom}{%
+%	\hskip\angstromlength
+%	\makebox[0pt]{%
+%		\ensuremath{%
+%		\overset{\text{\tiny$\circ$}}{\rule{0pt}{2.2mm}}%
+%		}%
+%	}%
+%	\hskip-\angstromlength A%
+%}
+\newcommand{\angstrom}{\ensuremath{\mathring{A}}}
+\newcommand{\Angstrom}{\angstrom}				% Synonyme
+
+% Les degrés.
+% Exemple: $T\e{f} = 10 \celsius$
+% Exemple: $T\e{i} = 10 \U{K}$
+\newcommand{\celsius}{\ensuremath{\text{\degre{}C}}\xspace}
+\renewcommand{\degre}{\ensuremath{{}^{\text{\footnotesize\ensuremath{\circ}}}}}
+%\renewcommand{\degres}{\degre}					% Synonyme
+\def\degres{\degre}
+
+% Les indices
+%
+% Les indices placés à côté d'une lettre peuvent être essentiellement de deux 
+% natures: soit ils désignent un numéro, comme dans 'u_n', soit ils désignent
+% une abréviation, comme dans 'T_\text{f}' (température finale).
+%
+% Les premiers ne posent aucun problème à composer: $u_n$. Les seconds, en 
+% revanche, sont pénibles parce qu'il faudrait en permanence utiliser \text
+% pour les faire apparaître en droit, ce qui est indispensable. La commande
+% \e s'en occupe pour vous.
+%
+% Exemple: $ T\e{finale} = 1 \U{K} $
+%
+% Attention, n'abusez pas non plus de cette commande: il ne serait pas correct
+% d'écrire $u\e{n}$. Il faut alors s'en tenir à la règle habituelle: $u_n$.
+%
+% Les commandes \liq, \sol et \gaz servent à indiquer la phase.
+%
+% Exemple: $ \He\liq $
+
+\newcommand{\e}[1]{\ensuremath{{}_{\text{#1}}}}
+\newcommand{\liq}{\ensuremath{\e{\ensuremath{(\ell)}}}}
+\newcommand{\gaz}{\ensuremath{\e{(g)}}}
+\newcommand{\sol}{\ensuremath{\e{(s)}}}
+\newcommand{\aq}{\ensuremath{\e{(aq)}}}
+
+% On en profite pour la thermochimie. Des combinaisons plus complexes sont
+% aussi possibles avec \e.
+\newcommand{\Deltar}{\ensuremath{\Delta_{\text{r}}}}
+\newcommand{\Deltaf}{\ensuremath{\Delta_{\text{f}}}}
+\newcommand{\deltar}{\Deltar}
+\newcommand{\deltaf}{\Deltaf}
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%               %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   La chimie   %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%               %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% La chimie est toujours difficile à composer. Le pire est naturellement la
+% chimie organique, qui exige des dessins. Mais même le simple fait d'utiliser
+% le symbole d'un élément demande du travail, puisque le symbole doit 
+% apparaître en caractères droits. Pour les quelques éléments dont le symbole
+% est réduit à une lettre (B,C,F,I,K,N,O,U), pas de problème. Pour tous les 
+% autres, il faudrait utiliser \text, comme dans $\text{Al}_2 O_3$.
+%
+% Pour simplifier le travail de composition, au moins deux commandes ont été 
+% accordées à chaque élément: l'un avec le nom complet, l'autre avec le 
+% symbole. Pour ce dernier cas, veillez à ne pas oublier les majuscules.
+%
+% Exemple: $ \Al_2 O_3 $
+
+\newcommand{\aluminium}{\ensuremath{\mathrm{Al}}}
+\newcommand{\alu}{\aluminium}
+\newcommand{\Al}{\aluminium}
+\newcommand{\argent}{\ensuremath{\mathrm{Ag}}}   
+\newcommand{\Ag}{\argent}
+\newcommand{\argon}{\ensuremath{\mathrm{Ar}}}
+\newcommand{\Ar}{\argon}
+\newcommand{\arsenic}{\ensuremath{\mathrm{As}}}
+\newcommand{\As}{\arsenic}
+\newcommand{\baryum}{\ensuremath{\mathrm{Ba}}}
+\newcommand{\Ba}{\baryum}
+\newcommand{\beryllium}{\ensuremath{\mathrm{Be}}}
+\newcommand{\Be}{\beryllium}
+\newcommand{\bismuth}{\ensuremath{\mathrm{Bi}}}
+\newcommand{\Bi}{\bismuth}
+\newcommand{\brome}{\ensuremath{\mathrm{Br}}}
+\newcommand{\Br}{\brome}
+\newcommand{\cadmium}{\ensuremath{\mathrm{Cd}}}
+\newcommand{\Cd}{\cadmium}
+\newcommand{\calcium}{\ensuremath{\mathrm{Ca}}}    
+\newcommand{\Ca}{\calcium}
+\newcommand{\cerium}{\ensuremath{\mathrm{Ce}}}
+\newcommand{\Ce}{\cerium}
+\newcommand{\cesium}{\ensuremath{\mathrm{Cs}}}
+\newcommand{\Cs}{\cesium}
+\newcommand{\chlore}{\ensuremath{\mathrm{Cl}}}   
+\newcommand{\Cl}{\chlore}
+\newcommand{\chrome}{\ensuremath{\mathrm{Cr}}}
+\newcommand{\Cr}{\chrome}
+\newcommand{\cobalt}{\ensuremath{\mathrm{Co}}}
+\newcommand{\Co}{\cobalt}
+\newcommand{\cuivre}{\ensuremath{\mathrm{Cu}}}
+\newcommand{\Cu}{\cuivre}
+\newcommand{\etain}{\ensuremath{\mathrm{Sn}}}
+\newcommand{\Sn}{\etain}
+\newcommand{\europium}{\ensuremath{\mathrm{Eu}}}
+\newcommand{\Eu}{\europium}
+\newcommand{\fer}{\ensuremath{\mathrm{Fe}}}  
+\newcommand{\Fe}{\fer}
+\newcommand{\gallium}{\ensuremath{\mathrm{Ga}}} 
+\newcommand{\Ga}{\gallium}
+\newcommand{\germanium}{\ensuremath{\mathrm{Ge}}} 
+\newcommand{\Ge}{\germanium}
+\newcommand{\helium}{\ensuremath{\mathrm{He}}}
+\newcommand{\He}{\helium}
+\newcommand{\krypton}{\ensuremath{\mathrm{Kr}}}
+\newcommand{\Kr}{\krypton}
+\newcommand{\lithium}{\ensuremath{\mathrm{Li}}}
+\newcommand{\Li}{\lithium}
+\newcommand{\magnesium}{\ensuremath{\mathrm{Mg}}}
+\newcommand{\Mg}{\magnesium}
+\newcommand{\manganese}{\ensuremath{\mathrm{Mn}}}
+\newcommand{\Mn}{\manganese}
+\newcommand{\mercure}{\ensuremath{\mathrm{Hg}}}
+\newcommand{\Hg}{\mercure}
+\newcommand{\molybdene}{\ensuremath{\mathrm{Mo}}}
+\newcommand{\Mo}{\molybdene}
+\newcommand{\neon}{\ensuremath{\mathrm{Ne}}}
+\newcommand{\Ne}{\neon}
+\newcommand{\nickel}{\ensuremath{\mathrm{Ni}}}
+\newcommand{\Ni}{\nickel}
+\newcommand{\palladium}{\ensuremath{\mathrm{Pd}}}
+\newcommand{\Pd}{\palladium}
+\newcommand{\platine}{\ensuremath{\mathrm{Pt}}}
+\newcommand{\Pt}{\platine}
+\newcommand{\plomb}{\ensuremath{\mathrm{Pb}}}
+\newcommand{\Pb}{\plomb}
+\newcommand{\polonium}{\ensuremath{\mathrm{Po}}}
+\newcommand{\Po}{\polonium}
+\newcommand{\radon}{\ensuremath{\mathrm{Rn}}}
+\newcommand{\Rn}{\radon}
+\newcommand{\rubidium}{\ensuremath{\mathrm{Rb}}}
+\newcommand{\Rb}{\rubidium}
+\newcommand{\samarium}{\ensuremath{\mathrm{Sm}}}
+\newcommand{\Sm}{\samarium}
+\newcommand{\selenium}{\ensuremath{\mathrm{Se}}}
+\newcommand{\Se}{\selenium}
+\newcommand{\silicium}{\ensuremath{\mathrm{Si}}}
+\newcommand{\Si}{\silicium}
+\newcommand{\sodium}{\ensuremath{\mathrm{Na}}} 
+\newcommand{\Na}{\sodium}
+\newcommand{\strontium}{\ensuremath{\mathrm{Sr}}}  
+\newcommand{\Sr}{\strontium}
+\newcommand{\titane}{\ensuremath{\mathrm{Ti}}}
+\newcommand{\Ti}{\titane}
+\newcommand{\thallium}{\ensuremath{\mathrm{Tl}}}
+\newcommand{\Tl}{\thallium}
+\newcommand{\xenon}{\ensuremath{\mathrm{Xe}}}
+\newcommand{\Xe}{\xenon}
+\newcommand{\zinc}{\ensuremath{\mathrm{Zn}}}   
+\newcommand{\Zn}{\zinc}
+\newcommand{\zirconium}{\ensuremath{\mathrm{Zr}}}                               
+\newcommand{\Zr}{\zirconium}   
+
+% D'autres raccourcis peuvent se révéler pratiques.
+\newcommand{\affinite}{\ensuremath{\mathcal{A}}}
+\newcommand{\cuivreI}{\ensuremath{\mathrm{Cu}^{+}}}
+	\newcommand{\CuI}{\cuivreI}				% Synonyme
+\newcommand{\cuivreII}{\ensuremath{\mathrm{Cu}^{2+}}}
+	\newcommand{\CuII}{\cuivreII}				% Synonyme
+\newcommand{\ferII}{\ensuremath{\mathrm{Fe}^{2+}}}
+	\newcommand{\FeII}{\ferII}				% Synonyme
+\newcommand{\ferIII}{\ensuremath{\mathrm{Fe}^{3+}}}
+	\newcommand{\FeIII}{\ferIII}				% Synonyme
+%
+\newcommand{\elec}{\ensuremath{\mathrm{e}^{-}}} % Pour les ½-équations rédox.
+\newcommand{\methyl}{\ensuremath{\mathrm{Me}}}
+	\newcommand{\Met}{\methyl}				% Synonyme
+	\newcommand{\Me}{\methyl}				% Synonyme
+\newcommand{\ethyl}{\ensuremath{\mathrm{Et}}}
+	\newcommand{\Et}{\ethyl}				% Synonyme
+\newcommand{\butyl}{\ensuremath{\mathrm{Bu}}}
+	\newcommand{\Bu}{\butyl}				% Synonyme
+%
+\newcommand{\pH}{\ensuremath{\mathrm{pH}}}
+\newcommand{\pOH}{\ensuremath{\mathrm{pOH}}}
+\newcommand{\pKa}{\ensuremath{\mathrm{pKa}}}
+\newcommand{\pKb}{\ensuremath{\mathrm{pKb}}}
+\newcommand{\pKe}{\ensuremath{\mathrm{pKe}}}
+\newcommand{\pKd}{\ensuremath{\mathrm{pKd}}}
+\newcommand{\pKs}{\ensuremath{\mathrm{pKs}}}
+\newcommand{\Ka}{\ensuremath{\text{Ka}}}
+\newcommand{\Kb}{\ensuremath{\text{Kb}}}
+\newcommand{\Ke}{\ensuremath{\text{Ke}}}
+\newcommand{\Ks}{\ensuremath{\text{Ks}}}
+\newcommand{\Kd}{\ensuremath{\text{Kd}}}
+%
+\newcommand{\sulfate}{\ensuremath{{SO_4}^{2-}}} 
+\newcommand{\sulfite}{\ensuremath{{SO_3}^{2-}}} 
+\newcommand{\nitrate}{\ensuremath{{NO_3}^{-}}} 
+\newcommand{\nitrite}{\ensuremath{{NO_2}^{-}}} 
+\newcommand{\hydronium}{\ensuremath{{H_3O}^{+}}} 
+\newcommand{\phosphate}{\ensuremath{{PO_4}^{3-}}} 
+\newcommand{\carbonate}{\ensuremath{{CO_3}^{2-}}} 
+\newcommand{\ammonium}{\ensuremath{{NH_4}^{+}}} 
+\newcommand{\bicarbonate}{\ensuremath{{HCO_3}^{-}}} 
+\newcommand{\bichromate}{\ensuremath{{\chrome_2O_7}^{2-}}} 
+\newcommand{\borate}{\ensuremath{{BO_3}^{3-}}} 
+\newcommand{\chlorate}{\ensuremath{{\chlore O_3}^{-}}} 
+\newcommand{\perchlorate}{\ensuremath{{\chlore O_4}^{-}}} 
+\newcommand{\chlorite}{\ensuremath{{\chlore O_2}^{-}}} 
+\newcommand{\chromate}{\ensuremath{{\chrome O_4}^{2-}}} 
+\newcommand{\dithionate}{\ensuremath{{S_4O_6}^{2-}}} 
+\newcommand{\hypochlorite}{\ensuremath{{\chlore O}^{-}}} 
+\newcommand{\permanganate}{\ensuremath{{\manganese O_4}^{-}}} 
+\newcommand{\thiosulfate}{\ensuremath{{S_2O_3}^{2-}}}
+
+% Pour les concentrations, on doit parfois ajuster la taille des crochets.
+\newcommand{\concentration}[1]{\ensuremath{\left[#1\right]}}
+
+% On peut aussi raccourcir l'unité la plus fréquence en chimie.
+% Exemple: $ [\ferII ]\e{finale} = 0,10 \conc $
+\newcommand{\conc}{\ensuremath{\U{mol.L^{-1}}}}
+
+% Le K°.
+\newcommand{\Kzero}{{\ensuremath{K^\circ}}}
+
+% P° et c°.
+\newcommand{\Pzero}{{\ensuremath{P^\circ}}}
+\newcommand{\czero}{{\ensuremath{c^\circ}}}
+
+% Les grandeurs standard.
+% Exemple: $\Deltar H\zero$
+\newcommand{\zero}{\ensuremath{^{\circ}}}
+
+% On est parfois amené à préciser des liaisons d'une molécule qui n'est pas 
+% dessinée mais « décrite » dans le texte, comme $H_3 C - \Cl$ ou 
+% $H_2 C = C H_2$. Pour que le rendu soit correct, on peut utiliser les 
+% commandes suivantes, l'idéal étant d'enrober la molécule dans une \mbox
+% pour s'assurer que LaTeX ne va pas augmenter ou rétrécir l'espace pour faire
+% en sorte que la ligne joigne correctement les deux marges.
+%
+% Exemple: L'éthylène (\mbox{$H_2 C \double C H_2$}) étant toxique, blablabla.
+
+\newcommand{\simple}{{\ensuremath{%
+    \mathchoice%
+        {\mbox{\raisebox{0.232ex}{\ensuremath{-}}}}
+        {\mbox{\raisebox{0.232ex}{\ensuremath{-}}}}
+        {\mbox{\raisebox{-0.05ex}{\ensuremath{-}}}}
+        {\mbox{\raisebox{-0.15ex}{\ensuremath{-}}}}
+}}}
+
+\newcommand{\double}{{\ensuremath{%
+    \mathchoice%
+        {\mbox{\raisebox{0.232ex}{\ensuremath{=}}}}
+        {\mbox{\raisebox{0.232ex}{\ensuremath{=}}}}
+        {\mbox{\raisebox{-0.005ex}{\ensuremath{=}}}}
+        {\mbox{\raisebox{-0.177ex}{\ensuremath{=}}}}
+}}}
+
+\newcommand{\triple}{{\ensuremath{%
+    \mathchoice%
+        {\mbox{\raisebox{0.232ex}{\ensuremath{\equiv}}}}
+        {\mbox{\raisebox{0.232ex}{\ensuremath{\equiv}}}}
+        {\mbox{\raisebox{-0.005ex}{\ensuremath{\equiv}}}}
+        {\mbox{\raisebox{-0.177ex}{\ensuremath{\equiv}}}}
+}}}
+
+%\newcommand{\simple}{\ensuremath{\!-\!}}
+%\newcommand{\double}{\ensuremath{\!=\!}}
+%\newcommand{\triple}{\ensuremath{\!\equiv\!}}
+
+% Les équilibres doivent être dessinés avec des demi-flèches.
+% \Equilibre laisse plus de place (horizontale) autour du symbole que 
+% \equilibre.
+\newcommand{\equilibre}{\ensuremath{\ \rightleftharpoons\ }}
+\newcommand{\Equilibre}{\ensuremath{\ \,\rightleftharpoons\,\ }}
+
+% Une simple flèche pour la cinétique 
+\newcommand{\kdonne}[1]{%
+	\ensuremath{%
+		{\overset{\raisebox{-2pt}{\scriptsize #1}}{\ \,\longrightarrow\,\ }}%
+	}%
+}
+
+%% Les configurations électroniques de quelques éléments.
+
+\newcommand{\ConfigurationAzote}{\ensuremath{%
+	\raisebox{0.5pt}{|}\,%
+        \underset{\text{\normalsize $\cdot$}}%
+        {\overset{\text{\raisebox{-1pt}{\normalsize $\cdot$}}}{N}}%
+        \hskip1pt\cdot%
+	}}
+\newcommand{\ConfigurationOxygene}{\ensuremath{%
+	\cdot\hskip1pt%
+	\underset{\raisebox{2pt}{\text{\normalsize{$-$}}}}%
+	{\overset{\raisebox{-2pt}{\text{\normalsize{$-$}}}}{O}}%
+	\hskip1pt\cdot%
+	}}
+\newcommand{\ConfigurationCarbone}{\ensuremath{%
+	\cdot\hskip1pt%
+	\underset{\raisebox{2pt}{\text{\normalsize{$\cdot$}}}}%
+	{\overset{\raisebox{-2pt}{\text{\normalsize{$\cdot$}}}}{C}}%
+	\hskip1pt\cdot%
+	}}
+\newcommand{\ConfigurationHydrogene}{\ensuremath{H\hskip0.5pt\cdot}}
+
+%% Pour dessiner les spins.
+
+\newcommand{\spinup}{
+        \begin{picture}(10,10)
+        \put(2.5,2.5){$\uparrow$}
+        \path(0,0)(10,0)(10,10)(0,10)(0,0) 
+        \end{picture}
+	}
+\newcommand{\spindown}{
+        \begin{picture}(10,10)
+        \put(2.5,2.5){$\downarrow$}
+        \path(0,0)(10,0)(10,10)(0,10)(0,0) 
+        \end{picture}
+	}
+\newcommand{\spindouble}{
+        \begin{picture}(10,10)
+        \put(1,2.5){$\uparrow\!\downarrow$}
+        \path(0,0)(10,0)(10,10)(0,10)(0,0) 
+        \end{picture}
+	}
+\newcommand{\spinvide}{
+        \begin{picture}(10,10)
+        \path(0,0)(10,0)(10,10)(0,10)(0,0) 
+        \end{picture}
+	}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%                    %%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%   L'informatique   %%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%                    %%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Insérer un code source en précisant le nom de la version et le fichier
+% à inclure.
+% Exemple: \codesource{Version Caml}{PS/MP_INFO_X_1_2002__1.ml}
+%\newcommand{\codesource}[2]{%
+%	\medskip\noindent%
+%	\textbf{#1}%
+%	\verbatiminput{#2}%
+%}
+% Je modifie cette commande car depuis 2003, seules les versions Caml des
+% corrigés sont proposées.
+%\newcommand{\codesource}[1]{\medskip\noindent\verbatiminput{#1}}
+\newcommand{\codesource}[1]{%
+    \medskip\noindent%
+    \NoAutoSpaceBeforeFDP%  Pas d'espace avant les ':' et ';'
+    \verbatiminput{#1}%
+    \AutoSpaceBeforeFDP%
+    }
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%                          %%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%   Les fautes de frappe   %%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%                          %%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%\renewcommand{\mp}{\pm}
+\renewcommand{\mp}{\errmessage{Commande interdite: utiliser \string\pm}}
+
Index: trunk/MESOSCALE_DEV/DOC/SRC/callphys.def
===================================================================
--- trunk/MESOSCALE_DEV/DOC/SRC/callphys.def	(revision 207)
+++ trunk/MESOSCALE_DEV/DOC/SRC/callphys.def	(revision 207)
@@ -0,0 +1,94 @@
+General options
+~~~~~~~~~~~~~~~
+tracer    (Run with or without tracer transport ?)
+F
+diurnal   (Diurnal cycle ?  if diurnal=F, diurnal averaged solar heating)
+T
+season    (Seasonal cycle ? if season=F, Ls stays constant like in "start")
+T
+lwrite    (want some more output on the screen ?) 
+F
+stats     (Saving statistics in file "cumul" ?)
+F
+calleofdump (Saving EOF profiles in file "profiles" for Climate Database ?)
+F
+Dust scenario. Used if the dust is prescribed (i.e. if tracer=F or active=F)
+~~~~~~~~~~~~~
+iaervar  (=1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario 
+4        (=4 Mars Year 24 from TES assimilation)
+iddist  (Dust vertical distribution: =0: old distrib. (Pollack90) 
+3       (=1: top set by "topdustref"; =2: Viking scenario; =3 MGS scenario )
+topdustref (Dust top altitude (km). Matter only if iddist=1)
+55.
+Physical Parameterizations :
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+callrad   (call radiative transfer ?)
+T
+callnlte (call NLTE radiative schemes ?   matter only if callrad=T)
+F
+callnirco2 (call CO2 NIR absorption ?   matter only if callrad=T)
+T
+calldifv  (call turbulent vertical diffusion ?)
+T
+calladj   (call convective adjustment ?)
+F 
+callcond  (call CO2 condensation ?)
+T
+callsoil  (call thermal conduction in the soil ?)
+T
+calllott  (call Lott's gravity wave/subgrid topography scheme ?)
+F
+Radiative transfer options :
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+iradia    (the rad.transfer is computed every "iradia" physical timestep)
+37 
+callg2d   (Output of the exchange coefficient mattrix ? for diagnostic only)
+F
+rayleigh  (Rayleigh scattering : should be =F for now)
+F
+Tracer (dust water, ice and/or chemical species) options (use if tracer=T) :
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+dustbin    (DUST: Transported dust ? (if >0, uses q(1) to q(dustbin))
+0
+active     (DUST: Radiatively active dust ? (uses q(1) to q(dustbin))
+F
+doubleq    (DUST: needs dustbin=1, use mass q(1) and nb q(2) mr to predict dust size ?)
+F
+lifting    (DUST: lifted by GCM surface winds ?)
+F
+dustdevil  (DUST: lifted by dust devils ?)
+F
+scavenging (DUST: Scavenging by CO2 snowfall ?)
+F
+sedimentation (DUST/WATERICE: Gravitationnal sedimentation ?)
+F
+iceparty   (WATERICE: Water cycle includes water ice mixing ratio q(nqmx-1))
+F
+activice   (WATERICE: Radiatively active transported atmospheric water ice ?)
+F
+water      (WATER: Compute water cycle using q(nqmx) )
+F
+caps       (WATER: put the current permanent caps at both poles)
+F
+photochem  (PHOTOCHEMISTRY: chemical species included)
+F
+Thermospheric options (relevant if tracer=T) :
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+callthermos  (call thermosphere ?)
+F
+thermoswater  (WATER: included without cycle	only if water=F)
+F
+callconduct  (call thermal conduction ?     matter only if callthermos=T)
+F
+calleuv  (call EUV heating ?                matter only if callthermos=T)
+F
+callmolvis  (call molecular viscosity ?     matter only if callthermos=T)
+F
+callmoldiff  (call molecular diffusion ?    matter only if callthermos=T)
+F
+thermochem  (call thermospheric photochemistry ?  matter only if callthermos=T)
+F
+solarcondate (date for solar flux calculation: 1985 < date < 2002))
+1993.4       (Solar min=1996.4 ave=1993.4 max=1990.6)
+
+
Index: trunk/MESOSCALE_DEV/DOC/SRC/namelist.input_full
===================================================================
--- trunk/MESOSCALE_DEV/DOC/SRC/namelist.input_full	(revision 207)
+++ trunk/MESOSCALE_DEV/DOC/SRC/namelist.input_full	(revision 207)
@@ -0,0 +1,120 @@
+ &time_control
+ start_year       = 2024,    !! (p1) Start Martian Year (20XX for MY XX)
+ start_month      = 07,      !! (p1) Start Martian Month 
+ start_day        = 01,      !! (p1) Start Martian Day 
+ start_hour       = 06,      !! (p1) Start Martian Hour (at longitude 0)
+ end_year         = 2024,    !! (p1) End Martian Year (20XX for MY XX)
+ end_month        = 07,      !! (p1) End Martian Month
+ end_day          = 02,      !! (p1) End Martian Day
+ end_hour         = 06,      !! (p1) End Martian Hour (at longitude 0)
+ history_interval    = 37,   !! Frequency of outputs (37 --> 3700s = 1 Martian hour)  
+ frames_per_outfile  = 24,   !! Size of time dimension in files 
+ restart          = .false.  !! (*) Output restart files ?
+ restart_interval = 8880     !! (*) Frequency of output restart files ?
+ io_form_history  = 2        !! (*) Choice of NETCDF for ouputs
+ io_form_restart  = 2        !! (*) Choice of NETCDF for ouputs     
+ io_form_input    = 2        !! (*) Choice of NETCDF for ouputs
+ io_form_boundary = 2        !! (*) Choice of NETCDF for ouputs
+ debug_level      = 0        !! (*) Verbose level
+ !!
+ !! OPTIONAL
+ !!
+ interval_seconds = 3700     !! (p2) Frequency of large-scale fields update (s)
+ input_from_file = T,        !! (n)(p2) Initialize a given domain with an input file
+ /
+
+
+ &domains
+ time_step   = 50            !! Dynamical timestep
+ dx = 20000,                 !! (p2) Horizontal resolution
+ dy = 20000,                 !! (p2) Horizontal resolution (should be equal to dx)
+ e_we   = 61,                !! (r)(p2) Number of longitude grid points
+ e_sn   = 61,                !! (r)(p2) Number of latitude grid points
+ e_vert = 61,                !! (r)(p2) Number of vertical levels
+ p_top_requested = 5         !! (p3) Chosen value of pressure at the top of the model
+ !!
+ !! OPTIONAL
+ !!
+ time_step_fract_num = 0     !! Additional fraction to time_step: numerator 
+ time_step_fract_den = 1     !! Additional fraction to time_step: denominator
+ num_metgrid_levels = 26     !! (p1) number of vertical levels in GCM inputs (+1)
+ force_sfc_in_vinterp = 8    !! (p3) Number of levels hardwired in the PBL 
+                             !!         NB: decrease this parameter when low model top 
+ max_dz = 1500.              !! (p3) Maximal interval (m) between vertical levels
+ eta_levels = -1.            !! (p3)  Specify a list of e_vert eta levels
+ max_dom = 1                 !! (r)(n)(p2) Total number of domains
+ grid_id                = 1, !! (n)(p2) Identification of the domain
+ parent_id              = 0, !! (n)(p2) Associated parent domain
+ i_parent_start         = 0, !! (n)(p2) x-position of the bottom-left nest corner
+ j_parent_start         = 0, !! (n)(p2) x-position of the bottom-left nest corner
+ parent_grid_ratio      = 1, !! (n)(p2) Ratio of horizontal resolution parent/nest
+ parent_time_step_ratio = 1, !! (n) Ratio of time step parent/nest
+ /
+
+ &physics
+ !!
+ !! OPTIONAL
+ !!
+ radt = 1,                   !! Ratio between physical and dynamical time step
+ mars =  0,                  !! (r)(p2) Configuration of tracers: 
+                             !!         0: no tracers, 1: water vapor + ice, 2: dust
+ init_TI = 0.,               !! (p3) Define constant thermal inertia value 
+ init_AL = 0.,               !! (p3) Define constant albedo value 
+ init_U = 0.,                !! (p3) Define constant ini/bdy zonal wind value
+ init_V = 0.,                !! (p3) Define constant ini/bdy meridional wind value
+ init_WX = 0.,               !! (p3) \  Ini/bdy wind profile is everywhere equal to
+ init_WY = 0.,               !! (p3) /  the wind profile @ grid pt (init_WX,init_WY)
+ init_MU = 0.,               !! (p3) Multiply ini & bdy zonal wind by init_U
+ init_MV = 0.,               !! (p3) Multiply ini & bdy meridional wind by init_V
+ init_LES = F,               !! (p3) Uniform domain initialization for LES
+ /
+
+ &dynamics
+ !!
+ !! OPTIONAL
+ !!
+ time_step_sound = 6,        !! Ratio of time step dynamic/acoustic integration
+                             !!   NB: an increase could help solve instabilities
+ non_hydrostatic = T,        !! Integrate in non-hydrostatic/hydrostatic mode
+ pd_scalar = F,              !! Positive-definite advection scheme for tracers 
+ !!
+ diff_opt = 1                !! (*d) Diffusion option [set to 0 if LES or GCM]
+ km_opt = 4                  !! (*d) Eddy coefficient option           
+ diff_6th_factor = 2,        !! (*d) Knievel numerical diffusion [set to 0 if LES]      
+ diff_6th_opt = 0.2,         !! (*d) Knievel numerical coeff. [set to 0.5 if GCM]       
+ smdiv = 0.1,                !! (*d) Divergence damping
+ emdiv = 0.01,               !! (*d) External-mode filter for mass coord. model
+ epssm = 0.1,                !! (*d) Time off-centering for vertical sound waves
+ h_mom_adv_order = 5,        !! (*d) Horizontal momentum advection order
+ v_mom_adv_order = 3,        !! (*d) Vertical momentum advection order
+ h_sca_adv_order = 5,        !! (*d) Horizontal scalar advection order
+ v_sca_adv_order = 3,        !! (*d) Vertical scalar advection order
+ /
+
+ &bdy_control
+ !!
+ !! OPTIONAL
+ !!
+ specified = T,              !! (n)(p3) Boundary conditions specified by GCM 
+ nested = F,                 !! (n)(p3) Boundary conditions from parent domain
+ periodic_x = F,             !! (p3) Periodic boundary conditions over x
+ periodic_y = F,             !! (p3) Periodic boundary conditions over y
+ open_xs = F,                !! (p3) Open boundary conditions @ western boundary
+ open_xe = F,                !! (p3) Open boundary conditions @ eastern boundary
+ open_ys = F,                !! (p3) Open boundary conditions @ southern boundary
+ open_ye = F,                !! (p3) Open boundary conditions @ northern boundary
+ spec_bdy_width = 5          !! (p3) Width of transition zone with specified=T
+                             !!      NB: spec_bdy_width must equal relax_zone+1
+ relax_zone = 4              !! (p3) Width of relaxation zone with specified=T
+ /
+
+ &grib2
+ /
+
+ &fdda
+ /
+
+ &namelist_quilt              !! (*)
+ nio_tasks_per_group = 0,     !! (*)
+ nio_groups = 1,              !! (*)
+ /                            !! (*)
Index: trunk/MESOSCALE_DEV/DOC/SRC/newfred.bib
===================================================================
--- trunk/MESOSCALE_DEV/DOC/SRC/newfred.bib	(revision 207)
+++ trunk/MESOSCALE_DEV/DOC/SRC/newfred.bib	(revision 207)
@@ -0,0 +1,15918 @@
+
+@string{aa = "Astron.~Astrophys."}
+@string{aap = "Astron.~Astrophys."}
+@string{ae = "Atmosph.~Environ."}
+
+@string{ang = "Ann.~Geophys."}
+
+@string{ao = "Appl.~Opt."}
+
+@string{apj="Astrophys.~Jour."}
+
+@string{araa="Ann.~Rev.~Astron.~Astrophys."}
+
+@string{aereps="Ann.~Rev.~Earth~Planet~Sci."}
+
+@string{asr="Adv.~Space~Res."}
+
+@string{baas="Bull.~Am.~Astron.~Soc."}
+
+@string{bams="Bull.~Am.~Meteorol.~Soc."}
+
+@string{bpa2 = "Beitr.~Phys.~Atmosph." }
+
+@string{bpa="Contrib.~Atmos.~Phys."}
+
+@string{cap="Contrib.~Atmos.~Phys."}
+
+@string{cc  = "Climatic~Change"}
+
+@string{jc = "J.~Climate"}
+
+@string{gfd="Geophys.~Fluid~Dyn."}
+
+@string{grl="Geophys.~Res.~Lett."}
+
+@string{iaop= "Izvestiya,~Atmos.~Ocean.~Phys."}
+
+@string{jam = "J.~Appl.~Met."}
+
+@string{jas = "J.~Atmos.~Sci."}
+
+@string{jcp = "J.~Computational~Phys."}
+
+@string{jgr = "J.~Geophys.~Res."}
+
+@string{jmsj = "J.~Meteor.~Soc.~Jap."}
+
+@string{josa = "J.~Opt.~Soc.~Am."}
+
+@string{jpo = "J.~Phys.~Oceanogr."}
+
+@string{jqsrt = "J.~Spectrosc.~Radiat.~Transfer"}
+
+@string{jqsrt="J.~Quant.~Spectrosc.~Radiat.~Transfer"}
+
+@string{lnp="Lect. Notes Phys."}
+
+@string{lps="Lunar Planet Sci."}
+
+@string{mwr = "Mon. Wea. Rev." }
+
+@string{pss="Planet.~Space~Sci."}
+
+@string{ptrsl="Philos. Trans. R. Soc. London"}
+
+@string{qjr = "Q.~J.~R.~Meteorol.~Soc."}
+
+@string{rg="Rev.~Geophys."}
+
+@string{sci="Science"}
+
+@string{qjrms="Q.~J.~R.~Meteorol.~Soc."}
+
+@string{rg="Rev.~Geophys."}
+
+@string{blm="Boundary-layer Meteorol."}
+
+@article{Zent:93,
+   author = {Zent, A. P. and Haberle, R. M. and Houben, H. C. and Jakosky, B. M.},
+   journal = jgr,
+   pages = {3319-3337},
+   publisher = {Masson},
+   title = {A coupled subsurface-boundary layer model of water on {Mars}},
+   volume = {98},
+   year = {1997}
+}
+
+@misc{Forg:01,
+   author = {Forget, F. and Wanherdrick, Y. and Lewis, S. R.},
+   howpublished = {{ESA technical report, available on 
+{\tt http://www-mars.lmd.jussieu.fr/mars/esadoc/lmd/esadoc.html} }},
+   title = {Validation of the {Mars General Circulation model and Mars Climate Database with new spacecraftobservations}},
+   year = {2001}
+}
+
+@article{Bake:01,
+   author = {Baker, V. R.},
+   journal = {Nature},
+   pages = {228-236},
+   title = {Water and the martian landscape},
+   year = {2001}
+}
+
+@misc{Forg:01egs,
+   author = {Forget et al.},
+   howpublished = {Oral presentation at the EGS assembly, Nice},
+   title = {Simulation of the upper martian atmosphere up to 120 km with a General Circulation Model},
+   year = {2001}
+}
+
+@misc{Cant:01sub,
+   author = {Cantor, B. and James, P.B. and Caplinger , M. and Wolff, M. J.},
+   howpublished = {Submitted to JGR},
+   title = {Martian dust storms: 1999 Mars Orbiter Camera Observations},
+   year = {2001}
+}
+
+@article{Hins:01,
+   author = {Hinson, D},
+   journal = jgr,
+   pages = {1463-1480},
+   title = {Radio Occultation measurements of forced atmospheric waves on {Mars}},
+   volume = {106},
+   year = {2001}
+}
+
+@article{Schu:98,
+   author = {Schulz, M. and Balkanski, Y. J.  and Guelle, W. and Dulac, F.},
+   journal = jgr,
+   pages = {10,579-10,592},
+   title = {Role of aerosol size distribution and source location in a three-dimensional simulation of {Saharan} dust episode tested against staellite-derived optical thickness},
+   volume = {103},
+   year = {1998}
+}
+
+@article{Wils:00,
+   author = {Wilson, R.~J. and Richardson, M.~I.},
+   journal = {Icarus},
+   pages = {555-579},
+   title = {Infrared measurements of atmospheric temperatures revisited},
+   volume = {145},
+   year = {2000}
+}
+
+@article{Scho:97,
+   author = {Schofield, J. T. and Crisp, D. and Barnes, J. R. and Haberle, R. M. and Magalha{\~a}es, J. A. and Murphy, J. R. and Seiff, A. and Larsen, S. and Wilson, G.},
+   journal = {Science},
+   pages = {1752-1757},
+   title = {The {Mars Pathfinder Atmospheric Structure Investigation/Meteorology (ASI/MET)} experiment},
+   volume = {278},
+   year = {1997}
+}
+
+@article{Josh:00,
+   author = {Joshi, M. and Haberle, R. M. and Hollingsworth, J. and Hinson, D.},
+   journal = jgr,
+   pages = {17,601-17615},
+   title = {A comparison of {MGS} phase 1 aerobraking radio occultation data and the {NASA Ames Mars GCM}.},
+   volume = {105},
+   year = {2000}
+}
+
+@article{Clan:00,
+   author = {Clancy, R. T. and Sandor, B. J. and Woff, M. J. and Christensen, P. R. and Smith, M. D. and Pearl, J. C. and Conrath, B. J. and Wilson, R. J.},
+   journal = jgr,
+   pages = {9553-9571},
+   title = {An intercomparison of ground-based millimeter, {MGS TES}, and {Viking} atmospheric temperature measurements: Seasonal and interannual variability of temperatures and dust loading in the global {Mars} atmosphere},
+   type = {atmosphere},
+   volume = {105},
+   year = {2000}
+}
+
+@article{Forb:00,
+   author = {Forbes, J. M. and Hagan, M. E.},
+   journal = grl,
+   pages = {3563-3566},
+   title = {Diurnal {Kelvin} wave in the atmosphere of {Mars}: Toward and understanding of {``Stationary''} density structures observed by the {MGS} accelerometer.},
+   volume = {27},
+   year = {2000}
+}
+
+@article{Conr:00,
+   author = {Conrath, B. J. and Pearl, J. C. and Smith, M. D. and Maguire, W. C. and Christensen, P. R. and Dason, S. and Kaelberer, M. S.},
+   journal = jgr,
+   pages = {9509-9519},
+   title = {{Mars Global Surveyor Thermal Emission Spectrometer (Tes)} observations : atmospheric temperature during aerobraking and science phasing.},
+   volume = {105},
+   year = {2000}
+}
+
+@ARTICLE{Smit:01tes,
+   author = {{Smith}, M.~D. and {Pearl}, J.~C. and {Conrath}, B.~J. and {Christensen}, P.~R.},
+    title = {Thermal Emission Spectrometer results: Mars atmospheric thermal structure and aerosol distribution},
+  journal = jgr,
+     year = 2001,
+   volume = 106,
+    pages = {23929-23945},
+      doi = {10.1029/2000JE001321},
+}
+
+@article{Hins:99,
+   author = {Hinson, D. P. and Flasar, M. and Simpson, R. A. and Twicken, J. D. and Tyler, G. L.},
+   journal = jgr,
+   pages = {26,997-27,012},
+   title = {Initial results from radio occultation measurements with Mars Global Surveyor},
+   volume = {104},
+   year = {1999}
+}
+
+@article{Keat:98,
+   author = {Keating, G. M. and Bougher S. W. and 29-coauthors.},
+   journal = {Science},
+   pages = {1672-1676},
+   title = {The structure of the upper atmosphere of Mars: {In} situ accelerometer measurements from {Mars Global Surveyor}},
+   volume = {279},
+   year = {1998}
+}
+
+@article{Mell:00,
+   author = {Mellon, M. T. and Jakosky, B. M. and Kieffer, H. H. and Christensen, P. R.},
+   journal = {Icarus},
+   pages = {437-455},
+   title = {High resolution Thermal inertia mapping from the {Mars Global Surveyor Thermal Emission Spectrometer}},
+   volume = {148},
+   year = {2000}
+}
+
+@article{Will:93,
+   author = {Williams , A. G. and Hacker , J. M.},
+   journal = blm,
+   pages = {55-74},
+   title = {Interactions between coherent eddies in the lower convective boundary layer},
+   volume = {64},
+   year = {1993}
+}
+
+@article{Will:92,
+   author = {Williams , A. G. and Hacker , J. M.},
+   journal = blm,
+   pages = {213--245},
+   title = {The composite shape and structure of coherent eddies in the convective boundary layer},
+   volume = {61},
+   year = {1992}
+}
+
+@misc{Will:9
+}
+
+@article{Ayot:96,
+   author = {Ayotte , K. W. and Sullivan , P. P. and Andrén , A. and Doney , S. C. and Holtslag , A. A. and Large , W. G. and McWilliams , J. C. and Moeng , C.-N. and Otte , M. J. and Tribbia , J. J. and Wyngaard , J. C.},
+   address = {, J. C.},
+   journal = blm,
+   pages = {131--175},
+   title = {An evaluation of neutral and convective planetary boundary-layer parameterizations relative to large eddy simulations},
+   volume = {79},
+   year = {1996}
+}
+
+@misc{Lebo:00,
+   author = {Lebonnois , S. and Toublanc , D. and Hourdin , F. and Rannou , P.},
+   howpublished = {submitted to Icarus},
+   title = {Seasonal variations of {Titan}'s atmospheric composition},
+   year = {2000}
+}
+
+@misc{Bona:00,
+   author = {Bonazzola , M. and Picon , L. and Laurent , H. and Hourdin , F. and S\`ese , G. and Pawlowska , H. and Sadourny , R.},
+   howpublished = {Submitted to J. of Geophys. Res.},
+   title = {Direct estimate of vertical profiles of horizontal wiund difvergences from {Meteosat}-5 data over the indian ocean},
+   year = {2000}
+}
+
+@misc{Hour:00THERM,
+   author = {Hourdin , F. and Couvreux , F. and Menut , L.},
+   howpublished = {submitted to J. of Atmosph. Sci.},
+   title = {Parameterisation of the dry convective boundary layer based on a mass flux representation of thermals},
+   year = {2000}
+}
+
+@misc{Crue:00,
+   author = {Cruette, D. and Marillier , A. and Dufresne , J.-L. and Granpeix , J.-Y. and Nacass , P. and Bellec , H.},
+   howpublished = {J. Atmosph. and Oceanic Tech., in press},
+   journal = {J. Atmosph. and Oceanic Tech.},
+   title = {Fast temperature and trues  airspeed measurements with the airborne ultrasonic anemometer-thermometer (AUSAT)},
+   year = {2000}
+}
+
+@misc{VanD:00,
+   author = {Van Dop , Han},
+   howpublished = {oral presentation at the General Assembly of the European Geophiscial Society, Nice},
+   title = {Progress in coutergradient theory},
+   year = {2000}
+}
+
+@article{Raym:86,
+   author = {Raymond , D. J. and Blyth , A. M.},
+   journal = jas,
+   pages = {2708--2718},
+   title = {A stochastic model for non precipitating cumulus clouds},
+   volume = {43},
+   year = {1986}
+}
+
+@phdthesis{Will:91,
+   author = {Williams , A. G.},
+   school = {Flinders University of South Australia},
+   title = {Internal structure and interactions of coherent eddies in the lower Convective Boundary Layer},
+   year = {1991}
+}
+
+@article{Eber:89,
+   author = {Ebert , E. E. and Schumann , U. and Stull , R. B.},
+   journal = jas,
+   pages = {2178-2207},
+   title = {Non local turbulent mixing in the Convective Boundary Layer evaluated from {Large-Eddy Simulation}},
+   volume = {46},
+   year = {1989}
+}
+
+@book{Pran:34,
+   author = {Prandtl , L. and Tietjens , O. G.},
+   address = {New-York},
+   publisher = {Dover Publications, Inc.},
+   series = {Engineering Societies Monographs},
+   title = {Applied hydro- and aeromechanics},
+   year = {1934}
+}
+
+@article{Alap:97,
+   author = {Alapaty , K. A. and Pleim , J. E. and Raman , S. and Niyogi , D. S. and Byun , D. W.},
+   journal = jam,
+   pages = {214--233},
+   title = {Simulation of Atmospheric Boundary Layer Processes Using Local and Nonlocal-Closure schemes},
+   year = {1997}
+}
+
+@article{Arak:74,
+   author = {Arakawa , R. A. and Schubert , W. H.},
+   journal = jas,
+   pages = {674--701},
+   title = {Interaction of a cumulus cloud ensemble with the large scale environment. Part {I}},
+   volume = {31},
+   year = {1974}
+}
+
+@article{Eman:91,
+   author = {Emanuel , Kerry A.},
+   journal = jas,
+   pages = {2313--2335},
+   title = {A scheme for representing cumulus convection in large-scale models},
+   volume = {48},
+   year = {1991}
+}
+
+@article{Plei:92,
+   author = {Pleim , Jonathan. E. and Chang , Julius. S.},
+   journal = ae,
+   pages = {965--981},
+   title = {A non-local closure model for vertical mixing in the convective boundary layer},
+   volume = {26A},
+   year = {1992}
+}
+
+@article{Holt:93,
+   author = {Holtslag , A. A. M. and Boville , B. A.},
+   journal = jc,
+   pages = {1825--1842},
+   title = {Local Versus Non-Local Boundary-Layer Diffusion in a Global Climate Model},
+   volume = {6},
+   year = {1993}
+}
+
+@article{Troe:86,
+   author = {Troen , I. and Mahrt , L.},
+   journal = blm,
+   pages = {129--148},
+   title = {A simple model of the atmospheric boundary layer: Sensitivity to surface evaporation},
+   volume = {37},
+   year = {1986}
+}
+
+@book{Well:97,
+   author = {Wells , Neil},
+   edition = {2nd},
+   publisher = {John Wiley and Sons},
+   title = {The atmosphere and ocean : A physical Introduction},
+   year = {1997}
+}
+
+@book{Salb:96,
+   author = {Salby , Murry L.},
+   publisher = {Academic Press},
+   title = {DFundamentals of Atmospheric Physics},
+   year = {1996}
+}
+
+@article{Hour:99METEO,
+   author = {Hourdin , F. H. and Idelkadi , Abderrahmane and Bonazola , M. and Fairhead , L. and Filiberti , M.-A. and Issartel , J.-P.},
+   journal = {La m\'et\'eorologie, 8eme serie},
+   title = {Exercice de simulation de dispersion atmosph\'erique pour l'accident de Tokaimura},
+   year = {1999}
+}
+
+@misc{Hour:00b,
+   author = {Hourdin, C. and Dufresnes, J-L. and Fournier, R. and Hourdin, F.},
+   howpublished = {Article in preparation},
+   title = {Net exchange reformulation of radiative transfer in the {CO$_2$} 15$\mu$m band on Mars},
+   year = {2000}
+}
+
+@misc{Mell:99,
+   author = {Mellon, M. T. and Jakosky, B.M. and Kieffer H. H. and Christensen P. R.},
+   howpublished = {In the {\it Fifth International conference on Mars}. Abstract 6131. LPI contribution No. 972 Lunar and Planetary Institute, Houston (CD-ROM).},
+   title = {High resolution mapping of thermal inertia from {Mars Global SUrveyor Thermal Emission Spectrometer}},
+   year = {1999}
+}
+
+@article{Smit:99,
+   author = {Smith , D. E. and Zuber , M. T.  and {17 coauthors}},
+   journal = {Science},
+   pages = {1495-1503},
+   title = {The global topography of {Mars} and implication for surface evolution},
+   volume = {284},
+   year = {1999}
+}
+
+@article{Houb:97,
+   author = {Houben, H. and Haberle, R. M. and Young, R. E. and Zent, A. P.},
+   journal = jgr,
+   pages = {9069-9083},
+   title = {Modeling the {Martian} seasonal water cycle},
+   volume = {102},
+   year = {1997}
+}
+
+@article{Zent:97,
+   author = {Zent, A. P. and Quinn, R. C.},
+   journal = jgr,
+   pages = {9085-9095},
+   title = {Measurements of {H$_2$O} adsorption under {Mars} like conditions: {Effect} of adsorbent heterogeneity},
+   volume = {102},
+   year = {1997}
+}
+
+@article{Clif:83,
+   author = {Clifford, S. M. and Hillel, D.},
+   journal = jgr,
+   pages = {2456-2474},
+   title = {The stability of ground ice in the equatorial region of {Mars}},
+   volume = {88},
+   year = {1983}
+}
+
+@proceedings{VanD:98,
+   editor = {Van Dop , H. and Nodop , K.},
+   pages = {4089--4378},
+   series = {Atmos. Enrionn. special issue, pp. 4089--4378},
+   title = {{ETEX}, A european tracer experiment},
+   volume = {32},
+   year = {1998}
+}
+
+@book{Fris:95,
+   author = {Frisch, U.},
+   publisher = {Cambridge University Press},
+   title = {Turbulence: the legacy of A. N. Kolmogorov},
+   year = {1995}
+}
+
+@article{Odak:97,
+   author = {Odaka, M. and Nakajima, K. and Takehiro, S. and Ishiwatari, M. and Hayashi, Y.},
+   journal = {EPS},
+   title = {A numerical study of the martian atmospheric convection with a two dimensional anelastic model},
+   year = {1997}
+}
+
+@article{Stan:98,
+   author = {Stansberry, J. A.},
+   journal = {American astronomical society},
+   pages = {4905},
+   title = {Atmospheric control of {Triton's} frost distribution},
+   volume = {30},
+   year = {1998}
+}
+
+@mastersthesis{Alla:79,
+   author = {Allard, E.},
+   school = {Ecole nationale de la m\'et\'eorologie},
+   title = {Une m\'ethode de reconnaissance des ascendances convectives individuelles},
+   type = {Rapport de stage},
+   year = {1979}
+}
+
+@article{Renn:98,
+   author = {Renno, N. O. and Burkett, M. L. and Larkin, M. P.},
+   journal = jas,
+   pages = {3244--3252},
+   title = {A simple thermodynamical theory for dust devils},
+   volume = {55},
+   year = {1998}
+}
+
+@article{Abde:97,
+   author = {Abdella, K. and McFarlane, N.},
+   journal = jas,
+   pages = {1850--1867},
+   title = {A new second-order turbulence closure scheme for the planetary boundary layers},
+   volume = {54},
+   year = {1997}
+}
+
+@article{Stul:84,
+   author = {Stull , Roland B.},
+   journal = jas,
+   pages = {3351--3367},
+   title = {Transilient Turbulence Theory. {Part I}: The concept of Eddy-Mixing  across finite distances},
+   volume = {41},
+   year = {1984}
+}
+
+@book{Nume:86,
+   publisher = {William H.},
+   title = {Numerical Recipies: the art of scientific computing},
+   year = {1986}
+}
+
+@book{Galp:93,
+   author = {Galperin, B. and Orszag, S. A.},
+   publisher = {Cambridge University Press},
+   title = {Large eddy simulation of complex engineering and geophysical flows},
+   year = {1993}
+}
+
+@article{Moen:88,
+   author = {Moeng, C. and Wyngaard, J. C.},
+   journal = jas,
+   number = {23},
+   pages = {3573--3587},
+   title = {Spectral analysis of large-eddy simulations of the convective bounadary layer},
+   volume = {45},
+   year = {1988}
+}
+
+@article{Andr:78,
+   author = {Andr\'e, J. C. and De Moor, G. and Lacarr\`ere, P. and Therry, G. and du Vachat, R.},
+   journal = jas,
+   pages = {1861--1883},
+   title = {Modeling the 24-hour evolution of the mean and turbulent structures of the planetary boundary layer},
+   volume = {35},
+   year = {1978}
+}
+
+@article{Ogur:61,
+   author = {Ogura, Y. and Phillips, N. A.},
+   journal = jas,
+   pages = {173--179},
+   title = {Scale analysis of deep and shallow convection in the atmosphere},
+   volume = {19},
+   year = {1962}
+}
+
+@article{Lipp:90,
+   author = {Lipps, F. B.},
+   journal = jas,
+   number = {14},
+   pages = {1794--1798},
+   title = {On the anelastic approximation for deep convection},
+   volume = {47},
+   year = {1990}
+}
+
+@article{Dutt:68,
+   author = {Dutton, J. A. and Fichtl, G. H.},
+   journal = jas,
+   pages = {241--254},
+   title = {Approximate equations of motion for gases and liquids},
+   volume = {26},
+   year = {1968}
+}
+
+@article{Goug:68,
+   author = {Gough, D. O.},
+   journal = jas,
+   pages = {448--456},
+   title = {The anelastic approximation for thermal convection},
+   volume = {26},
+   year = {1968}
+}
+
+@article{Lipp:82,
+   author = {Lipps, F. B. and Hemler, R. S.},
+   journal = jas,
+   pages = {2192--2210},
+   title = {A scale analysis of deep moist convection and some related numerical calculations},
+   volume = {39},
+   year = {1982}
+}
+
+@article{Scin:92,
+   author = {Scinocca, J. F. and Shepherd, T. G.},
+   journal = jas,
+   number = {1},
+   pages = {5--27},
+   title = {Nonlinear wave-activity conservation laws and hamiltonian structure for the two-dimensional anelastic equations},
+   volume = {49},
+   year = {1992}
+}
+
+@article{Maso:88,
+   author = {Mason, P. J.},
+   journal = jas,
+   number = {11},
+   pages = {1492--1516},
+   title = {Large-eddy simulation of the convective atmospheric boundary layer},
+   volume = {46},
+   year = {1988}
+}
+
+@article{Wilh:72,
+   author = {Wilhelmson, R. and Ogura, Y.},
+   journal = jas,
+   pages = {1295--1307},
+   title = {The pressure perturbation and the numerical modelling of a cloud},
+   volume = {29},
+   year = {1972}
+}
+
+@article{Dear:72,
+   author = {Deardorff, J. W.},
+   journal = jgr,
+   number = {30},
+   pages = {5900--5904},
+   title = {Theoretical expression for the countergradient vertical heat flux},
+   volume = {77},
+   year = {1972}
+}
+
+@book{Land:89,
+   author = {Landau, L. and Lifchitz, E.},
+   publisher = {Editions {Mir} {Moscou}},
+   title = {M\'ecanique des fluides},
+   volume = {6},
+   year = {1989}
+}
+
+@book{Stul:88,
+  title={{An introduction to boundary layer meteorology}},
+  author={Stull, R.B.},
+  year={1988},
+  publisher={Kluwer Academic Publishers, Dordrecht}
+}
+
+@article{Sode:90,
+   author = {Soderblom, L. A. and Kieffer, S. W. and Becker, T. L. and Brown, R. H. and Cook, A. F. and Hansen, C. J. and Johnson, T. V. and Kirk, R. L. and Shoemaker, E. M.},
+   journal = {Science},
+   pages = {410-415},
+   title = {Triton's geyser-like plumes : Discovery and basic characterization},
+   volume = {250},
+   year = {1990}
+}
+
+@article{Atki:96,
+   author = {Atkinson, B. W. and Zhang, J. W.},
+   journal = {Reviews of Geophysics},
+   pages = {403--431},
+   title = {Mesoscale shallow convection in the atmosphere},
+   volume = {34},
+   year = {1996}
+}
+
+@book{Lesi:90,
+   author = {Lesieur, M.},
+   publisher = {Kluwer Academic Publishers},
+   title = {Turbulence in fluids},
+   year = {1990}
+}
+
+@article{Moen:84,
+   author = {Moeng, C.},
+   journal = jas,
+   number = {13},
+   pages = {2052--2062},
+   title = {A large-eddy-simulation model for the study of planetary boundary-layer turbulence},
+   volume = {41},
+   year = {1984}
+}
+
+@article{Shut:94,
+   author = {Shutts, G. J. and Gray, E. B.},
+   journal = qjr,
+   pages = {1145--1178},
+   title = {A numerical modelling study of the geostrophic adjustement process following deep convection},
+   volume = {120},
+   year = {1994}
+}
+
+@article{Lill:62,
+   author = {Lilly, D. K.},
+   journal = {Tellus},
+   number = {2},
+   pages = {148--172},
+   title = {On the numerical simulation of buoyant convection},
+   volume = {14},
+   year = {1962}
+}
+
+@article{Herb:91,
+   author = {Herbert, F. and Sandel, B. R.},
+   journal = jgr,
+   pages = {19241-19252},
+   title = {{CH}$_4$ and haze in {Triton's} lower atmosphere},
+   volume = {96},
+   year = {1991}
+}
+
+@article{Mark:99,
+   author = {Markiewicz, W. J. and Sablotny, R. M. and Keller, H. U. and Thomas, N. and Titov, D. and Smith, P. H.},
+   journal = jgr,
+   pages = {9009-9017},
+   title = {Optical properties of the {Martian} aerosols as derived from
+ Imager for {Mars Pathfinder} midday sky brightness data},
+   volume = {104},
+   year = {1999}
+}
+
+@article{Stan:92,
+   author = {Stansberry, J. A. and Yelle, R. V. and Lunine, J. L. and McEwen, A. S.},
+   journal = {Icarus},
+   pages = {242-260},
+   title = {Triton's surface-atmosphere energy balance},
+   volume = {99},
+   year = {1992}
+}
+
+@book{Weas:67,
+   editor = {Weast, R. C.},
+   publisher = {{CRC,Cleaveland}},
+   title = {Handbook of {Chemistry and Physics}},
+   year = {1967}
+}
+
+@article{Clan:98,
+   author = {Clancy, R. T. and Sandor, B. J.},
+   journal = grl,
+   pages = {489-492},
+   title = {CO{$_2$} ice clouds in the upper atmosphere of {Mars}},
+   volume = {25},
+   year = {1998}
+}
+
+@article{Chri:98,
+   author = {Christensen, P. R. and Anderson, D. L. and Chase, S. C. and Clancy, R. T. and Clark, R.N. and Conrath, B. J. and Kieffer, H. H. and Kuzmin, R. O. and Malin, M. C. and Pearl, J. C. and Roush, T. L. and Smith, M. D.},
+   address = { Smith, M. D.},
+   journal = {Science},
+   pages = {1692-1698},
+   title = {Results from the {Mars Global Surveyor Thermal Emission Spectrometer}},
+   volume = {279},
+   year = {1998}
+}
+
+@misc{Pier:97,
+   author = {Pierrehumbert, R. T. and Erlick, C.},
+   howpublished = {J. Atmos. Sci, in press},
+   title = {On the scattering-greenhouse effect of {CO$_2$} ice clouds},
+   year = {1977}
+}
+
+@article{Hourd:98b,
+   author = {Hourdin , Frédéric and Issartel , Jean-Pierre},
+   journal = {In preparation},
+   title = {Reciprocity of transport of atmospheric tracers and CTBT monitoring of nuclear tests.},
+   year = {1998}
+}
+
+@article{Dele:94,
+   author = {Deleersnijder, E. and Luyten},
+   journal = {Applied Mathematical Modelling},
+   pages = {281-287},
+   volume = {18},
+   year = {1994}
+}
+
+@article{Forg:98dps,
+   author = {Forget, F. and Hourdin, F. and Hourdin, C. and Talagrand, O.},
+   journal = baas,
+   pages = {1023},
+   title = {Simulation of dust lifting and transport with the {LMD} {Mars} general circulation model},
+   volume = {30},
+   year = {1998}
+}
+
+@inproceedings{Forg:98erca,
+   author = {Forget, F.},
+   booktitle = {European Research Course on Atmosphere {III}},
+   editor = {C. Boutron},
+   note = {(in press)},
+   publisher = {Les Edition de physique},
+   title = {Climate and habitability of terrestrial planets around other stars},
+   year = {1998}
+}
+
+@article{Elli:98,
+   author = {Elliot, J. L. and Hammel, H. B. and Wasserman, L. H. and Franz, O. G. and McDonald, S. W. and Person, M. J. and Olkin, C. B. and Dunham, E. W. and Spencer, J. R. and Stansberry, J. A. and Buie, M. W.},
+   journal = {Nature},
+   pages = {765-767},
+   title = {Global Warming on Triton},
+   volume = {393},
+   year = {1998}
+}
+
+@article{Mayo:95,
+   author = {Mayor, M. and Queloz, D.},
+   journal = {Nature},
+   pages = {355-359},
+   title = {A {Jupiter-mass} companion to a solar-type star},
+   volume = {378},
+   year = {1995}
+}
+
+@article{Butl:96,
+   author = {Butler, P. and Marcy, G.},
+   journal = {Ap.J. Letters},
+   pages = {L153-L156},
+   title = {A Planet orbiting 47 {Uma}},
+   volume = {464},
+   year = {1996}
+}
+
+@phdthesis{Gurw:96,
+   author = {Gurwell, M. A.},
+   school = {California institute of technology},
+   title = {Planetary atmospheres: probing structure through millimeterwave observations of carbon monoxide.},
+   year = {1996}
+}
+
+@misc{Jego:98,
+   author = {Jegou, F.},
+   howpublished = {Rapport de stage de DEA, Universit{\'e} Paris 6},
+   title = { {Effets des mar\`ees atmosph\'eriques sur la circulation
+ de la moyenne atmosph\`ere martienne}},
+   year = {1998}
+}
+
+@article{From:68,
+   author = {From , J. E.},
+   journal = jcp,
+   pages = {176-189},
+   title = {A method for reducing dispersion in convective difference schemes},
+   volume = {3},
+   year = {1968}
+}
+
+@article{Hosk:81,
+   author = {Hoskins, B.J. and Karoly, D. J.},
+   journal = jas,
+   pages = {1179-1196},
+   title = {The steady linear response of a spherical atmosphere to thermal and orographic forcing},
+   volume = {38},
+   year = {1981}
+}
+
+@article{MacV:83,
+   author = {MacVean, M. K.},
+   howpublished = qjrms,
+   journal = qjrms,
+   pages = {771-783},
+   title = {The effect of horizontal diffusion on baroclinic development in a spectral model},
+   volume = {38},
+   year = {1983}
+}
+
+@article{Cole:84,
+   author = {Colella , P. and Woodward , P. R.},
+   journal = jcp,
+   pages = {174--201},
+   title = {The Piecewise parabolic method ({PPM}) for gaz-dynamical simulations},
+   volume = {54},
+   year = {1984}
+}
+
+@misc{Gree:94b,
+   author = {Greeley, R. and Blumberg, D. G. and Williams, S. H.},
+   howpublished = {Abstract of the workshop on Reponse of Eolian Processes to Global changes, Desert research Institute},
+   title = {Field measurements  of active windblown sand},
+   year = {1994}
+}
+
+@article{Shao:93,
+   author = {Shao, Y. and Raupach, M. R.  and Findlater , P. A.},
+   journal = jgr,
+   pages = {12719-12726},
+   title = {Effect of saltation bombardment  on the entrainment  of dust by wind},
+   volume = {98},
+   year = {1993}
+}
+
+@article{Mart:95lisa,
+   author = {Marticorena, N. and Bergametti, G.},
+   journal = jgr,
+   pages = {16,415-16,430},
+   title = {Modeling the atmospheric dust cycle: design of a soil-derived emission scheme},
+   volume = {102},
+   year = {1995}
+}
+
+@inproceedings{Muhl:93,
+   author = {Muhleman, D. O. and Clancy, R. T.},
+   booktitle = {Atmospheric remote sensing by microwave radiometry},
+   chapter = {9},
+   editor = {Janssen, M. A.},
+   pages = {497-533},
+   title = {Retrieval of atmospheric parameters in planetary atmospheres from microwave spectroscopy},
+   year = {1993}
+}
+
+@article{Lell:91b,
+   author = {Lellouch, E.  and Paubert, G. and Encrenaz, T.},
+   howpublished = pss,
+   journal = pss,
+   pages = {219-224},
+   title = {Mapping of {CO} millimeter-wave lines in {Mars}'atmosphere: the spatial variability of carbon monoxide on Mars.},
+   volume = {39},
+   year = {1991}
+}
+
+@article{Elli:97,
+   author = {Elliot, J. L. and Stansberry , J. A. and Olkin, C. B. and Agner , M. A. and Davies , M. E.},
+   journal = {Science},
+   pages = {436-439},
+   title = {Triton's distorted atmosphere},
+   volume = {278},
+   year = {1997}
+}
+
+@article{Olki:97,
+   author = {Olkin, C. B.  \protect{et al.}},
+   journal = {Icarus},
+   pages = {178-201},
+   title = {The thermal structure of triton's atmosphere:  {Results from the 1993 and 1995 occultations}},
+   volume = {129},
+   year = {1997}
+}
+
+@article{Bill:98,
+   author = {Billebaud, F. and Rosenqvist , J. and Lellouch , E. and Maillard , J.-P. and Encrenaz , T. and Hourdin , F.},
+   journal = {Planetary and Space Sciences, accepted for publication},
+   title = {Observations of $CO$ in the atmosphere of {Mars} in the (2-0) vibrational band at 2.35 microns},
+   year = {1998}
+}
+
+@article{Bill:98b,
+   author = {Billebaud , F. and Rosenqvist , J. and Hourdin F.},
+   journal = aa,
+   title = {Observations of CO in the atmosphere of Mars in the (2-0) vibrational band at 2.35 microns},
+   year = {1998}
+}
+
+@misc{Defr:00,
+   author = { Defraigne , P. and de Viron , O. and Dehant , V. and Van Hoolst , T. and Hourdin , F.},
+   howpublished = {JGR},
+   title = {Mars atmospheric rotation induced by atmospheric CO2 and winds},
+   year = {2000}
+}
+
+@misc{Hech:97,
+   author = {Hechler, M.},
+   howpublished = {M.A.S. working paper n$^o$398b},
+   title = {{Mars Express} mission analysis: proposed orbits},
+   year = {1997}
+}
+
+@article{Owen:79,
+   author = {Owen, T. and Cess, R. D.  and Ramanathan , V.},
+   journal = {Nature},
+   pages = {640-642},
+   title = {Early {Earth: An enhanced carbon dioxide greenhouse to compensate for reduced solar luminocity}},
+   volume = {277},
+   year = {1979}
+}
+
+@article{Toub:95,
+   author = {Toublanc , D. and Parisot , J. P. and Brillet , J. and Gautier , D. and Raulin , F. and McKay , C. P.},
+   journal = {Icarus},
+   pages = {2-26},
+   title = {Photochemical modelling of {Titan's} atmosphere},
+   volume = {113},
+   year = {1995}
+}
+
+@article{Forg:98grl,
+   author = {Forget, F.},
+   journal = grl,
+   pages = {1105-1109},
+   title = {Improved optical properties of the {Martian} atmospheric dust for radiative transfer calculations in the infrared},
+   volume = {25},
+   year = {1998}
+}
+
+@article{Forg:97,
+   author = {Forget,  F. and Pierrehumbert, R. T.},
+   journal = {Science},
+   pages = {1273-1276},
+   title = {Warming early {Mars} with carbon dioxide clouds that scatter infrared radiation},
+   volume = {278},
+   year = {1997}
+}
+
+@article{Carr:95,
+   author = {Carr, M. H.},
+   journal = jgr,
+   pages = {7479-7505},
+   title = {The {Martian} drainage system and the origin of valley networks and fretted channels},
+   volume = {100},
+   year = {1995}
+}
+
+@article{Ghil:97,
+   author = {Ghil , M. and Ide , K. and Benett , A. and Courtier , P. and Kimoto , M. and Nagata , M. and Saiki , M. and Sato , M.},
+   journal = jmsj,
+   pages = {111--196},
+   title = {Data assimilation in Meteorology and Oceanography : Theory and Practice},
+   volume = {75},
+   year = {1997}
+}
+
+@article{Carr:97,
+   author = {Carr, M. H. and Chuang, F. C.},
+   journal = jgr,
+   pages = {9145-9152},
+   title = {Martian drainage densities},
+   volume = {102},
+   year = {1997}
+}
+
+@article{Tala:97,
+   author = {Talagrand , O.},
+   journal = jmsj,
+   pages = {191-209},
+   title = {Assimilation of Observations : An introduction},
+   volume = {75},
+   year = {1997}
+}
+
+@misc{Stan:95,
+   author = {Stansberry, J. A.  and Haberle, R. M. and McKay, C. P.},
+   howpublished = {Paper presented at the 27th Annual Meeting of the Division for Planetary Science of the AAS, Hawaii, October 9, 1995},
+   year = {1995}
+}
+
+@article{Step:90,
+   author = {Stephens , G. L. and Tsay, S-C  and Stackhouse , P. W. and Flatau , P. J.},
+   journal = jas,
+   pages = {1742-1753},
+   title = {The relevance of the Microphysical and radiative properties of cirrus clouds to climate and climatic feedback},
+   volume = {47},
+   year = {1990}
+}
+
+@article{Wood:96,
+   author = {Wood, S. E. and Richardson, M. I. and Paige , D. A.},
+   journal = baas,
+   pages = {1065},
+   title = {A microphysical model of {CO$_2$} snow on {Mars}},
+   volume = {28},
+   year = {1996}
+}
+
+@article{Jens:94,
+   author = {Jensen, E. J. and Kinne, S. and Toon, O. B.},
+   journal = grl,
+   pages = {2023-2026},
+   title = {Tropical cirrus cloud radiative forcing: Sensitivity studies},
+   volume = {21},
+   year = {1994}
+}
+
+@article{Samu:67,
+   author = {Samuelson, R. E.},
+   journal = {Astrophys. J.},
+   pages = {782-798},
+   title = {Greenhouse effect in semi-infinite atmospheres: {Application} to {Venus}},
+   volume = {147},
+   year = {1967}
+}
+
+@article{Saga:97,
+   author = {Sagan, C.  and Chyba, C.},
+   journal = {Science},
+   pages = {1217-1221},
+   title = {The early faint young sun paradox: organic shielding of ultraviolet-labile greenhouse gases},
+   volume = {276},
+   year = {1997}
+}
+
+@article{Kast:97,
+   author = {Kasting, J. F.},
+   journal = {Science},
+   pages = {1213-1215},
+   title = {Warming early earth and mars},
+   volume = {276},
+   year = {1997}
+}
+
+@article{Cald:92,
+   author = {Cadeira, K. and Kasting, J. F},
+   journal = {Nature},
+   pages = {226-228},
+   title = {Susceptibility of the early Earth to irreversible glaciation caused by carbon dioxide clouds},
+   volume = {359},
+   year = {1992}
+}
+
+@article{Doug:93,
+   author = {Douglass , A. and Rood , R. and Waters , J. and Froidevaux , L. and Read , W. and Elson , L. and Geller , M. and Chi , Y. and Cerniglia , M. and Steenrod , S.},
+   journal = grl,
+   pages = {1271-1274},
+   title = {A {3D} simulation of the early winter distribution of reactive chlorine in the north polar vortex},
+   volume = {20},
+   year = {1993}
+}
+
+@article{Murp:95,
+   author = {Murphy, J.R. and Pollack, J. B.  and Haberle, R. M. and Leovy , C. B.  and Toon, O. B.  and Schaeffer, J.},
+   journal = jgr,
+   pages = {26357-26376},
+   title = {Three-dimensional numerical simulation of {Martian} global dust storms},
+   volume = {100},
+   year = {1995}
+}
+
+@article{Alle:91,
+   author = {Allen , Dale J. and Douglass , Anne R. and Rood , Richard B. and Guthrie , Paul D.},
+   journal = mwr,
+   pages = {2456--2464},
+   title = {Application of a monotonic upstream-biased transport scheme to three dimensional constituent transport calculations},
+   volume = {119},
+   year = {1991}
+}
+
+@article{Will:89,
+   author = {Williamson , David and Rasch , Philip J.},
+   journal = mwr,
+   pages = {102--127},
+   title = {Two Dimensional Semi-Lagrangian Transport with shape-preserving interpolation},
+   volume = {117},
+   year = {1989}
+}
+
+@article{Lin:96,
+   author = {Lin , Shian-Jiann and Rood, R. B.},
+   journal = mwr,
+   pages = {2046--2070},
+   title = {Multi-Dimensional Flux Form Semi-Lagrangian Transport Schemes},
+   volume = {124},
+   year = {1996}
+}
+
+@article{Godu:59,
+   author = {Godunov , S. K.},
+   journal = {Math. Sb.},
+   pages = {271-290},
+   title = {Finite-Difference Methods for the numerical computations of equations of gas dynamics},
+   volume = {7},
+   year = {1959}
+}
+
+@article{Rood:87,
+   author = {Rood , Richard B.},
+   journal = rg,
+   pages = {71-100},
+   title = {Numerical advection algorithms and their role in atmospheric transport and chemistry models},
+   volume = {25},
+   year = {1987}
+}
+
+@article{Wils:97,
+   author = {Wilson, R. J.},
+   journal = grl,
+   pages = {123-126},
+   title = {A general circulation model of the {Martian} polar warming},
+   volume = {24},
+   year = {1997}
+}
+
+@article{Spra:96,
+   author = {Sprague, A. L. and Hunten, D. M. and Hill, R. E. and Risk, B. and Wells, W. K.},
+   journal = jgr,
+   pages = {23,229-23,241},
+   title = {Martian water vapor, 1988-1995},
+   volume = {101},
+   year = {`1996}
+}
+
+@inproceedings{Poll:93msatt,
+   author = {Pollack, J. B. and Forget F. and Haberle , R.M. and Schaeffer , J. and Lee , H.},
+   address = {Lunar and Planetary Institute, Houston},
+   booktitle = {Mars: past, present and future.{Results from the MSATT program}},
+   journal = {LPI},
+   pages = {43},
+   series = {{LPI} Technical report},
+   title = {Controls on the {CO_2} seasonal cycle},
+   volume = {43P},
+   year = {1993}
+}
+
+@article{Edou:96,
+   author = {Edouard , S. and Legras , B. and Lef\`evre , F. and Eymard , R.},
+   journal = {Nature},
+   title = {The effect of small-scale inhomogeneities on ozone depletion in the {Artic}},
+   volume = {384},
+   year = {1996}
+}
+
+@article{Edou:96a,
+   author = {Edouard , S. and Legras , B. and Zeitlin , V.},
+   journal = jgr,
+   number = {D11},
+   pages = {16771-16779},
+   title = {The effect of dynamical mixing in a simple model of the ozone hole},
+   volume = {101},
+   year = {1996}
+}
+
+@article{Kast:93,
+   author = {Kasting,  J.F. and Whitmire , D. P. and Reynolds, R. T.},
+   journal = {Icarus},
+   pages = {108-128},
+   title = {Habitable zones around main sequence stars},
+   volume = {101},
+   year = {1993}
+}
+
+@book{Doyl:96,
+   address = {Menlo Park, California},
+   editor = {Doyle, L. R.},
+   publisher = {Travis House Pulications},
+   title = {Circumstellar Habitable Zone},
+   year = {1996}
+}
+
+@article{Josh:97,
+   author = {Joshi, M. M. and Haberle, R. M. and Reynolds, R. T.},
+   journal = {Icarus},
+   pages = {450-465},
+   title = {Simulations of the atmospheres of synchronously rotating terrestrial planets orbiting {M} dwarfs: conditions for atmospheric collapse and the implications for habitability},
+   volume = {129},
+   year = {1997}
+}
+
+@article{Will:97a,
+   author = {Williams, D. M. and Kasting, J. F.},
+   journal = {Icarus},
+   pages = {254-267},
+   title = {Habitable planets with high obliquities},
+   volume = {129},
+   year = {1997}
+}
+
+@article{Will:97b,
+   author = {Williams, D. M. and Kasting, J. F. and Wade, R. A.},
+   journal = {Nature},
+   pages = {234-236},
+   title = {Habitable moons around extrasolar planets},
+   volume = {385},
+   year = {1997}
+}
+
+@article{Gera:88,
+   author = {Gerard, J. C. and Francois, L. M.},
+   journal = {Annales Geophysicae},
+   pages = {101-112},
+   title = {A sensitivity study of the effects of solar luminosity changes on the Earth's global temperature},
+   volume = {6},
+   year = {1988}
+}
+
+@article{Brac:93,
+   author = {Brack, A.},
+   journal = {Orig. of Life},
+   pages = {23},
+   volume = {3-10},
+   title = {Liquid water and the origin of life},
+   year = {1993}
+}
+
+@inproceedings{Saga:96,
+   author = {Sagan, C.},
+   booktitle = {Circumstellar Habitable Zones},
+   chapter = {1},
+   editor = {Doyle, L. R.},
+   pages = {3-14},
+   title = {Circumstellar habitable zones: an introduction},
+   year = {1996}
+}
+
+@inproceedings{Whit:96,
+   author = {Whitmire, D. P. and Reynolds, R. T.},
+   booktitle = {Circumstellar Habitable Zones},
+   editor = {Doyle, L. R.},
+   pages = {117-142},
+   title = {Circumstellar habitable zones: Astronomical considerations},
+   year = {1996}
+}
+
+@article{Dona:82,
+   author = {Donahue, T. M. and Hoffman, J. H. and Hodges, R. R. and Watson, A. J.},
+   journal = {Science},
+   pages = {630-633},
+   title = {Venus was wet: a measurement of the ratio of deuterium to hydrogen},
+   volume = {216},
+   year = {1982}
+}
+
+@article{Grin:93,
+   author = {Grinspoon, D. H.},
+   journal = {Nature},
+   pages = {428-431},
+   title = {Implications of the high {D/H} ratio for the sources of water in Venus' atmosphere},
+   volume = {363},
+   year = {1993}
+}
+
+@article{Elli:96,
+   author = {Elliot , J. L. and Stansberry, J. A. and Olkin, C. B.},
+   journal = baas,
+   pages = {1079},
+   title = {Triton's distorted atmosphere},
+   volume = {28},
+   year = {1996}
+}
+
+@article{Stan:96,
+   author = {Stansberry , J. A. and Elliot, J. L. and Olkin, C. B.},
+   journal = baas,
+   pages = {1079},
+   title = {Strong zonal winds in {Triton's (and Pluto's?)} middle atmosphere},
+   volume = {28},
+   year = {1996}
+}
+
+@inproceedings{Harr:84,
+   author = {Harris, A. W.},
+   booktitle = {{Uranus and Neptune}},
+   editor = {Bergstralh, J. T.},
+   organization = {NASA CP-2330},
+   pages = {357-376},
+   title = {Physical properties of {Neptune and Triton} inferred from the orbit of {Triton}},
+   year = {1984}
+}
+
+@inproceedings{Yell:95,
+   author = {Yelle, R. V. and Lunine, J. I. and Pollack, J. B. and Brown, R. H.},
+   booktitle = {Neptune and {Triton}},
+   editor = {Cruikshank, D. P.},
+   pages = {1031-1105},
+   publisher = {The university of {Arizona} press},
+   title = {Lower atmospheric structure and surface-atmosphere interactions on {Triton}},
+   year = {1995}
+}
+
+@inproceedings{Gurr:92,
+   author = {Gurrola, E. M. and Marouf, E. A. and Eshleman, V. R. and Tyler, G. L. and Rosen, P. A.},
+   booktitle = {Neptune and {Triton}, Abstract book},
+   pages = {28},
+   publisher = {The university of {Arizona} press},
+   title = {Analysis of {Voyager} radio occultation observations of {Triton}},
+   year = {1992}
+}
+
+@article{Caba:92,
+   author = {Cabane , M. and Chassefi\`ere , E. and Israel , G.},
+   journal = {Icarus},
+   pages = {176-189},
+   title = {Formation and growth of photochemical aerosols in {Titan's} atmosphere},
+   volume = {96},
+   year = {1992}
+}
+
+@article{Caba:93,
+   author = {Cabane , M. and Rannou , P. and Chassefi\`ere , E. and Israel , G.},
+   journal = pss,
+   pages = {257-267},
+   title = {Fractal aggregates in {Titan's} atmosphere},
+   volume = {41},
+   year = {1993}
+}
+
+@article{Caba:94,
+   author = {Cabane , M. and Chassefi\`ere , E.},
+   journal = pss,
+   pages = {47-65},
+   title = {Laboratory simulations of {Titan's} atmosphere},
+   volume = {43},
+   year = {1994}
+}
+
+@article{Bote:95,
+   author = {Botet, R. and Rannou , P. and Cabane , M.},
+   journal = {J. Physics A},
+   pages = {297-316},
+   title = {Sensitivity of some optical properties of fractals to the cut-off functions},
+   volume = {28},
+   year = {1995}
+}
+
+@article{Bote:97,
+   author = {Botet , R. and Rannou , P. and Cabane , M.},
+   journal = {Applied Optics, in press},
+   title = {Mean field scattering aproximation of {Mie} scattering by fractal aggregates of identical spheres},
+   year = {1997}
+}
+
+@article{Leva:97,
+   author = {Levasseur-Regourd , A.-C. and Cabane , M. and  Worms , J. C. and Haudebourg, V.},
+   journal = {Advances in Space Research, in press},
+   title = {Physical properties of dust in the Solar System: relevance of a computational approach and of measurements under microgravity conditions},
+   year = {1997}
+}
+
+@article{Rann:93,
+   author = {Rannou , P. and Cabane , M. and Chassefi\`ere , E.},
+   journal = grl,
+   pages = {967-970},
+   title = {Growth of aerosols in {Titan's} atmosphere and related time scales : a stochastic approach},
+   volume = {20},
+   year = {1993}
+}
+
+@article{Rann:97,
+   author = {Rannou , P. and Cabane , M. and Botet , R.  and Chassefi\`ere , E.},
+   journal = jgr,
+   pages = {10997-11013},
+   title = {A new interpretation of scattered light at {Titan's} limb},
+   volume = {102},
+   year = {1997}
+}
+
+@article{Rann:97b,
+   author = {Rannou , P. and McKay , C. P. and Botet , R. and Cabane , M.},
+   journal = {to be submitted to Applied Optics},
+   title = {A Semi-empirical model of absorption and scattering by isotropic fractal aggregates of spheres},
+   year = {1997}
+}
+
+@article{Rann:95,
+   author = {Rannou , P. and Cabane , M. and Chassefi\`ere , E. and Botet , R. and McKay , C. P. and Courtin , R.},
+   journal = {Icarus},
+   pages = {355-372},
+   title = {Titan's geometric albedo : Role of the fractal structure of the aerosols},
+   volume = {96},
+   year = {1995}
+}
+
+@article{Forg:96egs,
+   author = {Forget , F. and Hourdin, F. and Talagrand, O.},
+   journal = {Ann. Geophys.},
+   pages = {C797},
+   title = {Simulation of the {Martian} atmospheric polar warming with the {LMD} general circulation model},
+   volume = {14},
+   year = {1996}
+}
+
+@article{Forg:96dps,
+   author = {Forget, F.  and Hourdin, F. and Fournier, R. and Talagrand, O.},
+   journal = baas,
+   note = {Oral presentation for the 28th DPS meeting, Tucson, Arizona},
+   pages = {1066},
+   title = {Simulation of the {Martian} polar climate withe the {LMD} General Circulation model: {CO$_2$ snow} falls and upper atmosphere polar warming},
+   volume = {28},
+   year = {1996}
+}
+
+@misc{Ono:96,
+   author = {Ono , A.M. and Paige , D. A.},
+   journal = baas,
+   pages = {1060},
+   title = {
+ IRTM observations of {Martian} South Polar Frosts
+},
+   volume = {28},
+   year = {1996}
+}
+
+@misc{Forg:96gcm,
+   author = {Forget, F.},
+   howpublished = {Présentation invitée au ``Mars GCM intercomparison workshop''},
+   note = {Oxford, juillet 1996},
+   title = {Intercomparison of {GCM} simulations at winter solstice with dust storm conditions},
+   year = {1996}
+}
+
+@mastersthesis{Meno:95,
+   author = {Menou , Kristen},
+   school = {DEA d'astrophysique et t\'echniques spatiales,  {PARIS-7}},
+   title = {D\'eveloppement d'un code de transfert radiatif de l'atmosph\`ere de V\'enus},
+   year = {1995}
+}
+
+@mastersthesis{DeVa:96,
+   author = {De Vaulgrenant , Guyonne},
+   school = {DEA d'océanographie,  m\'et\'eorologie et environnement  {(PARIS-VI)}},
+   title = {Pr\'eparation de l'assimilation des observations des futures missions martiennes},
+   year = {1996}
+}
+
+@article{Cher:96,
+   author = {Cherkaoui, M. and Dufresne, J.L. and Fournier, R. and Grandpeix, J.Y. and Lahellec, A.},
+   journal = {ASME Journal of Heat Transfer},
+   pages = {401--407},
+   title = {Monte-Carlo Simulation of Radiation in Gases with a Narrow-Band Model and a Net-Exchange Formulation},
+   volume = {118},
+   year = {1996}
+}
+
+@article{Lope:95,
+   author = {Lopez-Puertas, M. and Lopez-Valverde , M.A.},
+   journal = {Icarus},
+   pages = {113-129},
+   title = {Radiative energy balance of {CO$_2$} non-{LTE} infrared emissions in the {Martian} atmosphere},
+   volume = {114},
+   year = {1995}
+}
+
+@article{Thom:79cap,
+   author = {Thomas, P. and Veverka, J. and Campos-Marquetti , R.},
+   journal = jgr,
+   pages = {4621-4633},
+   title = {Frost streaks in the south polar cap of {Mars}},
+   volume = {84},
+   year = {1979}
+}
+
+@article{Jous:90,
+   author = {Joussaume , S.},
+   journal = jgr,
+   pages = {1909-1941},
+   title = {Three-dimensional simulations od the atmospheric cycle of desert dust particles using a general circulation model},
+   volume = {95},
+   year = {1990}
+}
+
+@inproceedings{Slin:83,
+   author = {Slinn, W. G. N.},
+   booktitle = {Air -sea exchange of gases and particles},
+   editor = {Liss, P.S. and Slinn, W. G. N.},
+   pages = {299-405},
+   publisher = {D. Reidel Publishing Company},
+   title = {Air to sea transfer of particles},
+   year = {1983}
+}
+
+@article{Haya:95,
+   author = {Hayashi, J. N. and Jakosky, B. M. and Haberle , R. M.},
+   journal = jgr,
+   pages = {5277-5284},
+   title = {Atmospheric effects on the mapping of {Martian} thermal inertia and thermally derived albedo},
+   volume = {100},
+   year = {1995}
+}
+
+@book{DeVa:54,
+   author = {De Vaucouleurs , G.},
+   publisher = {Faber and Faber, London},
+   title = {Physics of the planet {Mars}},
+   year = {1954}
+}
+
+@misc{Airl:76,
+   author = {Air-liquide},
+   note = {Elsevier publication},
+   title = {Encyclopédie des gaz},
+   year = {1976}
+}
+
+@article{Kast:91,
+   author = {Kasting, J. F.},
+   journal = {Icarus},
+   pages = {1-13},
+   title = {{CO$_2$} condensation and the early climate of {Mars}},
+   volume = {94},
+   year = {1991}
+}
+
+@inproceedings{Kast:91book,
+   author = {Kasting, J. F. and Grinspoon, M. S.},
+   booktitle = {The sun in time},
+   editor = {Sonett, C.P. and Grinspoon, M.S. and Matthews, M.S.},
+   pages = {447-462},
+   title = {The faint young sun problem},
+   year = {1991}
+}
+
+@article{Kast:88,
+   author = {Kasting, J. F.},
+   journal = {Icarus},
+   pages = {472-494},
+   title = {Runaway and moist greenhouse atmosphere and the evolution of {Earth} and {Venus}},
+   volume = {74},
+   year = {1988}
+}
+
+@article{Jako:97,
+   author = {Jakosky, B. M. and Jones , J. H.},
+   journal = {Review of Geophysics},
+   pages = {1 -16},
+   title = {The history of {Martian} volatiles},
+   volume = {35},
+   year = {1997}
+}
+
+@article{Sell:69,
+   author = {Sellers, W.D.},
+   journal = jam,
+   pages = {392-400},
+   title = {A climate model based on the energy balance of the {Earth}-atmosphere system},
+   volume = {8},
+   year = {1969}
+}
+
+@article{Gera:92,
+   author = {Gerard, J.-C. and Hauglustaine , D. A. and Francois, L. M.},
+   journal = {Paleogeogr., Paleoclimatol., Paleoecol.},
+   pages = {133-150},
+   title = {The faint young sun climatic paradox: a simulation with an interactive seasonal climate-sea ice model},
+   volume = {97},
+   year = {1992}
+}
+
+@article{Long:97,
+   author = {Longdoz, B. and Francois, L. M.},
+   journal = {Global and Planetary change},
+   pages = {97-112},
+   title = {The faint young sun paradox: influence of the continental configuration and of the seasonal cycle on the climatic stability},
+   volume = {14},
+   year = {1997}
+}
+
+@article{Walk:81,
+   author = {Walker, J. C. G. and Hays, P. B. and Kasting, J. F.},
+   howpublished = jgr,
+   journal = jgr,
+   pages = {9776-9782},
+   title = {A negative feedback mechanism for the long term stabilization of the Earth's surface temperature.},
+   volume = {86},
+   year = {1981}
+}
+
+@inproceedings{Fran:93,
+   author = {Francois, L. M. and Walker, J. C. G. and Opdyke, B. N.},
+   booktitle = {Evolution of the Earth and Planets},
+   editor = {Takahashi, E. and Jeanloz, R.  and  Dubie, D.},
+   pages = {143-159},
+   publisher = {IUGG},
+   title = {The history of global weathering and the chemical evolution of the ocean-atmosphere system},
+   volume = {14},
+   year = {1993}
+}
+
+@article{Hoff:98,
+   author = {Hoffman, P. F. and Kaufman, A. J. and Halverson, G. P. and Schrag, D. P.},
+   journal = {Science},
+   pages = {1342-1346},
+   title = {A neoproterozoic snowball {Earth}},
+   volume = {281},
+   year = {1998}
+}
+
+@article{Chyb:97,
+   author = {Chyba, C. F.},
+   journal = {Nature},
+   pages = {201},
+   title = {Life on other moons},
+   volume = {385},
+   year = {1997}
+}
+
+@article{Carr:98,
+   author = {Carr, M. H. and {21 co-authors}},
+   journal = {Nature},
+   pages = {363-365},
+   title = {Evidence for aubsurface ocean on {Europa}},
+   volume = {391},
+   year = {1998}
+}
+
+@article{Scho:93,
+   author = {Schopf, J. W.},
+   journal = {Science},
+   pages = {640-646},
+   title = {Microfossils of the early archean apex chert: new evidence of the antiquity of life},
+   volume = {260},
+   year = {1993}
+}
+
+@article{Mojz:96,
+   author = {Mojzsis, S. J. and Arrhenius, G. and McKeegan, K, D. and Harrison, T. M. and Nutman, A. P. and Friend, C. R. L.},
+   journal = {Nature},
+   pages = {55-59},
+   title = {Evidence for life on Earth before 3,800 million years ago},
+   volume = {384},
+   year = {1996}
+}
+
+@article{Goug:81,
+   author = {Gough, D. O.},
+   journal = {Solar Phys.},
+   pages = {21-34},
+   title = {Solar interior structure and luminosity variations},
+   volume = {74},
+   year = {1981}
+}
+
+@article{Whit:95,
+   author = {Whitmire, D. P. and Doyle, L. R. and Reynolds, R. T. and Matese, J.J.},
+   journal = jgr,
+   pages = {5457-5464},
+   title = {A slightly more massive young sun as an explanation for warm temperature on early {Mars}},
+   volume = {100},
+   year = {1995}
+}
+
+@article{Habe:94,
+   author = {Haberle, R.M.  and Tyler, D.  and McKay, C.P. and Davis, W. L.},
+   journal = {Icarus},
+   pages = {102-120},
+   title = {A model for the evolution of {CO$_2$ on Mars}},
+   volume = {109},
+   year = {1994}
+}
+
+@article{Kass:95,
+   author = {Kass, D. M. and Yung , Y. L.},
+   journal = {Science},
+   pages = {697-699},
+   title = {Loss of atmoshere from {Mars} due to solar wind-induced sputtering},
+   volume = {268},
+   year = {1995}
+}
+
+@article{Luhm:92,
+   author = {Luhman, J. G. and Johnson, R. E. and Zhang, H. G.},
+   howpublished = grl,
+   journal = grl,
+   pages = {2151-2154},
+   title = {Evolutionary impact of sputerring of the {Martian} atmosphere by {O$^+$} pickup ions},
+   volume = {19},
+   year = {1992}
+}
+
+@misc{John:96,
+   author = {Johnson, R.E. and Schnellenberger, D. and Liu, M.},
+   howpublished = {Abstract  for the ``Workshop on evolution of {Martian} volatiles'', LPI, Houston},
+   title = {Sputtering of the atmosphere of {Mars}},
+   year = {1996}
+}
+
+@article{Poll:87,
+   author = {Pollack, J. B. and Kasting, J. F. and Richardson, S. M. and Poliakoff , K.},
+   journal = {Icarus},
+   pages = {203-224},
+   title = {The case for a wet, warm climate on early {Mars}},
+   volume = {71},
+   year = {1987}
+}
+
+@article{Kast:86,
+   author = {Kasting  J. H. and  Ackerman ,  T. P.},
+   journal = {Science},
+   pages = {1383-1385},
+   title = {Climatic consequences of very high carbon dioxide levels in the earth's early atmosphere},
+   volume = {234},
+   year = {1986}
+}
+
+@article{Chap:77,
+   author = {Chapman, C. R. and Jones, K. L.},
+   journal = aereps,
+   pages = {515-540},
+   title = {Cratering and obliteration history of {Mars}},
+   volume = {5},
+   year = {1977}
+}
+
+@article{Tito:95,
+   author = {Titov , D.V.  and Rosenqvist , J.  and Moroz, V. I.  and Grigoriev , A. V. and Arnold, G.},
+   journal = asr,
+   pages = {23-33},
+   title = {Evidences of the regolith-atmosphere water exchange on {Mars} from the {ISM  (Phobos2)} infrared spectrometer observations},
+   volume = {16-6},
+   year = {1995}
+}
+
+@article{Yell:91,
+   author = {Yelle , R. V. and Lunine , J. I. and Hunten , D. M.},
+   journal = {Icarus},
+   pages = {347-358},
+   title = {Energy balance and plume dynamics in {Triton's} lower atmosphere},
+   volume = {89},
+   year = {1991}
+}
+
+@article{Ryan:79,
+   author = {Ryan , J. A.  and Henry, R. M.},
+   journal = jgr,
+   pages = {2821-2829},
+   title = {Mars atmospheric phenomena during major dust storms as measured at surface},
+   volume = {84},
+   year = {1979}
+}
+
+@article{Thom:85,
+   author = {Thomas,  P.C. and Gierasch , P. J.},
+   journal = {Science},
+   pages = {175-177},
+   title = {Dust devils on {Mars}},
+   volume = {230},
+   year = {1985}
+}
+
+@article{Josh:95b,
+   author = {Joshi , M. M. and Lawrence , B. N. and Lewis , S. R.},
+   journal = jgr,
+   pages = {21235-21245},
+   title = {Gravity wave dragin {3D} atmospheric models of  {Mars}},
+   volume = {100},
+   year = {1995}
+}
+
+@article{Forg:96spitz,
+   author = {Forget, F.  and Donzé , F. and Lahaye, G.},
+   journal = {La montagne \& Alpinisme},
+   pages = {38-41},
+   title = {Spitzberg:  {le rêve polaire}},
+   volume = {183},
+   year = {1996}
+}
+
+@article{Holl:96nat,
+author = {Hollingsworth , J. L. and Haberle, R. M. and Barnes, J.R. and Bridger, a. f. c. and Pollack, J. B. and Lee, H. and Schaeffer, J.},
+journal = {Nature},
+pages = {413-416},
+title = {Orographic control of storm zones on Mars},
+volume = {380},
+year = {1996}
+}
+
+@article{Holl:96,
+author = {Hollingsworth, J. L. and Barnes, J. R.},
+journal = jas,
+pages = {428-448},
+title = {Forced stationary waves in {Mars}' winter atmosphere},
+volume = {53},
+year = {1996}
+}
+
+@article{Conr:81,
+author = {Conrath  ,  B. J.},
+journal = {Icarus},
+pages = {246-255},
+title = {Planetary-scale wave structure in the {Martian} atmosphere},
+volume = {48},
+year = {1981}
+}
+
+@article{Banf:96,
+author = {Banfield, D.  and Toigo, A. D.  and Ingersoll , A. P.},
+journal = {Icarus},
+pages = {130-143},
+title = {Martian weather correlation length scales},
+volume = {119},
+year = {1996}
+}
+
+@article{Barn:96,
+author = {Barnes, J. R. and Haberle, R. M. and Pollack , J. B. and Lee, H. and Schaeffer , J.},
+journal = jgr,
+pages = {12753-12776},
+title = {{Mars} atmospheric dynamics as simulated by the  {NASA Ames} general circulation model, 3, winter quasi-stationary eddies},
+volume = {101},
+year = {1996}
+}
+
+@article{Lell:91,
+author = {Lellouch, E and Rosenqvist, J. and Goldstein , J. J.  and Bougher S. W.  and Paubert , G.},
+journal = {Astrophys. J.},
+pages = {383},
+title = {First absolute wind measurements in the middle atmosphere of {Mars}},
+volume = {401-406},
+year = {1991}
+}
+
+@article{Wils:96,
+author = {Wilson, R. W. and Hamilton, K.},
+journal = jas,
+pages = {1290-1326},
+title = {Comprehensive model simulation of thermal tides in the {Martian} atmosphere},
+volume = {53},
+year = {1996}
+}
+
+@article{Sant:95,
+author = {Santee, M.  L. and Crisp , D.},
+journal = jgr,
+pages = {5465-5484},
+title = {Diagnostic calculations of then circulation in the {Martian} atmosphere},
+volume = {100},
+year = {1995}
+}
+
+@article{Gree:93,
+author = {Greeley , R. and Skypeck , A. and Pollack , J. B.},
+journal = jgr,
+pages = {3183-3196},
+title = {Martian aeolian features and deposits: comparisons with general circulation model results},
+volume = {98},
+year = {1993}
+}
+
+@article{Thom:84,
+author = {Thomas , P. J. and Veverka ,  J.  and  Gineris , D. and Wong , L.},
+journal = {Icarus},
+pages = {161-179},
+title = {{``Dust streaks on Mars}},
+volume = {60},
+year = {1984}
+}
+
+@article{Coll:97,
+author = {Collins, M. and Lewis, S.R. and Read , P. L.},
+howpublished = {Submitted to {\it Advances in Space Research} for the 32th COSPAR  Scientific Assembly, Birmingham, UK},
+journal = asr,
+pages = {1395-1409},
+title = {Gravity wave drag in a global circulation model of the {Martian} atmosphere: parametrisation and validation},
+volume = {44},
+year = {1997}
+}
+
+@article{Demi:86,
+author = {Deming, D.  and  Mumma  , M. J. and Espenal, F.  and Kostiuk , T. and Zipoy , D.},
+journal = {Icarus},
+pages = {366-379},
+title = {Polar warming in the middle atmosphere of {Mars}},
+volume = {66},
+year = {1986}
+}
+
+@article{Giff:64,
+author = {Gifford JR. , F.  A.},
+journal = {Icarus},
+pages = {130-135},
+title = {The  {Martian} canals according to a purely aeolian hypothesis},
+volume = {3},
+year = {1964}
+}
+
+@article{Chas:78,
+author = {Chase , S.C. and Engel, J. L. and Eyerly , H. W. and Kieffer, H. H.  and Palluconi , F. D. and Schofield, D.},
+journal = {App. Optics},
+pages = {1243-1251},
+title = {Viking infrared thermal mappers},
+volume = {17},
+year = {1978}
+}
+
+@article{Hans:69,
+author = {Hansen , J. E.},
+journal = jas,
+pages = {478-487},
+title = {Exact and approximate solutions for multiple scaterring by cloudy and hazy planetary atmosphere},
+volume = {26},
+year = {1969}
+}
+
+@article{Gree:71,
+author = {Greenberg, J. M.  and Wang , R. T.  and Bangs, L.},
+journal = {Nature Phys. Sci},
+pages = {110-112},
+title = {Extinction by rough particles and the use of {Mie} theory},
+volume = {230},
+year = {1971}
+}
+
+@article{Deir:64,
+author = {Deirmendjian, D.},
+journal = {Applied Optics},
+key = {:},
+pages = {187-196},
+title = {Scattering and polarization properties of water clouds and hazes in the visible and infrared},
+volume = {3},
+year = {1964}
+}
+
+@book{Deir:69,
+author = {Deirmendjian , D.},
+publisher = {Elsevier},
+title = {Electromagnetic scaterring of spherical polydispersions},
+year = {1969}
+}
+
+@article{Bohr:91,
+author = {Bohren,  C. F. and Singham , S. B.},
+journal = jgr,
+pages = {5269-5277},
+title = {Backscattering by nonspherical particles: a review of methods and suggested new approaches},
+volume = {96},
+year = {1991}
+}
+
+@article{Chyl:76,
+author = {Ch\'{y}lek , P. G. and Grams , G. W.  and Pinnick , R. G.\},
+journal = {Science},
+pages = {480-482},
+title = {Light scaterring by irregular randomly oriented particles},
+volume = {193},
+year = {1976}
+}
+
+@book{Prup:78,
+author = {Pruppacher, H. R. and Klett , J. D.},
+publisher = {D. Reidel},
+title = {Microphysics of clouds and precipitation},
+year = {1978}
+}
+
+@article{Poll:80,
+author = {Pollack  , J. B. and Cuzzi , J. N.},
+journal = jas,
+pages = {868-881},
+title = {Scaterring by nonspherical particles of size comparable to wavelength: a new semi-empirical theory and its application to trpospheric aerosol},
+volume = {37},
+year = {1980}
+}
+
+@article{Helf:88,
+author = {Helfand , H. M. and Labraga , J. C.},
+journal = jas,
+pages = {113-132},
+title = {Design of a nonsingular level 2.5 second-order closure for the prediction of atmospheric turbulence},
+volume = {45},
+year = {1988}
+}
+
+@article{Blac:62,
+author = {Blackadar , A. K.},
+journal = jgr,
+pages = {3095-3102},
+title = {The vertical distribution of wind and turbulent exchange in neutral atmosphere},
+volume = {67},
+year = {1962}
+}
+
+@article{Galp:88,
+author = {Galperin , B. A. and Kantha , L. H. and Hassid , S. and Rosati  , A.},
+journal = jas,
+pages = {55-62},
+title = {A quasi-equilibrium turbulent energy model for geophysical flows},
+volume = {45},
+year = {1988}
+}
+
+@article{Rous:91,
+author = {Roush, T. and Pollack , J. B. and Orenberg , J.},
+journal = {Icarus},
+pages = {191-208},
+title = {Derivation of midinfrared ({5-25~$\mu$m}) optical constants of some silicates and palagonite},
+volume = {94},
+year = {1991}
+}
+
+@article{Rous:92,
+author = {Roush, T. L. and Roush , E. A. and Singer , R. B.  and Lucey , P. G.},
+journal = {Icarus},
+pages = {42-50},
+title = {Estimate of absolute flux and radiance factor of localized regions on {Mars} in the  2-4{$\mu$m} wavelength region},
+volume = {99},
+year = {1992}
+}
+
+@article{Habe:90,
+author = {Haberle, R.M. and Jakosky , B.M.},
+journal = jgr,
+pages = {1423-1437},
+title = {Sublimation and transport of water from the north residual polar cap on Mars},
+volume = {95},
+year = {1990}
+}
+
+@article{Ocke:97,
+author = {Ockert-Bell, M. E.  and Bell III, J. F.  and McKay , C.P.
+and Pollack , J.B. and Forget , F.},
+journal = jgr,
+pages = {9039-9050},
+title = {Absorption and scattering properties of the {Martian} dust in the solar wavelengths},
+volume = {102},
+year = {1997}
+}
+
+@techreport{Read:96,
+author = {Read, P.L. and  Collins , M. and Lewis , S.R. and Taylor , W. and Talagrand , O. and Forget , F. and Hourdin , F.},
+institution = {E.S.A.},
+title = {The {Martian} environment},
+year = {1996}
+}
+
+@article{Read:97,
+author = {Read, P. L. and Collins, M. and Forget, F. and Fournier, R. and Hourdin, F.  and Lewis, S. R. and Talagrand, O. and Taylor, W. and Thomas, N. P. J.},
+journal = asr,
+pages = {1267-1270},
+title = {A {GCM} climate database for Mars: for mission planning and for scientific studies.},
+volume = {19},
+year = {1997}
+}
+
+@inproceedings{Forg:97blois,
+author = { Forget, F. and Hourdin, F. and Hourdin, C. and Fournier, R. and Talagrand, O. and Collins, M.  and Lewis, S. R. and Read, P. L.   and  Huot., J-P.},
+booktitle = {Planetary system, the long view},
+note = {IXth Blois meeting},
+publisher = {Diderot Editeurs},
+title = {A {Martian} climate database},
+year = {1997}
+}
+
+@article{Forg:99,
+author = { Forget, F. and Hourdin, F. and Fournier, R. and Hourdin, C. and Talagrand, O. and Collins, M.  and Lewis, S. R. and Read, P. L.  and  Huot., J-P.},
+journal = jgr,
+pages = {24,155-24,176},
+title = {Improved general circulation models of the {Martian}
+atmosphere from the surface to above 80~km},
+volume = {104},
+year = {1999}
+}
+
+@article{Lewi:99,
+author = {Lewis, S. R. and Collins, M.  and Read, P. L. and Forget, F. and Hourdin, F. and Fournier, R. and Hourdin, C. and Talagrand, O. and  Huot., J-P.},
+journal = jgr,
+pages = {24,177-24,194},
+title = {A Climate Database for {Mars}},
+volume = {104},
+year = {1999}
+}
+
+@unpublished{Lewi:99jgr,
+author = {Lewis, S. R. and Collins, M.  and Read, P. L. and Forget, F. and Hourdin, F. and Fournier, R. and Hourdin, C. and Talagrand, O. and  Huot., J-P.},
+note = {\protect{\it J. Geophys. Res.}, this issue},
+title = {A Climate Database for {Mars}},
+year = {1999}
+}
+
+@article{Smit:96,
+author = {Smith , D. E. and Zuber  , M. T.},
+journal = {Science},
+pages = {184-188},
+title = {The shape of {Mars} and the topographic signature of the hemispheric dichotomy},
+volume = {271},
+year = {1996}
+}
+
+@article{Wu:78,
+author = {Wu , S. S. C.},
+journal = {Icarus},
+pages = {417-440},
+title = {Mars synthetic topographic mapping},
+volume = {33},
+year = {1978}
+}
+
+@article{Pime:74,
+author = {Pimentel, G.C.  and  Forney, P.B. and Herr, K.C.},
+journal = jgr,
+pages = {1623-1634},
+title = {Evidence about hydrate and solid water in the {Martian} surface from the 1969 {Mariner} infrared spectrometer},
+volume = {79},
+year = {1974}
+}
+
+@article{Rizk:95,
+author = {Rizk, B. and Haberle , R. M. and Hunten , D.M. and Pollack , J. B.},
+journal = {Icarus},
+pages = {39-50},
+title = {Meridional transport and water reservoir in southern {Mars} during 1988-1989},
+volume = {118},
+year = {1995}
+}
+
+@article{Chri:86,
+author = {Christensen , P. R.},
+journal = {Icarus},
+pages = {217-238},
+title = {The spatial distribution of rocks on {Mars}},
+volume = {68},
+year = {1986}
+}
+
+@article{Chri:82,
+author = {Christensen, P. R.},
+journal = JGR,
+pages = {9985-9998},
+title = {Martian dust mantling and surface composition: interpretation of the thermophysical  properties},
+volume = {87},
+year = {1982}
+}
+
+@article{Lott:97,
+author = {Lott, F. and Miller, M.},
+journal = qjrms,
+pages = {101-128},
+title = {A new sub-grid scale orographic drag parametrization: its formulation and testing.},
+volume = {123},
+year = {1997}
+}
+
+@article{Palm:86,
+author = {Palmer, T. N. and Shutts, G. J. and Swinbank, R.},
+journal = qjrms,
+pages = {1001-1039},
+title = {Alleviation of a systematic westerly bias in general
+circulation and numerical weather prediction models through an orographic gravity wave drag parametrisation},
+volume = {112},
+year = {1986}
+}
+
+@article{Palm:82,
+author = {Palmer, T. N.},
+journal = jas,
+pages = {992-997},
+title = {Properties of the {Eliassen-Palm} flux for planetary scale motions},
+volume = {39},
+year = {1982}
+}
+
+@article{Edmo,
+author = {Edmon, H. J.  and Hoskins, B. J. and McIntyre , M. E.},
+journal = jas,
+pages = {2600-2616},
+title = {Eliassen-Palm cross sections for the troposphere},
+year = {1980}
+}
+
+@book{Andr:87,
+author = {Andrews, D. G. and Holton, J. R. and Leovy, C. B.},
+publisher = {Academic Press},
+title = {Middle Atmosphere Dynamics},
+year = {1987}
+}
+
+@article{Jako:83b,
+author = {Jakosky, B.M.},
+journal = {Icarus},
+pages = {1-18},
+title = {The role of sesaonal reservoirs in the {Mars} water cycle. {I.} {Seasonal} exchange of water with the regolith.},
+volume = {55},
+year = {1983}
+}
+
+@book{Pano:84,
+author = {Panofsky , Hans A. and Dutton , John A.},
+address = {New York},
+publisher = {John Wiley and Sons},
+title = {Atmospheric turbulence},
+year = {1984}
+}
+
+@article{Jako:85,
+author = {Jakosky, B. M.},
+journal = {Space Sci. Rev.},
+pages = {131-200},
+title = {The seasonal cycle of water on {Mars}},
+volume = {41},
+year = {1985}
+}
+
+@article{Kras:91,
+author = {Krasnopolsky , V. A. and Korablev, O. I. and Moroz , A. A. and Krysko , A. A. and Blamont , J. E. and Chassefiere , E.},
+journal = {Icarus},
+pages = {32-44},
+title = {Infrared solar occultation sounding of the {Martian} atmosphere by the {Phobos} spacecraft.},
+volume = {94},
+year = {1991}
+}
+
+@article{Ryan:82,
+author = {Ryan , J. A. and Sharman, R. D. and Lucich , R. D.},
+journal = jgr,
+pages = {7279-7284},
+title = {Mars water vapor, near surface.},
+volume = {87},
+year = {1982}
+}
+
+@article{Kahn:90,
+author = {Kahn, R.},
+journal = jgr,
+pages = {14,677-14,693},
+title = {Ice haze, snow, and the {Mars} water cycle.},
+volume = {95},
+year = {1990}
+}
+
+@article{Kahn:95,
+author = {Kahn, R.},
+journal = jgr,
+pages = {5265-5275},
+title = {Temperature measurements of a {Martian} local dust storm},
+volume = {100},
+year = {1995}
+}
+
+@article{Ryan:83,
+author = {Ryan, J. A. and Lucich , R. D.},
+journal = jgr,
+pages = {11005-11011},
+title = {Possible dust devils vortices on {Mars}},
+volume = {1983},
+year = {1983}
+}
+
+@article{Mich:93,
+author = {Michelangeli, D. V. and Toon , O. B. and Haberle , R. M. and Pollack , J. B.},
+journal = {Icarus},
+pages = {261-285},
+title = {Numerical simulations of the formation and evolution of water ice clouds in the {Martian} atmosphere.},
+volume = {100},
+year = {1993}
+}
+
+@article{Curr:73,
+author = {Curran , R. J. and Conrath , B. J. and Hanel , R. A. and Kunde , V. G. and Pearl , J. C.},
+journal = {Science},
+pages = {381-383},
+title = {Mars: {Mariner~9} spectroscopic evidence for {H$_2$O} ice clouds.},
+volume = {182},
+year = {1973}
+}
+
+@article{Whit:79,
+author = {White , B. R.},
+journal = jgr,
+pages = {4643-4651},
+title = {Soil transport by winds on {Mars}},
+volume = {84},
+year = {1979}
+}
+
+@article{Gree:80,
+author = {Greeley , R. and Leach R. and White , B.  and Iversen , J. and Pollack , J.},
+journal = grl,
+pages = {121-124},
+title = {Threshold windspeeds for sands on {Mars}: wind tunnel simulations},
+volume = {7},
+year = {1980}
+}
+
+@inproceedings{Whit:89,
+author = {White , B. R. and Greeley , R.},
+booktitle = {MECA Workshop on dust on {Mars} {III}},
+editor = {Lee , S.},
+institution = {L.P.I.},
+number = {89-01},
+organization = {L.P.I  Tech. Rept.},
+pages = {60-61},
+title = {Martian dust threshold measurements: simulation under heated surface conditions},
+year = {1989}
+}
+
+@inproceedings{Gree:94,
+author = {Greeley, R. and Lacchia , M. and White , B. and Leach, R. and Trilling , D. and Pollack , J.},
+booktitle = {{XXV Lunar Planet. Sci. Conf.}},
+pages = {467-468},
+title = {Dust on {Mars}: new values for wind threshold},
+year = {1994}
+}
+
+@book{Wash:48,
+author = {Washburn, E.W.},
+publisher = {New York: McGraw Hill},
+title = {International critical tables of numerical data,physics, chemistry, and technology, volume~3},
+year = {1948}
+}
+
+@article{Arvi:83,
+author = {Arvidson , R.E.  and Guiness , E. A. and Moore , H.J. and Tillman , J. and Wall , S.D.},
+journal = {Science},
+pages = {463-468},
+title = {Three {Mars} years: {Viking Lander 1} imaging observations},
+volume = {222},
+year = {1983}
+}
+
+@article{West:87,
+author = {Westphal, D.L.  and Toon , O. B. and Carlson , T. N.},
+journal = jgr,
+pages = {3027-3049},
+title = {A two-dimensional numerical investigation of the dynamics and mycrophysics of saharian dust storms.},
+volume = {92},
+year = {1987}
+}
+
+@article{Fana:82,
+author = {Fanale , F. P. and Salvail , J.R. and Banerdt , W. B. and Saunders, R. S.},
+journal = {Icarus},
+pages = {381-407},
+title = {Mars: the regolith-atmosphere -cap system and climate change},
+volume = {50},
+year = {1982}
+}
+
+@article{Must:94,
+author = {Mustard , J. F. and Bell III , J. F.},
+journal = grl,
+pages = {353-356},
+title = {New composite reflectance spectra of {Mars} from 0.4 to 3.14~{$\mu$m}.},
+volume = {21},
+year = {1994}
+}
+
+@article{Must:93,
+author = {Mustard , J. F. and Erard , S.  and Bibring , J.P. and Head , J.W.  and Hurtrez ,  S. and Langevin , Y.  and Pieters , C. M.  and Sotin , C. J.},
+journal = jgr,
+pages = {3387-3400},
+title = {The surface of {Syrtis Major}: {Composition} of the volcanic substrate and mixing with altered dust and soil},
+volume = {98},
+year = {1993}
+}
+
+@article{Bibr:89,
+author = {Bibring, J. P. and Combes , M. and Langevin, Y. and Cara , C. and Drossart, P. and Encrenaz, T. and Erard, S. and Forni, O. and Gondet, B. and Ksanfomality, L.V. and Lellouch, E. and Masson, P.},
+journal = {Nature},
+pages = {591-592},
+title = {Results from the {ISM} experiments},
+volume = {341},
+year = {1989}
+}
+
+@article{Ocke:94,
+author = {Ockert-Bell, M.E. and Pollack , J. B. and Bell, J.F.},
+journal = baas,
+pages = {1130},
+title = {Wavelength dependance of the radiative properties of {Martian} atmospheric dust},
+volume = {26},
+year = {1994}
+}
+
+@article{Pang:77,
+author = {Pang, K. and Ajello, J.M.},
+journal = {Icarus},
+pages = {63-74},
+title = {Complex refractive index of {Martian} dust: wavelength dependence and composition},
+volume = {30},
+year = {1977}
+}
+
+@article{Pang:76,
+author = {Pang, K. and Ajello , J. M. and Hord, C.W. and Egan, W. G.},
+journal = {Icarus},
+pages = {55-67},
+title = {Complex refractive index of {Martian} dust: {Mariner 9 ultraviolet observations}.},
+volume = {27},
+year = {1976}
+}
+
+@article{Chyl:78,
+author = {Ch\'{y}lek, P. and Grams, G. W.},
+journal = {Icarus},
+pages = {198-203},
+title = {Scaterring by nonspherical particles and optical properties of {Martian} dust.},
+volume = {36},
+year = {1978}
+}
+
+@article{Ande:78,
+author = {Anderson , E. and Leovy , C.},
+journal = jas,
+pages = {723-734},
+title = {Mariner 9 television limb observations of dust and ice hazes on {Mars}},
+volume = {35},
+year = {1978}
+}
+
+@article{Clan:90,
+author = {Clancy , R. T. and Muhleman , D. O. and Berge , G. L.},
+journal = jgr,
+pages = {14543-14554},
+title = {Global changes in the {0-70 km} thermal structure of the {Mars} atmosphere derived from 1975 to 1989 microwave {CO} spectra},
+volume = {95},
+year = {1990}
+}
+
+@article{Jaqu:86,
+author = {Jaquin , F. and Gierasch , P. and Kahn , R.},
+journal = {Icarus},
+pages = {442-461},
+title = {The vertical structure of limb hazes in the {Martian} atmosphere},
+volume = {68},
+year = {1986}
+}
+
+@inproceedings{Hour:95intermarsnet,
+author = {Hourdin , Fr\'ed\'eric and Talagrand , Olivier and Forget , Fran\c{c}ois and Fournier , Richard},
+booktitle = {International workshop on {INTERMARSNET}},
+note = {invited presentation},
+organization = {ESA /NASA and EGS},
+title = {Numerical simulation of the circulation of the {Martian} atmosphere in {Europe}},
+year = {1995}
+}
+
+@inproceedings{Forg:95intermarsnet,
+author = {Forget , Fran\c{c}ois and Hansen , G. B. and Pollack , J.  B.},
+booktitle = {International workshop on {INTERMARSNET}},
+note = {oral presentation},
+organization = {ESA /NASA and EGS},
+title = {Condensation of the {Martian} {CO$_2$} polar caps},
+year = {1995}
+}
+
+@inproceedings{Hour:93msatt,
+author = {Hourdin , Fr\'ed\'eric and Forget , F. and Talagrand , O.},
+address = {Lunar and Planetary Institute,  Houston},
+booktitle = {Workshop on atmospheric transport on {Mars} (MSATT meeting)},
+institution = {LPI},
+number = {93-05},
+pages = {16-17},
+series = {{LPI} Technical Report},
+title = {The annual pressure cycle on {Mars} : Results from the {LMD} {Martian} Atmospheric General Circulation Model},
+type = {Technical Report},
+year = {1993}
+}
+
+@article{Hou:84,
+author = {Hou, A. Y.},
+journal = jas,
+pages = {3437-3455},
+title = {Axisymetric circulations forced by heat and momentum sources : a simple model applicable to the  {Venus atmosphere}},
+volume = {41},
+year = {1984}
+}
+
+@inproceedings{Forg:93msatt,
+author = {Forget , F. and Pollack , J. B.},
+address = {Lunar and Planetary Institute,  Houston},
+booktitle = {Workshop on atmospheric transport on {Mars} (MSATT meeting)},
+institution = {LPI},
+number = {93-05},
+pages = {16-17},
+series = {{LPI} Technical Report},
+title = {Impact of the {CO$_2$} and {H$_2$O} Clouds of the {Martian} polar hood on the polar energy balance},
+type = {Technical Report},
+year = {1993}
+}
+
+@incollection{Forg:97book,
+author = {Forget , F.},
+booktitle = {Solar system ices},
+editor = {Schmitt , B.  and De Bergh,  C.  and Festou , M.},
+pages = {477-507},
+publisher = {Kluwer Academic},
+title = {Mars {CO$_2$} ice polar caps},
+year = {1997}
+}
+
+@misc{Forg:95cnes,
+author = {Forget, F.},
+howpublished = {Rapport Technique BA/AM/3448, CNES},
+institution = {CNES},
+number = {BA/AM/3448},
+title = {Projet Aerostat Martien~: Etude et modelisation de l'environnement atmospherique: {Conclusion pour le projet MARS 96}, bases pour des projets futurs},
+year = {1995}
+}
+
+@misc{Forg:95ice,
+author = {Forget, F.},
+howpublished = {Invited presentation at the ``Solar system ices'' symposium in Toulouse (France)},
+title = {Mars {CO$_2$} ice seasonal polar caps},
+year = {1995}
+}
+
+@article{Habe:91,
+author = {Haberle , R. M. and Jakosky , B. M.},
+journal = {Icarus},
+pages = {187-204},
+title = {Atmospheric effects on the remote determination of thermal inertia of {Mars}},
+volume = {90},
+year = {1991}
+}
+
+@article{Coll:96,
+author = {Collins, M. and Lewis, S. R. and Read, P. L. and Hourdin, F.},
+journal = {Icarus},
+pages = {344-357},
+title = {Baroclinic wave transitions in the {Martian} atmosphere},
+volume = {120},
+year = {1996}
+}
+
+@misc{Dalt:89,
+author = {Dalton , B. et al.},
+howpublished = {in ``The Case for Mars III''},
+title = {.},
+year = {1989}
+}
+
+@techreport{Four:96ddd,
+author = {Fournier , R. and Forget , F. and Collins , M. and Hourdin , F.},
+institution = {ESA},
+number = {ESA contract  (Ref.~11369/95/NL/JG(SC))},
+title = {Detailed Design Document for the {Martian} Atmospheric General Circulation Model},
+year = {1996}
+}
+
+@techreport{Four:96gcmtesting,
+author = {Fournier , R. and Forget , F. and Collins , M. and Hourdin , F.},
+institution = {ESA},
+number = {ESA contract  (Ref.~11369/95/NL/JG(SC))},
+title = {Technical note on GCM testing},
+year = {1996}
+}
+
+@techreport{Maur:91,
+author = {Mauroy ,   P.},
+institution = {CNES},
+month = {janvier},
+number = {BA/AM/949},
+title = {Evaluation pr\'eliminaire de la vitesse du vent au voisinage du sol et d\'eplacement du guiderope.},
+year = {1991}
+}
+
+@techreport{Maur:92,
+author = {Mauroy , P.},
+address = {mars},
+institution = {CNES},
+number = {BA/AM/1513},
+title = {Consequences probables du changement de date de la missionsur les performances de l'aerostat},
+year = {1992}
+}
+
+@book{Arya:88,
+author = {Arya , S. P.},
+publisher = {Academic Press},
+title = {Intoduction to micrometeorology},
+year = {1988}
+}
+
+@article{Lumm:84,
+author = {Lumme , Kari and James , Philip B.},
+journal = {Icarus},
+pages = {363-376},
+title = {Some photometric properties of the {Martian} south polar cap region during the 1971 apparition.},
+volume = {58},
+year = {1984}
+}
+
+@article{Lars:72,
+author = {Larson , H. P. and Fink, U.},
+journal = {Astrophys. Jour.},
+pages = {L91-L95},
+title = {Identification of carbon dioxide frost on the {Martian} polar caps},
+volume = {171},
+year = {1972}
+}
+
+@article{Doll:65,
+author = {Dollfus,  Audouin},
+journal = {Ann. Astrophys},
+pages = {722-747},
+title = {Etude de la plan\`{e}te {Mars} de 1954 \`{a} 1958},
+volume = {28},
+year = {1965}
+}
+
+@article{Lumm:76,
+author = {Lumme , K},
+journal = {Icarus},
+pages = {69},
+title = {On the surface brightness and geometric albedo of some {Martian} areas.},
+volume = {29},
+year = {1976}
+}
+
+@misc{Ono:95,
+author = {Ono , A.M. and Paige , D. A.},
+howpublished = {Abstract for the "Solar System Ices" international symposium, Toulouse, France},
+title = {Martian polar frosts},
+year = {1995}
+}
+
+@misc{Butl:95,
+author = {Butler, B.J. and Muhleman , D.O. and Slade , M.J.},
+howpublished = {Abstract for the "Solar System Ices" international symposium, Toulouse, France},
+title = {The difference in the residual ice caps on {Mars} as deduced from {VLA/Goldstone} radar images},
+year = {1995}
+}
+
+@article{Cape:70,
+author = {Capen , C. F. and Capen , V. W.},
+journal = {Icarus},
+pages = {100-108},
+title = {Martian north polar cap, 1962-1968},
+volume = {13},
+year = {1970}
+}
+
+@article{Iwis:82,
+author = {Iwisaki , K. and Saito , Y. and Akabane , T.},
+journal = jgr,
+pages = {10265-10269},
+title = {Martian north polar cap : 1979-1980},
+volume = {87},
+year = {1982}
+}
+
+@article{Jame:83,
+author = {James , P. B.},
+journal = baas,
+pages = {846-847},
+title = {Condensation phase of the {Martian} south polar cap},
+volume = {15},
+year = {1983}
+}
+
+@article{Hart:83,
+author = {Hartman , Dennis L.},
+journal = jas,
+pages = {817-835},
+title = {Barotropic instability of the polar night jet stream},
+volume = {40},
+year = {1983}
+}
+
+@article{Park:83,
+author = {Parker , D. C.  and Capen , C. F. and Beish , J. D.},
+journal = {Sky \& Telescope},
+pages = {218-220},
+title = {Exploring the {Martian} artic.},
+volume = {65},
+year = {1983}
+}
+
+@article{Pire:95,
+author = {Pires , C. and Vautard , R. and Talagrand , O.},
+journal = {Tellus},
+pages = {96-121},
+title = {On extending the limits of variational assimilation in nonlinear chaotic systems},
+volume = {48A},
+year = {1995}
+}
+
+@article{Elus:93,
+author = {Eluszkiewicz , Janusz},
+journal = {Icarus},
+pages = {43-48},
+title = {On the microphysical state of the {Martian} seasonal caps},
+volume = {103},
+year = {1993}
+}
+
+@book{LaCh:69,
+author = {LaChapelle , E. R.},
+publisher = {University of Washington Press, Seattle, 1969.},
+title = {Field Guide to Snow Crystals},
+year = {1969}
+}
+
+@article{Bohr:83,
+author = {Bohren, C. F.},
+journal = {J. Opt. Soc. Am.},
+pages = {1646-1652},
+title = {Colors of snow, frozen waterfalls, and icebergs},
+volume = {73},
+year = {1983}
+}
+
+@article{Calv:94,
+author = {Calvin , Wendy M. and Martin , Terry Z.},
+journal = jgr,
+number = {E10cd},
+pages = {21,143-21,152},
+title = {Spatial variability in the seasonal south polar cap of {Mars}},
+volume = {99},
+year = {1994}
+}
+
+@article{Calv:90,
+author = {Calvin , Wendy M.},
+journal = jgr,
+pages = {14,743-14,750},
+title = {Additions and corrections to the absorption coefficient of {CO$_2$} ice : applications to the {Martian} south polar cap},
+volume = {95},
+year = {1990}
+}
+
+@article{Hans:74,
+author = {Hansen ,  James E. and Travis ,  Larry D.},
+journal = {Space Sci. Rev.},
+pages = {527-610},
+title = {Light scaterring in planetary atmosphere},
+volume = {16},
+year = {1974}
+}
+
+@misc{Pa
+}
+
+@misc{Hans:95,
+author = {Hansen  ,  Garry  B.},
+howpublished = {In preparation for J.G.R.},
+title = {Spectral absorption coefficient of {CO$_2$} ice 2. {Thermal}  infrared},
+year = {1995}
+}
+
+@article{Hans:71,
+author = {Hansen, J. E.},
+journal = jas,
+pages = {1400-1426},
+title = {Multiple scatering of polarized light in planetary atmosphere. {Part II. Sunlight} reflected by terrestrial water clouds.},
+volume = {28},
+year = {1971}
+}
+
+@article{Mish:94,
+author = {Mishchenko, M. I.},
+journal = {J. Quant. Spectrosc. Radiat. Transfer},
+pages = {95-110},
+title = {Asymmetry parameters of the phase function for densely packed scattering grains},
+volume = {52},
+year = {1994}
+}
+
+@article{Lind:81,
+author = {Lindzen , R. S.},
+journal = jgr,
+pages = {9707--9714},
+title = {Turbulence and stress owing to gravity wave and tidal breakdown},
+volume = {86},
+year = {1981}
+}
+
+@article{McFa:87,
+author = {McFarlane , N. A.},
+journal = jas,
+pages = {1775--1800},
+title = {The effect of orographically excited gravity wave drag on the general circulation of the lower stratosphere and troposphere},
+volume = {44},
+year = {1987}
+}
+
+@article{Herr:70,
+author = {Herr, K. C. and Pimentel, G. C.},
+journal = {Science},
+pages = {47-49},
+title = {Evidence for solid carbon dioxide in the upper atmosphere of {Mars}},
+volume = {167},
+year = {1970}
+}
+
+@article{Gier:68,
+author = {Gierasch, P. J. and Goody, R. M.},
+journal = {Planet. Space Sci.},
+pages = {615-646},
+title = {A study of the thermal and dynamical structure of the {Martian}  lower atmosphere},
+volume = {16},
+year = {1968}
+}
+
+@article{Herr:69,
+author = {Herr , K. C. and Pimentel , G. C.},
+journal = {Science},
+pages = {496-499},
+title = {Infrared absorptions near three microns recorded over the polar caps of {Mars}},
+volume = {166},
+year = {1969}
+}
+
+@article{Hans:92,
+author = {Hansen , G.  B.},
+journal = baas,
+pages = {978},
+title = {The spectral absorption of {CO$_2$} ice from 0.18 to 4.8 microns},
+volume = {24},
+year = {1992}
+}
+
+@article{Hans:92triton,
+author = {Hansen, C. J. and Paige , D. A.},
+journal = {Icarus},
+pages = {273-288},
+title = {A thermal model for the seasonal nitrogen cycle on {Triton}},
+volume = {99},
+year = {1992}
+}
+
+@article{Brow:94,
+author = {Brown, R. H. and Kirk, R. L.},
+journal = jgr,
+pages = {1965-1981},
+title = {Coupling of volatile transport and internal heat flow on {Triton}},
+volume = {99},
+year = {1994}
+}
+
+@inproceedings{Brow:79,
+author = {Brown, G. N. and Ziegler, W. T.},
+booktitle = {Advances in cryogenic engineering},
+editor = {Timmerhaus. K. and Snyder, H. A.},
+pages = {662-670},
+publisher = {New-York, {Plenum press}},
+title = {Vapor pressure and heats of sublimation of liquids and solids of interest in cryogenics below 1-atm pressure},
+volume = {25},
+year = {1979}
+}
+
+@article{Kief:70a,
+author = {Kieffer , H. H.},
+journal = jgr,
+pages = {510-514},
+title = {Interpretation of the {Martian} polar cap spectra},
+volume = {75},
+year = {1970}
+}
+
+@article{Kief:70b,
+author = {Kieffer, H. H.},
+journal = jgr,
+pages = {501-509},
+title = {Spectral reflectance of {CO$_2$-H$_2$O} frosts},
+volume = {75},
+year = {1970}
+}
+
+@article{Clar:82,
+author = {Clark , R. N. and McCord , T. B.},
+journal = jgr,
+pages = {367-370},
+title = {Mars residual polar cap : {Earth}-based spectroscopic confirmation of water ice as a major constituent and evidence for hydrated minerals},
+volume = {87},
+year = {1982}
+}
+
+@article{Jako:83,
+author = {Jakosky , B. M.},
+journal = jgr,
+pages = {4329-4330},
+title = {Comments on "{Mars} residual north polar cap : {Earth-based} spectroscopic confirmation of water ice as a major constituent and evidence for hydrated minerals" by {R. N. Clark and T. B.  McCord}.},
+volume = {88},
+year = {1983}
+}
+
+@article{Jako:84,
+author = {Jakosky , B. M. and Barker , E. S.},
+journal = {Icarus},
+pages = {322-334},
+title = {Comparison of ground-based and {Viking Orbiter} measurements of {Martian } water vapor : variability of the seasonal cycle.},
+volume = {57},
+year = {1984}
+}
+
+@article{Jako:90,
+author = {Jakosky , B. M. and Haberle , R. M.},
+journal = jgr,
+pages = {1359-1365},
+title = {Year-to-year instability of the {Mars} south polar cap.},
+volume = {95},
+year = {1990}
+}
+
+@article{Clan:96b,
+author = {Clancy, R.T.  and Grossman , A. W. and Wolff , M. J.  and  James, P. B. and Rudy , D. J. and Billawala , Y. N. and Sandor , B. J.  and Lee , S. W.  and Muhleman , D. O.},
+journal = {Icarus},
+pages = {36-62},
+title = {Water vapor saturation at low altitudes around {Mars}
+aphelion: a key to {Mars} climate},
+volume = {122},
+year = {1996}
+}
+
+@article{Encr:95,
+author = {Encrenaz , T. and Lellouch , E. and Cernicharo , J. and Paubert , G.  and Gulkis , S.},
+journal = {Icarus},
+pages = {110-118},
+title = {A tentative detection of the {183-GHz} water vapor line in the {Martian} atmosphere: {Contraint} upon the {H$_2$O}  abundance and vertical distribution},
+year = {1995}
+}
+
+@article{Clan:96,
+author = {Clancy, R.T.  and  Wolff , M. J.  and  James, P. B.  and Smith , E. and Billawala , Y. N.  and Lee , S. W.  and Callan , M.},
+journal = jgr,
+pages = {12777-12783},
+title = {Mars ozone measurements near the 1995 aphelion: {Hubble} space telescope ultraviolet spectroscopy with the faint object spectrograph},
+volume = {101},
+year = {1996}
+}
+
+@techreport{Alli:93,
+author = {Allison , M and Chandler , M. A. and Del Genio , A. D. and Lacis , A. and Rind , D.  and Rossow , W. B. and Travis , L. D.  and Zhou , W.},
+institution = {LPI},
+number = {93-05},
+title = {The {NASA GISS}   {Mars}  general circulation model : preliminary experiments.},
+type = {Technical Report},
+year = {1993}
+}
+
+@techreport{Wils:93,
+author = {Wilson , R. J.},
+institution = {LPI},
+number = {93-05},
+title = {Three dimensional numerical simulation of thermal tides in the {Martian} atmosphere.},
+type = {Technical Report},
+year = {1993}
+}
+
+@inproceedings{Thom:92,
+author = {Thomas , P. and Squyres , S. and Herkenhoff , K. and Howard , A. and Murray , B.},
+booktitle = {Mars},
+pages = {pp. 767-795},
+publisher = {Univ. of Arizona Press, Tucson},
+title = {Polar deposits of {Mars}},
+year = {1992}
+}
+
+@inproceedings{Fana:92,
+author = {Fanale, F. P. and Postawko, S. E. and Pollack, J. B. and
+Carr, M. H. and Pepin, R. O.},
+booktitle = {Mars},
+pages = {pp. 1135-1179},
+publisher = {Univ. of Arizona Press, Tucson},
+title = {Epochal climate change and volatile history},
+year = {1992}
+}
+
+@article{Theo:93,
+author = {Th{\'e}odore , B and Lellouch , E. and Chassefiere , E. and Hauchecorne , A.},
+journal = {Icarus},
+pages = {512-528},
+title = {Solsticial temperature inversions in the {Martian} middle atmosphere : observational clues and 2-{D} modeling},
+volume = {105},
+year = {1993}
+}
+
+@article{Josh:94nat,
+author = {Joshi , M. M. and Lewis , S. R. and Read , P. L. and Catling , D. C.},
+journal = {Nature},
+month = {February},
+pages = {548-551},
+title = {Western boundary currents in the atmosphere of {Mars}},
+volume = {367},
+year = {1994}
+}
+
+@article{Josh:95,
+author = {Joshi , M. M. and Lewis , S. R. and Read P. L. and Catling , D. C.},
+journal = jgr,
+pages = {5485-5500},
+title = {Western Boundary Courrents in the {Martian}  atmosphere : Numerical simulations and observational evidence},
+volume = {100},
+year = {1995}
+}
+
+@article{Hutz:95,
+author = {Hutzell , William T. and McKay , Christopher P. and Toon , Owen B. and Hourdin , F.},
+journal = {Icarus},
+pages = {112-129},
+title = {Simulations of {Titan's} brightness by a two-dimensional haze model},
+volume = {119},
+year = {1995}
+}
+
+@misc{Cous:su,
+author = {Coustenis, A. and B{\'e}zard , B.},
+note = {Submitted for publication},
+title = {{Titan's} atmosphere from {Voyager} infrared observations: {IV} Latitudinal variations of temperature and composition},
+year = {1995}
+}
+
+@article{Beza:95,
+author = {B\'ezard , Bruno and Coustenis , Athena and McKay , Christopher P.},
+journal = {Icarus},
+pages = {267-276},
+title = {Titan's stratospheric temperature asymmetry: a radiative origin},
+volume = {113},
+year = {1995}
+}
+
+@article{Upad:94,
+author = {Upadhyaya , H. C. and Agrawal , S. and Talagrand , O.},
+journal = {Proc. Indian Nation Sci. Acad.},
+pages = {193,204},
+title = {Variational data assimilation with an adiabatic version of the {LMD} {GCM} using adjoint methods},
+volume = {60},
+year = {1994}
+}
+
+@article{Rabi:93,
+author = {Rabier , F. and Courtier , P. and Pailleux , J. and Talagrand , O. and Vasijevic , D.},
+journal = qjrms,
+pages = {845-880},
+title = {A comparison bewteen four-dimensional variational assimilation and simplified sequential assimilation relying on three-dimensional analysis},
+volume = {119},
+year = {1993}
+}
+
+@unpublished{Tala:96,
+author = {Talagrand , Olivier},
+note = {submitted to J. Meteor. Soc. Japan},
+title = {Assimilation of Observations, an Introduction},
+year = {1996}
+}
+
+@article{Li:96,
+author = {Li , Zhao-Xin},
+journal = {NATO AISI series},
+pages = {127-137},
+title = {Comparison of convection parametrizations in an atmospheric General Circulation model},
+volume = {I 34},
+year = {1996}
+}
+
+@article{Hutz:93,
+author = {Hutzell , William T. and McKay , Christopher P. and Toon , Owen B.},
+journal = {Icarus},
+pages = {162-174},
+title = {Effects of time-varying haze production on {Titan's} geometric albedo},
+volume = {105},
+year = {1993}
+}
+
+@article{Jame:87,
+author = {James , Philip B. and Pierce , Maurice  and Martin , Leonard J.},
+journal = {Icarus},
+pages = {306-312},
+title = {Martian north polar cap and circumpolar clouds: 1975-1980  {Telescopic} observation.},
+volume = {71},
+year = {1987}
+}
+
+@article{Jame:94,
+author = {James , P. B. and Clancy , R. T. and Lee , S. W. and Martin, L. J. and Singer, R. B. and Smith E. and Kahn , R. A. and Zurek , R. W.},
+journal = {Icarus},
+pages = {79-101},
+title = {Monitoring {Mars} with the {Hubble} space telescope~: 1990-1991 observations.},
+volume = {109},
+year = {1994}
+}
+
+@article{Keeg:91,
+author = {Keegan , K. D. and Bachman , J. E. and Paige , D. A.},
+journal = lps,
+pages = {701-702},
+title = {Thermal and albedo mapping of the north polar region of {Mars}},
+volume = {XXII},
+year = {1991}
+}
+
+@article{Paig:91,
+author = {Paige , D. A. and Keegan , K. D.},
+journal = lps,
+pages = {1013-1014},
+title = {Thermal and albedo mapping of the south polar region of {Mars}},
+volume = {XXII},
+year = {1991}
+}
+
+@article{Paig:90jgr,
+author = {Paige , David A. and Herkenhoff , K. E. and Murray , B. C.},
+journal = jgr,
+number = {B2},
+pages = {1319-1335},
+title = {Mariner 9 observations of the south polar cap of {Mars} : evidence for residual {CO$_2$} frost},
+volume = {95},
+year = {1990}
+}
+
+@techreport{Paig:93,
+author = {Paige ,David A.  and Crisp , D. and Santee M. L.  and Richardson , M. I.},
+institution = {L.P.I.},
+title = {IRTM brightness temperature maps of the {Martian} south polar region during the polar night : the cold spots don't move},
+type = {MSATT final meeting report.},
+year = {1993}
+}
+
+@article{Sutt:78,
+author = {Sutton , Jordan L. and Leovy , Conway B. and Tillman , James E.},
+journal = jas,
+pages = {2346-2355},
+title = {Diurnal variations of the {Martian} surface layer meteorological parameters during the first 45 sols at two {Viking} lander sites},
+volume = {35},
+year = {1978}
+}
+
+@article{Till:94,
+author = {Tillman, James E. and Landberg , Lars and Larsen , Soren E.},
+journal = jas,
+month = {june},
+number = {12},
+pages = {1709-1727},
+title = {The boundary layer of {Mars} : fluxes stability, turbulent spectra and growth of the mixed layer},
+volume = {51},
+year = {1994}
+}
+
+@article{Dyer:74,
+author = {Dyer , A. J.},
+journal = blm,
+pages = {363-372},
+title = {A review of the flux profile relationships},
+year = {1974}
+}
+
+@article{Hans:93,
+author = {Hansen , G. B.},
+journal = baas,
+number = {3},
+pages = {1034},
+title = {The spectral absorption of {CO2} ice in the thermal infrared},
+volume = {25},
+year = {1993}
+}
+
+@article{Barn:90,
+author = {Barnes , J. R.},
+journal = jgr,
+pages = {1401-1421},
+title = {Possible  effect of breaking gravity waves on the circulation of the middle atmosphere of {Mars}},
+volume = {95},
+year = {1990}
+}
+
+@article{Warr:84,
+author = {Warren , S. G.},
+journal = {Applied~Optics},
+pages = {1206-1225},
+title = {Optical constant of ice from the ultraviolet to the microwaves},
+volume = {23},
+year = {1984}
+}
+
+@article{Bell:93,
+author = {Bell,  James F. III and Calvin  , W. M. and Pollack ,  J. B.  and Crisp , D.},
+journal = {Lunar~and~Plan.~Sci.},
+pages = {83-84},
+title = {An observational search for {CO2} ice clouds on {Mars}},
+volume = {XXIV},
+year = {1993}
+}
+
+@article{Bell:90,
+author = {Bell III, J. F.  and McCord , T. B. and Owensby , P. D.},
+journal = jgr,
+pages = {14447-14461},
+title = {Observational evidence of crystalline iron oxides on {Mars}},
+volume = {95},
+year = {1990}
+}
+
+@article{Bell:93b,
+author = {Bell, James F. and Crisp , D.},
+journal = {Icarus},
+pages = {2-19},
+title = {Groundbased imaging spectroscopy of {Mars} in the near infrared : preliminary results},
+volume = {104},
+year = {1993}
+}
+
+@article{Forg:96,
+author = {Forget, F. and Pollack,  J.B.},
+journal = jgr,
+pages = {16,865-16,880},
+title = {Thermal infrared observations of the condensing {Martian} polar caps: {CO$_2$} ice temperatures and radiative budget},
+volume = {101},
+year = {1996}
+}
+
+@article{Mart:93,
+author = {Martin , Terry Z. and Richardson , Mark I.},
+journal = jgr,
+pages = {10,941-10,949},
+title = {New Dust Opacity Mapping From \protect{Viking} Infrared Thermal Mapper Data},
+volume = {98},
+year = {1993}
+}
+
+@article{Mart:93leo,
+author = {Martin , Leonard J. and Zurek , Richard W.},
+journal = jgr,
+number = {E2},
+pages = {3221-3246},
+title = {An analysis of the history of dust activity on {Mars}},
+volume = {98},
+year = {1993}
+}
+
+@article{Loui:79,
+author = {Louis , J.-F.},
+journal = blm,
+pages = {187-202},
+title = {A parametric model of vertical eddy fluxes in the atmosphere.},
+volume = {17},
+year = {1979}
+}
+
+@article{Carl:91,
+author = {Carlson, R. W. and Baines, K. H. and Encrenaz, Th. and Taylor, F,. and Drossart, P. and Kamp, L. W.  and Pollack, J. B. ad Lellouch, E. and Collard, A. D. and Calcutt , S. B. and Grinspoon  et al.},
+journal = sci,
+pages = {1541-1548},
+title = {Galileo infrared imaging spectroscopy measurements at \protect{Venus}},
+volume = {253},
+year = {1991}
+}
+
+@techreport{Till:87,
+author = {Tillman, James E. and Guest ,W.},
+institution = {National Space Sciences Data Center},
+title = {a},
+year = {1987}
+}
+
+@article{Bark:86,
+author = {Barkstrom , B. R. and Smith , G. L.},
+journal = rg,
+key = {Barkstrom and Smith,1986},
+pages = {379-390},
+title = {The \protect{E}arth \protect{R}adiation \protect{B}udget \protect{E}xperiment: Science and Implementation},
+volume = {24},
+year = {1986}
+}
+
+@article{Hubb:93,
+author = {Hubbard , W. B. \protect{et al.}},
+journal = aa,
+pages = {541-563},
+title = {The Occultation of 28 {Sgr by Titan}},
+volume = {269},
+year = {1993}
+}
+
+@article{Tala:81,
+author = {Talagrand , Olivier},
+journal = {Tellus},
+pages = {321-339},
+title = {On the mathematics of Data Assimilation},
+volume = {33},
+year = {1981}
+}
+
+@article{Char:69,
+author = {Charney , J. and Halem , M. and Jastrow , R.},
+journal = jas,
+pages = {1160-1163},
+title = {Use of Incomplete Historical Data to Infer the Present State of the Atmosphere},
+volume = {26},
+year = {1969}
+}
+
+@article{LeDi:86,
+author = {Le Dimet , F.-X. and Talagrand , O.},
+journal = {Tellus},
+pages = {97-110},
+title = {Variational algorithms for analysis and assimilation of meteorological observations: theoretical aspects},
+volume = {38A},
+year = {1986}
+}
+
+@article{Thep:91,
+author = {Th\'epaut , J.- N. and Courtier , P.},
+journal = qjrms,
+pages = {1225-1254},
+title = {Four-dimensional variational data assimilation using the adjoint of a multilevel primitive-equation model},
+volume = {117},
+year = {1991}
+}
+
+@article{Muhl:92,
+author = {Muhleman , D. O. and Grossman , A. W. and Slade , M. A. and Butler , B. J.},
+journal = baas,
+pages = {954-955},
+title = {Thes surface of \protect{Titan's} rotation: What is radar telling us?},
+volume = {24},
+year = {1992}
+}
+
+@book{Moor:83,
+author = {Moore , Patrick and Hunt , Garry and Nicolson , Iain and Cattermole , Peter},
+publisher = {Mitchell Beasley Publishers},
+title = {The Atlas of the Solar System},
+year = {1983}
+}
+
+@article{Mutc:76,
+author = {Mutch , Thomas A. and Binder , Alan B. and Huck , Friedrich O. and Levinthal , E. C. and Liebes , S. Jr. and Morris , E. C. and Patterson , W. R. and Pollack J. B. and Sagan , C. and Taylor , G. R.},
+journal = {Science},
+pages = {791-801},
+title = {The surface of \protect{Mars} : The view from the \protect{Viking}~1 Lander},
+volume = {193},
+year = {1976}
+}
+
+@article{Pick:79,
+author = {Pickersgill , Adrian O. and Hunt , Garry E.},
+journal = jgr,
+number = {B14},
+pages = {8317-8331},
+title = {The formation of \protect{Martian} Lee Waves generated by a crater},
+volume = {84},
+year = {1979}
+}
+
+@article{Pick:81,
+author = {Pickersgill , Adrian O. and Hunt , Garry E.},
+journal = jas,
+pages = {40-51},
+title = {An examination of the formation of linear lee waves generated by giant \protect{Martian} volcanoes},
+volume = {38},
+year = {1981}
+}
+
+@article{Fren:81,
+author = {French , R. G. and Gierasch , P. J. and Popp , B. D. and Yerdon , R. J.},
+journal = {Icarus},
+pages = {468-493},
+title = {Global paterns in cloud forms on Mars},
+volume = {45},
+year = {1981}
+}
+
+@article{Svit:90,
+author = {Svitek , Thomas and Murray , Bruce},
+journal = jgr,
+pages = {1495-1510},
+title = {Winter frost at {Viking  Lander} 2 site},
+year = {1990}
+}
+
+@article{Kahn:83,
+author = {Kahn , R.},
+journal = jgr,
+pages = {10189-10209},
+title = {Some observational constraints on the global-scale wind systems of \protect{Mars}},
+volume = {88},
+year = {1983}
+}
+
+@article{Kahn:84,
+author = {Kahn , R.},
+journal = jgr,
+pages = {6671-6688},
+title = {The spatial and seasonal distribution of \protect{Martian} clouds and some meteorological implications},
+volume = {89},
+year = {1984}
+}
+
+@article{Maga:87,
+author = {Magalhaes , J. A.},
+journal = {Icarus},
+pages = {442-468},
+title = {The \protect{Martian} \protect{Hadley} circulation: Comparison of "viscous" predictions to observations},
+volume = {70},
+year = {1987}
+}
+
+@article{Maga:82,
+author = {Magalhaes , J. and Gierasch , P.},
+journal = jgr,
+pages = {9975-9984},
+title = {A model of \protect{Martian} slopes winds:  Implications for eolian transport},
+volume = {87},
+year = {1982}
+}
+
+@article{Kief:79,
+author = {Kieffer , H. H.},
+journal = jgr,
+pages = {8263-8288},
+title = {Mars south polar spring and summer temperatures: a residual CO$_2$ frost},
+volume = {84},
+year = {1979}
+}
+
+@article{Gadi:78,
+author = {Gadian , A. M.},
+journal = {Icarus},
+pages = {454-465},
+title = {The dynamics of and the heat transfer by baroclinic eddies and large-scale stationnary topographically forced long waves in the \protect{Martian} atmosphere},
+volume = {33},
+year = {1978}
+}
+
+@article{Mart:74,
+author = {Martin , L. J.},
+journal = {Icarus},
+pages = {108-115},
+title = {The major \protect{Martian} dust stroms of 1971 and 1973},
+volume = {23},
+year = {1974}
+}
+
+@article{Mell:74,
+author = {Mellor , George L. and Yamada , Tetsuji},
+journal = jas,
+pages = {1791-1806},
+title = {A Hierarchy of Turbulence Closure Models for Planetary Boundary Layers},
+volume = {31},
+year = {1974}
+}
+
+@article{Mell:82,
+author = {Mellor , George L. and Yamada , Tetsuji},
+journal = {Rev. of Geophys.},
+month = {November},
+number = {4},
+pages = {851-875},
+title = {Development of a turbulence closure model for geophysical fluid problems},
+volume = {20},
+year = {1982}
+}
+
+@article{Miya:77,
+author = {Myakoda , K. and Sirutis},
+journal = bpa,
+pages = {445-447},
+title = {Comparative Integrations of Global Models with Various Parametrized Processes of Subgrid-Scale Vertical Transports: Description of the Parametrization},
+volume = {50},
+year = {1977}
+}
+
+@article{Frie:94,
+author = {Friedson , A. J.},
+journal = {Icarus},
+pages = {40-57},
+title = {Gravity waves in {Titan's} atmosphere},
+volume = {109},
+year = {1994}
+}
+
+@article{Jame:82,
+author = {James , P. B. and North , G. R.},
+journal = jgr,
+pages = {10271-10283},
+title = {The seasonal {CO$_2$} cycle on \protect{Mars} : An application of an energy balance climate model},
+volume = {87},
+year = {1982}
+}
+
+@article{Davi:77,
+author = {Davies ,  D. W. and Farmer , C. B.  and LaPorte  , D. D.},
+journal = jgr,
+pages = {3815-3822},
+title = {Behavior of volatile in {Mars}' polar areas~:  a model incorporating new experimental data.},
+volume = {82},
+year = {1977}
+}
+
+@article{Jone:79,
+author = {Jones, K.L. and Arvidson, R. E. and Guiness, E. A. and Braggs, S. L. and Wall , S. D. and Carlston , C. E. and Pidek, D. G.},
+journal = {Science},
+pages = {799-806},
+title = {One {Mars} year : {Viking} lander imaging observations},
+volume = {204},
+year = {1979}
+}
+
+@article{Mitc:89,
+author = {Mitchell , Jhon F. B.},
+journal = rg,
+pages = {115-139},
+title = {The "greenhouse" effect and climate change},
+volume = {27},
+year = {1989}
+}
+
+@article{Wall:81,
+author = {Wall, Stephen D.},
+journal = {Icarus},
+pages = {173-183},
+title = {Analysis of condensates formed at the {Viking} 2 lander site : the first winter},
+volume = {47},
+year = {1981}
+}
+
+@article{Hart:86,
+author = {Hart , Helen M. and Jakosky , Bruce M.},
+journal = {Icarus},
+pages = {134-142},
+title = {Composition and stability of the condensate observed at the {Viking} lander 2 site on {Mars}},
+volume = {66},
+year = {1986}
+}
+
+@article{Mccl:92,
+journal = jgr,
+number = {E5},
+pages = {7735-7757},
+title = {Atmosphere and Climate Studies Using the \protect{Mars} Observer Pressure Modulator Infrared Radiometer},
+volume = {97},
+year = {1992}
+}
+
+@phdthesis{Mayn:97,
+author = {Karine Maynard},
+school = {Universit\'e Paris-6},
+title = {Param\'etrisation de la diffusion lat\'erale dans un mod\`ele de circulation g\'en\'erale de l'atmosph\`ere},
+type = {th\`ese},
+year = {1997}
+}
+
+@phdthesis{Hour:92f,
+author = {Hourdin, Fr\'ed\'eric},
+school = {Universit\'e Paris-7},
+title = {Etude et mod\'elisation num\'erique de la circulation g\'en\'erale des atmosph\`eres plan\'etaires},
+type = {th\`ese},
+year = {1992}
+}
+
+@phdthesis{Forg:96these,
+author = {Forget, Fran\c{c}ois},
+school = {Universit\'e Paris-6},
+title = {Le climat de la plan\`ete Mars~:
+de l'importance des poussi\`eres et des r\'egions polaires.},
+type = {th\`ese},
+year = {1996}
+}
+
+@phdthesis{Bouc:95,
+author = {Boucher, Olivier},
+school = {Universit\'e Paris-6},
+title = {
+Etude de quelques interactions a{\'e}rosol-nuage-rayonnement~: mod{\'e}lisation et simulations avec un mod{\'e}le de circulation g{\'e}n{\'e}rale},
+type = {th{\`e}se},
+year = {1995}
+}
+
+@book{Lore:67,
+author = {Lorenz , Edward N.},
+publisher = {World Meteorological Organization},
+title = {The nature and theory of the general circulation of the atmosphere},
+year = {1967}
+}
+
+@book{Newe:72,
+author = {Newel , Reginald E. and Kidson , John W. and Vincent , Dayton G. and Boer , George J.},
+address = {Cambridge, Massachussetts, USA},
+publisher = {The MIT Press},
+title = {The general circulation of the torpical atmosphere},
+year = {1972}
+}
+
+@book{Herg:62,
+author = {Herg\'e},
+address = {Tournai, Belgique},
+publisher = {Casterman},
+title = {On a march\'e sur la lune},
+year = {1962}
+}
+
+@article{Bouc:95b,
+author = {Boucher, O.},
+journal = jc,
+pages = {1403--1409},
+title = {GCM Estimate of the indirect aerosol forcing using satellite-retrieved cloud effective droplet radii},
+volume = {8},
+year = {1995}
+}
+
+@techreport{Bouc:95c,
+author = {Boucher , O. and Li , Z.-X. and Le Treut , H.},
+institution = {LMD},
+number = {197},
+title = {Introduction du sch\'ema de convection de {T}iedtke dans les
+{MCG}s du {LMD}},
+year = {1995}
+}
+
+@article{Bouc:97,
+author = {Boucher , O. and Pham , M. and Sadourny , R.},
+journal = {Submitted to Annales Geophysic},
+title = {General circulation model simulations of indian summer monsoon with increasing levels of sulphate aerosols},
+year = {1997}
+}
+
+@article{Cres:59,
+author = {Cressman , G. P.},
+journal = mwr,
+pages = {367--374},
+title = {An operational objective analysis system},
+volume = {87},
+year = {1959}
+}
+
+@article{Hour:99,
+author = {Hourdin , F. and Armengaud , A.},
+journal = mwr,
+pages = {822--837},
+title = {Test of a hierarchy of finite-volume schemes for transport of trace species in an atmospheric general circulation model},
+volume = {127},
+year = {1999}
+}
+
+@article{Pudy:98,
+author = {Pudykiewicz , J. A.},
+journal = {Atmos. Environ.},
+pages = {3039--3050},
+title = {Application of adjoint tracer transport equations for evaluating source parameters},
+volume = {32},
+year = {1998}
+}
+
+@article{Hess:96,
+author = {Hess, P. G. and Nanda, S.  and Flocke, S. J.},
+journal = jgr,
+pages = {14,543--14,568},
+title = {Trajectories and related variations in the chemical composition
+of air for the Mauna Loa Observatory during 1991 and 1992},
+volume = {101},
+year = {1996}
+}
+
+@article{Ramo:96,
+author = {Ramonet, M. and Le Roulley , J. C. and Bousquet, P. and Monfray, P.},
+journal = {J. Atmos. Chem.},
+pages = {107--136},
+title = {Radon-222 measurements during the Tropoz II campaign and coparison with a global atmospheric transport model},
+volume = {23},
+year = {1996}
+}
+
+@article{Merr:94,
+author = {Merrill, J. T.},
+journal = jgr,
+pages = {25,8881-25,8889},
+title = {Isentropic airflow probability analysis},
+volume = {99},
+year = {1994}
+}
+
+@techreport{Graz:98,
+author = {Graziani , C. and Klug , W. and Mosca , S.},
+address = {Office for Official Publications of the European Communities},
+institution = {Joint Research Center},
+title = {Real-time long-range dispersion model evaluation of the {ETEX} release},
+volume = {EUR--17754},
+year = {1996}
+}
+
+@article{X,
+author = {X},
+journal = {X},
+pages = {X},
+title = {X},
+volume = {X},
+year = {X}
+}
+
+@article{Hour:00GRL,
+author = {Hourdin , F. and Issartel , J.-P.},
+journal = grl,
+pages = {2245--2248},
+title = {Sub-surface nuclear tests monitoring through the CTBT xenon network},
+year = {2000},
+vol = "27"
+}
+
+@article{Hour:99CRAS,
+author = {Hourdin , F. and Issartel , J.-P. and Cabrit , B. and Idelkadi , A.},
+journal = {CRAS},
+pages = {623--628},
+title = {Reciprocity of Atmospheric Transport of Trace Species},
+volume = {329},
+year = {1999}
+}
+
+@article{Hosk:75,
+author = {Hoskins, B. J. and Simmons, A. J.},
+journal = qjrms,
+pages = {771-783},
+title = {A Multi-layer spectral model and the semi-implicit method},
+volume = {109},
+year = {1975}
+}
+
+@article{Barn:96jas,
+author = {Barnes, J. R. and Haberle, R. M.},
+journal = jas,
+pages = {3143-3156},
+title = {The {Martian} zonal-mean circulation: angular momentum and potential vorticity structure in GCM simulations},
+volume = {53},
+year = {1996}
+}
+
+@article{LeTr:96,
+author = {Le Treut , H. and Forichon , M. and Boucher , O. and Li , Z.-X.},
+journal = {submitted to J. Climate},
+title = {Sulfate aerosol indirect effect and CO$_2$ greenhouse forcing: equilibrium response of the LMD GCM and associated cloud feedbacks},
+year = {1996}
+}
+
+@article{author
+}
+
+@article{author
+}
+
+@article{author
+}
+
+@article{author
+}
+
+@article{Thom:70,
+author = {Thompson , R.},
+journal = jas,
+pages = {1107-1116},
+title = {Venus'  general circulation is a merry-go-round},
+volume = {27},
+year = {1970}
+}
+
+@misc{Elia:91,
+author = {Eliason, E.   and  Batson , R. and Manley , A.},
+title = {Mars {Mosaicked Digital Image Model (MIDM) and Digital Terrain Model (DTM), 1991.}},
+year = {1991}
+}
+
+@inproceedings{Davi:92,
+author = {Davies , Merton E. and Batson , Raymond M. and Sherman , S. C. Wu},
+booktitle = {Mars},
+pages = {321-342},
+publisher = {Univ. of Ariz. Press, Tucson},
+title = {Geodesy and Cartography of {Mars}},
+year = {1992}
+}
+
+@article{Thom:79,
+author = {Thomas , P. and Veverka , J.},
+journal = jgr,
+number = {b14},
+pages = {8131-8146},
+title = {Seasonal and secular variations of wind streaks on \protect{Mars}: A anlysis of \protect{Mariner~9} and \protect{Viking} data},
+volume = {84},
+year = {1979}
+}
+
+@article{Shap:71,
+author = {Shapiro , R.},
+journal = jas,
+pages = {523-591},
+title = {The use of linear filtering as a parametrization of atmospheric diffusion},
+volume = {28},
+year = {1971}
+}
+
+@article{Schn:77a,
+author = {Schneider , Edwin K.},
+journal = jas,
+pages = {280-296},
+title = {Axially symmetric Steady-State Models of the Basic State for Instabillity and Climate Studies. \protect{Part II}. Nonlinear Calculations},
+volume = {34},
+year = {1977}
+}
+
+@article{Samu:83a,
+author = {Samuelson , R. E. and Maguire , W. C. and  Hanel , R. A. and Kunde , V. G.and Jennigs D. E. and Yung , Y. L. and Aikin , A. C.},
+journal = jgr,
+pages = {8709-8715},
+title = {CO$_2$ on \protect{Titan}},
+volume = {88},
+year = {1983}
+}
+
+@article{Samu:83,
+author = {Samuelson , R. E.},
+journal = {Icarus},
+pages = {364-387},
+title = {Radiative equilibrium model of \protect{Titan's} atomsphere},
+volume = {53DedDeD},
+year = {1983}
+}
+
+@book{Brig:82,
+author = {Briggs , G. A. and Taylor , F. W.},
+publisher = {Cambridge University Press},
+title = {Photographic Atlas of the Planets},
+year = {1982}
+}
+
+@proceedings{esa:91,
+address = {Paris, France},
+editor = {ESA},
+publisher = {ESA Publications Division},
+title = {Symposium on \protect{Titan}},
+volume = {SP-338},
+year = {1992}
+}
+
+@inproceedings{Cous:91,
+author = {Coustenis , Athena},
+booktitle = {Symposium on Titan},
+crossref = {esa:91},
+pages = {53-58},
+title = {Titan's atmosphere: latitudinal variations in temperature and composition}
+}
+
+@article{Cous:95,
+author = {Coustenis , A. and B\'ezard , B.},
+journal = {Icarus},
+pages = {126-140},
+title = {Titan's atmosphere from {Voyager} Infrared observations : {IV} Latitudinal variations of temperature and composition},
+volume = {115},
+year = {1995}
+}
+
+@article{Kaln:73,
+author = {K\'alnay de Rivas , Eugenia},
+journal = jas,
+pages = {763-779},
+title = {Numerical models of the circulation of the atmosphere of \protect{Venus}},
+volume = {30},
+year = {1973}
+}
+
+@article{Suar:92,
+author = {Suarez , Max J. and Duffy , Dean G.},
+journal = jas,
+pages = {1541-1554},
+title = {Terrestrial Superrotation: A bifurcation of the general circulation},
+year = {1992}
+}
+
+@article{Newm:92,
+author = {Newman, Matthew and Leovy , Conway},
+journal = sci,
+pages = {647-650},
+title = {Maintenance of the Rotational Winds in \protectP{Venus'} Middle Atmosphere by thermal tides},
+volume = {257},
+year = {1992}
+}
+
+@article{Ross:79,
+author = {Rossow , William B.},
+journal = jas,
+pages = {377-389},
+title = {Large--scale Motion in the \protect{Venus} Stratosphere},
+volume = {36},
+year = {1979}
+}
+
+@article{Ross:80,
+author = {Rossow , W. B. and Del Genio , A. D. and Limaye , S. S. and Travis , L. D. and Stone , P. H.},
+journal = jgr,
+pages = {8107-8128},
+title = {Cloud morphology and motions from \protect{Pioneer} \protect{Venus} images},
+volume = {85},
+year = {1980}
+}
+
+@article{Ross:78,
+author = {Rossow , William B.},
+journal = {Icarus},
+pages = {1,50},
+title = {Cloud microphysics: {A}nalysis of the clouds of {Earth, Venus, Mars, and Jupiter}},
+volume = {36},
+year = {1978}
+}
+
+@article{Del:93,
+author = {Del Genio , Anthony D. and Zhou , Wei and Eichler , Timothy P.},
+journal = {Icarus},
+pages = {1-17},
+title = {Equatorial superrotation in a slowly rotating \protect{GCM}: implications for \protect{Titan} and \protect{Venus}},
+volume = {101},
+year = {1993}
+}
+
+@article{Fels:74,
+author = {Fels , S. B. and Lindzen , R. S.},
+journal = gfd,
+pages = {149-191},
+title = {The interaction of thermally excited gravity waves with the mean zonal flows},
+volume = {6},
+year = {1974}
+}
+
+@article{Schu:70,
+author = {Schubert , Gerald and Young , Richard E.},
+journal = jas,
+pages = {523-528},
+title = {The 4-Day \protect{Venus} Circulation Driven by Periodis Thermal Forcing},
+volume = {27},
+year = {1970}
+}
+
+@article{Fels:77,
+author = {Fels , Stephen B.},
+journal = jas,
+pages = {499-514},
+title = {Momentum and Energy Exchanges due to Orographically scaterred Gravity Waves},
+volume = {34},
+year = {1977}
+}
+
+@article{Malk:70,
+author = {Malkus , Willem V. R.},
+journal = jas,
+pages = {529-535},
+title = {Hadley--Halley Circulation on \protect{Venus}},
+volume = {27},
+year = {1970}
+}
+
+@article{Zure:88,
+author = {Zurek , Richard W. and Haberle , Robert M.},
+journal = jas,
+pages = {2469-2485},
+title = {Zonally Symmetric Response to Atmospheric Tidal Forcing in the Dusty {Martian} Atmosphere},
+volume = {45},
+year = {1988}
+}
+
+@inproceedings{Chri:92,
+author = {Christensen , P. R. and Moore , H. J.},
+address = {Tucson, AR},
+booktitle = {Mars},
+chapter = {26},
+pages = {686-729},
+publisher = {University of Arizona Press, Tucson},
+title = {The {Martian} surface layer},
+year = {1992}
+}
+
+@inproceedings{Zure:92,
+author = {Zurek , R. W. and Barnes , J. R. and Haberle , R. M. and Pollack , J. B. and Tillman , J. E. and Leovy ,  C. B.},
+booktitle = {Mars},
+chapter = {26},
+pages = {835-933},
+publisher = {Univ. of Ariz. Press, Tucson},
+title = {Dynamics of the atmosphere of \protect{Mars}},
+year = {1992}
+}
+
+@article{Boug:88,
+author = {Bougher , S. W. and Dickinson , R. E.},
+journal = jgr,
+pages = {7325-7337},
+title = {Mars mesosphere and thermosphere. I. Global ,mean heat budget and thermal structure},
+volume = {94},
+year = {1988}
+}
+
+@article{Schu:69,
+author = {Scubert , G. and Whitehead , J.},
+journal = sci,
+pages = {71-72},
+title = {Moving flame experiment with liquid mercury: Possible implication for Venus atmosphere},
+year = {1969}
+}
+
+@misc{Schu:97,
+author = {Schubnel, A.},
+howpublished = {Rapport de stage au LMD},
+title = {Modélisation numérique de la structure thermique de l'atmosphere de Triton},
+year = {1997}
+}
+
+@article{Lind:88,
+author = {Lindzen , Richard S. and Hou , Arthur},
+journal = jas,
+pages = {2416-2427},
+title = {Hadley circulation for zonally averaged heating centered off the equator},
+volume = {45},
+year = {1988}
+}
+
+@article{Lind:70,
+author = {Lindzen , Richard S.},
+journal = jas,
+pages = {536-549},
+title = {The Application and Aplicability of Terrestrial Atmospheric Tidal Theory to \protect{Venus} and \protect{Mars}},
+volume = {27},
+year = {1970}
+}
+
+@article{Ross:83,
+author = {Rossow , William B.},
+journal = jas,
+pages = {273-302},
+title = {A General Circulation Model of a {Venus}--like Atmosphere},
+volume = {40},
+year = {1983}
+}
+
+@article{Hunt:76,
+author = {Hunt , B. G.},
+journal = mwr,
+pages = {333-350},
+title = {Experiments with a Stratospheric General Circulation Model: Part \protect{IV}. Inclusion of the Hydrological Cycle},
+volume = {104},
+year = {1976}
+}
+
+@article{Hunt:79b,
+author = {Hunt , G. E. and James , P. B.},
+journal = {Nature},
+pages = {531-532},
+title = {Martian extratropical cyclones},
+volume = {278},
+year = {1979}
+}
+
+@article{Del:82,
+author = {Del Genio , A. D. and Rossow , W. B.},
+journal = {Icarus},
+pages = {391-415},
+title = {Temporal variability of ultraviolet cloud features in the Venus startosphere},
+volume = {51},
+year = {1982}
+}
+
+@article{Char:47,
+author = {Charney , J. G.},
+journal = {J. Meteor.},
+pages = {135-162},
+title = {The dynamics of long waves in a baroclinic westerly current},
+volume = {35},
+year = {1947}
+}
+
+@article{Eady:49,
+author = {Eady , E. T.},
+journal = {Tellus},
+pages = {35-52},
+title = {Long waves and cyclones},
+volume = {1},
+year = {1950}
+}
+
+@inproceedings{Fjor:51,
+author = {Fjortoft , R.},
+address = {Boston},
+booktitle = {Compendium of meteorology},
+editor = {T. F. Malone},
+journal = {Compendium of meteorology},
+pages = {454-463},
+publisher = {Amer. Meteor. Soc.},
+title = {Stability properties of large-scale distubances},
+year = {1951}
+}
+
+@article{Kuo:52,
+author = {Kuo , H.-L.},
+journal = {J. Meteor.},
+pages = {260-278},
+title = {Three-dimensional disturbances in a baroclinic zonal current},
+volume = {9},
+year = {1952}
+}
+
+@article{Kuo:49,
+author = {Kuo , H. L.},
+journal = {J. Meteor.},
+pages = {105-122},
+title = {Dynamic instability of two-dimensional nondivergent flow in a barotropic atmosphere},
+volume = {6},
+year = {1949}
+}
+
+@article{Hide:69,
+author = {Hide , R.},
+journal = jas,
+pages = {841-853},
+title = {Dynamics of the atmospheres of the major planets with an appendix on the viscous boundary layer at the rigid boundary surface of an electrically conducting rotating fluid in the presence of a magnetic field},
+type = { field},
+volume = {26},
+year = {1969}
+}
+
+@unpublished{Sado:90,
+author = {Sadourny , Robert},
+note = {Cours du DEA de m\'et\'eorologie de PARIS~6},
+title = {La circulation g\'en\'erale de l'atmosph\`ere: Th\'ories et observations},
+year = {1990}
+}
+
+@article{Hide:75,
+author = {Hide , R. and Mason , P. J.},
+journal = {Adv. in Physics},
+pages = {47-100},
+title = {Slopping convection in a rotating fluid},
+volume = {24},
+year = {1975}
+}
+
+@book{Pedl:82,
+author = {Pedlosky , Joseph},
+address = {New York},
+publisher = {Springer-Verlag},
+title = {Geophysical Fluid Dynamics},
+year = {1982}
+}
+
+@article{Lell:89,
+author = {Lellouch , E. and Coustenis , A.  and Gautier , D. and Raulin , F. and Dubouloz , N. and Fr\`ere , C.},
+journal = {Icarus},
+pages = {328-349},
+title = {Titan's atmosphere and hypothesized ocean: A reanalysis of  {Voyager~1} radio-occultation and {IRIS 7.7 $\mu$m} data.},
+volume = {79},
+year = {1989}
+}
+
+@misc{Lell:94,
+author = {Lellouch, E. and Rosenqvist , J. and Goldstein, J. J. and Boucher , S. W. and Paubert , G.},
+howpublished = {Acte du Colloque National de planétologie de l'INSU},
+note = {Section 13.5},
+title = {Dynamique des {atmosphère moyennes de Vénus et de Mars par spectroscopie  millimétrique}},
+year = {1994}
+}
+
+@misc{Benc:94,
+author = {Benchkoura, A. and Schmitt, B. and Klinger, J.},
+howpublished = {Acte du Colloque National de planétologie de l'INSU},
+note = {Section 13.5},
+title = {Mod\'elisation num\'erique du transport de volatils et de la
+differenciation chimique \`a la surface du satellite {Triton}},
+year = {1994}
+}
+
+@article{Boye:66,
+author = {Boyer , C. and Gu\'erin , P.},
+journal = {C. R. Hebd. S\'eances Acad. Sci.},
+pages = {253-255},
+title = {Mise en \'evidence directe, par la photographie d'une rotation r\'etrograde de V\'enus en 4 jours},
+volume = {263},
+year = {1966}
+}
+
+@inproceedings{Raul:92,
+author = {Raulin , F. and Fr\`ere , C. and Do , L. and Khlifi , M. and Paillous , P. and de Vanssay , E.},
+booktitle = {Symposium on Titan},
+crossref = {esa:91},
+title = {Organic chemistry on \protect{Titan} versus Terrestrial prebiotic chemistry: Exobiological implications}
+}
+
+@inproceedings{Gaut:92,
+author = {Gautier, Daniel},
+booktitle = {Symposium on Titan},
+crossref = {esa:91},
+pages = {43-51},
+publisher = {ESA},
+title = {The composition of the atmosphere of {Titan}},
+volume = {SP 338},
+year = {1992}
+}
+
+@inbook{Shap:68,
+author = {Shapiro , I. I.},
+address = {New York: Mc Graw-Hill},
+pages = {143-185},
+publisher = {eds. J. V. Evans and T. Hagfors},
+title = {Spin and orbital motions of the planets},
+year = {1968}
+}
+
+@article{Hadl:35,
+author = {Hadley , G.},
+journal = ptrsl,
+pages = {58-62},
+title = {Concerning the cause of the general trade-winds},
+volume = {39},
+year = {1735}
+}
+
+@article{Hall:86,
+author = {Halley , E.},
+journal = ptrsl,
+pages = {153-168},
+title = {An historical account of the trade winds, and monsoons, observable in the seas between and near the tropiks, with an attempt to assign the physical cause of the said winds},
+volume = {16},
+year = {1686}
+}
+
+@article{Evan:76,
+author = {Evans , David S.},
+journal = {Science},
+note = {Book rewview},
+pages = {754},
+title = {A Fancier of \protect{Mars}},
+volume = {193},
+year = {1976}
+}
+
+@book{Louc:88,
+author = {Louchet , Andr\'e},
+address = {120 Bd St Michel, 75280 Paris CEDEX 06},
+publisher = {Masson},
+title = {La plan\`ete Mars: description g\'eographique},
+year = {1988}
+}
+
+@book{Pica:53,
+author = {Picart , Luc},
+address = {103 Bd. Saint--Michel, Paris},
+publisher = {Librairie Armand Colin},
+title = {Astronomie g\'en\'erale},
+year = {1953}
+}
+
+@article{Blam:91,
+author = {Blamont , J. E. and Chassefi\`ere , E. and Goutail , J. P. and Mege , B. and Munes-Pinharanda and Souchon , G and Krasnopolsky , V. A. and Krysko , A. A. and Moroz , V. I..},
+journal = pss,
+pages = {175-187},
+title = {Vertical profiles of dust and ozone in the {Martian} atmosphere deduced from solar occultation measurements},
+volume = {39},
+year = {1991}
+}
+
+@article{Blam:89,
+author = {Blamont , J. E. and Chassefi\`ere , E. and Goutail , J. P. and Mege , B. and Munes-Pinharanda and Souchon , G and Krasnopolsky , V. A. and Krysko , A. A. and Moroz , V. I..},
+journal = {Nature},
+pages = {600-603},
+title = {Vertical profiles of dust and ozone in the {Martian} atmosphere deduced from solar occultation measurements},
+volume = {341},
+year = {1989}
+}
+
+@article{Comb:91,
+author = {Combes , M. and Cara , C. and Drossart , P. and Encrenaz , T. and Lellouch , E. and Rosenqvist , J. and Bibring , J.-P. and Erard , S. and Gondet , B. and Langevin , Y. and Soufflot , A. {\em et al.}},
+journal = pss,
+pages = {189-197},
+title = {Martian atmosphere studies from the \protect{ISM} experiment},
+volume = {39},
+year = {1991}
+}
+
+@article{Moro:91,
+author = {Moroz , V. I. and Petrova , E. V. and Ksanfomality , L. V. and Ganpantzerova , O. F. and Goroshkova , N. V. and Zharkov , A. V. and Nikitin , G. E. and Esposito , L. and Bibring , J.-P. {\em et al.}},
+journal = pss,
+pages = {199-207},
+title = {Characteristics of aerosol phenomena in {Martian} atmosphere from \protect{KRFM} eperiment data},
+volume = {39},
+year = {1991}
+}
+
+@article{Jose:76,
+author = {Joseph , J. H. and Wiscombe , W. J. and Weiman , J. A.},
+journal = jas,
+pages = {2452-2459},
+title = {The Delta-Eddington Approximation for radiative flux transfer},
+volume = {33},
+year = {1976}
+}
+
+@article{Zdun:80,
+author = {Zdunkowski , W. G. and Welch , R. M. and Korb , G.},
+journal = bpa,
+pages = {147-166},
+title = {An investigation of the structure of typical two-stream methods for the calculation of solar fluxes and heating rates in clouds},
+volume = {53},
+year = {1980}
+}
+
+@article{Gele:79,
+author = {Geleyn , J. F. and Hollingswortha , A.},
+journal = bpa,
+pages = {1-16},
+title = {An economical method for the computation of the interaction between scattering and line absorption of radiation},
+volume = {52},
+year = {1979}
+}
+
+@article{Emde:12,
+author = {Emden , R.},
+journal = {Sitzungsber. Bayer. Akad. Wiss. Math.-Phys. Kl.},
+pages = {55},
+title = {\"Uber Strahlungsgleichgewicht und atmospher\"ische Strahlung.},
+volume = {1},
+year = {1912}
+}
+
+@book{Palt:76,
+author = {Paltridge , G. W. and Platt , C. M. R.},
+address = {335 Jan Van Galenstraat/ P. O. Box 211, Amsterdam, The Netherlands},
+publisher = {Elsevier scientific publishing company},
+title = {Radiative processes in meteorology and climatology},
+year = {1976}
+}
+
+@article{Pall:81,
+author = {Palluconi , F. D. and Kieffer , H. H.},
+journal = {Icarus},
+pages = {415-426},
+title = {Thermal inertia mapping of {Mars} from {$60^{\mbox{o}}$S to $60^{\mbox{o}}$N}},
+volume = {45},
+year = {1981}
+}
+
+@article{Ples:81,
+author = {Pleskot , L. K. and Miner ,  E. D.},
+journal = {Icarus},
+pages = {179-201},
+title = {Time variability of {Martian} bolometric albedo},
+volume = {45},
+year = {1981}
+}
+
+@unpublished{Forg:91,
+author = {Forget , Fran\c{c}ois},
+note = {Rapport du stage de DEA "Oc\'eanologie, m\'et\'eorologie et environnement" de Paris VI},
+title = {Simulation nu\'erique de l'atmosph\`ere Martienne},
+year = {1991}
+}
+
+@article{Forg:95,
+author = {Forget , F. and Pollack , J. B. and Hansen , G. B.},
+journal = jgr,
+pages = {21,119-21,234},
+title = {Low brightness temperatures of {Martian} polar caps: {CO$_2$} clouds or low surface emissivity?},
+volume = {100},
+year = {1995}
+}
+
+@inproceedings{Hour:96estecb,
+author = { Hourdin , F. and Forget , Fran\c{c}ois and Fournier , Richard and Talagrand , O. and Read , P. L. and Collins , M. and Lewis , S. R. and Thomas , P. J.},
+booktitle = {Environement Modelling for Space-based Applications},
+editor = {A. Hilgers and T.-D. Guyenne},
+pages = {315-320},
+series = {ESA},
+title = {Numerical Modelling of the General Circulation of the {Martian} Atmosphere},
+volume = {SP-392},
+year = {1996}
+}
+
+@inproceedings{Hour:96estec,
+author = { Hourdin , F. and Talagrand , O. and Menou , K. and Fournier , R. and Dufresnes , J.-L. and Gautier , D. and Courtin , R.  and B\'ezard , B. and McKay , C. P.},
+booktitle = {Environement Modelling for Space-based Applications},
+editor = {A. Hilgers and T.-D. Guyenne},
+pages = {329-333},
+series = {ESA},
+title = { Numerical Modelling of the Circulation of Superrotating Atmospheres: {Venus and Titan}},
+volume = {SP-392},
+year = {1996}
+}
+
+@inproceedings{Four:96estec,
+author = { Fournier , R. and Deleersnijder , E. and Hourdin , F. and Lahellec , A. and Forget , F. and Talagrand , O.},
+booktitle = {Environement Modelling for Space-based Applications},
+editor = {A. Hilgers and T.-D. Guyenne},
+pages = {321},
+series = {ESA},
+title = { A  Boundary-Layer Parametrisation for {Martian General Circulation Models}},
+volume = {SP-392},
+year = {1996}
+}
+
+@misc{Coll:96estec,
+author = { Read , P. L. and Collins , M. and Lewis , S. R. and Thomas , P. J. and Talagrand , O. and Forget , F. and Fournier , R. and Hourdin , F.},
+howpublished = { Oral presentation at the Symopsium on Environment Modelling for space-based applications, ESTEC/ESA},
+title = { A Climate Database for the {Martian} Atmosphere},
+year = {1996}
+}
+
+@article{Coll:95a,
+author = {Collins , M. and James , I. N.},
+journal = jgr,
+number = {E7},
+pages = {14421-14432},
+title = {Regular and irregular baroclinic waves in a simplified global circulation model of the {Martian} atmosphere},
+volume = {100},
+year = {1995}
+}
+
+@misc{Forg:95dps,
+author = {Forget, F.  and Hansen , G.B. and Pollack , J.B.},
+howpublished = {Oral presentation at the 27th annual DPS meeting
+(Kona). Abstracts book, p44},
+title = {Low brightness temperatures of {Martian} polar caps},
+year = {1995}
+}
+
+@misc{Habe:95dps,
+author = {Haberle, R. M. and Schaeffer , J.},
+howpublished = {Oral presentation at the 27th annual DPS meeting
+(Kona). Abstracts book, p12},
+title = {Obliquity experiment with a Mars general circulation model},
+year = {1995}
+}
+
+@misc{Wood:95,
+author = {Wood, S. E. and Richardson, M. I. and Paige, D. A.},
+howpublished = {Oral presentation at the 27th annual DPS meeting (Kona). Abstracts book, p44},
+title = {Microphysical and radiative processes in {CO$_2$} snow on {Mars}},
+year = {1995}
+}
+
+@misc{Tala:95dps,
+author = {Talagrand , O. and Forget , F. and Hourdin , F. and Read , P. and Collins, M. and Lewis , S.},
+howpublished = {Oral presentation at the 27th annual DPS meeting (Kona). Abstracts book, p13},
+title = {A plan for developing  a {Martian} climate database},
+year = {1995}
+}
+
+@misc{Hour:95dps,
+author = {Hourdin , Fr\'ed\'eric and Talagrand , O.  and Courtin , R.  and Gautier , D. and McKay , C. P.},
+howpublished = {Oral presentation at the 27th annual DPS meeting (Kona). Abstracts book, p51},
+title = {Atmospheric superrotation on {Titan}},
+year = {1995}
+}
+
+@article{Forg:93dps,
+author = {Forget , F. and Pollack , J. B.},
+journal = baas,
+note = {Oral presentation at the 25th annual DPS meeting (Boulder)},
+pages = {1070},
+title = {Impact of the {CO$_2$} and {H$_2$O} clouds of the {Martian } polar hood on the polar energy balance},
+volume = {25},
+year = {1993}
+}
+
+@unpublished{Hour:89,
+author = {Hourdin , Fr\'ed\'eric},
+note = {stage de DEA "Astrophysique et T\'echniques spatiales" Universit\'e Paris 7},
+title = {Adaptation du Mod\`ele de Circulation G\'en\'eral du \protect{LMD} aux conditions \protect{Martiennes}},
+year = {1989}
+}
+
+@book{Good:89,
+author = {Goody , R. M. and Yung , Y. L.},
+address = {200 Madison Avenue, New York, New York 10016},
+edition = {second},
+publisher = {Oxford University Press.},
+title = {Atmospheric Radiation, Theoretical Basis},
+year = {1989}
+}
+
+@article{Brig:77,
+author = {Briggs , Geoffrey and Klaasen , Kenneth and Thorpe , Thomas and Wellman , John},
+journal = jgr,
+pages = {4121-4149},
+title = {Martian dynamical phenomenon during {June-November} 1976: \protect{Viking} orbiter imaging results},
+volume = {82},
+year = {1977}
+}
+
+@article{Brig:74,
+author = {Briggs , G. A. and Leovy , C. B.},
+journal = bams,
+pages = {278-296},
+title = {Mariner 9 observations of the \protect{Mars} north polar hood},
+volume = {55},
+year = {1974}
+}
+
+@article{Brig:74b,
+author = {Briggs, G. A},
+journal = {Icarus},
+pages = {167-191},
+title = {The nature of the residual {Martian} polar caps},
+volume = {23},
+year = {1974}
+}
+
+@article{Klio:73,
+author = {Kliore , A. J. and Fjeldbo , G. and Seidel, B. L. and Woiceshyn , P. M.},
+journal = jgr,
+pages = {4331-4350},
+title = {S band occultation measurements of the atmosphere and topography of \protect{Mars} with \protect{Mariner} 9: {Extended} mission coverage of polar intermediate latitudes},
+volume = {78},
+year = {1973}
+}
+
+@article{Klio:72,
+author = {Kliore , A. J. and  Cain , D. L. and  Fjeldbo , G. and  Seidel , B. L.  and
+Sykes , M. J.},
+journal = {Icarus},
+pages = {484-516},
+title = {The  atmosphere of {Mars from Mariner 9} radio occultation
+measurements},
+volume = {17},
+year = {1972}
+}
+
+@article{Vere:77,
+author = {Vereka , J. and Thomas , P. and Greeley , R.},
+journal = jgr,
+pages = {4167-4187},
+title = {A study of variables fitures on \protect{Mars} during the \protect{Viking} primary mission},
+volume = {82},
+year = {1977}
+}
+
+@article{Conr:73,
+author = {Conrath , B. and Curran , R. and Hanel , R. and Kunde , V. and Maguire , W. and Pearl , J. and Pirraglia , J. and Welker , J. and Burke , T.},
+journal = jgr,
+pages = {4267-4278},
+title = {Atmospheric and surface properties of \protect{Mars} obtained by infrared spectroscopy on \protect{Mariner} 9},
+volume = {78},
+year = {1973}
+}
+
+@article{Chri:84,
+author = {Christensen , P. R. and  Zurek , R. W.},
+journal = jgr,
+pages = {4587-4596},
+title = { Martian  north polar hazes and surface ice: {Results} from the \protect{Viking} survey/completion mission},
+volume = {89},
+year = {1984}
+}
+
+@article{Conr:75,
+author = {Conrath , B. J.},
+journal = {Icarus},
+pages = {36-46},
+title = {Thermal structure of the \protect{Martian} atmosphere during the dissipation of dust storm of 1971},
+volume = {24},
+year = {1975}
+}
+
+@techreport{Chri:94,
+author = {Christensen , P. R. and Edgett  , K. S.},
+institution = {LPI},
+number = {94-04},
+title = {Physical properties ({Particle size, rock abundance}) from thermal infrared remote observations : implication for {Mars} landing site},
+year = {1994}
+}
+
+@article{Ditt:79,
+author = {Ditteon, R. and Kieffer, H. H.},
+journal = jgr,
+pages = {8294-8300},
+title = {Optical properties of solid {CO$_2$}: {Application} to {Mars}},
+volume = {84},
+year = {1979}
+}
+
+@article{Chri:75,
+author = {Christensen, E. J.},
+journal = jgr,
+pages = {2909-2913},
+title = {Martian topography derived from occultation, radar, spectral, and optical measurements},
+volume = {80},
+year = {1975}
+}
+
+@unpublished{Paig:92a,
+author = {Paige  , David A.  and  Bachman , Jennifer E.  and Keegan K. D.},
+note = {Submitted to the Jour. Geophys. Res},
+title = {Thermal and albedo mapping of the polar regions of {Mars} using {Viking} thermal mapper observations : 1. {North} polar region},
+year = {1992}
+}
+
+@inproceedings{Simp:92,
+author = {Simpson , Richard A. and Harmon , John K. and Zisk , Stanley H. and Thompson , T. W.  and Muhleman , Duane O.},
+booktitle = {Mars},
+pages = {pp.~652-685},
+publisher = {University of Arizona Press, Tucson},
+title = {Radar determination of {Mars} surface properties},
+year = {1992}
+}
+
+@article{Fjel:77,
+author = {Fjeldbo , Gunnar and Sweetnam , Donald and Brenkle , Joseph and Christensen , Edward and Farless , Jitendra and Seidel , Boris and Michael , William and Wallio , Andrew and Grossi , Marioand},
+journal = jgr,
+pages = {4317-4324},
+title = {Viking radio occultation measurements of the {Martian} atmosphere and topography: primary coverage},
+volume = {82},
+year = {1977}
+}
+
+@article{Farm:77,
+author = {Farmer , C. B. and Davies , D. W. and Holland , A. L. and La Porte , D. D. and Doms , P. E.},
+journal = jgr,
+pages = {4225-4248},
+title = {Mars: water vapor observations from the \protect{Viking} orbiters},
+volume = {82},
+year = {1977}
+}
+
+@article{Farm:79,
+author = {Farmer , C. B. and Doms , P. E.},
+journal = jgr,
+number = {B6},
+pages = {2881-2888},
+title = {Global seasonal variation of water vapor on \protect{Mars} and the  implications for permafrost},
+volume = {84},
+year = {1979}
+}
+
+@article{Kief:77,
+author = {Kieffer , Hugh H. and Martin , T. Z. and Peterfreund , R. and Jakosky , Bruce M. and Miner , Ellis D. and Palluconi , Frank Don},
+journal = jgr,
+pages = {4249-4291},
+title = {Thermal and albedo mapping during the \protect{Viking} primary mission},
+volume = {82},
+year = {1977}
+}
+
+@article{Kief:76b,
+author = {Kieffer , H. H. and  Christensen , P. R. and  Martin , T. Z. and
+Miner, E. D. and Palluconi , F. D.},
+journal = {Science},
+pages = {1346-1351},
+title = {Infrared  thermal mapping of the {Martian} surface and atmosphere: {Viking} observation of diurnal and geometric observation},
+volume = {194},
+year = {1976}
+}
+
+@article{Kerz:77,
+author = {Kerzhanovich , V. V.},
+title = "{Mars 6 - Improved analysis of the descent module measurements}",
+journal = {Icarus},
+pages = {1-25},
+doi = {10.1016/0019-1035(77)90117-8},
+volume = {30},
+year = {1977}
+}
+
+@article{Owen:77,
+author = {Owen , Tobias and Biemann , K. and Rushneck , D. R. and Biller , J. E. and Howarth , D. W. and Lafleur , A. L.},
+journal = jgr,
+pages = {4635-4639},
+title = {The composition of the atmosphere at the surface of \protect{Mars}},
+volume = {82},
+year = {1977}
+}
+
+@article{Squy:94,
+author = {Squyres, S.W. and Kasting , J.F.},
+journal = {Science},
+pages = {744-749},
+title = {Early {Mars} , how warm and how wet?},
+volume = {265},
+year = {1994}
+}
+
+@article{Davi:79,
+author = {Davies , D. W.},
+journal = jgr,
+number = {B14},
+pages = {8335-8340},
+title = {The relative humidity of \protect{Mars} atmosphere},
+volume = {84},
+year = {1979}
+}
+
+@article{Davi:79a,
+author = {Davies , Donald W.},
+journal = jgr,
+number = {B6},
+pages = {2875-2879},
+title = {The vertical distribution of \protect{Mars} water vapor},
+volume = {84},
+year = {1979}
+}
+
+@article{Owen:72,
+author = {Owen , T. and Sagan , C.},
+journal = {Icarus},
+pages = {557-568},
+title = {Minor constituents in planetary atmospheres: {Ultraviolet} spectroscopy from the {Orbiting Astronomical Observatory}},
+volume = {16},
+year = {1972}
+}
+
+@article{Davi:79c,
+author = {Davies , Donald W.},
+journal = jgr,
+pages = {8289-8293},
+title = {Effect of dust on the heating of {Mars's} surface and atmosphere},
+volume = {84},
+year = {1979}
+}
+
+@article{Poll:85,
+author = {Pollack , James B. and McKay C. P.},
+journal = sci,
+pages = {245-262},
+title = {The impact of polar stratospheric clouds on the heating rates of the winter polar stratosphere},
+volume = {42},
+year = {1985}
+}
+
+@article{Poll:77,
+author = {Pollack , James B. and Colburn , David and Kahn , Ralph and Hunter , June and Warren , Van Camp and Carlston , C. E. and Wolf , M. R.},
+journal = jgr,
+pages = {4479-4496},
+title = {Properties of aerosols in the {Martian} atmosphere, as infered from \protect{Viking} lander imaging data},
+volume = {82},
+year = {1977}
+}
+
+@inproceedings{Seif:83,
+author = {Seiff , A.},
+booktitle = {Venus},
+crossref = {Hunt:83},
+pages = {215-279},
+title = {Thermal structure of the atmosphere of \protect{Venus}},
+year = {1983}
+}
+
+@article{Seif:77,
+author = {Seiff , Alvin and Kirk , Donn B.},
+journal = jgr,
+pages = {4364-4378},
+title = {Structure of the atmosphere of \protect{Mars} in summer mid-latitudes},
+volume = {82},
+year = {1977}
+}
+
+@inproceedings{Ekon:83,
+author = {Ekonomov , A. P. and Golovin , Yu. M. and Moroz , M. I. and Moshkin , B. Ye},
+booktitle = {Venus},
+crossref = {Hunt:83},
+pages = {632-649},
+title = {Solar scattered raiation measurements by \protect{Venus} probes},
+year = {1983}
+}
+
+@inproceedings{Schu:83,
+author = {Schubert , Gerald},
+booktitle = {Venus},
+crossref = {Hunt:83},
+pages = {681-765},
+title = {General ciruclation and the dynamical state of the \protect{Venus} atmosphere},
+year = {1983}
+}
+
+@inproceedings{Kerz:83,
+author = {Kerzhanovich , V. V. and Marov , M. Ya. Marov},
+booktitle = {Venus},
+crossref = {Hunt::83},
+pages = {766-778},
+title = {The atmospheric dyanmics of \protect{Venus} according to \protect{Doppler} measurements by the \protect{Venera} entry probes},
+year = {1983}
+}
+
+@inproceedings{Toma:83,
+author = {Tomasko , Martin G.},
+booktitle = {Venus},
+crossref = {Hunt:83},
+pages = {604-631},
+title = {The thermal balance of the lower atmosphere of \protect{Venus}},
+year = {1983}
+}
+
+@article{Cour:28,
+author = {Courant , R. and Friedrichs , K. O. and Lewy , H.},
+title = {On the Partial Difference Equations of Mathematical Physics},
+journal = {Math. Ann.},
+pages = {32},
+volume = {100},
+year = {1928}
+}
+
+@book{Oort:83,
+author = {Oort , Abraham H.},
+publisher = {NOAA},
+series = {NOAA profesional paper},
+title = {Global  Atmospheric Circulations Statics,  1958-1973},
+volume = {14},
+year = {1983}
+}
+
+@article{Huss:86,
+author = {Husson , N. and Ch\'edin , A. and Scott , N. A. and Bailly , D. and Graner , G. and Lacome , N. and Levy , A. and Rossetti , C. and Tarrago , G. and Camy-Peyret , C. and Flaud , J. M. etc.},
+journal = ang,
+pages = {185-190},
+title = {The \protect{GEISA} spectroscopic line parameters data bank in 1984},
+volume = {4},
+year = {1986},
+anotate = "  and Bauer , A. , and Colmont , J. M. and Monnanteuil , N. and Hilico , J. C. and Pierre , G. and Loete , M. and Champion , J. P. and Rothman , L. S. and Brown , L.R. and Orton , G. and Varanasi , P. and Rinsland , C. P. and Smith , M. A. H. and Goldman , A."
+}
+
+@article{Fouq:74,
+author = {Fouquart , Yves},
+journal = jqsrt,
+pages = {497-508},
+title = {Utilisation des approximants de Pad\'e pour l'\'etude des largeurs \'equivalentes des raies form\'ees en atmosph\`ere diffusante},
+volume = {14},
+year = {1974}
+}
+
+@article{Tala:88,
+author = {Talagrand , O.},
+journal = {La Recherche},
+pages = {1010-1021},
+title = {La dynamique des atmosph\`eres plan\'etaires},
+volume = {19},
+year = {1988}
+}
+
+@article{Tala:86,
+author = {Talagrand , O.},
+journal = {Bull. de la Soc. Fran\c{c}aise de Phys.},
+pages = {3-8},
+title = {La circulation des atmosph\`eres plan\'etaires},
+volume = {61},
+year = {1986}
+}
+
+@inproceedings{Tala:92,
+author = {Talagrand , O. and Hourdin , F. and Forget , F.},
+booktitle = {Atmospheres, Hydrospheres and Space Sciences},
+organization = {European Geophysical Scociety},
+pages = {Suppl:III,C--494},
+title = {Numerical simulation of the circulation of the \protect{Martian} atmosphere},
+volume = {10},
+year = {1992}
+}
+
+@inproceedings{Hour:92c,
+author = {Hourdin , F. and Talagrand , O. and Le Van , Phu and Courtin , R. and Gautier , D. and McKay , C. P.},
+booktitle = {Atmospheres, Hydrospheres and Space Sciences},
+organization = {European Geophysical Scociety},
+pages = {Suppl:III,C--496},
+title = {Study of atmospheric superrotation: Numerical simulations},
+volume = {10},
+year = {1992}
+}
+
+@article{Will:82,
+author = {Williams , Gareth P. and Holloway ,  J. Leith Jr},
+journal = {Nature},
+pages = {295-299},
+title = {The range and unity of planetary circulations},
+volume = {297},
+year = {1982}
+}
+
+@article{Inge:90,
+author = {Ingersoll , Andrew P.},
+journal = {Science},
+pages = {308-315},
+title = {Atmospheric dynamics of the outer planets},
+volume = {248},
+year = {1990}
+}
+
+@article{Inge:90triton,
+author = {Ingersoll, A. P.},
+journal = {Nature},
+pages = {315-316},
+title = {Dynamic of {Triton}'s atmosphere},
+volume = {344},
+year = {1990}
+}
+
+@article{Traf:84,
+author = {Trafton, L.},
+journal = {Icarus},
+pages = {312-324},
+title = {Large seasonal variations in {Triton's} atmosphere},
+volume = {58},
+year = {1984}
+}
+
+@article{Inge:85,
+author = {Ingersoll, A. P. and Summers, M. E. and Schlipf, S. G.},
+journal = {Icarus},
+pages = {375-390},
+title = {Supersonic meteorology of {Io} - sublimation - driven flow of {SO}$_2$},
+volume = {64},
+year = {1985}
+}
+
+@article{Inge:93,
+author = {Ingersoll,  A. P. and Lyons , J. R.},
+journal = jgr,
+pages = {10951-10961},
+title = {Mars dust storms: interranual variability and chaos},
+volume = {98},
+year = {1993}
+}
+
+@article{Traf:83,
+author = {Trafton, L. and Stern, S. A.},
+journal = {Astophysical Journal},
+pages = {872-881},
+title = {On the global distribution of {Pluto}'s atmosphere},
+volume = {267},
+year = {1983}
+}
+
+@article{Land:90,
+author = {Landberg , Lars and Tillman , James E. and Larsen , Soren E.},
+journal = {manuscript},
+title = {Turbulence spectra from the boundary layer of \protect{Mars}},
+year = {1990}
+}
+
+@incollection{Kasa:77,
+author = {Kasahara , Akira},
+booktitle = {Methods in computational physics},
+editor = {Julius Chang},
+journal = {Methods in Computational Physics},
+pages = {1-66},
+publisher = {Academic press, inc.},
+title = {Computational aspects of numerical models for weather prediction and climate simulation},
+volume = {17},
+year = {1977}
+}
+
+@techreport{LeVa:89,
+author = {Le Van , Phu},
+address = {24 rue Lhomond/75 231 Paris CEDEX 05},
+institution = {Laboratoire de M\'et\'eorologie Dynamique du CNRS},
+month = {Note interne},
+number = {147},
+title = {Description de directives pour l'utilisation de la nouvelle dynamique du \protect{Mod\`ele} de \protect{Circulation} \protect{G\'en\'erale}},
+year = {1989}
+}
+
+@phdthesis{Cass:89,
+author = {Cass\'e , Vincent},
+school = {Universit\'e Paris VI},
+title = {Elaboration d'un mod\`ele coupl\'e oc\'ean tropical--atmosph\`ere globale},
+type = {Th\`ese},
+year = {1989}
+}
+
+@article{Zure:93,
+author = {Zurek , Richard W. and Martin , Leonard J.},
+journal = jgr,
+number = {E2},
+pages = {3247-3259},
+title = {Interannual variability of planet-encircling dust storms on {Mars}},
+volume = {98},
+year = {1993}
+}
+
+@article{Lell:93,
+author = {Lellouch, E. and Goldstein, J. J. and Bougher , S. and Theodore, B. and Rosenqvist , J.},
+journal = baas,
+pages = {1060},
+title = {{Mars'} middle atmosphere circulation near equinox from microwave observations},
+volume = {25},
+year = {1993}
+}
+
+@article{Zure:82,
+author = {Zurek, R. W.},
+journal = {Icarus},
+pages = {288-310},
+title = {Martian great dust storm, an update},
+volume = {50},
+year = {1982}
+}
+
+@article{Paig:85,
+author = {Paige , D. A. and Ingersoll , A. P.},
+journal = {Science},
+pages = {1160-1168},
+title = {Annual heat balance of \protect{Martian} polar caps: \protect{Viking} observations},
+volume = {228},
+year = {1985}
+}
+
+@phdthesis{Holl:92,
+author = {Hollingsworth ,  J. L.},
+school = {Oreg. State Univ., Corvallis},
+title = {Modeling the forced planetary waves in the {Mars} atmosphere},
+year = {1992}
+}
+
+@phdthesis{Paig:85phd,
+author = {Paige , David A.},
+school = {Calif. Inst. of Technol., Pasadena},
+title = {{\em The annual heat balance of the {Martian} polar caps from {Viking} observations}},
+year = {1985}
+}
+
+@article{Paig:90,
+author = {Paige,  David A. and Crisp, David and Santee , M. L.},
+journal = baas,
+pages = {1075},
+title = {It  snows on {Mars}},
+volume = {22},
+year = {1990}
+}
+
+@misc{w
+}
+
+@article{Paig:92,
+author = {Paige , David A. and Wood , Stephen E.},
+journal = {Icarus},
+pages = {15-27},
+title = {Modeling the \protect{Martian} Seasonal {$CO_2$} Cycle: 2. Interannual variability},
+volume = {99},
+year = {1992}
+}
+
+@article{Poll:93,
+author = {Pollack , J. B. and Haberle , R. M. and Murphy , J. R. and Shaeffer , J. and Lee , H.},
+journal = jgr,
+pages = {3149-3181},
+title = {Simulation of the general circulation of the \protect{Martian} atmosphere \protect{2}, {Seasonnal} pressure variations},
+volume = {98},
+year = {1993}
+}
+
+@article{Paig:94s,
+author = {Paige , David A. and  Keegan , K. D.},
+journal = jgr,
+pages = {25993-26013},
+title = {Thermal and Albedo Mapping of the Polar Regions of {Mars}, 2, {South} Polar Region},
+volume = {99},
+year = {1994}
+}
+
+@article{Poll:93venus,
+author = {Pollack , J. B. and Dalton , J. B. and Grinspoon , D. and
+Wattson , D. R. B. and  Freedman , R. and Crisp , D.},
+journal = {Icarus},
+pages = {1-42},
+title = {Near-infrared light from
+{Venus} nightside: {A} spectroscopic analysis},
+volume = {103},
+year = {1993}
+}
+
+@article{Poll:95,
+author = {Pollack , J. B. and Ockert-Bell , M. E. and Shepard , M. K.},
+journal = jgr,
+pages = {5235-5250},
+title = {Viking {Lander} image analysis of {Martian} atmospheric dust},
+volume = {100},
+year = {1995}
+}
+
+@article{Habe:93,
+author = {Haberle , R. M. and Pollack , J. B. and Barnes , J. R. and Zurek , R. W. and Leovy , C. B. and Murphy , J. R. and Lee , H. and Schaeffer , J.},
+journal = jgr,
+number = {E2},
+pages = {3093-3124},
+title = {Mars Atmospheric Dynamics as Simulated by the \protect{NASA/Ames} General Circulation model, 1, The zonal-Mean Circulation},
+volume = {98},
+year = {1993}
+}
+
+@article{Habe:93pbl,
+author = {Haberle , R.M. and Houben , H. C. and Hertenstein, R. and Herdtle,,T.},
+journal = jas,
+month = {june},
+pages = {1544-1559},
+title = {A boundary layer model for {Mars}: {Comparison} with {Viking Lander} and entry data},
+volume = {50},
+year = {1993}
+}
+
+@phdthesis{Siil:94,
+author = {Siili , Tero},
+school = {Helsinki University of Technology},
+title = {Numerical studies of some surface-induced mesoscale phenomena in the {Martian} atmosphere},
+year = {1994}
+}
+
+@article{Hane:72,
+author = {Hanel, R. and Conrath, R. and Hovis, W. and Kunde, V. and Lowman, P. and Maguire, W. and
+Pearl, J. and  Pirraglia, J. and  Prabhakara, C. and  Schlachman, B. and Levin, G.},
+journal = {Icarus},
+pages = {423-442},
+title = {Investigation of the {Martian} environment by infrared spectroscopy on {Mariner} 9},
+volume = {17},
+year = {1972}
+}
+
+@article{Poll:82,
+author = {Pollack , James B.},
+journal = asr,
+pages = {43-56},
+title = {Properties and effects of \protect{Martian} atmospheric dust},
+volume = {2},
+year = {1982}
+}
+
+@article{Warr:90,
+author = {Warren , S. G. and Wiscombe , W. J. and Firestone , J. F.},
+journal = jgr,
+pages = {717-741},
+title = {Spectral albedo and emissivity of {CO}$_2$ in \protect{Martian} polar caps: model results},
+volume = {95},
+year = {1990}
+}
+
+@article{Wood:92,
+author = {Wood , S. E. and Paige , D. A.},
+journal = {Icarus},
+pages = {1-14},
+title = {Modeling the {Martian} seasonal  {CO$_2$} Cycle:  {Fitting} the \protect{Viking} lander pressure curves},
+volume = {99},
+year = {1992}
+}
+
+@article{Wood:84,
+author = {Woodward , P. R. and Colella , Phillip},
+journal = jcp,
+pages = {115-173},
+title = {The numerical simulation of Two-dimensional fluid flow with strong shocks},
+volume = {54},
+year = {1984}
+}
+
+@article{Wood:81,
+author = {Woodward , P. R. and Colella , P.},
+journal = lnp,
+pages = {434--441},
+title = {High resolution difference schemes for compressible gaz dynamics},
+volume = {141},
+year = {1981}
+}
+
+@article{Carp:90,
+author = {Carpenter , R. L. and Droegemeier , K. K. and Woodward , P. R. and Hane , C. E.},
+journal = mwr,
+pages = {586--612},
+title = {Application of the Piecewise Parabolic Method ({PPM}) to meteorological modeling},
+volume = {118},
+year = {1990}
+}
+
+@article{Leig:66,
+author = {Leighton , R. R. and Murray , B. C.},
+journal = sci,
+pages = {136-144},
+title = {Behavior of carbon dioxide and other volatiles on \protect{Mars}},
+volume = {153},
+year = {1966}
+}
+
+@article{Paig:94n,
+author = {Paige , D. A. and Bachman , J. E.  and Keegan , K. D.},
+journal = jgr,
+pages = {25959-25991},
+title = {Thermal and albedo mapping of the polar regions of {Mars} using {Viking} thermal mapper observations, 1, {North} polar region},
+volume = {99},
+year = {1994}
+}
+
+@techreport{Warr:86,
+author = {Warrilow , D. A. and Sangster , A. B. and Slingo , A.},
+address = {Meteorological Office, London Road, Bracknell, Berkshire RG12 2SZ},
+institution = {UKMO},
+number = {DCTN 38},
+title = {Modeling of land surface processes and their influence on \protect{European} climate},
+year = {1986}
+}
+
+@article{Warr:86co2,
+author = {Warren, S. G.},
+journal = {Appl. Opt.},
+pages = {2650-2674},
+title = {Optical constants of carbon dioxide ice},
+volume = {25},
+year = {1986}
+}
+
+@article{Barn:81,
+author = {Barnes , Jeffrey R.},
+journal = jas,
+number = {2},
+pages = {225-234},
+title = {Midlatitude disturbances in the \protect{Martian} atmosphere: A second \protect{Mars} year},
+volume = {38},
+year = {1981}
+}
+
+@misc{pola
+}
+
+@article{Barn:80,
+author = {Barnes , J. R.},
+journal = jas,
+pages = {2002-2015},
+title = {Time spectral analysis of the midlatitude disturbances in the \protect{Martian} atmosphere},
+volume = {37},
+year = {1980}
+}
+
+@article{Barn:87,
+author = {Barnes , Jeffey R. and Hollingsworth , Jeffrey L.},
+journal = {Icarus},
+pages = {313-334},
+title = {Dynamical modeling of a planetary wave mechanism for a \protect{Martian} polar warming},
+volume = {71},
+year = {1987}
+}
+
+@article{Poll:81,
+author = {Pollack , James B. and Leovy , Coneway B. and Greiman , Paul W. and Mintz , Yale},
+journal = jas,
+pages = {3-29},
+title = {A \protect{Martian} \protect{General} \protect{Circulation} \protect{Model} Experiment with Large Topography},
+volume = {38},
+year = {1981}
+}
+
+@inproceedings{Bill:92,
+author = {Billebaud , F. and Rosenqvist , J. and Maillard , J. P. and Lellouch , E. and Encrenaz , T. and Hourdin , F.},
+booktitle = {EGS},
+title = {Search for spatial variations in the \protect{CO} abundance on \protect{Mars} at $2.3\mu$m},
+year = {1998}
+}
+
+@inproceedings{Mart:91,
+author = {Martin , T. Z.},
+address = {Headington Hill Hall, Oxford OX2 0BW, England},
+booktitle = {The environmental model of \protect{Mars}},
+editor = {Szeg\"o K.},
+pages = {89-100},
+publisher = {Pergamon press plc},
+series = {COSPAR Colloquia series},
+title = {Thermal environnement of \protect{Mars}.},
+volume = {2},
+year = {1991}
+}
+
+@article{Mart:79,
+author = {Martin , Terry Z. and Peterfreund , Alan R. and Miner , Ellis D. and Kieffer , Hugh H. and Hunt , Garry E.},
+journal = jgr,
+pages = {2381-2842},
+title = {Thermal infrared properties of the \protect{Martian} atmosphere, 1, {Global} behavior at 7, 9, 11 and 20 \protect{$\mu$m}},
+volume = {84},
+year = {1979}
+}
+
+@article{Mart:79a,
+author = {Martin , Terry Z. and Kieffer , Hugh H.},
+journal = jgr,
+number = {B6},
+pages = {2843-2852},
+title = {Thermal infrared properties of the \protect{Martian} atmosphere, 2, The \protect{$15-\mu$m}  band measurements},
+volume = {84},
+year = {1979}
+}
+
+@article{Pete:79,
+author = {Peterfreund , Alan R. and Kieffer , Hugh H.},
+journal = jgr,
+number = {B6},
+pages = {2853-2863},
+title = {Thermal infrared properties of the \protect{Martian} atmosphere: 3. local dust clouds},
+volume = {84},
+year = {1979}
+}
+
+@article{Hunt:79a,
+author = {Hunt , Garry E.},
+journal = jgr,
+number = {B6},
+pages = {2865-2879},
+title = {Thermal IR properties of the \protect{Martian} atmosphere: 4. Predictions of the resence of Dust and ice clouds from \protect{Viking} \protect{IRTM} spectral measurements},
+volume = {84},
+year = {1979}
+}
+
+@article{Mart:86,
+author = {Martin , Terry Z.},
+journal = {Icarus},
+pages = {2-21},
+title = {Thermal infrared opacity of the \protect{Mars} atmosphere},
+volume = {66},
+year = {1986}
+}
+
+@techreport{Polc:91q,
+author = {Polcher , J. and Harzallah , A. and Bony , S.a and Chalita , S. N. and Cohen-Solal , E. and Forichon , M. and Hourdin , F. and LeTreut , H. and  Le Van , P. and Li , Z. X. and Rogel , P.},
+address = {ENS/24 rue Lhomond/75 005 Paris},
+institution = {LMD / CNRS},
+number = {170},
+title = {Le cycle 5 du \protect{Mod\`ele} de \protect{Circulation} \protect{G\'en\'erale} du \protect{LMD}},
+type = {Note interne},
+year = {1991}
+}
+
+@misc{pol,
+author = { }
+}
+
+@book{Chan:60,
+author = {Chandrasekhar , S.},
+address = {180 Varick Street,  New York},
+publisher = {Dover publications},
+title = {Radiative transfer},
+year = {1960}
+}
+
+@techreport{Polc:91a,
+author = {Polcher , Jan and Hourdin , Fr\'ed\'eric},
+institution = {LMD},
+number = {162},
+title = {Une gestion orient\'ee \protect{UNIX} du mod\`ele de circulation g\'en\'erale du \protect{LMD}},
+type = {note interne},
+year = {1991}
+}
+
+@techreport{Hour:91c,
+author = {Hourdin , Fr\'ed\'eric and Polcher , Jan and Li , Zhao  Xin},
+institution = {LMD},
+number = {161},
+title = {Vers une meilleur utilisation du logiciel \protect{UNIRAS}. Pr\'esentation de la biblioth\`eque commune de programmes graphiques lmdgraph et de la norme lmdstd d'\'ecriture des fichiers},
+type = {note interne},
+year = {1991}
+}
+
+@article{Hour:92,
+author = {Hourdin , Fr\'ed\'eric},
+journal = jgr,
+number = {E11},
+pages = {18,319-18,335},
+title = {A new representation of the \protect{CO$_2$ 15~$\mu$m} band for a \protect{Martian} General Circulation Model},
+volume = {97},
+year = {1992}
+}
+
+@article{Leov:82,
+author = {Leovy, C. B.},
+journal = {Adv. Space Res.},
+pages = {19-44},
+title = {Martian meteorological variability},
+volume = {2},
+year = {1982}
+}
+
+@article{Leov:85,
+author = {Leovy, Conway},
+journal = {Adv. Geophys},
+pages = {327-346},
+title = {The general circulation of {Mars} : {Model} and observations.},
+volume = {28a},
+year = {1985}
+}
+
+@article{Curt:52,
+author = {Curtis , A. R.},
+journal = qjr,
+pages = {638},
+title = {Contribution to a discussion of a statistical model for water vapor absorption', by \protect{R. M. Goody}},
+volume = {78},
+year = {1952}
+}
+
+@article{Mart:81,
+author = {Martin, T.  Z.},
+journal = {Icarus},
+pages = {427-446},
+title = {Mean thermal and albedo behavior of the {Mars} surface and atmosphere over a {Martian} year},
+volume = {45},
+year = {1981}
+}
+
+@article{Gods:53,
+author = {Godson , W. L.},
+journal = qjr,
+pages = {367},
+title = {The evaluation of infra-red radiative fluxes due to atmospheric vater vapor},
+volume = {79},
+year = {1953}
+}
+
+@article{Hour:93,
+author = {Hourdin , F. and Le Van , Phu and Forget , F. and Talagrand , O.},
+journal = jas,
+pages = {3625-3640},
+title = {Meteorological variability and the annual surface pressure cycle on \protect{Mars}},
+volume = {50},
+year = {1993}
+}
+
+@inproceedings{Forg:94lpi,
+author = {Forget , F. and Hourdin , F. and Talagrand , O.},
+booktitle = {{Mars Pathfinder Landing}},
+series = {LPI Technical Report},
+title = {Mars pathfinder meteorological observations on the basis of results of an atmospheric general circulation model},
+volume = {94-04},
+year = {1994}
+}
+
+@article{Forg:94egs,
+author = {Forget , F. and Pollack, J.B.},
+journal = {Annales Geophysicae},
+note = {Oral presentation at the 19th annual European Geophysical Society meeting},
+pages = {613},
+title = {Climatology and impact of the {Martian CO$_2$ and H$_2$O polar clouds from thermal infrared data}},
+volume = {12},
+year = {1994}
+}
+
+@article{Tala:94egs,
+author = {Talagrand , O. and Hourdin , F. and Forget , F.},
+journal = {Annales Geophysicae},
+note = {Oral presentation at the 19th annual European Geophysical
+Society meeting},
+pages = {613},
+title = {The {Viking} pressure measurements and the {LMD Martian
+atmospheric GCM}},
+volume = {12},
+year = {1994}
+}
+
+@article{Hour:94egs,
+author = {Hourdin , F and   Talagrand , O. and Courtin , R.  and  Gautier , D. and  McKay , C.P.},
+journal = {Annales Geophysicae},
+note = {Oral presentation at the 19th annual European Geophysical
+Society mee
+ting},
+pages = {613},
+title = {A strong atmospheric superrotation on {Titan}: numerical results},
+volume = {12},
+year = {1994}
+}
+
+@article{Hans:94,
+author = {Hansen , Garry B.},
+journal = baas,
+pages = {1114},
+title = {Low brightness temperatures of {Martian} polar deposits: {New} insight from recent measurement  of  {CO$_2$} ice.},
+volume = {26},
+year = {1994}
+}
+
+@article{Hans:90,
+author = {Hansen, C. A. and {McEwen}, A. S. and Ingersoll, A. P. and Terrile, R. J.},
+journal = {Science},
+pages = {421-424},
+title = {Surface and airborne evidence for plumes and winds on {Triton}},
+volume = {250},
+year = {1990}
+}
+
+@unpublished{Hour:94,
+author = {Hourdin, Fr\'ed\'eric and Talagrand, Olivier},
+note = {submitted to J.~Atmosph.~Sci.},
+title = {Superrotation of Planetary Atmospheres: a Numerical Study},
+year = {1994}
+}
+
+@article{Hour:95b,
+author = {Hourdin , Fr\'ed\'eric and Talagrand , Olivier and Sadourny , Robert and Courtin R\'egis and Gautier , Daniel and McKay , Christopher P.},
+journal = {Icarus},
+pages = {358-374},
+title = {General Circulation of the Atmosphere of {Titan}},
+volume = {117},
+year = {1995}
+}
+
+@article{Cour:94,
+author = {Courtier , P. and Thepaut , J.-N. and Hollingsworth , A.},
+journal = qjrms,
+pages = {1367-1387},
+title = {A strategy for implementation of 4D-Var, using an incremental approach},
+volume = {120},
+year = {1994}
+}
+
+@phdthesis{Forg:these,
+author = {Forget , Fran\c{c}ois},
+school = {Université Paris 6},
+title = {Le climat de la plan{è}te {Mars}~:  de l'importance des poussi{ères} et  des régions polaires},
+year = {1994}
+}
+
+@phdthesis{Murp:91,
+author = {Murphy , J. R.},
+address = {Seattle},
+school = {Univ. of Washington},
+title = {A dimensional hierarchy of numerical simulations of {Martian} global dust storms},
+year = {1991}
+}
+
+
+@article{Barn:93,
+author = {Barnes , J. R. and Pollack , J. B. and Haberle , R. M. and Zurek , R. W. and Leovy , C. B. and Lee , H and Schaeffer , J.},
+journal = jgr,
+number = {E2},
+pages = {3125-3148},
+title = {Mars atmospheric dynamics as simulated by the \protect{NASA/Ames} General Circulation Model, \protect{2}, {Transient} baroclinic eddies},
+volume = {98},
+year = {1993}
+}
+
+@article{Bert:69,
+author = {Bertie},
+journal = {J.~Chem.~Phys},
+pages = {4501},
+volume = {50},
+year = {1969}
+}
+
+@misc{Brig
+}
+
+@article{Leca:91,
+author = {Lecacheux , J. and Drossart , P. and Buil , C. and Laques , P. and Thouvenot , E. and Gu\'erin , P.},
+journal = pss,
+pages = {273-279},
+title = {\protect{CCD} images of \protect{Mars} with the $1m$ reflector atop \protect{Pic-du-Midi}},
+volume = {39},
+year = {1991}
+}
+
+@techreport{Hour:92e,
+author = {Hourdin , F.},
+institution = {Lab. de M\'et\'eorol Dyn., Cent. Nat. de la Rech.
+Sci., Paris},
+number = {175},
+title = {Conservation du moment angulaire dans le mod\`ele de circulation g\'en\'erale du \protect{LMD}},
+type = {Note Interne},
+year = {1992}
+}
+
+@article{Basd:78,
+author = {Basdevant , Claude and Lessieur , M. and Sadourny , R.},
+journal = jas,
+pages = {1028-1042},
+title = {Subgrid scale modeling of enstrophy transfer in two-dimensional turbulence},
+volume = {35},
+year = {1978}
+}
+
+@article{Hess:79,
+author = {Hess , Seymour L. and Henry , Robert H. and Tillman , James E.},
+journal = jgr,
+number = {B6},
+pages = {2923-2927},
+title = {The seasonal variation of atmospheric pressure on \protect{Mars} as affected by the south polar cap},
+volume = {84},
+year = {1979}
+}
+
+@article{Hess:79b,
+author = {Hess ,  Seymour L.},
+journal = jgr,
+pages = {2969-2973},
+title = {Static stability and thermal wind in an atmosphere of
+variable composition: {Application} to {Mars}},
+volume = {84},
+year = {1979}
+}
+
+@article{Hudg:93,
+author = {Hudgins , D. M. and  Sanford , S. A. and Allamandola , L. J. and Tielens , A. G. G. M.},
+journal = {J.~Astrophys.~Jour.~Suppl.~Ser.},
+pages = {713-870},
+title = {Mid and far-infrared spectroscopy of ices: {Optical} constants and
+integrated absorbances},
+volume = {86},
+year = {1993}
+}
+
+@article{Hunt:80,
+author = {Hunt, G. E.},
+journal = grl,
+pages = {481-484},
+title = {On the infrared radiative properties of {CO2} ice
+clouds: {Applications} to {Mars}.},
+volume = {7},
+year = {1980}
+}
+
+@article{Hess:80,
+author = {Hess , S. L. and Ryan , J. A. and Tillman , J. E. and Henry , R. M. and Leovy , C. B.},
+journal = grl,
+pages = {197-200},
+title = {The annual cycle of pressure on \protect{Mars} measured by \protect{Viking} landers 1 and 2},
+volume = {7},
+year = {1980}
+}
+
+@article{Jako:87,
+author = {Jakosky ,  Bruce M. and Martin , Terry Z.},
+journal = {Icarus},
+pages = {528-534},
+title = {Mars: {North}-polar atmospheric warming during dust storms},
+volume = {72},
+year = {1987}
+}
+
+@article{Hess:77,
+author = {Hess , S. L. and Henry , R. M. and Leovy , C. B. and Ryan , J. A. and Tillman , J. E.},
+journal = jgr,
+pages = {4559-4574},
+title = {Meteorological results from the surface of \protect{Mars}: \protect{Viking} 1 and 2},
+volume = {82},
+year = {1977}
+}
+
+@article{Jako:95,
+author = {Jakosky , B. M. and Henderson , B. G. and Mellon ,   M. T.},
+journal = jgr,
+pages = {1579-1584},
+title = {Chaotic obliquity and the nature of the {Martian} climate},
+volume = {100},
+year = {1995}
+}
+
+@article{Jako:95b,
+author = {Jakosky , B. M.},
+journal = {Icarus},
+pages = {352-357},
+title = {Out on a limb: {Martian} atmospheric dust opacity during the past hundred years},
+volume = {117},
+year = {1995}
+}
+
+@article{Habe:95,
+author = {Haberle , Robert M.},
+journal = {Nature},
+pages = {595-596},
+title = {Buried dry ice on Mars},
+volume = {374},
+year = {1995}
+}
+
+@article{Dros:91,
+author = {Drossart , P. and Rosenqvist , J. and Erard , S. and Langevin , Y. and Bibring , J. P. and Combes , M.},
+journal = ang,
+pages = {754-760},
+title = {Martian aerosol properties from the \protect{{\em Phobos}/ISM} experiment},
+volume = {9},
+year = {1991}
+}
+
+@article{Jaco:82,
+author = {Jacobsen , I. and Heise , E.},
+journal = bpa,
+pages = {128-141},
+title = {A new economical method for the computation of the surface temperature in numerical models.},
+volume = {55},
+year = {1982}
+}
+
+@article{Jame:79,
+author = {James , Philip B. and Briggs , Geoffrey and Barnes , Jeffrey and Spruck , Andrea},
+journal = jgr,
+number = {B6},
+pages = {2889-2922},
+title = {Seasonal recession of \protect{Mars'} south polar cap as seen by \protect{V}iking},
+volume = {84},
+year = {1979}
+}
+
+@article{Jame:79nor,
+author = {James, Philip B.},
+journal = jgr,
+pages = {8332-8334},
+title = {Recession of {Martian} north polar cap : 1977-1978 {Viking} Observations},
+volume = {84},
+year = {1979}
+}
+
+@article{Jame:82nor,
+author = {James, Philip B.},
+journal = {Icarus},
+pages = {565-569},
+title = {Recession of {Martian} north polar cap : 1979-1980 {Viking} Observations},
+volume = {52},
+year = {1982}
+}
+
+@article{Tied:89,
+author = {M. Tiedtke},
+journal = {Mon. Wea. Rev.},
+pages = {1179-1800},
+title = {A comprehensive mass flux scheme for cumulus parameterization in large-scale models},
+volume = {117},
+year = {1989}
+}
+
+@article{Till:88,
+author = {Tillman , James E.},
+journal = jgr,
+number = {D8},
+pages = {9433-9451},
+title = {Mars global atmospheric oscillations: Annually synchronized transient normal-mode oscillations and the triggering of global dust storms},
+volume = {93},
+year = {1988}
+}
+
+@article{Till:93,
+author = {Tillman  , James E. and Johnson , Neal C. and Guttorp , Peter and Percival , Donald B.},
+journal = jgr,
+number = {E6},
+pages = {10,963-10,971},
+title = {The \protect{Martian} annual atmospheric pressure cycle: years without great dust storms},
+volume = {98},
+year = {1993}
+}
+
+@article{Till:79,
+author = {Tillman , James E. and Henry , Robert M. and Hess , Seymour L.},
+journal = jgr,
+number = {B6},
+pages = {2947-2955},
+title = {Frontal systems during passage of the \protect{Martian} north polar hood over the \protect{Viking} lander 2 site prior to the first 1977 dust storm},
+volume = {84},
+year = {1979}
+}
+
+@article{Leov:79a,
+author = {Leovy , Conway B. and Zurek , Richard W.},
+journal = jgr,
+number = {B6},
+pages = {2956-2968},
+title = {Thermal tides and \protect{Martian} dust storms: direct evidence for coupling},
+volume = {84},
+year = {1979}
+}
+
+@article{Leov:73,
+author = {Leovy , C. B. and Briggs , G. A. and Smith , B. A.},
+journal = jgr,
+pages = {4252-4266},
+title = {Mars atmosphere during the \protect{Mariner} 9 extended mission: Television results},
+volume = {78},
+year = {1973}
+}
+
+@article{Leov:73a,
+author = {Leovy , C. B. and Pollack , J. B.},
+journal = {Icarus},
+pages = {195-201},
+title = {A first look at atmospheric dynamics and temperature variations on {Titan}},
+volume = {19},
+year = {1973}
+}
+
+@article{Kahn:82,
+author = {Kahn , R. and Gierasch , P.},
+journal = jgr,
+pages = {867-880},
+title = {Long clouds observations on \protect{Mars} and implications for boundary layer characteristics over slopes},
+volume = {87},
+year = {1982}
+}
+
+@article{Ryan:85,
+author = {Ryan , J,. A.},
+journal = jgr,
+number = {A7},
+pages = {6319-6325},
+title = {Mars atmospheric circulation: aspects from \protect{V}iking \protect{L}anders},
+volume = {90},
+year = {1985}
+}
+
+@article{Jako:79,
+author = {Jakosky , Bruce M.},
+journal = jgr,
+number = {B14},
+pages = {8252-8282},
+title = {The effect of nonideal surfaces on the derived thermal properties of \protect{M}ars},
+volume = {84},
+year = {1979}
+}
+
+@article{Jako:82,
+author = {Jakosky , B. M. and Farmer , C. B.},
+journal = jgr,
+number = {B4},
+pages = {2999-3019},
+title = {The seasonal and global behavior of Water Vapor in the \protect{Mars} atmosphere: complete global results of the \protect{Viking} atmospheric vater detector experiment},
+volume = {87},
+year = {1982}
+}
+
+@article{Habe:82,
+author = {Haberle , Robert M. and Leovy , Conway B. and Pollack , J. B.},
+journal = {Icarus},
+pages = {322-367},
+title = {Some effects of global dust storms on the atmospheric circulation of \protect{M}ars},
+volume = {50},
+year = {1982}
+}
+
+@phdthesis{Jous:89,
+author = {Joussaume , Sylvie},
+address = {Paris},
+school = {Universit\'e Pierre et Marie Curie},
+title = {Simulations du climat du dernier max. glaciaire \`a l'aide d'un \protect{MCG} de l'atm. incluant  une mod\'el. du cycle des isotopes de l'eau et des poussi\`eres d'orig. desert.},
+type = {Th\`ese de \protect{D}octorat d'\protect{E}tat \`es \protect{S}ciences \protect{P}hysiques},
+year = {1984}
+}
+
+@article{Youn:77,
+author = {Young , R. E. and Pollack , J. B.},
+journal = jas,
+pages = {1315-1351},
+title = {A three-dimensional model of dynamical processes in the {Venus} atmosphere},
+volume = {34},
+year = {1990}
+}
+
+@article{West:88,
+author = {Westphal , Douglas L. and Toon , Owen B. and Carlson
+, Toby N.},
+journal = jas,
+pages = {2145-2175},
+title = {A case of mobilization and transport of \protect{S}aharan dust},
+volume = {45},
+year = {1988}
+}
+
+@article{Murp:90,
+author = {Murphy , James R. and Haberle , Robert M. and Pollack , James B.},
+journal = jgr,
+number = {B9},
+pages = {14,629-14,647},
+title = {Numerical simulations of the decay of \protect{M}artian dust storms},
+volume = {95},
+year = {1990}
+}
+
+@article{Murp:93,
+author = {Murphy, J.R. and Haberle , R. M. and Toon, O.B.  and  Pollack, J.B.},
+journal = jgr,
+pages = {3197-3220},
+title = {Martian global dust storms: zonally symetric numerical simulations including size dependent  particle transport.},
+volume = {98},
+year = {1993}
+}
+
+@article{Toon:89,
+author = {Toon , O. B. and McKay , C. P. and Ackerman , T. P. and Santhanam , K.},
+journal = jgr,
+pages = {16,287-16,301},
+title = {Rapid calculation of radiative heating rates and photodissociation rates in inhomogeneous multiple scattering atmospheres},
+volume = {94},
+year = {1989}
+}
+
+@article{Toon:77,
+author = {Toon, O. B. and Pollack , J. B. and Sagan , C.},
+journal = {Icarus},
+pages = {663-696},
+title = {Physical properties of the particles composing the  {Martian} dust storm of 1971-1972},
+volume = {30},
+year = {1977}
+}
+
+@article{Wisc:80,
+author = {Wiscombe , W. J. and Warren, S. G.},
+journal = jas,
+pages = {2712-2733},
+title = {A model for the spectral albedo of snow, {I}, {Pure snow}},
+volume = {37},
+year = {1980}
+}
+
+@article{McKa:91,
+author = {McKay , Chris P. and Pollack , James B. and Courtin , R\'egis},
+journal = sci,
+pages = {1118-1121},
+title = {The greenhouse and anti-greenhouse effects on \protect{T}itan},
+volume = {253},
+year = {1991}
+}
+
+@article{Toon:91,
+author = {Toon , O. B. and McKay , C. P. and Griffith , C. A. and Turco , R. P.},
+journal = {Icarus},
+note = {submitted},
+title = {Titan's arerosols},
+year = {1991}
+}
+
+@article{Goli:70,
+author = {Golitsyn , G. S.},
+journal = {Icarus},
+pages = {1-24},
+title = {A similarity Approach to the General Circulation of planetary atmospheres},
+volume = {13},
+year = {1970}
+}
+
+@article{Goli:84,
+author = {Golitsyn , G. S.},
+journal = {Icarus},
+pages = {289-306},
+title = {Some problems of \protect{Venus'} atmospheric dynamics},
+volume = {60},
+year = {1984}
+}
+
+@article{Goli:77,
+author = {Golitsyn , G. S.},
+journal = iaop,
+pages = {780-791},
+title = {Similarity theory in \protect{Soviet} works on geophysical dynamics},
+volume = {13},
+year = {1977}
+}
+
+@article{Goli:75,
+author = {Golitsyn , G. S.},
+journal = {Icarus},
+pages = {70-75},
+title = {Another look at atmospheric dynamics on {Titan} and some of its general consequences},
+volume = {24},
+year = {1975}
+}
+
+@article{Hour:90dps,
+author = {Hourdin , Fr\'ed\'eric and Le~Van , P. and Talagrand , O. and Courtin , R. and Gautier , D. and McKay , C. P.},
+journal = {BAAS},
+note = {Oral presentation at the 22nd annual DPS meeting
+(Charlottesville, Virginia)},
+pages = {1086},
+title = {The Circulation of the Atmosphere of \protect{Titan} : Development of a General Circulation Model},
+volume = {22},
+year = {1990}
+}
+
+@article{Hour:91dps,
+author = {Hourdin , Fr\'ed\'eric and Le~Van , P. and Talagrand , O. and Courtin , R. and Gautier , D. and McKay , C. P.},
+journal = {BAAS},
+note = {Oral presentation at the 23rd annual DPS meeting (Palo Alto, California)},
+pages = {1187},
+title = {Numerical simulation of the circulation of \protect{T}itan's atmosphere: Study of a possible \protect{V}enus-like superrotation},
+volume = {23},
+year = {1991}
+}
+
+@article{Hour:92dps,
+author = {Hourdin , F. and Talagrand , O.},
+journal = {BAAS},
+note = {Oral presentation at the 24th annual DPS meeting (M\"unich, Germany)},
+pages = {1004},
+title = {Study of atmospheric superrotation: Numerical simulations},
+volume = {24},
+year = {1992}
+}
+
+@article{Hour:94cospar,
+author = {Hourdin , Fr\'ed\'eric and Talagrand , O.},
+journal = {Cospar 94 proceeding},
+note = {Invited presentation at the 30th {COSPAR} Scientific Assembly, Hamburg, Germany},
+pages = {133},
+title = {The {Martian} General Circulation},
+volume = {26},
+year = {1994}
+}
+
+@article{Hour:94dps,
+author = {Hourdin , F. and Talagrand , O.  and Courtin , R. and Gautier , D. and McKay , C. P.},
+journal = {BAAS},
+note = {Oral presentation at the 26th annual DPS meeting (Washington)},
+pages = {1184},
+title = {The Gerneral Circulation of the Atmosphere of {Titan}},
+volume = {26},
+year = {1994}
+}
+
+@article{Tala:94dps,
+author = {Talagrand , Olivier and Forget , Fran\c{c}ois and Hourdin , Fr\'ed\'eric},
+journal = {BAAS},
+note = {Oral presentation at the 26th annual DPS meeting (Washington)},
+pages = {1125},
+title = {Martian seasonal transient pressure variations : {GCM}
+simulations and {Viking} observations},
+volume = {26},
+year = {1994}
+}
+
+@article{Forg:94dps,
+author = {Forget , Fran\c{c}ois and Hourdin , Fr\'ed\'eric and Talagrand , Olivier  and Pollack , James B.},
+journal = {BAAS},
+note = {Oral presentation at the 26th annual DPS meeting (Washington)},
+pages = {1125},
+title = {Observations and simulation of the {Martian} Polar Climate : Impact of the {CO$_2$} Clouds},
+volume = {26},
+year = {1994}
+}
+
+@article{Forg:98,
+author = {Forget, F. and Hourdin, F. and Talagrand, O.},
+journal = {Icarus},
+pages = {302-316},
+title = {{CO$_2$} snow fall on {Mars}: Simulation with a general circulation model},
+volume = {131},
+year = {1998}
+}
+
+@article{Hour:93dps,
+author = {Hourdin , Fr\'ed\'eric and Le~Van , P. and Talagrand , O.  and Courtin , R. and Gautier , D. and McKay , C. P.},
+journal = {BAAS},
+note = {Oral presentation at the 25th annual DPS meeting (Boulder)},
+pages = {1105},
+title = {Superrotation: the case of {Titan}},
+volume = {25},
+year = {1993}
+}
+
+@article{Hour:95,
+author = {Hourdin , F. and Forget , F. and Talagrand , O.},
+journal = jgr,
+pages = {5501-5523},
+title = {The sensitivity of the {Martian} surface pressure to various parameters: {A} comparison between numerical simulations and {Viking} observations},
+volume = {100},
+year = {1995}
+}
+
+@article{Duqu:91,
+author = {Duquennoy, A. and Mayor, M.},
+journal = {Astron. Astrophys.},
+pages = {485-524},
+title = {Multiplicity among solar-type stars in the solar neighborhood. {II. Distribution of the orbital elements in an unbiased sample.}},
+volume = {248},
+year = {1991}
+}
+
+@article{Whit:97,
+author = {Whitmire, D. and Matese, J. and Criswell, L. and Mikkola, S.},
+journal = {Icarus},
+pages = {196},
+title = {Habitable planet formation in binary star systems},
+volume = {132},
+year = {1997}
+}
+
+@article{Weth:96,
+author = {Wetherill, G. W.},
+journal = {Icarus},
+pages = {219-238},
+title = {The formation and habitability of extra-solar planets},
+volume = {119},
+year = {1996}
+}
+
+@misc{Forg:95esa,
+author = {Forget , F. and Hansen , G.B. and Pollack , J.B.},
+howpublished = {Oral presentation at the International Workshop on Intermarsnet, Capri, Italy.},
+title = {Condensation of the {Martian CO$_2$} polar caps},
+year = {1995}
+}
+
+@article{Habe:96,
+author = {Haberle, R. M. and Catling, D. C.},
+journal = pss,
+pages = {1361-1383},
+title = {A micro-meteorological mission for global network science on {Mars}: rationale and measurement requirements},
+volume = {44},
+year = {1996}
+}
+
+@article{Lewi:96,
+author = {Lewis, S. R. and Read, P. L. and Collins , M.},
+journal = pss,
+pages = {1395-1409},
+title = {Martian atmospheric data assimilation with a simplified general circulation model: orbiter and Lander networks},
+volume = {44},
+year = {1996}
+}
+
+@article{Jako:96dps,
+author = {Jakosky, B. M.  and  Zent, A. P. and Zurek, R.W.},
+journal = baas,
+pages = {1064},
+title = {The {Mars} water cycle: determining the role of regolith-atmosphere exchange},
+volume = {28},
+year = {1996}
+}
+
+@misc{Maro:95,
+author = {Marov, M.  and Walberg, G. and Jits, R.},
+howpublished = {Mars mission Research Center, NCSU},
+title = {Microlander network for meteorological {Mars} monitoring},
+year = {1996}
+}
+
+@article{Merr:96,
+author = {Merrihew, S. C.  and Haberle, R. M. and Lemke, L. G.},
+journal = pss,
+pages = {1385-1393},
+title = {A micro-meteorological mission for global network science on {Mars}: a conceptual design},
+year = {1996}
+}
+
+@article{IMEW:94,
+author = {The  {International Mars Exploration Working Group}},
+howpublished = pss,
+journal = pss,
+pages = {581-595},
+title = {International strategy for the exploration of {Mars}},
+volume = {43},
+year = {1994}
+}
+
+@article{Tala:93dps,
+author = {Talagrand , O. and Hourdin , F. and Forget , F.},
+journal = {BAAS},
+note = {Oral presentation at the 25th annual DPS meeting (Boulder)},
+pages = {1071},
+title = {Numerical simulation of the General Circulation of the
+{Martian} Atmosphere and the Viking Pressure Data},
+volume = {25},
+year = {1993}
+}
+
+@misc{}
+}
+
+@article{Tala:90dps,
+author = {Talagrand , Olivier and Hourdin , Fr\'ed\'eric},
+journal = {BAAS},
+note = {Oral presentation at the 22nd annual DPS meeting
+(Charlottesville, Virginia)},
+pages = {1074},
+title = {A general Circulation Model of the {Martian} Atmosphere},
+volume = {22},
+year = {1990}
+}
+
+@article{Tala:91dps,
+author = {Talagrand , O. and Hourdin , F. and Forget , F.},
+journal = baas,
+note = {Oral presentation at the 23rd annual DPS meeting (Palo Alto, California)},
+pages = {1217},
+title = {The \protect{LMD} \protect{M}artian General Circulation Model: Results about the Annual Pressure Cycle},
+volume = {23},
+year = {1991}
+}
+
+@article{Tala:92dps,
+author = {Talagrand , O. and Hourdin , F. and Forget , F.},
+journal = {BAAS},
+note = {Oral presentation at the 24th annual DPS meeting (M\"unich, Germany)},
+pages = {922},
+title = {Study of atmospheric superrotation: Numerical simulations},
+volume = {24},
+year = {1992}
+}
+
+@inproceedings{Tala:93assim,
+author = {Talagrand , Olivier},
+address = {Berlin},
+booktitle = {Energy and Weather Cycles in the Climate System},
+editor = {A. Raschke and D. Jacob},
+organization = {NATO Advanced Study Institute},
+pages = {187-213},
+publisher = {Springer-Verlag},
+series = {NATO ASI Series},
+title = {Data Assimilations Problems},
+year = {1993}
+}
+
+@article{Rabi:92,
+author = {Rabier , F. and Courtier , P. and Talagrand , O.},
+journal = bpa,
+pages = {177-192},
+title = {An application of adjoint models to sensitivity analysis},
+volume = {65},
+year = {1992}
+}
+
+@inproceedings{Tala:91assim,
+author = {Talagrand , Olivier},
+address = {Philadelphie},
+booktitle = {Automatic differentitation of algorithms: Theory, implementation, and application},
+editor = {A. Griewank and G. F. Corliss},
+pages = {169-180},
+publisher = {Society for Industrial and Applied Mathematics},
+title = {The use of adjoint equations in numerical modeling of the atmospheric circulation},
+year = {1991}
+}
+
+@phdthesis{Tour:84,
+author = {Tourte , Jean-Louis},
+address = {Paris},
+school = {Universit\'e \protect{P}ierre et \protect{M}arie \protect{C}urie},
+title = {Mod\'elisation num\'erique de la circulation de l'atmosph\`ere de \protect{V}\'enus},
+type = {Th\`ese de docteur -ing\'enieur},
+year = {1984}
+}
+
+@inproceedings{Tanr:84,
+author = {Tanr\'e , D. and Geylen , J.-F. and Slingo , J.},
+address = {Hampton},
+booktitle = {Aerosols and their climatic effects},
+editor = {H..E. Gerber and A. Deepack},
+pages = {133-177},
+publisher = {A. Deepack Publishing},
+title = {First results of the introduction of aerosol-radiation interaction in the \protect{ECMWF} low resolution global model},
+year = {1984}
+}
+
+@article{Del:87,
+author = {Del Genio , Anthony and Suozzo , Robert J.},
+journal = jas,
+pages = {973-986},
+title = {A comparative study of rapidly rotating dynamical regimes in a terrestrial general circulation model},
+volume = {44},
+year = {1987}
+}
+
+@article{Del:83,
+author = {Del Genio , A. D. and Meccage , J. K. and Suozzo , R. and Opstbaum , R. and Rind , D. and Rossow , W. B. and Russell , G. and Travis , L. D.},
+journal = baas,
+pages = {821},
+title = {Variable rotation rate experiments with the \protect{GISS}   General Circulation Model},
+volume = {15},
+year = {1983}
+}
+
+@book{Elsa:42,
+author = {Elsasser , W. M.},
+address = {Cambridge, Mass.},
+pages = {43},
+publisher = {Harvard University Press},
+series = {Harvard Meteorol. Stud.},
+title = {Heat Transfer by Infrared Radiation in the Atmosphere},
+volume = {6},
+year = {1942}
+}
+
+@book{Good:64,
+author = {Goody , R. M.},
+address = {New York},
+publisher = {Oxford University Press},
+title = {Atmospheric Radiation, \protect{vol. I}, Theoretical Basis},
+year = {1964}
+}
+
+@article{Fouq:80,
+author = {Fouquart , Y and Bonnel , B.},
+journal = bpa,
+pages = {35-62},
+title = {Computations of solar heating of the \protect{E}arth's atmosphere: A new parametrization},
+volume = {53},
+year = {1980}
+}
+
+@book{Abra:65,
+address = {New York},
+editor = {Abramowitz , M. and Stegun , I. A.},
+publisher = {Dover},
+title = {Handbook of Mathematical Functions},
+year = {1965}
+}
+
+@article{Gier:67,
+author = {Gierasch , Peter and Goody , Richard},
+journal = pss,
+pages = {1465-1477},
+title = {An approximate calculation of radiative heating and radiative equilibrium in the {Martian} atmosphere},
+volume = {15},
+year = {1967}
+}
+
+@article{Kuhn:79,
+author = {Kuhn ,  W. R. and Atreya , S. K. and Postawko , S. E.},
+journal = jgr,
+number = {B14},
+pages = {8341-8342},
+title = {The influence of ozone on \protect{M}artian atmospheric temperature},
+volume = {84},
+year = {1979}
+}
+
+@phdthesis{Lind:85,
+author = {Lindner , Leo Bernhard},
+school = {Fac. of the Grad. Sch. of the Univ. of Colo., Boulder},
+title = {The aeronomy and radiative transfer of the \protect{M}artian atmosphere},
+year = {1985}
+}
+
+@article{Lind:90,
+author = {Lindner , B. L.},
+journal = jgr,
+pages = {1367-1379},
+title = {The {Martian} polar cap: {Radiative} effects of ozone, clouds, and airborne dust},
+volume = {95},
+year = {1990}
+}
+
+@book{Lind:90book,
+author = {Lindzen , R. S.},
+publisher = {Cmabridge University Press},
+title = {Dynamics in atmospheric physicsq},
+year = {1990}
+}
+
+@book{Jame:94book,
+author = {James, I. N.},
+publisher = {Cambridge University Press},
+title = {Introduction to circulating atmospheres},
+year = {1994}
+}
+
+@article{Lind:93,
+author = {Lindner , B. L.},
+journal = jgr,
+pages = {3339-3344},
+title = {The hemispherical asymmetry in the {Martian} polar caps.},
+volume = {98},
+year = {1993}
+}
+
+@article{Lind:83,
+author = {Lindal , G. F. and Wood , G. E. and Hotz , H. B. and Sweetnam , D. N. and Eshleman , V. R. and Tyler , G. L.},
+journal = {Icarus},
+pages = {348--363},
+title = {The atmosphere of {Titan}: an analysis of the {Voyager~1} radio occultation measurements},
+volume = {53},
+year = {1983}
+}
+
+@article{Lind:79a,
+author = {Lindal , G. F. and Hotz , H. B. and Sweetnam , D. N. and Shippony , Z. and Brenkle , J. P. and Hartsell , G. V. and Spear , R. T. and Micheal , W. H.},
+journal = jgr,
+pages = {8443-8456},
+title = {Viking radio occultation measurements of the atmosphere and topography on \protect{M}ars},
+volume = {84},
+year = {1979}
+}
+
+@book{Liou:80,
+author = {Liou , Kuo-Nan},
+address = {San Diego, Calif.},
+editor = {Academic press},
+publisher = {Academic},
+title = {An Introduction to Atmospheric Radiation},
+year = {1980}
+}
+
+@phdthesis{Li:90,
+author = {Li , Zhao Xin},
+school = {Universit\'e Paris 7},
+title = {Etude de l'int\'eratcion nuage-rayonnement dans le contexte deu changement climatique d\^u \`a l'augmentation dez gaz \`a effet de serre dans l'atmosph\`ere},
+type = {Th\`ese},
+year = {1990}
+}
+
+@article{Leov:69,
+author = {Leovy , Conway and Mintz , Yale},
+journal = jas,
+pages = {1167-1190},
+title = {Numerical simulation of the atmospheric circulation and climate of \protect{M}ars},
+volume = {26},
+year = {1969}
+}
+
+@article{Leov:79,
+author = {Leovy , Conway B.},
+journal = araa,
+pages = {387-413},
+title = {Martian meteorology},
+volume = {17},
+year = {1979}
+}
+
+@article{Poll:79,
+author = {Pollack , James B. and Colburn , David S. and Flasar , F. Michael and Kahn , Ralph and Carlston , C. E. and Pidek , D.},
+journal = jgr,
+number = {B6},
+pages = {2929-2945},
+title = {Properties and effects of dust particles suspended in the \protect{M}artian atmosphere},
+volume = {84},
+year = {1979}
+}
+
+@inproceedings{Mart:92,
+author = {Martin , L. J. and James, P. B. and Dollfus , A. and Iwasaki, K. and Beish , J. D.},
+booktitle = {Mars},
+journal = {Icarus},
+publisher = {University of Arizona Press, Tucson},
+title = {Telescopic observations: visual, photographic, polarimetric},
+year = {1992}
+}
+
+@article{Clan:93lpi,
+author = {Clancy  , R. T. and Lee , S. W. and Gladstone , G. R.},
+institution = {LPI},
+number = {93-05},
+title = {Particle sizes and composition of {Mars} atmospheric dust based upon {Viking}  and {Mariner 9} observations.},
+year = {1993}
+}
+
+@article{Clan:93,
+author = {Clancy,  T.  and Grossman , A.  and Muhleman , D.},
+journal = baas,
+pages = {1060},
+title = {A cold , dry, cloudy, dust-free {Mars} atmosphere in the 1990's},
+volume = {25},
+year = {1993}
+}
+
+@article{Clan:94,
+author = {Clancy, R. T. and Lellouch , E. and Billawala , Y. N. and Sandor , B. J. and Rudy, D. J.},
+journal = baas,
+pages = {1130},
+title = {Microwave observations of a 1994 {Mars} global dust storm},
+volume = {26},
+year = {1994}
+}
+
+@article{Clan:95,
+author = {Clancy, R. T. and Lee , S. W.  and Gladstone , G. R. and McMillan , W. W.  and Rousch , T.},
+journal = jgr,
+pages = {5251-5263},
+title = {A new model for {Mars} atmospheric dust based upon analysis of ultraviolet through infrared observations from  {Mariner 9, Viking, and Phobos}},
+volume = {100},
+year = {1995}
+}
+
+@article{Clan:91,
+author = {Clancy , R. T. and Lee , S. W.},
+journal = {Icarus},
+pages = {135-158},
+title = {A new look at dust and clouds in the {Mars} atmosphere: {Analysis} of emission-phase function sequences from global {Viking IRTM} observations},
+volume = {93},
+year = {1991}
+}
+
+@article{Chas:95,
+author = {Chassefiere, E. and Drossart , P. and Korablev , O.},
+journal = jgr,
+pages = {5525-5539},
+title = {Post-{Phobos} model for the altitude and size distribution of dust in the low {Martian} atmosphere},
+volume = {100},
+year = {1995}
+}
+
+@article{Chas:92,
+author = {Chassefiere, E. and Blamont , J. E.  and Krasnopolsky , V. A.  and Korablev , O. I. and Atreya , S. K.  and West , R. A.},
+journal = {Icarus},
+pages = {46-69},
+title = {Vertical structure and size distributions of {Martian} aerosols from solar occultation measurements},
+volume = {97},
+year = {1992}
+}
+
+@article{Chas:91,
+author = {Chassefi\`{e}re, E.},
+journal = grl,
+pages = {1055-1058},
+title = {Photochemical regulation of {CO on Mars}},
+volume = {18},
+year = {1991}
+}
+
+@article{Chas:92b,
+author = {Chassefi\`ere , E. and Blamont , J. E.},
+journal = grl,
+pages = {945},
+title = {Vertical transport of water ice at low latitudes in the {Martian} atmosphere},
+volume = {19},
+year = {1992}
+}
+
+@article{Zent:95,
+author = {Zent , A. P.  and Quinn , R. C.},
+journal = jgr,
+pages = {5341-5349},
+title = {Simultaneous adsorption of {CO$_{2}$ and H$_{2}$O under  Mars}-like conditions and application to the evolution of the {Martian} climate.},
+volume = {100},
+year = {1995}
+}
+
+@article{Houb:94,
+author = {Houben , H. and Haberle , R. M. and Young , R.E. and Zent , A.},
+journal = baas,
+pages = {1112},
+title = {The regolith-dominated {Martian} water cycle.},
+volume = {26},
+year = {1994}
+}
+
+@article{Kora:93,
+author = {Korablev , O. I. and Krasnopolsky , V. A. and Rodin , A. V.  and Chassefiere , E.},
+journal = {Icarus},
+pages = {76-87},
+title = {Vertical structure of the {Martian} dust measured by the solar infrared occultations from the {Phobos} spacecraft.},
+volume = {102},
+year = {1993}
+}
+
+@article{Colb:89,
+author = {Colburn , D. S.  and Pollack , J. B.  and  Haberle , R. M.},
+journal = {Icarus},
+pages = {159-189},
+title = {Diurnal variations in optical depth at {Mars}},
+volume = {79},
+year = {1989}
+}
+
+@article{Poll:90,
+author = {Pollack , James B. and Haberle , Robert M. and Schaeffer , J. and Lee , H.},
+journal = jgr,
+pages = {1447-1473},
+title = {Simulations of the general circulation of the \protect{M}artian atmosphere, \protect{1}, \protect{Polar} processes},
+volume = {95},
+year = {1990}
+}
+
+@article{Poll:90triton,
+author = {Pollack, J.B. and Schwartz, J. M. and Rages, K.},
+journal = {Science},
+number = {25},
+pages = {440-443},
+title = {Scatterers in {Triton's} atmosphere : implications for the seasonal volatile cycle.},
+year = {1990}
+}
+
+@techreport{Ched:84,
+author = {Chedin , A. and Husson , N. and Scott , N. A. and Cohen-Hallaleh , I. and Berroir , A.},
+address = {Ecole Polytech., Palaiseau, France},
+institution = {Laboratoire de M\'et\'eorologie Dynamique du CNRS},
+number = {127},
+title = {The \protect{"GEISA"} data bank 1984 version},
+year = {1984}
+}
+
+@article{Hunt:73,
+author = {Hunt , B. G.},
+journal = {Tellus},
+pages = {337-354},
+title = {Zonally symmetric global general circulation models with and without hydrologic cycle},
+volume = {XXV},
+year = {1973}
+}
+
+@article{Mayr:91,
+author = {Mayr , H. G.  and Chan , K. L. and Harris , I. and Schatten , K.},
+journal = apj,
+pages = {361-366},
+title = {What maintains the zonal circulation in planetary atmospheres?},
+volume = {367},
+year = {1991}
+}
+
+@article{Savi:91,
+author = {Savij\"arvi , H.},
+journal = bpa,
+pages = {103-112},
+title = {Radiative Fluxes on a dust free \protect{M}ars},
+volume = {2},
+year = {1991}
+}
+
+@article{Savi:91pbl,
+author = {Savij{\"a}rvi , Hannu},
+journal = mwr,
+pages = {833-840},
+title = {The {United} {States|} Great plains diurnal {ABL} variation and the nocturnal low-level jet},
+volume = {119},
+year = {1991}
+}
+
+@article{Savi:93,
+author = {Savij\"arvi , H. and Siili , T.},
+journal = jas,
+pages = {77-88},
+title = {The \protect{M}artian slope wind and the nocturnal \protect{PBL} jet},
+volume = {50},
+year = {1993}
+}
+
+@article{Savi:XXa,
+author = {Savij\"arvi , Hannu},
+journal = {not published},
+title = {A model study of the \protect{PBL} structure on Mars and Earth},
+year = {19XX}
+}
+
+@article{Savi:95,
+author = {Savij{\"a}rvi , Hannu},
+journal = {Icarus},
+pages = {120-127},
+title = {Mars boundary layer modeling : diurnal moisture cycle and soil properties at the {Viking} Lander~1 site},
+volume = {117},
+year = {1995}
+}
+
+@article{Seif:82,
+author = {Seiff , A.},
+journal = asr,
+pages = {3-17},
+title = {Post-\protect{V}iking models for the stucture of the summer atmosphere of \protect{M}ars},
+volume = {2},
+year = {1982}
+}
+
+@article{Seif:76,
+author = {Seiff , Alvin and Kirk , Donn B.},
+journal = {Science},
+pages = {1300-1303},
+title = {Structure of the \protect{Mars'} atmosphere up to 100 kilometers from the entry measurements of \protect{Viking} 2},
+volume = {194},
+year = {1976}
+}
+
+@article{Shor:76,
+author = {Shorthill , Richard W. and Moore , Henry J. and Hutton , Robert E.  and Scott , Ronald F. and Spitzer , Cary R.},
+journal = {Science},
+pages = {1309-1318},
+title = {The environment of \protect{Viking} 2 lander},
+volume = {194},
+year = {1976}
+}
+
+@article{Kief:76,
+author = {Kieffer , Hugh H. and Chase , S. C.  and Miner,  E. D.  and Palluconi , Frank Don.  and M\"unch , Guidoa and Neugebauer , Gerry and Martin, Terry Z.},
+journal = {Science},
+pages = {780-786},
+title = {Infrared Thermal mapping of the {Martian} surface and atmosphere: First results},
+volume = {193},
+year = {1976}
+}
+
+@article{Kief:76c,
+author = {Kieffer , H. H. and Chase , S. C.  and Martin , T. Z.  and Miner , E. D.  and Palluconi , F. D.},
+journal = {Science},
+pages = {1341-1343},
+title = {Martian north pole summer temperatures : dirty water ice},
+volume = {194},
+year = {76}
+}
+
+@article{Hers:84,
+author = {Herschel , W.},
+journal = {Philos. Trans.},
+pages = {233-273},
+title = {On the remarkable appearance of the polar regions of the planet {Mars}, the inclination of its axis, the position of its poles, and its spheroidical figure; {With} a few hints relative to its diameter},
+volume = {24},
+year = {1784}
+}
+
+@article{Mana:61,
+author = {Manabe , Syukuro  and M\"oller , Fritz},
+journal = mwr,
+pages = {503-532},
+title = {On the radiative  equilibrium and heat balance of the atmosphere},
+volume = {89},
+year = {1961}
+}
+
+@article{Mana:64,
+author = {Manabe , Syukuro and Strickler , Robert F.},
+journal = jas,
+pages = {361-385},
+title = {Thermal Equilibrium of the atmosphere with a convective adjustment},
+volume = {21},
+year = {1964}
+}
+
+@article{Hosk:91,
+author = {Hoskins , Brian J.},
+journal = {Tellus},
+pages = {27-35},
+title = {Toward a PV-$\theta$ view of the general circulation},
+volume = {43AB},
+year = {1991}
+}
+
+@article{Cris:86,
+author = {Crisp , David and Fels , Stephen B. and Schwarzkopf , M. D.},
+journal = jgr,
+number = {D11},
+pages = {11,851-11,866},
+title = {Approximate methods for finding \protect{CO$_2$}  \protect{$15\mu$m} band transmission in planetary atmospheres},
+volume = {91},
+year = {1986}
+}
+
+@article{Buri:80,
+author = {Buriez , J. C. and Fouquart , Y.},
+journal = jqsrt,
+pages = {407-419},
+title = {Generalization of the \protect{C}urtis-\protect{G}odson approximation to inhomogeneous scattering atmopsheres},
+volume = {24},
+year = {1980}
+}
+
+@article{Mead:80,
+author = {Meador , W. E. and Weaver , W. R.},
+journal = jas,
+pages = {630-643},
+title = {Two-stream approximations to radiative transfer in planetary atmospheres: a unified description of existing methods and new improvement},
+volume = {37},
+year = {1980}
+}
+
+@article{Kuhn:69,
+author = {Kuhn , William and London , Julius},
+journal = jas,
+pages = {189-204},
+title = {Infrared radiative cooling in the middle atmosphere (30-110 km)},
+volume = {26},
+year = {1969}
+}
+
+@proceedings{Berg:84,
+editor = {Berger, A. L. and Nicolis C.},
+publisher = {Elsevier Science Publishers, Amsterdam},
+title = {New perspectives in climate modeling},
+year = {1984}
+}
+
+@article{Fels:81,
+author = {Fels , Stephen B. and Schwarzkopf , M. D.},
+journal = jgr,
+number = {C2},
+pages = {1205-1232},
+title = {An Efficient, Accurate Algorithm for Calculating \protect{CO$_2$} $15 \mu$m Band Cooling Rates},
+volume = {86},
+year = {1981}
+}
+
+@article{Flas:81,
+author = {Flasar , F. M. and Samuelson , R. E. and Conrath , B. J.},
+journal = {Nature},
+pages = {693-698},
+title = {Titan's atmosphere: temperature and dynamics},
+volume = {292},
+year = {1981}
+}
+
+@article{Lask:93,
+author = {Laskar , J and Robutel , P.},
+journal = {Nature},
+pages = {608-612},
+title = {The chaotic obliquity of the planets},
+volume = {361},
+year = {1993}
+}
+
+@article{Flas:90,
+author = {Flasar , F. M. and Conrath , B. J.},
+journal = {Icarus},
+pages = {346-354},
+title = {Titan's stratospheric temperatures: a case for dynamical inertia?},
+volume = {85},
+year = {1990}
+}
+
+@article{Gier:75,
+author = {Gierasch , P. J.},
+journal = jas,
+pages = {1038-1044},
+title = {Meridional circulation and the maintenance of the \protect{Venus} atmospheric rotation},
+volume = {32},
+year = {1975}
+}
+
+@book{Holt:79,
+author = {Holton , James R.},
+edition = {second},
+editor = {Anton L. Hales},
+publisher = {Academic Press},
+series = {Internal geophysics series},
+title = {An introduction to dynamic meteorology},
+volume = {23},
+year = {1979},
+adress = "New York \ San Francisco \ London"
+}
+
+@book{Holt:92,
+author = {Holton , James R.},
+edition = {third},
+publisher = {Academic Press},
+series = {Internal geophysics series},
+title = {An introduction to dynamic meteorology},
+volume = {48},
+year = {1992},
+adress = "New York \ San Francisco \ London"
+}
+
+@book{Holt:04,
+	author = {Holton , J.~R.},
+	edition = {fourth},
+	publisher = {Elsevier Academic Press},
+	series = {International geophysics series},
+	title = {An introduction to dynamic meteorology},
+	volume = {48},
+	year = {2004},
+	adress = "New York \ San Francisco \ London"
+}
+
+@book{Peix:92,
+author = {Peixoto , Jos\'e P.  and Oort , Abraham H.},
+address = {New York},
+publisher = {American Institute of Physics},
+title = {Physics of Climate},
+year = {1992}
+}
+
+@unpublished{Morc:89,
+author = {Morcrette , Jean-Jacques},
+title = {The \protect{ECMWF} model radiation scheme: Description and Validation},
+year = {1989}
+}
+
+@article{Hou:90,
+author = {Hou , Arthur Y. and Fels , Stephen B. and Goody , Richard M.},
+journal = jas,
+pages = {1894-1901},
+title = {Zonal Superrotation above \protect{Venus}'Cloud Base Induced by the Semidiurnal Tide and the Mean Meridional Circulation},
+volume = {47},
+year = {1990}
+}
+
+@article{Malk:67,
+author = {Malkmus , W.},
+journal = josa,
+pages = {323-329},
+title = {Random \protect{L}orentz band model with exponential-tailed $S^{-1}$ line-intensity distiribution function},
+volume = {57},
+year = {1967}
+}
+
+@article{Zhu:88,
+author = {Zhu , Xun},
+journal = jqsrt,
+pages = {421-427},
+title = {An improved voigt line approximation for the calculation of equivalent width and transmission},
+volume = {39},
+year = {1988}
+}
+
+@article{Zhu:89,
+author = {Zhu , Xun},
+journal = jas,
+pages = {511-520},
+title = {Radiative cooling calculated by random models with \protect{$S^{-1-\beta}$} tailed distribution},
+volume = {46},
+year = {1989}
+}
+
+@article{Fels:79,
+author = {Fels , Stephen B.},
+journal = ao,
+pages = {2634-2637},
+title = {Simple strategies for inclusion of \protect{V}oigt effect in infrared cooling rate calculations},
+volume = {18},
+year = {1979}
+}
+
+@inproceedings{Tala:90b,
+author = {Talagrand , Olivier and Hourdin , Fr\'ed\'eric},
+booktitle = {International symposium on assimilation of observations in meteorology and oceanography},
+organization = {World Meteorological Organization},
+pages = {578-580},
+title = {A plan for assimilation of observations of the \protect{Martian} atmosphere},
+year = {1990}
+}
+
+@article{Cour:90,
+author = {Courtier , P. and Talagrand , O.},
+journal = {Tellus},
+pages = {531-549},
+title = {Variational assimilation of meteorological observations with the direct and adjoint shallow-water equations},
+volume = {42A},
+year = {1990}
+}
+
+@article{Cour:95,
+author = {Courtin , R\'egis and Gautier , Daniel  and McKay , Christopher P.},
+journal = {Icarus},
+pages = {144-162},
+title = {Titan's thermal emission spectrum: {Reanalysis} of the {Voyager} Infrared measurements},
+volume = {14},
+year = {1995}
+}
+
+@article{Cour:87,
+author = {Courtier , P. and Talagrand , O.},
+journal = qjrms,
+pages = {1329-1347},
+title = {Variational assimilation of meteorological observations with the adjoint vorticity equation. \protect{II}: Numerical results},
+volume = {113},
+year = {1987}
+}
+
+@article{Tala:90,
+author = {Talagrand , O. and Courtier , P.},
+journal = {Tellus},
+pages = {531-549},
+title = {Variational assimilation of meteorological observations with the direct and adjoint shallow-water equations},
+volume = {42A},
+year = {1990}
+}
+
+@article{Tala:87,
+author = {Talagrand , O. and Courtier , P.},
+journal = qjrms,
+pages = {1331-1328},
+title = {Variational assimilation of meteorological observations with the adjoint vorticity equation. \protect{I}: Theory},
+volume = {113},
+year = {1987}
+}
+
+@article{Good:52,
+author = {Goody , R. M.},
+journal = qjr,
+pages = {165-169},
+title = {A statistical model for water vapour absorption},
+volume = {78},
+year = {1952}
+}
+
+@article{Hour:90a,
+author = {Fr\'ed\'eric Hourdin and Talagrand , Olivier},
+journal = ang,
+note = {Poster presentation at the XV General Assembly of the EGS},
+pages = {328},
+title = {A general Circulation Model of the {Martian} Atmosphere},
+volume = {Special Issue},
+year = {1990}
+}
+
+@article{Jako:93,
+author = {Jakosky, B. M.   and Henderson , B. G.  and Mellon M. T.},
+journal = {Icarus},
+pages = {286-297},
+title = {The {Mars} water cycle at other epochs~: recent history of the polar caps and layered terrain.},
+volume = {102},
+year = {1993}
+}
+
+@article{Ward:74,
+author = {Ward  ,  W. R. and Murray , B. C. and Malin , M. C.},
+journal = jgr,
+pages = {3387-3395},
+title = {Climatic variations on {Mars}. 2. {Evolution} of carbon dioxide atmosphere and polar caps},
+volume = {79},
+year = {1974}
+}
+
+@article{Tala:91,
+author = {Talagrand , Olivier and Hourdin , Fr\'ed\'eric and Le Van , Phu},
+journal = ang,
+note = {Oral presentation at the XVI General Assembly of the EGS},
+pages = {C422},
+title = {Development of the \protect{LMD} General Circulation Model of the {Martian} atmosphere: a progress report},
+volume = {9 supp.},
+year = {1991}
+}
+
+@article{Hou:92,
+author = {Hou , Arthur Y. and Lindzen , Richard S.},
+journal = jas,
+pages = {1233-1241},
+title = {The influence of concentrated heating on the \protect{Hadley} circulation},
+volume = {49},
+year = {1992}
+}
+
+@article{Hour:91,
+author = {Hourdin , Fr\'ed\'eric and Talagrand , Olivier},
+journal = ang,
+note = {Oral presentation at the XVI General Assembly of the EGS},
+pages = {C409},
+title = {Hadley Circulation and Superrotation in Planetary Atmospheres},
+volume = {9 supp.},
+year = {1991}
+}
+
+@inproceedings{Hour:92b,
+author = {Hourdin , F. and Le Van , P. and Talagrand , O. and Courtin , R. and Gautier , D. and McKay , C.},
+booktitle = {Symposium on \protect{Titan}},
+organization = {ESA},
+pages = {101-106},
+publisher = {ESA},
+title = {Numerical simulation of the circulation of the atmosphere of \protect{Titan}},
+volume = {SP-338},
+year = {1992}
+}
+
+@inproceedings{Jame:92,
+author = {James , Ian N.},
+booktitle = {Symposium on \protect{Titan}},
+crossref = {esa:91},
+editor = {ESA},
+organization = {ESA},
+pages = {107-111},
+title = {Simple dynamical models of \protect{Titan's}
+atmospheric circulation},
+volume = {SP-338},
+year = {1992}
+}
+
+@inproceedings{Kief:92b,
+author = {Kieffer , H. H. and Zent , A. P.},
+booktitle = {Mars},
+editor = {Kieffer , Jakosky , Snyder  and Matthews},
+pages = {pp. 1180-1218},
+publisher = {University of Arizona Press, Tucson},
+title = {Quasi-periodic climate change on {Mars}},
+year = {1992}
+}
+
+@inproceedings{Snyd:92,
+author = {Snyder, C. W. and Moroz, V. I.},
+booktitle = {Mars},
+editor = {Kieffer , Jakosky , Snyder  and Matthews},
+pages = {pp. 71-119},
+publisher = {University of Arizona Press, Tucson},
+title = {Spacecraft exploration of {Mars}},
+year = {1992}
+}
+
+@inproceedings{Kief:92c,
+author = {Kieffer , H. H. and Jakosky, B. M. and Snyder , C.W.},
+booktitle = {Mars},
+editor = {Kieffer ,  Jakosky , Snyder  and Matthews},
+pages = {pp. 1-33},
+publisher = {University of Arizona Press, Tucson},
+title = {The planet {Mars: From} antiquity to the present},
+year = {1992}
+}
+
+@inproceedings{Jame:92mars,
+author = {James , Philip B. and Kieffer , Hugh H. and Paige , David A.},
+booktitle = {Mars},
+pages = {pp.~934-968},
+publisher = {University of Arizona Press, Tucson},
+title = {The seasonal cycle of carbon dioxide on {Mars}},
+volume = {  },
+year = {1992}
+}
+
+@inproceedings{Kahn:92,
+author = {Kahn, R. A. and Martin , T. Z. and Zurek , R. W.},
+booktitle = {Mars},
+pages = {pp.~1017-1053},
+publisher = {University of Arizona Press, Tucson},
+title = {The {Martian} dust cycle},
+volume = {  },
+year = {1992}
+}
+
+@inproceedings{Gree:92,
+author = {Greeley , R. and Lancaster , N. and Lee , S. and Thomas, P.},
+booktitle = {Mars},
+pages = {pp.~730-766},
+publisher = {University of Arizona Press, Tucson},
+title = {Martian aeolian processes, sediments and features},
+volume = {  },
+year = {1992}
+}
+
+@inproceedings{Jako:92,
+author = {Jakosky , Bruce M. and Haberle  ,  Robert M},
+booktitle = {Mars},
+pages = {pp.~969},
+publisher = {University of Arizona Press, Tucson},
+title = {The seasonal behavior of water on {Mars}},
+year = {1992}
+}
+
+@inproceedings{Owen:92,
+author = {Owen ,Tobias},
+booktitle = {Mars},
+pages = {pp.~818-834},
+publisher = {University of Arizona Press, Tucson},
+title = {The composition and early history of the atmosphere of {Mars}},
+year = {1992}
+}
+
+@article{Hapk:81,
+author = {Hapke, B.},
+journal = jgr,
+pages = {3039-3054},
+title = {Bidirectional reflectance spectroscopy 1. {Theory}},
+volume = {86},
+year = {1981}
+}
+
+@article{Hapk:86,
+author = {Hapke , B.},
+journal = {Icarus},
+pages = {264-280},
+title = {Bidirectional reflectance spectroscopy  4. {The extinction coefficient and the opposition effect}},
+volume = {67},
+year = {1986}
+}
+
+@inproceedings{Jame:92b,
+author = {James , P. B. and Kieffer , H. H. and Paige , D. A.},
+address = {Tucson},
+booktitle = {Mars},
+chapter = {27},
+pages = {pp.~934-968},
+publisher = {University of Arizona Press, Tucson},
+title = {The seasonal cycle of carbon dioxide on \protect{Mars}},
+year = {1992}
+}
+
+@book{Kief:92,
+author = {Kieffer, H. H. and Jakosky , B. M.  and Snyder , C. W.  and Matthews, M .S},
+address = {Tucson},
+booktitle = {Mars},
+chapter = {23},
+publisher = {University of Arizona Press, Tucson},
+title = {Mars},
+year = {1992}
+}
+
+@article{Hunt:79,
+author = {Hunt , B. G.},
+journal = jas,
+pages = {1392-1408},
+title = {The Influence of the Earth's Rotation Rate on the General Circulation of the Atmosphere},
+volume = {36},
+year = {1979}
+}
+
+@article{Toon:,
+author = {Rapid}
+}
+
+@article{Hunt:81,
+author = {Hunt, B. G.},
+journal = jas,
+pages = {2172-2186},
+title = {The maintenance of the zonal mean state of the upper atmosphere as represented in a three-dimensional \protect{General} \protect{Circulation} \protect{Model} Extending to $100km$.},
+volume = {38},
+year = {1981}
+}
+
+@article{McKa:89,
+author = {McKay , C. P. and Pollack , J. B. and Courtin , R.},
+journal = {Icarus},
+pages = {23-53},
+title = {The Thermal Structure of \protect{Titan's} Atmosphere},
+volume = {80},
+year = {1989}
+}
+
+@article{Schn:77,
+author = {Schneider , Edwin K. and Lindzen , Richard S.},
+journal = jas,
+pages = {263-296},
+title = {Axially symmetric steady-state models of the basic state for instability and climate studies. \protect{Part I}. Linearized calculations.},
+volume = {34},
+year = {1977}
+}
+
+@article{Held:80,
+author = {Held , Isaac M. and Hou , Arthur Y.},
+journal = jas,
+pages = {515-533},
+title = {Nonlinear axially symmetric circulations in a nearly inviscid atmosphere},
+volume = {37},
+year = {1980}
+}
+
+@article{Held:78,
+author = {Held , Isaac M.},
+journal = jas,
+pages = {572-576},
+title = {The vertical scale of an unstable baroclinic wave and its importance for Eddy heat flux parametrizations},
+volume = {35},
+year = {1977}
+}
+
+@article{McKa:90,
+author = {McKay , Christopher},
+journal = {La recherche},
+pages = {1216-1224},
+title = {La vie sur \protect{Mars}},
+volume = {21},
+year = {1990}
+}
+
+@article{McKa:89mars,
+author = {McKay, C.P. and Stoker, C. R.},
+journal = {Review of Geophysics},
+pages = {189-214},
+title = {The early environment and its evolution on {Mars}: implication for life},
+volume = {27},
+year = {1989}
+}
+
+@article{McKa:96,
+author = {McKay, D. S. and Gibson Jr. , E. K. and Thomas-Keprta, K.L. and Vali, H. and Romanek, C.S. and Clemett, S. J. and Chillier, X.D.F. and Maechling, C.R. and Zare, R.N.},
+journal = {Science},
+pages = {924-929},
+title = {Search for past life on {Mars}: possible relic biogenic activity in {Martian} meteorite {ALH84001}},
+volume = {273},
+year = {1996}
+}
+
+@article{Morc:86,
+author = {Morcrette , Jean Jacques and Smith , Laura and Fouquart , Yves},
+journal = bpa,
+number = {4},
+pages = {455-469},
+title = {Pressure and Temperature Dependence of the Absorption in Longwave Radiation Parametrizations},
+volume = {59},
+year = {1986}
+}
+
+@phdthesis{Morc:84,
+author = {Morcrette , Jean Jacques},
+school = {Univ. des Sci. et Tech. de Lille, France},
+title = {Sur la param\'etrisation du rayonnement dans les mod\`eles de la circulation g\'en\'erale atmosph\'erique},
+type = {th\`ese de \protect{D}octorat d'\protect{E}tat},
+year = {1984}
+}
+
+@article{Sado:75,
+author = {Sadourny , Robert},
+journal = jas,
+pages = {680-689},
+title = {The Dynamics of Finite-Difference Models of the Shallow-Water Equations},
+volume = {32},
+year = {1975}
+}
+
+@article{Sado:75a,
+author = {Sadourny , Robert},
+journal = jas,
+pages = {2103-2110},
+title = {Compressible Model Flows on the Sphere},
+volume = {32},
+year = {1975}
+}
+
+@article{Rodg:66,
+author = {Rodgers , C. D. and Walshaw , C. D.},
+journal = qjr,
+pages = {67-92},
+title = {The computation of infra-red cooling rate in planetary atmospheres},
+volume = {92},
+year = {1966}
+}
+
+@article{Rodg:74,
+author = {Rodgers , C. D. and Williams , A. P.},
+journal = jqsrt,
+pages = {319-323},
+title = {Integrated absorption of a spectral line with the \protect{V}oigt profile},
+volume = {14},
+year = {1974}
+}
+
+@incollection{Sado:84,
+author = {Sadourny,R. and Laval,K.},
+address = {Amsterdam},
+booktitle = {New perspectives in Climate Modeling},
+editor = {A.~Berger and C.~Nicolis},
+key = {Sadourny, Laval, 1984},
+pages = {173-197},
+series = {Elsevier},
+title = {January and {July} performance of the \protect{LMD} General Circulation Model},
+year = {1984}
+}
+
+@inproceedings{Sado:80,
+author = {Sadourny , Robert},
+address = {Reading},
+booktitle = {Dynamical meteorology and numerical weather prediction},
+editor = {ECMWF},
+title = {Conservation laws, quasi-two-dimensional turbulence and numerical modeling of large scale flows},
+volume = {2},
+year = {1980}
+}
+
+@article{Sica:90,
+author = {Sicardy , Bruno and Brahic , A. and Ferrari , C. and Gautier , D. and Lecacheux , J. and Lellouch , E. and Roques , F. and Arlot , J. E. and Colas , F. and Thuillot , W. and S\`evre , F. and Vidal , J. and Blanco , C. and Cristaldi , S. and Buil , C. and Klotz , A. and Thouvenot , E.},
+address = {. and Blanco , C. and Cristaldi , S. and Buil , C. and Klotz , A. and Thouvenot , E.},
+journal = {Nature},
+pages = {350},
+title = {Probing \protect{Titan's} atmosphere by stellar occultation},
+volume = {343},
+year = {1990}
+}
+
+@article{Sant:93,
+author = {Santee , Michelle and Crisp , David},
+journal = jgr,
+pages = {3261-3279},
+title = {Thermal structure and Dust Loading of the \protect{Martian} atmosphere during late southern summer: \protect{Mariner} 9 revisited},
+volume = {98},
+year = {1993}
+}
+
+@article{Step:84,
+author = {Stephens , Graeme L.},
+journal = mwr,
+pages = {826-867},
+title = {The Parametrization of Radiation for Numerical Weather Prediction and Climate Models},
+volume = {112},
+year = {1984}
+}
+
+@article{Tiwa:78,
+author = {Tiwari , Surendra N.},
+journal = {Adv. Geophys.},
+pages = {1-85},
+title = {Models For Infrared Atmospheric Radiation},
+volume = {20},
+year = {1978}
+}
+
+@article{Tjem:88,
+author = {Tjemkes , S. A. and Duynkerke , P. G.},
+journal = bpa,
+pages = {105-113},
+title = {A New Look at the \protect{G}oody Band Model},
+volume = {61},
+year = {1988}
+}
+
+@book{Hunt:83,
+address = {Tucson, AZ, USA},
+editor = {Hunten , D. M. and Colin , L. and Donahue , T. M. and Moroz , V. I.},
+publisher = {Univ. of Arizona Press},
+series = {Space Science},
+title = {Venus},
+year = {1983}
+}
+
+@article{Rama:89,
+author = {Ramanathan, V. and R. D. Cess and E. F. Harrison
+and P. Minnis and B. R. Barkstrom and E. Ahmad and D.
+Hartmann},
+journal = {Science},
+pages = {57-62},
+title = {Cloud-radiative forcing and climate: results
+from the {E}arth {R}adiation {B}udget {E}xperiment},
+volume = {243},
+year = {1989}
+}
+
+@article{Russ:81,
+author = {Russell , G. L. and Lerner , J. A.},
+journal = jam,
+pages = {1483-1498},
+title = {A new finite-differencing scheme for the tracer transport equation},
+volume = {20},
+year = {1981}
+}
+
+@article{Blam:93,
+author = {Blamont, J. E. and Chassefi\`ere , E.},
+journal = {Icarus},
+pages = {324-336},
+title = {First detection of Ozone in the middle atmosphere of Mars from solar occultaion measurements},
+volume = {104},
+year = {1993}
+}
+
+@article{Chas:94,
+author = {Chassefi\`ere , E. and Rosenqvist , J. and Th\'eodore , B.},
+journal = pss,
+pages = {825-830},
+volume = {42},
+year = {1994}
+}
+
+@article{VanL:77,
+author = {Van Leer , Bram},
+journal = jcp,
+pages = {276-299},
+title = {Towards the ultimate conservative difference scheme : {IV.} A new approach to numerical convection},
+volume = {23},
+year = {1977}
+}
+
+@article{VanL:79,
+author = {Van Leer , B.},
+journal = jcp,
+pages = {101-136},
+title = {Towards the ultimate conservative difference scheme. {V.} A second-order sequel to {Godunov's} method},
+volume = {32},
+year = {1979}
+}
+
+@article{Bori:73,
+author = {Boris , J. P. and Book , D. L.}
+}
+
+@article{vanL:85,
+author = {\protect{van} Leer, B.},
+journal = {Lect.~Notes Appl. Math.},
+pages = {327-336},
+title = {Upwind-difference methods for aerodynamic problems governed by the \protect{E}uler equations},
+volume = {22},
+year = {1985}
+}
+
+@book{Vand:57,
+author = {Van de Hulst , H. C.},
+note = {Republished, 1981},
+publisher = {Dover Publication, inc.},
+title = {Light scaterring by small particles},
+year = {1957}
+}
+
+@article{Prat:86,
+author = {Prather , M. J.},
+journal = jgr,
+pages = {6671-6681},
+title = {Numerical advection by conservation of second order moments},
+volume = {91},
+year = {1986}
+}
+
+@article{Mill:89,
+author = {Miller, M. J. and Palmer, P. M. and Swinbank, R.},
+journal = {Meteorol. Atmos. Phys.},
+pages = {84-109},
+title = {Parametrisation and influence of sub-grid scale orography in general circulation and numerical weather prediction models.},
+volume = {40},
+year = {1989}
+}
+
+@techreport{Bain:90,
+author = {Baines, P. G. and Palmer, T. N.},
+institution = {Eur. Cent. for Medium-Range Weather Forecasts,
+Reading, England},
+number = {169},
+title = {Rationale for a new physically-based parametrisation of sub-grid scale orographic effects.},
+year = {1990}
+}
+
+@article{Wu:81,
+author = {Wu, S. S. C.},
+journal = {Annales de Geophysique},
+pages = {147-160},
+title = {A method of defining topographic datums of planetary bodies},
+volume = {1},
+year = {1981}
+}
+
+@article{Phil:84,
+author = {Phillips, S. P.},
+journal = jas,
+pages = {1073-1084},
+title = {Analytical surface pressure and drag for linear hydrostatic flow over three-dimensional elliptical mountains},
+volume = {41},
+year = {1984}
+}
+
+@article{Conr:89,
+author = {{Conrath}, B. and {Flasar}, F. M. and {Hanel}, R. and {Kunde}, V. and
+{Maguire}, W. and {Pearl}, J. and {Pirraglia}, J. and {Samuelson}, R. and 
+{Gierasch}, P. and {Weir}, A. and {Bezard}
+}
+}
+
+@article{Lehn:99,
+author = { Lehning , M. and Richner , H. and Kok , G. L. and Neininger , B.},
+journal = ae,
+pages = {1353-1363},
+title = {Vertical exchange and regional budgets of air pollutants over densely populated areas},
+volume = {32},
+year = {1999}
+}
+
+@article{Menu:99a,
+author = { Menut , L. and Flamant , C. and Pelon , J. and Flamant , P. H.},
+journal = ao,
+pages = {945-954},
+title = {Urban boundary layer height determination from lidar measurements over the {Paris} area},
+volume = {38},
+year = {1999}
+}
+
+@article{Menu:99b,
+author = { Menut , L. and Flamant , C. and Pelon , J.},
+journal = blm,
+pages = {269-286},
+title = {Evidence of synoptic scale influence on the atmospheric boundary layer dynamics and turbulent processes over the Paris area},
+volume = {93},
+year = {1999}
+}
+
+@misc{Menu:00,
+author = {Menut , L. and Vautard , R. and Flamant , C. and Abonnel , C. and Beekman , M. and Chazette , P. Flamant , P. H. and Gombert , D.  and Guedalia D. and Kley , D. and Lefebvre , M. B. and Lossec , B. and Martin , D. and Megie , G. and Perros , P. and Sicard , M. and Toupance , G.},
+address = {d Martin , D. and Megie , G. and Perros , P. and Sicard , M. and Toupance , G.},
+note = {Annales Geophysicae (submitted)},
+title = {Atmospheric pollution over the Paris area: The {ESQUIF} project},
+year = {2000}
+}
+
+@article{Piel:98,
+author = {Pielke , R. A. and Uliasz , M.},
+journal = ae,
+pages = {1455-1466},
+title = {Use of meteorological models as input to
+regional and mesoscale air quality models - Limitations and strengths},
+volume = {32},
+year = {1998}
+}
+
+@article{Plei:94,
+author = {Pleim , J. E. and Xiu , A.},
+journal = jam,
+pages = {16-32},
+title = {Development and Testing of a Surface Flux and Planetary Boundary Layer Model for Application in Mesoscale Models},
+volume = {34},
+year = {1994}
+}
+
+@article{GK1,
+author = {Krinner, G. and Genthon, C.},
+journal = {Ann. Glaciol.},
+pages = {73--78},
+title = {The {A}ntarctic surface mass balance in a stretched-grid {GCM}},
+volume = {25},
+year = {1997}
+}
+
+@article{GK2,
+author = {Krinner, G. and Genthon, C. and Li, Z.-X. and Le Van, P.},
+journal = jgr,
+pages = {13731--13745},
+title = {Studies of the {A}ntarctic climate with a stretched-grid general
+circulation model},
+volume = {102},
+year = {1997}
+}
+
+@article{GK3,
+author = {Genthon, C. and Krinner, G. and D\'equ\'e, M.},
+journal = {Ann. Glaciol.},
+pages = {488--494},
+title = {Intra-annual variability of {A}ntarctic precipitation
+from weather forecasts and high resolution climate models},
+volume = {27},
+year = {1998}
+}
+
+@article{GK4,
+author = {Krinner, G. and Genthon, C. and Jouzel, J.},
+journal = grl,
+pages = {2825--2828},
+title = {{GCM} analysis of local influences on ice core $\delta$ signals},
+volume = {24},
+year = {1997}
+}
+
+@phdthesis{GK5,
+author = {Krinner, G.},
+note = {partially in French},
+pages = {209 pp.},
+school = {Universit\'e Grenoble 1},
+title = {Simulations du climat des calottes de glace},
+type = {Th\`ese de doctorat},
+year = {1997}
+}
+
+@article{GK6,
+author = {Krinner, G. and Genthon, C.},
+journal = {Clim. Dyn.},
+pages = {741--758},
+title = {{GCM} simulations of the {L}ast {G}lacial {M}aximum surface
+climate of {G}reenland and {A}ntarctica},
+volume = {14},
+year = {1998}
+}
+
+@article{GK7,
+author = {Krinner, G. and Raynaud , D. and Doutriaux , C. and Dang , H.},
+journal = jgr,
+pages = {2059--2070},
+title = {Simulations of the {L}ast {G}lacial {M}aximum ice sheet
+surface climate: {I}mplications for the interpretation of
+ice core air content},
+volume = {105},
+year = {2000}
+}
+
+@article{GK8,
+author = {Krinner, G. and Genthon, C.},
+journal = grl,
+pages = {2227--2230},
+title = {Altitude dependence of the surface climate over the ice
+sheets},
+volume = {26},
+year = {1999}
+}
+
+@article{LeTr:91,
+author = {Le Treut, H. and Li, Z. X.},
+journal = {Climate Dynamics},
+pages = {175-187},
+title = {Sensitivity of an atmospheric general circulation model to prescribed \protect{SST} changes: Feedback effects associated with the simulation of cloud optical properties.},
+volume = {5},
+year = {1991}
+}
+
+@article{Harzallah:1994,
+author = {A. Harzallah and R. Sadourny},
+journal = {J.Clim.},
+pages = {474-495},
+title = {Internal versus {SST}-forced atmospheric variability as simulated by atmospheric general circulation model},
+volume = {8},
+year = {1994}
+}
+
+@article{Toig:00,
+author = {{Toigo}, A.~D. and {Richardson}, M.~I.},
+journal = jgr,
+pages = {4109--4121},
+title = {{Seasonal variation of aerosols in the Martian atmosphere}},
+volume = {105},
+year = {2000}
+}
+
+@article{Kief:00,
+author = {{Kieffer}, H.~H. and {Titus}, T.~N. and {Mullins}, K.~F.
+and 
+{Christensen}, P.~R.},
+journal = jgr,
+pages = {9653--9700},
+title = {{Mars south polar spring and summer behavior observed by
+TES: Seasonal cap evolution controlled by frost grain size}},
+volume = {105},
+year = {2000}
+}
+
+@article{Thom:00,
+author = {{Thomas}, P.~C. and {Malin}, M.~C. and {Edgett}, K.~S. and
+{Carr}, M.~H. and 
+{Hartmann}, W.~K. and {Ingersoll}, A.~P. and {James}, P. B.},
+journal = {Nature},
+pages = {161--164},
+title = {{North-south geological differences between the residual
+polar caps on Mars}},
+volume = {404},
+year = {2000}
+}
+
+@article{Pett:00,
+author = {{Pettengill}, G.~H. and {Ford}, P.~G.},
+journal = grl,
+pages = {609--613},
+title = {{Winter Clouds over the North Martian Polar Cap}},
+volume = {27},
+year = {2000}
+}
+
+@article{Cola:00,
+author = {{Colaprete}, A. and {Toon}, O.~B.},
+journal = {Icarus},
+pages = {524--532},
+title = {{The radiative effects of martian water ice clouds on the
+local atmospheric temperature profile}},
+volume = {145},
+year = {2000}
+}
+
+@article{Toum:93,
+author = {{Touma}, J. and {Wisdom}, J.},
+journal = {Science},
+pages = {1294--1297},
+title = {{The chaotic obliquity of Mars}},
+volume = {259},
+year = {1993}
+}
+
+
+@article{Jego:00,
+author = {{Jegou}, F. and {Chassefiere}, E. and {Forget}, F. and
+{Hourdin}, F. and {Lellouch}, E. and {Encrenaz}, T. and {Moreno}, R.},
+title = "{Ground-Based Millimeter Observations of the Middle
+Atmosphere of Mars: Why Are the Retrograde Winds So Strong?}",
+booktitle = {AAS/Division of Planetary Sciences Meeting},
+year = 2000,
+volume = 32,
+pages = {5116+}
+}
+
+@ARTICLE{Misc:03,
+author = {{Mischna}, M.~A. and {Richardson}, M.~I. and {Wilson},
+R.~J. and 
+{McCleese}, D.~J.},
+title = "{On the orbital forcing of Martian water and CO$_{2}$ cycles:
+A general circulation model study with simplified volatile schemes}",
+journal = {Journal of Geophysical Research (Planets)},
+year = 2003,
+pages = {16-1},
+}
+
+
+@ARTICLE{Bert:00,
+author = {{Bertaux}, J.-L. and {Fonteyn}, D. and {Korablev}, O. and
+{Chassefi{\` e}re}, E. and 
+{Dimarellis}, E. and {Dubois}, J.~P. and {Hauchecorne}, A. and 
+{Cabane}, M. and {Rannou}, P. and {Levasseur-Regourd}, A.~C. and 
+{Cernogora}, G. and {Quemerais}, E. and {Hermans}, C. and
+{Kockarts}, G. and 
+{Lippens}, C. and {Maziere}, M.~D. and {Moreau}, D. and {Muller}, C.
+and 
+{Neefs}, B. and {Simon}, P.~C. and {Forget}, F. and {Hourdin}, F.
+and 
+{Talagrand}, O. and {Moroz}, V.~I. and {Rodin}, A. and {Sandel}, B.
+and 
+{Stern}, A.},
+title = "{The study of the martian atmosphere from top to bottom
+with SPICAM light on mars express}",
+journal = pss,
+year = 2000,
+volume = 48,
+pages = {1303-1320},
+}
+
+@INPROCEEDINGS{Chic:03,
+author = {{Chicarro}, A.~F. and {The Science Team}},
+title = "{The Mars Express Mission and Its Beagle-2 Lander}",
+booktitle = {Sixth International Conference on Mars},
+year = 2003,
+month = jul,
+pages = {3049},
+}
+
+@ARTICLE{Form:02,
+author = {{Formisano}, V. and {Grassi}, D. and {Ignatiev}, N. and
+{Zasova}, L. and 
+{Maturilli}, A.},
+title = "{PFS for Mars Express: A new approach to study Martian
+atmosphere}",
+journal = {Advances in Space Research},
+year = 2002,
+volume = 29,
+pages = {131-142},
+}
+
+@ARTICLE{Habe:03,
+author = {{Haberle}, R.~M. and {Murphy}, J.~R. and {Schaeffer}, J.},
+title = "{Orbital change experiments with a Mars general circulation
+model}",
+journal = {Icarus},
+year = 2003,
+volume = 161,
+pages = {66-89},
+}
+
+@ARTICLE{Habe:98,
+author = {{Haberle}, R.~M.},
+title = "{Early Mars climate models}",
+journal = jgr,
+year = 1998,
+volume = 103,
+pages = {28467},
+}
+
+@ARTICLE{Habe:99,
+    author = {{Haberle}, R.~M. and {Joshi}, M.~M. and {Murphy}, J.~R.
+and 
+	{Barnes}, J.~R. and {Schofield}, J.~T. and {Wilson}, G. and 
+	{Lopez-Valverde}, M. and {Hollingsworth}, J.~L. and {Bridger},
+A.~F.~C. and 
+	{Schaeffer}, J.},
+    title = "{General circulation model simulations of the Mars
+Pathfinder atmospheric structure investigation/meteorology data}",
+    journal = jgr,
+    year = 1999,
+    volume = 104,
+    pages = {8957-8974},
+}
+
+
+
+@ARTICLE{Brid:98,
+    author = {{Bridger}, A.~F.~C. and {Murphy}, J.~R.},
+    title = "{Mars' surface pressure tides and their behavior during
+global dust storms}",
+    journal = jgr,
+    year = 1998,
+    volume = 103,
+    pages = {8587-8602},
+}
+
+
+@ARTICLE{Cola:99,
+    author = {{Colaprete}, A. and {Toon}, O.~B. and {Magalh{\~ a}es},
+J.~A.
+	},
+    title = "{Cloud formation under Mars Pathfinder conditions}",
+    journal = jgr,
+    year = 1999,
+    volume = 104,
+    pages = {9043-9054},
+}
+
+@ARTICLE{Cola:03a,
+    author = {{Colaprete}, A. and {Toon}, O.~B.},
+    title = "{Carbon dioxide clouds in an early dense Martian
+atmosphere}",
+    journal = {Jour. Geophys. Res. (Planets)},
+    year = 2003,
+    pages = {6-1},
+}
+
+@ARTICLE{Cola:03b,
+    author = {{Colaprete}, A. and {Haberle}, R.~M. and {Toon}, O.~B.},
+    title = "{Formation of convective carbon dioxide clouds near the
+south pole of Mars}",
+    journal = {Jour. Geophy. Res. (Planets)},
+    year = 2003,
+    pages = {17-1},
+}
+
+@ARTICLE{Mont:02,
+    author = {{Montmessin}, F. and {Rannou}, P. and {Cabane}, M.},
+    title = "{New insights into Martian dust distribution and water-ice
+cloud microphysics}",
+    journal = {Jour. Geophys. Res. (Planets)},
+    year = 2002,
+    pages = {4-1},
+}
+
+
+
+@ARTICLE{Boyn:02,
+    author = {{Boynton}, W.~V. and {Feldman}, W.~C. and {Squyres}, S.~W.
+and 
+	{Prettyman}, T.~H. and {Br{\" u}ckner}, J. and {Evans}, L.~G. and 
+	{Reedy}, R.~C. and {Starr}, R. and {Arnold}, J.~R. and {Drake},
+D.~M. and 
+	{Englert}, P.~A.~J. and {Metzger}, A.~E. and {Mitrofanov}, I. and 
+	{Trombka}, J.~I. and {d'Uston}, C. and {W{\" a}nke}, H. and 
+	{Gasnault}, O. and {Hamara}, D.~K. and {Janes}, D.~M. and
+{Marcialis}, R.~L. and 
+	{Maurice}, S. and {Mikheeva}, I. and {Taylor}, G.~J. and {Tokar}, R.
+and 
+	{Shinohara}, C.},
+    title = "{Distribution of Hydrogen in the Near Surface of Mars:
+Evidence for Subsurface Ice Deposits}",
+    journal = {Science},
+    year = 2002,
+    volume = 297,
+    pages = {81-85},
+}
+
+@INPROCEEDINGS{Habe:00lpi,
+    author = {{Haberle}, R.~M. and {McKay}, C.~P. and {Schaeffer}, J.
+and 
+	{Joshi}, M. and {Cabrol}, N.~A. and {Grin}, E.~A.},
+    title = "{Meteorological Control on the Formation of Martian
+Paleolakes}",
+    booktitle = {Lunar and Planetary Institute Conference Abstracts},
+    year = 2000,
+    pages = {1509},
+}
+
+@INPROCEEDINGS{Bott:03,
+    author = {{Bottger}, H.~M. and {Lewis}, S. R. and {Read}, P. L.
+and {Forget}, F. },
+    title = "{{GCM simulations of the Martian water cycle} }",
+    booktitle = {Mars atmosphere modelling and observations workshop abstracts, {http://www-mars.lmd.jussieu.fr/granada2003} },
+    year = 2003,
+}
+
+
+@INPROCEEDINGS{Mont:03,
+    author = {{Montmessin}, F. and {Forget}, F. and {Haberle}, R.~M. and
+{Rannou}, P. and {Cabane}, M.},
+    title = "{Water-Ice Clouds in the LMDs Martian General Circulation
+Model}",
+    booktitle = {Sixth International Conference on Mars},
+    year = 2003,
+    pages = {3117},
+}
+
+@ARTICLE{Bibr:04,
+   author = {{Bibring}, J. and {Langevin}, Y. and {Poulet}, F. and {Gendrin}, A. and 
+	{Gondet}, B. and {Berth{\' e}}, M. and {Soufflot}, A. and {Drossart}, P. and 
+	{Combes}, M. and {Bellucci}, G. and {Moroz}, V. and {Mangold}, N. and 
+	{Schmitt}, B. and {OMEGA team}, the},
+    title = "{Perennial water ice identified in the south polar cap of Mars}",
+  journal = {Nature},
+     year = {2004},
+   volume = 428,
+    pages = {627-630},
+}
+
+@book{Sobo:75,
+author = {Sobolev , V. V.},
+publisher = {Pergamon Press},
+title = {Light scaterring in planetary atmospheres},
+year = {1975},
+}
+
+
+
+@ARTICLE{Gend:03,
+   author = {{Gendrin}, A. and {Erard}, S. and {Drossart}, P. and {Melchiorri}, R.
+	},
+    title = "{Observation of pressure variations in the Martian atmosphere}",
+  journal = grl,
+     year = 2003,
+   volume = 30,
+    pages = {A14},
+} 
+
+@article{Mass:90,
+	author = {{Mass}, C.~F. and {Ferber}, G.~K.},
+	title = "{Surface pressure perturbations produced by an isolated mesoscale
+		topographic barrier. Part I: general characteristics and dynamics}",
+	journal = mwr,
+	year = 1990,
+	volume = 118,
+	pages={2579-2595},	
+}
+
+	
+@ARTICLE{Suns:93,
+   author = {{Sunshine}, J.~M. and {Pieters}, C.~M.},
+    title = "{Estimating modal abundances from the spectra of natural and laboratory pyroxene mixtures using the modified Gaussian model}",
+  journal = jgr,
+     year = 1993,
+   volume = 98,
+    pages = {9075-9087},
+}
+
+
+@ARTICLE{Suns:98,
+   author = {{Sunshine}, J.~M. and {Pieters}, C.~M.},
+    title = "{Determining the composition of olivine from reflectance spectroscopy}",
+  journal = jgr,
+     year = 1998,
+   volume = 103,
+    pages = {13675-13688},
+ }
+
+@phdthesis{Rose:these,
+author = {Rosenqvist, Jan},
+school = {Universit\'e Paris 7},
+title = {Mars : \'etude de son atmosph\`ere par le spectro-imageur ISM},
+year = {1991}
+}
+
+
+@book{Forg:03book,
+author = {{Forget}, F. and {Costard}, F. and {Lognonn\'e}, P.},
+publisher = {Belin. Pour la science},
+title = {La plan\`ete Mars, histoire d'un autre monde},
+year = {2003}
+}
+
+@book{Forg:06book,
+author = {{Forget}, F. and {Costard}, F. and {Lognonn\'e}, P.},
+publisher = {Belin. Pour la science},
+title = {La plan\`ete Mars, histoire d'un autre monde (seconde édition
+augmentée)},
+year = {2006}
+}
+
+@ARTICLE{Titu:01,
+   author = {{Titus}, T.~N. and {Kieffer}, H.~H. and {Mullins}, K.~F. and 
+	{Christensen}, P.~R.},
+    title = "{TES premapping data: Slab ice and snow flurries in the
+Martian north polar night}",
+  journal = jgr,
+     year = 2001,
+   volume = 106,
+    pages = {23181-23196}
+}
+
+
+
+@ARTICLE{Metz:99,
+   author = {{Metzger}, S.~M. and {Carr}, J.~R. and {Johnson}, J.~R. and 
+	{Parker}, T.~J. and {Lemmon}, M.~T.},
+    title = "{Dust devil vortices seen by the Mars Pathfinder camera}",
+  journal = grl,
+     year = 1999,
+   volume = 26,
+    pages = {2781-2784},
+}
+
+
+@ARTICLE{Smit:02,
+   author = {{Smith}, M.~D. and {Conrath}, B.~J. and {Pearl}, J.~C. and
+{Christensen}, P.~R.
+	},
+    title = "{NOTE: Thermal Emission Spectrometer Observations of Martian
+Planet-Encircling Dust Storm 2001A}",
+  journal = {Icarus},
+     year = 2002,
+   volume = 157,
+    pages = {259-263},
+}
+
+@ARTICLE{Newm:02b,
+   author = {{Newman}, C.~E. and {Lewis}, S.~R. and {Read}, P.~L. and
+{Forget}, F.
+	},
+    title = "{Modeling the Martian dust cycle 2. Multiannual radiatively
+active dust transport simulations}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2002,
+   volume = 107,
+    pages = {7-1},
+}
+
+@ARTICLE{Newm:02a,
+   author = {{Newman}, C.~E. and {Lewis}, S.~R. and {Read}, P.~L. and
+{Forget}, F.
+	},
+    title = "{Modeling the Martian dust cycle, 1. Representations of dust
+transport processes}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2002,
+   volume = 107,
+    pages = {6-1},
+}
+
+@ARTICLE{Smit:04,
+   author = {{Smith}, M.~D.},
+    title = "{Interannual variability in TES atmospheric observations of
+Mars during 1999-2003}",
+  journal = {Icarus},
+     year = 2004,
+   volume = 167,
+    pages = {148-165},
+}
+
+@ARTICLE{Encr:04,
+   author = {{Encrenaz}, T. and {B{\' e}zard}, B. and {Greathouse},
+T.~K. and 
+	{Richter}, M.~J. and {Lacy}, J.~H. and {Atreya}, S.~K. and {Wong},
+A.~S. and 
+	{Lebonnois}, S. and {Lef{\` e}vre}, F. and {Forget}, F.},
+    title = "{Hydrogen peroxide on Mars: evidence for spatial and
+seasonal variations}",
+  journal = {Icarus},
+     year = 2004,
+   volume = 170,
+    pages = {424-429},
+}
+
+@ARTICLE{Capd:04,
+   author = {{Capderou}, M. and {Forget}, F.},
+    title = "{Optimal orbits for Mars atmosphere remote sensing}",
+  journal = pss,
+     year = 2004,
+   volume = 52,
+    pages = {789-798},
+}
+
+@ARTICLE{Ange:04,
+   author = {{Angelats i Coll}, M. and {Forget}, F. and {L{\'
+o}pez-Valverde}, M.~A. and 
+	{Read}, P.~L. and {Lewis}, S.~R.},
+    title = "{Upper atmosphere of Mars up to 120 km: Mars Global
+Surveyor accelerometer data analysis with the LMD general circulation
+model}",
+  journal = jgr,
+     year = 2004,
+    pages = {1011},
+}
+
+@ARTICLE{Forg:05reve,
+   author = {Forget, F. and {Angelats i Coll}, M.
+and Hourdin, F. and Wanherdrick, Y. and 
+{L{\'o}pez-Valverde}, M.~A. and 
+	{Read}, P.~L. and {Lewis}, S.~R.},
+    title = "{Upper atmosphere of Mars up to 120 km: 
+numerical simulation with a general circulation model
+}",
+  journal = jgr,
+     year = 2004,
+    volume = {In preparation...},
+}
+
+
+
+@ARTICLE{Lefe:04,
+   author = {Lef\`evre, S. and Lebonnois, S. and Montmessin, F.  and Forget,
+F.  },
+    title = "{Three-dimensional modeling of ozone on Mars }",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2004,
+   volume = 109,
+    pages = {E07004},
+}
+
+@ARTICLE{Vand:02,
+   author = {{Van den Acker}, E. and {Van Hoolst}, T. and {de Viron}, O.
+and 
+	{Defraigne}, P. and {Forget}, F. and {Hourdin}, F. and {Dehant}, V.
+	},
+    title = "{Influence of the seasonal winds and the CO$_{2}$ mass
+exchange between atmosphere and polar caps on Mars' rotation}",
+  journal = {Journal of Geophysical Research },
+     year = 2002,
+   volume = 107,
+    pages = {E7,9-1},
+}
+
+@ARTICLE{Levr:04,
+   author = {Levrard, B. and Forget, F. and Montmessin, F. and Laskar,
+J.
+    },
+    title = "{Formation of recent martian high-latitude ice-rich
+deposits by sublimation of unstable equatorial ice at low obliquity
+}",
+  journal = {Nature},
+     year = 2004,
+    volume = {In press},
+}
+
+
+@ARTICLE{Mont:05,
+   author = {
+Montmessin, F. and Fouchet, T. and  Forget, F. },
+    title = "{
+Modeling the annual cycle of HDO in the {Martian atmosphere}
+}",
+  journal = {Journal of Geophysical Research },
+     year = 2004,
+    volume = {Submitted},
+}
+
+@ARTICLE{Tobi:03,
+   author = {{Tobie}, G. and {Forget}, F. and {Lott}, F.},
+    title = "{Numerical simulation of the winter polar wave clouds observed by
+Mars Global Surveyor Mars Orbiter Laser Altimeter}",
+  journal = {Icarus},
+     year = 2003,
+   volume = 164,
+    pages = {33-49}
+}
+
+@INBOOK{Squy:92,
+    author = {{Squyres}, S.~W. and {Clifford}, S.~M. and {Kuz'min}, R.~O. and 
+	{Zimbelman}, J.~R. and {Costard}, F.~M.},
+    title = "{Ice in the Martian regolith}",
+publisher = {University of Arizona Press, Tucson},
+year = 1992,
+    pages = {523-554}
+}
+@ARTICLE{Lask:04,
+   author = {{Laskar}, J. and {Correia}, A.~C.~M. and {Gastineau}, M. and 
+	{Joutel}, F. and {Levrard}, B. and {Robutel}, P.},
+    title = "{Long term evolution and chaotic diffusion of the insolation
+quantities of Mars}",
+  journal = {Icarus},
+     year = 2004,
+   volume = 170,
+    pages = {343-364}
+}
+
+@INBOOK{Bake:92,
+    author = {{Baker}, V.~R. and {Carr}, M.~H. and {Gulick}, V.~C. and
+{Williams}, C.~R. and 
+	{Marley}, M.~S.},
+    title = "{Channels and valley networks}",
+publisher = {University of Arizona Press, Tucson},
+year = 1992,
+    pages = {493-522}
+}
+
+@BOOK{Carr:96,
+    author = {{Carr}, M.~H.},
+    title = "{Water on Mars}",
+publisher = {New York: Oxford University Press, |c1996},
+year = 1996
+}
+
+@ARTICLE{Crad:93,
+   author = {{Craddock}, R.~A. and {Maxwell}, T.~A.},
+    title = "{Geomorphic evolution of the Martian highlands through ancient
+fluvial processes}",
+  journal = jgr,
+     year = 1993,
+   volume = 98,
+    pages = {3453-3468},
+}
+
+@ARTICLE{Lask:02,
+   author = {{Laskar}, J. and {Levrard}, B. and {Mustard}, J.~F.},
+    title = "{Orbital forcing of the martian polar layered deposits}",
+  journal = {Nature},
+     year = 2002,
+   volume = 419,
+    pages = {375-377},
+}
+
+@ARTICLE{Clif:00,
+   author = {{Clifford}, S.~M. and {Crisp}, D. and {Fisher}, D.~A. and
+{Herkenhoff}, K.~E. and 
+	{Smrekar}, S.~E. and {Thomas}, P.~C. and {Wynn-Williams}, D.~D. and 
+	{Zurek}, R.~W. and {Barnes}, J.~R. and {Bills}, B.~G. and {Blake}, E.~W.
+and 
+	{Calvin}, W.~M. and {Cameron}, J.~M. and {Carr}, M.~H. and {Christensen},
+P.~R. and 
+	{Clark}, B.~C. and {Clow}, G.~D. and {Cutts}, J.~A. and {Dahl-Jensen}, D.
+and 
+	{Durham}, W.~B. and {Fanale}, F.~P. and {Farmer}, J.~D. and 
+	{Forget}, F. and {Gotto-Azuma}, K. and {Grard}, R. and {Haberle}, R.~M. and
+
+	{Harrison}, W. and {Harvey}, R. and {Howard}, A.~D. and {Ingersoll}, A.~P.
+and 
+	{James}, P.~B. and {Kargel}, J.~S. and {Kieffer}, H.~H. and 
+	{Larsen}, J. and {Lepper}, K. and {Malin}, M.~C. and {McCleese}, D.~J. and
+	{Murray}, B. and {Nye}, J.~F. and {Paige}, D.~A. and {Platt}, S.~R. and 
+	{Plaut}, J.~J. and {Reeh}, N. and {Rice}, J.~W. and {Smith}, D.~E. and 
+	{Stoker}, C.~R. and {Tanaka}, K.~L. and {Mosley-Thompson}, E. and 
+	{Thorsteinsson}, T. and {Wood}, S.~E. and {Zent}, A. and {Zuber}, M.~T. and
+	{Zwally}, H.~J.},
+    title = "{The State and Future of Mars Polar Science and Exploration}",
+  journal = {Icarus},
+     year = 2000,
+   volume = 144,
+    pages = {210-242}
+}
+
+@ARTICLE{Smit:01mola,
+   author = {{Smith}, D.~E. and {Zuber}, M.~T. and {Frey}, H.~V. and {Garvin},
+J.~B. and 
+	{Head}, J.~W. and {Muhleman}, D.~O. and {Pettengill}, G.~H. and 
+	{Phillips}, R.~J. and {Solomon}, S.~C. and {Zwally}, H.~J. and 
+	{Banerdt}, W.~B. and {Duxbury}, T.~C. and {Golombek}, M.~P. and 
+	{Lemoine}, F.~G. and {Neumann}, G.~A. and {Rowlands}, D.~D. and 
+	{Aharonson}, O. and {Ford}, P.~G. and {Ivanov}, A.~B. and {Johnson}, C.~L.
+and 
+	{McGovern}, P.~J. and {Abshire}, J.~B. and {Afzal}, R.~S. and 
+	{Sun}, X.},
+    title = "{Mars Orbiter Laser Altimeter: Experiment summary after the first
+year of global mapping of Mars}",
+  journal = jgr,
+     year = 2001,
+volume=106,
+    pages = {23689-23722},
+}
+
+@ARTICLE{Mitr:02,
+   author = {{Mitrofanov}, I. and {Anfimov}, D. and {Kozyrev}, A. and {Litvak},
+M. and 
+	{Sanin}, A. and {Tret'yakov}, V. and {Krylov}, A. and {Shvetsov}, V. and 
+	{Boynton}, W. and {Shinohara}, C. and {Hamara}, D. and {Saunders}, R.~S.
+	},
+    title = "{Maps of Subsurface Hydrogen from the High Energy Neutron
+Detector, Mars Odyssey}",
+  journal = {Science},
+     year = 2002,
+   volume = 297,
+    pages = {78-81},
+}
+
+@ARTICLE{Feld:02,
+   author = {{Feldman}, W.~C. and {Boynton}, W.~V. and {Tokar}, R.~L. and 
+	{Prettyman}, T.~H. and {Gasnault}, O. and {Squyres}, S.~W. and 
+	{Elphic}, R.~C. and {Lawrence}, D.~J. and {Lawson}, S.~L. and 
+	{Maurice}, S. and {McKinney}, G.~W. and {Moore}, K.~R. and {Reedy}, R.~C.
+	},
+    title = "{Global Distribution of Neutrons from Mars: Results from Mars
+Odyssey}",
+  journal = {Science},
+     year = 2002,
+   volume = 297,
+    pages = {75-78},
+}
+
+@ARTICLE{Head:03,
+   author = {{Head}, J.~W. and {Mustard}, J.~F. and {Kreslavsky}, M.~A. and 
+	{Milliken}, R.~E. and {Marchant}, D.~R.},
+    title = "{Recent ice ages on Mars}",
+  journal = {Nature},
+     year = 2003,
+   volume = 426,
+    pages = {797-802},
+}
+
+@ARTICLE{Habe:01,
+   author = {{Haberle}, R.~M. and {McKay}, C.~P. and {Schaeffer}, J. and 
+	{Cabrol}, N.~A. and {Grin}, E.~A. and {Zent}, A.~P. and {Quinn}, R.
+	},
+    title = "{On the possibility of liquid water on present-day Mars}",
+  journal = jgr,
+     year = 2001,
+    pages = {23317-23326},
+}
+
+@ARTICLE{Hech:02,
+   author = {{Hecht}, M.~H.},
+    title = "{Metastability of Liquid Water on Mars}",
+  journal = {Icarus},
+     year = 2002,
+   volume = 156,
+    pages = {373-386},
+}
+
+@ARTICLE{Head:03nat,
+   author = {{Head}, J.~W. and {Mustard}, J.~F. and {Kreslavsky}, M.~A. and 
+	{Milliken}, R.~E. and {Marchant}, D.~R.},
+    title = "{Recent ice ages on Mars}",
+  journal = {Nature},
+     year = 2003,
+   volume = 426,
+    pages = {797-802},
+}
+
+@ARTICLE{Mali:00gul,
+   author = {{Malin}, M.~C. and {Edgett}, K.~S.},
+    title = "{Evidence for Recent Groundwater Seepage and Surface Runoff on
+Mars}",
+  journal = {Science},
+     year = 2000,
+   volume = 288,
+    pages = {2330-2335},
+}
+
+
+@ARTICLE{Mali:00lay,
+author = {{Malin}, M.~C. and {Edgett}, K.~S.},
+    title = "{Sedimentary Rocks of Early Mars}",
+  journal = {Science},
+     year = 2000,
+   volume = 290,
+    pages = {1927-1937},
+
+}
+
+@ARTICLE{Mali:03,
+author = {{Malin}, M.~C. and {Edgett}, K.~S.},
+    title = "{Evidence for Persistent Flow and Aqueous Sedimentation on Early
+Mars}",
+  journal = {Science},
+     year = 2003,
+   volume = 302,
+    pages = {1931-1934},
+}
+
+@ARTICLE{Cost:02,
+   author = {{Costard}, F. and {Forget}, F. and {Mangold}, N. and {Peulvast},
+J.~P.
+	},
+    title = "{Formation of Recent Martian Debris Flows by Melting of
+Near-Surface Ground Ice at High Obliquity}",
+  journal = {Science},
+     year = 2002,
+   volume = 295,
+    pages = {110-113},
+}
+
+@ARTICLE{Mang:03dune,
+   author = {{Mangold}, N. and {Costard}, F. and {Forget}, F.},
+    title = "{Debris flows over sand dunes on Mars: Evidence for liquid
+water}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2003,
+   volume = 108,
+    pages = {8-1},
+}
+
+@ARTICLE{Mang:04,
+   author = {{Mangold}, N. and {Quantin}, C. and {Ansan}, V. and {Delacourt},
+C. and 
+	{Allemand}, P.},
+    title = "{Evidence for Precipitation on Mars from Dendritic Valleys in the
+Valles Marineris Area}",
+  journal = {Science},
+     year = 2004,
+   volume = 305,
+    pages = {78-81},
+}
+
+@ARTICLE{Crad:02,
+   author = {{Craddock}, R.~A. and {Howard}, A.~D.},
+    title = "{The case for rainfall on a warm, wet early Mars}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2002,
+   volume = 107,
+    pages = {21-1},
+}
+
+@ARTICLE{Chri:01,
+   author = {{Christensen}, P.~R. and {Bandfield}, J.~L. and {Hamilton}, V.~E.
+and 
+	{Ruff}, S.~W. and {Kieffer}, H.~H. and {Titus}, T.~N. and {Malin}, M.~C.
+and 
+	{Morris}, R.~V. and {Lane}, M.~D. and {Clark}, R.~L. and {Jakosky}, B.~M.
+and 
+	{Mellon}, M.~T. and {Pearl}, J.~C. and {Conrath}, B.~J. and 
+	{Smith}, M.~D. and {Clancy}, R.~T. and {Kuzmin}, R.~O. and {Roush}, T. and
+	{Mehall}, G.~L. and {Gorelick}, N. and {Bender}, K. and {Murray}, K. and 
+	{Dason}, S. and {Greene}, E. and {Silverman}, S. and {Greenfield}, M.
+	},
+    title = "{Mars Global Surveyor Thermal Emission Spectrometer experiment:
+Investigation description and surface science results}",
+  journal = jgr,
+     year = 2001,
+   volume = 111,
+    pages = {23823-23872},
+}
+
+@ARTICLE{Segu:02,
+   author = {{Segura}, T.~L. and {Toon}, O.~B. and {Colaprete}, A. and
+{Zahnle}, K.
+	},
+    title = "{Environmental Effects of Large Impacts on Mars}",
+  journal = {Science},
+     year = 2002,
+   volume = 298,
+    pages = {1977-1980},
+}
+
+
+@ARTICLE{Mont:04jgr,
+   author = {{Montmessin}, F. and {Forget}, F. and {Rannou}, P. and
+{Cabane}, M. and 
+	{Haberle}, R.~M.},
+    title = "{Origin and role of water ice clouds in the Martian water
+cycle as inferred from a general circulation model}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2004,
+   volume = 109,
+   number = "E18",
+    pages = {10004},
+}
+
+@ARTICLE{Shea:05,
+   author = {{Shean}, D.~E. and {Head}, J.~W. and {Marchant}, D.~R.},
+    title = "{Origin and evolution of a cold-based tropical mountain
+glacier on Mars: The Pavonis Mons fan-shaped deposit}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2005,
+   volume = 110,
+   number = {E9},
+    pages = {5001},
+}
+
+@ARTICLE{Haub:05,
+   author = {{Hauber}, E. and {van Gasselt}, S. and {Ivanov}, B. and
+{Werner}, S. and 
+	{Head}, J.~W. and {Neukum}, G. and {Jaumann}, R. and {Greeley}, R.
+and 
+	{Mitchell}, K.~L. and {Muller}, P. and {Co-Investigator Team}, T.~H.
+	},
+    title = "{Discovery of a flank caldera and very young glacial
+activity at Hecates Tholus, Mars}",
+  journal = {Nature},
+     year = 2005,
+   volume = 434,
+    pages = {356-361},
+}
+
+
+@ARTICLE{Head:05,
+   author = {{Head}, J.~W. and {Neukum}, G. and {Jaumann}, R. and
+{Hiesinger}, H. and 
+	{Hauber}, E. and {Carr}, M. and {Masson}, P. and {Foing}, B. and 
+	{Hoffmann}, H. and {Kreslavsky}, M. and {Werner}, S. and {Milkovich},
+S. and 
+	{van Gasselt}, S. and {Co-Investigator Team}, T.~H.},
+    title = "{Tropical to mid-latitude snow and ice accumulation, flow
+and glaciation on Mars}",
+  journal = {Nature},
+     year = 2005,
+   volume = 434,
+    pages = {346-351},
+}
+
+
+
+@ARTICLE{Squy:79,
+   author = {{Squyres}, S.~W.},
+    title = "{The distribution of lobate debris aprons and similar flows
+on Mars}",
+  journal = jgr,
+     year = 1979,
+   volume = 84,
+    pages = {8087-8096},
+}
+
+@ARTICLE{Lucc:84,
+   author = {{Lucchitta}, B.~K.},
+    title = "{Ice and debris in the fretted terrain, Mars}",
+  journal = {Journal of Geophysical Research Supplement},
+     year = 1984,
+   volume = 89,
+    pages = {409},
+}
+
+@ARTICLE{Lucc:81,
+   author = {{Lucchitta}, B.~K.},
+    title = "{Mars and earth - Comparison of cold-climate features}",
+  journal = {Icarus},
+     year = 1981,
+   volume = 45,
+    pages = {264-303},
+}
+
+@ARTICLE{Mill:03,
+   author = {{Milliken}, R.~E. and {Mustard}, J.~F. and {Goldsby},
+D.~L.},
+    title = "{Viscous flow features on the surface of Mars: Observations
+from high-resolution Mars Orbiter Camera (MOC) images}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2003,
+   volume = 108,
+   number = "E6",
+    pages = {11-1},
+}
+
+@ARTICLE{Marq:04,
+   author = {{M{\' a}rquez}, {\' A}. and {Fern{\' a}ndez}, C. and
+{Anguita}, F. and 
+	{Farelo}, A. and {Anguita}, J. and {de La Casa}, M.},
+    title = "{New evidence for a volcanically, tectonically, and
+climatically active Mars}",
+  journal = {Icarus},
+     year = 2004,
+   volume = 172,
+    pages = {573-581},
+}
+
+@ARTICLE{Arfs:05,
+   author = {{Arfstrom}, J. and {Hartmann}, W.~K.},
+    title = "{Martian flow features, moraine-like ridges, and gullies:
+Terrestrial analogs and interrelationships}",
+  journal = {Icarus},
+     year = 2005,
+   volume = 174,
+    pages = {321-335},
+}
+
+@ARTICLE{Hart:03,
+   author = {{Hartmann}, W.~K. and {Thorsteinsson}, T. and {Sigurdsson},
+F.
+	},
+    title = "{Martian hillside gullies and icelandic analogs}",
+  journal = {Icarus},
+     year = 2003,
+   volume = 162,
+    pages = {259-277},
+}
+
+@ARTICLE{Chri:03,
+   author = {{Christensen}, P.~R.},
+    title = "{Formation of recent martian gullies through melting of
+extensive water-rich snow deposits}",
+  journal = {Nature},
+     year = 2003,
+   volume = 422,
+    pages = {45-48},
+}
+
+@ARTICLE{Mang:03aprons,
+   author = {{Mangold}, N.},
+    title = "{Geomorphic analysis of lobate debris aprons on Mars at Mars
+Orbiter Camera scale: Evidence for ice sublimation initiated by
+fractures}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2003,
+   volume = 108,
+   number = "E4",
+    pages = {2-1},
+}
+
+@ARTICLE{Jako:85nat,
+   author = {{Jakosky}, B.~M. and {Carr}, M.~H.},
+    title = "{Possible precipitation of ice at low latitudes of Mars
+during periods of high obliquity}",
+  journal = {Nature},
+     year = 1985,
+   volume = 315,
+    pages = {559-561},
+}
+
+@ARTICLE{Head:03geo,
+   author = {Head, J. W. and Marchant, D. R.}, 
+    title = "{
+Cold-based mountain glaciers on Mars: western Arsia Mons.
+}",
+  journal = {Geology},
+     year = 2003,
+   volume = 31,
+    pages = {641-644},
+}
+
+@ARTICLE{Mont:04,
+   author = {{Montmessin}, F. and {Forget}, F. and {Rannou}, P. and
+{Cabane}, M. and 
+	{Haberle}, R.~M.},
+    title = "{Origin and role of water ice clouds in the Martian water
+cycle as inferred from a general circulation model}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2004,
+   volume = 109,
+   number = "E18",
+    pages = {10004},
+}
+
+@ARTICLE{Rich:02,
+   author = {{Richardson}, M.~I. and {Wilson}, R.~J.},
+    title = "{Investigation of the nature and stability of the Martian
+seasonal water cycle with a general circulation model}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2002,
+   volume = 107,
+   number = "E5",
+    pages = {7-1},
+}
+
+
+@ARTICLE{Clan:03,
+   author = {{Clancy}, R.~T. and {Wolff}, M.~J. and {Christensen},
+P.~R.},
+    title = "{Mars aerosol studies with the MGS TES emission phase
+function observations: Optical depths, particle sizes, and ice cloud
+types versus latitude and solar longitude}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2003,
+   volume = 108,
+   number = {E9},
+    pages = {2-1},
+}
+
+@ARTICLE{Newm:05,
+   author = {{Newman}, C.~E. and {Lewis}, S.~R. and {Read}, P.~L.},
+    title = "{The atmospheric circulation and dust activity in different
+orbital epochs on Mars}",
+  journal = {Icarus},
+     year = 2005,
+   volume = 174,
+    pages = {135-160},
+}
+
+@ARTICLE{Misc:05,
+   author = {{Mischna}, M.~A. and {Richardson}, M.~I.},
+    title = "{A reanalysis of water abundances in the Martian atmosphere
+at high obliquity}",
+  journal = grl,
+     year = 2005,
+   volume = 32,
+    pages = {3201},
+}
+
+
+@INPROCEEDINGS{Mont:04lpi,
+   author = {{Montmessin}, F. and {Haberle}, R.~M. and {Forget}, F.},
+    title = "{Making Water Ice Permanent at the South Pole 25000 Years
+Ago}",
+booktitle = {Lunar and Planetary Institute Conference Abstracts},
+     year = 2004,
+    pages = {1312},
+}
+
+@INPROCEEDINGS{Chap:05,
+   author = {{Chapman}, M.~G. and {Soderblom}, L.~A. and {Cushing}, G.},
+    title = "{Evidence of Very Young Glacial Processes in Central Candor
+Chasma, Mars}",
+booktitle = {36th Annual Lunar and Planetary Science Conference},
+     year = 2005,
+    pages = {1850},
+}
+
+@INPROCEEDINGS{Fast:05,
+   author = {{Fastook}, J.~L. and {Head}, J.~W. and {Marchant}, D.~R. and
+	{Shean}, D.~E.},
+    title = "{Ice Sheet Modeling: Mass Balance Relationships for
+Map-Plane Ice Sheet Reconstruction: Application to Tharsis Montes
+Glaciation}",
+booktitle = {36th Annual Lunar and Planetary Science Conference},
+     year = 2005,
+    pages = {1212},
+}
+
+rt
+
+@ARTICLE{Neuk:04,
+   author = {{Neukum}, G. and {Jaumann}, R. and {Hoffmann}, H. and {Hauber}, E. and 
+	{Head}, J.~W. and {Basilevsky}, A.~T. and {Ivanov}, B.~A. and 
+	{Werner}, S.~C. and {van Gasselt}, S. and {Murray}, J.~B. and 
+	{McCord}, T. and {HRSC Co-Investigator Team}, T.},
+    title = "{Recent and episodic volcanic and glacial activity on Mars revealed by the High Resolution Stereo Camera}",
+  journal = {Nature},
+     year = 2004,
+   volume = 432,
+    pages = {971-979},
+      doi = {10.1038/nature03231},
+}
+
+@ARTICLE{Pier:03,
+   author = {{Pierce}, T.~L. and {Crown}, D.~A.},
+    title = "{Morphologic and topographic analyses of debris aprons in
+the eastern Hellas region, Mars}",
+  journal = {Icarus},
+     year = 2003,
+   volume = 163,
+    pages = {46-65},
+}
+
+@INPROCEEDINGS{Milk:03,
+   author = {{Milkovich}, S.~M. and {Head}, J.~W.},
+    title = "{Olympus Mons Fan Shaped Deposit Morphology: Evidence for
+Debris Glaciers}",
+booktitle = {Sixth International Conference on Mars},
+     year = 2003,
+    pages = {3149},
+}
+
+@ARTICLE{Rafk:01,
+   author = {{Rafkin}, S.~C.~R. and {Haberle}, R.~M. and {Michaels}, T.~I.
+	},
+    title = "{The Mars Regional Atmospheric Modeling System: Model Description and
+Selected Simulations}",
+  journal = {Icarus},
+     year = 2001,
+   volume = 151,
+    pages = {228-256},
+}
+
+
+@ARTICLE{Tyle:02,
+   author = {{Tyler}, D. and {Barnes}, J.~R. and {Haberle}, R.~M.},
+    title = "{Simulation of surface meteorology at the Pathfinder and VL1 sites using
+a Mars mesoscale model}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2002,
+   volume = 107,
+   number = {E4},
+    pages = {5018},
+}
+
+@ARTICLE{Toig:02,
+   author = {{Toigo}, A.~D. and {Richardson}, M.~I.},
+    title = "{A mesoscale model for the Martian atmosphere}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2002,
+   volume = 107,
+   number = {E12},
+    pages = {5049},
+      doi = {10.1029/2000JE001489},
+}
+
+@ARTICLE{Stam:88,
+ author = {{Stamnes}, K. and {Tsay}, S.-C. and {Jayaweera}, K.  and
+		 {Wiscombe}, W.},
+title = "{Numerically stable algorithm for
+				   discrete-ordinate-method radiative transfer in
+					   multiple scattering and emitting layered media}",
+journal = {Applied Optics},
+year = 1988,
+volume = 27,
+pages = {2502-2509},
+}
+
+@ARTICLE{Evan:98,
+  author = {{Evans}, K.~F.},
+  title = "{The Spherical Harmonics Discrete Ordinate
+		   Method for Three-Dimensional Atmospheric
+		   Radiative Transfer.}",
+  journal = {Journal of Atmospheric Sciences},
+  year = 1998,
+  volume = 55,
+  pages = {429-446},
+}
+
+@ARTICLE{Melc:06,
+   author = {{Melchiorri}, R. and {Drossart}, P. and {Fouchet}, T. and {B{\'e}zard}, B. and 
+	{Forget}, F. and {Gendrin}, A. and {Bibring}, J.~P. and {Manaud}, N. and 
+	{OMEGA Team}},
+    title = "{A simulation of the OMEGA/Mars Express observations: Analysis of the atmospheric
+contribution}",
+  journal = pss,
+     year = 2006,
+   volume = 54,
+    pages = {774-783},
+      doi = {10.1016/j.pss.2006.04.014},
+}
+
+@ARTICLE{Bibr:05,
+   author = {{Bibring}, J.-P. and {Langevin}, Y. and {Gendrin}, A. and {Gondet}, B. and 
+	{Poulet}, F. and {Berth{\'e}}, M. and {Soufflot}, A. and {Arvidson}, R. and 
+	{Mangold}, N. and {Mustard}, J. and {Drossart}, P.},
+    title = "{Mars Surface Diversity as Revealed by the OMEGA/Mars Express Observations}",
+  journal = {Science},
+     year = 2005,
+   volume = 307,
+    pages = {1576-1581},
+      doi = {10.1126/science.1108806},
+}
+
+@ARTICLE{Erar:94,
+   author = {{Erard}, S. and {Mustard}, J. and {Murchie}, S. and {Bibring}, J.-P. and 
+	{Cerroni}, P. and {Caradini}, A.},
+    title = "{Martian aerosols: Near-infrared spectral properties and effects on the observation of the
+surface}",
+  journal = {Icarus},
+     year = 1994,
+   volume = 111,
+    pages = {317-337},
+      doi = {10.1006/icar.1994.1148},
+}
+
+@ARTICLE{Tito:00,
+   author = {{Titov}, D.~V. and {Fedorova}, A.~A. and {Haus}, R.},
+    title = "{A new method of remote sounding of the Martian aerosols by means of spectroscopy in the
+2.7 {$\mu$}m CO$_{2}$ band}",
+  journal = pss,
+     year = 2000,
+   volume = 48,
+    pages = {67-74},
+}
+
+@ARTICLE{Hins:04,
+   author = {{Hinson}, D.~P. and {Smith}, M.~D. and {Conrath}, B.~J.},
+    title = "{Comparison of atmospheric temperatures obtained through infrared sounding and
+radio occultation by Mars Global Surveyor}",
+  journal = jgr,
+     year = 2004,
+   volume = 109,
+   number = {E18},
+    pages = {12002},
+      doi = {10.1029/2004JE002344},
+}
+
+@ARTICLE{Gras:05,
+   author = {{Grassi}, D. and {Fiorenza}, C. and {Zasova}, L.~V. and
+{Ignatiev}, N.~I. and 
+	{Maturilli}, A. and {Formisano}, V. and {Giuranna}, M.},
+    title = "{The Martian atmosphere above great volcanoes: Early
+planetary Fourier spectrometer observations}",
+  journal = pss,
+     year = 2005,
+   volume = 53,
+    pages = {1053-1064},
+      doi = {10.1016/j.pss.2005.02.008},
+}
+
+@ARTICLE{Gras:07,
+   author = {{Grassi}, D. and {Formisano}, V. and {Forget}, F.
+and {Fiorenza}, C. and {Ignatiev}, N.~I. and {Maturilli}, A. and 
+{Zasova}, L.~V.},
+    title = "{The martian atmosphere in the region of Hellas basin as
+	observed by the planetary Fourier spectrometer (PFS-MEX)}",
+  journal = pss,
+     year = 2007,
+	 volume = 55,
+	 pages = {1346-1357},
+		       doi = {10.1016/j.pss.2006.12.006},
+}
+
+@INPROCEEDINGS{Paet:06gra,
+   author = {{P{\"a}tzold}, M. and {Tellmann}, S. and {H{\"a}usler}, B.
+and 
+	{Hinson}, D. and {Tyler}, G.~L.},
+    title = "{Radio-sounding of the neutral martian atmosphere with Mars
+Express: overview of the observations}",
+booktitle = {Mars Atmosphere Modelling and Observations},
+     year = 2006,
+    pages = {132},
+   editor = {Forget et al.},
+}
+
+
+
+@INPROCEEDINGS{Keat:03,
+   author = {{Keating}, G.~M. and {Theriot}, Jr., M. and {Tolson}, R. and
+	{Bougher}, S. and {Forget}, F. and {Forbes}, J.},
+    title = "{Global Measurements of the Mars Upper Atmosphere: In Situ
+Accelerometer Measurements from Mars Odyssey 2001 and Mars Global
+Surveyor}",
+booktitle = {Lunar and Planetary Institute Conference Abstracts},
+     year = 2003,
+   editor = {{Mackwell}, S. and {Stansbery}, E.},
+    pages = {1142},
+}
+
+@ARTICLE{Forb:02,
+   author = {{Forbes}, J.~M. and {Bridger}, A.~F.~C. and {Bougher}, S.~W.
+and 
+	{Hagan}, M.~E. and {Hollingsworth}, J.~L. and {Keating}, G.~M. and 
+	{Murphy}, J.},
+    title = "{Nonmigrating tides in the thermosphere of Mars}",
+  journal = jgr,
+     year = 2002,
+   volume = 107,
+    pages = {23-1},
+      doi = {10.1029/2001JE001582},
+}
+
+
+ 
+@INPROCEEDINGS{Forg:06mcd,
+   author = {{Forget}, F. and {Millour}, E. and {Lebonnois}, S. and {Montabone}, L. and
+   	{Dassas}, K. and {Lewis}, S.~R. and {Read}, P.~L. and {L{\'o}pez-Valverde}, M.~A. and
+	{Gonz{\'a}lez-Galindo}, F. and {Montmessin}, F. and {Lef{\`e}vre}, F. and
+	{Desjean}, M.-C. and {Huot}, J.-P.},
+   title = "{The new Mars climate database}",
+   booktitle = {Mars Atmosphere Modelling and Observations},
+   year = 2006,
+   editor = {{Forget et al.}},
+    pages = {625},
+   adsurl = {http://adsabs.harvard.edu/abs/2006mamo.conf..625G},
+}
+
+
+
+@ARTICLE{Must:05,
+   author = {{Mustard}, J.~F. and {Poulet}, F. and {Gendrin}, A. and {Bibring}, J.-P. and
+  	{Langevin}, Y. and {Gondet}, B. and {Mangold}, N. and {Bellucci}, G. and
+	{Altieri}, F.},
+   title = "{Olivine and Pyroxene Diversity in the Crust of Mars}",
+   journal = sci,
+   year = 2005,
+   volume = 307,
+   pages = {1594-1597},
+   doi = {10.1126/science.1109098},
+}
+
+@ARTICLE{Bell:06,
+   author = {{Bellucci}, G. and {Altieri}, F. and {Bibring}, J.~P. and {Bonello}, G. and
+   	{Langevin}, Y. and {Gondet}, B. and {Poulet}, F.},
+   title = "{OMEGA/Mars Express: Visual channel performances and data reduction techniques}",
+   journal = pss,
+   year = 2006,
+   volume = 54,
+   pages = {675-684},
+   doi = {10.1016/j.pss.2006.03.006},
+}
+
+@INPROCEEDINGS{Gond:06,
+   author = {{Gondet}, B. and {Bibring}, J.-P. and {Langevin}, Y. and {Poulet}, F. and
+   	{Montmessin}, F. and {Forget}, F.},
+   title = "{One martian year observation of H2O ice clouds By OMEGA/Mars Express}",
+   booktitle = {Mars Atmosphere Modelling and Observations},
+   year = 2006,
+   pages = {251},
+   editor = {{Forget et al.}},
+   adsurl = {http://adsabs.harvard.edu/abs/2006mamo.conf..625G},
+}
+
+@ARTICLE{Lang:05,
+   author = {{Langevin}, Y. and {Poulet}, F. and {Bibring}, J.-P. and {Schmitt}, B. and
+   	{Dout{\'e}}, S. and {Gondet}, B.},
+   title = "{Summer Evolution of the North Polar Cap of Mars as Observed by OMEGA/Mars Express}",
+   journal = sci,
+   year = 2005,
+   volume = 307,
+   pages = {1581-1584},
+   doi = {10.1126/science.1109438},
+}
+
+
+@ARTICLE{Bibr:06,
+   author = {{Bibring}, J.-P. and {Langevin}, Y. and {Mustard}, J.~F. and
+   	{Poulet}, F. and {Arvidson}, R. and {Gendrin}, A. and {Gondet}, B. and
+        {Mangold}, N. and {Pinet}, P. and {Forget}, F.},
+   title = "{Global Mineralogical and Aqueous Mars History Derived from OMEGA/Mars Express Data}",
+   journal = sci,
+   year = 2006,
+   volume = 312,
+   pages = {400-404},
+   doi = {10.1126/science.1122659},
+}
+
+@INBOOK{Bibr:04doc,
+   author = {{Bibring}, J.-P. and {Soufflot}, A. and {Berth{\'e}}, M. and 
+   	{Langevin}, Y. and {Gondet}, B. and {Drossart}, P. and {Bouy{\'e}}, M. and 
+	{Combes}, M. and {Puget}, P. and {Semery}, A. and {Bellucci}, G. and 
+	{Formisano}, V. and {Moroz}, V. and {Kottsov}, V. and {Bonello}, G. and 
+	{Erard}, S. and {Forni}, O. and {Gendrin}, A. and {Manaud}, N. and 
+	{Poulet}, F. and {Poulleau}, G. and {Encrenaz}, T. and {Fouchet}, T. and 
+	{Melchiori}, R. and {Altieri}, F. and {Ignatiev}, N. and {Titov}, D. and 
+	{Zasova}, L. and {Coradini}, A. and {Capacionni}, F. and {Cerroni}, P. and 
+	{Fonti}, S. and {Mangold}, N. and {Pinet}, P. and {Schmitt}, B. and 
+	{Sotin}, C. and {Hauber}, E. and {Hoffmann}, H. and {Jaumann}, R. and 
+	{Keller}, U. and {Arvidson}, R. and {Mustard}, J. and {Forget}, F.},
+   title = "{OMEGA: Observatoire pour la Min{\'e}ralogie, l'Eau, les Glaces et l'Activit{\'e}}",
+   publisher = {ESA SP-1240: Mars Express: the Scientific Payload},
+   year = 2004,
+   pages = {37-49},
+}
+
+@misc{Lang:05doc,
+	author = {Langevin, Y.},
+	title = {\protect{OMEGA} software documentation version 3},
+	year = {2005}
+}
+
+@ARTICLE{Wang:02,
+   author = {{Wang}, H. and {Ingersoll}, A.~P.},
+   title = "{Martian clouds observed by Mars Global Surveyor Mars Orbiter Camera}",
+   journal = jgr,
+   year = 2002,
+   volume = 107,
+   pages = {5078-+},
+   doi = {10.1029/2001JE001815},
+}
+
+
+@book{Read:04,
+    author = {{Read}, P.~L. and {Lewis}, S.~R.},
+    publisher = {Springer/Praxis Publishing},
+    title = {The Martian climate revisited: Atmosphere and Environment of a desert planet},
+    year = {2004},
+    adress = "Berlin \ Heidelberg \ New York"
+}
+
+@ARTICLE{Crea:06,
+   author = {{Creasey}, J.~E. and {Forbes}, J.~M. and {Hinson}, D.~P.},
+   title = "{Global and seasonal distribution of gravity wave activity in Mars' lower atmosphere derived from MGS radio occultation data}",
+   journal = grl,
+   year = 2006,
+   volume = 33,
+   pages = {1803},
+  doi = {10.1029/2005GL024037},
+}
+
+@ARTICLE{Vinc:00,
+   author = {{Vincent}, R.~A. and {Alexander}, M.~J.},
+   title = "{Gravity waves in the tropical lower stratosphere: An observational study of seasonal and interannual variability}",
+   journal = jgr,
+   year = 2000,
+   volume = 105,
+   number = 14,
+   pages = {17971-17982},
+   doi = {10.1029/2000JD900196},
+}
+
+@ARTICLE{Plou:03,
+   author = {{Plougonven}, R. and {Teitelbaum}, H. and {Zeitlin}, V.},
+   title = "{Inertia gravity wave generation by the tropospheric midlatitude jet as given by the Fronts and Atlantic 
+	   Storm-Track Experiment radio soundings}",
+   journal = jgr,
+   year = 2003,
+   volume = 108,
+   number = 21,
+   pages = {4686-4704},
+   doi = {10.1029/2003JD003535},
+}
+
+
+@INPROCEEDINGS{Tyle:06,
+   author = {{Tyler}, Jr., D. and {Barnes}, J.~R. and {Skyllingstad}, E.},
+   title = "{A New Large Eddy Simulation Model to Study the Convective Planetary Boundary Layer On Mars}",
+   booktitle = {Mars Atmosphere Modelling and Observations},
+   year = 2006,
+   editor = {{Forget}, F. and {Lopez-Valverde}, M.~A. and {Desjean}, M.~C. and 
+      	{Huot}, J.~P. and {Lefevre}, F. and {Lebonnois}, S. and {Lewis}, S.~R. and 
+	{Millour}, E. and {Read}, P.~L. and {Wilson}, R.~J.},
+   pages = {124},
+}
+
+@ARTICLE{Koff:98,
+   author = {{Koffi}, E. and {B{\'e}nech}, B. and {Stein}, J. and {Terliuc}, B.
+	},
+    title = "{Dynamic Characteristics of Regional Flows around the Pyr{\'e}n{\'e}es in View of the PYREX Experiment. Part II: Solution of a Linear Model Compared to Field Measurements.}",
+  journal = jam,
+    year = 1998,
+    volume = 37,
+    pages = {53-71},
+}
+
+@ARTICLE{Youn:02,
+   author = {{Young}, G.~S. and {Kristovich}, D.~A.~R. and {Hjelmfelt}, M.~R. and
+           {Foster}, R.~C.},
+   title = "{Rolls, Streets, Waves, and More: A Review of Quasi-Two-Dimensional Structures in the Atmospheric Boundary Layer.}",
+   journal = bams,
+   year = 2002,
+   volume = 83,
+   pages = {997-1001},
+}
+
+@ARTICLE{Smit:80,
+   author = {{Smith}, R.~B.},
+    title = "{Linear theory of stratified hydrostatic flow past an isolated mountain}",
+  journal = {Tellus},
+     year = 1980,
+   volume = 32,
+    pages = {348},
+}
+
+@misc{Skam:05,
+	author = {{Skamarock}, W.~C. and  {Klemp}, J.~B. and  {Dudhia}, J. and 
+		{Gill}, D.~O. and {Barker}, D.~M. and {Wang}, W. and {Powers}, J.~G.},
+  	title = "{A description of the Advanced Research \protect{WRF}, version 2.}",
+    	journal = {National Center for Atmospheric Research Technical Note},
+	year = 2005,
+        pages = {468+STR},
+}
+
+@book{Goss:75,
+	author = {{Gossard}, E.~E. and {Hooke}, W.~H.},
+        edition = {first},
+        publisher = {Elsevier Scientific Publishing},
+        series = {Developments in Atmospheric Science},
+	title = "{Waves in the atmosphere: Atmospheric infrasound 
+		and gravity waves - Their generation and propagation}",
+	volume = {2},
+	year = {1975},
+	adress = "Amsterdam - Oxford - New York"
+}
+
+@ARTICLE{Boug:97,
+   author = {{Bougeault}, P. and {Benech}, B. and {Bessemoulin}, P. 
+	   and {Carissimo}, B. and {Jansa Clar}, A. and {Pelon}, J. 
+		   and {Petitdidier}, M. and {Richard}, E.},
+   title = "{PYREX: A Summary of Findings.}",
+   journal = bams,
+   year = 1997,
+   volume = 78,
+   pages = {637-637},
+}
+
+@ARTICLE{Dubu:01,
+   author = {{Dubuisson}, P. and {Borde}, R. 
+	   and {Schmechtig}, C. and {Santer}, R.},
+   title = "{Surface pressure estimates from satellite data in 
+	   the oxygen A-band: Applications to the MOS sensor over land}",
+   journal = jgr,
+   year = 2001,
+   volume = 106,
+   pages = {27277-27286},
+   doi = {10.1029/2001JD000401},
+}
+
+@ARTICLE{Mitc:87,
+   author = {{Mitchell}, R.~M. and {O'Brien}, D.~M.},
+   title = "{Error Estimates for Passive Satellite Measurement 
+	   of Surface Pressure Using Absorption in the A Band of Oxygen.}",
+   journal = jas,
+   year = 1987,
+   volume = 44,
+   pages = {1981-1990},
+}
+
+@ARTICLE{Mont:06luca,
+   author = {{Montabone}, L. and {Lewis}, S.~R. and {Read}, P.~L. and {Hinson}, D.~P.},
+   title = "{Validation of martian meteorological data assimilation for MGS/TES using radio occultation measurements}",
+   journal = {Icarus},
+   year = 2006,
+   volume = 185,
+   pages = {113-132},
+   doi = {10.1016/j.icarus.2006.07.012},
+}
+
+@ARTICLE{Bibr:91,
+   author = {{Bibring}, J.-P. and {Erard}, S. and {Gondet}, B. and
+{Langevin}, Y. and 
+	{Soufflot}, A. and {Combes}, M. and {Cara}, C. and {Drossart},
+P. and 
+	{Encrenaz}, T. and {Lellouch}, E. and {Rosenqvist}, J. and
+{Moroz}, V.~I. and 
+	{Dyachkov}, A.~V. and {Grygoriev}, A.~V. and {Havinson}, N.~G.
+and 
+	{Khatuntsev}, I.~V. and {Kiselev}, A.~V. and {Ksanfomality},
+L.~V. and 
+	{Nikolsky}, Y.~V. and {Masson}, P. and {Forni}, O. and {Sotin},
+C.
+	},
+    title = "{Topography of the Martian tropical regions with
+ISM}",
+  journal = pss,
+     year = 1991,
+   volume = 39,
+    pages = {225-236},
+      doi = {10.1016/0032-0633(91)90146-2},
+}
+
+@INPROCEEDINGS{Smit:06granada,
+   author = {{Smith}, M.~D.},
+    title = "{TES atmospheric temperature, aerosol optical depth, and
+water vapor observations 1999-2004}",
+booktitle = {Mars Atmosphere Modelling and Observations},
+     year = 2006,
+   editor = {{Forget}, F. and {Lopez-Valverde}, M.~A. and {Desjean},
+M.~C. and 
+	{Huot}, J.~P. and {Lefevre}, F. and {Lebonnois}, S. and {Lewis},
+S.~R. and 
+	{Millour}, E. and {Read}, P.~L. and {Wilson}, R.~J.},
+    pages = {211},
+}
+
+@ARTICLE{Zaso:05,
+   author = {{Zasova}, L. and {Formisano}, V. and {Moroz}, V. and
+{Grassi}, D. and 
+	{Ignatiev}, N. and {Giuranna}, M. and {Hansen}, G. and {Blecka}, M.
+and 
+	{Ekonomov}, A. and {Lellouch}, E. and {Fonti}, S. and {Grigoriev}, A.
+and 
+	{Hirsch}, H. and {Khatuntsev}, I. and {Mattana}, A. and {Maturilli},
+A. and 
+	{Moshkin}, B. and {Patsaev}, D. and {Piccioni}, G. and {Rataj}, M.
+and 
+	{Saggin}, B.},
+    title = "{Water clouds and dust aerosols observations with PFS MEX at
+Mars}",
+  journal = pss,
+     year = 2005,
+   volume = 53,
+    pages = {1065-1077},
+      doi = {10.1016/j.pss.2004.12.010},
+}
+
+@ARTICLE{Lebo:06,
+   author = {{Lebonnois}, S. and {Qu{\'e}merais}, E. and {Montmessin},
+F. and 
+	{Lef{\`e}vre}, F. and {Perrier}, S. and {Bertaux}, J.-L. and 
+	{Forget}, F.},
+    title = "{Vertical distribution of ozone on Mars as measured by
+SPICAM/Mars Express using stellar occultations}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+    pages = {9},
+      doi = {10.1029/2005JE002643},
+}
+
+@ARTICLE{Lang:06,
+   author = {{Langevin}, Y. and {Dout{\'e}}, S. and {Vincendon}, M. and
+{Poulet}, F. and 
+	{Bibring}, J.-P. and {Gondet}, B. and {Schmitt}, B. and {Forget}, F.
+	},
+    title = "{No signature of clear {CO$_{2}$} ice from the `cryptic'
+regions in Mars' south seasonal polar cap}",
+  journal = {Nature},
+     year = 2006,
+   volume = 442,
+    pages = {790-792},
+      doi = {10.1038/nature05012},
+}
+
+@ARTICLE{Mont:06franck,
+   author = {{Montmessin}, F. and {Bertaux}, J.-L. and {Qu{\'e}merais}, E. and 
+	{Korablev}, O. and {Rannou}, P. and {Forget}, F. and {Perrier}, S.  and 
+	{Fussen}, D. and {Lebonnois}, S. and {R{\'e}b{\'e}rac}, A. and 
+	{Dimarellis}, E.},
+    title = "{Subvisible {CO$_2$} ice clouds detected in the mesosphere of
+Mars}",
+  journal = {Icarus},
+     year = 2006,
+   volume = 183,
+    pages = {403-410},
+      doi = {10.1016/j.icarus.2006.03.015},
+}
+
+@ARTICLE{Bara:06,
+   author = {{Baratoux}, D. and {Mangold}, N. and {Forget}, F. and
+{Cord}, A. and 
+	{Pinet}, P. and {Daydou}, Y. and {Jehl}, A. and {Masson}, P. and 
+	{Neukum}, G. and {The HRSC Co-Investigator Team}},
+    title = "{The role of the wind-transported dust in slope streaks
+activity: Evidence from the HRSC data}",
+  journal = {Icarus},
+     year = 2006,
+   volume = 183,
+    pages = {30-45},
+      doi = {10.1016/j.icarus.2006.01.023},
+}
+
+@ARTICLE{Forg:06,
+   author = {{Forget}, F. and {Haberle}, R.~M. and {Montmessin}, F. and
+{Levrard}, B. and 
+	{Head}, J.~W.},
+    title = "{Formation of Glaciers on Mars by Atmospheric Precipitation
+at High Obliquity}",
+  journal = {Science},
+     year = 2006,
+   volume = 311,
+    pages = {368-371},
+      doi = {10.1126/science.1120335},
+}
+
+@ARTICLE{Encr:05ica,
+   author = {{Encrenaz}, T. and {B{\'e}zard}, B. and {Owen}, T. and
+{Lebonnois}, S. and 
+	{Lef{\`e}vre}, F. and {Greathouse}, T. and {Richter}, M. and 
+	{Lacy}, J. and {Atreya}, S. and {Wong}, A.~S. and {Forget}, F.  },
+    title = "{Infrared imaging spectroscopy of Mars: H$_{2}$O mapping and
+determination of {CO$_2$} isotopic ratios}",
+  journal = {Icarus},
+     year = 2005,
+   volume = 179,
+    pages = {43-54},
+      doi = {10.1016/j.icarus.2005.06.022},
+}
+
+@ARTICLE{Encr:05aaa,
+   author = {{Encrenaz}, T. and {Melchiorri}, R. and {Fouchet}, T. and
+{Drossart}, P. and 
+	{Lellouch}, E. and {Gondet}, B. and {Bibring}, J.-P. and {Langevin},
+Y. and 
+	{Titov}, D. and {Ignatiev}, N. and {Forget}, F.},
+    title = "{A mapping of martian water sublimation during early
+northern summer using OMEGA/Mars Express}",
+  journal = {Astronomy and Astrophysics},
+     year = 2005,
+   volume = 441,
+    pages = {L9-L12},
+      doi = {10.1051/0004-6361:200500171},
+}
+
+
+@ARTICLE{Suns:90,
+   author = {{Sunshine}, J.~M. and {Pieters}, C.~M. and {Pratt}, S.~F.},
+    title = "{Deconvolution of mineral absorption bands - An improved
+approach}",
+  journal = jgr,
+     year = 1990,
+   volume = 95,
+    pages = {6955-6966},
+}
+
+@INPROCEEDINGS{Kann:05,
+   author = {{Kanner}, L.~C. and {Mustard}, J.~F. and {Bibring}, J.-P.
+and 
+	{Gendrin}, A. and {Langevin}, Y. and {Gondet}, B. and {Pelkey}, S.~M.
+and 
+	{The Omega Science Team}},
+    title = "{Analysis of Martian Pyroxene Compositions in Syrtis Major:
+Full MGM Application to OMEGA}",
+booktitle = {36th Annual Lunar and Planetary Science Conference},
+     year = 2005,
+    pages = {1730},
+}
+
+@ARTICLE{Forg:07omeg,
+   author = {{Forget}, F. and {Spiga}, A. and {Dolla}, B. and {Vinatier}, S. and 
+	{Melchiorri}, R. and {Drossart}, P. and {Gendrin}, A. and {Bibring}, J.-P. and 
+	{Langevin}, Y. and {Gondet}, B.},
+    title = "{Remote sensing of surface pressure on Mars with the Mars Express/OMEGA spectrometer: 1. Retrieval method}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+   number = {E11},
+    pages = {8-+},
+      doi = {10.1029/2006JE002871},
+}
+
+@ARTICLE{Spig:07omeg,
+   author = {{Spiga}, A. and {Forget}, F. and {Dolla}, B. and {Vinatier}, S. and 
+	{Melchiorri}, R. and {Drossart}, P. and {Gendrin}, A. and {Bibring}, J.-P. and 
+	{Langevin}, Y. and {Gondet}, B.},
+    title = "{Remote sensing of surface pressure on Mars with the Mars Express/OMEGA spectrometer: 2. Meteorological maps}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+   number = {E11},
+    pages = {8-+},
+      doi = {10.1029/2006JE002870},
+}
+
+@misc{Forg:07dust,
+   author = {Forget, F. and Dolla, B. and Vinatier, S. and Spiga, A.},
+   howpublished = {submitted to Geophys. Res. Lett.},
+   title = {A very simple algorithm to compute light scattering in optically
+	   thin planetary atmosphere. Application to remote sensing on \protect{M}ars},
+   year = {2010}
+}
+
+
+@ARTICLE{Renn:04,
+   author = {{Renno}, N.~O. and {Abreu}, V.~J. and {Koch}, J. and {Smith}, P.~H. and 
+   	{Hartogensis}, O.~K. and {De Bruin}, H.~A.~R. and {Burose}, D. and 
+	{Delory}, G.~T. and {Farrell}, W.~M. and {Watts}, C.~J. and 
+	{Garatuza}, J. and {Parker}, M. and {Carswell}, A.},
+   title = "{MATADOR 2002: A pilot field experiment on convective plumes and dust devils}",
+   journal = jgr,
+   year = 2004,
+   volume = 109,
+   number = {E18},
+   pages = {7001},
+   doi = {10.1029/2003JE002219},
+}
+
+@misc{Koch:06,
+   author = {{Koch}, J. and {Renno}, N.~O.},
+   howpublished = {submitted to JAS},
+   title = {Interactions between Boundary Layer Convection, Mineral Dust and Solar Radiation},
+   year = {2006}
+}
+
+@misc{Joug:06,
+   author = {{Jouglet}, D. and {Poulet}, F. and {Milliken}, R.~E. and {Mustard}, J.~F.
+	  and {Bibring}, J.-P. and {Langevin}, Y. and {Gondet}, B.
+	  and the \protect{OMEGA} team},
+   howpublished = {submitted to JGR},
+   title = {Hydration state of the Martian surface as seen by \protect{Mars Express OMEGA}. \protect{I} - Analysis
+	   of 3~$\mu$m hydration feature},
+   year = {2006}
+}
+
+@INPROCEEDINGS{Zaso:06,
+   author = {{Zasova}, L.~V. and {Altieri}, F. and {Grassi}, D. and {Bellucci}, G. and 
+   	{Formisano}, V. and {Ignatiev}, N. and {Bibring}, J.-P. and 
+	{Drossart}, P. and {Encrenaz}, T. and {Fouchet}, T. and {The Omega Team}
+	},
+   title = "{Ozone in martian atmosphere from the 1.27 {$\mu$}m O2 Emission: OMEGA/Mars Express measurements}",
+   booktitle = {Mars Atmosphere Modelling and Observations},
+   year = 2006,
+   editor = {{Forget}, F. and {Lopez-Valverde}, M.~A. and {Desjean}, M.~C. and 
+      	{Huot}, J.~P. and {Lefevre}, F. and {Lebonnois}, S. and {Lewis}, S.~R. and 
+	{Millour}, E. and {Read}, P.~L. and {Wilson}, R.~J.},
+   pages = {521},
+}
+
+
+
+@INPROCEEDINGS{Gras:06,
+   author = {{Grassi}, D. and {Wolkenberg}, P. and {Fiorenza}, C. and
+{Formisano}, V. and 
+	{Ignatiev}, N.~I. and {Zasova}, L.~V.},
+    title = "{Studies of the local circulation in the martian atmosphere
+from PFS data}",
+booktitle = {Mars Atmosphere Modelling and Observations},
+     year = 2006,
+   editor = {{Forget}, F. and {Lopez-Valverde}, M.~A. and {Desjean},
+M.~C. and 
+	{Huot}, J.~P. and {Lefevre}, F. and {Lebonnois}, S. and {Lewis},
+S.~R. and 
+	{Millour}, E. and {Read}, P.~L. and {Wilson}, R.~J.},
+    pages = {131},
+}
+
+
+@ARTICLE{Huss:92,
+   author = {{Husson}, N. and {Bonnet}, B. and {Scott}, N.~A. and
+{Chedin}, A.
+	},
+    title = "{Management and Study of Spectroscopic Information-The
+GEISA program}",
+  journal = {Journal of Quantitative Spectroscopy and Radiative
+Transfer},
+     year = 1992,
+   volume = 48,
+    pages = {509-518},
+}
+
+
+@INPROCEEDINGS{Cham:06,
+   author = {{Chamberlain}, S. and {Bailey}, J. and {Walter}, M. and {Simpson}, A. and 
+   	{Crisp}, D.},
+   title = "{Topographic and atmospheric pressure mapping using near infrared imaging and spectral observations of Mars}",
+   booktitle = {Mars Atmosphere Modelling and Observations},
+   year = 2006,
+   editor = {{Forget}, F. and {Lopez-Valverde}, M.~A. and {Desjean}, M.~C. and 
+      	{Huot}, J.~P. and {Lefevre}, F. and {Lebonnois}, S. and {Lewis}, S.~R. and 
+        {Millour}, E. and {Read}, P.~L. and {Wilson}, R.~J.},
+   pages = {146},
+}
+						     
+@ARTICLE{Habe:04,
+   author = {{Haberle}, R.~M. and {Mattingly}, B. and {Titus}, T.~N.},
+    title = "{Reconciling different observations of the $CO_{2}$ ice mass
+loading of the Martian north polar cap}",
+  journal = grl,
+     year = 2004,
+   volume = 31,
+    pages = {5702},
+      doi = {10.1029/2004GL019445},
+}
+
+@ARTICLE{Rafk:03,
+   author = {{Rafkin}, S.~C.~R. and {Michaels}, T.~I.},
+    title = "{Meteorological predictions for 2003 Mars Exploration Rover high-priority landing sites}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2003,
+   volume = 108,
+   number = {E12},
+    pages = {8091},
+      doi = {10.1029/2002JE002027},
+}
+
+@ARTICLE{Toig:03,
+   author = {{Toigo}, A.~D. and {Richardson}, M.~I.},
+   title = "{Meteorology of proposed Mars Exploration Rover landing sites}",
+   journal = jgr,
+   year = 2003,
+   volume = 108,
+   number = {E12},
+   pages = {8092-+},
+   doi = {10.1029/2003JE002064},
+}
+
+@ARTICLE{Gray:66,
+   author = {{Gray}, L.~D.},
+   title = "{Transmission of the Atmosphere of Mars in the Region of 2~$\mu$}",
+   journal = {Icarus},
+   year = 1966,
+   volume = 5,
+   pages = {390},
+}
+
+@ARTICLE{Rafk:02,
+   author = {{Rafkin}, S.~C.~R. and {Sta.~Maria}, M.~R.~V. and {Michaels}, T.~I.},
+   title = "{Simulation of the atmospheric thermal circulation of a martian volcano using a mesoscale numerical model}",
+   journal = {Nature},
+   year = 2002,
+   volume = 419,
+   pages = {697-699},
+}
+
+@ARTICLE{Buch:06,
+   author = {{Buchwitz}, M. and {de Beek}, R. and {No{\"e}l}, S. and {Burrows}, J.~P. and 
+   	{Bovensmann}, H. and {Schneising}, O. and {Khlystova}, I. and 
+	{Bruns}, M. and {Bremer}, H. and {Bergamaschi}, P. and {K{\"o}rner}, S. and 
+	{Heimann}, M.},
+    title = "{Atmospheric carbon gases retrieved from SCIAMACHY by WFM-DOAS: version 0.5 CO and CH4 and impact of calibration improvements on CO2 retrieval}",
+    journal = {Atmospheric Chemistry \& Physics},
+    year = 2006,
+    volume = 6,
+   pages = {2727-2751},
+}
+
+@ARTICLE{Bosc:06,
+   author = {{B{\"o}sch}, H. and {Toon}, G.~C. and {Sen}, B. and {Washenfelder}, R.~A. and 
+   	{Wennberg}, P.~O. and {Buchwitz}, M. and {de Beek}, R. and {Burrows}, J.~P. and 
+	{Crisp}, D. and {Christi}, M. and {Connor}, B.~J. and {Natraj}, V. and 
+	{Yung}, Y.~L.},
+   title = "{Space-based near-infrared CO2 measurements: Testing the Orbiting Carbon Observatory retrieval algorithm and validation concept using SCIAMACHY observations over Park Falls, Wisconsin}",
+   journal = {Journal of Geophysical Research (Atmospheres)},
+   year = 2006,
+   volume = 111,
+   number = {D10},
+   pages = {23302},
+   doi = {10.1029/2006JD007080},
+}
+
+@ARTICLE{Four:06,
+   author = {{Fournier}, N. and {Stammes}, P. and {de Graaf}, M. and {van der A}, R. and 
+   	{Piters}, A. and {Grzegorski}, M. and {Kokhanovsky}, A.},
+   title = "{Improving cloud information over deserts from SCIAMACHY Oxygen A-band measurements}",
+   journal = {Atmospheric Chemistry \& Physics},
+   year = 2006,
+   volume = 6,
+   pages = {163-172},
+}
+
+@ARTICLE{Mich:06,
+   author = {{Michaels}, T.~I. and {Colaprete}, A. and {Rafkin}, S.~C.~R.},
+   title = "{Significant vertical water transport by mountain-induced circulations on Mars}",
+   journal = grl,
+   year = 2006,
+   volume = 33,
+   pages = {L16201},
+   doi = {10.1029/2006GL026562},
+}
+
+@ARTICLE{Janj:01,
+  author = {{Janjic}, Z.~I. and {Gerrity Jr}, J.~P. and {Nickovic},S.},
+  title = "{An alternative approach to nonhydrostatic modeling}",
+  journal = mwr,
+  year = 2001,
+  volume = 129,
+  pages = {1129-1178},
+}
+
+@ARTICLE{Lapr:92,
+  author = {{Laprise}, R},
+  title = "{The Euler Equations of Motion with Hydrostatic Pressure as an Independent Variable}",
+  journal = mwr,
+  year = 1992,
+  volume = 120,
+ pages = {197-207},
+}
+
+@ARTICLE{Stul:76,
+  author = {{Stull}, R.~B.},
+  title = "{Internal Gravity Waves Generated by Penetrative Convection}",
+  journal = jas,
+  year = 1976,
+  volume = 33,
+  pages = {1279-1286},
+}
+
+@ARTICLE{Mich:04,
+   author = {{Michaels}, T.~I. and {Rafkin}, S.~C.~R.},
+   title = "{Large eddy simulation of atmospheric convection on Mars}",
+   journal = qjrms,
+   year = 2004,
+   volume = 128,
+}
+
+@ARTICLE{Wang:03,
+   author = {{Wang}, H. and {Richardson}, M.~I. and {Wilson}, R.~J. and {Ingersoll}, A.~P. and 
+   	{Toigo}, A.~D. and {Zurek}, R.~W.},
+   title = "{Cyclones, tides, and the origin of a cross-equatorial dust storm on Mars}",
+   journal = grl,
+   year = 2003,
+   volume = 30,
+   pages = {1488},
+   doi = {10.1029/2002GL016828},
+}
+
+@ARTICLE{Bart:86,
+   author = {{Barton}, I.~J. and {Scott}, J.~C.},
+    title = "{Remote measurement of surface pressure using absorption in
+the oxygen A-band}",
+  journal = {Applied Optics},
+     year = 1986,
+   volume = 25,
+    pages = {3502-3507},
+}
+
+@ARTICLE{Jacq:03,
+   author = {{Jacquinet-Husson}, N. and {Scott}, N.~A. and {Chedin}, A.
+and 
+	{Garceran}, K. and {Armante}, R. and {Chursin}, A.~A. and {Barbe},
+A. and 
+	{Birk}, M. and {Brown}, L.~R. and {Camy-Peyret}, C. and {Claveau},
+C. and 
+	{Clerbaux}, C. and {Coheur}, P.~F. and {Dana}, V. and {Daumont}, L.
+and 
+	{Debacker-Barilly}, M.~R. and {Flaud}, J.~M. and {Goldman}, A. and 
+	{Hamdouni}, A. and {Hess}, M. and {Jacquemart}, D. and {Kopke}, P.
+and 
+	{Mandin}, J.~Y. and {Massie}, S. and {Mikhailenko}, S. and
+{Nemtchinov}, V. and 
+	{Nikitin}, A. and {Newnham}, D. and {Perrin}, A. and {Perevalov},
+V.~I. and 
+	{Regalia-Jarlot}, L. and {Rublev}, A. and {Schreier}, F. and 
+	{Schult}, I. and {Smith}, K.~M. and {Tashkun}, S.~A. and {Teffo},
+J.~L. and 
+	{Toth}, R.~A. and {Tyuterev}, V.~G. and {Vander Auwera}, J. and 
+	{Varanasi}, P. and {Wagner}, G.},
+    title = "{The 2003 edition of the GEISA/IASI spectroscopic
+database}",
+  journal = {Journal of Quantitative Spectroscopy and Radiative
+Transfer},
+     year = 2005,
+   volume = 95,
+    pages = {429-467},
+}
+
+@ARTICLE{Houw:05,
+   author = {{Houweling}, S. and {Hartmann}, W. and {Aben}, I. and
+{Schrijver}, H. and 
+	{Skidmore}, J. and {Roelofs}, G.-J. and {Breon}, F.-M.},
+    title = "{Evidence of systematic errors in SCIAMACHY-observed CO$_{2}$
+due to aerosols}",
+  journal = {Atmospheric Chemistry \& Physics},
+     year = 2005,
+   volume = 5,
+    pages = {3003-3013},
+}
+
+@ARTICLE{Mont:06jgr,
+   author = {{Montmessin}, F. and {Qu{\'e}merais}, E. and {Bertaux},
+J.~L. and 
+	{Korablev}, O. and {Rannou}, P. and {Lebonnois}, S.},
+    title = "{Stellar occultations at UV wavelengths by the SPICAM
+instrument: Retrieval and analysis of Martian haze profiles}",
+  journal = jgr,
+     year = 2006,
+   volume = 111,
+   number = {E10},
+    pages = {9},
+      doi = {10.1029/2005JE002662},
+}
+
+@ARTICLE{Fedo:06,
+   author = {{Fedorova}, A. and {Korablev}, O. and {Perrier}, S. and {Bertaux}, J.-L. and 
+	   	{Lef{\`e}vre}, F. and {Rodin}, A.},
+   title = "{Observation of O$_{2}$ 1.27~$\mu$m dayglow by SPICAM IR: Seasonal distribution for the first Martian year of Mars Express}",
+   journal = jgr,
+   year = 2006,
+   volume = 111,
+   number = {E10},
+   pages = {9},
+   doi = {10.1029/2006JE002694},
+}
+
+@BOOK{Pres:92,
+   author = {{Press}, W.~H. and {Teukolsky}, S.~A. and {Vetterling},
+W.~T. and 
+	{Flannery}, B.~P.},
+    title = "{Numerical recipes in FORTRAN. The art of scientific
+computing}",
+publisher = {Cambridge University Press},
+     year = 1992,
+}
+
+
+@ARTICLE{Kann:07,
+   author = {{Kanner}, L.~C. and {Mustard}, J.~F. and {Gendrin}, A.},
+    title = "{Assessing the limits of the Modified Gaussian Model for
+remote spectroscopic studies of pyroxenes on Mars}",
+  journal = {Icarus},
+     year = 2007,
+   volume = 187,
+    pages = {442-456},
+      doi = {10.1016/j.icarus.2006.10.025},
+}
+
+ 
+
+@ARTICLE{Jacq:05,
+   author = {{Jacquinet-Husson}, N. and {Scott}, N.~A. and {Chedin}, A.
+and 
+	{Garceran}, K. and {Armante}, R. and {Chursin}, A.~A. and {Barbe}, A.
+and 
+	{Birk}, M. and {Brown}, L.~R. and {Camy-Peyret}, C. and {Claveau}, C.
+and 
+	{Clerbaux}, C. and {Coheur}, P.~F. and {Dana}, V. and {Daumont}, L.
+and 
+	{Debacker-Barilly}, M.~R. and {Flaud}, J.~M. and {Goldman}, A. and 
+	{Hamdouni}, A. and {Hess}, M. and {Jacquemart}, D. and {Kopke}, P.
+and 
+	{Mandin}, J.~Y. and {Massie}, S. and {Mikhailenko}, S. and
+{Nemtchinov}, V. and 
+	{Nikitin}, A. and {Newnham}, D. and {Perrin}, A. and {Perevalov},
+V.~I. and 
+	{Regalia-Jarlot}, L. and {Rublev}, A. and {Schreier}, F. and 
+	{Schult}, I. and {Smith}, K.~M. and {Tashkun}, S.~A. and {Teffo},
+J.~L. and 
+	{Toth}, R.~A. and {Tyuterev}, V.~G. and {Vander Auwera}, J. and 
+	{Varanasi}, P. and {Wagner}, G.},
+    title = "{The 2003 edition of the GEISA/IASI spectroscopic
+database}",
+  journal = {Journal of Quantitative Spectroscopy and Radiative
+Transfer},
+     year = 2005,
+   volume = 95,
+    pages = {429-467},
+}
+
+@ARTICLE{Rega:06,
+   author = {{R{\'e}galia-Jarlot}, L. and {Z{\'e}ninari}, V. and
+{Parvitte}, B. and 
+	{Grossel}, A. and {Thomas}, X. and {von der Heyden}, P. and 
+	{Durry}, G.},
+    title = "{A complete study of the line intensities of four bands of
+CO2 around 1.6 and 2.0 {$\mu$}m: A comparison between Fourier transform
+and diode laser measurements}",
+  journal = {Journal of Quantitative Spectroscopy and Radiative
+Transfer},
+     year = 2006,
+   volume = 101,
+    pages = {325-338},
+}
+
+@ARTICLE{Stam:00,
+   author = {{Stam}, D.~M. and {De Haan}, J.~F. and {Hovenier}, J.~W.
+and 
+	{Aben}, I.},
+    title = "{Detecting radiances in the {O$_{2}$} A band using
+polarization-sensitive satellite instruments with application to the
+Global Ozone Monitoring Experiment}",
+  journal = jgr,
+     year = 2000,
+   volume = 105,
+    pages = {22379-22392},
+      doi = {10.1029/2000JD900313},
+}
+
+@ARTICLE{Stam:99,
+   author = {{Stam}, D.~M. and {De Haan}, J.~F. and {Hovenier}, J.~W.
+and 
+	{Stammes}, P.},
+    title = "{Degree of linear polarization of light emerging from the
+cloudless atmosphere in the oxygen A band}",
+  journal = jgr,
+     year = 1999,
+   volume = 104,
+    pages = {16843-16858},
+      doi = {10.1029/1999JD900159},
+}
+
+@ARTICLE{Wolf:06,
+   author = {{Wolff}, M.~J. and {Smith}, M.~D. and {Clancy}, R.~T. and
+{Spanovich}, N. and 
+	{Whitney}, B.~A. and {Lemmon}, M.~T. and {Bandfield}, J.~L. and 
+	{Banfield}, D. and {Ghosh}, A. and {Landis}, G. and {Christensen},
+P.~R. and 
+	{Bell}, J.~F. and {Squyres}, S.~W.},
+    title = "{Constraints on dust aerosols from the Mars Exploration
+Rovers using MGS overflights and Mini-TES}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+   number = {E10},
+    pages = {12},
+      doi = {10.1029/2006JE002786},
+}
+
+@ARTICLE{Shku:05,
+   author = {{Shkuratov}, Y. and {Kreslavsky}, M. and {Kaydash}, V. and
+{Videen}, G. and 
+	{Bell}, J. and {Wolff}, M. and {Hubbard}, M. and {Noll}, K. and 
+	{Lubenow}, A.},
+    title = "{Hubble Space Telescope imaging polarimetry of Mars during
+the 2003 opposition}",
+  journal = {Icarus},
+     year = 2005,
+   volume = 176,
+    pages = {1-11},
+      doi = {10.1016/j.icarus.2005.01.009},
+}
+
+@ARTICLE{Bone:05,
+   author = {{Bonello}, G. and {Pierre Bibring}, J. and {Soufflot}, A.
+and 
+	{Langevin}, Y. and {Gondet}, B. and {Berth{\'e}}, M. and
+{Carabetian}, C.
+	},
+    title = "{The ground calibration setup of OMEGA and VIRTIS
+experiments: description and performances}",
+  journal = pss,
+     year = 2005,
+   volume = 53,
+    pages = {711-728},
+      doi = {10.1016/j.pss.2005.02.002},
+}
+
+@ARTICLE{Spra:04,
+   author = {{Sprague}, A.~L. and {Boynton}, W.~V. and {Kerry}, K.~E.
+and 
+	{Janes}, D.~M. and {Hunten}, D.~M. and {Kim}, K.~J. and {Reedy},
+R.~C. and 
+	{Metzger}, A.~E.},
+    title = "{Mars' South Polar Ar Enhancement: A Tracer for South Polar
+Seasonal Meridional Mixing}",
+  journal = {Science},
+     year = 2004,
+   volume = 306,
+    pages = {1364-1367},
+      doi = {10.1126/science.1098496},
+}
+
+@ARTICLE{Toth:06,
+   author = {{Toth}, R.~A. and {Brown}, L.~R. and {Miller}, C.~E. and
+{Devi}, V.~M. and 
+	{Benner}, D.~C.},
+    title = "{Line strengths of $^{12}C^{16}O_{2}$: 4550-7000
+cm$^{-1}$}",
+  journal = {Journal of Molecular Spectroscopy},
+     year = 2006,
+   volume = 239,
+    pages = {221-242},
+      doi = {10.1016/j.jms.2006.08.001},
+}
+
+@ARTICLE{Coli:96,
+   author = {{Colina}, L. and {Bohlin}, R.~C. and {Castelli}, F.},
+    title = "{The 0.12-2.5 micron Absolute Flux Distribution of the Sun for
+Comparison With Solar Analog Stars}",
+  journal = {Astronomical Journal },
+     year = 1996,
+   volume = 112,
+    pages = {307},
+      doi = {10.1086/118016},
+}
+
+
+@ARTICLE{Dufr:05,
+   author = {{Dufresne}, J.-L. and {Fournier}, R. and {Hourdin}, C. and
+{Hourdin}, F. },
+title = "{Net Exchange Reformulation of Radiative Transfer in the
+{CO$_{2}$} 15-{$\mu$}m Band on Mars.}",
+journal = {Journal of Atmospheric Sciences},
+year = 2005,
+volume = 62,
+pages = {3303-3319},
+}
+
+@ARTICLE{Wils:07,
+   author = {{Wilson}, R.~J. and {Neumann}, G.~A. and {Smith}, M.~D.},
+    title = "{Diurnal variation and radiative influence of Martian water
+ice clouds}",
+  journal = grl,
+     year = 2007,
+   volume = 34,
+    pages = {2710},
+      doi = {10.1029/2006GL027976},
+}
+
+@ARTICLE{Basu:04,
+   author = {{Basu}, S. and {Richardson}, M.~I. and {Wilson}, R.~J.},
+    title = "{Simulation of the Martian dust cycle with the GFDL Mars
+GCM}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2004,
+   volume = 109,
+   number = {E18},
+    pages = {11006},
+      doi = {10.1029/2004JE002243},
+}
+
+@INPROCEEDINGS{Rich:06,
+   author = {{Richardson}, M.~I. and {Newman}, C.~E. and {Toigo},
+A.~D.},
+    title = "{PlanetWRF - A Flexible, Multi-scale Model For Planetary
+Atmospheres}",
+booktitle = {AAS/Division for Planetary Sciences Meeting Abstracts},
+     year = 2006,
+   volume = 38,
+    pages = {70.04},
+}
+
+@ARTICLE{Hart:05,
+   author = {{Hartogh}, P. and {Medvedev}, A.~S. and {Kuroda}, T. and
+{Saito}, R. and 
+	{Villanueva}, G. and {Feofilov}, A.~G. and {Kutepov}, A.~A. and 
+	{Berger}, U.},
+    title = "{Description and climatology of a new general circulation
+model of the Martian atmosphere}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2005,
+   volume = 110,
+   number = {E9},
+    pages = {11008},
+      doi = {10.1029/2005JE002498},
+}
+
+@ARTICLE{Moud:05,
+   author = {{Moudden}, Y. and {McConnell}, J.~C.},
+    title = "{A new model for multiscale modeling of the Martian
+atmosphere, GM3}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2005,
+   volume = 110,
+   number = {E9},
+    pages = {4001},
+      doi = {10.1029/2004JE002354},
+}
+
+@ARTICLE{Fent:07,
+   author = {{Fenton}, L.~K. and {Geissler}, P.~E. and {Haberle},
+R.~M.},
+    title = "{Global warming and climate forcing by recent albedo
+changes on Mars}",
+  journal = {Nature},
+     year = 2007,
+   volume = 446,
+    pages = {646-649},
+      doi = {10.1038/nature05718},
+}
+
+@ARTICLE{Kahr:06,
+   author = {{Kahre}, M.~A. and {Murphy}, J.~R. and {Haberle}, R.~M.},
+    title = "{Modeling the Martian dust cycle and surface dust
+reservoirs with the NASA Ames general circulation model}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+   number = {E10},
+    pages = {6008},
+      doi = {10.1029/2005JE002588},
+}
+
+
+@ARTICLE{Taka:03,
+   author = {{Takahashi}, Y.~O. and {Fujiwara}, H. and {Fukunishi}, H.
+and 
+	{Odaka}, M. and {Hayashi}, Y.-Y. and {Watanabe}, S.},
+    title = "{Topographically induced north-south asymmetry of the
+meridional circulation in the Martian atmosphere}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2003,
+   volume = 108,
+    pages = {5-1},
+      doi = {10.1029/2001JE001638},
+}
+
+@ARTICLE{Taka:06,
+   author = {{Takahashi}, Y.~O. and {Fujiwara}, H. and {Fukunishi}, H.},
+   title = "{Vertical and latitudinal structure of the migrating diurnal
+tide in the Martian atmosphere: Numerical investigations}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+   number = {E10},
+    pages = {1003},
+      doi = {10.1029/2005JE002543},
+}
+
+@INPROCEEDINGS{Forg:06argon,
+   author = {{Forget}, F. and {Montabone}, L. and {Lebonnois}, S.},
+    title = "{Modelling the non-condensable gas enrichment in the polar
+night}",
+booktitle = {Mars Atmosphere Modelling and Observations},
+     year = 2006,
+   editor = {{Forget}, F. and {Lopez-Valverde}, M.~A. and {Desjean},
+M.~C. and 
+	{Huot}, J.~P. and {Lefevre}, F. and {Lebonnois}, S. and {Lewis},
+S.~R. and 
+	{Millour}, E. and {Read}, P.~L. and {Wilson}, R.~J.},
+    pages = {422},
+}
+
+@ARTICLE{Encr:06,
+   author = {{Encrenaz}, T. and {Fouchet}, T. and {Melchiorri}, R. and
+{Drossart}, P. and 
+	{Gondet}, B. and {Langevin}, Y. and {Bibring}, J.-P. and {Forget},
+F. and 
+	{B{\'e}zard}, B.},
+    title = "{Seasonal variations of the martian CO over Hellas as
+observed by OMEGA/Mars Express}",
+  journal = {Astronomy and Astrophysics},
+     year = 2006,
+   volume = 459,
+    pages = {265-270},
+      doi = {10.1051/0004-6361:20065586},
+}
+
+@ARTICLE{Basu:06,
+  author = {{Basu}, S. and {Wilson}, J. and {Richardson}, M. and
+   {Ingersoll}, A.
+   },
+   title = "{Simulation of spontaneous and variable global
+   dust storms with the GFDL Mars GCM}",
+   journal = {Journal of Geophysical Research (Planets)},
+   year = 2006,
+   volume = 111,
+   number = {E10},
+    pages = {9004},
+   doi = {10.1029/2005JE002660}, 
+   }
+
+
+@ARTICLE{Perr:06,
+   author = {{Perrier}, S. and {Bertaux}, J.~L. and {Lef{\`e}vre}, F. and 
+	{Lebonnois}, S. and {Korablev}, O. and {Fedorova}, A. and 
+{Montmessin}, F.
+	},
+    title = "{Global distribution of total ozone on Mars from SPICAM/MEX UV 
+measurements}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+   number = {E10},
+    pages = {9},
+      doi = {10.1029/2006JE002681},
+}
+
+@ARTICLE{Squy:04,
+author = {{Squyres}, S.~W. and {Grotzinger}, J.~P. and
+   {Arvidson}, R.~E. and 
+   {Bell}, J.~F. and {Calvin}, W. and {Christensen},
+P.~R. and 
+{Clark}, B.~C. and {Crisp}, J.~A. and
+{Farrand}, W.~H. and {Herkenhoff}, K.~E. and 
+{Johnson}, J.~R. and {Klingelh{\"o}fer}, G. and
+{Knoll}, A.~H. and 
+{McLennan}, S.~M. and {McSween}, H.~Y. and
+{Morris}, R.~V. and 
+{Rice}, J.~W. and {Rieder}, R. and
+{Soderblom}, L.~A.},
+    title = "{In Situ Evidence for an
+Ancient Aqueous Environment
+at Meridiani Planum, Mars}",
+journal = {Science},
+      year = 2004,
+      volume = 306,
+      pages = {1709-1714},
+        doi = {10.1126/science.1104559},
+}
+
+
+@ARTICLE{Ansa:06,
+   author = {{Ansan}, V. and {Mangold}, N.},
+       title = "{New observations of Warrego Valles, Mars:
+   Evidence for precipitation and surface runoff}",
+     journal = pss,
+      year = 2006,
+     volume = 54,
+     pages = {219-242},
+       doi = {10.1016/j.pss.2005.12.009},
+}
+
+
+@INPROCEEDINGS{Forg:03,
+   author = {{Forget}, F. and {Haberle}, R.~M. and {Montmessin},
+   F. and {Cha}, S. and 
+   {Marcq}, E. and {Schaeffer}, J. and
+   {Wanherdrick}, Y.},
+       title = "{3D Simulations of the Early Mars
+   Climate with a General Circulation
+   Model}",
+   booktitle = {Third International Conference on
+   Mars Polar Science and Exploration},
+        year = 2003,
+   editor = {{Clifford}, S. and {Doran}, P.  and {Fisher}, D. and {Herd}, C.  },
+       pages = {8070},
+}
+
+@misc{Forg:04,
+   author = {Forget, F. and Bertaux, J.L. },
+   howpublished = {ESA technical report 09-2004},
+   title = {The Martian atmosphere at the time of the Beagle 2 landing: the density was not anomalously low},
+   year = 2004,
+}
+
+@misc{Forg:02mambo,
+   author = {Forget, F. {and the MAMBO team}  },
+   howpublished = {Proposition CNES, 12O pages},
+   title = {MAMBO: Mars atmosphere Microwave Brightness Observer (A
+proposal for the scientific payload onboard the CNES 2007 Premier
+Obiter)
+   },
+   year = 2002,
+}
+
+
+@INPROCEEDINGS{Gonz:06,
+   author = {{Gonz{\'a}lez-Galindo}, F. and {Bougher}, S. and
+{L{\'o}pez-Valverde}, M.~A. and 
+	{Forget}, F. and {Bell}, J.},
+    title = "{Thermal structure of the martian thermosphere: LMD-IAA GCM
+and MTGCM intercomparisons}",
+booktitle = {Mars Atmosphere Modelling and Observations},
+     year = 2006,
+   editor = {{Forget et al.}},
+    pages = {625},
+   adsurl = {http://adsabs.harvard.edu/abs/2006mamo.conf..625G},
+}
+
+@ARTICLE{Boug:90,
+   author = {{Bougher}, S.~W. and {Roble}, R.~G. and {Ridley}, E.~C. and
+	{Dickinson}, R.~E.},
+    title = "{The Mars thermosphere. II - General circulation with
+coupled dynamics and composition}",
+  journal = jgr,
+     year = 1990,
+   volume = 95,
+    pages = {14811-14827},
+}
+
+@ARTICLE{Gonz:05,
+   author = {{Gonz{\'a}lez-Galindo}, F. and {L{\'o}pez-Valverde}, M.~A.
+and {Angelats i Coll}, M. and {Forget}, F.},
+    title = "{Extension of a Martian general circulation model to
+thermospheric altitudes: UV heating and photochemical models}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2005,
+   volume = 110,
+   number = {E9},
+    pages = {9008},
+      doi = {10.1029/2004JE002312},
+}
+
+@INPROCEEDINGS{Forg:05methane,
+   author = {{Forget}, F. and {Haberle}, R.~M. and {Montmessin}, F.},
+    title = "{Spatial Variation of Methane and Other Trace Gases Detected
+on Mars: Interpretation with a General Circulation Model}",
+booktitle = {36th Annual Lunar and Planetary Science Conference},
+     year = 2005,
+   series = {Lunar and Planetary Institute Conference Abstracts},
+   volume = 36,
+   editor = {{Mackwell}, S. and {Stansbery}, E.},
+    pages = {1597},
+}
+
+@INPROCEEDINGS{Forg:05cap,
+   author = {{Forget}, F. and {Levrard}, B. and {Montmessin}, F. and
+{Schmitt}, B. and 
+	{Dout{\'e}}, S. and {Langevin}, Y. and {Bibring}, J.-P.},
+    title = "{Mars Water Ice and Carbon Dioxide Seasonal Polar Caps: GCM
+Modeling and Comparison with Mars Express Omega Observations}",
+booktitle = {36th Annual Lunar and Planetary Science Conference},
+     year = 2005,
+   series = {Lunar and Planetary Institute Conference Abstracts},
+   volume = 36,
+   editor = {{Mackwell}, S. and {Stansbery}, E.},
+    pages = {1605},
+}
+
+@ARTICLE{Form:04,
+   author = {{Formisano}, V. and {Atreya}, S. and {Encrenaz}, T. and
+{Ignatiev}, N. and 
+	{Giuranna}, M.},
+    title = "{Detection of Methane in the Atmosphere of Mars}",
+  journal = {Science},
+     year = 2004,
+   volume = 306,
+    pages = {1758-1761},
+      doi = {10.1126/science.1101732},
+}
+
+@ARTICLE{Kras:04,
+   author = {{Krasnopolsky}, V.~A. and {Maillard}, J.~P. and {Owen},
+T.~C.
+	},
+    title = "{Detection of methane in the martian atmosphere: evidence
+for life?}",
+  journal = {Icarus},
+     year = 2004,
+   volume = 172,
+    pages = {537-547},
+      doi = {10.1016/j.icarus.2004.07.004},
+}
+
+@INPROCEEDINGS{Made:07,
+   author = {{Madeleine}, J.-B. and {Forget}, F. and {Head}, J.~W. and
+{Levrard}, B. and {Montmessin}, F.},
+    title = "{Mars: A Proposed Climatic Scenario for Northern
+Mid-Latitude Glaciation}",
+booktitle = {Lunar and Planetary Institute Conference Abstracts},
+     year = 2007,
+   volume = 38,
+    pages = {1778},
+}
+
+@ARTICLE{Elli:07,
+   author = {{Elliot}, J.~L. and {Person}, M.~J. and {Gulbis}, A.~A.~S.
+and 
+	{Souza}, S.~P. and {Adams}, E.~R. and {Babcock}, B.~A. and
+{Gangestad}, J.~W. and 
+	{Jaskot}, A.~E. and {Kramer}, E.~A. and {Pasachoff}, J.~M. and 
+	{Pike}, R.~E. and {Zuluaga}, C.~A. and {Bosh}, A.~S. and {Dieters},
+S.~W. and 
+	{Francis}, P.~J. and {Giles}, A.~B. and {Greenhill}, J.~G. and 
+	{Lade}, B. and {Lucas}, R. and {Ramm}, D.~J.},
+    title = "{Changes in Pluto's Atmosphere: 1988-2006}",
+  journal = {Astrophys. Jour.},
+     year = 2007,
+   volume = 134,
+    pages = {1-13},
+      doi = {10.1086/517998},
+}
+
+@ARTICLE{Youn:97,
+   author = {{Young}, L.~A. and {Elliot}, J.~L. and {Tokunaga}, A. and
+{de Bergh}, C. and 
+	{Owen}, T.},
+    title = "{Detection of Gaseous Methane on Pluto}",
+  journal = {Icarus},
+     year = 1997,
+   volume = 127,
+    pages = {258},
+      doi = {10.1006/icar.1997.5709},
+}
+
+@ARTICLE{Stro:96,
+   author = {{Young}, L.~A. and {Elliot}, J.~L. and {Tokunaga}, A. and
+{de Bergh}, C. and 
+	{Owen}, T.},
+    title = "{Detection of Gaseous Methane on Pluto}",
+  journal = {Icarus},
+     year = 1997,
+   volume = 127,
+    pages = {258},
+      doi = {10.1006/icar.1997.5709},
+}
+
+@ARTICLE{Elli:03,
+   author = {{Elliot}, J.~L. and {Ates}, A. and {Babcock}, B.~A. and
+{Bosh}, A.~S. and 
+	{Buie}, M.~W. and {Clancy}, K.~B. and {Dunham}, E.~W. and
+{Eikenberry}, S.~S. and 
+	{Hall}, D.~T. and {Kern}, S.~D. and {Leggett}, S.~K. and {Levine},
+S.~E. and 
+	{Moon}, D.-S. and {Olkin}, C.~B. and {Osip}, D.~J. and {Pasachoff},
+J.~M. and 
+	{Penprase}, B.~E. and {Person}, M.~J. and {Qu}, S. and {Rayner},
+J.~T. and 
+	{Roberts}, L.~C. and {Salyk}, C.~V. and {Souza}, S.~P. and {Stone},
+R.~C. and 
+	{Taylor}, B.~W. and {Tholen}, D.~J. and {Thomas-Osip}, J.~E. and 
+	{Ticehurst}, D.~R. and {Wasserman}, L.~H.},
+    title = "{The recent expansion of Pluto's atmosphere}",
+  journal = {Nature},
+     year = 2003,
+   volume = 424,
+    pages = {165-168},
+}
+
+@ARTICLE{Sica:03,
+   author = {{Elliot}, J.~L. and {Ates}, A. and {Babcock}, B.~A. and
+{Bosh}, A.~S. and 
+	{Buie}, M.~W. and {Clancy}, K.~B. and {Dunham}, E.~W. and
+{Eikenberry}, S.~S. and 
+	{Hall}, D.~T. and {Kern}, S.~D. and {Leggett}, S.~K. and {Levine},
+S.~E. and 
+	{Moon}, D.-S. and {Olkin}, C.~B. and {Osip}, D.~J. and {Pasachoff},
+J.~M. and 
+	{Penprase}, B.~E. and {Person}, M.~J. and {Qu}, S. and {Rayner},
+J.~T. and 
+	{Roberts}, L.~C. and {Salyk}, C.~V. and {Souza}, S.~P. and {Stone},
+R.~C. and 
+	{Taylor}, B.~W. and {Tholen}, D.~J. and {Thomas-Osip}, J.~E. and 
+	{Ticehurst}, D.~R. and {Wasserman}, L.~H.},
+    title = "{The recent expansion of Pluto's atmosphere}",
+  journal = {Nature},
+     year = 2003,
+   volume = 424,
+    pages = {165-168},
+}
+
+@ARTICLE{Bull:01,
+   author = {{Bullock}, M.~A. and {Grinspoon}, D.~H.},
+    title = "{The Recent Evolution of Climate on Venus}",
+  journal = {Icarus},
+     year = 2001,
+   volume = 150,
+    pages = {19-37},
+      doi = {10.1006/icar.2000.6570},
+}
+
+@ARTICLE{Bull:96,
+   author = {{Bullock}, M.~A. and {Grinspoon}, D.~H.},
+    title = "{The stability of climate on Venus}",
+  journal = jgr,
+     year = 1996,
+   volume = 101,
+    pages = {7521-7530},
+      doi = {10.1029/95JE03862},
+}
+
+@ARTICLE{Udry:07,
+   author = {{Udry}, S. and {Bonfils}, X. and {Delfosse}, X. and
+{Forveille}, T. and 
+	{Mayor}, M. and {Perrier}, C. and {Bouchy}, F. and {Lovis}, C. and 
+	{Pepe}, F. and {Queloz}, D. and {Bertaux}, J.~-.},
+    title = "{The HARPS search for southern extra-solar planets XI.
+Super-Earths (5 and 8 Earth mass in a 3-planet system}",
+  journal = {Astronomy and Astrophysics, ArXiv e-prints},
+   eprint = {0704.3841},
+     year = 2007,
+   volume = 704,
+}
+
+@ARTICLE{Kalt:05,
+   author = {{Kaltenegger}, L. and {Fridlund}, M.},
+    title = "{The Darwin mission: Search for extra-solar planets}",
+  journal = {Advances in Space Research},
+     year = 2005,
+   volume = 36,
+    pages = {1114-1122},
+      doi = {10.1016/j.asr.2005.05.061},
+}
+
+@ARTICLE{Robe:06,
+   author = {{Robert}, F. and {Chaussidon}, M.},
+    title = "{
+A paleotemperature curve for the Precambrian oceans based on silicon
+isotopes in cherts.
+}",
+  journal = {Nature},
+     year = 2006,
+   volume = 443,
+    pages = {969-973},
+}
+
+
+@ARTICLE{Cola:05,
+   author = {{Colaprete}, A. and {Barnes}, J.~R. and {Haberle}, R.~M.
+and 
+	{Hollingsworth}, J.~L. and {Kieffer}, H.~H. and {Titus}, T.~N.
+	},
+    title = "{Albedo of the south pole on Mars determined by topographic
+forcing of atmosphere dynamics}",
+  journal = {Nature},
+     year = 2005,
+   volume = 435,
+    pages = {184-188},
+      doi = {10.1038/nature03561},
+}
+
+@ARTICLE{Bott:05,
+   author = {{B{\"o}ttger}, H.~M. and {Lewis}, S.~R. and {Read}, P.~L.
+and 
+	{Forget}, F.},
+    title = "{The effects of the martian regolith on GCM water cycle
+simulations}",
+  journal = {Icarus},
+     year = 2005,
+   volume = 177,
+    pages = {174-189},
+      doi = {10.1016/j.icarus.2005.02.024},
+}
+
+@ARTICLE{Bott:04,
+   author = {{B{\"o}ttger}, H.~M. and {Lewis}, S.~R. and {Read}, P.~L.
+and 
+	{Forget}, F.},
+    title = "{The effect of a global dust storm on simulations of the
+Martian water cycle}",
+  journal = grl,
+     year = 2004,
+   volume = 31,
+    pages = {22702},
+      doi = {10.1029/2004GL021137},
+}
+
+
+@ARTICLE{Fouc:07,
+   author = {
+Fouchet,  T. and Lellouch E. and  Ignatiev, N.I. and  {Forget, F.} 
+and  Titov, D.V. and 
+Tschimmel, M. and  Montmessin, F. and  Formisano, V. and  
+Giuranna, M. and  Maturilli A. and Encrenaz, T.
+},
+    title = "{
+Martian water Vapor: Mars Express PFS/LW Observations.
+}",
+  journal = {{\it Icarus}, in press},
+     year = 2007,
+}
+
+@ARTICLE{Levr:07,
+   author = {Levrard, B. and {Forget, F.} and  Montmessin, F. and Laskar,
+J.},
+    title = "{
+Recent formation and evolution of northern Martian polar layered
+deposits as inferred from a Global Climate Model.
+}",
+  journal = {{Jour. Geophys. Res.}, in press},
+     year = 2007,
+}
+
+@ARTICLE{Bert:02,
+   author = {{Bertaux}, J.-L. and {Montmessin}, F.},
+    title = "{Isotopic fractionation through water vapor condensation:
+The Deuteropause, a cold trap for deuterium in the atmosphere of Mars}",
+ journal = jgr,
+     year = 2001,
+   volume = 106,
+    pages = {32879-32884},
+      doi = {10.1029/2000JE001358},
+}
+
+@ARTICLE{Urba:05,
+   author = {{Urban}, J. and {Dassas}, K. and {Forget}, F. and {Ricaud},
+P.
+	},
+    title = "{Retrieval of vertical constituents and temperature
+profiles from passive submillimeter wave limb observations of the
+Martian atmosphere: a feasibility study}",
+  journal = {Applied Optics},
+     year = 2005,
+   volume = 44,
+    pages = {2438-2455},
+}
+
+@ARTICLE{Fouc:00,
+   author = {{Fouchet}, T. and {Lellouch}, E.},
+    title = "{Vapor Pressure Isotope Fractionation Effects in Planetary
+Atmospheres: Application to Deuterium}",
+  journal = {Icarus},
+     year = 2000,
+   volume = 144,
+    pages = {114-123},
+      doi = {10.1006/icar.1999.6264},
+}
+
+
+@ARTICLE{Ange:05,
+   author = {{Angelats i Coll}, M. and {Forget}, F. and {L{\'o}pez-Valverde}, M.~A. and 
+   {Gonz{\'a}lez-Galindo}, F.},
+       title = "{The first Mars thermospheric general circulation model: The Martian atmosphere from the ground to 240 km}",
+         journal = grl,
+      year = 2005,
+     volume = 32,
+         pages = {4201},
+       doi = {10.1029/2004GL021368},
+}
+
+
+
+@ARTICLE{Maga:99,
+   author = {{Magalhaes}, J.~A. and {Schofield}, J.~T. and {Seiff},
+A.
+	},
+    title = "{Results of the Mars Pathfinder atmospheric structure
+investigation}",
+  journal = jgr,
+     year = 1999,
+   volume = 104,
+    pages = {8943-8956},
+      doi = {10.1029/1998JE900041},
+}
+
+@ARTICLE{Arie:87,
+   author = {{Arie}, E. and {Lacome}, N. and {Levy}, A.},
+    title = "{Measurement of $CO_2$ line broadening in the 10.4-micron
+laser transition at low temperatures}",
+  journal = {Applied Optics},
+     year = 1987,
+   volume = 26,
+    pages = {1636-1640},
+}
+
+@ARTICLE{Roth:05,
+   author = {{Rothman}, L.~S. and {Jacquemart}, D. and {Barbe}, A. and
+{Benner}, D.~C. and 
+	{Birk}, M. and {Brown}, L.~R. and {Carleer}, M.~R. and {Chackerian},
+C. and 
+	{Chance}, K. and {Coudert}, L.~H. and {Dana}, V. and {Devi}, V.~M.
+and 
+	{Flaud}, J.~M. and {Gamache}, R.~R. and {Goldman}, A. and
+{Hartmann}, J.~M. and 
+	{Jucks}, K.~W. and {Maki}, A.~G. and {Mandin}, J.~Y. and {Massie},
+S.~T. and 
+	{Orphal}, J. and {Perrin}, A. and {Rinsland}, C.~P. and {Smith},
+M.~A.~H. and 
+	{Tennyson}, J. and {Tolchenov}, R.~N. and {Toth}, R.~A. and 
+	{Vander Auwera}, J. and {Varanasi}, P. and {Wagner}, G.},
+    title = "{The HITRAN 2004 molecular spectroscopic database}",
+  journal = {Journal of Quantitative Spectroscopy and Radiative
+Transfer},
+     year = 2005,
+   volume = 96,
+    pages = {139-204},
+}
+
+@ARTICLE{Obri:97,
+   author = { {O'Brien}, D. M. and  Mitchell, R. M. and  English, S. A. and 
+   Da Costa, G. A. },
+    title = "{
+Airborne Measurements of Air Mass from {O$_2$} A-Band Absorption Spectra
+}",
+  journal = {Jour. of Atmos. and Oceanic Technology},
+     year = 1997,
+   volume = 15,
+    pages = {1272-1286},
+}
+
+@ARTICLE{Cris:04,
+   author = {{Crisp}, D. and {Atlas}, R.~M. and {Breon}, F.-M.
+   and {Brown}, L.~R. and 
+   {Burrows}, J.~P. and {Ciais}, P. and
+   {Connor}, B.~J. and {Doney}, S.~C. and 
+   {Fung}, I.~Y. and {Jacob}, D.~J. and {Miller}, C.~E.
+and {O'Brien}, D. and 
+{Pawson}, S. and {Randerson}, J.~T. and
+{Rayner}, P. and {Salawitch}, R.~J. and 
+{Sander}, S.~P. and {Sen}, B. and {Stephens},
+G.~L. and {Tans}, P.~P. and 
+{Toon}, G.~C. and {Wennberg}, P.~O.
+and {Wofsy}, S.~C. and {Yung}, Y.~L. and 
+{Kuang}, Z. and {Chudasama}, B. and
+{Sprague}, G. and {Weiss}, B. and 
+{Pollock}, R. and {Kenyon}, D. and {Schroll},
+S.},
+    title = "{The Orbiting Carbon Observatory
+(OCO) mission}",
+  journal = {Advances in Space Research},
+       year = 2004,
+      volume = 34,
+      pages = {700-709},
+        doi =
+{10.1016/j.asr.2003.08.062},
+}
+
+@ARTICLE{Boug:06grl,
+   author = {{Bougher}, S.~W. and {Bell}, J.~M. and {Murphy}, J.~R. and
+{Lopez-Valverde}, M.~A. and 
+	{Withers}, P.~G.},
+    title = "{Polar warming in the Mars thermosphere: Seasonal
+variations owing to changing insolation and dust distributions}",
+  journal = grl,
+     year = 2006,
+   volume = 33,
+    pages = {2203-+},
+      doi = {10.1029/2005GL024059},
+}
+
+
+@ARTICLE{Mill:07,
+   author = {{Millour}, E. and Forget, F.  and {Gonz{\'a}lez-Galindo},
+F. and 
+	{Spiga}, A. and {Lewis}, S.~R. and {Montabone}, L. and {Read}, P.~L.
+and 
+	{L{\'o}pez-Valverde}, M.~A. and {Gilli}, G. and {Desjean}, M.-C. and
+
+	{Huot}, J.-P. and {McD/Gcm Development Team}},
+    title = "{The Mars Climate Database (Version 4.2)}",
+  journal = {European Mars Science and Exploration Conference, ESTEC,
+The Netherlands, 12 - 16 November, 2007},
+     year = 2007,
+}
+
+
+@ARTICLE{Boug:07,
+   author = {{Bougher}, S.~W. and {Bell}, J.~M. and {Steers}, B. and
+{Murphy}, J.~R. and 
+	{Keating}, G.~M.},
+    title = "{Winter Polar Warming in the Mars Thermosphere}",
+  journal = {LPI Contributions},
+     year = 2007,
+   volume = 1353,
+    pages = {3027-+},
+}
+
+@INPROCEEDINGS{Keat:07,
+   author = {{Keating}, G.~M. and {Bougher}, S.~W. and {Theriot}, M.~E.
+and 
+	{Tolson}, R.~H. and {Zurek}, R.~W. and {Blanchard}, R.~C. and 
+	{Murphy}, J.~R. and {Bertaux}, J.-L.},
+    title = "{Mars Neutral Upper Atmosphere Temporal and Spatial
+Variations Discovered from the Accelerometer Science Experiment Aboard
+Mars Reconnaissance Orbiter}",
+booktitle = {Lunar and Planetary Institute Conference Abstracts},
+     year = 2007,
+   series = {Lunar and Planetary Institute Conference Abstracts},
+   volume = 38,
+    pages = {2074-+},
+}
+
+@INPROCEEDINGS{Ther:06,
+   author = {{Theriot}, M. and {Keating}, G. and {Blanchard}, R. and
+{Bougher}, S. and 
+	{Zurek}, R. and {Tolson}, R. and {Murphy}, J. and {Forget}, F. and 
+	{Bertaux}, J.},
+    title = "{Interannual Comparison of Temporal and Spatial Structure
+in the Martian Thermosphere from Atmospheric Accelerometer Measurements
+of Mars Reconnaissance Orbiter (MRO) during Aerobraking and Stellar
+Occultation Measurements from the SPICAM Ultraviolet Infrared
+Atmospheric Spectrometer of Mars Express (MEX)}",
+booktitle = {AAS/Division for Planetary Sciences Meeting Abstracts},
+     year = 2006,
+   volume = 38,
+    pages = {73.02},
+}
+
+@ARTICLE{Mont:07clouds,
+   author = {{Montmessin}, F. and {Gondet}, B. and {Bibring}, J.-P. and
+{Langevin}, Y. and 
+	{Drossart}, P. and {Forget}, F. and {Fouchet}, T.},
+    title = "{Hyperspectral imaging of convective {CO$_{2}$} ice clouds in
+the equatorial mesosphere of Mars}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+    pages = {11-+},
+      doi = {10.1029/2007JE002944},
+}
+
+@ARTICLE{Mont:07cap,
+   author = {{Montmessin}, F. and {Haberle}, R.~M. and {Forget}, F. and
+{Langevin}, Y. and 
+	{Clancy}, R.~T. and {Bibring}, J.-P.},
+    title = "{On the origin of perennial water ice at the south pole of
+Mars: A precession-controlled mechanism?}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+   number = {E11},
+    pages = {8-+},
+      doi = {10.1029/2007JE002902},
+}
+
+@ARTICLE{Quem:06,
+   author = {{Qu{\'e}merais}, E. and {Bertaux}, J.-L. and {Korablev}, O.
+and 
+	{Dimarellis}, E. and {Cot}, C. and {Sandel}, B.~R. and {Fussen}, D.
+	},
+    title = "{Stellar occultations observed by SPICAM on Mars Express}",
+ journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+    pages = {9-+},
+      doi = {10.1029/2005JE002604},
+   adsurl = {http://adsabs.harvard.edu/abs/2006JGRE..11109S04Q},
+  adsnote = {Provided by the Smithsonian/NASA Astrophysics Data System}
+}
+
+@ARTICLE{Yosh:96,
+   author = {{Yoshino}, K. and {Esmond}, J.~R. and {Sun}, Y. and
+{Parkinson}, W.~H. and 
+	{Ito}, K. and {Matsui}, T.},
+    title = "{Absorption cross section measurements of carbon dioxide in
+the wavelength region 118.7-175.5 nm and the temperature dependence.}",
+  journal = {Journal of Quantitative Spectroscopy and Radiative
+Transfer},
+     year = 1996,
+   volume = 55,
+    pages = {53-60},
+}
+
+
+@book{Tikh:77,
+   author = {Tikhonov, A. N.  and Arsenin, V. Y. },
+   publisher = {V. H. Winston and Sons (distributed by Wiley, New York)},
+   title = {Solutions of ill posed problems},
+   year = {1977}
+}
+
+@techreport{Thol:06,
+author = {Thollot, P. },
+institution = {Service d'Aeronomie},
+title = {Am{\'e}lioration du traitement des occultations stellaires
+SPICAM},
+type = {L3 Project report},
+year = {2006}
+}
+
+@ARTICLE{Kora:01,
+   author = {{Korablev}, O.~I. and {Bertaux}, J.-L. and {Dubois},
+J.-P.},
+    title = "{Occultation of stars in the UV: Study of the atmosphere of
+Mars}",
+  journal = jgr,
+     year = 2001,
+   volume = 106,
+    pages = {7597-7610},
+      doi = {10.1029/2000JE001298},
+}
+
+@ARTICLE{With:06a,
+   author = {{Withers}, P. and {Smith}, M.~D.},
+    title = "{Atmospheric entry profiles from the Mars Exploration
+Rovers Spirit and Opportunity}",
+  journal = {Icarus},
+     year = 2006,
+   volume = 185,
+    pages = {133-142},
+      doi = {10.1016/j.icarus.2006.06.013},
+}
+
+@ARTICLE{Smit:06,
+   author = {{Smith}, M.~D. and {Wolff}, M.~J. and {Spanovich}, N. and
+{Ghosh}, A. and 
+	{Banfield}, D. and {Christensen}, P.~R. and {Landis}, G.~A. and 
+	{Squyres}, S.~W.},
+    title = "{One Martian year of atmospheric observations using MER
+Mini-TES}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+   number = {E10},
+    pages = {12-+},
+      doi = {10.1029/2006JE002770},
+}
+
+@ARTICLE{Wils:02,
+   author = {{Wilson}, R.~J.},
+    title = "{Evidence for nonmigrating thermal tides in the Mars upper
+atmosphere from the Mars Global Surveyor Accelerometer Experiment}",
+  journal = grl,
+     year = 2002,
+   volume = 29,
+    pages = {24-1},
+}
+
+@ARTICLE{Lope:98,
+   author = {{L{\'o}pez-Valverde}, M.~A. and {Edwards}, D.~P. and
+{L{\'o}pez-Puertas}, M. and 
+	{Rold{\'a}n}, C.},
+    title = "{Non-local thermodynamic equilibrium in general circulation
+models of the Martian atmosphere 1. Effects of the local thermodynamic
+equilibrium approximation on thermal cooling and solar heating}",
+  journal = jgr,
+     year = 1998,
+   volume = 103,
+    pages = {16799-16812},
+      doi = {10.1029/98JE01601},
+}
+
+@ARTICLE{Boug:94,
+   author = {{Bougher}, S.~W. and {Hunten}, D.~M. and {Roble}, R.~G.},
+    title = "{CO2 cooling in terrestrial planet thermospheres}",
+  journal = jgr,
+     year = 1994,
+   volume = 99,
+    pages = {14609-+},
+}
+
+@ARTICLE{Boug:99,
+   author = {{Bougher}, S.~W. and {Engel}, S. and {Roble}, R.~G. and
+{Foster}, B.
+	},
+    title = "{Comparative terrestrial planet thermospheres 2. Solar
+cycle variation of global structure and winds at equinox}",
+  journal = jgr,
+     year = 1999,
+   volume = 104,
+    pages = {16591-16611},
+      doi = {10.1029/1998JE001019},
+}
+
+@misc{Lope:01,
+   author = {Lopez-Valverde, M. A. and Lopez-Puertas, M.},
+   howpublished = {{ESA contract 11369 technical report}},
+   title = {
+Amospheric non-LTE effects and their parameterization for Mars
+},
+   year = {2001}
+}
+
+@ARTICLE{Stew:92,
+   author = {{Stewart}, A.~I.~F. and {Alexander}, M.~J. and {Meier},
+R.~R. and 
+	{Paxton}, L.~J. and {Bougher}, S.~W. and {Fesen}, C.~G.},
+    title = "{Atomic oxygen in the Martian thermosphere}",
+  journal = jgr,
+     year = 1992,
+   volume = 97,
+    pages = {91-102},
+}
+
+@ARTICLE{Nair:94,
+   author = {{Nair}, H. and {Allen}, M. and {Anbar}, A.~D. and {Yung},
+Y.~L. and 
+	{Clancy}, R.~T.},
+    title = "{A photochemical model of the martian atmosphere}",
+  journal = {Icarus},
+     year = 1994,
+   volume = 111,
+    pages = {124-150},
+      doi = {10.1006/icar.1994.1137},
+}
+
+@INPROCEEDINGS{Lope:06,
+   author = {{L{\'o}pez-Valverde}, M.~A. and {Gonz{\'a}lez-Galindo}, F.
+and 
+	{Forget}, F.},
+    title = "{1-D and 3-D modelling of the upper atmosphere of Mars}",
+booktitle = {Mars Atmosphere Modelling and Observations},
+     year = 2006,
+   editor = {{Forget}, F. and {Lopez-Valverde}, M.~A. and {Desjean},
+M.~C. and 
+	{Huot}, J.~P. and {Lefevre}, F. and {Lebonnois}, S. and {Lewis},
+S.~R. and 
+	{Millour}, E. and {Read}, P.~L. and {Wilson}, R.~J.},
+    pages = {623-+},
+}
+
+@ARTICLE{Stat:00,
+   author = {{States}, R.~J. and {Gardner}, C.~S.},
+    title = "{Thermal Structure of the Mesopause Region (80-105 km) at
+{40$^\circ$N} Latitude. Part I: Seasonal Variations.}",
+  journal = {Journal of Atmospheric Sciences},
+     year = 2000,
+   volume = 57,
+    pages = {66-77},
+}
+
+@ARTICLE{Mccl:07,
+   author = {{McCleese}, D.~J. and {Schofield}, J.~T. and {Taylor},
+F.~W. and 
+	{Calcutt}, S.~B. and {Foote}, M.~C. and {Kass}, D.~M. and {Leovy},
+C.~B. and 
+	{Paige}, D.~A. and {Read}, P.~L. and {Zurek}, R.~W.},
+    title = "{Mars Climate Sounder: An investigation of thermal and
+water vapor structure, dust and condensate distributions in the
+atmosphere, and energy balance of the polar regions}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+   number = {E11},
+    pages = {5-+},
+      doi = {10.1029/2006JE002790},
+}
+
+@ARTICLE{Vonz:96,
+   author = {{von Zahn}, U. and {H{\"o}ffner}, J.},
+    title = "{Mesopause temperature profiling by potassium lidar}",
+  journal = grl,
+     year = 1996,
+   volume = 23,
+    pages = {141-144},
+      doi = {10.1029/95GL03688},
+}
+
+@ARTICLE{Sels:07,
+   author = {{Selsis}, F. and {Kasting}, J.~F. and {Levrard}, B. and
+{Paillet}, J. and 
+	{Ribas}, I. and {Delfosse}, X.},
+    title = "{Habitable planets around the star Gliese 581?}",
+  journal = {Astronomy and Astrophysics},
+     year = 2007,
+   volume = 476,
+    pages = {1373-1387},
+      doi = {10.1051/0004-6361:20078091},
+}
+
+@ARTICLE{Bert:06,
+   author = {{Bertaux}, J.-L. and {Korablev}, O. and {Perrier}, S. and
+{Qu{\'e}merais}, E. and 
+	{Montmessin}, F. and {Leblanc}, F. and {Lebonnois}, S. and {Rannou},
+P. and 
+	{Lef{\`e}vre}, F. and {Forget}, F. and {Fedorova}, A. and
+{Dimarellis}, E. and 
+	{Reberac}, A. and {Fonteyn}, D. and {Chaufray}, J.~Y. and {Guibert},
+S.
+	},
+    title = "{SPICAM on Mars Express: Observing modes and overview of UV
+spectrometer data and scientific results}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+   number = {E10},
+    pages = {10-+},
+      doi = {10.1029/2006JE002690},
+}
+
+@ARTICLE{Toma:99,
+   author = {{Tomasko}, M.~G. and {Doose}, L.~R. and {Lemmon}, M. and
+{Smith}, P.~H. and 
+	{Wegryn}, E.},
+    title = "{Properties of dust in the Martian atmosphere from the
+Imager on Mars Pathfinder}",
+  journal = jgr,
+     year = 1999,
+   volume = 104,
+    pages = {8987-9008},
+      doi = {10.1029/1998JE900016},
+}
+
+@ARTICLE{Gras:00,
+   author = {{Grassi}, D. and {Formisano}, V.},
+    title = "{IRIS Mariner 9 data revisited:2. Aerosol dust
+composition}",
+  journal = pss,
+     year = 2000,
+   volume = 48,
+    pages = {577-598},
+}
+
+@ARTICLE{Hami:05,
+   author = {{Hamilton}, V.~E. and {McSween}, H.~Y. and {Hapke}, B.},
+    title = "{Mineralogy of Martian atmospheric dust inferred from
+thermal infrared spectra of aerosols}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2005,
+   volume = 110,
+    pages = {12006-+},
+      doi = {10.1029/2005JE002501},
+}
+
+@INPROCEEDINGS{Hans:03,
+   author = {{Hansen}, G.~B.},
+    title = "{Infrared Optical Constants of Martian Dust Derived from
+Martian Spectra}",
+booktitle = {Sixth International Conference on Mars},
+     year = 2003,
+   editor = {{Albee}, A.},
+    pages = {3194-+},
+}
+
+@ARTICLE{Wolf:03,
+   author = {{Wolff}, M.~J. and {Clancy}, R.~T.},
+    title = "{Constraints on the size of Martian aerosols from Thermal
+Emission Spectrometer observations}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2003,
+   volume = 108,
+    pages = {5097-+},
+      doi = {10.1029/2003JE002057},
+}
+
+@ARTICLE{Bell:00,
+   author = {{Bell}, J.~F. and {McSween}, H.~Y. and {Crisp}, J.~A. and
+{Morris}, R.~V. and 
+	{Murchie}, S.~L. and {Bridges}, N.~T. and {Johnson}, J.~R. and 
+	{Britt}, D.~T. and {Golombek}, M.~P. and {Moore}, H.~J. and 
+	{Ghosh}, A. and {Bishop}, J.~L. and {Anderson}, R.~C. and
+{Br{\"u}ckner}, J. and 
+	{Economou}, T. and {Greenwood}, J.~P. and {Gunnlaugsson}, H.~P. and 
+	{Hargraves}, R.~M. and {Hviid}, S. and {Knudsen}, J.~M. and 
+	{Madsen}, M.~B. and {Reid}, R. and {Rieder}, R. and {Soderblom}, L.
+	},
+    title = "{Mineralogic and compositional properties of Martian soil
+and dust: Results from Mars Pathfinder}",
+  journal = jgr,
+     year = 2000,
+   volume = 105,
+    pages = {1721-1756},
+      doi = {10.1029/1999JE001060},
+}
+ 
+@ARTICLE{Morr:06b,
+   author = {{Morris}, R.~V. and {Klingelh{\"o}fer}, G. and
+{Schr{\"o}der}, C. and 
+	{Rodionov}, D.~S. and {Yen}, A. and {Ming}, D.~W. and {de Souza},
+P.~A. and 
+	{Wdowiak}, T. and {Fleischer}, I. and {Gellert}, R. and {Bernhardt},
+B. and 
+	{Bonnes}, U. and {Cohen}, B.~A. and {Evlanov}, E.~N. and {Foh}, J.
+and 
+	{G{\"u}tlich}, P. and {Kankeleit}, E. and {McCoy}, T. and
+{Mittlefehldt}, D.~W. and 
+	{Renz}, F. and {Schmidt}, M.~E. and {Zubkov}, B. and {Squyres}, S.~W.
+and 
+	{Arvidson}, R.~E.},
+    title = "{M{\"o}ssbauer mineralogy of rock, soil, and dust at
+Meridiani Planum, Mars: Opportunity's journey across sulfate-rich
+outcrop, basaltic sand and dust, and hematite lag deposits}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+    pages = {12-+},
+      doi = {10.1029/2006JE002791},
+}
+
+@ARTICLE{Morr:06a,
+   author = {{Morris}, R.~V. and {Klingelh{\"o}fer}, G. and
+{Schr{\"o}der}, C. and 
+	{Rodionov}, D.~S. and {Yen}, A. and {Ming}, D.~W. and {de Souza},
+P.~A. and 
+	{Fleischer}, I. and {Wdowiak}, T. and {Gellert}, R. and {Bernhardt},
+B. and 
+	{Evlanov}, E.~N. and {Zubkov}, B. and {Foh}, J. and {Bonnes}, U. and
+	{Kankeleit}, E. and {G{\"u}tlich}, P. and {Renz}, F. and {Squyres},
+S.~W. and 
+	{Arvidson}, R.~E.},
+    title = "{M{\"o}ssbauer mineralogy of rock, soil, and dust at Gusev
+crater, Mars: Spirit's journey through weakly altered olivine basalt on
+the plains and pervasively altered basalt in the Columbia Hills}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+    pages = {2-+},
+      doi = {10.1029/2005JE002584},
+}
+
+@ARTICLE{Goetz:05,
+   author = {{Goetz}, W. and {Bertelsen}, P. and {Binau}, C.~S. and
+{Gunnlaugsson}, H.~P. and 
+	{Hviid}, S.~F. and {Kinch}, K.~M. and {Madsen}, D.~E. and {Madsen},
+M.~B. and 
+	{Olsen}, M. and {Gellert}, R. and {Klingelh{\"o}fer}, G. and 
+	{Ming}, D.~W. and {Morris}, R.~V. and {Rieder}, R. and {Rodionov},
+D.~S. and 
+	{de Souza}, P.~A. and {Schr{\"o}der}, C. and {Squyres}, S.~W. and 
+	{Wdowiak}, T. and {Yen}, A.},
+    title = "{Indication of drier periods on Mars from the chemistry and
+mineralogy of atmospheric dust}",
+  journal = {Nature},
+     year = 2005,
+   volume = 436,
+    pages = {62-65},
+      doi = {10.1038/nature03807},
+}
+
+@ARTICLE{Mart:95,
+   author = {{Martin}, T.~Z.},
+    title = "{Mass of dust in the Martian atmosphere}",
+  journal = jgr,
+     year = 1995,
+   volume = 100,
+    pages = {7509-7512},
+}
+
+@ARTICLE{Neuk:07,
+   author = {{Neukum}, G. and {Behnke}, T. and 
+	   	{Duxbury}, T.~C. and {Eichentopf}, K. and {Flohrer}, J. and 
+		{Gasselt}, S.~V. and {Giese}, B. and {Gwinner}, K. and {Hauber}, E. and 
+		{Hoffmann}, H. and {Hoffmeister}, A. and {K{\"o}hler}, U. and 
+		{Matz}, K.-D. and {McCord}, T.~B. and {Mertens}, V. and {Oberst}, J. and 
+		{Pischel}, R. and {Reiss}, D. and {Ress}, E. and {Roatsch}, T. and 
+		{Saiger}, P. and {Scholten}, F. and {Schwarz}, G. and {Stephan}, K. and 
+		{W{\"a}hlisch}, M.},
+    title = "{The high-resolution stereo camera (HRSC) experiment on Mars Express: Instrument aspects and experiment conduct from interplanetary cruise through the nominal mission}",
+    journal = pss,
+    year = 2007,
+    volume = 55,
+    pages = {928-952},
+    doi = {10.1016/j.pss.2006.12.003},
+}
+
+@ARTICLE{Mcew:07,
+  author = {{McEwen}, A.~S. and {Eliason}, E.~M. and {Bergstrom}, J.~W. and 
+   	{Bridges}, N.~T. and {Hansen}, C.~J. and {Delamere}, W.~A. and 
+	{Grant}, J.~A. and {Gulick}, V.~C. and {Herkenhoff}, K.~E. and 
+	{Keszthelyi}, L. and {Kirk}, R.~L. and {Mellon}, M.~T. and {Squyres}, S.~W. and 
+	{Thomas}, N. and {Weitz}, C.~M.},
+  title = "{Mars Reconnaissance Orbiter's High Resolution Imaging Science Experiment (HiRISE)}",
+  journal = jgr,
+  year = 2007,
+  volume = 112,
+  number = {E11},
+  pages = {5-+},
+  doi = {10.1029/2005JE002605},
+}
+
+@ARTICLE{Murc:07,
+   author = {{Murchie}, S. and {Arvidson}, R. and {Bedini}, P. and {Beisser}, K. and 
+   	{Bibring}, J.-P. and {Bishop}, J. and {Boldt}, J. and {Cavender}, P. and 
+	{Choo}, T. and {Clancy}, R.~T. and {Darlington}, E.~H. and {Des Marais}, D. and 
+	{Espiritu}, R. and {Fort}, D. and {Green}, R. and {Guinness}, E. and 
+	{Hayes}, J. and {Hash}, C. and {Heffernan}, K. and {Hemmler}, J. and 
+	{Heyler}, G. and {Humm}, D. and {Hutcheson}, J. and {Izenberg}, N. and 
+	{Lee}, R. and {Lees}, J. and {Lohr}, D. and {Malaret}, E. and 
+	{Martin}, T. and {McGovern}, J.~A. and {McGuire}, P. and {Morris}, R. and 
+	{Mustard}, J. and {Pelkey}, S. and {Rhodes}, E. and {Robinson}, M. and 
+	{Roush}, T. and {Schaefer}, E. and {Seagrave}, G. and {Seelos}, F. and 
+	{Silverglate}, P. and {Slavney}, S. and {Smith}, M. and {Shyong}, W.-J. and 
+	{Strohbehn}, K. and {Taylor}, H. and {Thompson}, P. and {Tossman}, B. and 
+	{Wirzburger}, M. and {Wolff}, M.},
+   title = "{Compact Reconnaissance Imaging Spectrometer for Mars (CRISM) on Mars Reconnaissance Orbiter (MRO)}",
+   journal = {Journal of Geophysical Research (Planets)},
+   year = 2007,
+   volume = 112,
+   number = {E11},
+   pages = {5-+},
+   doi = {10.1029/2006JE002682},
+}
+
+@book{Kond:65,
+	author = {Kondratyev , K.~Y.},
+	publisher = {Pergamon Press, Oxford},
+	title = {Radiative heat exchange in the atmosphere},
+	year = {1965},
+}
+
+@article{Dozi:90,
+	author = {{Dozier}, J. and {Frew}, J.}, 
+	title = "{Rapid calculation of terrain parameters for radiation modeling from digital elevation data}", 
+	journal = {\protect{IEEE} Transactions on Geoscience and Remote Sensing},
+	year = 1990,
+	volume =  28,
+	number = 5, 
+	pages = {963-969},
+}
+
+@article{Hay:85,
+	author = {Hay, J.~E. and McKay, D.~C.}, 
+	title = "{Estimating Solar Irradiance on Inclined Surfaces: A Review and Assessment of Methodologies}", 
+	journal = {International Journal of Sustainable Energy},
+	year = 1985,
+	volume =  {3-4},
+	pages = {203-240},
+}
+
+@book{Mune:04,
+	author = {Muneer, T.},
+	publisher = {Butterworth-Heinemann},
+	title = {Solar Radiation and Daylight Models},
+	year = {2004}
+}
+
+@book{Capd:88,
+	author = {Capderou, M.},
+	publisher = {Office des publications universitaires, Alger},
+	title = {Atlas solaire de l'Alg\'erie},
+	year = {1988}
+}
+
+@article{Sand:97,
+	author = {Sandmeier, S. and Itten, K.~I.}, 
+	title = "{A physically-based model to correct atmospheric and illumination effects in optical satellite data of rugged terrain}", 
+	journal = {\protect{IEEE} Transactions on Geoscience and Remote Sensing},
+	year = 1997,
+	volume = 35,
+	number = 3, 
+	pages = {708-717},
+	doi={10.1109/36.581991},
+}
+ 
+@INPROCEEDINGS{Hay:78,
+	author = {Hay, J.~E. and Davies, J.~A.},
+        title = "{Calculation of the solar radiation incident on an inclined surface}",
+	booktitle = {Proc. First Canadian Solar Radiation Data Workshop},
+	year = 1978,
+	pages = {59-72},
+	editor = {{Hay, J.~E. and Won, T.~K., Toronto, Ontario, Canada}},
+}
+
+@ARTICLE{Bird:86,
+   author = {{Bird}, R.~E. and {Riordan}, C.},
+   title = "{Simple Solar Spectral Model for Direct and Diffuse Irradiance on Horizontal and Tilted Planes at the Earth's Surface for Cloudless Atmospheres}",
+   journal = {Journal of Applied Meteorology},
+   year = 1986,
+   volume = 25,
+   pages = {87-97},
+}
+
+@article{Pere:90,
+  title={{Modeling daylight availability and irradiance components from direct and global irradiance}},
+  author={Perez, R. and Ineichen, P. and Seals, R. and Michalsky, J. and Stewart, R.},
+  journal={Solar Energy},
+  volume={44},
+  number={5},
+  pages={271--289},
+  year={1990}
+}
+
+@ARTICLE{Li:00,
+   author = {Li, D.~H.~W. and Lam, J.~C.},
+   title = "{Evaluation of slope irradiance and illuminance models against measured Hong Kong data}",
+   journal = {Building and Environment},
+   year = 2000,
+   volume = 35,
+   number=6,
+   pages = {501-509},
+}
+
+@ARTICLE{Kluc:79,
+   author = {Klucher, T.~M.},
+   title = "{Evaluation of models to predict insolation on tilted surfaces}",
+   journal = {Solar Energy},
+   year = 1979,
+   volume = 23,
+   pages = {111-114},
+}
+
+@ARTICLE{Tran:04,
+   author = {Tran, T.~T. and Rannou, P.},
+   title = "{Comparing 3D spherical Monte-Carlo and 2-stream parallel plane simulation of far-field backscattering image of Titan}",
+   journal = {Notes du Pole de Plan\'etologie IPSL},
+   year = 2004,
+}
+
+@ARTICLE{Mull:05,
+   author = {M{\"u}ller, M.~D. and Scherer, D.},
+   title = "{A Grid and Subgrid Scale Radiation Parameterization of Topographic Effects for Mesoscale Weather Forecast Models}",
+   journal = mwr,
+   year = 2005,
+   volume = 133,
+   pages = {1431-1442}
+}
+
+@ARTICLE{Senk:07,
+   author = {{Senkova}, A.~V. and {Rontu}, L. and {Savij{\"a}rvi}, H.},
+    title = "{Parametrization of orographic effects on surface radiation in HIRLAM}",
+  journal = {Tellus Series A},
+     year = 2007,
+   volume = 59,
+    pages = {279-291},
+      doi = {10.1111/j.1600-0870.2007.00235.x},
+}
+
+@ARTICLE{Savi:05,
+   author = {{Savij{\"a}rvi}, H. and {Crisp}, D. and {Harri}, A.-M.},
+    title = "{Effects of CO2 and dust on present-day solar radiation and climate on Mars}",
+  journal = {Quarterly Journal of the Royal Meteorological Society},
+     year = 2005,
+   volume = 131,
+    pages = {2907-2922},
+}
+
+@ARTICLE{Beye:03,
+   author = {{Beyer}, R.~A. and {McEwen}, A.~S. and {Kirk}, R.~L.},
+    title = "{Meter-scale slopes of candidate MER landing sites from point photoclinometry}",
+  journal = jgr,
+     year = 2003,
+   volume = 108,
+    pages = {8085-+},
+      doi = {10.1029/2003JE002120},
+}
+
+@ARTICLE{Ahar:06,
+   author = {{Aharonson}, O. and {Schorghofer}, N.},
+    title = "{Subsurface ice on Mars with rough topography}",
+  journal = jgr,
+     year = 2006,
+   volume = 111,
+   number = {E10},
+    pages = {11007-+},
+      doi = {10.1029/2005JE002636},
+}
+
+@ARTICLE{Golo:03,
+   author = {{Golombek}, M.~P. and {Grant}, J.~A. and {Parker}, T.~J. and 
+	{Kass}, D.~M. and {Crisp}, J.~A. and {Squyres}, S.~W. and {Haldemann}, A.~F.~C. and 
+	{Adler}, M. and {Lee}, W.~J. and {Bridges}, N.~T. and {Arvidson}, R.~E. and 
+	{Carr}, M.~H. and {Kirk}, R.~L. and {Knocke}, P.~C. and {Roncoli}, R.~B. and 
+	{Weitz}, C.~M. and {Schofield}, J.~T. and {Zurek}, R.~W. and 
+	{Christensen}, P.~R. and {Fergason}, R.~L. and {Anderson}, F.~S. and 
+	{Rice}, J.~W.},
+    title = "{Selection of the Mars Exploration Rover landing sites}",
+  journal = jgr,
+     year = 2003,
+   volume = 108,
+    pages = {8072-+},
+      doi = {10.1029/2003JE002074},
+}
+
+@ARTICLE{Wils:08,
+   author = {{Wilson}, R.~J. and {Lewis}, S.~R. and {Montabone}, L. and
+{Smith}, M.~D.
+	},
+    title = "{Influence of water ice clouds on Martian tropical
+atmospheric temperatures}",
+  journal = grl,
+     year = 2008,
+   volume = 35,
+    pages = {7202-+},
+      doi = {10.1029/2007GL032405},
+}
+
+@ARTICLE{Scho:06,
+   author = {{Schorghofer}, N. and {Edgett}, K.~S.},
+   title = "{Seasonal surface frost at low latitudes on Mars}",
+   journal = {Icarus},
+   year = 2006,
+   volume = 180,
+   pages = {321-334},
+   doi = {10.1016/j.icarus.2005.08.022},
+}
+
+@ARTICLE{Ye:90,
+   author = {{Ye}, Z.~J. and {Segal}, M. and {Pielke}, R.~A.},
+    title = "{A comparative study of daytime thermally induced upslope flow on Mars and earth}",
+  journal = {Journal of Atmospheric Sciences},
+     year = 1990,
+   volume = 47,
+    pages = {612-628},
+}
+
+@INPROCEEDINGS{Siil:06,
+   author = {{Siili}, T. and {J{\"a}rvenoja}, S. and {Kauhanen}, J. and {Savij{\"a}rvi}, H.
+	},
+    title = "{Mars limited area model: status report}",
+booktitle = {Mars Atmosphere Modelling and Observations},
+     year = 2006,
+   editor = {{Forget}, F. and {Lopez-Valverde}, M.~A. and {Desjean}, M.~C. and 
+	{Huot}, J.~P. and {Lefevre}, F. and {Lebonnois}, S. and {Lewis}, S.~R. and 
+	{Millour}, E. and {Read}, P.~L. and {Wilson}, R.~J.},
+    pages = {129-+},
+}
+
+@ARTICLE{Wing:06,
+   author = {{Wing}, D.~R. and {Austin}, G.~L.},
+    title = "{Description of the University of Auckland global Mars mesoscale meteorological model}",
+  journal = {Icarus},
+     year = 2006,
+   volume = 185,
+    pages = {370-382},
+      doi = {10.1016/j.icarus.2006.07.016},
+}
+
+@ARTICLE{Rich:07,
+   author = {{Richardson}, M.~I. and {Toigo}, A.~D. and {Newman}, C.~E.},
+    title = "{PlanetWRF: A general purpose, local to global numerical model for planetary atmospheric and climate dynamics}",
+  journal = jgr,
+     year = 2007,
+   volume = 112,
+   number = {E09001},
+      doi = {10.1029/2005JE002636},
+}
+
+@ARTICLE{Tyle:05,
+   author = {{Tyler}, D. and {Barnes}, J.~R.},
+    title = "{A mesoscale model study of summertime atmospheric circulations in the north polar region of Mars}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2005,
+   volume = 110,
+   number = {E9},
+    pages = {6007-+},
+      doi = {10.1029/2004JE002356},
+}
+
+@ARTICLE{Toig:02dust,
+   author = {{Toigo}, A.~D. and {Richardson}, M.~I. and {Wilson}, R.~J. and 
+	{Wang}, H. and {Ingersoll}, A.~P.},
+    title = "{A first look at dust lifting and dust storms near the south pole of Mars with a mesoscale model}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2002,
+   volume = 107,
+    pages = {5050-+},
+      doi = {10.1029/2001JE001592},
+}
+
+@ARTICLE{Kuzm:01,
+   author = {{Kuzmin}, R.~O. and {Greeley}, R. and {Rafkin}, S.~C.~R. and 
+	{Haberle}, R.},
+    title = "{Wind-Related Modification of Some Small Impact Craters on Mars}",
+  journal = {Icarus},
+     year = 2001,
+   volume = 153,
+    pages = {61-70},
+      doi = {10.1006/icar.2001.6654},
+}
+
+@ARTICLE{Fent:05,
+   author = {{Fenton}, L.~K. and {Toigo}, A.~D. and {Richardson}, M.~I.},
+    title = "{Aeolian processes in Proctor Crater on Mars: Mesoscale modeling of dune-forming winds}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2005,
+   volume = 110,
+   number = {E9},
+    pages = {6005-+},
+      doi = {10.1029/2004JE002309},
+}
+
+@ARTICLE{Gree:08,
+   author = {{Greeley}, R. and {Whelley}, P.~L. and {Neakrase}, L.~D.~V. and 
+	{Arvidson}, R.~E. and {Bridges}, N.~T. and {Cabrol}, N.~A. and 
+	{Christensen}, P.~R. and {Di}, K. and {Foley}, D.~J. and {Golombek}, M.~P. and 
+	{Herkenhoff}, K. and {Knudson}, A. and {Kuzmin}, R.~O. and {Li}, R. and 
+	{Michaels}, T. and {Squyres}, S.~W. and {Sullivan}, R. and {Thompson}, S.~D.
+	},
+    title = "{Columbia Hills, Mars: Aeolian features seen from the ground and orbit}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2008,
+   volume = 113,
+   number = {E12},
+    pages = {6-+},
+      doi = {10.1029/2007JE002971},
+}
+
+@ARTICLE{Rafk:04,
+   author = {{Rafkin}, S.~C.~R. and {Michaels}, T.~I. and {Haberle}, R.~M.
+	},
+    title = "{Meteorological predictions for the Beagle 2 mission to Mars}",
+  journal = grl,
+     year = 2004,
+   volume = 31,
+    pages = {1703-+},
+      doi = {10.1029/2003GL018966},
+}
+
+@ARTICLE{Kass:03,
+   author = {{Kass}, D.~M. and {Schofield}, J.~T. and {Michaels}, T.~I. and 
+	{Rafkin}, S.~C.~R. and {Richardson}, M.~I. and {Toigo}, A.~D.
+	},
+    title = "{Analysis of atmospheric mesoscale models for entry, descent, and landing}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2003,
+   volume = 108,
+    pages = {8090-+},
+      doi = {10.1029/2003JE002065},
+}
+
+@ARTICLE{Skam:08,
+   author = {{Skamarock}, W.~C. and {Klemp}, J.~B.},
+    title = "{A time-split nonhydrostatic atmospheric model for weather research and forecasting applications}",
+  journal = {Journal of Computational Physics},
+     year = 2008,
+   volume = 227,
+    pages = {3465-3485},
+      doi = {10.1016/j.jcp.2007.01.037},
+}
+
+@ARTICLE{Skam:06,
+   author = {{Skamarock}, W.~C.},
+    title = "{Positive-Definite and Monotonic Limiters for Unrestricted-Time-Step Transport Schemes}",
+  journal = {Monthly Weather Review},
+     year = 2006,
+   volume = 134,
+    pages = {2241-+},
+      doi = {10.1175/MWR3170.1},
+}
+
+@ARTICLE{Arak:66,
+   author = {{Arakawa}, A.},
+    title = "{Computational Design for Long-Term Numerical Integration of the Equations of Fluid Motion: Two-Dimensional Incompressible Flow. Part I}",
+  journal = {Journal of Computational Physics},
+     year = 1966,
+   volume = 1,
+    pages = {119-+},
+}
+
+@ARTICLE{Klem:07,
+   author = {{Klemp}, J.~B. and {Skamarock}, W.~C. and {Dudhia}, J.},
+    title = "{Conservative Split-Explicit Time Integration Methods for the Compressible Nonhydrostatic Equations}",
+  journal = {Monthly Weather Review},
+     year = 2007,
+   volume = 135,
+    pages = {2897-+},
+      doi = {10.1175/MWR3440.1},
+}
+
+@ARTICLE{Wick:02,
+   author = {{Wicker}, L.~J. and {Skamarock}, W.~C.},
+    title = "{Time-Splitting Methods for Elastic Models Using Forward Time Schemes}",
+  journal = {Monthly Weather Review},
+     year = 2002,
+   volume = 130,
+    pages = {2088-+},
+      doi = {10.1175/1520-0493(2002)130},
+}
+
+@ARTICLE{Hund:95,
+   author = {{Hundsdorfer}, W.},
+    title = "{A Positive Finite-Difference Advection Scheme}",
+  journal = {Journal of Computational Physics},
+     year = 1995,
+   volume = 117,
+    pages = {35-46},
+      doi = {10.1006/jcph.1995.1042},
+}
+
+@ARTICLE{Knie:07,
+   author = {{Knievel}, J.~C. and {Bryan}, G.~H. and {Hacker}, J.~P.},
+    title = "{Explicit Numerical Diffusion in the WRF Model}",
+  journal = {Monthly Weather Review},
+     year = 2007,
+   volume = 135,
+    pages = {3808-+},
+      doi = {10.1175/2007MWR2100.1},
+}
+
+@article{Smag:63,
+  author   = {Smagorinsky, J.},
+  journal  = {Mon. Weather Rev.},
+  pages    = {99--164},
+  title    = {General Circulation Experiments with the Primitive Equations. I. The Basic Experiment},
+  volume   = {91},
+  year     = {1963}
+}
+
+@INPROCEEDINGS{Forg:99icm5,
+   author = {{Forget}, F. and {Hourdin}, F. and {Hourdin}, C. and {Talagrand}, O.
+	},
+    title = "{Simulations of the Martian Seasonal Dust Cycle with a General Circulation Model}",
+booktitle = {The Fifth International Conference on Mars},
+     year = 1999,
+    pages = {6206-+},
+}
+
+
+@inproceedings{Forg:07emsec,
+	author = {Forget, F. and Millour, E. and Gonzalez-Galindo, F. and Spiga, A. and Lebonnois, S. and Hourdin, F. and Lewis, S.~R. and Montabone, L. and Read, P.~L. and Lefevre, F. and Montmessin, F.},
+	booktitle = {European Mars Science and Exploration Conference: Mars Express and ExoMars},
+	editor = {ESA},
+	title = {Modelling the present Mars climate system as observed by Mars Express},
+	year = {2007}
+}
+
+@INPROCEEDINGS{Rafk:03adj,
+   author = {{Rafkin}, S.~C.~R.},
+    title = "{The Effect of Convective Adjustment on the Global Circulation of Mars as Simulated by a General Circulation Model}",
+booktitle = {Sixth International Conference on Mars},
+     year = 2003,
+   editor = {{Albee}, A.},
+    pages = {3059-+},
+}
+
+@ARTICLE{Dimi:05,
+   author = {{Dimitrijevic}, M. and {Laprise}, R.},
+    title = "{Validation of the nesting technique in a regional climate model and sensitivity tests to the resolution of the lateral boundary conditions during summer}",
+  journal = {Climate Dynamics},
+     year = 2005,
+   volume = 25,
+    pages = {555-580},
+      doi = {10.1007/s00382-005-0023-6},
+}
+
+@article{Anti:06,
+  title={{Testing the downscaling ability of a one-way nested regional climate model in regions of complex topography}},
+  author={Antic, S. and Laprise, R. and Denis, B. and de El{\'\i}a, R.},
+  journal={Climate Dynamics},
+  volume={26},
+  number={2},
+  pages={305--325},
+  year={2006},
+}
+
+@ARTICLE{Putz:07,
+   author = {{Putzig}, N.~E. and {Mellon}, M.~T.},
+    title = "{Apparent thermal inertia and the surface heterogeneity of Mars}",
+  journal = {Icarus},
+     year = 2007,
+   volume = 191,
+    pages = {68-94},
+      doi = {10.1016/j.icarus.2007.05.013},
+}
+
+@ARTICLE{Vasa:00,
+   author = {{Vasavada}, A.~R. and {Williams}, J.-P. and {Paige}, D.~A. and 
+	{Herkenhoff}, K.~E. and {Bridges}, N.~T. and {Greeley}, R. and 
+	{Murray}, B.~C. and {Bass}, D.~S. and {McBride}, K.~S.},
+    title = "{Surface properties of Mars' polar layered deposits and polar landing sites}",
+  journal = jgr,
+     year = 2000,
+   volume = 105,
+    pages = {6961-6970},
+      doi = {10.1029/1999JE001108},
+}
+
+@ARTICLE{Hebr:07,
+   author = {{H{\'e}brard}, E. and {Coll}, P. and {Montmessin}, F. and {Marticorena}, B. and 
+	{Bergametti}, G.},
+    title = "{Modelling the Aeolian Erosion Thresholds on Mars}",
+  journal = {LPI Contributions},
+     year = 2007,
+   volume = 1353,
+    pages = {3144-+},
+}
+
+@ARTICLE{Nayv:97,
+   author = {{Nayvelt}, L. and {Gierasch}, P.~J. and {Cook}, K.~H.},
+    title = "{Modeling and observations of Martian stationary waves.}",
+  journal = {Journal of Atmospheric Sciences},
+     year = 1997,
+   volume = 54,
+    pages = {986-1013},
+}
+
+@misc{Mill:08ddd,
+   author = {Millour, E. and Forget, F. and Lewis, S.~R.},
+   howpublished = {Mars Climate Database v4.3 Detailed Design Document, available on {\tt http://web.lmd.jussieu.fr/forget/dvd/docs}},
+   year = {2008}
+}
+
+@ARTICLE{Lewi:03,
+   author = {{Lewis}, S.~R. and {Read}, P.~L.},
+    title = "{Equatorial jets in the dusty Martian atmosphere}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2003,
+   volume = 108,
+    pages = {5034-+},
+      doi = {10.1029/2002JE001933},
+}
+
+@ARTICLE{Gier:71,
+   author = {{Gierasch}, P. and {Sagan}, C.},
+    title = "{A Preliminary Assessment of Martian Wind Regimes}",
+  journal = {Icarus},
+     year = 1971,
+   volume = 14,
+    pages = {312-+},
+}
+
+@ARTICLE{Ramp:04,
+   author = {{Rampanelli}, G. and {Zardi}, D. and {Rotunno}, R.},
+    title = "{Mechanisms of Up-Valley Winds.}",
+  journal = {Journal of Atmospheric Sciences},
+     year = 2004,
+   volume = 61,
+    pages = {3097-3111},
+}
+
+@ARTICLE{Zang:02,
+   author = {{Z{\"a}ngl}, G.},
+    title = "{An Improved Method for Computing Horizontal Diffusion in a Sigma-Coordinate Model and Its Application to Simulations over Mountainous Topography}",
+  journal = {Monthly Weather Review},
+     year = 2002,
+   volume = 130,
+    pages = {1423-+},
+      doi = {10.1175/1520-0493(2002)130},
+}
+
+@ARTICLE{Inad:08,
+   author = {{Inada}, A. and {Garcia-Comas}, M. and {Altieri}, F. and {Gwinner}, K. and 
+	{Poulet}, F. and {Bellucci}, G. and {Keller}, H.~U. and {Markiewicz}, W.~J. and 
+	{Richardson}, M.~I. and {Hoekzema}, N. and {Neukum}, G. and 
+	{Bibring}, J.-P.},
+    title = "{Dust haze in Valles Marineris observed by HRSC and OMEGA on board Mars Express}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2008,
+   volume = 113,
+   number = {E12},
+    pages = {2004-+},
+      doi = {10.1029/2007JE002893},
+}
+
+@ARTICLE{Odak:98,
+   author = {{Odaka}, M. and {Nakajima}, K. and {Takehiro}, S. and {Ishiwatari}, M. and 
+	{Hayashi}, Y.},
+    title = "{A numerical study of the Martian atmospheric convection with a two-dimensional anelastic model}",
+  journal = {Earth, Planets, and Space},
+     year = 1998,
+   volume = 50,
+    pages = {431-437},
+}
+
+@ARTICLE{Sorb:07,
+   author = {{Sorbjan}, Z.},
+    title = "{Statistics of shallow convection on Mars based on large-eddy simulations. Part 1: shearless conditions}",
+  journal = {Boundary-Layer Meteorology},
+     year = 2007,
+   volume = 123,
+    pages = {121-142},
+      doi = {10.1007/s10546-006-9128-7},
+}
+
+@ARTICLE{Toig:03dd,
+   author = {{Toigo}, A.~D. and {Richardson}, M.~I. and {Ewald}, S.~P. and 
+	{Gierasch}, P.~J.},
+    title = "{Numerical simulation of Martian dust devils}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2003,
+   volume = 108,
+    pages = {5047-+},
+      doi = {10.1029/2002JE002002},
+}
+
+@ARTICLE{Anto:07,
+   author = {{Antonelli}, M. and {Rotunno}, R.},
+    title = "{Large-Eddy Simulation of the Onset of the Sea Breeze}",
+  journal = {Journal of Atmospheric Sciences},
+     year = 2007,
+   volume = 64,
+    pages = {4445-+},
+      doi = {10.1175/2007JAS2261.1},
+}
+
+@ARTICLE{Savi:04,
+   author = {{Savij{\"a}rvi}, H. and {M{\"a}{\"a}tt{\"a}nen}, A. and {Kauhanen}, J. and 
+	{Harri}, A.-M.},
+    title = "{Mars Pathfinder: New data and new model simulations}",
+  journal = {Quarterly Journal of the Royal Meteorological Society},
+     year = 2004,
+   volume = 130,
+    pages = {669-683},
+}
+
+@ARTICLE{Ferr:03,
+   author = {{Ferri}, F. and {Smith}, P.~H. and {Lemmon}, M. and {Renn{\'o}}, N.~O.
+	},
+    title = "{Dust devils as observed by Mars Pathfinder}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2003,
+   volume = 108,
+    pages = {5133-+},
+      doi = {10.1029/2000JE001421},
+}
+
+@article{Dion:02,
+  title={{Numerical study of a Sahelian synoptic weather system: Initiation and mature stages of convection and its interactions with the large-scale dynamics}},
+  author={Diongue, A. and Lafore, JP and Redelsperger, JL and Roca, R.},
+  journal={Quarterly Journal of the Royal Meteorological Society},
+  volume={128},
+  number={584},
+  pages={1899--1927},
+  year={2002}
+}
+
+@ARTICLE{Peal:73,
+   author = {{Peale}, J.},
+    title = "{Water and the Martian W Cloud}",
+  journal = {Icarus},
+     year = 1973,
+   volume = 18,
+    pages = {497-+},
+}
+
+@ARTICLE{Bens:03,
+   author = {{Benson}, J.~L. and {Bonev}, B.~P. and {James}, P.~B. and {Shan}, K.~J. and 
+	{Cantor}, B.~A. and {Caplinger}, M.~A.},
+    title = "{The seasonal behavior of water ice clouds in the Tharsis and Valles Marineris regions of Mars: Mars Orbiter Camera Observations}",
+  journal = {Icarus},
+     year = 2003,
+   volume = 165,
+    pages = {34-52},
+      doi = {10.1016/S0019-1035(03)00175-1},
+}
+
+@ARTICLE{Mali:08,
+   author = {{Malin}, M.~C. and {Calvin}, W.~M. and {Cantor}, B.~A. and {Clancy}, R.~T. and 
+	{Haberle}, R.~M. and {James}, P.~B. and {Thomas}, P.~C. and 
+	{Wolff}, M.~J. and {Bell}, J.~F. and {Lee}, S.~W.},
+    title = "{Climate, weather, and north polar observations from the Mars Reconnaissance Orbiter Mars Color Imager}",
+  journal = {Icarus},
+     year = 2008,
+   volume = 194,
+    pages = {501-512},
+      doi = {10.1016/j.icarus.2007.10.016},
+}
+
+@INPROCEEDINGS{Made:08mwcm,
+   author = {Madeleine, J.~B. and Forget F. and Spiga A. and Bibring J.~P. and Gondet B. and Jouglet D. and Vincendon M. and Langevin Y. and Poulet F. and Montmessin F. and Schmitt B.},
+    title = "{Mapping water ice cloud microphysics with OMEGA/Mars Express}",
+booktitle = {Mars Water Cycle Workshop},
+     year = 2008,
+   editor = {{Montmessin}, F.},
+}
+
+@INPROCEEDINGS{Wolf:08mwcm,
+   author = {Wolff, M.~J. and Clancy, R.~T. and Smith, M.~D. and the CRISM and MARCI team},
+    title = "{Insights into the Mars Water Cycle Through Retrievals of Aerosols and Ozone:
+The MARCI and CRISM Datasets}",
+booktitle = {Mars Water Cycle Workshop},
+     year = 2008,
+   editor = {{Montmessin}, F.},
+}
+
+@ARTICLE{Raph:03,
+   author = {{Raphael}, M.~N.},
+    title = "{The Santa Ana Winds of California}",
+  journal = {Earth Interactions},
+     year = 2003,
+   volume = 7,
+   number = 8,
+    pages = {080000-+},
+      doi = {10.1175/1087-3562(2003)007},
+}
+
+@ARTICLE{Maat:09,
+   author = {
+{M{\"a}{\"a}tt{\"a}nen}, A. 
+and Fouchet, T. 
+and Forni, O. 
+and Melchiorri, R. 
+and Forget, F. 
+and Savijarvi, H. 
+and Bibring, J.~P. 
+and Langevin, Y. 
+and Gondet, B. 
+and Formisano, V. 
+and Giuranna, M.},
+   title = {A study of the properties of a local dust storm with \protect{Mars Express} \protect{OMEGA} and \protect{PFS} data},
+  journal = {Icarus},
+     year = 2009,
+   volume = 201,
+   number = 2,
+    pages = {504-516},
+}
+
+@misc{Mont:08,
+   author = {Montabone, L. and Martinez-Alvarado, O. and Spiga, A. and Lewis, S. R. and Read, P. L. and Forget, F.},
+   howpublished = {EGU 2008, Abstract Number 10457},
+   title = {Meteorology of the 2001 Martian planet-encircling dust storm in global and mesoscale modelling with data assimilation},
+   year = {2008}
+}
+
+@INPROCEEDINGS{Smit:08mwcm,
+   author = {Smith, M.~D.},
+    title = "{Mars Water Vapor Climatology From MGS/TES}",
+booktitle = {Mars Water Cycle Workshop},
+     year = 2008,
+   editor = {{Montmessin}, F.},
+}
+
+@ARTICLE{Malt:08,
+   author = {{Maltagliati}, L. and {Titov}, D.~V. and {Encrenaz}, T. and 
+	{Melchiorri}, R. and {Forget}, F. and {Garcia-Comas}, M. and 
+	{Keller}, H.~U. and {Langevin}, Y. and {Bibring}, J.-P.},
+    title = "{Observations of atmospheric water vapor above the Tharsis volcanoes on Mars with the OMEGA/MEx imaging spectrometer}",
+  journal = {Icarus},
+     year = 2008,
+   volume = 194,
+    pages = {53-64},
+      doi = {10.1016/j.icarus.2007.09.027},
+}
+
+@ARTICLE{Giur:08,
+   author = {{Giuranna}, M. and {Grassi}, D. and {Formisano}, V. and {Montabone}, L. and {Forget}, F. and {Zasova}, L.},
+    title = "{PFS/MEX observations of the condensing $CO_{2}$ south polar cap of Mars}",
+  journal = {Icarus},
+     year = 2008,
+   volume = 197,
+    pages = {386-402},
+      doi = {10.1016/j.icarus.2008.05.019},
+}
+
+@misc{Sorb:08,
+   author = {Sorbjan, Z. and Wolff, M.~J. and Smith, M.~D.},
+   howpublished = {\textit{submitted to Icarus}},
+   title = {Temperature and turbulent heat flux profiles on Mars based on mini-TES observations},
+   year = {2008}
+}
+
+
+@article{Scor:56,
+  title={{Airflow over an isolated hill}},
+  author={Scorer, RS},
+  journal={Quart. J. Roy. Meteor. Soc},
+  volume={82},
+  pages={75--81},
+  year={1956}
+}
+
+@ARTICLE{Spig:09,
+   author = {{Spiga}, A. and {Forget}, F.},
+    title = "{A new model to simulate the Martian mesoscale and microscale atmospheric circulation: Validation and first results}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2009,
+   volume = 114,
+    pages = {E02009},
+      doi = {10.1029/2008JE003242},
+}
+
+@ARTICLE{Vinc:07,
+   author = {{Vincendon}, M. and {Langevin}, Y. and {Poulet}, F. and
+{Bibring}, J.-P. and 
+	{Gondet}, B.},
+    title = "{Recovery of surface reflectance spectra and evaluation of
+the optical depth of aerosols in the near-IR using a Monte Carlo
+approach: Application to the OMEGA observations of high-latitude regions
+of Mars}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+   number = {E11},
+    pages = {8-+},
+      doi = {10.1029/2006JE002845},
+}
+
+@ARTICLE{Boug:06venus,
+   author = {{Bougher}, S.~W. and {Rafkin}, S. and {Drossart}, P.},
+    title = "{Dynamics of the Venus upper atmosphere: Outstanding
+problems and new constraints expected from Venus Express}",
+  journal = pss,
+     year = 2006,
+   volume = 54,
+    pages = {1371-1380},
+      doi = {10.1016/j.pss.2006.04.023},
+}
+
+@article{Lore:63,
+  title={{Deterministic Nonperiodic Flow}},
+  author={Lorenz, E.N.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={20},
+  number={2},
+  pages={130--141},
+  year={1963},
+  publisher={American Meteorological Society}
+}
+
+@article{Wyng:04,
+  title={{Toward Numerical Modeling in the “Terra Incognita”}},
+  author={Wyngaard, J.C.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={61},
+  number={14},
+  pages={1816--1826},
+  year={2004},
+  publisher={American Meteorological Society}
+}
+
+@article{Phil:56,
+  title={{The general circulation of the atmosphere: A numerical experiment}},
+  author={Phillips, N.A.},
+  journal={Quart. J. Roy. Meteor. Soc},
+  volume={82},
+  pages={123--164},
+  year={1956}
+}
+
+@article{Lill:67,
+  title={{The representation of small-scale turbulence in numerical simulation experiments}},
+  author={Lilly, DK},
+  journal={Proc. IBM Scientific Computing Symposium on Environmental Sciences},
+  volume={195},
+  year={1967}
+}
+
+@article{Dear:70,
+  title={{Convective Velocity and Temperature Scales for the Unstable Planetary Boundary Layer and for Rayleigh Convection}},
+  author={Deardorff, J.W.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={27},
+  number={8},
+  pages={1211--1213},
+  year={1970},
+  publisher={American Meteorological Society}
+}
+
+
+@book{Fedo:04,
+  title={{Atmospheric turbulence and mesoscale meteorology}},
+  author={Fedorovich, E. and Rotunno, R. and Stevens, B.},
+  year={2004},
+  publisher={Cambridge University Press, Cambridge}
+}
+
+@article{Orla:75,
+  title={{A rational subdivision of scales for atmospheric processes}},
+  author={Orlanski, I.},
+  journal={Bull. Amer. Meteor. Soc},
+  volume={56},
+  number={5},
+  pages={527--534},
+  year={1975}
+}
+
+@article{Hill:68,
+  title={{Grid Telescoping in Numerical Weather Prediction}},
+  author={Hill, GE},
+  journal={Journal of Applied Meteorology},
+  volume={7},
+  number={1},
+  pages={29--38},
+  year={1968},
+  publisher={NOAA Central Library, Department of Commerce}
+}
+
+@article{Harr:72,
+  title={{A Method for Incorporating Nested Finite Grids in the Solution of Systems of Geophysical Equations}},
+  author={Harrison, E.J. and Elsberry, R.L.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={29},
+  number={7},
+  pages={1235--1245},
+  year={1972},
+  publisher={American Meteorological Society}
+}
+
+@article{Yana:61,
+  title={{A Detailed Analysis of Typhoon Formation}},
+  author={Yanai, M.},
+  journal={Meteor. Soc. Japan},
+  volume={39},
+  pages={187--214},
+  year={1961}
+}
+
+@article{Char:64,
+  title={{On the Growth of the Hurricane Depression}},
+  author={Charney, J.G. and Eliassen, A.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={21},
+  number={1},
+  pages={68--75},
+  year={1964},
+  publisher={American Meteorological Society}
+}
+
+@article{Ooya:69,
+  title={{Numerical Simulation of the Life Cycle of Tropical Cyclones}},
+  author={Ooyama, K.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={26},
+  number={1},
+  pages={3--40},
+  year={1969},
+  publisher={American Meteorological Society}
+}
+
+@article{Anth:71,
+  title={{Preliminary results from an asymmetric model of the tropical cyclone}},
+  author={Anthes, R.~A. and Rosenthal, S.~L. and Trout, J.~W.},
+  journal={Monthly Weather Review},
+  volume={99},
+  number={10},
+  pages={744--758},
+  year={1971},
+  publisher={American Meteorological Society}
+}
+
+@article{Ogur:64,
+  title={{Frictionally Controlled, Thermally Driven Circulations in a Circular Vortex with Application to Tropical Cyclones}},
+  author={Ogura, Y.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={21},
+  number={6},
+  pages={610--621},
+  year={1964},
+  publisher={American Meteorological Society}
+}
+
+@article{Math:74,
+  title={{A Multiple-Grid Primitive Equation Model to Simulate the Development of an Asymmetric Hurricane (Isbell, 1964)}},
+  author={Mathur, M.B.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={31},
+  number={2},
+  pages={371--393},
+  year={1974},
+  publisher={American Meteorological Society}
+}
+
+@article{Rede:88,
+  title={{A Three-Dimensional Simulation of a Tropical Squall Line: Convective Organization and Thermodynamic Vertical Transport}},
+  author={Redelsperger, J.L. and Lafore, J.P.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={45},
+  number={8},
+  pages={1334--1356},
+  year={1988},
+  publisher={American Meteorological Society}
+}
+
+@article{Mill:74,
+  title={{A three-dimensional primitive equation model of cumulonimbus convection}},
+  author={Miller, M.~J. and Pearce, R.~P.},
+  journal={Quarterly Journal of the Royal Meteorological Society},
+  volume={100},
+  number={424},
+  pages={133--154},
+  year={1974},
+  publisher={Royal Meteorological Society}
+}
+
+@article{Monc:76,
+  title={{The dynamics and simulation of tropical cumulonimbus and squall lines}},
+  author={Moncrieff, M.~W. and Miller, M.~J.},
+  journal={Quarterly Journal of the Royal Meteorological Society},
+  volume={102},
+  number={432},
+  pages={373--394},
+  year={1976},
+  publisher={Royal Meteorological Society}
+}
+
+
+@article{Lill:73,
+  title={{Observations of a Stationary Mountain Wave and its Associated Momentum Flux and Energy Dissipation}},
+  author={Lilly, DK and Kennedy, PJ},
+  journal={Journal of the Atmospheric Sciences},
+  volume={30},
+  number={6},
+  pages={1135--1152},
+  year={1973},
+  publisher={American Meteorological Society}
+}
+
+@article{Quen:48,
+  title={{The problem of airflow over mountains: A summary of theoretical studies}},
+  author={Queney, P.},
+  journal={Bull. Amer. Meteor. Soc},
+  volume={29},
+  number={1},
+  pages={16--26},
+  year={1948}
+}
+
+@article{Mahr:77,
+  title={{The Effects of Topography on Sea and Land Breezes in a Two-Dimensional Numerical Model}},
+  author={Mahrer, Y. and Pielke, R.A.},
+  journal={Monthly Weather Review},
+  volume={105},
+  number={9},
+  pages={1151--1162},
+  year={1977},
+  publisher={American Meteorological Society}
+}
+
+@article{Klem:78,
+  title={{Numerical Simulation of Hydrostatic Mountain Waves}},
+  author={Klemp, JB and Lilly, DK},
+  journal={Journal of the Atmospheric Sciences},
+  volume={35},
+  number={1},
+  pages={78--107},
+  year={1978},
+  publisher={American Meteorological Society}
+}
+
+@article{Anth:78,
+  title={{Development of Hydrodynamic Models Suitable for Air Pollution and Other Mesometerological Studies}},
+  author={Anthes, R.A. and Warner, T.T.},
+  journal={Monthly Weather Review},
+  volume={106},
+  number={8},
+  pages={1045--1078},
+  year={1978},
+  publisher={American Meteorological Society}
+}
+
+@article{Mesi:88,
+  title={{The Step-Mountain Coordinate: Model Description and Performance for Cases of Alpine Lee Cyclogenesis and for a Case of an Appalachian Redevelopment}},
+  author={Mesinger, F. and Janji{\'c}, Z.I. and Ni{\v{c}}kovi{\'c}, S. and Gavrilov, D. and Deaven, D.G.},
+  journal={Monthly Weather Review},
+  volume={116},
+  number={7},
+  pages={1493--1518},
+  year={1988},
+  publisher={American Meteorological Society}
+}
+
+@article{Piel:92,
+  title={{A Comprehensive Meteorological Modeling System-RAMS}},
+  author={Pielke, RA and Cotton, WR and Walko, RL and Trembaek, CJ and Lyons, WA and Grasso, LD and Nieholls, ME and Moran, MD and Wesley, DA and Lee, TJ and others},
+  journal={Meteorol. Atmos. Phys},
+  volume={49},
+  pages={69--91},
+  year={1992}
+}
+
+@article{Dudh:93,
+  title={{A Nonhydrostatic Version of the Penn State--NCAR Mesoscale Model: Validation Tests and Simulation of an Atlantic Cyclone and Cold Front}},
+  author={Dudhia, J.},
+  journal={Monthly Weather Review},
+  volume={121},
+  number={5},
+  pages={1493--1513},
+  year={1993},
+  publisher={American Meteorological Society}
+}
+
+@article{Clar:84,
+  title={{Severe Downslope Windstorm Calculations in Two and Three Spatial Dimensions Using Anelastic Interactive Grid Nesting: A Possible Mechanism for Gustiness}},
+  author={Clark, T.L. and Farley, R.~D.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={41},
+  number={3},
+  pages={329--350},
+  year={1984},
+  publisher={American Meteorological Society}
+}
+
+@article{Lo:08,
+  title={{Assessment of three dynamical climate downscaling methods using the Weather Research and Forecasting (WRF) model}},
+  author={Lo, J. and Yang, Z. and Pielke, RA},
+  journal={J. Geophys. Res., doi},
+  volume={10},
+  year={2008}
+}
+
+@book{Boug:01,
+  title={{Dynamique de l’atmosphere et de l’ocean}},
+  author={Bougeault, P. and Sadourny, R.},
+  journal={Editions de l’Ecole polytechnique},
+  year={2001},
+  publisher={Editions de l'Ecole Polytechnique}
+}
+
+@article{Elia:49,
+  title={{The quasi-static equations of motion with pressure as independent variable}},
+  author={Eliassen, A.},
+  journal={Geofys. Publ., Oslo},
+  volume={17},
+  year={1949}
+}
+
+@article{Phil:57,
+  title={{A coordinate system having some special advantages for numerical forecasting}},
+  author={Phillips, NA},
+  journal={Journal of the Atmospheric Sciences},
+  volume={14},
+  number={2},
+  pages={184--185},
+  year={1957},
+  publisher={American Meteorological Society}
+}
+
+@article{Arak:77,
+  title={{Computational design of the UCLA general circulation model}},
+  author={Arakawa, A. and Lamb, V.~R.},
+  journal={Methods in Computational Physics},
+  volume={17},
+  pages={174--267},
+  year={1977}
+}
+
+@article{Kasa:74,
+  title={{Various Vertical Coordinate Systems Used for Numerical Weather Prediction}},
+  author={Kasahara, A.},
+  journal={Monthly Weather Review},
+  volume={102},
+  number={7},
+  pages={509--522},
+  year={1974},
+  publisher={American Meteorological Society}
+}
+
+@article{Durr:89,
+  title={{Improving the Anelastic Approximation}},
+  author={Durran, D.R.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={46},
+  number={11},
+  pages={1453--1461},
+  year={1989},
+  publisher={American Meteorological Society}
+}
+
+
+@ARTICLE{Lafo:98,
+   author = {{Lafore}, J.~P. and {Stein}, J. and {Asencio}, N. and {Bougeault}, P. and 
+	{Ducrocq}, V. and {Duron}, J. and {Fischer}, C. and {H{\'e}reil}, P. and 
+	{Mascart}, P. and {Masson}, V. and {Pinty}, J.~P. and {Redelsperger}, J.~L. and 
+	{Richard}, E. and {Vil{\`a}-Guerau de Arellano}, J.},
+    title = "{The Meso-NH Atmospheric Simulation System. Part I: adiabatic formulation and control simulations}",
+  journal = {Annales Geophysicae},
+     year = 1998,
+   volume = 16,
+    pages = {90-109},
+}
+
+@book{Piel:84,
+  title={{Mesoscale Atmospheric Modeling}},
+  author={Pielke, RA},
+  year={1984},
+  publisher={Academic Press}
+}
+
+@article{Skam:92,
+  title={{The Stability of Time-Split Numerical Methods for the Hydrostatic and the Nonhydrostatic Elastic Equations}},
+  author={Skamarock, W.C. and Klemp, J.B.},
+  journal={Monthly Weather Review},
+  volume={120},
+  number={9},
+  pages={2109--2127},
+  year={1992},
+  publisher={American Meteorological Society}
+}
+
+@article{Frit:03,
+  title={{Gravity wave dynamics and effects in the middle atmosphere}},
+  author={Fritts, D.C. and Alexander, M.J.},
+  journal={Rev. Geophys},
+  volume={41},
+  number={1},
+  pages={1003},
+  year={2003},
+}
+
+@article{Moen:07,
+  title={{Examining Two-Way Grid Nesting for Large Eddy Simulation of the PBL Using the WRF Model}},
+  author={Moeng, CH and Dudhia, J. and Klemp, J. and Sullivan, P.},
+  journal={Monthly Weather Review},
+  volume={135},
+  number={6},
+  pages={2295--2311},
+  year={2007},
+  publisher={American Meteorological Society}
+}
+
+@misc{Skam:08weis,
+   author = {Skamarock, W.~C. and Weisman, M.~L.},
+   howpublished = {Submitted to Monthly Weather Review},
+   title = {The Impact of Positive-Definite Moisture Transport on NWP Precipitation Forecasts},
+   year = {2008}
+}
+
+@book{Alla:05,
+  title={{Analyse numérique et optimisation}},
+  author={Allaire, G.},
+  year={2005},
+  publisher={Editions de l'Ecole Polytechnique}
+}
+
+@article{Gall:06,
+  title={{Comparison of Impacts of WRF Dynamic Core, Physics Package, and Initial Conditions on Warm Season Rainfall Forecasts}},
+  author={Gallus Jr, W.A. and Bresch, J.F.},
+  journal={Monthly Weather Review},
+  volume={134},
+  number={9},
+  pages={2632--2641},
+  year={2006},
+  publisher={American Meteorological Society}
+}
+
+@article{Davi:08,
+  title={{Hurricane Vortex Dynamics during Atlantic Extratropical Transition}},
+  author={Davis, C.A. and Jones, S.C. and Riemer, M.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={65},
+  number={3},
+  pages={714--736},
+  year={2008},
+  publisher={American Meteorological Society}
+}
+
+@ARTICLE{Plou:08,
+   author = {{Plougonven}, R. and {Hertzog}, A. and {Teitelbaum}, H.},
+    title = "{Observations and simulations of a large-amplitude mountain wave breaking over the Antarctic Peninsula}",
+  journal = {Journal of Geophysical Research (Atmospheres)},
+     year = 2008,
+   volume = 113,
+   number = D12,
+    pages = {16113-+},
+      doi = {10.1029/2007JD009739},
+}
+
+@article{Hine:08,
+  title={{Development and Testing of Polar Weather Research and Forecasting (WRF) Model. Part I: Greenland Ice Sheet Meteorology}},
+  author={Hines, K.M. and Bromwich, D.H.},
+  journal={Monthly Weather Review},
+  volume={136},
+  number={6},
+  pages={1971--1989},
+  year={2008},
+  publisher={American Meteorological Society}
+}
+
+@misc{Bao:08,
+   author = {Bao, J.~W. and Michelson, S.~A. and Persson, P.~O.~G. and Djalalova, I.~V. and Wilczak J.~M.},
+   howpublished = {Journal of Applied Meteorology and Climatology},
+   title = {Observed and WRF-Simulated Low-Level Winds in a High-Ozone Episode during the Central California Ozone Study, In Press},
+   year = {2008}
+}
+
+@article{Chen:05,
+  title={{Evaluation of Surface Sensible Weather Forecasts by the WRF and the Eta Models over the Western United States}},
+  author={Cheng, W.Y.Y. and Steenburgh, W.J.},
+  journal={Weather and Forecasting},
+  volume={20},
+  number={5},
+  pages={812--821},
+  year={2005},
+  publisher={American Meteorological Society}
+}
+
+@article{Scav:98,
+  title={{A study of the low frequency inertio-gravity waves observed during PYREX}},
+  author={Scavuzzo, CM and Lamfri, MA and Teitelbaum, H. and Lott, F.},
+  journal={J. Geophys. Res},
+  volume={103},
+  pages={1747--1758},
+  year={1998}
+}
+
+@ARTICLE{Alex:00,
+   author = {{Alexander}, M.~J. and {Vincent}, R.~A.},
+    title = "{Gravity waves in the tropical lower stratosphere: A model study of seasonal and interannual variability}",
+  journal = jgr,
+     year = 2000,
+   volume = 105,
+    pages = {17983-17994},
+      doi = {10.1029/2000JD900197},
+}
+
+@article{Osul:95,
+  title={{Generation of Inertia--Gravity Waves in a Simulated Life Cycle of Baroclinic Instability}},
+  author={O'sullivan, D. and Dunkerton, T.J.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={52},
+  number={21},
+  pages={3695--3716},
+  year={1995},
+  publisher={American Meteorological Society}
+}
+
+@article{Pfis:93,
+  title={{Mesoscale Disturbances in the Tropical Stratosphere Excited by Convection: Observations and Effects on the Stratospheric Momentum Budget}},
+  author={Pfister, L. and Scott, S. and Loewenstein, M. and Bowen, S. and Legg, M.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={50},
+  number={8},
+  pages={1058--1075},
+  year={1993},
+  publisher={American Meteorological Society}
+}
+
+@book{Mint:61,
+  title={{Numerical studies of planetary circulation}},
+  author={Mintz, Y.},
+  year={1961},
+  publisher={DTIC Research Report AD0263158}
+}
+
+@article{Savi:99,
+  title={{A model study of the atmospheric boundary layer in the Mars Pathfinder lander conditions}},
+  author={S{\"a}vijarvi, H.},
+  journal={Quarterly Journal of the Royal Meteorological Society},
+  volume={125},
+  number={554},
+  pages={483--493},
+  year={1999},
+  publisher={Royal Meteorological Society}
+}
+
+@article{Pres:97,
+  title={{The effect of bulk density and particle size sorting on the thermal conductivity of particulate materials under Martian atmospheric pressures}},
+  author={Presley, M.A. and Christensen, P.R.},
+  journal={J. Geophys. Res},
+  volume={102},
+  number={E4},
+  pages={9221--9229},
+  year={1997}
+}
+
+@ARTICLE{Good:67,
+   author = {{Goody}, R. and {Belton}, M.~J.~S.},
+    title = "{Radiative relaxation times for Mars. A discussion of martian atmospheric dynamics}",
+  journal = pss,
+     year = 1967,
+   volume = 15,
+    pages = {247-+},
+}
+
+@ARTICLE{Cant:07,
+   author = {{Cantor}, B.~A.},
+    title = "{MOC observations of the 2001 Mars planet-encircling dust storm}",
+  journal = {Icarus},
+     year = 2007,
+   volume = 186,
+    pages = {60-96},
+      doi = {10.1016/j.icarus.2006.08.019},
+}
+
+@ARTICLE{Mont:05luca,
+   author = {{Montabone}, L. and {Lewis}, S.~R. and {Read}, P.~L.},
+    title = "{Interannual variability of Martian dust storms in assimilation of several years of Mars global surveyor observations}",
+  journal = {Advances in Space Research},
+     year = 2005,
+   volume = 36,
+    pages = {2146-2155},
+      doi = {10.1016/j.asr.2005.07.047},
+}
+
+@ARTICLE{Gold:08,
+   author = {{Goldenson}, N. and {Desch}, S. and {Christensen}, P.},
+    title = "{Non-equilibrium between dust and gas temperatures in the Mars atmosphere}",
+  journal = grl,
+     year = 2008,
+   volume = 35,
+    pages = {8813-+},
+      doi = {10.1029/2007GL032907},
+}
+
+@ARTICLE{Banf:00,
+   author = {{Banfield}, D. and {Conrath}, B. and {Pearl}, J.~C. and {Smith}, M.~D. and 
+	{Christensen}, P.},
+    title = "{Thermal tides and stationary waves on Mars as revealed by Mars Global Surveyor thermal emission spectrometer}",
+  journal = jgr,
+     year = 2000,
+   volume = 105,
+    pages = {9521-9538},
+      doi = {10.1029/1999JE001161},
+}
+
+@ARTICLE{Cant:02,
+   author = {{Cantor}, B. and {Malin}, M. and {Edgett}, K.~S.},
+    title = "{Multiyear Mars Orbiter Camera (MOC) observations of repeated Martian weather phenomena during the northern summer season}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2002,
+   volume = 107,
+    pages = {5014-+},
+      doi = {10.1029/2001JE001588},
+}
+
+@BOOK{Chap:70,
+   author = {{Chapman}, S. and {Lindzen}, R.},
+    title = "{Atmospheric tides. Thermal and gravitational}",
+publisher = {Dordrecht: Reidel, 1970},
+     year = 1970,
+}
+
+@ARTICLE{Zure:81,
+   author = {{Zurek}, R.~W. and {Leovy}, C.~B.},
+    title = "{Thermal tides in the dusty martian atmosphere - A verification of theory}",
+  journal = {Science},
+     year = 1981,
+   volume = 213,
+    pages = {437-439},
+}
+
+@ARTICLE{Hert:07,
+   author = {{Hertzog}, A. and {Cocquerez}, P. and {Basdevant}, C. and {Boccara}, G. and 
+	{Bordereau}, J. and {Brioit}, B. and {Cardonne}, A. and {Guilbon}, R. and 
+	{Ravissot}, A. and {Schmitt}, {\'E}. and {Valdivia}, J.-N. and 
+	{Venel}, S. and {Vial}, F.},
+    title = "{Strat{\'e}ole/Vorcore Long-duration, Superpressure Balloons to Study the Antarctic Lower Stratosphere during the 2005 Winter}",
+  journal = {Journal of Atmospheric and Oceanic Technology},
+     year = 2007,
+   volume = 24,
+    pages = {2048-+},
+      doi = {10.1175/2007JTECHA948.1},
+}
+
+@article{Teit:91,
+  title={{On tidal variability induced by nonlinear interaction with planetary waves}},
+  author={Teitelbaum, H. and Vial, F.},
+  journal={Journal of Geophysical Research},
+  volume={96},
+  number={A8},
+  pages={14169--14178},
+  year={1991}
+}
+
+@ARTICLE{Span:06,
+   author = {{Spanovich}, N. and {Smith}, M.~D. and {Smith}, P.~H. and {Wolff}, M.~J. and 
+	{Christensen}, P.~R. and {Squyres}, S.~W.},
+    title = "{Surface and near-surface atmospheric temperatures for the Mars Exploration Rover landing sites}",
+  journal = {Icarus},
+     year = 2006,
+   volume = 180,
+    pages = {314-320},
+      doi = {10.1016/j.icarus.2005.09.014},
+}
+
+@article{Aebi:98,
+  title={{Low-Level Potential Vorticity and Cyclogenesis to the Lee of the Alps}},
+  author={Aebischer, U. and Sch{\"a}r, C.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={55},
+  number={2},
+  pages={186--207},
+  year={1998},
+  publisher={American Meteorological Society}
+}
+
+@article{Epif:02,
+  title={{Lee-Vortex Formation in Free-Slip Stratified Flow over Ridges. Part II: Mechanisms of Vorticity and PV Production in Nonlinear Viscous Wakes}},
+  author={Epifanio, CC and Durran, DR},
+  journal={Journal of the Atmospheric Sciences},
+  volume={59},
+  number={7},
+  pages={1166--1181},
+  year={2002},
+  publisher={American Meteorological Society}
+}
+
+@article{Cast:93,
+  title={{Experiments on wave breaking in statified flow over obstacles}},
+  author={Castro, I.~P. and Snyder, W.~H.},
+  journal={Journal of Fluid Mechanics},
+  volume={255},
+  pages={195--211},
+  year={1993},
+  publisher={Cambridge University Press}
+}
+
+@misc{Epif:03,
+  title={{Lee vortices. Encyclopedia of Atmospheric Sciences, JR Holton, J. Pyle, and J. A. Curry, Eds}},
+  author={Epifanio, C.C.},
+  year={2003},
+  publisher={Academic Press}
+}
+
+@article{Scha:97,
+  title={{Vortex Formation and Vortex Shedding in Continuously Stratified Flows past Isolated Topography}},
+  author={Sch{\"a}r, C. and Durran, D.R.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={54},
+  number={4},
+  pages={534--554},
+  year={1997},
+  publisher={American Meteorological Society}
+}
+
+@article{Scha:93,
+  title={{Shallow-Water Flow past Isolated Topography. Part I: Vorticity Production and Wake Formation}},
+  author={Sch{\"a}r, C. and Smith, R.B.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={50},
+  number={10},
+  pages={1373--1400},
+  year={1993},
+  publisher={American Meteorological Society}
+}
+
+@article{Smol:89,
+  title={{Low Froude Number Flow Past Three-Dimensional Obstacles. Part I: Baroclinically Generated Lee Vortices}},
+  author={Smolarkiewicz, P.K. and Rotunno, R.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={46},
+  number={8},
+  pages={1154--1164},
+  year={1989},
+  publisher={American Meteorological Society}
+}
+
+@article{Clar:77,
+  title={{On the Evolution and Stability of Finite-Amplitude Mountain Waves}},
+  author={Clark, T.~L. and Peltier, W.~R.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={34},
+  number={11},
+  pages={1715--1730},
+  year={1977},
+  publisher={American Meteorological Society}
+}
+
+@article{Durr:86,
+  title={{Another Look at Downslope Windstorms. Part I: The Development of Analogs to Supercritical Flow in an Infinitely Deep, Continuously Stratified Fluid}},
+  author={Durran, D.R.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={43},
+  number={21},
+  pages={2527--2543},
+  year={1986},
+  publisher={American Meteorological Society}
+}
+
+@article{Grub:95,
+  title={{The Effect of Bottom Friction on Shallow-Water Flow past an Isolated Obstacle}},
+  author={Grubi{\v{s}}i{\'c}, V. and Smith, R.B. and Sch{\"a}r, C.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={52},
+  number={11},
+  pages={1985--2005},
+  year={1995},
+  publisher={American Meteorological Society}
+}
+
+@article{Kaln:96,
+  title={{The NCEP/NCAR 40-Year Reanalysis Project}},
+  author={Kalnay, E. and Kanamitsu, M. and Kistler, R. and Collins, W. and Deaven, D. and Gandin, L. and Iredell, M. and Saha, S. and White, G. and Woollen, J. and others},
+  journal={Bulletin of the American Meteorological Society},
+  volume={77},
+  number={3},
+  pages={437--471},
+  year={1996},
+  publisher={American Meteorological Society}
+}
+
+
+@ARTICLE{Ched:03,
+   author = {{Ch{\'e}din}, A. and {Serrar}, S. and {Scott}, N.~A. and {Crevoisier}, C. and 
+	{Armante}, R.},
+    title = "{First global measurement of midtropospheric CO2 from NOAA polar satellites: Tropical zone}",
+  journal = {Journal of Geophysical Research (Atmospheres)},
+     year = 2003,
+   volume = 108,
+    pages = {4581-+},
+      doi = {10.1029/2003JD003439},
+}
+
+@ARTICLE{Kapl:64,
+   author = {{Kaplan}, L.~D. and {M{\"u}nch}, G. and {Spinrad}, H.},
+    title = "{An Analysis of the Spectrum of Mars.}",
+  journal = apj,
+     year = 1964,
+   volume = 139,
+    pages = {1-+},
+}
+
+@ARTICLE{Klio:65,
+   author = {{Kliore}, A. and {Cain}, D.~L. and {Levy}, G.~S. and {Eshleman}, V.~R. and 
+	{Fjeldbo}, G. and {Drake}, F.~D.},
+    title = "{Occultation Experiment: Results of the First Direct Measurement of Mars's Atmosphere and Ionosphere}",
+  journal = {Science},
+     year = 1965,
+   volume = 149,
+    pages = {1243-1248},
+}
+
+@article{Belt:66,
+  title={{The Abundance and Temperature of CO$_2$ in the Martian Atmosphere}},
+  author={Belton, M.J.S. and Hunten, D.M.},
+  journal={The Astrophysical Journal},
+  volume={145},
+  pages={454},
+  year={1966}
+}
+
+@ARTICLE{Farr:08,
+   author = {{Farrell}, W.~M. and {Clifford}, S.~M. and {Milkovich}, S.~M. and 
+	{Plaut}, J.~J. and {Leuschen}, C.~J. and {Picardi}, G. and {Gurnett}, D.~A. and 
+	{Watters}, T.~R. and {Safaeinili}, A. and {Ivanov}, A.~B. and 
+	{Phillips}, R.~J. and {Stofan}, E.~R. and {Heggy}, E. and {Cummer}, S.~A. and 
+	{Espley}, J.~R.},
+    title = "{MARSIS subsurface radar investigations of the South Polar reentrant Chasma Australe}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2008,
+   volume = 113,
+   number = {E12},
+    pages = {4002-+},
+      doi = {10.1029/2007JE002974},
+}
+
+@ARTICLE{Poul:07,
+   author = {{Poulet}, F. and {Gomez}, C. and {Bibring}, J.-P. and {Langevin}, Y. and 
+	{Gondet}, B. and {Pinet}, P. and {Belluci}, G. and {Mustard}, J.
+	},
+    title = "{Martian surface mineralogy from Observatoire pour la Min{\'e}ralogie, l'Eau, les Glaces et l'Activit{\'e} on board the Mars Express spacecraft (OMEGA/MEx): Global mineral maps}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+   number = {E11},
+    pages = {8-+},
+      doi = {10.1029/2006JE002840},
+}
+
+
+
+@ARTICLE{Loiz:07,
+   author = {{Loizeau}, D. and {Mangold}, N. and {Poulet}, F. and {Bibring}, J.-P. and 
+	{Gendrin}, A. and {Ansan}, V. and {Gomez}, C. and {Gondet}, B. and 
+	{Langevin}, Y. and {Masson}, P. and {Neukum}, G.},
+    title = "{Phyllosilicates in the Mawrth Vallis region of Mars}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+   number = {E11},
+    pages = {8-+},
+      doi = {10.1029/2006JE002877},
+}
+
+
+@ARTICLE{Lang:07,
+   author = {{Langevin}, Y. and {Bibring}, J.-P. and {Montmessin}, F. and 
+	{Forget}, F. and {Vincendon}, M. and {Dout{\'e}}, S. and {Poulet}, F. and 
+	{Gondet}, B.},
+    title = "{Observations of the south seasonal cap of Mars during recession in 2004-2006 by the OMEGA visible/near-infrared imaging spectrometer on board Mars Express}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+   number = {E11},
+    pages = {8-+},
+      doi = {10.1029/2006JE002841},
+}
+
+@ARTICLE{Mang:07,
+   author = {{Mangold}, N. and {Poulet}, F. and {Mustard}, J.~F. and {Bibring}, J.-P. and 
+	{Gondet}, B. and {Langevin}, Y. and {Ansan}, V. and {Masson}, P. and 
+	{Fassett}, C. and {Head}, J.~W. and {Hoffmann}, H. and {Neukum}, G.
+	},
+    title = "{Mineralogy of the Nili Fossae region with OMEGA/Mars Express data: 2. Aqueous alteration of the crust}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+   number = {E11},
+    pages = {8-+},
+      doi = {10.1029/2006JE002835},
+}
+
+@ARTICLE{Joug:07,
+   author = {{Jouglet}, D. and {Poulet}, F. and {Milliken}, R.~E. and {Mustard}, J.~F. and 
+	{Bibring}, J.-P. and {Langevin}, Y. and {Gondet}, B. and {Gomez}, C.
+	},
+    title = "{Hydration state of the Martian surface as seen by Mars Express OMEGA: 1. Analysis of the 3 {$\mu$}m hydration feature}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+   number = {E11},
+    pages = {8-+},
+      doi = {10.1029/2006JE002846},
+}
+
+@ARTICLE{Gend:05,
+   author = {{Gendrin}, A. and {Mangold}, N. and {Bibring}, J.-P. and {Langevin}, Y. and 
+	{Gondet}, B. and {Poulet}, F. and {Bonello}, G. and {Quantin}, C. and 
+	{Mustard}, J. and {Arvidson}, R. and {LeMou{\'e}lic}, S.},
+    title = "{Sulfates in Martian Layered Terrains: The OMEGA/Mars Express View}",
+  journal = {Science},
+     year = 2005,
+   volume = 307,
+    pages = {1587-1591},
+      doi = {10.1126/science.1109087},
+}
+
+@ARTICLE{Encr:05,
+   author = {{Encrenaz}, T. and {Melchiorri}, R. and {Fouchet}, T. and {Drossart}, P. and 
+	{Lellouch}, E. and {Gondet}, B. and {Bibring}, J.-P. and {Langevin}, Y. and 
+	{Titov}, D. and {Ignatiev}, N. and {Forget}, F.},
+    title = "{A mapping of martian water sublimation during early northern summer using OMEGA/Mars Express}",
+  journal = aa,
+     year = 2005,
+   volume = 441,
+    pages = {L9-L12},
+      doi = {10.1051/0004-6361:200500171},
+}
+
+@book{Tara:05,
+  title={{Inverse Problem Theory and Methods for Model Parameter Estimation}},
+  author={Tarantola, A.},
+  year={2005},
+  publisher={Society for Industrial Mathematics}
+}
+
+@ARTICLE{Melc:07,
+   author = {{Melchiorri}, R. and {Encrenaz}, T. and {Fouchet}, T. and {Drossart}, P. and 
+	{Lellouch}, E. and {Gondet}, B. and {Bibring}, J.-P. and {Langevin}, Y. and 
+	{Schmitt}, B. and {Titov}, D. and {Ignatiev}, N.},
+    title = "{Water vapor mapping on Mars using OMEGA/Mars Express}",
+  journal = pss,
+     year = 2007,
+   volume = 55,
+    pages = {333-342},
+      doi = {10.1016/j.pss.2006.05.040},
+}
+
+@ARTICLE{Tsch:08,
+   author = {{Tschimmel}, M. and {Ignatiev}, N.~I. and {Titov}, D.~V. and 
+	{Lellouch}, E. and {Fouchet}, T. and {Giuranna}, M. and {Formisano}, V.
+	},
+    title = "{Investigation of water vapor on Mars with PFS/SW of Mars Express}",
+  journal = {Icarus},
+     year = 2008,
+   volume = 195,
+    pages = {557-575},
+      doi = {10.1016/j.icarus.2008.01.018},
+}
+
+@ARTICLE{Fedo:06water,
+   author = {{Fedorova}, A. and {Korablev}, O. and {Bertaux}, J.-L. and {Rodin}, A. and 
+	{Kiselev}, A. and {Perrier}, S.},
+    title = "{Mars water vapor abundance from SPICAM IR spectrometer: Seasonal and geographic distributions}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+   number = {E10},
+    pages = {9-+},
+      doi = {10.1029/2006JE002695},
+}
+
+@article{Neld:65,
+  title={{A Simplex Method for Function Minimization}},
+  author={Nelder, JA and Mead, R.},
+  journal={The Computer Journal},
+  volume={7},
+  number={4},
+  pages={308},
+  year={1965},
+  publisher={Br Computer Soc}
+}
+
+@article{Mahr:82,
+  title={{Momentum Balance of Gravity Flows}},
+  author={Mahrt, L.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={39},
+  number={12},
+  pages={2701--2711},
+  year={1982},
+  publisher={American Meteorological Society}
+}
+
+
+@ARTICLE{Savi:08,
+   author = {{Savij{\"a}rvi}, H. and {Kauhanen}, J.},
+    title = "{Surface and boundary-layer modelling for the Mars Exploration Rover sites}",
+  journal = {Quarterly Journal of the Royal Meteorological Society},
+     year = 2008,
+   volume = 134,
+    pages = {635-641},
+      doi = {10.1002/qj.232},
+}
+
+@article{Blac:57,
+  title={{Boundary layer wind maxima and their significance for the growth of nocturnal inversions}},
+  author={Blackadar, A.K.},
+  journal={Bull. Amer. Meteor. Soc},
+  volume={38},
+  number={5},
+  pages={283--290},
+  year={1957}
+}
+
+@article{Thor:77,
+  title={{The nocturnal jet}},
+  author={Thorpe, A.J. and Guymer, T.H.},
+  journal={Quarterly Journal of the Royal Meteorological Society},
+  volume={103},
+  number={438},
+  pages={633--653},
+  year={1977},
+  publisher={Royal Meteorological Society}
+}
+
+
+@article{Smit:92,
+  title={{Surface Forcing of the Infrared Cooling Profile over the Tibetan Plateau. Part I: Influence of Relative Longwave Radiative Heating at High Altitude}},
+  author={Smith, E.A. and Shi, L.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={49},
+  number={10},
+  pages={805--822},
+  year={1992},
+  publisher={American Meteorological Society}
+}
+
+@ARTICLE{Balm:06,
+   author = {{Balme}, M. and {Greeley}, R.},
+    title = "{Dust devils on Earth and Mars}",
+  journal = {Reviews of Geophysics},
+     year = 2006,
+   volume = 44,
+    pages = {3003-+},
+      doi = {10.1029/2005RG000188},
+}
+
+@ARTICLE{Mali:01,
+   author = {{Malin}, M.~C. and {Edgett}, K.~S.},
+    title = "{Mars Global Surveyor Mars Orbiter Camera: Interplanetary cruise through primary mission}",
+  journal = jgr,
+     year = 2001,
+   volume = 106,
+    pages = {23429-23570},
+      doi = {10.1029/2000JE001455},
+}
+
+@ARTICLE{Stan:06,
+   author = {{Stanzel}, C. and {P{\"a}tzold}, M. and {Greeley}, R. and {Hauber}, E. and 
+	{Neukum}, G.},
+    title = "{Dust devils on Mars observed by the High Resolution Stereo Camera}",
+  journal = grl,
+     year = 2006,
+   volume = 33,
+    pages = {11202-+},
+      doi = {10.1029/2006GL025816},
+}
+
+@article{Sinc:73,
+  title={{The Lower Structure of Dust Devils}},
+  author={Sinclair, P.C.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={30},
+  number={8},
+  pages={1599--1619},
+  year={1973},
+  publisher={American Meteorological Society}
+}
+
+@ARTICLE{Fish:05,
+   author = {{Fisher}, J.~A. and {Richardson}, M.~I. and {Newman}, C.~E. and 
+	{Szwast}, M.~A. and {Graf}, C. and {Basu}, S. and {Ewald}, S.~P. and 
+	{Toigo}, A.~D. and {Wilson}, R.~J.},
+    title = "{A survey of Martian dust devil activity using Mars Global Surveyor Mars Orbiter Camera images}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2005,
+   volume = 110,
+   number = {E9},
+    pages = {3004-+},
+      doi = {10.1029/2003JE002165},
+}
+
+@ARTICLE{Geis:05,
+   author = {{Geissler}, P.~E.},
+    title = "{Three decades of Martian surface changes}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2005,
+   volume = 110,
+   number = {E9},
+    pages = {2001-+},
+      doi = {10.1029/2004JE002345},
+}
+
+@ARTICLE{Ring:03,
+   author = {{Ringrose}, T.~J. and {Towner}, M.~C. and {Zarnecki}, J.~C.},
+    title = "{Convective vortices on Mars: a reanalysis of Viking Lander 2 meteorological data, sols 1-60}",
+  journal = {Icarus},
+     year = 2003,
+   volume = 163,
+    pages = {78-87},
+      doi = {10.1016/S0019-1035(03)00073-3},
+}
+
+@ARTICLE{Murp:02,
+   author = {{Murphy}, J.~R. and {Nelli}, S.},
+    title = "{Mars Pathfinder convective vortices: Frequency of occurrence}",
+  journal = grl,
+     year = 2002,
+   volume = 29,
+   number = 23,
+    pages = {230000-1},
+}
+
+@ARTICLE{Farr:04,
+   author = {{Farrell}, W.~M. and {Smith}, P.~H. and {Delory}, G.~T. and 
+	{Hillard}, G.~B. and {Marshall}, J.~R. and {Catling}, D. and 
+	{Hecht}, M. and {Tratt}, D.~M. and {Renno}, N. and {Desch}, M.~D. and 
+	{Cummer}, S.~A. and {Houser}, J.~G. and {Johnson}, B.},
+    title = "{Electric and magnetic signatures of dust devils from the 2000-2001 MATADOR desert tests}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2004,
+   volume = 109,
+   number = {E18},
+    pages = {3004-+},
+      doi = {10.1029/2003JE002088},
+}
+
+@ARTICLE{Renn:03,
+   author = {{Renno}, N.~O. and {Wong}, A.-S. and {Atreya}, S.~K. and {de Pater}, I. and 
+	{Roos-Serote}, M.},
+    title = "{Electrical discharges and broadband radio emission by Martian dust devils and dust storms}",
+  journal = grl,
+     year = 2003,
+   volume = 30,
+   number = 22,
+    pages = {220000-1},
+}
+
+@ARTICLE{Gree:06,
+   author = {{Greeley}, R. and {Whelley}, P.~L. and {Arvidson}, R.~E. and 
+	{Cabrol}, N.~A. and {Foley}, D.~J. and {Franklin}, B.~J. and 
+	{Geissler}, P.~G. and {Golombek}, M.~P. and {Kuzmin}, R.~O. and 
+	{Landis}, G.~A. and {Lemmon}, M.~T. and {Neakrase}, L.~D.~V. and 
+	{Squyres}, S.~W. and {Thompson}, S.~D.},
+    title = "{Active dust devils in Gusev crater, Mars: Observations from the Mars Exploration Rover Spirit}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+   number = {E10},
+    pages = {12-+},
+      doi = {10.1029/2006JE002743},
+}
+
+@ARTICLE{Cant:01,
+   author = {{Cantor}, B.~A. and {James}, P.~B. and {Caplinger}, M. and {Wolff}, M.~J.
+	},
+    title = "{Martian dust storms: 1999 Mars Orbiter Camera observations}",
+  journal = jgr,
+     year = 2001,
+   volume = 106,
+    pages = {23653-23688},
+      doi = {10.1029/2000JE001310},
+}
+
+@ARTICLE{Kana:00,
+   author = {{Kanak}, K.~M. and {Lilly}, D.~K. and {Snow}, J.~T.},
+    title = "{The formation of vertical Vortices in the convective boundary layer}",
+  journal = {Quarterly Journal of the Royal Meteorological Society},
+     year = 2000,
+   volume = 126,
+    pages = {2789-2810},
+      doi = {10.1256/smsqj.56909},
+}
+
+@ARTICLE{Renn:00,
+   author = {{Renno}, N.~O. and {Nash}, A.~A. and {Lunine}, J. and {Murphy}, J.},
+    title = "{Martian and terrestrial dust devils: Test of a scaling theory using Pathfinder data}",
+  journal = jgr,
+     year = 2000,
+   volume = 105,
+    pages = {1859-1866},
+      doi = {10.1029/1999JE001037},
+}
+
+@ARTICLE{Thor:03,
+   author = {{Thorpe}, A.~J. and {Volkert}, H. and {Ziemianski}, M.~J.},
+    title = "{The Bjerknes' Circulation Theorem: A Historical Perspective.}",
+  journal = {Bulletin of the American Meteorological Society, vol.~84, Issue 4, pp.471-480},
+     year = 2003,
+   volume = 84,
+    pages = {471-480},
+}
+
+@article{Flea:50,
+  title={{A theory of air drainage}},
+  author={Fleagle, R.G.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={7},
+  number={3},
+  pages={227--232},
+  year={1950},
+  publisher={American Meteorological Society}
+}
+
+@article{Mani:79,
+  title={{A Model of Katabatic Winds}},
+  author={Manins, PC and Sawford, BL},
+  journal={Journal of the Atmospheric Sciences},
+  volume={36},
+  number={4},
+  pages={619--630},
+  year={1979},
+  publisher={American Meteorological Society}
+}
+
+@ARTICLE{Brom:01,
+   author = {{Bromwich}, D.~H. and {Cassano}, J.~J. and {Klein}, T. and {Heinemann}, G. and 
+	{Hines}, K.~M. and {Steffen}, K. and {Box}, J.~E.},
+    title = "{Mesoscale Modeling of Katabatic Winds over Greenland with the Polar MM5}",
+  journal = {Monthly Weather Review},
+     year = 2001,
+   volume = 129,
+    pages = {2290--2309},
+      doi = {10.1175/1520-0493(2001)129},
+}
+
+@article{Ball:56,
+  title={{The Theory of Strong Katabatic Winds}},
+  author={Ball, FK},
+  journal={Australian Journal of Physics},
+  volume={9},
+  pages={373},
+  year={1956}
+}
+
+@article{Pran:42,
+  title={{Fuehrer durch die Stromunglehre. Braunschweig}},
+  author={Prandtl, L.},
+  journal={Viewing und Sohn},
+  volume={382},
+  year={1942}
+}
+
+@article{Defa:49,
+  title={{Zur Theorie der Hangwinde, nebst Bemerkungen zur Theorie der Berg-und Talwinde}},
+  author={Defant, F.},
+  journal={Archiv f{\"u}r Meteorologie, Geophysik und Bioklimatologie Serie A,},
+  volume={1},
+  number={3-4},
+  pages={421--450},
+  year={1949}
+}
+
+@article{Ye:87,
+  title={{Effects of Atmospheric Thermal Stability and Slope Steepness on the Development of Daytime Thermally Induced Upslope Flow}},
+  author={Ye, ZJ and Segal, M. and Pielke, RA},
+  journal={Journal of the Atmospheric Sciences},
+  volume={44},
+  number={22},
+  pages={3341--3354},
+  year={1987},
+  publisher={American Meteorological Society}
+}
+
+@ARTICLE{Parm:04,
+   author = {{Parmhed}, O. and {Oerlemans}, J. and {Grisogono}, B.},
+    title = "{Describing surface fluxes in katabatic flow on Breidamerkurj{\"o}kull, Iceland}",
+  journal = {Quarterly Journal of the Royal Meteorological Society},
+     year = 2004,
+   volume = 130,
+    pages = {1137-1151},
+}
+
+@ARTICLE{Pari:84,
+   author = {{Parish}, T.~R.},
+    title = "{A Numerical Study of Strong Katabatic Winds over Antarctica}",
+  journal = {Monthly Weather Review},
+     year = 1984,
+   volume = 112,
+    pages = {545-+},
+      doi = {10.1175/1520-0493(1984)112},
+}
+
+@ARTICLE{Stip:07,
+   author = {{Stiperski}, I. and {Kav{\v c}i{\v c}}, I. and {Grisogono}, B. and 
+	{Durran}, D.~R.},
+    title = "{Including Coriolis effects in the Prandtl model for katabatic flow}",
+  journal = {Quarterly Journal of the Royal Meteorological Society},
+     year = 2007,
+   volume = 133,
+    pages = {101-106},
+      doi = {10.1002/qj.19},
+}
+
+@ARTICLE{Siil:99,
+   author = {{Siili}, T. and {Haberle}, R.~M. and {Murphy}, J.~R. and {Savijarvi}, H.
+	},
+    title = "{Modelling of the combined late-winter ice cap edge and slope winds in Mars Hellas and Argyre regions}",
+  journal = pss,
+     year = 1999,
+   volume = 47,
+    pages = {951-970},
+}
+
+@ARTICLE{Frit:06,
+   author = {{Fritts}, D.~C. and {Wang}, L. and {Tolson}, R.~H.},
+    title = "{Mean and gravity wave structures and variability in the Mars upper atmosphere inferred from Mars Global Surveyor and Mars Odyssey aerobraking densities}",
+  journal = {Journal of Geophysical Research (Space Physics)},
+     year = 2006,
+   volume = 111,
+   number = {A10},
+    pages = {12304-+},
+      doi = {10.1029/2006JA011897},
+}
+
+@article{Quen:47,
+  title={{Theory of perturbations in stratified currents with applications to airflow over mountain barriers}},
+  author={Queney, P.},
+  journal={Misc. Rep},
+  volume={23},
+  year={1947}
+}
+
+@article{Pirr:76,
+  title={{Martian atmospheric Lee waves}},
+  author={Pirraglia, J.A.},
+  journal={Icarus},
+  volume={27},
+  number={4},
+  pages={517--530},
+  year={1976},
+  publisher={Elsevier}
+}
+
+@article{Bene:98,
+  title={{Dynamic Characteristics of Regional Flows around the Pyr{\'e}n{\'e}es in View of the PYREX Experiment. Part I: Analysis of the Pressure and Wind Fields and Experimental Assessment of the Applicability of the Linear Theory}},
+  author={B{\'e}nech, B. and Koffi, E. and Druilhet, A. and Durand, P. and Bessemoulin, P. and Campins, J. and Jansa, A. and Terliuc, B.},
+  journal={Journal of Applied Meteorology},
+  volume={37},
+  number={1},
+  pages={32--52},
+  year={1998},
+  publisher={NOAA Central Library, Department of Commerce}
+}
+
+@article{Smol:88,
+  title={{On the Dynamics of Hawaiian Cloud Bands: Island Forcing}},
+  author={Smolarkiewicz, P.K. and Rasmussen, R.M. and Clark, T.L.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={45},
+  number={13},
+  pages={1872--1905},
+  year={1988},
+  publisher={American Meteorological Society}
+}
+
+@article{Lott:98,
+  title={{Linear mountain drag and averaged pseudo-momentum flux profiles in the presence of trapped lee waves}},
+  author={Lott, F.},
+  journal={Tellus A},
+  volume={50},
+  number={1},
+  pages={12--25},
+  year={1998},
+  publisher={Blackwell Synergy}
+}
+
+@ARTICLE{Poul:00,
+   author = {{Poulos}, G.~S. and {Bossert}, J.~E. and {McKee}, T.~B. and 
+	{Pielke}, R.~A.},
+    title = "{The Interaction of Katabatic Flow and Mountain Waves. Part I: Observations and Idealized Simulations.}",
+  journal = {Journal of Atmospheric Sciences},
+     year = 2000,
+   volume = 57,
+    pages = {1919-1936},
+}
+
+@article{Busi:71,
+  title={{Flux-Profile Relationships in the Atmospheric Surface Layer}},
+  author={Businger, JA and Wyngaard, JC and Izumi, Y. and Bradley, EF},
+  journal={Journal of the Atmospheric Sciences},
+  volume={28},
+  number={2},
+  pages={181--189},
+  year={1971},
+  publisher={American Meteorological Society}
+}
+
+@ARTICLE{Glen:03,
+   author = {{Glenar}, D.~A. and {Samuelson}, R.~E. and {Pearl}, J.~C. and 
+	{Bjoraker}, G.~L. and {Blaney}, D.},
+    title = "{Spectral imaging of martian water ice clouds and their diurnal behavior during the 1999 aphelion season}",
+  journal = {Icarus},
+     year = 2003,
+   volume = 161,
+    pages = {297-318},
+      doi = {10.1016/S0019-1035(02)00046-5},
+}
+
+@article{Maso:89,
+  title={{Large-Eddy Simulation of the Convective Atmospheric Boundary Layer}},
+  author={Mason, PJ},
+  journal={Journal of the Atmospheric Sciences},
+  volume={46},
+  number={11},
+  pages={1492--1516},
+  year={1989},
+  publisher={American Meteorological Society}
+}
+
+@article{Will:79,
+  title={{Laboratory observations of turbulent penetrative-convection planforms}},
+  author={Willis, GE and Deardorff, JW},
+  journal={Journal of Geophysical Research},
+  volume={84},
+  number={C1},
+  pages={295--302},
+  year={1979}
+}
+
+@ARTICLE{Newm:02,
+   author = {{Newman}, C.~E. and {Lewis}, S.~R. and {Read}, P.~L. and {Forget}, F.
+	},
+    title = "{Modeling the Martian dust cycle 2. Multiannual radiatively active dust transport simulations}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2002,
+   volume = 107,
+    pages = {5124-+},
+      doi = {10.1029/2002JE001920},
+}
+
+@ARTICLE{Gree:03,
+   author = {{Greeley}, R. and {Kuzmin}, R.~O. and {Rafkin}, S.~C.~R. and 
+	{Michaels}, T.~I. and {Haberle}, R.},
+    title = "{Wind-related features in Gusev crater, Mars}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2003,
+   volume = 108,
+   number = {E12},
+    pages = {8077},
+      doi = {10.1029/2002JE002006},
+}
+
+@article{Smit:93grubi,
+  title={{Aerial Observations of Hawaii's Wake}},
+  author={Smith, R.B. and Grubi{\v{s}}i{\'c}, V.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={50},
+  number={22},
+  pages={3728--3750},
+  year={1993},
+  publisher={American Meteorological Society}
+}
+
+
+@article{Rotu:99,
+  title={{Vorticity and Potential Vorticity in Mountain Wakes}},
+  author={Rotunno, R. and Grubi{\v{s}}i{\'c}, V. and Smolarkiewicz, PK},
+  journal={Journal of the Atmospheric Sciences},
+  volume={56},
+  number={16},
+  pages={2796--2810},
+  year={1999},
+  publisher={American Meteorological Society}
+}
+
+@article{Spig:08grl,
+  title={{Fast and accurate estimation of solar irradiance on Martian slopes}},
+  author={Spiga, A. and Forget, F.},
+  journal=grl,
+  volume={35},
+  pages={L15201},
+  year={2008},
+}
+
+@article{Smit:08,
+  title={Spacecraft Observations of the Martian Atmosphere},
+  author={Smith, M.~D.},
+  journal={Annu. Rev. Earth Planet. Sci},
+  year={2008},
+  volume={36},
+  pages={191--219}
+}
+
+@ARTICLE{Poll:76,
+   author = {{Pollack}, J.~B. and {Leovy}, C.~B. and {Mintz}, Y.~H. and {van Camp}, W.},
+    title = "{Winds on Mars during the Viking season - Predictions based on a general circulation model with topography}",
+  journal = grl,
+     year = 1976,
+   volume = 3,
+    pages = {479-482},
+}
+
+@ARTICLE{Balm:03,
+   author = {{Balme}, M.~R. and {Whelley}, P.~L. and {Greeley}, R.},
+    title = "{Mars: Dust devil track survey in Argyre Planitia and Hellas Basin}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2003,
+   volume = 108,
+    pages = {5086-+},
+      doi = {10.1029/2003JE002096},
+}
+
+@misc{Pari:03,
+  title={{Katabatic winds. Encyclopedia of Atmospheric Sciences, JR Holton, J. Pyle, and J. A. Curry, Eds}},
+  author={Parish, T.~R.},
+  year={2003},
+  publisher={Academic Press}
+}
+
+@misc{Durr:03enc,
+  title={{Lee waves and mountain waves. Encyclopedia of Atmospheric Sciences, JR Holton, J. Pyle, and J. A. Curry, Eds}},
+  author={Durran, D.},
+  year={2003},
+  publisher={Academic Press}
+}
+
+@ARTICLE{Forg:06blague,
+   author = {{Forget}, F. and {Schmitt}, B.},
+    title = "{Katabatic winds in Greenland: the no-wind case.}",
+  journal = {Journal of Advanced Kite-Surfing},
+     year = 2006,
+   volume = 66,
+    pages = {99-+},
+}
+
+
+@ARTICLE{Vinc:08,
+   author = {{Vincendon}, M. and {Langevin}, Y. and {Poulet}, F. and {Bibring}, J.-P. and 
+	{Gondet}, B. and {Jouglet}, D. and {OMEGA Team}},
+    title = "{Dust aerosols above the south polar cap of Mars as seen by OMEGA}",
+  journal = {Icarus},
+     year = 2008,
+   volume = 196,
+    pages = {488-505},
+      doi = {10.1016/j.icarus.2007.11.034},
+}
+
+@INPROCEEDINGS{Joug:08,
+   author = {{Jouglet}, D. and {Poulet}, F. and {Langevin}, Y. and {Bibring}, J.-P. and {Gondet}, B. and {Vincendon}, M.},
+    title = "{Hydration of the Martian Southern Hemiphere Using the OMEGA Dataset}",
+booktitle = {Lunar and Planetary Institute Conference Abstracts},
+     year = 2008,
+   series = {Lunar and Planetary Institute Conference Abstracts},
+   volume = 39,
+    pages = {1752-+},
+}
+
+@article{Rein:08,
+  title={{Estimating Topographic Blocking Using a Froude Number When the Static Stability Is Nonuniform}},
+  author={Reinecke, P.A. and Durran, D.R.},
+  journal={Journal of the Atmospheric Sciences},
+  volume={65},
+  number={3},
+  pages={1035--1048},
+  year={2008},
+  publisher={American Meteorological Society}
+}
+
+@article{Harr:08,
+  title={{Lee vortices in evolving large-scale flows}},
+  author={Harris, L.M.},
+  journal={13th Conference on Mountain Meteorology},
+  year={2008}
+}
+
+
+@ARTICLE{Bell:06jim,
+   author = {{Bell}, J.~F. and {Savransky}, D. and {Wolff}, M.~J.},
+    title = "{Chromaticity of the Martian sky as observed by the Mars Exploration Rover Pancam instruments}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+   number = {E10},
+    pages = {12-+},
+      doi = {10.1029/2006JE002687},
+}
+
+@article{Smit:31,
+  title={{The CIE colorimetric standards and their use}},
+  author={Smith, T. and Guild, J.},
+  journal={Transactions of the Optical Society},
+  volume={33},
+  pages={73--134},
+  year={1931},
+  publisher={Institute of Physics Publishing}
+}
+
+@misc{Stok:96,
+  author={Stokes, M. and Anderson, M. and Chandrasekar, S. and Motta, R.},
+  title={A standard default color space for the Internet sRGB},
+  year={1996},
+  howpublished = {Microsoft and Hewlett-Packard Joint Report, Version 1.10. (Available at {\tt http://www.w3.org/Graphics/Color/sRGB})}
+}
+
+@ARTICLE{Cola:08,
+   author = {{Colaprete}, A. and {Barnes}, J.~R. and {Haberle}, R.~M. and 
+	{Montmessin}, F.},
+   title = "{CO$_{2}$ clouds, CAPE and convection on Mars: Observations and general circulation modeling}",
+   journal = pss,
+   year = 2008,
+   volume = 56,
+   pages = {150-180},
+   doi = {10.1016/j.pss.2007.08.010},
+}
+
+@article{Dyud:08,
+  title={{Dynamics of Saturn's South Polar Vortex}},
+  author={Dyudina, U.A. and Ingersoll, A.P. and Ewald, S.P. and Vasavada, A.R. and West, R.A. and Del Genio, A.D. and Barbara, J.M. and Porco, C.C. and Achterberg, R.K. and Flasar, F.M. and others},
+  journal={Science},
+  volume={319},
+  number={5871},
+  pages={1801},
+  year={2008},
+  publisher={AAAS}
+}
+
+@article{Reut:07,
+  title={{Jupiter Cloud Composition, Stratification, Convection, and Wave Motion: A View from New Horizons}},
+  author={Reuter, DC and Simon-Miller, AA and Lunsford, A. and Baines, KH and Cheng, AF and Jennings, DE and Olkin, CB and Spencer, JR and Stern, SA and Weaver, HA and others},
+  journal={Science},
+  volume={318},
+  number={5848},
+  pages={223},
+  year={2007},
+  publisher={AAAS}
+}
+
+@article{Bart:07,
+  title={{TRAMS: A new dynamic cloud model for Titan's methane clouds}},
+  author={Barth, E.L. and Rafkin, S.C.R.},
+  journal=grl,
+  volume={34},
+  pages={L03203},
+  year={2007}
+}
+
+@article{Sanc:08,
+  title={{Variable winds on Venus mapped in three dimensions}},
+  author={S{\'a}nchez-Lavega, A. and Hueso, R. and Piccioni, G. and Drossart, P. and Peralta, J. and P{\'e}rez-Hoyos, S. and Wilson, CF and Taylor, FW and Baines, KH and Luz, D. and others},
+  journal={Geophysical Research Letters},
+  volume={35},
+  number={13},
+  year={2008}
+}
+
+@article{Hayw:07,
+  title={{Mars Global Digital Dune Database and initial science results}},
+  author={Hayward, R.K. and Mullins, K.F. and Fenton, L.K. and Hare, T.M. and Titus, T.N. and Bourke, M.C. and Colaprete, A. and Christensen, P.R.},
+  journal={Journal of Geophysical Research},
+  volume={112},
+  number={E11},
+  year={2007}
+}
+
+@article{Bant:04,
+  title={{Nocturnal Low-Level Jet in a Mountain Basin Complex. Part I: Evolution and Effects on Local Flows}},
+  author={Banta, R.M. and Darby, L.S. and Fast, J.D. and Pinto, J.O. and Whiteman, C.D. and Shaw, W.J. and Orr, B.W.},
+  journal={Journal of Applied Meteorology},
+  volume={43},
+  number={10},
+  pages={1348--1365},
+  year={2004},
+  publisher={NOAA Central Library, Department of Commerce}
+}
+
+@misc{Egge:03,
+  title={{Valley winds. Encyclopedia of Atmospheric Sciences, JR Holton, J. Pyle, and J. A. Curry, Eds}},
+  author={Egger, J.},
+  year={2003},
+  publisher={Academic Press}
+}
+
+@INPROCEEDINGS{Spig:03,
+   author = {{Haberle}, R.~M. and {Montmessin}, F. and {Forget}, F. and {Spiga}, A. and 
+	{Colaprete}, A.},
+   title = "{Obliquity Driven Climate Change in Mars' Recent Past}",
+booktitle = {Third International Conference on Mars Polar Science and Exploration},
+   year = 2003,
+   editor = {{Clifford}, S. and {Doran}, P. and {Fisher}, D. and {Herd}, C.
+	},
+    pages = {8060-+},
+}
+
+@ARTICLE{Lian:08,
+   author = {{Lian}, Y. and {Showman}, A.~P.},
+   title = "{Deep jets on gas-giant planets}",
+   journal = {Icarus},
+   year = 2008,
+   volume = 194,
+   pages = {597-615},
+   doi = {10.1016/j.icarus.2007.10.014},
+}
+
+@ARTICLE{Heim:05,
+   author = {{Heimpel}, M. and {Aurnou}, J. and {Wicht}, J.},
+   title = "{Simulation of equatorial and high-latitude jets on Jupiter in a deep convection model}",
+   journal = {Nature},
+   year = 2005,
+   volume = 438,
+    pages = {193-196},
+}
+
+@ARTICLE{Fouc:08,
+   author = {{Fouchet}, T. and {Guerlet}, S. and {Strobel}, D.~F. and {Simon-Miller}, A.~A. and 
+	{B{\'e}zard}, B. and {Flasar}, F.~M.},
+   title = "{An equatorial oscillation in Saturn's middle atmosphere}",
+   journal = {Nature},
+   year = 2008,
+   volume = 453,
+   pages = {200-202},
+   doi = {10.1038/nature06912},
+}
+
+@ARTICLE{Spig:08gw,
+   author = {{Spiga}, A. and {Teitelbaum}, H. and {Zeitlin}, V.},
+   title = "{Identification of the sources of inertia-gravity waves in the Andes Cordillera region}",
+   journal = {Annales Geophysicae},
+   year = 2008,
+   volume = 26,
+   pages = {2551-2568},
+}
+
+@ARTICLE{Lewi:07,
+   author = {{Lewis}, S.~R. and {Read}, P.~L. and {Conrath}, B.~J. and {Pearl}, J.~C. and 
+	{Smith}, M.~D.},
+    title = "{Assimilation of thermal emission spectrometer atmospheric data during the Mars Global Surveyor aerobraking period}",
+  journal = {Icarus},
+     year = 2007,
+   volume = 192,
+    pages = {327-347},
+      doi = {10.1016/j.icarus.2007.08.009},
+}
+
+@ARTICLE{Flas:05,
+   author = {{Flasar}, F.~M. and {Achterberg}, R.~K. and {Conrath}, B.~J. and 
+	{Pearl}, J.~C. and {Bjoraker}, G.~L. and {Jennings}, D.~E. and 
+	{Romani}, P.~N. and {Simon-Miller}, A.~A. and {Kunde}, V.~G. and 
+	{Nixon}, C.~A. and {B{\'e}zard}, B. and {Orton}, G.~S. and {Spilker}, L.~J. and 
+	{Spencer}, J.~R. and {Irwin}, P.~G.~J. and {Teanby}, N.~A. and 
+	{Owen}, T.~C. and {Brasunas}, J. and {Segura}, M.~E. and {Carlson}, R.~C. and 
+	{Mamoutkine}, A. and {Gierasch}, P.~J. and {Schinder}, P.~J. and 
+	{Showalter}, M.~R. and {Ferrari}, C. and {Barucci}, A. and {Courtin}, R. and 
+	{Coustenis}, A. and {Fouchet}, T. and {Gautier}, D. and {Lellouch}, E. and 
+	{Marten}, A. and {Prang{\'e}}, R. and {Strobel}, D.~F. and {Calcutt}, S.~B. and 
+	{Read}, P.~L. and {Taylor}, F.~W. and {Bowles}, N. and {Samuelson}, R.~E. and 
+	{Abbas}, M.~M. and {Raulin}, F. and {Ade}, P. and {Edgington}, S. and 
+	{Pilorz}, S. and {Wallis}, B. and {Wishnow}, E.~H.},
+    title = "{Temperatures, Winds, and Composition in the Saturnian System}",
+  journal = {Science},
+     year = 2005,
+   volume = 307,
+    pages = {1247-1251},
+      doi = {10.1126/science.1105806},
+}
+
+@ARTICLE{Porc:05,
+   author = {{Porco}, C.~C. and {Baker}, E. and {Barbara}, J. and {Beurle}, K. and 
+	{Brahic}, A. and {Burns}, J.~A. and {Charnoz}, S. and {Cooper}, N. and 
+	{Dawson}, D.~D. and {Del Genio}, A.~D. and {Denk}, T. and {Dones}, L. and 
+	{Dyudina}, U. and {Evans}, M.~W. and {Giese}, B. and {Grazier}, K. and 
+	{Helfenstein}, P. and {Ingersoll}, A.~P. and {Jacobson}, R.~A. and 
+	{Johnson}, T.~V. and {McEwen}, A. and {Murray}, C.~D. and {Neukum}, G. and 
+	{Owen}, W.~M. and {Perry}, J. and {Roatsch}, T. and {Spitale}, J. and 
+	{Squyres}, S. and {Thomas}, P. and {Tiscareno}, M. and {Turtle}, E. and 
+	{Vasavada}, A.~R. and {Veverka}, J. and {Wagner}, R. and {West}, R.
+	},
+    title = "{Cassini Imaging Science: Initial Results on Saturn's Atmosphere}",
+  journal = {Science},
+     year = 2005,
+   volume = 307,
+    pages = {1243-1247},
+      doi = {10.1126/science.1107691},
+}
+
+@ARTICLE{Porc:03,
+   author = {{Porco}, C.~C. and {West}, R.~A. and {McEwen}, A. and {Del Genio}, A.~D. and 
+	{Ingersoll}, A.~P. and {Thomas}, P. and {Squyres}, S. and {Dones}, L. and 
+	{Murray}, C.~D. and {Johnson}, T.~V. and {Burns}, J.~A. and 
+	{Brahic}, A. and {Neukum}, G. and {Veverka}, J. and {Barbara}, J.~M. and 
+	{Denk}, T. and {Evans}, M. and {Ferrier}, J.~J. and {Geissler}, P. and 
+	{Helfenstein}, P. and {Roatsch}, T. and {Throop}, H. and {Tiscareno}, M. and 
+	{Vasavada}, A.~R.},
+    title = "{Cassini Imaging of Jupiter's Atmosphere, Satellites, and Rings}",
+  journal = {Science},
+     year = 2003,
+   volume = 299,
+    pages = {1541-1547},
+      doi = {10.1126/science.1079462},
+}
+
+@ARTICLE{Flas:04,
+   author = {{Flasar}, F.~M. and {Kunde}, V.~G. and {Achterberg}, R.~K. and 
+	{Conrath}, B.~J. and {Simon-Miller}, A.~A. and {Nixon}, C.~A. and 
+	{Gierasch}, P.~J. and {Romani}, P.~N. and {B{\'e}zard}, B. and 
+	{Irwin}, P. and {Bjoraker}, G.~L. and {Brasunas}, J.~C. and 
+	{Jennings}, D.~E. and {Pearl}, J.~C. and {Smith}, M.~D. and 
+	{Orton}, G.~S. and {Spilker}, L.~J. and {Carlson}, R. and {Calcutt}, S.~B. and 
+	{Read}, P.~L. and {Taylor}, F.~W. and {Parrish}, P. and {Barucci}, A. and 
+	{Courtin}, R. and {Coustenis}, A. and {Gautier}, D. and {Lellouch}, E. and 
+	{Marten}, A. and {Prang{\'e}}, R. and {Biraud}, Y. and {Fouchet}, T. and 
+	{Ferrari}, C. and {Owen}, T.~C. and {Abbas}, M.~M. and {Samuelson}, R.~E. and 
+	{Raulin}, F. and {Ade}, P. and {C{\'e}sarsky}, C.~J. and {Grossman}, K.~U. and 
+	{Coradini}, A.},
+    title = "{An intense stratospheric jet on Jupiter}",
+  journal = {Nature},
+     year = 2004,
+   volume = 427,
+    pages = {132-135},
+}
+
+@ARTICLE{Li:08,
+   author = {{Li}, L. and {Gierasch}, P.~J. and {Achterberg}, R.~K. and 
+	{Conrath}, B.~J. and {Flasar}, F.~M. and {Vasavada}, A.~R. and 
+	{Ingersoll}, A.~P. and {Banfield}, D. and {Simon-Miller}, A.~A. and 
+	{Fletcher}, L.~N.},
+    title = "{Strong jet and a new thermal wave in Saturn's equatorial stratosphere}",
+  journal = grl,
+     year = 2008,
+   volume = 35,
+    pages = {23208-+},
+      doi = {10.1029/2008GL035515},
+}
+
+@ARTICLE{Leov:91,
+   author = {{Leovy}, C.~B. and {Friedson}, A.~J. and {Orton}, G.~S.},
+    title = "{The quasiquadrennial oscillation of Jupiter's equatorial stratosphere}",
+  journal = {Nature},
+     year = 1991,
+   volume = 354,
+    pages = {380-382},
+      doi = {10.1038/354380a0},
+}
+
+@ARTICLE{Howe:07,
+   author = {{Howett}, C.~J.~A. and {Irwin}, P.~G.~J. and {Teanby}, N.~A. and 
+	{Simon-Miller}, A. and {Calcutt}, S.~B. and {Fletcher}, L.~N. and 
+	{de Kok}, R.},
+    title = "{Meridional variations in stratospheric acetylene and ethane in the southern hemisphere of the saturnian atmosphere as determined from Cassini/CIRS measurements}",
+  journal = {Icarus},
+     year = 2007,
+   volume = 190,
+    pages = {556-572},
+      doi = {10.1016/j.icarus.2007.03.009},
+}
+
+@ARTICLE{Sanc:08,
+   author = {{S{\'a}nchez-Lavega}, A. and {Orton}, G.~S. and {Hueso}, R. and 
+	{Garc{\'{\i}}a-Melendo}, E. and {P{\'e}rez-Hoyos}, S. and {Simon-Miller}, A. and 
+	{Rojas}, J.~F. and {G{\'o}mez}, J.~M. and {Yanamandra-Fisher}, P. and 
+	{Fletcher}, L. and {Joels}, J. and {Kemerer}, J. and {Hora}, J. and 
+	{Karkoschka}, E. and {de Pater}, I. and {Wong}, M.~H. and {Marcus}, P.~S. and 
+	{Pinilla-Alonso}, N. and {Carvalho}, F. and {Go}, C. and {Parker}, D. and 
+	{Salway}, M. and {Valimberti}, M. and {Wesley}, A. and {Pujic}, Z.
+	},
+    title = "{Depth of a strong jovian jet from a planetary-scale disturbance driven by storms}",
+  journal = {Nature},
+     year = 2008,
+   volume = 451,
+    pages = {437-440},
+      doi = {10.1038/nature06533},
+}
+
+@ARTICLE{Dyud:07,
+   author = {{Dyudina}, U.~A. and {Ingersoll}, A.~P. and {Ewald}, S.~P. and 
+	{Porco}, C.~C. and {Fischer}, G. and {Kurth}, W. and {Desch}, M. and 
+	{Del Genio}, A. and {Barbara}, J. and {Ferrier}, J.},
+    title = "{Lightning storms on Saturn observed by Cassini ISS and RPWS during 2004 2006}",
+  journal = {Icarus},
+     year = 2007,
+   volume = 190,
+    pages = {545-555},
+      doi = {10.1016/j.icarus.2007.03.035},
+}
+
+@ARTICLE{Show:08,
+   author = {{Showman}, A.~P. and {Cooper}, C.~S. and {Fortney}, J.~J. and 
+	{Marley}, M.~S.},
+    title = "{Atmospheric Circulation of Hot Jupiters: Three-dimensional Circulation Models of HD 209458b and HD 189733b with Simplified Forcing}",
+  journal = apj,
+archivePrefix = "arXiv",
+   eprint = {0802.0327},
+     year = 2008,
+   volume = 682,
+    pages = {559-576},
+      doi = {10.1086/589325},
+}
+
+@ARTICLE{Pera:08,
+   author = {{Peralta}, J. and {Hueso}, R. and {S{\'a}nchez-Lavega}, A. and 
+	{Piccioni}, G. and {Lanciano}, O. and {Drossart}, P.},
+    title = "{Characterization of mesoscale gravity waves in the upper and lower clouds of Venus from VEX-VIRTIS images}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2008,
+   volume = 113,
+    pages = {0-+},
+      doi = {10.1029/2008JE003185},
+}
+
+@ARTICLE{Rafk:09,
+   author = {{Rafkin}, S.~C.~R.},
+    title = "{A positive radiative-dynamic feedback mechanism for the maintenance and growth of Martian dust storms}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2009,
+   volume = 114,
+   number = {E13},
+    pages = {1009-+},
+      doi = {10.1029/2008JE003217},
+}
+
+
+@ARTICLE{Hins:08,
+   author = {{Hinson}, D.~P. and {P{\"a}tzold}, M. and {Tellmann}, S. and 
+	{H{\"a}usler}, B. and {Tyler}, G.~L.},
+    title = "{The depth of the convective boundary layer on Mars}",
+  journal = {Icarus},
+     year = 2008,
+   volume = 198,
+    pages = {57-66},
+      doi = {10.1016/j.icarus.2008.07.003},
+}
+
+@ARTICLE{Li:00qqo,
+   author = {{Li}, X. and {Read}, P.~L.},
+    title = "{A mechanistic model of the quasi-quadrennial oscillation in Jupiter's stratosphere}",
+  journal = pss,
+     year = 2000,
+   volume = 48,
+    pages = {637-669},
+}
+
+@ARTICLE{Hues:01,
+   author = {{Hueso}, R. and {S{\'a}nchez-Lavega}, A.},
+    title = "{A Three-Dimensional Model of Moist Convection for the Giant Planets: The Jupiter Case}",
+  journal = {Icarus},
+     year = 2001,
+   volume = 151,
+    pages = {257-274},
+      doi = {10.1006/icar.2000.6606},
+}
+
+@ARTICLE{Russ:06,
+   author = {{Russell}, C.~T. and {Strangeway}, R.~J. and {Zhang}, T.~L.},
+    title = "{Lightning detection on the Venus Express mission}",
+  journal = pss,
+     year = 2006,
+   volume = 54,
+    pages = {1344-1351},
+      doi = {10.1016/j.pss.2006.04.026},
+}
+
+@ARTICLE{Ring:07,
+   author = {{Ringrose}, T.~J. and {Patel}, M.~R. and {Towner}, M.~C. and 
+	{Balme}, M. and {Metzger}, S.~M. and {Zarnecki}, J.~C.},
+    title = "{The meteorological signatures of dust devils on Mars}",
+  journal = pss,
+     year = 2007,
+   volume = 55,
+    pages = {2151-2163},
+      doi = {10.1016/j.pss.2007.07.002},
+}
+
+@ARTICLE{Stan:08,
+   author = {{Stanzel}, C. and {P{\"a}tzold}, M. and {Williams}, D.~A. and 
+	{Whelley}, P.~L. and {Greeley}, R. and {Neukum}, G. and {The HRSC Co-Investigator Team}
+	},
+    title = "{Dust devil speeds, directions of motion and general characteristics observed by the Mars Express High Resolution Stereo Camera}",
+  journal = {Icarus},
+     year = 2008,
+   volume = 197,
+    pages = {39-51},
+      doi = {10.1016/j.icarus.2008.04.017},
+}
+
+@INPROCEEDINGS{Wolk:08,
+   author = {
+{Wolkenberg}, P. and 
+{Formisano}, V. and 
+{Rinaldi}, G. and 
+{D'Amore}, M. and 
+{Geminale}, A. and 
+{Montabone}, L. and 
+{Spiga}, A. and 
+{Michaels}, T.
+}, 
+    title = "{An atmospheric hot ring around Olympus Mons – comparison with mesoscale models}",
+booktitle = {3rd Internat.Workshop on the Mars Atmosph.: Modeling and Observations, Williamsburg, USA},
+     year = 2008,
+}
+
+@ARTICLE{Will:03,
+   author = {{Williams}, G.~P.},
+    title = "{Jovian Dynamics. Part III: Multiple, Migrating, and Equatorial Jets.}",
+  journal = {Journal of Atmospheric Sciences},
+     year = 2003,
+   volume = 60,
+    pages = {1270-1296},
+      doi = {10.1175/1520-0469(2003)60},
+}
+
+@ARTICLE{Yano:05,
+   author = {{Yano}, J.-I. and {Talagrand}, O. and {Drossart}, P.},
+    title = "{Deep two-dimensional turbulence: An idealized model for atmospheric jets of the giant outer planets}",
+  journal = {Geophysical and Astrophysical Fluid Dynamics},
+     year = 2005,
+   volume = 99,
+    pages = {137-150},
+      doi = {10.1080/03091920412331336398},
+}
+
+@ARTICLE{Li:06,
+   author = {{Li}, L. and {Ingersoll}, A.~P. and {Huang}, X.},
+    title = "{Interaction of moist convection with zonal jets on Jupiter and Saturn}",
+  journal = {Icarus},
+     year = 2006,
+   volume = 180,
+    pages = {113-123},
+      doi = {10.1016/j.icarus.2005.08.016},
+}
+
+@ARTICLE{Lian:10,
+   author = {{Lian}, Y. and {Showman}, A.~P.},
+    title = "{Generation of equatorial jets by large-scale latent heating on the giant planets}",
+  journal = {Icarus},
+archivePrefix = "arXiv",
+   eprint = {0910.3065},
+     year = 2010,
+   volume = 207,
+    pages = {373-393},
+      doi = {10.1016/j.icarus.2009.10.006},
+}
+
+
+@ARTICLE{Lebo:08gcm,
+   author = {{Lebonnois}, S. and {Forget}, F. and {Hourdin}, F.},
+    title = "{Using Terrestrial GCMs to Understand Climate on Venus, Mars and Titan}",
+  journal = {AGU Fall Meeting Abstracts},
+     year = 2008,
+    pages = {B2+},
+}
+
+@ARTICLE{Hour:04,
+   author = {{Hourdin}, F. and {Lebonnois}, S. and {Luz}, D. and {Rannou}, P.
+	},
+    title = "{Titan's stratospheric composition driven by condensation and dynamics}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2004,
+   volume = 109,
+    pages = {12005-+},
+      doi = {10.1029/2004JE002282},
+}
+
+@ARTICLE{Hour:06,
+   author = {{Hourdin}, F. and {Musat}, I. and {Bony}, S. and {Braconnot}, P. and 
+	{Codron}, F. and {Dufresne}, J.-L. and {Fairhead}, L. and {Filiberti}, M.-A. and 
+	{Friedlingstein}, P. and {Grandpeix}, J.-Y. and {Krinner}, G. and 
+	{Levan}, P. and {Li}, Z.-X. and {Lott}, F.},
+    title = "{The LMDZ4 general circulation model: climate performance and sensitivity to parametrized physics with emphasis on tropical convection}",
+  journal = {Climate Dynamics},
+     year = 2006,
+   volume = 27,
+    pages = {787-813},
+      doi = {10.1007/s00382-006-0158-0},
+}
+
+@ARTICLE{Blum:73,
+   author = {{Blumsack}, S.~L. and {Gierasch}, P.~J. and {Wessel}, W.~R.},
+    title = "{An analytical and numerical study of the Martian planetary boundary layer over slopes.}",
+  journal = {Journal of Atmospheric Sciences},
+     year = 1973,
+   volume = 30,
+    pages = {66-82},
+      doi = {10.1175/1520-0469(1973)030},
+}
+
+@ARTICLE{Mich:08,
+   author = {{Michaels}, T.~I. and {Rafkin}, S.~C.~R.},
+    title = "{Meteorological predictions for candidate 2007 Phoenix Mars Lander sites using the Mars Regional Atmospheric Modeling System (MRAMS)}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2008,
+   volume = 113,
+   number = {E12},
+    pages = {0-+},
+      doi = {10.1029/2007JE003013},
+}
+
+@ARTICLE{Tyle:08,
+   author = {{Tyler}, D. and {Barnes}, J.~R. and {Skyllingstad}, E.~D.},
+    title = "{Mesoscale and large-eddy simulation model studies of the Martian atmosphere in support of Phoenix}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2008,
+   volume = 113,
+   number = {E12},
+    pages = {0-+},
+      doi = {10.1029/2007JE003012},
+}
+
+@ARTICLE{Dear:80,
+   author = {{Deardorff}, J.~W.},
+    title = "{Stratocumulus-capped mixed layers derived from a three-dimensional model}",
+  journal = {Boundary-Layer Meteorology},
+     year = 1980,
+   volume = 18,
+    pages = {495-527},
+      doi = {10.1007/BF00119502},
+}
+
+@ARTICLE{Wild:85,
+   author = {{Wilde}, N.~P. and {Stull}, R.~B. and {Eloranta}, E.~W.},
+    title = "{The LCL Zone and Cumulus Onset.}",
+  journal = {Journal of Applied Meteorology},
+     year = 1985,
+   volume = 24,
+    pages = {640-657},
+      doi = {10.1175/1520-0450(1985)024},
+}
+
+@ARTICLE{Barn:08,
+   author = {{Barnes}, J.~R. and {Tyler}, D. and {Hinson}, D.~P.},
+    title = "{The Depth of the Daytime Convective Boundary Layer on Mars: A Case of Extremes}",
+  journal = {LPI Contributions},
+     year = 2008,
+   volume = 1447,
+    pages = {9076-+},
+}
+
+@ARTICLE{Whit:09,
+   author = {{Whiteway}, J.~A. and {Komguem}, L. and {Dickinson}, C. and 
+	{Cook}, C. and {Illnicki}, M. and {Seabrook}, J. and {Popovici}, V. and 
+	{Duck}, T.~J. and {Davy}, R. and {Taylor}, P.~A. and {Pathak}, J. and 
+	{Fisher}, D. and {Carswell}, A.~I. and {Daly}, M. and {Hipkin}, V. and 
+	{Zent}, A.~P. and {Hecht}, M.~H. and {Wood}, S.~E. and {Tamppari}, L.~K. and 
+	{Renno}, N. and {Moores}, J.~E. and {Lemmon}, M.~T. and {Daerden}, F. and 
+	{Smith}, P.~H.},
+    title = "{Mars Water-Ice Clouds and Precipitation}",
+  journal = {Science},
+     year = 2009,
+   volume = 325,
+    pages = {68-},
+      doi = {10.1126/science.1172344},
+}
+
+@ARTICLE{Hors:86,
+   author = {{Horst}, T.~W. and {Doran}, J.~C.},
+    title = "{Nocturnal drainage flow on simple slopes}",
+  journal = {Boundary-Layer Meteorology},
+     year = 1986,
+   volume = 34,
+    pages = {263-286},
+      doi = {10.1007/BF00122382},
+}
+
+@article{Papa:99,
+  title={{Evening and morning transition of katabatic flows}},
+  author={Papadopoulos, KH and Helmis, CG},
+  journal={Boundary-Layer Meteorology},
+  volume={92},
+  number={2},
+  pages={195--227},
+  year={1999},
+}
+
+@ARTICLE{Mahr:90,
+   author = {{Mahrt}, L. and {Larsen}, S.},
+    title = "{Relation of slope winds to the ambient flow over gentle terrain}",
+  journal = {Boundary-Layer Meteorology},
+     year = 1990,
+   volume = 53,
+    pages = {93-102},
+      doi = {10.1007/BF00122465},
+}
+
+@ARTICLE{Drob:03,
+   author = {{Drobinski}, P. and {Haeberli}, C. and {Richard}, E. and {Lothon}, M. and 
+	{Dabas}, A.~M. and {Flamant}, P.~H. and {Furger}, M. and {Steinacker}, R.
+	},
+    title = "{Scale interaction processes during the MAP IOP 12 south foehn event in the Rhine Valley}",
+  journal = {Quarterly Journal of the Royal Meteorological Society},
+     year = 2003,
+   volume = 129,
+    pages = {729-753},
+      doi = {10.1256/qj.02.35},
+}
+
+@ARTICLE{Skyl:03,
+   author = {{Skyllingstad}, E.~D.},
+    title = "{Large-Eddy Simulation of Katabatic Flows}",
+  journal = {Boundary-Layer Meteorology},
+     year = 2003,
+   volume = 106,
+    pages = {217-243},
+      doi = {10.1023/A:1021142828676},
+}
+
+@ARTICLE{Whit:99,
+   author = {{Whiteman}, C.~D. and {Zhong}, S. and {Bian}, X.},
+    title = "{Wintertime Boundary Layer Structure in the Grand Canyon.}",
+  journal = {Journal of Applied Meteorology},
+     year = 1999,
+   volume = 38,
+    pages = {1084-1102},
+      doi = {10.1175/1520-0450(1999)038},
+}
+
+@ARTICLE{Dora:90,
+   author = {{Doran}, J.~C. and {Horst}, T.~W. and {Whiteman}, C.~D.},
+    title = "{The development and structure of nocturnal slope winds in a simple valley}",
+  journal = {Boundary-Layer Meteorology},
+     year = 1990,
+   volume = 52,
+    pages = {41-68},
+      doi = {10.1007/BF00123177},
+}
+
+@ARTICLE{Pari:87,
+   author = {{Parish}, T.~R. and {Waight}, K.~T.},
+    title = "{The Forcing of Antarctic Katabatic Winds}",
+  journal = {Monthly Weather Review},
+     year = 1987,
+   volume = 115,
+    pages = {2214-+},
+      doi = {10.1175/1520-0493(1987)115},
+}
+
+@ARTICLE{Nyle:04,
+   author = {{Nylen}, T.~H. and {Fountain}, A.~G. and {Doran}, P.~T.},
+    title = "{Climatology of katabatic winds in the McMurdo dry valleys, southern Victoria Land, Antarctica}",
+  journal = {Journal of Geophysical Research (Atmospheres)},
+     year = 2004,
+   volume = 109,
+    pages = {D03114},
+      doi = {10.1029/2003JD003937},
+}
+
+@ARTICLE{Pari:07,
+   author = {{Parish}, T.~R. and {Bromwich}, D.~H.},
+    title = "{Reexamination of the Near-Surface Airflow over the Antarctic Continent and Implications on Atmospheric Circulations at High Southern Latitudes}",
+  journal = {Monthly Weather Review},
+     year = 2007,
+   volume = 135,
+    pages = {1961-+},
+      doi = {10.1175/MWR3374.1},
+}
+
+@ARTICLE{Lars:02,
+   author = {{Larsen}, S.~E. and {J{\o}rgensen}, H.~E. and {Landberg}, L. and 
+	{et al.}},
+    title = "{Aspects Of The Atmospheric Surface Layers On Mars And Earth}",
+  journal = {Boundary-Layer Meteorology},
+     year = 2002,
+   volume = 105,
+    pages = {451-470},
+      doi = {10.1023/A:1020338016753},
+}
+
+@ARTICLE{Hess:81,
+   author = {{Hess}, G.~D. and {Hicks}, B.~B. and {Yamada}, T.},
+    title = "{The impact of the Wangara experiment}",
+  journal = {Boundary-Layer Meteorology},
+     year = 1981,
+   volume = 20,
+    pages = {135-174},
+      doi = {10.1007/BF00119899},
+}
+
+@ARTICLE{Basu:08,
+   author = {{Basu}, S. and {Vinuesa}, J.-F. and {Swift}, A.},
+    title = "{Dynamic LES Modeling of a Diurnal Cycle}",
+  journal = {Journal of Applied Meteorology and Climatology},
+     year = 2008,
+   volume = 47,
+    pages = {1156-+},
+      doi = {10.1175/2007JAMC1677.1},
+}
+
+@ARTICLE{Mart:09,
+   author = {{Mart{\'{\i}}nez}, G. and {Valero}, F. and {V{\'a}zquez}, L.
+	},
+    title = "{Characterization of the Martian Convective Boundary Layer}",
+  journal = {Journal of Atmospheric Sciences},
+     year = 2009,
+   volume = 66,
+    pages = {2044-2058},
+}
+
+@article{Spig:10bl,
+   author = {Spiga, A. and Forget, F. and Lewis, S.~R. and Hinson, D.~P.},
+   journal = {Quarterly Journal of the Royal Meteorological Society},
+   title = {Structure and Dynamics of the Convective Boundary Layer on Mars as Inferred from Large-Eddy Simulations and Remote-Sensing Measurements},
+   year = {2010},
+   volume = 136,
+   pages = {414-428},
+}
+
+@ARTICLE{Alti:09,
+   author = {{Altieri}, F. and {Zasova}, L. and {D'Aversa}, E. and 
+	{Bellucci}, G. and {Carrozzo}, F.~G. and {Gondet}, B. and {Bibring}, {J.-P.}
+	},
+    title = "{O$_{2}$ 1.27 {$\mu$}m emission maps as derived from OMEGA/MEx data}",
+  journal = {Icarus},
+     year = 2009,
+   volume = 204,
+    pages = {499-511},
+      doi = {10.1016/j.icarus.2009.07.022},
+}
+
+@ARTICLE{Melo:06,
+   author = {{Melo}, S.~M.~L. and {Chiu}, O. and {Garcia-Munoz}, A. and {Strong}, K. and 
+	{McConnell}, J.~C. and {Slanger}, T.~G. and {Taylor}, M.~J. and 
+	{Lowe}, R.~P. and {McDade}, I.~C. and {Huestis}, D.~L.},
+    title = "{Using airglow measurements to observe gravity waves in the Martian atmosphere}",
+  journal = {Advances in Space Research},
+     year = 2006,
+   volume = 38,
+    pages = {730-738},
+      doi = {10.1016/j.asr.2005.08.041},
+}
+
+@ARTICLE{Yute:95,
+   author = {{Yuter}, S.~E. and {Houze}, R.~A.},
+    title = "{Three-Dimensional Kinematic and Microphysical Evolution of Florida Cumulonimbus. Part III: Vertical Mass Transport, Maw Divergence, and Synthesis}",
+  journal = {Monthly Weather Review},
+     year = 1995,
+   volume = 123,
+    pages = {1964-+},
+      doi = {10.1175/1520-0493(1995)123<1964:TDKAME>2.0.CO;2},
+}
+
+@INPROCEEDINGS{Spig:10ti,
+   author = {{Spiga}, A. and {Lewis}, S.~R. and {Forget}, F. and {Millour}, E. and 
+	{Montabone}, L. and {Madeleine}, {J.-B.}},
+    title = "{The Impact of Katabatic Winds on Martian Thermal Inertia Retrievals}",
+booktitle = {Lunar and Planetary Institute Science Conference Abstracts},
+     year = 2010,
+   series = {Lunar and Planetary Inst. Technical Report},
+   volume = 41,
+    pages = {1533},
+}
+
+
+@misc{Alti:10,
+   author = {{Altieri}, F. and {Spiga}, A. and {Zasova}, L. and {Bellucci}, G. and {Bibring}, J.~P.}, 
+   howpublished = {Geophys. Res. Lett. (submitted)},
+   title = {Gravity waves in Mars polar regions: O$_2$ airglow maps and mesoscale modelling},
+   year = {2010}
+}
+
+@misc{Spig:09tasi,
+   author = {{Spiga}, A. and {Bourrier}, V.}, 
+   howpublished = {Report Thales-Alenia Space (november 2009, contract ExoMars Environmental atmospheric support analysis)},
+   title = {Mesoscale Meteorology of the ExoMars Meridiani safe reference landing site in non-dusty spring conditions},
+   year = {2009}
+}
+
+@ARTICLE{Wolf:09,
+   author = {{Wolff}, M.~J. and {Smith}, M.~D. and {Clancy}, R.~T. and {Arvidson}, R. and 
+	{Kahre}, M. and {Seelos}, F. and {Murchie}, S. and {Savij{\"a}rvi}, H.
+	},
+    title = "{Wavelength dependence of dust aerosol single scattering albedo as observed by the Compact Reconnaissance Imaging Spectrometer}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2009,
+   volume = 114,
+   number = {E13},
+    pages = {0-+},
+      doi = {10.1029/2009JE003350},
+}
+
+@ARTICLE{Schn:09,
+   author = {{Schneider}, T. and {Liu}, J.},
+    title = "{Formation of Jets and Equatorial Superrotation on Jupiter}",
+  journal = {Journal of Atmospheric Sciences},
+archivePrefix = "arXiv",
+   eprint = {0809.4302},
+     year = 2009,
+   volume = 66,
+    pages = {579-+},
+      doi = {10.1175/2008JAS2798.1},
+}
+
+@ARTICLE{Lebe:98,
+   author = {{Lebeau}, R.~P. and {Dowling}, T.~E.},
+    title = "{EPIC simulations of time-dependent, three-dimensional vortices with application to Neptune's Great Dark Spot}",
+  journal = {Icarus},
+     year = 1998,
+   volume = 132,
+    pages = {239-265},
+      doi = {10.1006/icar.1998.5918},
+}
+
+@ARTICLE{Dowl:08,
+   author = {{Dowling}, T.~E.},
+    title = "{Music of the stratospheres}",
+  journal = {Nature},
+     year = 2008,
+   volume = 453,
+    pages = {163-164},
+}
+
+@ARTICLE{Mish:96,
+   author = {{Mishchenko}, M.~I. and {Travis}, L.~D. and {Mackowski}, D.~W.
+	},
+    title = "{T-matrix computations of light scattering by nonspherical particles: a review.}",
+  journal = {Journal of Quantitative Spectroscopy and Radiative Transfer},
+     year = 1996,
+   volume = 55,
+    pages = {535-575},
+      doi = {10.1016/0022-4073(96)00002-7},
+}
+
+@ARTICLE{Davy:09,
+   author = {{Davy}, R. and {Taylor}, P.~A. and {Weng}, W. and {Li}, {P.-Y.}
+	},
+    title = "{A model of dust in the Martian lower atmosphere}",
+  journal = {Journal of Geophysical Research (Atmospheres)},
+     year = 2009,
+   volume = 114,
+   number = {D13},
+    pages = {4108-+},
+      doi = {10.1029/2008JD010481},
+}
+
+@ARTICLE{Kauh:08,
+   author = {{Kauhanen}, J. and {Siili}, T. and {J{\"a}rvenoja}, S. and {Savij{\"a}rvi}, H.
+	},
+    title = "{The Mars limited area model and simulations of atmospheric circulations for the Phoenix landing area and season of operation}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2008,
+   volume = 113,
+    pages = {E00A14},
+      doi = {10.1029/2007JE003011},
+}
+
+@ARTICLE{Souz:00,
+   author = {{Souza}, E.~P. and {Renn{\'o}}, N.~O. and {Silva Dias}, M.~A.~F.
+	},
+    title = "{Convective Circulations Induced by Surface Heterogeneities.}",
+  journal = {Journal of Atmospheric Sciences},
+     year = 2000,
+   volume = 57,
+    pages = {2915-2922},
+      doi = {10.1175/1520-0469(2000)057<2915:CCIBSH>2.0.CO;2},
+}
+
+@ARTICLE{Tayl:08,
+   author = {{Taylor}, P.~A. and {Gunnlaugsson}, H.~P. and {Holstein-Rathlou}, C. and 
+	{Lange}, C.~F. and {Moores}, J. and {Cook}, C. and {Dickinson}, C. and 
+	{Popovici}, V. and {Seabrook}, J. and {Whiteway}, J.},
+    title = "{Phoenix: Summer Weather in Green Valley (126W, 68N on Mars)}",
+  journal = {LPI Contributions},
+     year = 2008,
+   volume = 1447,
+    pages = {9024-+},
+}
+
+@ARTICLE{Savi:91comp,
+   author = {{Savijarvi}, H.},
+    title = "{A model study of the PBL structure on Mars and the earth}",
+  journal = {Contributions to Atmospheric Physics/Beitraege zur Physik Atmosphaere},
+     year = 1991,
+   volume = 64,
+    pages = {219-229},
+}
+
+@ARTICLE{Davy:10,
+   author = {{Davy}, R. and {Davis}, J.~A. and {Taylor}, P.~A. and {Lange}, C.~F. and 
+	{Weng}, W. and {Whiteway}, J. and {Gunnlaugson}, H.~P.},
+    title = "{Initial analysis of air temperature and related data from the Phoenix MET station and their use in estimating turbulent heat fluxes}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2010,
+   volume = 115,
+   number = {E14},
+    pages = {0-+},
+      doi = {10.1029/2009JE003444},
+}
+
+@ARTICLE{Encr:08ica,
+   author = {{Encrenaz}, T. and {Greathouse}, T.~K. and {Richter}, M.~J.
+and 
+	{B{\'e}zard}, B. and {Fouchet}, T. and {Lef{\`e}vre}, F. and 
+	{Montmessin}, F. and {Forget}, F. and {Lebonnois}, S. and {Atreya},
+S.~K.
+	},
+    title = "{Simultaneous mapping of H$_2$O and H$_2$O$_2$ on Mars from
+infrared high-resolution imaging spectroscopy}",
+  journal = {Icarus},
+     year = 2008,
+   volume = 195,
+    pages = {547-556},
+      doi = {10.1016/j.icarus.2008.01.022},
+}
+
+@ARTICLE{Lang:08,
+   author = {{Langlais}, B. and {Leblanc}, F. and {Fouchet}, T. and
+{Barabash}, S. and 
+	{Breuer}, D. and {Chassefi{\`e}re}, E. and {Coates}, A. and 
+	{Dehant}, V. and {Forget}, F. and {Lammer}, H. and {Lewis}, S. and 
+	{Lopez-Valverde}, M. and {Mandea}, M. and {Menvielle}, M. and 
+	{Pais}, A. and {Paetzold}, M. and {Read}, P. and {Sotin}, C. and 
+	{Tarits}, P. and {Vennerstrom}, S. and {Branduardi-Raymont}, G. and
+	{Cremonese}, G. and {Merayo}, J.~G.~M. and {Ott}, T. and {R{\`e}me},
+H. and 
+	{Trotignon}, J.~G. and {Walhund}, J.~E.},
+    title = "{Mars environment and magnetic orbiter model payload}",
+  journal = {Experimental Astronomy},
+     year = 2008,
+    pages = {16-+},
+      doi = {10.1007/s10686-008-9101-1},
+}
+
+@ARTICLE{Encr:08aa,
+   author = {{Encrenaz}, T. and {Fouchet}, T. and {Melchiorri}, R. and
+{Drossart}, P. and 
+	{Gondet}, B. and {Langevin}, Y. and {Bibring}, J.-P. and {Forget},
+F. and 
+	{Maltagliati}, L. and {Titov}, D. and {Formisano}, V.},
+    title = "{A study of the Martian water vapor over Hellas using OMEGA
+and PFS aboard Mars Express}",
+  journal = aa,
+     year = 2008,
+   volume = 484,
+    pages = {547-553},
+      doi = {10.1051/0004-6361:20079288},
+}
+
+
+@ARTICLE{Habe:08,
+   author = {{Haberle}, R.~M. and {Forget}, F. and {Colaprete}, A. and
+{Schaeffer}, J. and 
+	{Boynton}, W.~V. and {Kelly}, N.~J. and {Chamberlain}, M.~A.
+	},
+    title = "{The effect of ground ice on the Martian seasonal CO$_2$
+cycle}",
+  journal = pss,
+     year = 2008,
+   volume = 56,
+    pages = {251-255},
+      doi = {10.1016/j.pss.2007.08.006},
+}
+
+@ARTICLE{Cava:08,
+   author = {{Cavali{\'e}}, T. and {Billebaud}, F. and {Encrenaz}, T. and
+
+	{Dobrijevic}, M. and {Brillet}, J. and {Forget}, F. and {Lellouch},
+E.
+	},
+    title = "{Vertical temperature profile and mesospheric winds
+retrieval on Mars from CO ;millimeter observations. Comparison with
+general circulation model predictions}",
+  journal = aap,
+     year = 2008,
+   volume = 489,
+    pages = {795-809},
+      doi = {10.1051/0004-6361:200809815},
+}
+
+@ARTICLE{Gonz:09a,
+   author = {{Gonz{\'a}lez-Galindo}, F. and {Forget}, F. and {L{\'o}pez-Valverde}, M.~A.  and {Angelats i Coll}, M. and {Millour}, E.},
+    title = "{A Ground-to-Exosphere Martian General Circulation Model. 1.
+Seasonal, Diurnal and Solar Cycle Variation of Thermospheric
+Temperatures}",
+  journal = {Journal of Geophysical Research (Planets), in press},
+     year = 2009,
+}
+
+
+@ARTICLE{Gonz:09b,
+   author = {{Gonz{\'a}lez-Galindo}, F. and {Forget}, F. and {L{\'o}pez-Valverde}, M.~A.  and {Angelats i Coll}, M.},
+    title = "{A Ground-to-Exosphere Martian General Circulation Model. 
+2. The Atmosphere During Perihelion Conditions: Thermospheric Polar
+Warming
+}",
+  journal = {Journal of Geophysical Research (Planets), in press},
+     year = 2009,
+}
+
+@ARTICLE{Hour:02,
+   author = {{Hourdin}, F. and {Couvreux}, F. and {Menut}, L.},
+    title = "{Parameterization of the Dry Convective Boundary Layer Based
+on a Mass Flux Representation of Thermals.}",
+  journal = {Journal of Atmospheric Sciences},
+     year = 2002,
+   volume = 59,
+    pages = {1105-1123},
+      doi = {10.1175/1520-0469(2002)059},
+}
+
+
+@ARTICLE{Galp:07,
+   author = {{Galperin}, B. and {Sukoriansky}, S. and {Anderson}, P.~S.},
+   title = "{On the critical Richardson number in stably stratified
+turbulence}",
+  journal = {Atmospheric Science Letters},
+     year = 2007,
+   volume = 8,
+    pages = {65-69},
+      doi = {10.1002/asl.153},
+}
+
+@ARTICLE{Suko:06,
+   author = {{Sukoriansky}, S. and {Galperin}, B. and {Perov}, V.},
+    title = "{A quasi-normal scale elimination model of turbulence and
+its application to stably stratified flows}",
+  journal = {Nonlinear Processes in Geophysics},
+     year = 2006,
+   volume = 13,
+    pages = {9-22},
+}
+
+@ARTICLE{Cant:06,
+   author = {{Cantor}, B.~A. and {Kanak}, K.~M. and {Edgett}, K.~S.},
+    title = "{Mars Orbiter Camera observations of Martian dust devils and their tracks (September
+1997 to January 2006) and evaluation of theoretical vortex models}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+   number = {E10},
+    pages = {12002-+},
+      doi = {10.1029/2006JE002700},
+}
+
+@ARTICLE{Forg:09,
+   author = {{Forget}, F. and {Montmessin}, F. and {Bertaux}, J.-L. and {Gonz{\'a}lez-Galindo}, F.
+and 
+	{Lebonnois}, S. and {Qu{\'e}merais}, E. and {Reberac}, A. and 
+	{Dimarellis}, E. and {L{\'o}pez-Valverde}, M.~A.},
+    title = "{Density and temperatures of the upper Martian atmosphere measured by stellar
+occultations with Mars Express SPICAM}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2009,
+   volume = 114,
+   number = {E13},
+    pages = {1004-+},
+      doi = {10.1029/2008JE003086},
+}
+
+@ARTICLE{Lefe:08,
+   author = {{Lef{\`e}vre}, F. and {Bertaux}, J.-L. and {Clancy}, R.~T. and 
+	{Encrenaz}, T. and {Fast}, K. and {Forget}, F. and {Lebonnois}, S. and 
+	{Montmessin}, F. and {Perrier}, S.},
+    title = "{Heterogeneous chemistry in the atmosphere of Mars}",
+  journal = {Nature},
+     year = 2008,
+   volume = 454,
+    pages = {971-975},
+      doi = {10.1038/nature07116},
+}
+
+@ARTICLE{Habe:08,
+   author = {{Haberle}, R.~M. and {Pilorget}, C. and {Wolff}, M. and
+{Lef{\`e}vre}, F. and 
+	{Forget}, F.},
+    title = "{Seasonal and Spatial Variability of Ozone as Inferred from
+MARCI UV Data}",
+  journal = {LPI Contributions},
+     year = 2008,
+   volume = 1447,
+    pages = {9109-+},
+}
+
+@INPROCEEDINGS{Mali:00spot,
+   author = {{Malin}, M.~C. and {Edgett}, K.~S.},
+    title = "{Frosting and Defrosting of Martian Polar Dunes}",
+booktitle = {Lunar and Planetary Institute Science Conference Abstracts},
+     year = 2000,
+   series = {Lunar and Planetary Inst. Technical Report},
+   volume = 31,
+    pages = {1056-+},
+}
+
+@INPROCEEDINGS{Supu:01,
+   author = {{Supulver}, K.~D. and {Edgett}, K.~S. and {Malin}, M.~C.},
+    title = "{Seasonal Changes in Frost Cover in the Martian South Polar
+Region: Mars Global Surveyor MOC and TES Monitoring of the Richardson
+Crater Dune Field}",
+booktitle = {Lunar and Planetary Institute Science Conference Abstracts},
+     year = 2001,
+   series = {Lunar and Planetary Inst. Technical Report},
+   volume = 32,
+    pages = {1966-+},
+}
+ 
+@ARTICLE{Kief:06,
+   author = {{Kieffer}, H.~H. and {Christensen}, P.~R. and {Titus}, T.~N.
+	},
+    title = "{CO2 jets formed by sublimation beneath translucent slab
+ice in Mars' seasonal south polar ice cap}",
+  journal = {Nature},
+     year = 2006,
+   volume = 442,
+    pages = {793-796},
+      doi = {10.1038/nature04945},
+}
+
+@ARTICLE{Kief:07,
+   author = {{Kieffer}, H.~H.},
+    title = "{Cold jets in the Martian polar caps}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+    pages = {8005-+},
+      doi = {10.1029/2006JE002816},
+}
+
+@INBOOK{Schu:92,
+   author = {{Schubert}, G. and {Solomon}, S.~C. and {Turcotte}, D.~L. and 
+	{Drake}, M.~J. and {Sleep}, N.~H.},
+    title = "{Origin and thermal evolution of Mars}",
+publisher = {Mars},
+     year = 1992,
+    pages = {147-183},
+}
+
+@ARTICLE{Kief:01,
+   author = {{Kieffer}, H.~H. and {Titus}, T.~N.},
+    title = "{TES Mapping of Mars' North Seasonal Cap}",
+  journal = {Icarus},
+     year = 2001,
+   volume = 154,
+    pages = {162-180},
+      doi = {10.1006/icar.2001.6670},
+   
+ }
+
+@INPROCEEDINGS{Dout:08,
+   author = {{Dout{\'e}}, S. and {Schmidt}, F. and {Schmitt}, B. and
+{Langevin}, Y. and 
+	{Vincendon}, M. and {Bibring}, J.-P. and {Omega Team}},
+    title = "{Physical Characterization of the South Seasonal Cap of
+Mars During Recession from OMEGA Observations}",
+booktitle = {Lunar and Planetary Institute Science Conference
+Abstracts},
+     year = 2008,
+   series = {Lunar and Planetary Inst. Technical Report},
+   volume = 39,
+    pages = {1736-+},
+}
+
+@ARTICLE{Schm:09,
+   author = {{The Omega Team} and {Schmidt}, F. and {Dout{\'e}}, S. and
+{Schmitt}, B. and 
+	{Vincendon}, M. and {Bibring}, J.-P. and {Langevin}, Y. and 
+	{The OMEGA Team}},
+    title = "{Albedo control of seasonal South Polar cap recession on
+Mars}",
+  journal = {Icarus},
+     year = 2009,
+   volume = 200,
+    pages = {374-394},
+      doi = {10.1016/j.icarus.2008.12.014},
+}
+
+@INPROCEEDINGS{Lang:09,
+   author = {{Langevin}, Y. and {Hansen}, C. and {Thomas}, N. and
+{Vincendon}, M. and 
+	{Titus}, T.~N. and {Piqueux}, S. and {Bibring}, J.-P. and {Gondet},
+B.
+	},
+    title = "{Investigations of Cryptic Regions of the South Seasonal
+Cap, 12/2008-02/2009}",
+booktitle = {Lunar and Planetary Institute Science Conference
+Abstracts},
+     year = 2009,
+   series = {Lunar and Planetary Inst. Technical Report},
+   volume = 40,
+    pages = {2017-+},
+}
+
+@ARTICLE{Titu:08,
+   author = {{Titus}, T.~N. and {Michaels}, T.~I. and {Colaprete}, A. and 
+	{Kieffer}, H.~H. and {Langevin}, Y. and {Murchie}, S.~L. and 
+	{Vincendon}, M. and {Crism Science Team}},
+    title = "{Exotic Processes within the Cryptic Region of Mars: A New
+Method for Near Real-Time Estimates of Wind Direction}",
+  journal = {LPI Contributions},
+     year = 2008,
+   volume = 1447,
+    pages = {9043-+},
+}
+
+@ARTICLE{Hans:05,
+   author = {{Hansen}, G.~B.},
+    title = "{Ultraviolet to near-infrared absorption spectrum of carbon
+dioxide ice from 0.174 to 1.8 {$\mu$}m}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2005,
+   volume = 110,
+   number = E9,
+    pages = {11003-+},
+      doi = {10.1029/2005JE002531},
+}
+
+@INPROCEEDINGS{Ahar:04,
+   author = {{Aharonson}, O.},
+    title = "{Sublimation at the Base of a Seasonal CO2 Slab on Mars}",
+booktitle = {Lunar and Planetary Institute Science Conference
+Abstracts},
+     year = 2004,
+   series = {Lunar and Planetary Institute Science Conference
+Abstracts},
+   volume = 35,
+   editor = {{Mackwell}, S. and {Stansbery}, E.},
+    pages = {1918-+},
+}
+
+@ARTICLE{Hans:99,
+   author = {{Hansen}, G.~B.},
+    title = "{Control of the radiative behavior of the Martian polar
+caps by surface {\lt}formula{\gt}CO$_{2}$ ice: Evidence from Mars Global
+Surveyor measurements}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 1999,
+   volume = 104,
+    pages = {16471-16486},
+      doi = {10.1029/1998JE000626},
+}
+  
+
+@ARTICLE{Roth:01,
+   author = {{Rothschild}, L.~J. and {Mancinelli}, R.~L.},
+    title = "{Life in extreme environments}",
+  journal = {Nature},
+     year = 2001,
+   volume = 409,
+    pages = {1092-1101},
+}
+
+@ARTICLE{Lamm:09,
+   author = {{Lammer}, H. and {Bredeh{\"o}ft}, J.~H. and {Coustenis}, A. and 
+	{Khodachenko}, M.~L. and {Kaltenegger}, L. and {Grasset}, O. and 
+	{Prieur}, D. and {Raulin}, F. and {Ehrenfreund}, P. and {Yamauchi}, M. and 
+	{Wahlund}, {J.-E.} and {Grie{\ss}meier}, {J.-M.} and {Stangl}, G. and 
+	{Cockell}, C.~S. and {Kulikov}, Y.~N. and {Grenfell}, J.~L. and 
+	{Rauer}, H.},
+    title = "{What makes a planet habitable?}",
+  journal = {The Astronomy and Astrophysics Review},
+     year = 2009,
+   volume = 17,
+    pages = {181-249},
+      doi = {10.1007/s00159-009-0019-z},
+}
+
+@ARTICLE{Spie:08,
+   author = {{Spiegel}, D.~S. and {Menou}, K. and {Scharf}, C.~A.},
+    title = "{Habitable Climates}",
+  journal = {Astrophys. Jour.},
+     year = 2008,
+   volume = 681,
+    pages = {1609-1623},
+      doi = {10.1086/588089},
+}
+
+@ARTICLE{Nimm:98,
+   author = {{Nimmo}, F. and {McKenzie}, D.},
+    title = "{Volcanism and Tectonics on Venus}",
+  journal = {Annual Review of Earth and Planetary Sciences},
+     year = 1998,
+   volume = 26,
+    pages = {23-53},
+      doi = {10.1146/annurev.earth.26.1.23},
+}
+
+@ARTICLE{Lope:05,
+   author = {{Lopez}, B. and {Schneider}, J. and {Danchi}, W.~C.},
+    title = "{Can Life Develop in the Expanded Habitable Zones around Red Giant Stars?}",
+  journal = apj,
+     year = 2005,
+   volume = 627,
+    pages = {974-985},
+      doi = {10.1086/430416},
+}
+
+
+@ARTICLE{Cern:05,
+   author = {{Cernicharo}, J. and {Crovisier}, J.},
+    title = "{Water in Space: The Water World of ISO}",
+  journal = {Space Science Reviews},
+     year = 2005,
+   volume = 119,
+    pages = {29-69},
+      doi = {10.1007/s11214-005-8058-x},
+}
+
+@ARTICLE{McKa:08,
+   author = {{McKay}, C.~P. and {Porco Carolyn C.} and {Altheide}, T. and 
+	{Davis}, W.~L. and {Kral}, T.~A.},
+    title = "{The Possible Origin and Persistence of Life on Enceladus and Detection of
+Biomarkers in the Plume}",
+  journal = {Astrobiology},
+     year = 2008,
+   volume = 8,
+    pages = {909-919},
+      doi = {10.1089/ast.2008.0265},
+}
+
+@ARTICLE{Rosi:05,
+   author = {{Rosing}, M.~T.},
+    title = "{Thermodynamics of life on the planetary scale}",
+  journal = {International Journal of Astrobiology},
+     year = 2005,
+   volume = 4,
+    pages = {9-11},
+      doi = {10.1017/S147355040500248X},
+}
+
+@ARTICLE{Vale:07,
+   author = {{Valencia}, D. and {O'Connell}, R.~J. and {Sasselov}, D.~D.},
+    title = "{Inevitability of Plate Tectonics on Super-Earths}",
+  journal = apj,
+     year = 2007,
+   volume = 670,
+    pages = {L45-L48},
+      doi = {10.1086/524012},
+}
+
+@INPROCEEDINGS{Stam:09,
+   author = {Stamenkovic, V. and Noack, L. and Breuer, D.},
+    title = "{Habitability of Super-Earths}",
+booktitle = {Europlanet Science Conference Abstracts},
+     year = 2009,
+   volume = 4,
+    pages = {372-3},
+}
+
+@ARTICLE{ONei:07,
+   author = {{O'Neill}, C. and {Lenardic}, A.},
+    title = "{Geological consequences of super-sized Earths}",
+  journal = grl,
+     year = 2007,
+   volume = 34,
+    pages = {19204-+},
+      doi = {10.1029/2007GL030598},
+}
+
+@ARTICLE{Josh:03,
+   author = {{Joshi}, M.},
+    title = "{Climate Model Studies of Synchronously Rotating Planets}",
+  journal = {Astrobiology},
+     year = 2003,
+   volume = 3,
+    pages = {415-427},
+      doi = {10.1089/153110703769016488},
+}
+
+@ARTICLE{Tart:07,
+   author = {{Tarter}, J.~C. and {Backus}, P.~R. and {Mancinelli}, R.~L. and 
+	{Aurnou}, J.~M. and {Backman}, D.~E. and {Basri}, G.~S. and 
+	{Boss}, A.~P. and {Clarke}, A. and {Deming}, D. and {Doyle}, L.~R. and 
+	{Feigelson}, E.~D. and {Freund}, F. and {Grinspoon}, D.~H. and 
+	{Haberle}, R.~M. and {Hauck}, II, S.~A. and {Heath}, M.~J. and 
+	{Henry}, T.~J. and {Hollingsworth}, J.~L. and {Joshi}, M.~M. and 
+	{Kilston}, S. and {Liu}, M.~C. and {Meikle}, E. and {Reid}, I.~N. and 
+	{Rothschild}, L.~J. and {Scalo}, J. and {Segura}, A. and {Tang}, C.~M. and 
+	{Tiedje}, J.~M. and {Turnbull}, M.~C. and {Walkowicz}, L.~M. and 
+	{Weber}, A.~L. and {Young}, R.~E.},
+    title = "{A Reappraisal of The Habitability of Planets around M Dwarf Stars}",
+  journal = {Astrobiology},
+     year = 2007,
+   volume = 7,
+    pages = {30-65},
+      doi = {10.1089/ast.2006.0124},
+}
+
+@ARTICLE{Bucc:07,
+   author = {{Buccino}, A.~P. and {Lemarchand}, G.~A. and {Mauas}, P.~J.~D.},
+    title = "{UV habitable zones around M stars}",
+  journal = {Icarus},
+     year = 2007,
+   volume = 192,
+    pages = {582-587},
+      doi = {10.1016/j.icarus.2007.08.012},
+}
+ 
+@ARTICLE{Lebo:09,
+   author = {{Lebonnois}, S. and {Hourdin}, F. and {Eymet}, V. and {Crespin}, A. and 
+	{Fournier}, R. and {Forget}, F.},
+    title = "{Superrotation of Venus' atmosphere analyzed with a full general circulation model}",
+  journal = {Journal of Geophysical Research (Planets)},
+ keywords = {Planetary Sciences: Solid Surface Planets: Meteorology (3346), Atmospheric Processes: Planetary
+meteorology (5445, 5739), Atmospheric Composition and Structure: Planetary atmospheres (5210, 5405, 5704),
+Atmospheric Processes: General circulation (1223)},
+     year = 2010,
+   volume = 115,
+   number = E14,
+    pages = {E06006},
+      doi = {10.1029/2009JE003458},
+   adsurl = {http://adsabs.harvard.edu/abs/2010JGRE..11506006L},
+  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
+}
+
+
+@ARTICLE{Yama:75,
+   author = {{Yamada}, T. and {Mellor}, G.},
+    title = "{A Simulation of the Wangara Atmospheric Boundary Layer Data.}",
+  journal = {Journal of Atmospheric Sciences},
+     year = 1975,
+   volume = 32,
+    pages = {2309-2329},
+      doi = {10.1175/1520-0469(1975)032<2309:ASOTWA>2.0.CO;2},
+}
+
+@ARTICLE{Lewi:05,
+   author = {{Lewis}, S.~R. and {Barker}, P.~R.},
+    title = "{Atmospheric tides in a Mars general circulation model with data assimilation}",
+  journal = {Advances in Space Research},
+     year = 2005,
+   volume = 36,
+    pages = {2162-2168},
+      doi = {10.1016/j.asr.2005.05.122},
+}
+
+@ARTICLE{Mich:06dd,
+   author = {{Michaels}, T.~I.},
+    title = "{Numerical modeling of Mars dust devils: Albedo track generation}",
+  journal = grl,
+     year = 2006,
+   volume = 33,
+    pages = {19-+},
+      doi = {10.1029/2006GL026268},
+}
+
+@book{Gree:87,
+  title={{Wind as a Geological Process: On Earth, Mars, Venus and Titan}},
+  author={Greeley, R. and Iversen, J.D.},
+  year={1987},
+  publisher={Cambridge Univ Press}
+}
+
+@ARTICLE{Bagn:54,
+   author = {{Bagnold}, R.~A.},
+    title = "{Experiments on a Gravity-Free Dispersion of Large Solid Spheres in a Newtonian Fluid under Shear}",
+  journal = {Royal Society of London Proceedings Series A},
+     year = 1954,
+   volume = 225,
+    pages = {49-63},
+}
+
+@misc{Spig:10comp,
+   author = {Spiga, A.},
+   howpublished = {Planetary and Space Science, in press},
+   title = {Elements of comparison between Martian and terrestrial mesoscale meteorological phenomena: Katabatic winds and boundary layer convection},
+   year = {2010}
+}
+
+@ARTICLE{Gree:03lab,
+   author = {{Greeley}, R. and {Balme}, M.~R. and {Iversen}, J.~D. and {Metzger}, S. and 
+	{Mickelson}, R. and {Phoreman}, J. and {White}, B.},
+    title = "{Martian dust devils: Laboratory simulations of particle threshold}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2003,
+   volume = 108,
+    pages = {5041-+},
+      doi = {10.1029/2002JE001987},
+}
+
+@INPROCEEDINGS{Reis:09,
+   author = {{Reiss}, D. and {L{\"u}sebrink}, D. and {Hiesinger}, H. and 
+	{Kelling}, T. and {Wurm}, G. and {Teiser}, J.},
+    title = "{High Altitude Dust Devils on Arsia Mons, Mars: Testing the Greenhouse and Thermophoresis Hypothesis of Dust Lifting}",
+booktitle = {Lunar and Planetary Institute Science Conference Abstracts},
+     year = 2009,
+   series = {Lunar and Planetary Inst. Technical Report},
+   volume = 40,
+    pages = {1961-+},
+}
+
+@ARTICLE{Lefe:09,
+   author = {{Lef{\`e}vre}, F. and {Forget}, F.},
+    title = "{Observed variations of methane on Mars unexplained by known atmospheric chemistry and physics}",
+  journal = {Nature},
+     year = 2009,
+   volume = 460,
+    pages = {720-723},
+      doi = {10.1038/nature08228},
+}
+
+@ARTICLE{Jako:00,
+   author = {{Jakosky}, B.~M. and {Mellon}, M.~T. and {Kieffer}, H.~H. and 
+	{Christensen}, P.~R. and {Varnes}, E.~S. and {Lee}, S.~W.},
+    title = "{The thermal inertia of Mars from the Mars Global Surveyor Thermal Emission Spectrometer}",
+  journal = jgr,
+     year = 2000,
+   volume = 105,
+    pages = {9643-9652},
+      doi = {10.1029/1999JE001088},
+}
+
+@ARTICLE{Putz:07mix,
+   author = {{Putzig}, N.~E. and {Mellon}, M.~T.},
+    title = "{Thermal behavior of horizontally mixed surfaces on Mars}",
+  journal = {Icarus},
+     year = 2007,
+   volume = 191,
+    pages = {52-67},
+      doi = {10.1016/j.icarus.2007.03.022},
+}
+
+@ARTICLE{Band:08,
+   author = {{Bandfield}, J.~L. and {Feldman}, W.~C.},
+    title = "{Martian high latitude permafrost depth and surface cover thermal inertia distributions}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2008,
+   volume = 113,
+    pages = {E08001},
+      doi = {10.1029/2007JE003007},
+}
+
+@ARTICLE{Vinc:10grl,
+   author = {{Vincendon}, M. and {Mustard}, J. and {Forget}, F. and {Kreslavsky}, M. and 
+	{Spiga}, A. and {Murchie}, S. and {Bibring}, {J.-P.}},
+    title = "{Near-tropical subsurface ice on Mars}",
+  journal = grl,
+     year = 2010,
+   volume = 37,
+    pages = {L01202},
+      doi = {10.1029/2009GL041426},
+}
+
+@ARTICLE{Basi:06,
+   author = {{Basilevsky}, A.~T. and {Werner}, S.~C. and {Neukum}, G. and 
+	{Head}, J.~W. and {van Gasselt}, S. and {Gwinner}, K. and {Ivanov}, B.~A.
+	},
+    title = "{Geologically recent tectonic, volcanic and fluvial activity on the eastern flank of the Olympus Mons volcano, Mars}",
+  journal = grl,
+     year = 2006,
+   volume = 33,
+    pages = {L13201},
+      doi = {10.1029/2006GL026396},
+}
+
+@ARTICLE{Brac:96,
+   author = {{Brack}, A.},
+    title = "{Why exobiology on Mars?}",
+  journal = pss,
+     year = 1996,
+   volume = 44,
+    pages = {1435-1440},
+}
+
+@ARTICLE{Spig:11ti,
+   author = {{Spiga}, A. and {Forget}, F. and {Madeleine}, {J.-B.} and {Montabone}, L. and {Lewis}, S.~R. and {Millour}, E.},
+    title = "{The impact of Martian mesoscale winds on surface temperature and on the determination of thermal inertia}",
+  journal = {Icarus},
+     year = 2011,
+   volume = 212,
+    pages = {504-519},
+}   
+
+
+@ARTICLE{Spig:08will,
+   author = {{Spiga}, A. and {Forget}, F. and {Montabone}, L.},
+    title = "{Study of the Martian Boundary Layer, Mountain Meteorology and 2001 Dust Storm with the LMD Mesoscale Model}",
+  journal = {LPI Contributions},
+     year = 2008,
+   volume = 1447,
+    pages = {9028-+},
+}
+
+@ARTICLE{Ferg:06,
+   author = {{Fergason}, R.~L. and {Christensen}, P.~R. and {Bell}, J.~F. and 
+	{Golombek}, M.~P. and {Herkenhoff}, K.~E. and {Kieffer}, H.~H.
+	},
+    title = "{Physical properties of the Mars Exploration Rover landing sites as inferred from Mini-TES-derived thermal inertia}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+    pages = {E02S21},
+      doi = {10.1029/2005JE002583},
+}
+
+@ARTICLE{Hyne:07,
+   author = {{Hynek}, B.~M. and {Singer}, K.},
+    title = "{Ground truth from the Opportunity Rover for Mars thermal inertia data}",
+  journal = grl,
+     year = 2007,
+   volume = 34,
+    pages = {L11201},
+      doi = {10.1029/2007GL029687},
+}
+
+@ARTICLE{Putz:05,
+   author = {{Putzig}, N.~E. and {Mellon}, M.~T. and {Kretke}, K.~A. and 
+	{Arvidson}, R.~E.},
+    title = "{Global thermal inertia and surface properties of Mars from the MGS mapping mission}",
+  journal = {Icarus},
+     year = 2005,
+   volume = 173,
+    pages = {325-341},
+      doi = {10.1016/j.icarus.2004.08.017},
+}
+
+@ARTICLE{Wolk:10,
+   author = {{Wolkenberg}, P. and {Formisano}, V. and {Rinaldi}, G. and {Geminale}, A.
+	},
+    title = "{The atmospheric temperatures over Olympus Mons on Mars: An atmospheric hot ring}",
+  journal = {Icarus},
+     year = 2010,
+   volume = 207,
+    pages = {110-123},
+      doi = {10.1016/j.icarus.2009.11.005},
+}
+
+@ARTICLE{Blea:07,
+   author = {{Bleacher}, J.~E. and {Greeley}, R. and {Williams}, D.~A. and 
+	{Werner}, S.~C. and {Hauber}, E. and {Neukum}, G.},
+    title = "{Olympus Mons, Mars: Inferred changes in late Amazonian aged effusive activity from lava flow mapping of Mars Express High Resolution Stereo Camera data}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+    pages = {E04003},
+      doi = {10.1029/2006JE002826},
+}
+
+@article{McGo:09,
+  title={{Volcanic spreading and lateral variations in the structure of Olympus Mons, Mars}},
+  author={McGovern, P.J. and Morgan, J.K.},
+  journal={Geology},
+  volume={37},
+  number={2},
+  pages={139},
+  year={2009},
+}
+
+@ARTICLE{Joug:09,
+   author = {{Jouglet}, D. and {Poulet}, F. and {Langevin}, Y. and {Bibring}, {J.-P.} and 
+	{Gondet}, B. and {Vincendon}, M. and {Berthe}, M.},
+    title = "{OMEGA long wavelength channel: Data reduction during non-nominal stages}",
+  journal = pss,
+     year = 2009,
+   volume = 57,
+    pages = {1032-1042},
+      doi = {10.1016/j.pss.2008.07.025},
+}
+
+@article{Mahr:08,
+  title={{Bulk formulation of surface fluxes extended to weak-wind stable conditions}},
+  author={Mahrt, L.},
+  journal={Quarterly Journal of the Royal Meteorological Society},
+  volume={134},
+  number={630},
+  pages={1--10},
+  year={2008},
+}
+
+@book{Garr:92,
+   author = {Garratt, J.~R.},
+   address = {New York},
+   publisher = {Cambridge Univ. Press},
+   title = {The Atmospheric Boundary Layer},
+   year = {1992}
+}
+
+@article{Gris:07,
+  title={{The low-level katabatic jet height versus Monin--Obukhov height}},
+  author={Grisogono, B. and Kraljevi{\'c}, L. and Jeri{\v{c}}evi{\'c}, A.},
+  journal={Quarterly Journal of the Royal Meteorological Society},
+  volume={133},
+  number={629},
+  pages={2133--2136},
+  year={2007},
+}
+
+@ARTICLE{Cass:01,
+   author = {{Cassano}, J.~J. and {Parish}, T.~R. and {King}, J.~C.},
+    title = "{Evaluation of Turbulent Surface Flux Parameterizations for the Stable Surface Layer over Halley, Antarctica}",
+  journal = {Monthly Weather Review},
+     year = 2001,
+   volume = 129,
+    pages = {26--46},
+      doi = {10.1175/1520-0493(2001)129<0026:EOTSFP>2.0.CO;2},
+}
+
+@ARTICLE{Ditt:82,
+   author = {{Ditteon}, R.},
+    title = "{Daily temperature variations on Mars}",
+  journal = jgr,
+     year = 1982,
+   volume = 87,
+    pages = {10197-10214},
+      doi = {10.1029/JB087iB12p10197},
+}
+
+@ARTICLE{Howa:00,
+   author = {{Howard}, A.~D.},
+    title = "{The Role of Eolian Processes in Forming Surface Features of the Martian Polar Layered Deposits}",
+  journal = {Icarus},
+     year = 2000,
+   volume = 144,
+    pages = {267-288},
+      doi = {10.1006/icar.1999.6305},
+}
+
+@ARTICLE{Smit:10holt,
+   author = {{Smith}, I.~B. and {Holt}, J.~W.},
+    title = "{Onset and migration of spiral troughs on Mars revealed by orbital radar}",
+  journal = {Nature},
+     year = 2010,
+   volume = 465,
+    pages = {450-453},
+      doi = {10.1038/nature09049},
+}
+
+@ARTICLE{Holt:10,
+   author = {{Holt}, J.~W. and {Fishbaugh}, K.~E. and {Byrne}, S. and {Christian}, S. and 
+	{Tanaka}, K. and {Russell}, P.~S. and {Herkenhoff}, K.~E. and 
+	{Safaeinili}, A. and {Putzig}, N.~E. and {Phillips}, R.~J.},
+    title = "{The construction of Chasma Boreale on Mars}",
+  journal = {Nature},
+     year = 2010,
+   volume = 465,
+    pages = {446-449},
+      doi = {10.1038/nature09050},
+}
+
+@ARTICLE{Ng:06,
+   author = {{Ng}, F.~S.~L. and {Zuber}, M.~T.},
+    title = "{Patterning instability on the Mars polar ice caps}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2006,
+   volume = 111,
+    pages = {E02005},
+      doi = {10.1029/2005JE002533},
+}
+
+@ARTICLE{Vang:09,
+   author = {{Vangvichith}, M. and {Tran}, H. and {Hartmann}, {J.-M.}},
+    title = "{Line-mixing and collision induced absorption for O$_{2}$-CO$_{2}$ mixtures in the oxygen
+A-band region}",
+  journal = jqsrt,
+     year = 2009,
+   volume = 110,
+    pages = {2212-2216},
+      doi = {10.1016/j.jqsrt.2009.06.002},
+}
+
+@ARTICLE{Word:10,
+   author = {{Wordsworth}, R. and {Forget}, F. and {Eymet}, V.},
+    title = "{Infrared collision-induced and far-line absorption in dense CO$_{2}$ atmospheres}",
+  journal = {Icarus},
+     year = 2010,
+   volume = 210,
+    pages = {992-997},
+      doi = {10.1016/j.icarus.2010.06.010},
+}
+
+@ARTICLE{Lell:10,
+   author = {{Lellouch}, E. and {de Bergh}, C. and {Sicardy}, B. and {Ferron}, S. and {K{\"a}ufl}, {H.-U.}},
+    title = "{Detection of CO in Triton's atmosphere and the nature of surface-atmosphere interactions}",
+  journal = {aap},
+     year = 2010,
+   volume = 512,
+    pages = {L8+},
+      doi = {10.1051/0004-6361/201014339},
+}
+
+@ARTICLE{Spen:90,
+   author = {{Spencer}, J.~R.},
+    title = "{Nitrogen frost migration on Triton - A historical model}",
+  journal = {grl},
+     year = 1990,
+   volume = 17,
+    pages = {1769-1772},
+      doi = {10.1029/GL017i010p01769},
+}
+
+@INPROCEEDINGS{Schm:95,
+   author = {{Schmitt}, B. and {Quirico}, E. and {Dout{\'e}}, S. and {Owen}, T.~C. and 
+	{de Bergh}, C. and {Cruikshank}, D.~P. and {Geballe}, T.},
+    title = "{Physical State and Composition of the Ices on Triton and Pluto}",
+booktitle = {Bulletin of the American Astronomical Society},
+     year = 1995,
+    pages = {1099-+},
+}
+
+@article{Grun:10,
+   author = {{Grundy}, W.~M. and {Young}, L.~A. and {Stansberry}, J.~A. and 
+	{Buie}, M.~W. and {Olkin}, C.~B. and {Young}, E.~F.},
+    title = "{Near-infrared spectral monitoring of Triton with IRTF/SpeX II: Spatial distribution and evolution of ices}",
+  journal = {Icarus},
+     year = 2010,
+   volume = 205,
+    pages = {594-604},
+      doi = {10.1016/j.icarus.2009.08.005},
+}
+
+@ARTICLE{Smit:89,
+   author = {{Smith}, B.~A. and {Soderblom}, L.~A. and {Banfield}, D. and 
+	{Barnet}, C. and {Beebe}, R.~F. and {Bazilevskii}, A.~T. and 
+	{Bollinger}, K. and {Boyce}, J.~M. and {Briggs}, G.~A. and {Brahic}, A.
+	},
+    title = "{Voyager 2 at Neptune - Imaging science results}",
+  journal = {Science},
+     year = 1989,
+   volume = 246,
+    pages = {1422-1449},
+      doi = {10.1126/science.246.4936.1422},
+}
+
+@ARTICLE{Brow:90,
+   author = {{Brown}, R.~H. and {Johnson}, T.~V. and {Kirk}, R.~L. and {Soderblom}, L.~A.
+	},
+    title = "{Energy sources for Triton's geyser-like plumes}",
+  journal = {Science},
+     year = 1990,
+   volume = 250,
+    pages = {431-435},
+      doi = {10.1126/science.250.4979.431},
+}
+
+@ARTICLE{Saga:90,
+   author = {{Sagan}, C. and {Chyba}, C.},
+    title = "{Triton's streaks as windblown dust}",
+  journal = {Nature},
+     year = 1990,
+   volume = 346,
+    pages = {546-548},
+      doi = {10.1038/346546a0},
+}
+
+@ARTICLE{Habe:97,
+   author = {{Haberle}, R.~M. and {Barnes}, J.~R. and {Murphy}, J.~R. and 
+	{Joshi}, M.~M. and {Schaeffer}, J.},
+    title = "{Meteorological predictions for the Mars Pathfinder lander}",
+  journal = jgr,
+ keywords = {Meteorology and Atmospheric Dynamics: Synoptic-scale meteorology},
+     year = 1997,
+   volume = 102,
+    pages = {13301-13312},
+      doi = {10.1029/97JE01334},
+}
+
+@ARTICLE{Spig:10dust,
+   author = {{Spiga}, A. and {Lewis}, S.R.},
+    title = "{Mesoscale and microscale wind variability of relevance for dust lifting}",
+  journal = {Mars},
+     year = 2010,
+   volume = 5,
+    pages = {146-158},
+      doi = {10.1555/mars.2010.0006},
+}
+
+@ARTICLE{Maat:10,
+   author = {{M{\"a}{\"a}tt{\"a}nen}, A. and {Montmessin}, F. and {Gondet}, B. and 
+	{Scholten}, F. and {Hoffmann}, H. and {Gonz{\'a}lez-Galindo}, F. and 
+	{Spiga}, A. and {Forget}, F. and {Hauber}, E. and {Neukum}, G. and 
+	{Bibring}, {J.-P.} and {Bertaux}, {J.-L.}},
+    title = "{Mapping the mesospheric CO$_{2}$ clouds on Mars: MEx/OMEGA and MEx/HRSC observations and challenges for atmospheric models}",
+  journal = {Icarus},
+     year = 2010,
+   volume = 209,
+    pages = {452-469},
+      doi = {10.1016/j.icarus.2010.05.017},
+}
+
+@ARTICLE{With:10,
+   author = {{Withers}, P. and {Catling}, D.~C.},
+    title = "{Observations of atmospheric tides on Mars at the season and latitude of the Phoenix atmospheric entry}",
+  journal = grl,
+     year = 2010,
+   volume = 37,
+    pages = {24204-+},
+      doi = {10.1029/2010GL045382},
+}
+
+@ARTICLE{Clan:07,
+   author = {{Clancy}, R.~T. and {Wolff}, M.~J. and {Whitney}, B.~A. and 
+	{Cantor}, B.~A. and {Smith}, M.~D.},
+    title = "{Mars equatorial mesospheric clouds: Global occurrence and physical properties from Mars Global Surveyor Thermal Emission Spectrometer and Mars Orbiter Camera limb observations}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+   number = {E11},
+    pages = {4004-+},
+      doi = {10.1029/2006JE002805},
+}
+
+@ARTICLE{Mcco:10,
+   author = {{McConnochie}, T.~H. and {Bell}, J.~F. and {Savransky}, D. and 
+	{Wolff}, M.~J. and {Toigo}, A.~D. and {Wang}, H. and {Richardson}, M.~I. and 
+	{Christensen}, P.~R.},
+    title = "{THEMIS-VIS observations of clouds in the martian mesosphere: Altitudes, wind speeds, and decameter-scale morphology}",
+  journal = {Icarus},
+     year = 2010,
+   volume = 210,
+    pages = {545-565},
+      doi = {10.1016/j.icarus.2010.07.021},
+}
+
+@misc{Gonz:11,
+   author = {{Gonz{\'a}lez-Galindo}, F. and {M{\"a}{\"a}tt{\"a}nen}, A. and 
+	{Forget}, F. and {Spiga}, A.},
+   howpublished = {Submitted to Icarus},
+   title = {The Martian mesosphere as revealed by CO2 clouds observations and General Circulation Modeling},
+   year = {2011}
+}
+
+@ARTICLE{Pari:09,
+   author = {{Parish}, H.~F. and {Schubert}, G. and {Hickey}, M.~P. and {Walterscheid}, R.~L.
+	},
+    title = "{Propagation of tropospheric gravity waves into the upper atmosphere of Mars}",
+  journal = {Icarus},
+     year = 2009,
+   volume = 203,
+    pages = {28-37},
+      doi = {10.1016/j.icarus.2009.04.031},
+}
+
+@ARTICLE{Hauc:87,
+   author = {{Hauchecorne}, A. and {Chanin}, M.~L. and {Wilson}, R.},
+    titlev = "{Mesospheric temperature inversion and gravity wave breaking}",
+  journal = grl,
+     year = 1987,
+   volume = 14,
+    pages = {933-936},
+      doi = {10.1029/GL014i009p00933},
+}
+
+@ARTICLE{Savi:10,
+   author = {{Savij{\"a}rvi}, H. and {M{\"a}{\"a}tt{\"a}nen}, A.},
+    title = "{Boundary-layer simulations for the Mars Phoenix lander site}",
+  journal = {Quarterly Journal of the Royal Meteorological Society},
+     year = 2010,
+   volume = 136,
+    pages = {1497-1505},
+      doi = {10.1002/qj.650},
+}
+
+@ARTICLE{McCl:10,
+   author = {{McCleese}, D.~J. and {Heavens}, N.~G. and {Schofield},
+J.~T. and 
+	{Abdou}, W.~A. and {Bandfield}, J.~L. and {Calcutt}, S.~B. and 
+	{Irwin}, P.~G.~J. and {Kass}, D.~M. and {Kleinb{\"o}hl}, A. and 
+	{Lewis}, S.~R. and {Paige}, D.~A. and {Read}, P.~L. and
+{Richardson}, M.~I. and 
+	{Shirley}, J.~H. and {Taylor}, F.~W. and {Teanby}, N. and {Zurek},
+R.~W.
+	},
+    title = "{Structure and dynamics of the Martian lower and middle
+atmosphere as observed by the Mars Climate Sounder: Seasonal variations
+in zonal mean temperature, dust, and water ice aerosols}",
+  journal = jgr,
+ keywords = {Planetary Sciences: Solar System Objects: Mars},
+     year = 2010,
+   volume = 115,
+   number = E14,
+    pages = {12016-+},
+      doi = {10.1029/2010JE003677},
+}
+
+@ARTICLE{Kono:11,
+   author = {{Konopliv}, A.~S. and {Asmar}, S.~W. and {Folkner}, W.~M. and 
+	{Karatekin}, {\"O}. and {Nunes}, D.~C. and {Smrekar}, S.~E. and 
+	{Yoder}, C.~F. and {Zuber}, M.~T.},
+    title = "{Mars high resolution gravity fields from MRO, Mars seasonal gravity, and other dynamical
+parameters}",
+  journal = {Icarus},
+     year = 2011,
+   volume = 211,
+    pages = {401-428},
+      doi = {10.1016/j.icarus.2010.10.004},
+   adsurl = {http://adsabs.harvard.edu/abs/2011Icar..211..401K},
+}
+
+@ARTICLE{Hins:04clouds,
+   author = {{Hinson}, D.~P. and {Wilson}, R.~J.},
+    title = "{Temperature inversions, thermal tides, and water ice clouds in the Martian tropics}",
+  journal = {Journal of Geophysical Research (Planets)},
+ keywords = {Planetary Sciences: Atmospheres-structure and dynamics, Meteorology and Atmospheric Dynamics: Planetary meteorology (5445, 5739), Planetary Sciences: Meteorology (3346), Planetology: Solar System Objects: Mars, Meteorology and Atmospheric Dynamics: Waves and tides},
+     year = 2004,
+   volume = 109,
+   number = E18,
+    pages = {1002-+},
+      doi = {10.1029/2003JE002129},
+   adsurl = {http://adsabs.harvard.edu/abs/2004JGRE..10901002H},
+}
+
+
+@ARTICLE{Heav:10,
+   author = {{Heavens}, N.~G. and {Benson}, J.~L. and {Kass}, D.~M. and {Kleinb{\"o}hl}, A. and 
+	{Abdou}, W.~A. and {McCleese}, D.~J. and {Richardson}, M.~I. and 
+	{Schofield}, J.~T. and {Shirley}, J.~H. and {Wolkenberg}, P.~M.
+	},
+    title = "{Water ice clouds over the Martian tropics during northern summer}",
+  journal = grl,
+ keywords = {Planetary Sciences: Solar System Objects: Mars, Atmospheric Composition and Structure: Cloud physics and chemistry, Atmospheric Composition and Structure: Cloud/radiation interaction, Atmospheric Processes: Clouds and cloud feedbacks, Atmospheric Processes: General circulation (1223)},
+     year = 2010,
+   volume = 37,
+    pages = {18202-+},
+      doi = {10.1029/2010GL044610},
+   adsurl = {http://adsabs.harvard.edu/abs/2010GeoRL..3718202H},
+}
+
+@ARTICLE{Spen:99,
+   author = {{Spencer}, D.~A. and {Blanchard}, R.~C. and {Braun}, R.~D. and 
+	{Kallemeyn}, P.~H. and {Thurman}, S.~W.},
+    title = "{Mars Pathfinder Entry, Descent, and Landing Reconstruction}",
+  journal = {Journal of Spacecraft and Rockets},
+     year = 1999,
+   volume = 36,
+    pages = {357-366},
+      doi = {10.2514/2.3478},
+   adsurl = {http://adsabs.harvard.edu/abs/1999JSpRo..36..357S},
+}
+
+
+@INPROCEEDINGS{Kara:04,
+   author = {{Karatekin}, {\"O}. and {Charbonnier}, {J.-M.} and {Wang}, F. and 
+	{Dehant}, V.},
+    title = "{Dynamic stability of atmospheric entry probes}",
+ keywords = {Planetary Atmospheres, Entry Probes},
+booktitle = {Planetary Probe Atmospheric Entry and Descent Trajectory Analysis and Science},
+     year = 2004,
+   series = {ESA Special Publication},
+   volume = 544,
+   editor = "{A.~Wilson}",
+    pages = {101-108},
+   adsurl = {http://adsabs.harvard.edu/abs/2004ESASP.544..101K},
+}
+
+@INPROCEEDINGS{Kara:01,
+   author = {{Karatekin}, {\"O}.},
+    title = "{Effect of surface pressure variations on the aerodynamic stability of planetary entry capsules}",
+     year = 2001,
+booktitle = {2nd International Symposium on Atmospheric reentry vehicles and systems}
+}
+
+@ARTICLE{Kara:10,
+   author = {{Karatekin}, {\"O}. and Viron, O. and Lambert, S. and Rosenblatt, P. and Dehant, V. and van Hoolst, T. and LeMaistre, S.},
+    title = "{Atmospheric angular momentum variations of Earth, Mars and Venus at seasonal time scales}",
+  journal = {Planetary and Space Science},
+     year = 2010,
+}
+
+@ARTICLE{Wood:97,
+   author = {{Wood}, G.~E. and {Asmar}, S.~W. and {Rebold}, T.~A. and {Lee}, R.~A.},
+    title = "{Mars Pathfinder EntryDescent, and Landing Communications}",
+  journal = {Telecommunications and Data Acquisition Progress Report},
+     year = 1997,
+   volume = 131,
+    pages = {1-19},
+   adsurl = {http://adsabs.harvard.edu/abs/1997TDAPR.131R...1W},
+}
+
+@INPROCEEDINGS{Vang:10dps,
+   author = {{Vangvichith}, M. and {Forget}, F. and {Wordsworth}, R. and 
+	{Millour}, E.},
+    title = "{A 3-D General Circulation Model of Triton's Atmosphere}",
+booktitle = {AAS/Division for Planetary Sciences Meeting Abstracts \#42},
+     year = 2010,
+   series = {Bulletin of the American Astronomical Society},
+   volume = 42,
+    month = oct,
+    pages = {952-+},
+   adsurl = {http://adsabs.harvard.edu/abs/2010DPS....42.0606V},
+  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
+}
+
+@article{Sieb:95,
+  title={{Evaluation of parametric assumptions for shallow cumulus convection}},
+  author={Siebesma, AP and Cuijpers, JWM},
+  journal={Journal of the atmospheric sciences},
+  volume={52},
+  number={6},
+  pages={650--666},
+  year={1995},
+}
+
+@ARTICLE{Toyo:11,
+   author = {{Toyota}, T. and {Kurita}, K. and {Spiga}, A.},
+    title = "{Distribution and time-variation of spire streaks at Pavonis Mons on Mars}",
+  journal = {Planetary and Space Science},
+     year = 2011,
+   volume = 59,
+    pages = {672-682},
+      doi = {10.1016/j.pss.2011.01.015},
+}
+
+@INPROCEEDINGS{Spig:11mamogw,
+   author = {{Spiga}, A. and {Gonzalez-Galindo}, F. and {Forget}, F. and 
+	{Lopez-Valverde}, M.-A.},
+    title = "{Martian Mesospheric CO2 Clouds and Gravity Wave Activity.}",
+booktitle = {Mars Atmosphere: Modelling and observation},
+     year = 2011,
+   editor = "{F.~Forget \& E.~Millour}",
+    pages = {409-412},
+}
+
+@ARTICLE{Gonz:10,
+   author = {{Gonz{\'a}lez-Galindo}, F. and {Bougher}, S.~W. and {L{\'o}pez-Valverde}, M.~A. and 
+	{Forget}, F. and {Murphy}, J.},
+    title = "{Thermal and wind structure of the Martian thermosphere as given by two General Circulation Models}",
+  journal = {Planetary and Space Sciences},
+     year = 2010,
+   volume = 58,
+    pages = {1832-1849},
+      doi = {10.1016/j.pss.2010.08.013},
+   adsurl = {http://adsabs.harvard.edu/abs/2010P%26SS...58.1832G},
+}
+
+@ARTICLE{Lill:10,
+   author = {{Lillis}, R.~J. and {Bougher}, S.~W. and {Gonz{\'a}lez-Galindo}, F. and 
+	{Forget}, F. and {Smith}, M.~D. and {Chamberlin}, P.~C.},
+    title = "{Four Martian years of nightside upper thermospheric mass densities derived from electron
+reflectometry: Method extension and comparison with GCM simulations}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2010,
+    month = jul,
+   volume = 115,
+   number = E14,
+    pages = {E07014},
+      doi = {10.1029/2009JE003529},
+   adsurl = {http://adsabs.harvard.edu/abs/2010JGRE..11507014L},
+}
+
+@ARTICLE{Smit:05,
+   author = {{Smith}, J.~C. and {Bell}, J.},
+    title = "{2001 Mars Odyssey Aerobraking}",
+  journal = {Journal of Spacecraft and Rockets},
+     year = 2005,
+   volume = 42,
+    pages = {406-415},
+      doi = {10.2514/1.15213},
+}
+
+@ARTICLE{With:06b,
+   author = {{Withers}, P.},
+    title = "{Mars Global Surveyor and Mars Odyssey Accelerometer observations of the Martian upper atmosphere
+during aerobraking}",
+  journal = {Geophys.~Res.~Letters},
+     year = 2006,
+   volume = 33,
+    pages = {2201-+},
+      doi = {10.1029/2005GL024447},
+}
+
+@ARTICLE{Tols:08,
+   author = {{Tolson}, R. and {Bemis}, E. and {Hough}, S. and {Zaleski}, K. and
+    {Keating}, G. and {Shidner}, J. and {Brown}, S. and {Brickler}, A. and
+    {Scher}, M. and {Thomas}, P.},
+    title = "{Atmospheric Modeling Using Accelerometer Data During Mars Reconnaissance Orbiter Aerobraking
+Operations}",
+  journal = {Journal of Spacecraft and Rockets},
+     year = 2008,
+   volume = 45,
+    pages = {511-518},
+      doi = {10.2514/1.34301},
+}
+
+
+
+@ARTICLE{Zure:07,
+   author = {{Zurek}, R.~W. and {Smrekar}, S.~E.},
+    title = "{An overview of the Mars Reconnaissance Orbiter (MRO) science mission}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2007,
+   volume = 112,
+   number = E11,
+    pages = {5-+},
+      doi = {10.1029/2006JE002701},
+}
+
+@ARTICLE{Jako:08,
+   author = {{Jakosky}, B.~M. and {Maven Science Team}},
+    title = "{The Mars Atmosphere and Volatile Evolution (MAVEN) Mars Scout Mission}",
+  journal = {LPI Contributions},
+     year = 2008,
+   volume = 1447,
+    pages = {9036-+},
+   adsurl = {http://adsabs.harvard.edu/abs/2008LPICo1447.9036J},
+  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
+}
+
+@ARTICLE{Gior:95,
+   author = {{Giorgini}, J. and {Wong}, S.~K. and {You}, {T.-H.} and {Chadbourne}, P. and
+    {Lim}, L.},
+    title = "{Magellan aerobrake navigation}",
+  journal = {Journal of the British Interplanetary Society},
+     year = 1995,
+   volume = 48,
+    pages = {111-122},
+}
+
+@ARTICLE{Chas:04,
+   author = {{Chassefi{\`e}re}, E. and {Nagy}, A. and {Mandea}, M. and {Primdahl}, F. and
+    {R{\`e}me}, H. and {Sauvaud}, {J.-A.} and {Lin}, R. and {Barabash}, S. and
+    {Mitchell}, D. and {Zurbuchen}, T. and {Leblanc}, F. and {Berthelier}, {J.-J.} and
+    {Waite}, H. and {Young}, D.~T. and {Clarke}, J. and {Parrot}, M. and
+    {Trotignon}, {J.-G.} and {Bertaux}, {J.-L.} and {Qu{\`e}merais}, E. and
+    {Barlier}, F. and {Szeg{\"o}}, K. and {Szala{\"i}}, S. and {Bougher}, S. and
+    {Forget}, F. and {Lilensten}, J. and {Barriot}, {J.-P.} and
+    {Chanteur}, G. and {Luhmann}, J. and {Hulot}, G. and {Purucker}, M. and
+    {Breuer}, D. and {Smrekar}, S. and {Jakosky}, B. and {Menvielle}, M. and
+    {Sasaki}, S. and {Acuna}, M. and {Keating}, G. and {Touboul}, P. and
+    {G{\'e}rard}, {J.-C.} and {Rochus}, P. and {Orsini}, S. and
+    {Cerutti-Maori}, G. and {Porteneuve}, J. and {Meftah}, M. and
+    {Malique}, C.},
+    title = "{DYNAMO: a Mars upper atmosphere package for investigating solar wind interaction and escape
+processes, and mapping Martian fields}",
+  journal = {Advances in Space Research},
+ keywords = {Mars, Upper atmosphere, Escape, Magnetic field, Gravity field},
+     year = 2004,
+   volume = 33,
+    pages = {2228-2235},
+      doi = {10.1016/S0273-1177(03)00528-3},
+}
+
+@ARTICLE{Lebl:09,
+   author = {{Leblanc}, F. and {Langlais}, B. and {Fouchet}, T. and {Barabash}, S. and
+    {Breuer}, D. and {Chassefi{\`e}re}, E. and {Coates}, A. and
+    {Dehant}, V. and {Forget}, F. and {Lammer}, H. and {Lewis}, S. and
+    {Lopez-Valverde}, M. and {Mandea}, M. and {Menvielle}, M. and
+    {Pais}, A. and {Paetzold}, M. and {Read}, P. and {Sotin}, C. and
+    {Tarits}, P. and {Vennerstrom}, S.},
+    title = "{Mars Environment and Magnetic Orbiter Scientific and Measurement Objectives}",
+  journal = {Astrobiology},
+ keywords = {Mars,  Future space mission,  Solar wind, Atmosphere,  Magnetic field,  Surface,},
+     year = 2009,
+   volume = 9,
+    pages = {71-89},
+      doi = {10.1089/ast.2007.0222},
+}
+
+@ARTICLE{Lang:09,
+   author = {{Langlais}, B. and {Leblanc}, F. and {Fouchet}, T. and {Barabash}, S. and
+    {Breuer}, D. and {Chassefi{\`e}re}, E. and {Coates}, A. and
+    {Dehant}, V. and {Forget}, F. and {Lammer}, H. and {Lewis}, S. and
+    {Lopez-Valverde}, M. and {Mandea}, M. and {Menvielle}, M. and
+    {Pais}, A. and {Paetzold}, M. and {Read}, P. and {Sotin}, C. and
+    {Tarits}, P. and {Vennerstrom}, S. and {Branduardi-Raymont}, G. and
+    {Cremonese}, G. and {Merayo}, J.~G.~M. and {Ott}, T. and {R{\`e}me}, H. and
+    {Trotignon}, J.~G. and {Walhund}, J.~E.},
+    title = "{Mars environment and magnetic orbiter model payload}",
+  journal = {Experimental Astronomy},
+ keywords = {Space vehicles, Instruments, Planets and satellites, General, Solar{\amp}ndash, terrestri
+al relations, Formation, Magnetic fields, Solar system},
+     year = 2009,
+   volume = 23,
+    pages = {761-783},
+      doi = {10.1007/s10686-008-9101-1},
+}
+
+
+
+
+@BOOK{King:87,
+   author = {{King-Hele}, D.},
+    title = "{Satellite orbits in an atmosphere. Theory and applications.}",
+booktitle = {Satellite orbits in an atmosphere.~Theory and applications..~D.~King-Hele.Blackie and Son
+ Ltd., Glasgow, UK.~11+291 pp.~ISBN 0-216-92252-6},
+     year = 1987,
+}
+
+@ARTICLE{Albe:01,
+   author = {{Albee}, A.~L. and {Arvidson}, R.~E. and {Palluconi}, F. and
+    {Thorpe}, T.},
+    title = "{Overview of the Mars Global Surveyor mission}",
+  journal = {Journal of Geophysical Research (Planets)},
+ keywords = {Planetology: Solar System Objects: Mars},
+     year = 2001,
+   volume = 106,
+    pages = {23291-23316},
+      doi = {10.1029/2000JE001306},
+}
+
+@BOOK{Capd:05,
+   author = {{Capderou}, M.},
+    title = "{Satellites: Orbits and missions}",
+booktitle = {Satellites: Orbits and missions, by M.~Capderou.~364 p.~With CD-ROM.~2-287-21317-1.~ Berl
+in: Springer, 2005.},
+     year = 2005,
+}
+
+
+@BOOK{Vall:07,
+   author = {{Vallado}, D.~A.},
+    title = "{Fundamentals of Astrodynamics and Applications}",
+booktitle = {Fundamentals of Astrodynamics and Applications, by D.A.~Vallado.~Berlin: Springer, 2007.~
+ ISBN: 978-0-387-71831-6},
+     year = 2007,
+   editor = "{Vallado, D.~A.}",
+}
+
+
+@ARTICLE{Tols:07,
+   author = {{Tolson}, R.~H. and {Keating}, G.~M. and {Zurek}, R.~W. and 
+	{Bougher}, S.~W. and {Justus}, C.~G. and {Fritts}, D.~C.},
+    title = "{Application of Accelerometer Data to Atmospheric Modeling During Mars Aerobraking Operations}",
+  journal = {Journal of Spacecraft and Rockets},
+     year = 2007,
+   volume = 44,
+    pages = {1172-1179},
+      doi = {10.2514/1.28472},
+   adsurl = {http://adsabs.harvard.edu/abs/2007JSpRo..44.1172T},
+}
+
+@ARTICLE{Frit:89,
+   author = {{Fritts}, D.~C.},
+    title = "{A review of gravity wave saturation processes, effects, and variability in the middle atmosphere}",
+  journal = {Pure and Applied Geophysics},
+     year = 1989,
+   volume = 130,
+    pages = {343-371},
+      doi = {10.1007/BF00874464},
+}
+
+@ARTICLE{Lebl:95,
+   author = {{Leblanc}, T. and {Hauchecorne}, A. and {Chanin}, M.-L. and 
+	{Rodgers}, C. and {Taylor}, F. and {Livesey}, N.},
+    title = "{Mesospheric temperature inversions as seen by ISAMS in December 1991}",
+  journal = {Geophys.~Res.~Letters},
+     year = 1995,
+   volume = 22,
+    pages = {1485-1488},
+      doi = {10.1029/94GL03274},
+}
+
+@article{Vinc:11,
+  title={Observations of mesospheric {CO$_2$} and {H$_2$O} clouds on Mars},
+  author={Vincendon, M. and Pilorget, C. and Gondet, B. and Murchie, S. and Bibring, J.P.},
+  journal={Arxiv preprint arXiv:1103.3448},
+  year={2011}
+}
+
+@ARTICLE{Elle:10,
+   author = {{Ellehoj}, M.~D. and {Gunnlaugsson}, H.~P. and {Taylor}, P.~A. and 
+	{Kahanp{\"a}{\"a}}, H. and {Bean}, K.~M. and {Cantor}, B.~A. and 
+	{Gheynani}, B.~T. and {Drube}, L. and {Fisher}, D. and {Harri}, A.-M. and 
+	{Holstein-Rathlou}, C. and {Lemmon}, M.~T. and {Madsen}, M.~B. and 
+	{Malin}, M.~C. and {Polkko}, J. and {Smith}, P.~H. and {Tamppari}, L.~K. and 
+	{Weng}, W. and {Whiteway}, J.},
+    title = "{Convective vortices and dust devils at the Phoenix Mars mission landing site}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2010,
+   volume = 115,
+   number = {E14},
+    pages = {E00E16},
+      doi = {10.1029/2009JE003413},
+}
+
+@ARTICLE{Heav:11dust,
+   author = {{Heavens}, N.~G. and {Richardson}, M.~I. and {Kleinb{\"o}hl}, A. and 
+	{Kass}, D.~M. and {McCleese}, D.~J. and {Abdou}, W. and {Benson}, J.~L. and 
+	{Schofield}, J.~T. and {Shirley}, J.~H. and {Wolkenberg}, P.~M.
+	},
+    title = "{Vertical distribution of dust in the Martian atmosphere during northern spring and summer: High-altitude tropical dust maximum at northern summer solstice}",
+  journal = {Journal of Geophysical Research (Planets)},
+     year = 2011,
+   volume = 116,
+   number = {E15},
+    pages = {E01007},
+      doi = {10.1029/2010JE003692},
+}
+
+@ARTICLE{Scho:10,
+   author = {{Scholten}, F. and {Hoffmann}, H. and {M{\"a}{\"a}tt{\"a}nen}, A. and 
+	{Montmessin}, F. and {Gondet}, B. and {Hauber}, E.},
+    title = "{Concatenation of HRSC colour and OMEGA data for the determination and 3D-parameterization of high-altitude CO$_{2}$ clouds in the Martian atmosphere}",
+  journal = {Planetary and Space Science},
+     year = 2010,
+   volume = 58,
+    pages = {1207-1214},
+      doi = {10.1016/j.pss.2010.04.015},
+}
+
Index: trunk/MESOSCALE_DEV/DOC/SRC/these.bst
===================================================================
--- trunk/MESOSCALE_DEV/DOC/SRC/these.bst	(revision 207)
+++ trunk/MESOSCALE_DEV/DOC/SRC/these.bst	(revision 207)
@@ -0,0 +1,1252 @@
+%
+% Style de bibliographie pour the`se - d'apres alpha.bst
+%
+% Matthieu Herrb (matthieu@laas.fr) - Juillet 89, Octobre 90
+%
+%        Les references seront designees tant dans le texte que dans
+% la liste recapitulative (ordonnee suivant l'ordre alphabetique du nom
+% du premier auteur), par le nom du premier auteur suivi des deux
+% derniers chiffres de l'annee de publication, le tout entre crochets.
+% Si deux references du meme auteur se rapportent a la meme annee, elles
+% seront differenciees par des lettres minuscules (a, b, etc.)
+%
+ 
+	% version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
+	% Copyright (C) 1985, all rights reserved.
+	% Copying of this file is authorized only if either
+	% (1) you make absolutely no changes to your copy, including name, or
+	% (2) if you do make changes, you name it something other than
+	% btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
+	% This restriction helps ensure that all standard styles are identical.
+ 
+ENTRY
+  { address
+    author
+    booktitle
+    chapter
+    edition
+    editor
+    howpublished
+    institution
+    journal
+    key
+    month
+    note
+    number
+    organization
+    pages
+    publisher
+    school
+    series
+    title
+    type
+    volume
+    year
+  }
+  {}
+  { label extra.label sort.label }
+ 
+INTEGERS { output.state before.all mid.sentence after.sentence after.block }
+ 
+FUNCTION {init.state.consts}
+{ #0 'before.all :=
+  #1 'mid.sentence :=
+  #2 'after.sentence :=
+  #3 'after.block :=
+}
+ 
+STRINGS { s t }
+ 
+FUNCTION {output.nonnull}
+{ 's :=
+  output.state mid.sentence =
+    { ", " * write$ }
+    { output.state after.block =
+	{ add.period$ write$
+	  newline$
+	  "\newblock " write$
+	}
+	{ output.state before.all =
+	    'write$
+	    { add.period$ " " * write$ }
+	  if$
+	}
+      if$
+      mid.sentence 'output.state :=
+    }
+  if$
+  s
+}
+ 
+FUNCTION {output}
+{ duplicate$ empty$
+    'pop$
+    'output.nonnull
+  if$
+}
+ 
+FUNCTION {output.check}
+{ 't :=
+  duplicate$ empty$
+    { pop$ "empty " t * " in " * cite$ * warning$ }
+    'output.nonnull
+  if$
+}
+ 
+FUNCTION {output.bibitem}
+{ newline$
+  "\bibitem[" write$
+  label write$
+  "]{" write$
+  cite$ write$
+  "}" write$
+  newline$
+  ""
+  before.all 'output.state :=
+}
+ 
+FUNCTION {fin.entry}
+{ add.period$
+  write$
+  newline$
+}
+ 
+FUNCTION {new.block}
+{ output.state before.all =
+    'skip$
+    { after.block 'output.state := }
+  if$
+}
+ 
+FUNCTION {new.sentence}
+{ output.state after.block =
+    'skip$
+    { output.state before.all =
+	'skip$
+	{ after.sentence 'output.state := }
+      if$
+    }
+  if$
+}
+ 
+FUNCTION {not}
+{   { #0 }
+    { #1 }
+  if$
+}
+ 
+FUNCTION {and}
+{   'skip$
+    { pop$ #0 }
+  if$
+}
+ 
+FUNCTION {or}
+{   { pop$ #1 }
+    'skip$
+  if$
+}
+ 
+FUNCTION {new.block.checka}
+{ empty$
+    'skip$
+    'new.block
+  if$
+}
+ 
+FUNCTION {new.block.checkb}
+{ empty$
+  swap$ empty$
+  and
+    'skip$
+    'new.block
+  if$
+}
+ 
+FUNCTION {new.sentence.checka}
+{ empty$
+    'skip$
+    'new.sentence
+  if$
+}
+ 
+FUNCTION {new.sentence.checkb}
+{ empty$
+  swap$ empty$
+  and
+    'skip$
+    'new.sentence
+  if$
+}
+ 
+FUNCTION {field.or.null}
+{ duplicate$ empty$
+    { pop$ "" }
+    'skip$
+  if$
+}
+ 
+FUNCTION {emphasize}
+{ duplicate$ empty$
+    { pop$ "" }
+    { "{\em " swap$ * "}" * }
+  if$
+}
+ 
+FUNCTION {scapify}
+{ duplicate$ empty$
+    { pop$ "" }
+    { "{\sc " swap$ * "}" * }
+  if$
+}
+ 
+FUNCTION {underline}
+{ duplicate$ empty$
+    { pop$ "" }
+    { "{\ul " swap$ * "}" * }
+  if$
+}
+ 
+INTEGERS { nameptr namesleft numnames }
+ 
+FUNCTION {format.names}
+{ 's :=
+  #1 'nameptr :=
+  s num.names$ 'numnames :=
+  numnames 'namesleft :=
+    { namesleft #0 > }
+    { s nameptr "{ff~}{vv~}{ll}{~jj}" format.name$ 't :=
+      nameptr #1 >
+	{ namesleft #1 >
+	    { ", " * t * }
+	    { numnames #2 >
+		{ "" * }
+		'skip$
+	      if$
+	      t "others" =
+		{ " et~al." emphasize * }
+		{ " \& " * t * }
+	      if$
+	    }
+	  if$
+	}
+	't
+      if$
+      nameptr #1 + 'nameptr :=
+      namesleft #1 - 'namesleft :=
+    }
+  while$
+}
+ 
+FUNCTION {format.authors}
+{ author empty$
+    { "" }
+    { author format.names }
+  if$
+}
+ 
+FUNCTION {format.editors}
+{ editor empty$
+    { "" }
+    { editor format.names
+      editor num.names$ #1 >
+	{ ", editeurs" * }
+	{ ", editeur" * }
+      if$
+    }
+  if$
+}
+ 
+FUNCTION {format.title}
+{ title empty$
+    { "" }
+    { title "t" change.case$ }
+  if$
+}
+ 
+FUNCTION {n.dashify}
+{ 't :=
+  ""
+    { t empty$ not }
+    { t #1 #1 substring$ "-" =
+	{ t #1 #2 substring$ "--" = not
+	    { "--" *
+	      t #2 global.max$ substring$ 't :=
+	    }
+	    {   { t #1 #1 substring$ "-" = }
+		{ "-" *
+		  t #2 global.max$ substring$ 't :=
+		}
+	      while$
+	    }
+	  if$
+	}
+	{ t #1 #1 substring$ *
+	  t #2 global.max$ substring$ 't :=
+	}
+      if$
+    }
+  while$
+}
+ 
+FUNCTION {format.date}
+{ year empty$
+    { month empty$
+	{ "" }
+	{ "there's a month but no year in " cite$ * warning$
+	  month
+	}
+      if$
+    }
+    { month empty$
+	'year
+	{ month " " * year * }
+      if$
+    }
+  if$
+}
+ 
+FUNCTION {format.btitle}
+{ title emphasize
+}
+ 
+FUNCTION {format.utitle}
+{ title emphasize
+}
+ 
+FUNCTION {tie.or.space.connect}
+{ duplicate$ text.length$ #3 <
+    { "~" }
+    { " " }
+  if$
+  swap$ * *
+}
+ 
+FUNCTION {either.or.check}
+{ empty$
+    'pop$
+    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
+  if$
+}
+ 
+FUNCTION {format.bvolume}
+{ volume empty$
+    { "" }
+    { "volume" volume tie.or.space.connect
+      series empty$
+	'skip$
+	{ " of " * series emphasize * }
+      if$
+      "volume and number" number either.or.check
+    }
+  if$
+}
+ 
+FUNCTION {format.number.series}
+{ volume empty$
+    { number empty$
+	{ series field.or.null }
+	{ output.state mid.sentence =
+	    { "num\'ero" }
+	    { "Nume\'ero" }
+	  if$
+	  number tie.or.space.connect
+	  series empty$
+	    { "there's a number but no series in " cite$ * warning$ }
+	    { " in " * series * }
+	  if$
+	}
+      if$
+    }
+    { "" }
+  if$
+}
+ 
+FUNCTION {format.edition}
+{ edition empty$
+    { "" }
+    { output.state mid.sentence =
+	{ edition "l" change.case$ " edition" * }
+	{ edition "t" change.case$ " edition" * }
+      if$
+    }
+  if$
+}
+ 
+INTEGERS { multiresult }
+ 
+FUNCTION {multi.page.check}
+{ 't :=
+  #0 'multiresult :=
+    { multiresult not
+      t empty$ not
+      and
+    }
+    { t #1 #1 substring$
+      duplicate$ "-" =
+      swap$ duplicate$ "," =
+      swap$ "+" =
+      or or
+	{ #1 'multiresult := }
+	{ t #2 global.max$ substring$ 't := }
+      if$
+    }
+  while$
+  multiresult
+}
+ 
+FUNCTION {format.pages}
+{ pages empty$
+    { "" }
+    { pages multi.page.check
+	{ "pages" pages n.dashify tie.or.space.connect }
+	{ "page" pages tie.or.space.connect }
+      if$
+    }
+  if$
+}
+ 
+ 
+FUNCTION {format.volume}
+{ volume empty$
+    { "" }
+    { "vol.~" volume * }
+  if$
+}
+ 
+FUNCTION {format.number}
+{ number empty$
+    { "" }
+    { "no.~" number * }
+  if$
+}
+ 
+FUNCTION {format.chapter.pages}
+{ chapter empty$
+    'format.pages
+    { type empty$
+	{ "chapitre" }
+	{ type "l" change.case$ }
+      if$
+      chapter tie.or.space.connect
+      pages empty$
+	'skip$
+	{ ", " * format.pages * }
+      if$
+    }
+  if$
+}
+ 
+FUNCTION {format.in.ed.booktitle}
+{ booktitle empty$
+    { "" }
+    { editor empty$
+	{ "In " booktitle * }
+	{ "In " format.editors * ", " * booktitle * }
+      if$
+    }
+  if$
+}
+ 
+FUNCTION {empty.misc.check}
+{ author empty$ title empty$ howpublished empty$
+  month empty$ year empty$ note empty$
+  and and and and and
+  key empty$ not and
+    { "all relevant fields are empty in " cite$ * warning$ }
+    'skip$
+  if$
+}
+ 
+FUNCTION {format.thesis.type}
+{ type empty$
+    'skip$
+    { pop$
+      type "t" change.case$
+    }
+  if$
+}
+ 
+FUNCTION {format.tr.number}
+{ type empty$
+    { "Rapport technique" }
+    'type
+  if$
+  number empty$
+    { "t" change.case$ }
+    { number tie.or.space.connect }
+  if$
+}
+ 
+FUNCTION {format.article.crossref}
+{ key empty$
+    { journal empty$
+	{ "need key or journal for " cite$ * " to crossref " * crossref *
+	  warning$
+	  ""
+	}
+	{ "In {\em " journal * "\/}" * }
+      if$
+    }
+    { "In " key * }
+  if$
+  " \cite{" * crossref * "}" *
+}
+ 
+FUNCTION {format.crossref.editor}
+{ editor #1 "{vv~}{ll}" format.name$
+  editor num.names$ duplicate$
+  #2 >
+    { pop$ " et~al." * }
+    { #2 <
+	'skip$
+	{ editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
+	    { " et~al." * }
+	    { " \& " * editor #2 "{vv~}{ll}" format.name$ * }
+	  if$
+	}
+      if$
+    }
+  if$
+}
+ 
+FUNCTION {format.book.crossref}
+{ volume empty$
+    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
+      "In "
+    }
+    { "Volume" volume tie.or.space.connect
+      " of " *
+    }
+  if$
+  editor empty$
+  editor field.or.null author field.or.null =
+  or
+    { key empty$
+	{ series empty$
+	    { "need editor, key, or series for " cite$ * " to crossref " *
+	      crossref * warning$
+	      "" *
+	    }
+	    { "{\em " * series * "\/}" * }
+	  if$
+	}
+	{ key * }
+      if$
+    }
+    { format.crossref.editor * }
+  if$
+  " \cite{" * crossref * "}" *
+}
+ 
+FUNCTION {format.incoll.inproc.crossref}
+{ editor empty$
+  editor field.or.null author field.or.null =
+  or
+    { booktitle empty$
+        { key empty$
+	    { "need editor, key, or booktitle for " cite$ * " to crossref " *
+	      crossref * warning$
+	      ""
+	    }
+	    { "In " key * }
+	  if$
+	}
+	{ "In " booktitle * }
+      if$
+    }
+    { "In " format.crossref.editor * }
+  if$
+  " \cite{" * crossref * "}" *
+}
+ 
+FUNCTION {article}
+{ output.bibitem
+  format.authors "author" output.check
+  new.block
+  format.utitle "title" output.check
+  new.block
+  crossref missing$
+    { journal "journal" output.check
+      format.volume output
+      format.number output 
+      format.pages output
+      format.date "year" output.check
+    }
+    { format.article.crossref output.nonnull
+      format.pages output
+    }
+  if$
+  new.block
+  note output
+  fin.entry
+}
+ 
+FUNCTION {book}
+{ output.bibitem
+  author empty$
+    { format.editors "author and editor" output.check }
+    { format.authors output.nonnull
+      crossref missing$
+	{ "author and editor" editor either.or.check }
+	'skip$
+      if$
+    }
+  if$
+  new.block
+  format.title "title" output.check
+  crossref missing$
+    { format.bvolume output
+      new.block
+      format.number.series output
+      new.sentence
+      publisher "publisher" output.check
+      address output
+    }
+    { new.block
+      format.book.crossref output.nonnull
+    }
+  if$
+  format.edition output
+  format.date "year" output.check
+  new.block
+  note output
+  fin.entry
+}
+ 
+FUNCTION {booklet}
+{ output.bibitem
+  format.authors output
+  new.block
+  format.title "title" output.check
+  howpublished address new.block.checkb
+  howpublished output
+  address output
+  format.date output
+  new.block
+  note output
+  fin.entry
+}
+ 
+FUNCTION {inbook}
+{ output.bibitem
+  author empty$
+    { format.editors "author and editor" output.check }
+    { format.authors output.nonnull
+      crossref missing$
+	{ "author and editor" editor either.or.check }
+	'skip$
+      if$
+    }
+  if$
+  new.block
+  format.title "title" output.check
+  crossref missing$
+    { format.bvolume output
+      format.chapter.pages "chapter and pages" output.check
+      new.block
+      format.number.series output
+      new.sentence
+      publisher "publisher" output.check
+      address output
+    }
+    { format.chapter.pages "chapter and pages" output.check
+      new.block
+      format.book.crossref output.nonnull
+    }
+  if$
+  format.edition output
+  format.date "year" output.check
+  new.block
+  note output
+  fin.entry
+}
+ 
+FUNCTION {incollection}
+{ output.bibitem
+  format.authors "author" output.check
+  new.block
+  format.utitle "title" output.check
+  new.block
+  crossref missing$
+    { format.in.ed.booktitle "booktitle" output.check
+      format.bvolume output
+      format.number.series output
+      format.chapter.pages output
+      new.sentence
+      publisher "publisher" output.check
+      address output
+      format.edition output
+      format.date "year" output.check
+    }
+    { format.incoll.inproc.crossref output.nonnull
+      format.chapter.pages output
+    }
+  if$
+  new.block
+  note output
+  fin.entry
+}
+ 
+FUNCTION {inproceedings}
+{ output.bibitem
+  format.authors "author" output.check
+  new.block
+  format.utitle "title" output.check
+  new.block
+  crossref missing$
+    { format.in.ed.booktitle "booktitle" output.check
+      format.bvolume output
+      format.number.series output
+      format.pages output
+      address empty$
+	{ organization publisher new.sentence.checkb
+	  organization output
+	  publisher output
+	  format.date "year" output.check
+	}
+	{ address output.nonnull
+	  format.date "year" output.check
+	  new.sentence
+	  organization output
+	  publisher output
+	}
+      if$
+    }
+    { format.incoll.inproc.crossref output.nonnull
+      format.pages output
+    }
+  if$
+  new.block
+  note output
+  fin.entry
+}
+ 
+FUNCTION {conference} { inproceedings }
+ 
+FUNCTION {manual}
+{ output.bibitem
+  author empty$
+    { organization empty$
+	'skip$
+	{ organization output.nonnull
+	  address output
+	}
+      if$
+    }
+    { format.authors output.nonnull }
+  if$
+  new.block
+  format.utitle "title" output.check
+  author empty$
+    { organization empty$
+	{ address new.block.checka
+	  address output
+	}
+	'skip$
+      if$
+    }
+    { organization address new.block.checkb
+      organization output
+      address output
+    }
+  if$
+  format.edition output
+  format.date output
+  new.block
+  note output
+  fin.entry
+}
+ 
+FUNCTION {mastersthesis}
+{ output.bibitem
+  format.authors "author" output.check
+  new.block
+  format.title "title" output.check
+  new.block
+  "Master's thesis" format.thesis.type output.nonnull
+  school "school" output.check
+  address output
+  format.date "year" output.check
+  new.block
+  note output
+  fin.entry
+}
+ 
+FUNCTION {misc}
+{ output.bibitem
+  format.authors output
+  title howpublished new.block.checkb
+  format.utitle output
+  howpublished new.block.checka
+  howpublished output
+  format.date output
+  new.block
+  note output
+  fin.entry
+  empty.misc.check
+}
+ 
+FUNCTION {phdthesis}
+{ output.bibitem
+  format.authors "author" output.check
+  new.block
+  format.btitle "title" output.check
+  new.block
+  "PhD thesis" format.thesis.type output.nonnull
+  school "school" output.check
+  address output
+  format.date "year" output.check
+  new.block
+  note output
+  fin.entry
+}
+ 
+FUNCTION {proceedings}
+{ output.bibitem
+  editor empty$
+    { organization output }
+    { format.editors output.nonnull }
+  if$
+  new.block
+  format.title "title" output.check
+  format.bvolume output
+  format.number.series output
+  address empty$
+    { editor empty$
+	{ publisher new.sentence.checka }
+	{ organization publisher new.sentence.checkb
+	  organization output
+	}
+      if$
+      publisher output
+      format.date "year" output.check
+    }
+    { address output.nonnull
+      format.date "year" output.check
+      new.sentence
+      editor empty$
+	'skip$
+	{ organization output }
+      if$
+      publisher output
+    }
+  if$
+  new.block
+  note output
+  fin.entry
+}
+ 
+FUNCTION {techreport}
+{ output.bibitem
+  format.authors "author" output.check
+  new.block
+  format.utitle "title" output.check
+  new.block
+  format.tr.number output.nonnull
+  institution "institution" output.check
+  address output
+  format.date "year" output.check
+  new.block
+  note output
+  fin.entry
+}
+ 
+FUNCTION {unpublished}
+{ output.bibitem
+  format.authors "author" output.check
+  new.block
+  format.title "title" output.check
+  new.block
+  note "note" output.check
+  format.date output
+  fin.entry
+}
+ 
+FUNCTION {default.type} { misc }
+ 
+MACRO {jan} {"January"}
+ 
+MACRO {feb} {"February"}
+ 
+MACRO {mar} {"March"}
+ 
+MACRO {apr} {"April"}
+ 
+MACRO {may} {"May"}
+ 
+MACRO {jun} {"June"}
+ 
+MACRO {jul} {"July"}
+ 
+MACRO {aug} {"August"}
+ 
+MACRO {sep} {"September"}
+ 
+MACRO {oct} {"October"}
+ 
+MACRO {nov} {"November"}
+ 
+MACRO {dec} {"December"}
+ 
+MACRO {acmcs} {"ACM Computing Surveys"}
+ 
+MACRO {acta} {"Acta Informatica"}
+ 
+MACRO {cacm} {"Communications of the ACM"}
+ 
+MACRO {ibmjrd} {"IBM Journal of Research and Development"}
+ 
+MACRO {ibmsj} {"IBM Systems Journal"}
+ 
+MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
+ 
+MACRO {ieeetc} {"IEEE Transactions on Computers"}
+ 
+MACRO {ieeetcad}
+ {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
+ 
+MACRO {ipl} {"Information Processing Letters"}
+ 
+MACRO {jacm} {"Journal of the ACM"}
+ 
+MACRO {jcss} {"Journal of Computer and System Sciences"}
+ 
+MACRO {scp} {"Science of Computer Programming"}
+ 
+MACRO {sicomp} {"SIAM Journal on Computing"}
+ 
+MACRO {tocs} {"ACM Transactions on Computer Systems"}
+ 
+MACRO {tods} {"ACM Transactions on Database Systems"}
+ 
+MACRO {tog} {"ACM Transactions on Graphics"}
+ 
+MACRO {toms} {"ACM Transactions on Mathematical Software"}
+ 
+MACRO {toois} {"ACM Transactions on Office Information Systems"}
+ 
+MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
+ 
+MACRO {tcs} {"Theoretical Computer Science"}
+ 
+READ
+ 
+FUNCTION {sortify}
+{ purify$
+  "l" change.case$
+}
+ 
+INTEGERS { len }
+ 
+FUNCTION {chop.word}
+{ 's :=
+  'len :=
+  s #1 len substring$ =
+    { s len #1 + global.max$ substring$ }
+    's
+  if$
+}
+ 
+INTEGERS { et.al.char.used }
+ 
+FUNCTION {initialize.et.al.char.used}
+{ #0 'et.al.char.used :=
+}
+ 
+EXECUTE {initialize.et.al.char.used}
+ 
+%
+% Cette function produit le label avec le nom du premier auteur
+%
+FUNCTION {format.lab.names}
+{ 's :=
+  s #1 "{vv }{ll}" format.name$
+}
+ 
+FUNCTION {author.key.label}
+{ author empty$
+    { key empty$
+	{ cite$ #1 #3 substring$ }
+	{ key #3 }
+      if$
+    }
+    { author format.lab.names }
+  if$
+}
+ 
+FUNCTION {author.editor.key.label}
+{ author empty$
+    { editor empty$
+	{ key empty$
+	    { cite$ #1 #3 substring$ }
+	    { key }
+	  if$
+	}
+	{ editor format.lab.names }
+      if$
+    }
+    { author format.lab.names }
+  if$
+}
+ 
+FUNCTION {author.key.organization.label}
+{ author empty$
+    { key empty$
+	{ organization empty$
+	    { cite$ #1 #3 substring$ }
+	    { "The " #4 organization chop.word #3 text.prefix$ }
+	  if$
+	}
+	{ key }
+      if$
+    }
+    { author format.lab.names }
+  if$
+}
+ 
+FUNCTION {editor.key.organization.label}
+{ editor empty$
+    { key empty$
+	{ organization empty$
+	    { cite$ #1 #3 substring$ }
+	    { "The " #4 organization chop.word #3 text.prefix$ }
+	  if$
+	}
+	{ key }
+      if$
+    }
+    { editor format.lab.names }
+  if$
+}
+ 
+%
+% Fonction modifiee pour generer les bons labels
+FUNCTION {calc.label}
+{ type$ "book" =
+  type$ "inbook" =
+  or
+    'author.editor.key.label
+    { type$ "proceedings" =
+	'editor.key.organization.label
+	{ type$ "manual" =
+	    'author.key.organization.label
+	    'author.key.label
+	  if$
+	}
+      if$
+    }
+  if$
+  duplicate$
+  "~" *
+  year #-1 #2 substring$ field.or.null purify$ *
+  'label :=
+  year #-1 #4 substring$ field.or.null purify$ 
+  *
+  sortify 'sort.label :=
+}
+ 
+FUNCTION {sort.format.names}
+{ 's :=
+  #1 'nameptr :=
+  ""
+  s num.names$ 'numnames :=
+  numnames 'namesleft :=
+    { namesleft #0 > }
+    { nameptr #1 >
+	{ "   " * }
+	'skip$
+      if$
+      s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
+      nameptr numnames = t "others" = and
+	{ "et al" * }
+	{ t sortify * }
+      if$
+      nameptr #1 + 'nameptr :=
+      namesleft #1 - 'namesleft :=
+    }
+  while$
+}
+ 
+FUNCTION {sort.format.title}
+{ 't :=
+  "A " #2
+    "An " #3
+      "The " #4 t chop.word
+    chop.word
+  chop.word
+  sortify
+  #1 global.max$ substring$
+}
+ 
+FUNCTION {author.sort}
+{ author empty$
+    { key empty$
+	{ "to sort, need author or key in " cite$ * warning$
+	  ""
+	}
+	{ key sortify }
+      if$
+    }
+    { author sort.format.names }
+  if$
+}
+ 
+FUNCTION {author.editor.sort}
+{ author empty$
+    { editor empty$
+	{ key empty$
+	    { "to sort, need author, editor, or key in " cite$ * warning$
+	      ""
+	    }
+	    { key sortify }
+	  if$
+	}
+	{ editor sort.format.names }
+      if$
+    }
+    { author sort.format.names }
+  if$
+}
+ 
+FUNCTION {author.organization.sort}
+{ author empty$
+    { organization empty$
+	{ key empty$
+	    { "to sort, need author, organization, or key in " cite$ * warning$
+	      ""
+	    }
+	    { key sortify }
+	  if$
+	}
+	{ "The " #4 organization chop.word sortify }
+      if$
+    }
+    { author sort.format.names }
+  if$
+}
+ 
+FUNCTION {editor.organization.sort}
+{ editor empty$
+    { organization empty$
+	{ key empty$
+	    { "to sort, need editor, organization, or key in " cite$ * warning$
+	      ""
+	    }
+	    { key sortify }
+	  if$
+	}
+	{ "The " #4 organization chop.word sortify }
+      if$
+    }
+    { editor sort.format.names }
+  if$
+}
+ 
+FUNCTION {presort}
+{ calc.label
+  sort.label
+  "    "
+  *
+  type$ "book" =
+  type$ "inbook" =
+  or
+    'author.editor.sort
+    { type$ "proceedings" =
+	'editor.organization.sort
+	{ type$ "manual" =
+	    'author.organization.sort
+	    'author.sort
+	  if$
+	}
+      if$
+    }
+  if$
+  *
+  "    "
+  *
+  year field.or.null sortify
+  *
+  "    "
+  *
+  title field.or.null
+  sort.format.title
+  *
+  #1 entry.max$ substring$
+  'sort.key$ :=
+}
+ 
+ITERATE {presort}
+ 
+SORT
+ 
+STRINGS { longest.label last.sort.label next.extra }
+ 
+INTEGERS { longest.label.width last.extra.num }
+ 
+FUNCTION {initialize.longest.label}
+{ "" 'longest.label :=
+  #0 int.to.chr$ 'last.sort.label :=
+  "" 'next.extra :=
+  #0 'longest.label.width :=
+  #0 'last.extra.num :=
+}
+ 
+FUNCTION {forward.pass}
+{ last.sort.label sort.label =
+    { last.extra.num #1 + 'last.extra.num :=
+      last.extra.num int.to.chr$ 'extra.label :=
+    }
+    { "a" chr.to.int$ 'last.extra.num :=
+      "" 'extra.label :=
+      sort.label 'last.sort.label :=
+    }
+  if$
+}
+ 
+FUNCTION {reverse.pass}
+{ next.extra "b" =
+    { "a" 'extra.label := }
+    'skip$
+  if$
+  label extra.label * 'label :=
+  label width$ longest.label.width >
+    { label 'longest.label :=
+      label width$ 'longest.label.width :=
+    }
+    'skip$
+  if$
+  extra.label 'next.extra :=
+}
+ 
+EXECUTE {initialize.longest.label}
+ 
+ITERATE {forward.pass}
+ 
+REVERSE {reverse.pass}
+ 
+FUNCTION {begin.bib}
+{ et.al.char.used
+    { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
+    'skip$
+  if$
+  preamble$ empty$
+    'skip$
+    { preamble$ write$ newline$ }
+  if$
+  "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
+%  "\begin{thebibliography}{xxxxx}" write$ newline$
+}
+ 
+EXECUTE {begin.bib}
+ 
+EXECUTE {init.state.consts}
+ 
+ITERATE {call.type$}
+ 
+FUNCTION {end.bib}
+{ newline$
+  "\end{thebibliography}" write$ newline$
+}
+ 
+EXECUTE {end.bib}
Index: trunk/MESOSCALE_DEV/DOC/SRC/these_spiga.sty
===================================================================
--- trunk/MESOSCALE_DEV/DOC/SRC/these_spiga.sty	(revision 207)
+++ trunk/MESOSCALE_DEV/DOC/SRC/these_spiga.sty	(revision 207)
@@ -0,0 +1,170 @@
+%
+%\documentclass{book}
+%\documentclass[10pt,a4paper,twoside,openright]{report}
+%\documentclass[12pt,a4paper,twoside]{report}
+%
+\documentclass[10pt,a4paper,twoside,openright,titlepage]{book}
+%\documentclass[10pt,a4paper,twoside]{report}
+%\documentclass[10pt,a4paper,twoside]{book}
+%\documentclass[12pt,a4paper,twoside]{book}
+%%
+%%
+%% PACKAGES
+%%
+%\usepackage[utf8]{inputenc}
+%\usepackage[french]{babel}
+%%
+%
+% FROM annales.sty (c) H&K
+%
+%\input{annales.sty}
+\usepackage{annales}
+%
+% END FROM annales.sty (c) H&K
+%
+\usepackage{srcltx}
+%\usepackage{pslatex}
+%\usepackage{pdflatex}
+
+\usepackage{setspace}
+
+%\pdfadjustspacing=1
+
+\usepackage{hyperref} 
+
+\usepackage{pdfpages}
+
+
+%\usepackage{pslatex}
+\usepackage{sectsty}
+%%\chapterfont{\large\sc\centering}
+%\chapterfont{\sc\centering}
+%\chaptertitlefont{\sc\centering}
+%\sectionfont{\sc\centering}
+%\subsectionfont{\sc\centering}
+%\subsubsectionfont{\sc\centering}
+\allsectionsfont{\sc\centering}
+
+\usepackage[english]{minitoc}
+
+\usepackage{wasysym}
+%\usepackage[pdftex]{graphicx}
+
+
+\def\thechapter       {\Roman{chapter}}
+\def\thesection       {\thechapter.\arabic{section}}
+\def\thesubsection    {\thesection.\arabic{subsection}}
+\def\thesubsubsection {\thesubsection.\arabic{subsubsection}}
+%\def\thechapter       {\arabic{chapter}}
+%\def\thesection       {\arabic{section}}
+%\def\thesubsection    {\thesection.\arabic{subsection}}
+%\def\thesubsubsection {\thesubsection.\arabic{subsubsection}}
+\setcounter{secnumdepth}{3}
+\setcounter{tocdepth}{3}
+
+\setcounter{minitocdepth}{1}
+
+%\renewcommand{\labelitemi}{$\star$}
+
+%\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}}
+
+%%% figures
+%%\makeatletter
+%%\renewcommand{\fnum@figure}{\figurename~\thefigure\sffamily\small\bfseries}
+%%\makeatother
+%\makeatletter
+%\renewcommand{\fnum@figure}{\figurename~\thefigure\bfseries}
+%\makeatother
+
+
+%\usepackage{amsmath}
+%\usepackage{amsfonts}
+%\usepackage{amssymb}
+%%
+%\usepackage{epsfig}
+%\usepackage{graphics}
+%%
+%%\usepackage{fancybox}		% Boîtes avec une ombre pour les parties.
+%%
+% FIN PACKAGES
+%
+%
+% RACCOURCIS TEXTE
+% NB: utiliser un espace insécable si 
+% un mot ou un autre raccourci suivent
+% NB: pour ajouter un s, juste un espace
+% par exemple: \mn s == martiens
+%
+\newcommand{\Ma}{Mars}
+\newcommand{\mn}{martien}
+\newcommand{\mne}{martienne}
+\newcommand{\lM}{la planète \Ma}
+\newcommand{\LM}{La planète \Ma}
+\newcommand{\lR}{la planète rouge}
+\newcommand{\LR}{La planète rouge}
+%
+\newcommand{\met}{météorologie}
+\newcommand{\Te}{Terre}
+\newcommand{\te}{terrestre}
+\newcommand{\lT}{la \Te}
+\newcommand{\LT}{La \Te}
+\newcommand{\lpT}{la planète \Te}
+\newcommand{\LpT}{La planète \Te}
+%
+\newcommand{\atq}{atmosphérique}
+\newcommand{\lat}{l'atmosphère}
+\newcommand{\Lat}{L'atmosphère}
+\newcommand{\lam}{\lat~\mne}
+\newcommand{\Lam}{\Lat~\mne}
+%
+\newcommand{\OM}{OMEGA}
+\newcommand{\ME}{Mars Express}
+\newcommand{\IR}{infra-rouge}
+\newcommand{\lo}{longueur d'onde}
+\newcommand{\los}{longueurs d'onde}
+\newcommand{\mi}{\U{\mu m}}
+\newcommand{\spe}{spectre}
+\newcommand{\carb}{CO$_2$}
+\newcommand{\eau}{H$_2$O}
+\newcommand{\tele}{télédétection}
+\newcommand{\p}{pression}
+\newcommand{\ps}{pression de surface}
+\newcommand{\bande}{bande d'absorption à $2$\mi~du \carb}
+%
+\newcommand{\Vi}{Viking}
+%
+\newcommand{\temp}{température}
+\newcommand{\baw}{ondes baroclines}
+\newcommand{\thw}{ondes de marée thermique}
+%
+\newcommand{\m}{modèle}
+\newcommand{\W}{WRF}
+\newcommand{\mec}{méso-échelle}
+\newcommand{\mmec}{\m~\mec}
+\newcommand{\gcm}{\m~de circulation générale}
+\newcommand{\gcms}{\m s de circulation générale}
+\newcommand{\nh}{non-hydrostatique}
+\newcommand{\h}{hydrostatique}
+%
+\newcommand{\chef}{\textit{Forget et al.}}
+\newcommand{\LMD}{Laboratoire de Météorologie Dynamique}
+%%
+%\newenvironment{citemize}[1]{\begin{itemize}\addtolength{\itemsep}{-0.5\baselineskip}}{\end{list}}
+\newenvironment{citemize}%
+{ \begin{list}%
+	{$\circ$}%\bullet\star
+ 	{%\setlength{\labelwidth}{30pt}%
+	 %\setlength{\leftmargin}{35pt}%
+         %\setlength{\topsep}{2pt}%
+	 \setlength{\itemsep}{-0.2\baselineskip}}}%
+{ \end{list} }
+\newenvironment{finger}%
+{ \begin{dinglist}%
+	{43}%
+	{
+	}}%
+{ \end{dinglist} }
+%%
+%% FIN RACCOURCIS TEXTE
+%%
+
Index: trunk/MESOSCALE_DEV/DOC/SRC/user_manual.tex
===================================================================
--- trunk/MESOSCALE_DEV/DOC/SRC/user_manual.tex	(revision 207)
+++ trunk/MESOSCALE_DEV/DOC/SRC/user_manual.tex	(revision 207)
@@ -0,0 +1,100 @@
+
+%
+% FICHIER STYLE
+%
+\input{these_spiga.sty}
+\usepackage{pstricks}
+\usepackage{pifont}
+\usepackage{paralist}
+%
+%
+% END FICHIER STYLE
+%
+
+\begin{document}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\frontmatter
+
+%\pagestyle{fancy}
+\selectlanguage{english}
+%\maketitle
+
+\begin{titlepage} 
+\mbox{}\\ 
+\Ovalbox{ 
+\begin{minipage}{1\textwidth} \begin{center}
+\Huge{LMD Martian Mesoscale Model}\\\huge{User Manual}
+\end{center} \end{minipage} 
+}
+\mbox{}\\ 
+\begin{center} 
+\includegraphics[width=0.85\textwidth]{domain_100.png} 
+\end{center}
+\mbox{}\\ 
+\begin{center}
+\huge{A. Spiga}\\
+\email{aymeric.spiga}{upmc.fr}\\
+Laboratoire de M\'et\'eorologie Dynamique\\
+%Institut Pierre Simon Laplace\\
+Universit\'e Pierre et Marie Curie, Paris, France\\
+\end{center} 
+\end{titlepage} 
+
+
+\clearemptydoublepage
+
+
+%%%%%%%%%%%%%%%%%%%%%%
+% TABLE DES MATIERES %
+%%%%%%%%%%%%%%%%%%%%%%
+\dominitoc
+%\ajusterletitrecourant{Sommaire}
+%\pagestyle{empty}
+\tableofcontents
+\clearemptydoublepage
+%\pagestyle{fancy}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\mainmatter
+
+%\clearemptydoublepage
+%\include{intro}  
+%
+%\clearemptydoublepage
+%\include{ch1}
+%
+\clearemptydoublepage
+\ajusterletitrecourant{User Manual for the LMD Martian Mesoscale Model}
+%\chapter*{
+%Realistic modeling of the 
+%Martian mesoscale and 
+%microscale circulation :
+%validation and first results.
+%}
+%\newpage
+
+
+
+
+
+%\newpage
+%\mbox{}
+%\newpage
+
+
+\include{user_manual_txt}
+
+\backmatter
+\footnotesize{
+\bibliographystyle{these}
+%\bibliographystyle{plain}
+%\bibliographystyle{natbib}
+%\bibliographystyle{abbrvnat}
+\bibliography{newfred}
+}
+
+\end{document}
Index: trunk/MESOSCALE_DEV/DOC/SRC/user_manual_txt.tex
===================================================================
--- trunk/MESOSCALE_DEV/DOC/SRC/user_manual_txt.tex	(revision 207)
+++ trunk/MESOSCALE_DEV/DOC/SRC/user_manual_txt.tex	(revision 207)
@@ -0,0 +1,1263 @@
+\chapter{What is the LMD Martian Mesoscale Model?}
+
+\mk
+\paragraph{Welcome !} The purpose of this introduction is to describe the Martian mesoscale model developed at the Laboratoire de M\'et\'eorologie Dynamique (LMD). This chapter comprises the excerpts from \textit{Spiga and Forget} [2009]\nocite{Spig:09} dedicated to the technical description of the LMD Martian Mesoscale Model. This serves as an introduction to the model, its design and capabilities. Further details can be found in the reference paper \textit{Spiga and Forget} [2009]\nocite{Spig:09} and subsequent papers about mesoscale applications: e.g., \textit{Spiga and Lewis} [2010]\nocite{Spig:10dust} and \textit{Spiga et al.} [2011]\nocite{Spig:11ti}. An introduction to Large-Eddy Simulations can be found in \textit{Spiga et al.} [2010]\nocite{Spig:10bl}. 
+
+\paragraph{Important} Please cite the reference paper \textit{Spiga and Forget} [2009]\nocite{Spig:09} if you'd like to refer to the LMD Martian Mesoscale Model in one of your publication. If your paper makes use of simulations carried out with the LMD Martian Mesoscale Model, please consider including A. Spiga as a co-author of your work (and asking for help with writing the part related to mesoscale modeling). If you have any idea of specific simulations and wonder if it is ever possible to perform those with the LMD Martian Mesoscale Model, please do not hesitate to ask.
+
+\mk
+\section{Dynamical core}
+
+\sk
+The numerical integration of the atmospheric fluid dynamic equations is performed in meteorological models by the dynamical core. The LMD Martian Mesoscale Model dynamical core is based on the stable and carefully tested, fully parallellized, Advanced Research Weather Research and Forecasting model (hereinafter referred as ARW-WRF) [\textit{Skamarock et al.}, 2005, 2008\nocite{Skam:08}\nocite{Skam:05}], developed for terrestrial applications at NCEP/NCAR (version 2.2.1 - November 2007).
+
+\sk
+The ARW-WRF mesoscale model integrates the fully compressible non-hydrostatic Navier-Stokes equations in a specific area of interest on the planet. Since the mesoscale models can be employed to resolve meteorological motions less than few kilometers, a scale at which the vertical wind acceleration might become comparable to the acceleration of gravity, hydrostatic balance cannot be assumed, as is usually done in GCMs.
+
+\sk
+Mass, momentum, entropy, and tracer conservation are ensured by an explicitly conservative flux-form formulation of the fundamental equations, based on mass-coupled meteorological variables (winds, potential temperature, tracers). Alternatively, these variables are recast into a reference profile plus a perturbation to reduce truncation errors [\textit{Skamarock et al.}, 2008]\nocite{Skam:08}. Tracer transport can be computed by an additional forward-in-time scheme based on the Piecewise Parabolic Method [\textit{Carpenter et al.}, 1990]\nocite{Carp:90}, with positive definite and monotonic properties
+[\textit{Skamarock et al.}, 2006]\nocite{Skam:06}.
+
+\sk
+In the vertical dimension, the equations are projected, as suggested by \textit{Laprise} [1992]\nocite{Lapr:92}, on terrain-following mass-based coordinates (``eta levels"): $\eta = (\pi-\pi_t) / (\pi_s-\pi_t)$ where $\pi$ is the hydrostatic component of the pressure, $\pi_s$ the value at the surface and $\pi_t$ the (constant) upper boundary value. As shown in \textit{Laprise} [1992]\nocite{Lapr:92} and \textit{Janjic et al.} [2001]\nocite{Janj:01}, the choice of such vertical coordinates enables the integration of the ARW-WRF equations either in full non-hydrostatic mode or under the hydrostatic assumption. At the top of the domain, a free relaxation condition to zero vertical velocity is imposed (gravity wave absorbing layers can be defined as well).
+
+\sk
+In the horizontal dimension, the dynamical solver is available with three possible projections on the planetary sphere: Mercator (suitable for equatorial regions),  Lambert Conformal (for mid-latitudes),  and Polar Stereographic (for high-latitudes). Projections are defined by map scale factors, ensuring a regular computational grid whatever the map projection should be. Polar simulations are therefore devoid of any pole singularity, an usual drawback of the GCMs that requires the use of additional filtering. The spatial discretization is an Arakawa C-grid, where normal velocities are staggered one-half grid length from the thermodynamic variables [\textit{Arakawa}, 1966]\nocite{Arak:66}.
+
+\sk
+In the temporal dimension, a third-order Runge-Kutta integration scheme is employed for improved numerical accuracy and stability: the maximum stable Courant Friedrichs Lewy (CFL) numbers for advection are increased by a factor of two compared to the regular leapfrog integration scheme [\textit{Skamarock et al.}, 2008]. A time-splitting integration technique is implemented to prevent the meteorologically insignificant acoustic motions from triggering numerical instabilities [\textit{Klemp et al.}, 2007]\nocite{Klem:07}. Additional filters for acoustic external and internal modes damp residual instabilities possibly arising in the acoustic step integration.
+
+\sk
+In the ARW-WRF Runge-Kutta time-integration scheme, while pressure gradient and divergence terms are simply second order and centered, spatial discretizations of the advection terms for momentum, scalars and geopotential are 2nd through 6th order accurate [\textit{Wicker and Skamarock}, 2002]\nocite{Wick:02}. Martian simulations are performed with a 5th order discretized advection. One peculiarity of the odd-order advection discretization is the inherent inclusion of a dissipation term [\textit{Hundsdorfer et al.}, 1995]\nocite{Hund:95} with a coefficient proportional to the Courant number.
+
+\sk
+However, as was pointed out by \textit{Knievel et al.} [2007]\nocite{Knie:07}, this odd-ordered implicit scheme is not diffusive enough in low-wind or neutral/unstable stratification, and numerical noise in the wind fields might reach amplitudes comparable to the simulated winds. Such noise was found to be significant in the Martian case under near-surface afternoon superadiabatic conditions. The standard Martian simulations thus include the additional 6th order diffusion scheme developed by \textit{Knievel et al.}, with a removal parameter set for Martian applications to $20\%$ of the $2\,\Delta x$ noise in one timestep. While reducing the numerical noise near the surface to almost undiscernable amplitudes, the additional Knievel diffusion has little effect on the simulated meteorological fields.
+
+\sk
+Particular adaptations were required to use the ARW-WRF dynamical solver in the Martian environment. Physical constants, such as the acceleration of gravity and the planetary rotation rate, were converted to the Martian values. Vegetation and ocean-related variables were not used, and replaced with variables more suitable for the Martian applications (e.g., thermal inertia). Martian dates are given by the aerocentric solar longitude $L_s$, which indicates the position of Mars with respect to the Sun (0, 90, 180, 270 degrees are, respectively, the beginning of the northern hemisphere spring, summer, fall and winter). The terrestrial calendar was thus replaced with the LMD-GCM Martian calendar built on 669 Martian sols split in 12 ``aerocentric longitude"-based months (each of them is $L_s=30^{\circ}$ long, and thus encloses an irregular number of Martian sols due to the high eccentricity of the orbit), and one hour was defined as $1/24$ sol.
+
+\mk
+\section{Martian physics}
+
+\sk
+In any meteorological model, the 3D dynamical core is coupled with parameterization schemes (most often 1D) to compute at each grid point of the simulation domain the particular physics of the considered planetary environment: diabatic forcing of the atmospheric circulation (radiative transfer, soil thermal diffusion); sub-grid scale dynamical parameterizations (Planetary Boundary Layer [PBL] diffusion and mixing, convective adjustment); tracer sources and sinks (microphysical processes, chemistry, dust sedimentation and lifting). The LMD-MGCM complete physical parameterizations are interfaced with the adapted ARW-WRF dynamical core, described in the previous section, by a new ``driver" that is built on the same principles as the ARW-WRF terrestrial parameterization schemes, which are all switched off for the Martian applications. Thus, the LMD Martian Mesoscale Model shares the same comprehensive physical parameterizations as the LMD-MGCM, in order to simulate the Martian dust, CO$_2$, H$_2$O and photochemistry cycles [\textit{Forget et al.}, 1999; \textit{Montmessin et al.}, 2004; \textit{Lefevre et al.}, 2004].
+
+\sk
+\subsection{Physical parameterizations}
+
+\sk
+The radiative transfer in the model accounts for CO$_2$ gas infrared absorption/emission [\textit{Hourdin et al.}, 1992]\nocite{Hour:92} and visible and infrared dust absorption, emission and diffusion [\textit{Forget et al.}, 1998, 1999]\nocite{Forg:98grl}. Description of the CO$_2$ condensation processes in the model can be found in \textit{Forget et al.} [1998b]\nocite{Forg:98}. Thermal conduction in the soil is simulated by the 11-layer soil model developed by \textit{Hourdin et al.} [1993]\nocite{Hour:93} for Mars (soil density and soil specific heat capacity are set as constants). Turbulent closure is based on turbulent viscosity with coefficients calculated from the ``$2.5$-order" scheme by \textit{Mellor and Yamada} [1982]\nocite{Mell:82}, improved by \textit{Galperin et al.} [1988]\nocite{Galp:88}. In the case where vertical mixing is handled in the independent 1D physical packages, the native vertical mixing schemes in the ARW-WRF dynamical core are switched off, and the most appropriate choice for explicit horizontal diffusion is the built-in ARW-WRF scheme based on horizontal deformation [\textit{Smagorinsky}, 1963]\nocite{Smag:63}.
+
+\sk
+Recent improvements on the radiative transfer computations [\textit{Dufresne et al.}, 2005]\nocite{Dufr:05}, on the slope irradiance estimations [\textit{Spiga and Forget}, 2008]\nocite{Spig:08grl}, on the dust lifting and sedimentation [\textit{Forget et al.}, 1999b\nocite{Forg:99icm5}; \textit{Newmann et al.}, 2002]\nocite{Newm:02a}, on the water cycle and water ice clouds [\textit{Montmessin et al.}, 2004]\nocite{Mont:04}, and on the photochemical species [\textit{Lefevre et al.}, 2004]\nocite{Lefe:04}, particularly ozone [\textit{Lefevre et al.}, 2008]\nocite{Lefe:08}, are also natively included in the LMD Martian Mesoscale Model. The non-local thermodynamic equilibrium (NLTE) parameterizations for thermosphere applications [\textit{Gonz\'alez-Galindo et al.}, 2005\nocite{Gonz:05}] as well as estimations of the atmospheric exchanges with the Martian regolith [\textit{B\"ottger et al.}, 2005]\nocite{Bott:05}, are also available in the model.
+
+%\sk
+%Upcoming improvements of the LMD-MGCM physics [\textit{Forget et al.}, 2007]\nocite{Forg:07emsec}, following the recent measurements by instruments onboard Mars Express (MEx) and MRO, will be included in the LMD Martian Mesoscale Model too. Examples of future parameterizations that will be added in both models are the radiative effects of water ice clouds, which could significantly modify the atmospheric temperatures [\textit{Wilson et al.}, 2007]\nocite{Wils:07}, and the new dust radiative properties derived from recent measurements by the OMEGA instrument onboard MEx [\textit{M\"a\"att\"anen et al.}, 2008]\nocite{Maat:08} and the CRISM instrument onboard MRO [\textit{M.~J. Wolff and M. Vincendon}, personal communication, 2008].
+
+\sk
+Two physical parameterizations of the LMD-MGCM, specifically designed for synoptic-scale meteorological applications, are not used in the mesoscale applications.
+
+\sk
+Firstly, in the mesoscale domain, the topographical field is described with horizontal resolutions from tens of kilometers to hundreds of meters. The \textit{Lott and Miller} [1997]\nocite{Lott:97} subgrid-scale topographical drag parameterization and the \textit{Miller et al.} [1989]\nocite{Mill:89} gravity-wave drag scheme can thus be switched off, as the topographical influence on the atmospheric flow is computed by the dynamical core at the chosen mesoscale resolutions.
+
+\sk
+Secondly, in order to ensure numerical stability, and to account for subgrid-scale mixing processes insufficiently handled in the PBL scheme, it is usually necessary to modify any unstable layer with negative potential temperature gradients (an usual near-surface situation during Martian afternoons) into a neutral equivalent [\textit{Hourdin et al.}, 1993]. As pointed out by \textit{Rafkin} [2003b]\nocite{Rafk:03adj}, the use of such an artificial convective adjustment scheme might be questionable in Martian atmospheric models, should they be GCMs or mesoscale models. Since numerical stability is ensured in the LMD Martian Mesoscale Model by choosing the appropriate dynamical timestep with respect to the CFL condition, and using the aforementioned ARW-WRF nominal filters and diffusion schemes, the convective adjustment scheme used in the LMD-MGCM can thus be switched off in the LMD Martian Mesoscale Model. 
+
+\mk
+\subsection{Physical timestep}
+
+\sk
+Invoking physical packages often with respect to the dynamical computations was found to be necessary to accurately account for near-surface friction effects where the wind acceleration is particularly high, typically in regions of strong Martian topographically-driven circulation. In such areas, if the ratio between the physical timestep and the dynamical timestep is above $\sim 5$, the model predicts winds spuriously increasing with the chosen ratio and varying with the horizontal resolution. On the contrary, if this ratio is less than $\sim 5$, the simulated winds neither vary significantly with the chosen ratio nor with the horizontal resolution.
+
+\sk
+A ratio equal to 1 is chosen in the standard LMD Martian Mesoscale Model simulations. This choice is in conformity with the strategy adopted in the terrestrial ARW-WRF model. Besides, computing the physical parameterizations at the same frequency as the dynamical integration is profitable to some physical parameterizations, such as the formation of clouds (which is sensitive to rapid temperature change). Note that radiative transfer computations are usually carried out less often to save computational time.
+
+\sk
+When the ratio between the physical timestep and the dynamical timestep is superior to 1, two distinct strategies could be adopted. Interestingly, we found that splitting the physical tendency in equal parts and blending it with the dynamical tendency at each dynamical timestep computation is slightly more stable (understand: allows for higher dynamical timesteps) than applying the whole physical tendency when the physical parameterizations are computed, and letting the dynamical core naturally evolve until the next physics call. However, an analysis of the simulated meteorological fields in both cases does not reveal significant differences.
+
+\mk
+\section{Initial and boundary conditions}
+\label{ssc:inibdy}
+
+\mk
+\subsection{Starting state and horizontal boundaries}
+
+\sk
+Mesoscale simulations can be performed in a limited domain anywhere on the planet. Thus, boundary conditions for the main meteorological fields (horizontal winds, temperature, tracers) have to be provided during the simulations, in addition to an atmospheric starting state. Idealized simulations usually require the use of periodic, symmetric or open boundary conditions, whereas real-case simulations need specified climatologies at the boundaries.
+
+\sk
+The specified boundary conditions and the atmospheric starting state are derived from previously performed $64\times48\times25$ (i.e., horizontal resolution of $5.625^{\circ}$ in longitude and $3.75^{\circ}$ in latitude, model top $\sim$~80~km~altitude) LMD-MGCM simulations which have reached equilibrium, typically after $\sim 10$ simulated years. GCM results are often used every Martian hour to constrain the mesoscale model at the domain boundaries. Temporal interpolations to each mesoscale timestep and spatial interpolations on the mesoscale domain are performed from the LMD-MGCM inputs. A relaxation zone of a given width (user-defined, usually 5 grid points) is implemented at the boundaries of the ARW-WRF domain to enable both the influence of the large-scale fields on the limited area, and the development of the specific mesoscale circulation inside the domain. The interpolations and the use of a relaxation zone prevent the prescribed meteorological fields at the lateral boundaries from having sharp gradients and from triggering spurious waves or numerical instabilities (the situation where the relaxation zone crosses steep topographical gradients should however be avoided).
+
+\mk
+\subsection{Nesting or single-domain strategy ?}
+\label{ssc:nestingvalid}
+
+\sk
+The model includes one-way and two-way (or ``feedback") nesting capabilities. The nested simulations feature two kinds of domains where the meteorological fields are computed: the "parent" domain, with a large geographical extent, a coarse grid resolution, and specified boundary conditions, and the "nested" domains, centered in a particular zone of interest, with a finer grid resolution, and boundary conditions provided by its parent domain.
+
+\sk
+The nesting capabilities can be used only if deemed necessary, and single-domain simulations may be the primary type of run performed.
+
+\sk
+Firstly, employing the same physical parameterizations in the mesoscale model computations and in the GCM simulations defining the boundary and initial conditions, ensures a very consistent meteorological forcing at the boundaries of the mesoscale domain. This assumption was not denied by further examination of the performed simulations: mesoscale predictions are not unrealistically departing from the LMD-MGCM prescribed fields at the boundaries, and the mesoscale influence naturally adds to the synoptic (large-scale) tendency communicated at the boundaries. 
+
+\sk
+Secondly, the single-domain approach is appropriate as long as the variations of near-surface winds, pressure and temperature induced by ``passing" thermal tides through the east-west boundaries are not unrealistic. This criterion is specific to Martian mesoscale modeling and was described by \textit{Tyler et al.} [2002]. In the various simulations performed with the LMD Martian Mesoscale Model, a likely spurious influence of the passing thermal tides was only detected in the near-surface meteorological fields calculated at the $\sim 5$ near-boundaries grid points. The amplitudes of the departures were negligible ($\delta T \apprle 3$~K; $\delta u, \delta v \apprle 5\%$) and did not require the use of domains nested inside one semi-hemispheric parent domain [\textit{Tyler et al.}, 2002]. However, the analysis of the simulated fields at the near-boundaries grid points should be carried out with caution when choosing the single-domain approach. A practical solution to this drawback is to define a large domain, centered on the chosen area of interest, with a sufficient number of grid points ($75 \times 75$ being a minimal requirement).
+
+\sk
+Thirdly, \textit{Dimitrijevic and Laprise} [2005]\nocite{Dimi:05} showed, by the so-called ``Big Brother" approach, that the single-domain approach yields unbiased results when the boundary forcing involves a minimum of $\sim 8-10$ GCM grid points. Thus, given the resolution of the GCM fields used to constrain the LMD Martian Mesoscale Model, single-domain simulations with, for instance, a horizontal resolution of $20$~km shall be performed on at least $133 \times 88$ grid points. \textit{Antic et al.} [2006]\nocite{Anti:06} found that the ``$8-10$ grid points" limit can be lowered in situations of complex topography, because the dynamical influence of these mesoscale features is responsible for the larger part of the mesoscale circulation in the domain. Such situations are rather common on Mars, and the aforementioned ``minimal" grid can be of slightly smaller horizontal extent in areas such as Olympus Mons or Valles Marineris.
+
+\sk
+Thus the sizes of the simulation grids have to be chosen in order to ensure the applicability of the single-domain approach. The nesting technique is used only when defining a single domain with sufficient geographical extent would have required too many grid points to handle the computations within reasonable CPU time. For instance, with ``$64 \times 48$" GCM simulations as boundary conditions, the use of the single-domain strategy to model the Arsia Mons circulation at $5$ km resolution imposes a simulation grid of at least $531 \times 354$ points. The nesting technique is more suitable for this kind of simulation.
+
+\mk
+\subsection{Surface fields}
+
+\sk
+Surface static data intended for the mesoscale domain are extracted from maps derived from recent spacecraft measurements: 64 pixel-per-degree (ppd) MOLA topography [\textit{Smith et al.}, 2001]\nocite{Smit:01mola}, 8 ppd MGS/Thermal Emission Spectrometer (TES) albedo [\textit{Christensen et al.}, 2001]\nocite{Chri:01}, 20 ppd TES thermal inertia [\textit{Putzig and Mellon}, 2007]\nocite{Putz:07}. A smoother composite thermal inertia map derived from \textit{Palluconi and Kieffer} [1981]\nocite{Pall:81}, \textit{Mellon et al.} [2000]\nocite{Mell:00} and \textit{Vasavada et al.} [2000]\nocite{Vasa:00} can be alternatively used for better continuity with LMD-MGCM simulations. Except for CO$_2$ ice covered areas, emissivity is set to $0.95$. The roughness length $z_0$ is set to the constant value of $1$~cm, but further versions of the model will use spatially-varying $z_0$ [\textit{H\'ebrard et al.}, 2007]\nocite{Hebr:07}. Initial values for time-varying surface data, such as CO$_2$ and H$_2$O ice on the surface and soil temperatures, are derived from the GCM simulations. The latter initialization reduces the spin-up time for surface temperature to roughly one simulated sol.
+
+\sk
+The LMD Martian Mesoscale Model has the complete ability to simulate the dust cycle (lifting, sedimentation, transport). However, the high sensivity of the results to the assumptions made on threshold wind stress and injection rate [\textit{Basu et al.}, 2004]\nocite{Basu:04} leads us to postpone these issues to future studies. Instead, similarly to the reference LMD-MGCM simulations, dust opacities are prescribed in the mesoscale model from 1999-2001 TES measurements, thought to be representative of Martian atmospheric conditions outside of planet-encircling dust storm events [\textit{Montabone et al.}, 2006]\nocite{Mont:06luca}. In the vertical dimension, as described in \textit{Forget et al.} [1999], and in accordance with the general consensus of well-mixed dust in equilibrium with sedimentation and mixing processes [\textit{Conrath}, 1975]\nocite{Conr:75}, dust mixing ratio is kept constant from the surface up to a given elevation $z_{\textrm{\tiny{max}}}$ above which it rapidly declines. Both in the nominal GCM and mesoscale simulations, $z_{\textrm{\tiny{max}}}$ as a function of areocentric longitude and latitude is calculated from the ``MGS scenario" [\textit{Forget et al.}, 2003]\nocite{Forg:03}.
+
+\mk
+\subsection{Vertical interpolation}
+
+\sk
+In the process of initialization and definition of boundary conditions, the vertical interpolation of GCM meteorological fields to the terrain-following mesoscale levels must be treated with caution. While deriving the near-surface meteorological fields from GCM inputs, one may address the problem of underlying topographical structures at fine mesoscale horizontal resolution, e.g., a deep crater that is not resolved in the coarse GCM case.
+
+\sk
+A crude extrapolation of the near-surface GCM fields to the mesoscale levels is usually acceptable for terrestrial applications. On Mars, owing to the low density and heat capacity of the Martian atmosphere, the surface temperature is to first order controlled by radiative equilibrium, and thus it is left relatively unaffected by variations of topography [e.g. \textit{Nayvelt et al.}, 1997]\nocite{Nayv:97}. A practical consequence, which renders an extrapolation strategy particularly wrong on Mars, is that the near-surface temperature and wind fields vary much more with the distance from the surface than with the absolute altitude above the areoid (or equivalently with the pressure level). Initial tests carried out with the extrapolation strategy showed that differences between temperatures at the boundaries and temperatures computed within the mesoscale domain close to these boundaries often reach $20-30$~K near the surface. An interpolation based only on terrain-following principles solves this problem near the surface but was found to lead to numerical instabilities at higher altitudes during the mesoscale integrations.
+
+\sk
+Therefore, input meteorological data need to be recast on intermediate pressure levels $P'$ with a low level smooth transition from terrain-following levels (for the near-surface environment) to constant pressure levels (for the free atmosphere at higher altitude). We thus have $P'(x,y)=\alpha + \beta \, P_s(x,y)$, $P_s$ being the surface pressure at the resolution of the GCM simulations. To ensure a realistic low-level transition, the technique described in \textit{Millour et al.} [2008]\nocite{Mill:08ddd}, based on high-resolution GCM results, is employed to calculate the $P'$ levels. The mesoscale surface pressure field $p_s$ is an input parameter of the method, since the near-surface adiabatic cooling over mountains and warming within craters are taken into account. Note that $p_s(x,y)$ is calculated from $P_s(x,y)$ on the basis of the high-resolution topography of the mesoscale domain $z(x,y)$ by $$p_s(x,y) = P_s(x,y) \, e^{ \frac{g \, [Z(x,y)-z(x,y)]}{R \, T(x,y)} }$$ \noindent where $Z(x,y)$ is the topography at the resolution of the GCM simulations, $R$ the gas law constant, $g$ the acceleration of gravity, and $T(x,y)$ the temperature predicted by the GCM $1$~km above the surface (see \textit{Spiga et al.} [2007]\nocite{Spig:07omeg}). Without reinterpolating the data, the intermediate pressure $P'$ levels are then simply converted into their mesoscale counterparts $p'$ by substituting $p_s$ for $P_s$ in the formula $P'(x,y)=\alpha + \beta \, P_s(x,y)$. Finally, the built-in ARW-WRF vertical interpolation onto the final mesoscale terrain-following levels can be performed, as the problem of extrapolation is solved by the use of the intermediate pressure levels $p'$.
+
+\sk
+The initial atmospheric state obtained through this ``hybrid" method ensures low-amplitude adjustments of the meteorological fields by the mesoscale model at the beginning of the performed simulations (i.e., in the first thousands of seconds). Furthermore, the continuity between the large-scale forcing and the mesoscale computations near the limits of the domain, as well as the numerical stability of the simulations, appear as significantly improved compared to methods either based on extrapolation (especially in areas of uneven terrains) or terrain-following interpolation.
+
+%\pagebreak
+\includepdf[pages=1,offset=25mm -20mm]{meso.pdf}
+\clearemptydoublepage
+
+\chapter{First steps toward running the model}
+
+\mk
+This chapter is meant for first time users of the LMD Martian Mesoscale Model.
+%
+We describe how to install the model on your system, compile the program and run a test case.
+%
+Experience with either the terrestrial WRF mesoscale model or the LMD Martian GCM is not absolutely required,
+although it would help you getting more easily through the installation process.
+
+\mk
+\section{Prerequisites}
+
+\mk
+\subsection{General requirements}
+
+\mk
+In order to install the LMD Martian Mesoscale Model, please ensure that:
+\begin{citemize}
+\item your computer is connected to the internet;
+\item your OS is Linux\footnote{
+%%%%%%%%%%%%%%
+The model was also successfully compiled on MacOSX; 
+``howto" information is available upon request.
+%%%%%%%%%%%%%%
+} with a decent set of basic commmands (\ttt{sed}, \ttt{awk}, \ldots);
+\item your Fortran compiler is the PGI commercial compiler \ttt{pgf90} or the GNU 
+free compiler\footnote{
+%%%%%%%%%%%%%%
+Sources and binaries available on \url{http://www.g95.org}
+%%%%%%%%%%%%%%
+} \ttt{g95};
+\item your C compiler is \ttt{gcc} and C development libraries are included;
+\item \ttt{bash}, \ttt{m4} and \ttt{perl} are installed on your computer;
+\item \ttt{NETCDF} libraries have been compiled \emph{on your system}.
+\end{citemize} 
+%
+\begin{finger}
+\item You might also find useful -- though not mandatory -- to install on your system:
+\begin{citemize}
+\item the \ttt{ncview} utility\footnote{
+%%%%%%
+\url{http://meteora.ucsd.edu/~pierce/ncview\_home\_page.html}
+%%%%%%
+}, which is a nice tool to visualize the contents of a NETCDF file;
+\item the \ttt{IDL} demo version\footnote{
+%%%%%%
+\url{http://www.ittvis.com/ProductServices/IDL.aspx}
+%%%%%%
+}, which is used by the plot utilities provided with the model.
+\end{citemize} 
+\end{finger}
+
+\mk
+\marge Three environment variables associated with the \ttt{NETCDF} libraries must be defined: 
+\begin{verbatim}
+declare -x NETCDF=/disk/user/netcdf  
+declare -x NCDFLIB=$NETCDF/lib       
+declare -x NCDFINC=$NETCDF/inc       
+\end{verbatim}
+
+\begin{finger}
+\item All command lines in the document are proposed in \ttt{bash}.
+\end{finger}
+
+%%[csh] setenv NETCDF /disk/user/netcdf
+%%[csh] setenv NCDFLIB $NETCDF/lib
+%%[csh] setenv NCDFINC $NETCDF/inc
+
+\mk
+\marge You also need the environment variable \ttt{\$LMDMOD} to point 
+at the directory where you will install the model (e.g. \ttt{/disk/user/MODELS}):
+\begin{verbatim}
+declare -x LMDMOD=/disk/user/MODELS  
+\end{verbatim}
+%[csh] setenv LMDMOD /disk/user/MODELS
+%
+\begin{finger}
+\item Please check that $\sim 200$~Mo free disk space is available in \ttt{/disk}.
+\end{finger}
+
+\mk
+\subsection{Parallel computations}
+
+\mk
+\marge Parallel computations with the Message Passing Interface (MPI) standard are supported by 
+the ARW-WRF mesoscale model.
+%
+If you want to use this capability in the LMD Martian Mesoscale Model,
+you would have the installation of MPICH2 as a additional prerequisite.
+
+\mk
+\marge Please download the current stable version of the sources
+(e.g. \ttt{mpich2-1.0.8.tar.gz}) on the MPICH2 website
+\url{http://www.mcs.anl.gov/research/projects/mpich2}
+and install the MPICH2 utilities by the following commands:
+%
+\begin{verbatim}
+mkdir $LMDMOD/MPI
+mv mpich2-1.0.8.tar.gz $LMDMOD/MPI
+cd $LMDMOD/MPI
+tar xzvf mpich2-1.0.8.tar.gz
+cd mpich2-1.0.8
+./configure --prefix=$PWD --with-device=ch3:nemesis > conf.log 2> conferr.log &
+# please wait...
+make > mk.log 2> mkerr.log &
+declare -x WHERE_MPI=$LMDMOD/MPI/mpich2-1.0.8/bin
+\end{verbatim}
+%
+\begin{finger}
+\item Even if you add the \ttt{\$LMDMOD/MPI/mpich2-1.0.8/bin}
+directory to your \ttt{\$PATH} variable, defining the environment 
+variable \ttt{\$WHERE\_MPI} is still required
+to ensure a successful compilation of the model.
+\end{finger}
+
+\mk
+\subsection{Compiling the terrestrial WRF model}
+
+\mk
+The LMD Martian Mesoscale Model is based on the terrestrial NCEP/NCAR ARW-WRF Mesoscale Model.
+%
+As a first step towards the compilation of the Martian version, we advise you to check that the terrestrial
+model compiles on your computer with either \ttt{g95} or \ttt{pgf90}.
+
+\mk
+\marge On the ARW-WRF website \url{http://www.mmm.ucar.edu/wrf/users/download/get\_source.html}, you will be allowed 
+to freely download the model after a quick registration process (click on ``New users").
+%
+Make sure to download the version 2.2 of the WRF model and copy the 
+\ttt{WRFV2.2.TAR.gz} archive to the \ttt{\$LMDMOD} folder.
+
+\mk
+\marge Then please extract the model sources and configure the compilation process:
+\begin{verbatim}
+cd $LMDMOD
+tar xzvf WRFV2.2.TAR.gz
+cd WRFV2
+./configure
+\end{verbatim}
+
+\mk
+\marge The \ttt{configure} script analyzes your architecture
+and proposes you several possible compilation options.
+%
+Make sure to choose the ``single-threaded, no nesting" 
+option related to either \ttt{g95} (should be option $13$ on a $32$~bits Linux PC)
+or \ttt{pgf90} (should be option $1$ on a $32$~bits Linux PC).
+
+\mk
+\marge The next step is to compile the WRF model by choosing the kind of 
+simulations you would like to run.
+%
+A simple and direct test consists in trying to compile 
+the idealized case of a 2D flow impinging on a small hill:
+\begin{verbatim}
+./compile em_hill2d_x > log_compile 2> log_error &
+\end{verbatim}
+%
+\begin{finger}
+\item In case you encounter problems compiling the ARW-WRF model, 
+please read documentation on the website
+\url{http://www.mmm.ucar.edu/wrf/users},
+contact the WRF helpdesk or search the web for your error message.
+\end{finger}%\pagebreak
+
+\mk
+\marge If the compilation was successful
+(the file \ttt{log\_error} should be empty
+or only reporting few warnings), you should find
+in the \ttt{main} folder two executables
+\ttt{ideal.exe} and \ttt{run.exe}
+that would allow you to run the test
+simulation:
+\begin{verbatim}
+cd test/em_hill2d_x
+./ideal.exe
+./wrf.exe
+\end{verbatim}
+%
+During the simulation, the time taken by the computer
+to perform integrations at each dynamical timestep 
+is displayed in the standard output.
+%
+The simulation should end with a message \ttt{SUCCESS COMPLETE WRF}.
+%
+The model results are stored in a \ttt{wrfout} data file
+you might like to browse with a \ttt{NETCDF}-compliant software
+such as \ttt{ncview}.
+%
+\begin{finger}
+\item If you compiled the model with \ttt{g95}, \ttt{ideal.exe} will
+probably complain about an error reading the namelist.
+%
+Please move the line \ttt{non\_hydrostatic} below the line \ttt{v\_sca\_adv\_order}
+in the \ttt{namelist.input} file to solve the problem.
+\end{finger}
+
+\mk
+\section{Compiling the Martian model}
+
+\mk
+\subsection{Extracting and preparing the sources}
+
+\mk
+To start the installation of the Martian mesoscale model,
+download the archive \ttt{LMD\_MM\_MARS.tar.gz}
+(click on \url{http://www.lmd.jussieu.fr/~aslmd/LMD_MM_MARS/LMD_MM_MARS.tar.gz}
+or use the \ttt{wget} command).
+%
+Copy the sources in the \ttt{\$LMDMOD} directory and extract the files:
+\begin{verbatim}
+cp LMD_MM_MARS.tar.gz $LMDMOD
+cd $LMDMOD
+tar xzvf LMD_MM_MARS.tar.gz
+\end{verbatim}
+
+\mk
+\marge Execute the \ttt{prepare} script 
+that would do some necessary preparatory tasks for you:
+deflate the various compressed archives contained into \ttt{LMD\_MM\_MARS},
+download the ARW-WRF sources from the web,
+apply a (quite significant) ``Martian patch" to these sources
+and build the final structure of your \ttt{LMD\_MM\_MARS} directory:
+\begin{verbatim}
+cd $LMDMOD/LMD_MM_MARS
+./prepare
+\end{verbatim}
+
+\mk
+\marge Please check the contents of the \ttt{LMD\_MM\_MARS} directory:
+\begin{citemize}
+\item seven \ttt{bash} scripts: 
+\ttt{build\_static}, 
+\ttt{copy\_model},
+\ttt{makemeso}, 
+\ttt{prepare},
+\ttt{prepare\_ini},\linebreak 
+\ttt{prepare\_post},
+\ttt{save\_all}; 
+\item the sources directory \ttt{SRC};
+\item the static data directory \ttt{WPS\_GEOG};
+\item the simulation utilities directory \ttt{SIMU}.
+\end{citemize}
+%
+\marge and check that the \ttt{LMD\_MM\_MARS/SRC} directory contains:
+\begin{citemize}
+\item the model main sources in \ttt{WRFV2},
+\item the preprocessing sources in \ttt{WPS} and \ttt{PREP\_MARS},
+\item the postprocessing sources in \ttt{ARWpost},
+\item three \ttt{tar.gz} archives and two information text files. %\ttt{saved} and \ttt{datesave}.
+\end{citemize}
+
+\mk
+\subsection{Main compilation step}
+\label{sc:makemeso}
+
+\mk
+In order to compile the model, execute the \ttt{makemeso} compilation script 
+in the \ttt{LMD\_MM\_MARS}\linebreak directory 
+%
+\begin{verbatim}
+cd $LMDMOD/LMD_MM_MARS
+./makemeso
+\end{verbatim}
+%
+\marge and answer to the questions about
+\begin{asparaenum}[1.]%[\itshape Q1\upshape)]
+\item compiler choice (and number of processors if using MPI)
+\item number of grid points in longitude [61]
+\item number of grid points in latitude [61]
+\item number of vertical levels [61] 
+\item number of tracers [1]
+\item number of domains [1]
+\end{asparaenum}
+
+%\mk
+\begin{finger}
+\item On the first time you compile the model, you will probably wonder what to reply
+to questions $2$ to $6$ \ldots type the answers given in brackets to compile an executable suitable 
+for the test case given below.
+\item Suppose you compiled a version of the model for a given set of parameters $1$ to $6$
+to run a specific compilation. 
+If you would like to run another simulation 
+with at least one of parameters $1$ to $6$ 
+subject to change, the model needs to be recompiled\footnote{This
+necessary recompilation each time the number of grid points,
+tracers and domains is modified is imposed by the LMD physics code.
+The WRF dynamical core alone is much more flexible.} with \ttt{makemeso}.
+\item When you use parallel computations, please bear in mind that with
+$2$ (resp. $4$, $6$, $8$, $16$) processors the whole domain would be separated 
+into $2$ (resp. $2$, $3$, $4$, $4$) tiles over
+the latitude direction and $1$ (resp. $2$, $2$, $2$, $4$) tile over the longitude direction.
+Thus make sure that the number of grid points minus $1$ in each direction 
+could be divided by the aforementioned number of tiles over the considered
+direction.
+\item If you use grid nesting, note that no more than $4$ processors can be used.
+\end{finger}
+
+\mk
+\marge The \ttt{makemeso} is an automated script which performs
+the following serie of tasks:
+%It is useful to detail and comment the  performed by the \ttt{makemeso} script: 
+\begin{citemize}
+\item determine if the machine is 32 or 64 bits;
+\item ask the user about the compilation settings;
+\item create a corresponding directory \ttt{\$LMDMOD/LMD\_MM\_MARS/DIRCOMP}; 
+\begin{finger}
+\item For example, a \ttt{DIRCOMP} directory named \ttt{g95\_32\_single} 
+is created if the user requested
+a \ttt{g95} compilation of the code for single-domain simulations
+on a 32bits machine.
+\end{finger}
+\item generate with \ttt{copy\_model} a directory \ttt{DIRCOMP/WRFV2} containing links to \ttt{SRC/WRFV2} sources;
+\begin{finger}
+\item This method ensures that any change to the model sources would
+be propagated to all the different \ttt{DIRCOMP} installation folders. 
+\end{finger}
+\item execute the WRF \ttt{configure} script with the correct option;
+\item tweak the resulting \ttt{configure.wrf} file to include a link towards the Martian physics;
+\item calculate the total number of horizontal grid points handled by the LMD physics;
+\item duplicate LMD physical sources if nesting is activated;
+\begin{finger}
+\item The model presently supports 3 nests, but more nests
+can be included by adaptating the following files: 
+\begin{verbatim}
+$LMDMOD/LMD_MM_MARS/SRC/WRFV2/call_meso_inifis3.inc
+$LMDMOD/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq3.inc
+$LMDMOD/LMD_MM_MARS/SRC/WRFV2/mars_lmd/libf/duplicate3
+$LMDMOD/LMD_MM_MARS/SRC/WRFV2/mars_lmd/libf/generate3
+$LMDMOD/LMD_MM_MARS/SRC/WRFV2/mars_lmd/makegcm*  ## search for 'nest'
+\end{verbatim}%\pagebreak
+\end{finger}
+\item compile the LMD physical packages with the appropriate \ttt{makegcm} command
+and collect the compiled objects in the library \ttt{liblmd.a};
+\begin{finger}
+\item During this step that could be a bit long,
+especially if you defined more than one domain,
+the \ttt{makemeso} script provides you with the full path towards 
+the text file \ttt{log\_compile\_phys} in which you can check for
+compilation progress and possible errors.
+%
+In the end of the process, you will find an 
+error message associated to the generation of the
+final executable.
+%
+Please do not pay attention to this, as the compilation of the LMD
+sources is meant to generate a library of
+compiled objects called \ttt{liblmd.a} instead of a program.
+\end{finger}
+\item compile the modified Martian ARW-WRF solver, including
+the \ttt{liblmd.a} library; 
+\begin{finger}
+\item When it is the first time the model is compiled, this 
+step could be quite long.
+%
+The \ttt{makemeso} script provides you with a \ttt{log\_compile}
+text file where the progress of the compilation can be checked
+and a \ttt{log\_error} text file listing errors and warnings
+during compilation. 
+%
+A list of warnings related to \ttt{grib}
+utilities (not used in the Martian model) 
+may appear and have no impact on the
+final executables.
+\item The compilation with \ttt{g95} might be unsuccessful 
+due to some problems with files related to terrestrial microphysics.
+%
+Please type the following commands:
+\begin{verbatim}
+cd $LMDMOD/LMD_MM_MARS/SRC
+tar xzvf g95.tar.gz
+cp -f g95/WRFV2_g95_fix/* WRFV2/phys/
+cd $LMDMOD/LMD_MM_MARS
+\end{verbatim}
+\marge then recompile the model with the \ttt{makemeso} command.
+\end{finger}
+\item change the name of the executables in agreements with the
+settings provided by the user.
+\begin{finger}
+\item If you choose to answer to the \ttt{makemeso} questions using the
+aforementioned parameters in brackets, you should have in the
+\ttt{DIRCOMP} directory two executables:
+\begin{verbatim}
+real_x61_y61_z61_d1_t1_p1.exe
+wrf_x61_y61_z61_d1_t1_p1.exe
+\end{verbatim}
+%
+The directory also contains a text file
+in which the answers to the questions are stored, which
+allows you to re-run the script without the
+``questions to the user" step:
+\begin{verbatim}
+./makemeso < makemeso_x61_y61_z61_d1_t1_p1
+\end{verbatim}
+\end{finger}
+\end{citemize}
+
+\mk
+\section{Running a simple test case}
+\label{sc:arsia}
+
+\mk
+We suppose that you had successfully compiled
+the model at the end of the previous section
+and you had used the answers in brackets 
+to the \ttt{makemeso} questions.
+
+\mk
+\marge In order to test the compiled executables,
+a ready-to-use test case 
+(with pre-generated initial and boundary
+conditions) is proposed
+in the \ttt{LMD\_MM\_MARS\_TESTCASE.tar.gz}
+archive you can download at 
+\url{http://www.lmd.jussieu.fr/~aslmd/LMD_MM_MARS/LMD_MM_MARS_TESTCASE.tar.gz}.
+%
+This test case simulates the hydrostatic
+atmospheric flow around Arsia Mons during half a sol
+with constant thermal inertia, albedo
+and dust opacity.
+
+\begin{finger}
+\item Though the simulation reproduces some reasonable
+features of the mesoscale circulation around Arsia
+Mons (e.g. slope winds), it should not be used
+for scientific purpose, for the number of grid points
+is unsufficient for single-domain simulation
+and the integration time is below the necessary spin-up time.
+\end{finger}
+%\pagebreak
+
+\marge To launch the test simulation, please type
+the following commands, replacing the
+\ttt{g95\_32\_single} directory with its corresponding
+value on your system:
+%
+\begin{verbatim}
+cp LMD_MM_MARS_TESTCASE.tar.gz $LMDMOD/LMD_MM_MARS/
+tar xzvf LMD_MM_MARS_TESTCASE.tar.gz
+cd TESTCASE
+ln -sf ../g95_32_single/real_x61_y61_z61_d1_t1_p1.exe wrf.exe  
+nohup wrf.exe > log_wrf &
+\end{verbatim}
+
+%tar xzvf wrfinput.tar.gz
+
+\begin{finger}
+\item If you compiled the model using MPICH2,
+the command to launch a simulation is slightly different:
+%
+\begin{verbatim}
+[simulation on 2 processors on 1 machine]
+mpd &      # first-time only (or after a reboot)
+           # NB: may request the creation of a file .mpd.conf
+mpirun -np 8 wrf.exe < /dev/null &      # NB: mpirun is only a link to mpiexec  
+tail -20 rsl.out.000?     # to check the outputs
+\end{verbatim}
+\begin{verbatim}
+[simulation on 16 processors in 4 connected machines]
+echo barry.lmd.jussieu.fr > ~/mpd.hosts
+echo white.lmd.jussieu.fr >> ~/mpd.hosts
+echo loves.lmd.jussieu.fr >> ~/mpd.hosts
+echo tapas.lmd.jussieu.fr >> ~/mpd.hosts
+ssh barry.lmd.jussieu.fr   # make sure that ssh to other machines 
+                           # is possible without authentification
+mpdboot -f ~/mpd.hosts -n 4
+mpdtrace
+mpirun -l -np 16 wrf.exe < /dev/null &   # NB: mpirun is only a link to mpiexec
+tail -20 rsl.out.00??     # to check the outputs
+\end{verbatim}
+\end{finger}
+
+
+\mk
+\chapter{Setting the simulation parameters}
+
+\mk
+In this chapter, we describe how to set the various parameters
+defining a given simulation.
+%
+As could be inferred from the content of the \ttt{TESTCASE} directory, 
+two parameter files are needed to run the model:
+\begin{enumerate}
+\item The parameters related to the dynamical part of the model can be set
+in the file \ttt{namelist.input} according to the ARW-WRF namelist formatting.
+\item The parameters related to the physical part of the model can be set
+in the file \ttt{callphys.def} according to the LMD-MGCM formatting.
+\end{enumerate}
+
+\mk
+\section{Dynamical settings}
+
+\mk
+\ttt{namelist.input} controls the behavior of the dynamical core 
+in the LMD Martian Mesoscale Model.
+%
+Compared to the file the ARW-WRF users are familiar with\footnote{
+%%%
+A description of this file can be found in \ttt{SRC/WRFV2/run/README.namelist}.
+%%%
+}, the \ttt{namelist.input} in the LMD Martian Mesoscale Model 
+is much shorter.
+%
+The only mandatory parameters in this file
+are information on time control\footnote{
+%%%
+More information on the adopted Martian calendar:
+\url{http://www-mars.lmd.jussieu.fr/mars/time/solar_longitude.html}
+%%%
+} and domain definition.
+
+\mk
+\marge The minimal version of the \ttt{namelist.input}
+file corresponds to standard simulations with the model.
+%
+It is however possible to modify optional parameters 
+if needed, as is the case in the \ttt{namelist.input} 
+associated to the Arsia Mons test case 
+(e.g. the parameter \ttt{non\_hydrostatic} is set to false
+to assume hydrostatic equilibrium, whereas standard
+simulations are non-hydrostatic).
+
+\mk
+\marge A detailed description of the \ttt{namelist.input} file is given below\footnote{
+%%%
+You may find the corresponding file in \ttt{SIMU/namelist.input\_full}.
+%%%
+}.
+%
+Comments on each of the parameters are provided, 
+with the following labels:
+\begin{citemize}
+\item \ttt{(*)} denotes parameters not to be modified,
+\item \ttt{(r)} indicates parameters which modification implies a new recompilation of the model,
+\item \ttt{(n)} describes parameters involved when nested domains are defined,
+\item \ttt{(p1)}, \ttt{(p2)}, \ttt{(p3)} mention parameters which modification implies a new processing 
+of initial and boundary conditions (see next chapter),
+\item \ttt{(*d)} denotes dynamical parameters which modification implies
+non-standard simulations -- please read \ttt{SRC/WRFV2/run/README.namelist} 
+and use with caution.
+\end{citemize}
+%
+If omitted, the optional parameters would be set to their default 
+values indicated below.\pagebreak
+
+\centers{\ttt{-- file: namelist.input\_full --}}\codesource{namelist.input_full}\centers{\ttt{-- end file: namelist.input\_full --}}
+
+\begin{finger}
+\item Please pay attention to rigorous syntax while
+editing your personal \ttt{namelist.input} file
+to avoid reading error.
+\item To modify the default values (or even add
+personal parameters) in the \ttt{namelist.input} file, 
+edit the \ttt{SRC/WRFV2/Registry/Registry.EM} file.
+%
+You will then have to recompile the model with \ttt{makemeso} ; 
+answer \ttt{y} to the last question.
+\end{finger}
+
+\mk
+\marge In case you run simulations with \ttt{max\_dom}
+nested domains, you have to set \ttt{max\_dom} parameters
+wherever there is a ``," in the above list.
+%
+Here is an example of the resulting syntax of the
+\ttt{time\_control}, \ttt{domains} and \ttt{bdy\_control}
+categories in \ttt{namelist.input}:
+%
+\codesource{OMG_namelist.input}
+
+\section{Physical settings}
+
+\mk
+\ttt{callphys.def} controls the behavior of the physical parameterizations
+in the LMD Martian\linebreak Mesoscale Model.
+%
+The organization of this file is exactly similar 
+to the corresponding file in the LMD Martian GCM, which
+user manual can be found at 
+\url{http://web.lmd.jussieu.fr/~forget/datagcm/user_manual.pdf}.
+
+\mk
+\marge Please find in what follows the contents of \ttt{callphys.def}:
+%
+\centers{\ttt{-- file: callphys.def --}}\codesource{callphys.def}\centers{\ttt{-- end file: callphys.def --}}
+
+\mk
+\begin{finger}
+\item Note that in the given example
+the convective adjustment,
+the gravity wave parameterization,
+and the NLTE schemes are turned off, as is
+usually the case in typical Martian tropospheric 
+mesoscale simulations.
+\item \ttt{iradia} sets the frequency 
+(in dynamical timesteps) at which
+the radiative computations are performed.
+\item Modifying \ttt{callphys.def} only implies
+to recompile the model if the number of tracers is different.
+\item If you run a simulation with, say, $3$ domains,
+please ensure that you defined three files
+\ttt{callphys.def}, \ttt{callphys\_d2.def} and \ttt{callphys\_d3.def}.
+\end{finger}
+
+\mk
+\chapter{Preprocessing utilities}
+
+\mk
+In the previous chapter, we decribed the simulation settings
+in the \ttt{namelist.input} file.
+%
+We saw that any modification of the parameters
+labelled with \ttt{(p1)}, \ttt{(p2)} or \ttt{(p3)} 
+implies the initial and boundary conditions
+and/or the domain definition to be recomputed prior to running the model again.
+%
+As a result, you were probably unable to change many of the parameters 
+of the Arsia Mons test case (proposed in section \ref{sc:arsia}) in which 
+the initial and boundary conditions -- as well as the domain of 
+simulation -- were predefined.
+
+\mk
+\marge In this chapter, we describe the installation and use of the preprocessing tools to 
+define the domain of simulation, calculate an initial atmospheric state
+and prepare the boundary conditions for the chosen simulation time.
+%
+This necessary step would eventually allow you to run your own simulations at the specific season and region
+you are interested in, with a complete ability to modify any of the parameters in \ttt{namelist.input}.
+
+\mk
+\section{Installing the preprocessing utilities}
+
+\mk
+First and foremost, since the preprocessing utilities could generate 
+(or involve) files of quite significant sizes, it is necessary
+to define a directory where these files would be stored.
+%
+Such a directory (e.g. \ttt{/bigdisk/user}) must be linked as follows
+%
+\begin{verbatim}
+ln -sf /bigdisk/user $LMDMOD/TMPDIR
+\end{verbatim}
+
+\mk
+\marge A second prerequisite to the installation of the preprocessing tools is that the LMD Martian
+Mesoscale Model was compiled at least once.
+%
+If this is not the case, please compile
+the model with the \ttt{makemeso} command 
+(see section \ref{sc:makemeso}).
+
+\mk
+\marge The compilation process created an
+installation directory adapted to your
+particular choice of compiler$+$machine.
+%
+The preprocessing tools will also
+be installed in this directory.
+%
+Please type the following commands:
+%
+\begin{verbatim}
+cd $LMDMOD/LMD_MM_MARS/g95_32_single/   ## or any install directory
+ln -sf ../prepare_ini .
+./prepare_ini
+\end{verbatim}
+
+\mk
+\marge The script \ttt{prepare\_ini} plays with the preprocessing tools 
+an equivalent role as the \ttt{copy\_model} with the model sources :
+files are simply linked to their actual location in the \ttt{SRC} folder.
+%
+Once you have executed \ttt{prepare\_ini}, please check that
+two folders were generated: \ttt{PREP\_MARS} and \ttt{WPS}. 
+
+\mk
+\marge In the \ttt{PREP\_MARS} directory, please compile
+the programs \ttt{create\_readmeteo.exe} and \ttt{readmeteo.exe}, 
+using the compiler mentionned in the name of the current
+installation directory: 
+%
+\begin{verbatim}
+echo $PWD
+cd PREP_MARS/
+./compile [or] ./compile_g95
+ls -lt create_readmeteo.exe readmeteo.exe
+cd ..
+\end{verbatim}
+
+\mk
+\marge In the \ttt{WPS} directory, please compile
+the programs \ttt{geogrid.exe} and \ttt{metgrid.exe}:
+\begin{verbatim}
+cd WPS/   
+./configure   ## select your compiler + 'NO GRIB2' option
+./compile
+ls -lt geogrid.exe metgrid.exe
+\end{verbatim}
+
+\mk
+\marge Apart from the executables you just compiled,
+the preprocessing utilities include \ttt{real.exe}, 
+which was compiled by the \ttt{makemeso} script
+along with the mesoscale model executable \ttt{wrf.exe}.
+%
+\ttt{real.exe} should be copied or linked in the 
+simulation directory (e.g. \ttt{TESTCASE} for the
+Arsia Mons test case) to be at the same level than
+\ttt{namelist.input}.
+
+\begin{finger}
+\item Even though the name of the executable writes 
+e.g. \ttt{real\_x61\_y61\_z61\_d1\_t1\_p1.exe}, such program
+is not related to the specific \ttt{makemeso} 
+parameters -- contrary to the \ttt{wrf.exe} executable.
+%
+We just found that renaming the (possibly similar
+if the model sources were not modified) 
+\ttt{real.exe} was a practical way not to confuse
+between executables compiled at different moments. 
+\end{finger}
+
+\mk
+\section{Running the preprocessing utilities}
+
+\mk
+When you run a simulation with \ttt{wrf.exe},
+the program attempts to read the initial state 
+in the files 
+\ttt{wrfinput\_d01}, 
+\ttt{wrfinput\_d02}, \ldots 
+(one file per domain)
+and the parent domain boundary conditions
+in \ttt{wrfbdy\_d01}.
+%
+The whole chain of data conversion and
+interpolation needed to generate those
+files is summarized in the diagram next 
+page.
+%
+Three distinct preprocessing steps are
+necessary to generate the final files. 
+%
+As is described in the previous section,
+some modifications in the \ttt{namelist.input} file
+[e.g. start/end dates labelled with \ttt{(p1)}]
+requires a complete reprocessing from step $1$ to step $3$
+to successfully launch the simulation,
+whereas other changes
+[e.g. model top labelled with \ttt{(p3)}] 
+only requires a quick reprocessing at step $3$, keeping
+the files generated at the end of step $2$
+the same.
+ 
+\mk
+\subsection{Input data}
+
+\mk
+\subsubsection{Static data}
+
+\mk
+All the static data 
+(topography, thermal inertia, albedo)
+needed to initialize the model
+are included in the \ttt{\$LMDMOD/LMD\_MM\_MARS/WPS\_GEOG} directory.
+%
+By default, only coarse-resolution datasets\footnote{ 
+%%%
+Corresponding to the fields stored in the
+file \ttt{surface.nc} known by LMD-MGCM users:
+\url{http://web.lmd.jussieu.fr/~forget/datagcm/datafile/surface.nc}
+%%%
+} are available, but the directory also contains sources and scripts
+to install finer resolution datasets:
+\begin{citemize}
+\item 32 and/or 64 pixel-per-degree (ppd) MOLA topography [\textit{Smith et al.}, 2001]\nocite{Smit:01mola},
+\item 8 ppd MGS/Thermal Emission Spectrometer (TES) albedo [\textit{Christensen et al.}, 2001]\nocite{Chri:01},
+\item 20 ppd TES thermal inertia [\textit{Putzig and Mellon}, 2007]\nocite{Putz:07} 
+\end{citemize}
+\pagebreak
+\includepdf[pages=1,offset=25mm -20mm]{diagramme.pdf}
+
+\mk
+\marge The role of the \ttt{build\_static} script is to
+automatically download these datasets from the web
+(namely PDS archives) and convert them to an 
+acceptable format for a future use by the 
+preprocessing utilities:
+%
+\begin{verbatim}
+cd $LMDMOD/LMD_MM_MARS
+./build_static
+\end{verbatim}
+%
+\begin{finger}
+\item Please install the \ttt{octave}
+free software\footnote{
+%%%
+Available at \url{http://www.gnu.org/software/octave}
+%%%
+} on your system to be able to use the
+\ttt{build\_static} script.
+%
+Another solution is to browse into each of the
+directories contained within \ttt{WPS\_GEOG}, download the
+data with the shell scripts and execute the \ttt{.m} scripts with either
+\ttt{octave} or the commercial software \ttt{matlab}
+(just replace \ttt{\#} by \ttt{\%}).
+%
+\item If you do not manage to execute the \ttt{build\_static} script, 
+converted ready-to-use datafiles are available upon request.
+%
+\item The building of the MOLA 64ppd topographical 
+database can be quite long. Thus, such a process is
+not performed by default by the \ttt{build\_static} script.
+If the user would like to build this database,
+please remove the \ttt{exit} command in the script, just above
+the commands related to the MOLA 64ppd.
+%
+\item The resulting \ttt{WPS\_GEOG} can reach a size
+of several hundreds of Mo. 
+%
+You might move such a folder in a place 
+with more disk space available, but then be
+sure to create in \ttt{\$LMDMOD/LMD\_MM\_MARS}
+a link to the new location
+of the directory.
+\end{finger}
+
+\mk
+\subsubsection{Meteorological data}
+
+\mk
+The preprocessing tools generate initial and boundary conditions
+from the \ttt{diagfi.nc} outputs of LMD-MGCM simulations.
+%
+If you would like to run a mesoscale simulation at a given
+season, you need to first run a GCM simulation and output
+the meteorological fields at the considered season.
+%
+For optimal forcing at the boundaries, we advise you
+to write the meteorological fields to the 
+\ttt{diagfi.nc} file at least each two hours.
+%
+Please also make sure that the following fields
+are stored in the NETCDF \ttt{diagfi.nc} file:
+
+\footnotesize
+\codesource{contents_diagfi}
+
+\normalsize
+\begin{finger}
+\item If the fields 
+\ttt{emis}, 
+\ttt{co2ice}, 
+\ttt{q01}, 
+\ttt{q02}, 
+\ttt{tsoil} 
+are missing in the \ttt{diagfi.nc} file, 
+they are replaced by respective default 
+values $0.95$, $0$, $0$, $0$, tsurf.
+\end{finger}
+
+\mk
+\marge An example of input meteorological file 
+\ttt{diagfi.nc} file can be downloaded
+at \url{http://web.lmd.jussieu.fr/~aslmd/LMD_MM_MARS/diagfi.nc.tar.gz}.
+%
+Please deflate the archive and copy the \ttt{diagfi.nc} file
+in \ttt{\$LMDMOD/TMPDIR/GCMINI}.
+%
+Such a file can then be used to define the initial
+and boundary conditions, and we will go 
+through the three preprocessing steps.
+
+\mk
+\subsection{Preprocessing steps} 
+
+\mk
+\subsubsection{Step 1: Converting GCM data}
+
+\mk
+The programs in the \ttt{PREP\_MARS} directory
+convert the data from the NETCDF \ttt{diagfi.nc}
+file into separated binary datafiles for each
+date contained in \ttt{diagfi.nc}, according to
+the formatting needed by the 
+preprocessing programs at step 2.
+%
+These programs can be executed by the following
+commands: 
+\begin{verbatim}
+cd $LMDMOD/LMD_MM_MARS/your_install_dir/PREP\_MARS
+echo 1 | ./create_readmeteo.exe     # drop the "echo 1 |" if you want control
+./readmeteo.exe < readmeteo.def
+\end{verbatim}
+%
+\marge If every went well with the conversion,
+the directory \ttt{\$LMDMOD/TMPDIR/WPSFEED}
+should contain files named \ttt{LMD:}.
+
+\mk
+\subsubsection{2: Interpolation on the regional domain}
+
+\mk
+In the \ttt{WPS} directory, the \ttt{geogrid.exe} program allows 
+you to define the mesoscale simulation domain
+to horizontally interpolate the topography, 
+thermal inertia and albedo fields at the domain
+resolution and to calculate useful fields
+such as topographical slopes.%\pagebreak
+
+\mk
+\marge Please execute the commands:
+%
+\begin{verbatim}
+cd $LMDMOD/LMD_MM_MARS/your_install_dir/WPS
+ln -sf ../../TESTCASE/namelist.wps .   # test case
+./geogrid.exe
+\end{verbatim}
+%
+\marge The result of \ttt{geogrid.exe} 
+-- and thus the definition of the mesoscale
+domain -- can be checked in the NETCDF
+file \ttt{geo\_em.d01.nc}.
+%
+A quick check can be performed using the command line
+\begin{verbatim}
+ncview geo_em.d01.nc
+\end{verbatim} 
+\marge if \ttt{ncview} is installed, or the \ttt{IDL}
+script \ttt{out\_geo.pro}
+\begin{verbatim}
+idl
+IDL> out_geo, field1='TOPO'
+IDL> out_geo, field1='TI'
+IDL> SPAWN, 'ghostview geo_em.d01_HGT_M.ps &'
+IDL> SPAWN, 'ghostview geo_em.d01_THERMAL_INERTIA.ps &'
+IDL> exit
+\end{verbatim}
+\marge if the demo version of \ttt{IDL} is installed.
+%
+Of course if your favorite graphical tool supports
+the NETCDF standard, you might use it to check the
+domain definition in \ttt{geo\_em.d01.nc}.
+
+\mk
+\marge If you are unhappy with the results or
+you want to change 
+the location of the mesoscale domain on the planet, 
+the horizontal resolution,
+the number of grid points \ldots,
+please modify the parameter
+file \ttt{namelist.wps} and execute again \ttt{geogrid.exe}.
+%
+Here are the contents of \ttt{namelist.wps}:
+%
+\codesource{namelist.wps_TEST} 
+
+\begin{finger}
+%
+\item No input meteorological data 
+are actually needed to execute \ttt{geogrid.exe}.
+%
+\item More details about the database and
+more options of interpolation could be
+found in the file \ttt{geogrid/GEOGRID.TBL}.
+%
+\item Defining several domains yields
+distinct files 
+\ttt{geo\_em.d01.nc},
+\ttt{geo\_em.d02.nc},
+\ttt{geo\_em.d03.nc}\ldots
+\end{finger}
+
+\mk
+\marge Once the \ttt{geo\_em} file(s) are generated,
+the \ttt{metgrid.exe} program performs
+a similar horizontal interpolation 
+of the meteorological fields to the mesoscale 
+domain as the one performed by \ttt{geogrid.exe} 
+for the surface data.
+%
+Then the program writes the results in
+\ttt{met\_em} files and also collects
+the static fields and domain parameters
+included in the \ttt{geo\_em} file(s)
+%
+Please type the following commands:
+\begin{verbatim}
+cd $LMDMOD/LMD_MM_MARS/your_install_dir/WPS
+./metgrid.exe
+\end{verbatim}
+%
+\marge If every went well,
+the directory \ttt{\$LMDMOD/TMPDIR/WRFFEED}
+should contain the \ttt{met\_em.*} files.
+
+\mk
+\subsubsection{Step 3: Vertical interpolation on mesoscale levels}
+
+\mk
+\marge The last step is to execute \ttt{real.exe}
+to perform the interpolation from the vertical
+levels of the GCM to the vertical levels 
+defined in the mesoscale model.
+%
+This program also prepares the final initial
+state for the simulation in files called
+\ttt{wrfinput} and the boundary conditions
+in files called \ttt{wrfbdy}.
+
+\mk
+\marge To successfully execute \ttt{real.exe}, 
+you need the \ttt{met\_em.*} files
+and the \ttt{namelist.input} file
+to be in the same directory as \ttt{real.exe}.
+%
+Parameters in \ttt{namelist.input} 
+controlling the behavior of the vertical interpolation 
+are those labelled with \ttt{(p3)} in the detailed
+list introduced in the previous chapter.
+
+\mk
+\marge Please type the following commands
+to prepare files for the Arsia Mons test case
+(or your personal test case if you changed
+the parameters in \ttt{namelist.wps}):
+\begin{verbatim}
+cd $LMDMOD/TESTCASE
+ln -sf $LMDMOD/WRFFEED/met_em* .
+./real.exe
+\end{verbatim}
+
+\mk
+\marge The final message of the \ttt{real.exe}
+should claim the success of the processes and you
+are now ready to launch the integrations
+of the LMD Martian Mesoscale Model again
+with the \ttt{wrf.exe} command as in section
+\ref{sc:arsia}.
+
+\begin{finger}
+\item When you modify either 
+\ttt{namelist.wps} or \ttt{namelist.input},
+make sure that the common parameters
+are exactly similar in both files
+(especially when running nested simulations)
+otherwise either \ttt{real.exe} or \ttt{wrf.exe}
+command will exit with an error message.
+\end{finger}
+%\pagebreak
+
+
+\chapter{Starting simulations from scratch}
+
+\mk
+\section{Running your own GCM simulations}
+
+\begin{remarque}
+To be completed
+\end{remarque}
+
+\mk
+\section{Complete simulations with \ttt{runmeso}}
+
+\begin{remarque}
+To be completed
+\end{remarque}
+
+
+\chapter{Outputs}
+
+\mk
+\section{Postprocessing utilities and graphics}
+
+\begin{remarque}
+To be completed. Do-it-all \ttt{idl} scripts
+would be described here !
+\end{remarque}
+
+\mk
+\section{Modify the outputs}
+
+\begin{remarque}
+To be completed. 
+Though the method is different,
+we kept all the convenient aspects of \ttt{writediagfi}
+\end{remarque}
+
+\chapter{Frequently Asked Questions}
+
+
+\begin{finger}
+\item Which timestep should I choose to avoid crashes of the model ?
+\item In the Martian simulations, why can't I define boundaries each 6 hours as on Earth ?
+\item Help ! I get strange assembler errors or ILM errors while compiling !
+\item Is it possible to run the model on a specific configuration that is not supported ?
+\item Why do I have to define four less rows in the parent domain
+when performing nested runs ?
+\item I am kind of nostalgic of early/middle Mars. How could I run
+mesoscale simulations at low/high obliquity ?
+\item Why \ttt{real.exe} is crashing when the model top pressure is
+lower than $2$~Pa ?
+\item Can I use the two-way nesting ?
+\end{finger}
+
+\begin{remarque}
+To be completed. 
+\end{remarque}
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/MESOSCALE_DEV/NETCDF/g95_netcdf
===================================================================
--- trunk/MESOSCALE_DEV/NETCDF/g95_netcdf	(revision 207)
+++ trunk/MESOSCALE_DEV/NETCDF/g95_netcdf	(revision 207)
@@ -0,0 +1,50 @@
+#! /bin/bash
+
+###
+### marche aussi en 64 bits
+###
+
+wget http://www.lmd.jussieu.fr/~hourdin/PATCH_LMDZ4OR_G95/netcdf-3.6.1.tar.gz
+gunzip netcdf-3.6.1.tar.gz
+tar xvf netcdf-3.6.1.tar
+
+cd netcdf-3.6.1
+
+# On modifie les options de compilation
+#export FC=g95
+#export F90=g95
+#export CC=gcc 
+#export F90FLAGS=" -cpp -ffree-form"
+#export FFLAGS=" -cpp "
+
+
+
+export CC=gcc 
+export CXX=g++ 
+export CPP='gcc -E' 
+export FC=g95 
+export F77=g95 
+export F90=g95 
+export CFLAGS='-O2 -DpgiFortran' 
+export CXXFLAGS='-O2 -DpgiFortran' 
+export CPPFLAGS='-DpgiFortran' 
+export FFLAGS='-O2 -fno-second-underscore' 
+export FCFLAGS='-O2 -fno-second-underscore' 
+export F90FLAGS='-O2 -fno-second-underscore'
+
+
+
+cd src
+cd fortran
+
+
+# Correction d'un petit probleme de netcdf
+sed -e '83s/^$/\#define f2cFortran/' cfortran.h >| tmp
+\mv tmp cfortran.h
+cd ..
+
+# Compilation
+./configure
+make check
+make install
+
Index: trunk/MESOSCALE_DEV/NETCDF/gfortran_netcdf
===================================================================
--- trunk/MESOSCALE_DEV/NETCDF/gfortran_netcdf	(revision 207)
+++ trunk/MESOSCALE_DEV/NETCDF/gfortran_netcdf	(revision 207)
@@ -0,0 +1,28 @@
+#! /bin/bash
+
+
+#wget http://www.lmd.jussieu.fr/~hourdin/PATCH_LMDZ4OR_G95/netcdf-3.6.1.tar.gz
+#gunzip netcdf-3.6.1.tar.gz
+tar xvf netcdf-3.6.1.tar
+
+cd netcdf-3.6.1
+
+export CC=gcc 
+export CXX=g++ 
+export CPP='gcc -E' 
+export FC=gfortran 
+export F77=gfortran 
+export F90=gfortran 
+export CFLAGS='-O2 -DpgiFortran' 
+export CXXFLAGS='-O2 -DpgiFortran' 
+export CPPFLAGS='-DpgiFortran' 
+export FFLAGS='-O2 -fno-second-underscore' 
+export FCFLAGS='-O2 -fno-second-underscore' 
+export F90FLAGS='-O2 -fno-second-underscore'
+
+cd src
+# Compilation
+./configure
+make check
+make install
+
Index: trunk/MESOSCALE_DEV/NETCDF/pgf90_64_netcdf
===================================================================
--- trunk/MESOSCALE_DEV/NETCDF/pgf90_64_netcdf	(revision 207)
+++ trunk/MESOSCALE_DEV/NETCDF/pgf90_64_netcdf	(revision 207)
@@ -0,0 +1,32 @@
+#! /bin/bash
+
+# netcdf  v3.6.1
+# pgi     v6.2-5
+# ehouarn v2.0
+
+tar xvf netcdf-3.6.1.tar
+
+cd netcdf-3.6.1
+
+export CC=pgcc
+export CXX=pgCC
+#export CPP='pgcc -E'
+#export FC=pgf90
+export F77=pgf90
+export F90=pgf90
+export CFLAGS="-fast -tp=x64 -Msignextend"
+export CXXFLAGS="-fast -tp=x64 -Msignextend"
+export CPPFLAGS="-DNDEBUG -DpgiFortran"
+export FFLAGS="-fast -tp=x64"
+#export FCFLAGS="-fast -tp=x64"
+export F90FLAGS="-fast -tp=x64"
+
+PREFIX=$PWD
+
+cd src
+
+./configure --prefix=${PREFIX} 
+make
+make test
+make install
+
Index: trunk/MESOSCALE_DEV/NETCDF/pgf90_64_netcdf_fpic
===================================================================
--- trunk/MESOSCALE_DEV/NETCDF/pgf90_64_netcdf_fpic	(revision 207)
+++ trunk/MESOSCALE_DEV/NETCDF/pgf90_64_netcdf_fpic	(revision 207)
@@ -0,0 +1,32 @@
+#! /bin/bash
+
+# netcdf  v3.6.1
+# pgi     v6.2-5
+# ehouarn v2.0
+
+tar xvf netcdf-3.6.1.tar
+
+cd netcdf-3.6.1
+
+export CC=pgcc
+export CXX=pgCC
+#export CPP='pgcc -E'
+#export FC=pgf90
+export F77=pgf90
+export F90=pgf90
+export CFLAGS="-fast -tp=x64 -Msignextend -fpic"
+export CXXFLAGS="-fast -tp=x64 -Msignextend-fpic"
+export CPPFLAGS="-DNDEBUG -DpgiFortran -fpic"
+export FFLAGS="-fast -tp=x64 -fpic"
+#export FCFLAGS="-fast -tp=x64"
+export F90FLAGS="-fast -tp=x64 -fpic"
+
+PREFIX=$PWD
+
+cd src
+
+./configure --prefix=${PREFIX} 
+make
+make test
+make install
+
Index: trunk/MESOSCALE_DEV/NOTES.txt
===================================================================
--- trunk/MESOSCALE_DEV/NOTES.txt	(revision 207)
+++ trunk/MESOSCALE_DEV/NOTES.txt	(revision 207)
@@ -0,0 +1,211 @@
+
+kvdif ne sert a rien dans le mesoscale martien, en raison de l'appel a la
+physique et MY
+
+Venus_est_dans_SOURCES_FORTRAN
+
+dire que si pb il faut regradre les premiers pas de temps
+
+adapter runmeso pour les runs ideal et les ???
+
+faire comme storm mais avec les pour eviter les recouvrements
+user manual
+
+il faut creer TMPDIR puis GCMINI WPSFEED WRFFEED actuellement
+
+changer la gestion topo dans LES comme fait dans modele general
+
+	13min_si_Registry_modifie     
+	15min_makemeso_moins_f        
+	1min_phys_plus_dyn_chgtresol  
+
+	PD_SCALAR est T par defaut desormais !!
+
+
+	il faudrait regler le prob du Registry dans le LES
+il y a un souci avec les variables liees a l'eau et d'autres
+
+	---anciennes notes lES sur gnome pb avec ideal.exe
+	## jusque 201 OK avec ideal.exe sequentiel
+	## ensuite il vaut mieux utiliser
+	## mpirun -n 4 ideal.exe
+	## le MP_STACK_SIZE est dans le bashrc
+
+
+
+concat.e puis localtime.e puis
+localtime.e (tres long) puis concatnc.e pour avoir en ls
+le resultat doit etre strider a 10... sinon bug affichage
+
+ncwa -O -v mtot,icetot -a longitude -d longitude,-179.0,179.0 diagfi.nc yeye.nc
+ncwa -O -v mtot -a longitude -d longitude,-180.0,180.0 concat_LT.nc mawd.nc
+(si trop gros faire ncrcat -v mtot -d Time,,,2 concat_LT.nc yorgl.nc)
+
+resumee
+--> localtime.e tres long
+--> concatnc.e en ls tres court
+--> renomme le fichier
+--> ncwa -O -v mtot,Time -a longitude -d longitude,-180.0,180.0 gcm_LT14_a035.nc mawd_a035.nc 
+
+	A FAIRE:::: mettre des flags precompilo dans les meso_
+	les reporter dans makegcm
+
+changer le renormalisation dans aeropacity ????
+on ne laisse pas aerosol comme le lifting veut qu'il soit !
+tenter des taux de soulevement pour que taudust_tmp soit les obs
+en prescivant une dust bomb fixe d opacite, on aura au moins la structure verticale
+
+	tester traceurs radiativement actifs avec la nouvelle physique ?????
+
+	A FAIRE: PB LES sur iDATAPLEX (les points HFX nuls) (pas de soucis sur ciclad)
+METTRE SUR LE svn LA BASE d'ETATS INITIAUX ????
+
+more than 4 procs w/ nest ??? y reflechir
+	-----------------------------------------------------------------------
+	-- si possible comment determiner taille ?
+	nproc doit diviser e_we-1 (1er nest)
+	grid_ratio doit diviser e_we-1 +4 (1er nest)
+	soit e_we=ye+1
+	grid_ratio divise ye+4 et nproc divise ye
+	soit nproc=8, ye=8*i
+	ainsi il existe j tel que 8i + 4 = 3j ou encore 4*[2i+1] = 3j
+	verifie par exemple si 2i+1 est multiple de 3
+	il suffit donc de trouver un multiple impair de 3 et de deduire i
+	par exemple 2i+1=33 >>>> i=16
+	>>>> e_we = 129 pour le 1er nest (et ajouter 4 pour les suivants)
+	------------------------------------------------------------------------
+
+	ne pas utiliser le FASTCASE avec traceurs (instabilites en haut)
+            ces instabilites sont cependant reglees si on augmente radt a 10 par exemple
+
+	pour le cycle de l'eau c'est OK de regler caps=F dans le mesoscale
+	sauf si on commence a devoiler la calotte permanente nord
+	---> corrige, scenario caps specifique au mesoscale
+
+	NE SERAIT-CE PAS MIEUX DE TOUT TRANSMETTRE AUX BORNES ???
+	tous les traceurs, pas seulement vapor
+
+
+	- attention il faut les trois MARS sinon il s arrete sans message clair
+	- attention a ne pas lancer le modele s il est deja lance
+	- important que pd_scalar soit a T ... le mettre par defaut ????
+
+
+ROUTINES a AJOUTER sont dans COMMON_GCM
+- passer aux nouveaux makegcm [en commun avec Ehouarn si on veut le nouveau
+  readtesassim qui est en F90]
+- il faut tester le nest pour verifier les lignes trop longues
+
+	(ok) lier gr_fi_dyn qui est dans dyn3d
+	(ok) regler le pb du nouveau readtesassim (ou alors le lier tout simplement ou
+	  l'appeler meso_readtesassim)
+	(ok) regler le pb meso_dustlift (le lier dans makemeso comme point precedent)
+	     (car le souci c que dustlift est appele dans vdifc)
+
+	RESTE a ADAPTER le LES a la NOUVELLE PHYSIQUE
+	il y a normalement peu a faire
+	reste a faire egalement le -DNEWPHYS pour le LES
+
+	attention pb d'affichage des valeurs dans le fichier texte avec LES ???
+	bien que les valeurs du fichier soient tout a fait raisonnables
+	... n'est-ce pas un effet de bord cache ????
+
+
+	apres fusion, le LES est reconnu par module_lmd_driver lorsque diff_opt=2 km_opt=2
+
+
+	-attention PB si on ne sort pas HFX et USTM (note dans le Registry)
+	-il faut run.def nouvelle physique [c est meme ce qui est utilise par runmeso]
+	- IL FAUT SE PENCHER SUR LE FAIT QU'ON INDIQUE q2val=0 dans lmd_driver ....
+
+-----------------------
+ATTENTION NOUVELLE PHYSIQUE
+Oui, c'est quelque chose qu'il faut probablement changer partout 
+maintenant que la version de pgf90 à changé (sur les machines du LMD).
+Avec cette nouvelle version (7.1-6), le '-fast' est plus agressif 
+qu'avant (et inclue entre autre les horribles '-Mvect=sse -Mscalarsse' 
+qui dégradent la précision de certains calculs pour accélérer le code); 
+je préconise de ne plus s'en servir. Bon d'accord, je n'ai pas fait une 
+étude approfondie de l'impact de '-fast', mais j'ai vu qu'avec, 
+j'obtenais des résultats différents lorsque je changeais simplement 
+l'ordre des traceurs...
+
+Aymeric Spiga wrote:
+> je détecte ces changements d'option de compilation ; ont-ils de
+> l'importance ?
+>
+> Aymeric
+>
+> < #   set optim90=" -fast"
+> < #   set optimtru90=" -fast -c -Mfree "
+> < #   set optim90=" -O2 -Munroll=c:1 -Mnoframe -Mcache_align"
+> < #   set optimtru90=" -O2 -Munroll=c:1 -Mnoframe -Mcache_align"
+> <    set optim90=" -O2 -Munroll -Mcache_align"
+> <    set optimtru90=" -O2 -Munroll -Mcache_align"
+> ---
+>   
+>>    set optim90=" -fast"
+>>    set optimtru90=" -fast -c -Mfree "
+------------------------------
+
+
+	- attention a cp et R, normaliser une bonne fois pour toutes
+	- il manque sur le SVN les cas idealises
+- il manque sur le SVN les scripts MPI
+	- il faut recompiler les librairies NETCDF
+	- mettre la nouvelle physique
+	- mettre les DEF du meso-echelle
+
+	- modele ok sur auric
+- modele pas ok sur ciclad avec pgf2010, erreur inedite un seul module manquant
+	- modele LES OK sur ciclad
+	- modele LES ok sur auric
+
+	24/01/2011
+	tests g95 en 64bits natif sur systeme Linux
+	-- modifications de makemeso, tests
+	-- tout est OK sauf les libraires NETCDF, probleme d'underscore
+	-- OK avec libraires maison compilees avec g95 standard sur flores [et tourne OK]
+
+
+
+	mpi_64_pgf7_ncdf4_mpi1.2.txt
+	- probleme lors de la compilation de solve_em : LINUX runs out of memory [huchard]
+	- IL FAUT COMPILER SUR auric
+	nougaro est lent a la compilation, utiliser surtout auric
+
+
+
+
+______________________________________________________
+
+
+PB MPI
+/donnees/aslmd/MODELES/MPI/mpich2-1.2.1p1_PGF7/lib/libmpich.a(simple_pmi.o):
+In function `PMI_Init':
+simple_pmi.c:(.text+0x15c0): warning: Using 'gethostbyname' in statically
+linked applications requires at runtime the shared libraries from the glibc
+version used for linking
+/donnees/aslmd/MODELES/MPI/mpich2-1.2.1p1_PGF7/lib/libmpich.a(simple_pmi.o):
+In function `PMI_Init':
+simple_pmi.c:(.text+0x15c0): warning: Using 'gethostbyname' in statically
+linked applications requires at runtime the shared libraries from the glibc
+version used for linking
+/donnees/aslmd/MODELES/MPI/mpich2-1.2.1p1_PGF7/lib/libmpich.a(simple_pmi.o):
+In function `PMI_Init':
+simple_pmi.c:(.text+0x15c0): warning: Using 'gethostbyname' in statically
+linked applications requires at runtime the shared libraries from the glibc
+version used for linking
+/donnees/aslmd/MODELES/MPI/mpich2-1.2.1p1_PGF7/lib/libmpich.a(simple_pmi.o):
+In function `PMI_Init':
+simple_pmi.c:(.text+0x15c0): warning: Using 'gethostbyname' in statically
+linked applications requires at runtime the shared libraries from the glibc
+version used for linking
+
+
+POSSIBLE mars.sed
+
+s+ *../frame/module_internal_header_util.o ../frame/pack_utils.o
+-L../external/esmf_time_f90 -lesmf_time+& -L../mars_lmd/libo -llmd
+-Mmpi=mpich2+g
+
Index: trunk/MESOSCALE_DEV/PLOT/ARWpost/call_arwpost.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/ARWpost/call_arwpost.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/ARWpost/call_arwpost.pro	(revision 207)
@@ -0,0 +1,97 @@
+pro call_arwpost, nam1, nam2, nam3, nam4, nam5, tabnam, nest, datafolder, grads
+
+;
+; YOU MUST HAVE COMPILED ARWPOST.EXE !
+;
+
+;
+; USE:
+;  @plot.def
+;  then: call_arwpost, nam1, nam2, nam3, nam4, nam5, tabnam
+;
+; but you'd rather use the trace.idl script  
+
+
+
+;
+; prepare user_defined namelist part
+;
+param_namelist=[ nam1, "/", " ", "&datetime", nam2, nam3, nam4, "/", " ", "&interp", nam5 ]
+
+if (tabnam(0) ne 999.) then begin
+  ntot = ( 1+tabnam(1)-tabnam(0) ) / float(tabnam(2))
+  ;ntot = ( tabnam(1)-tabnam(0) ) / float(tabnam(2))
+  ntot = ceil(ntot) 
+  temparr =  tabnam(0)+findgen(ntot)*tabnam(2)
+endif else begin
+  temparr = tabnam[1:n_elements(tabnam)-1] 
+endelse
+
+
+        if (n_elements(temparr) le 5.) then begin
+		levelstr=[ " interp_levels = ", '   '+string(temparr,'(F7.3)'), "/"]
+	endif else begin
+		nnnn = floor(n_elements(temparr)/3.)
+		ye = strarr(nnnn)
+	        for i=0,nnnn-2 do begin
+		  ye[i] = string(temparr[3*i],'(F7.3)')+','+string(temparr[3*i+1],'(F7.3)')+','+string(temparr[3*i+2],'(F7.3)')+','
+		endfor
+		ye[nnnn-1] = string(temparr[3*(nnnn-1)],'(F7.3)')+','+string(temparr[3*(nnnn-1)+1],'(F7.3)')+','+string(temparr[3*(nnnn-1)+2],'(F7.3)')
+		levelstr=[ "interp_levels = ", ye, "/"]
+	endelse
+
+param_namelist=[param_namelist,levelstr]
+param_namelist=transpose(param_namelist)
+
+;
+; generate file (not available in demo mode)
+;
+SPAWN, 'touch toto ; \rm toto'
+OPENW, 1, 'toto'
+PRINTF, 1, param_namelist
+CLOSE, 1
+	;;
+	;; fix for demo mode
+	;;	
+	;SPAWN, 'touch toto ; \rm toto ; touch toto'
+	;for i=0, n_elements(param_namelist)-1 do begin
+	;	SPAWN, 'echo "'+param_namelist[i]+'" >> toto'
+	;	print, param_namelist[i]
+	;endfor	
+instru = 'sed s/zenest/'+nest+'/g namelist.ARWpost_ref > namelist.ARWpost_ref_tmp'
+instru = instru + ' ; ' + 'rm -rf zefolder ; ln -sf '+datafolder+' zefolder'
+instru = instru + ' ; ' + 'touch namelist.ARWpost ; \rm namelist.ARWpost ; mv namelist.ARWpost_ref_tmp namelist.ARWpost'
+if (grads eq 'true') then instru = instru + ' ; ' + "sed s/'idl'/'grads'/g namelist.ARWpost > yeye ; \mv yeye namelist.ARWpost"
+instru = instru + ' ; ' + 'cat toto >> namelist.ARWpost ; \rm toto'
+
+;
+; extract data from netcdf file
+;
+instru = instru + ' ; ' + './ARWpost.exe'
+
+;
+; patch for correct time in plots
+;
+instru = instru + " ; " + "touch input_tmp.ctl ; \rm input_tmp.ctl ; touch timefil ; \rm timefil"
+	;;; this line induces problems with variables with Z in the name
+if (grads ne 'true') then instru = instru + " ; " + "sed s/'Z'/' 0 Z'/g input.ctl > input_tmp.ctl ; mv -f input_tmp.ctl input.ctl"
+instru = instru + " ; " + "grep interval_seconds namelist.ARWpost | tail -n 1 | awk '{print $3}' > timefil ; cat timefil"
+SPAWN, instru
+
+;;old ARWpost
+;SPAWN, "sed s/'*'/'9'/g input.dat > yeah ; mv -f yeah input.dat"
+
+
+;; fix debile
+SPAWN, "sed s/'SWDOWN 0 Z'/'SWDOWNZ'/g input.ctl > yeah ; mv -f yeah input.ctl"
+
+;
+; ok
+;
+print, 'ok...'
+print, 'if the extraction was successful, '
+print, 'you can use the input.dat and input.ctl files' 
+
+if (grads eq 'true') then stop
+
+END
Index: trunk/MESOSCALE_DEV/PLOT/ARWpost/gw.def
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/ARWpost/gw.def	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/ARWpost/gw.def	(revision 207)
@@ -0,0 +1,267 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  -or- @report.idl
+;  -or- @movie.idl
+;
+;  this file will be saved !
+;
+;;---------------------------------------
+
+
+;-------------------------------------;
+; DATA LOCATION and PLOT DESTINATION  ;
+; default is ./                       ;
+;-------------------------------------;
+datafolder='/d5/aslmd/WRF_Mars/EN_COURS/OM40_ls170/'   
+plotfolder=datafolder
+;; for web anim and tex report (default is 'plot')
+textitle='OM40_month72'
+texcomments='sol3'
+
+;;; load/save ARWpost-generated text files ? default is no
+;backup_data='yes'
+;already_data='yes'
+
+;-------------------------------
+;-------------------------------
+; namelist.ARWPOST parameters
+;-------------------------------
+;-------------------------------
+
+nam1=" fields = 'tk,HGT,W' "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE FIELDS TO BE EXTRACTED 
+;; ex: tk,HGT,PSFC,U,V,W,T,tk,ICETOT,RAVE,QH2O_ICE,QH2O,PTOT,TSURF
+
+nam2=" start_date = '2024-06-37_20:00:10' " 
+nam3=" end_date   = '2024-06-37_23:00:10' "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE START/END DATE
+
+nam4=" interval_seconds = 11100 "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
+;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s, 12h: 44400s	
+
+nam5=" interp_method = 1 "	
+;nam5=" interp_method = 0 "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 		
+;; SET VERT. COORD. 0: eta levels, 1: height (inc) or pressure (dec)
+
+tabnam=[-5.,40.,0.5]   ;[2.,30.,0.3]   	
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; SET HEIGHT/PRESSURE LEVELS WITH [first alt, last alt, step]
+
+;nest='d03'  
+;; ^ ^ ^ ^
+;; SET NEST
+
+
+
+;----------------------------------------------------
+;----------------------------------------------------
+; what do you want to plot ?
+; THIS MUST BE SET ACCORDINGLY TO PREVIOUS SECTION
+;   - do not plot a field not extracted
+;   - do not ask for more plot than data available
+;----------------------------------------------------
+;----------------------------------------------------
+
+num=2		   	;; how many plots ?
+
+
+field1='tk'		;; FILLED
+field2='tk'		;; CONTOURED
+;winds=['U','V']	;; VECTORS
+;topo=1
+
+
+;;; VORTICITY
+;field1='HGT' & winds=['U','V'] & topo=1
+
+
+;----------------------------------
+;----------------------------------
+; what kind of plot do you want ? 
+;----------------------------------
+;----------------------------------
+
+;; first is 1
+;plot='map' & level=15  	
+plot='meridional' & nlon=30
+;plot='zonal' & nlat=66
+
+
+;---------;
+; special ;
+;---------;
+;;; SEA-LEVEL PRESSURE
+;field1='PSFC' & winds=['tk','HGT'] & topo=1 & plot='map' & level=7
+;;; HORIZONTAL WIND VELOCITY
+;field1='U' & winds=['U','V'] & topo=1 & plot='map' & level=9
+
+;;useidlfile='true' ;; if you are just changing what is below...
+;;extract='no' ;; SPECIFIC FOR ATLAS
+
+;----------------------------
+;----------------------------
+; change plot settings 
+;----------------------------
+;----------------------------
+
+;; uncomment to modify default plot settings
+;; | | | | | | | | | | | | | | | | | | | | |
+;; v v v v v v v v v v v v v v v v v v v v v
+
+;;;
+;;; PLOT TITLES
+;;;
+;subtitle_user='-- LMD Martian Mesoscale Model --'            ;; grepALL
+;title_user='Vertical Wind (!Nm!N.s!U-1!N)'     ;; grepALL
+;title_axis=['x coord (km)','y coord (km)']     ;; grepALL
+
+;;;
+;;; COLOR TABLES
+;;;
+;flag_cb='false'                ;; grepALL
+;format='(I0)'                  ;; grepALL
+colors=64                       ;; grepALL
+pal=39                          ;; grepALL
+;; GOOD COLOR TABLES: 4, 18, 22, 16, 37, 33, 39
+
+;;;
+;;; FILL LIMITS
+;;;
+minfield_init=150.      ;; grepALL
+maxfield_init=250.	;; grepALL
+
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max ;; grepALL
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min ;; grepALL
+;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value ;; grepALL
+
+;;;
+;;; WINDS
+;;;
+;windex=40.	;; grepALL
+;stride=1.	;; grepALL
+
+;;;
+;;; CONTOUR
+;;;
+;overcontour=overcontour-mean(overcontour)	;; grepALL
+lev=130. + 10.*findgen(20) ;; grepALL
+
+;;;
+;;; AXIS
+;;;
+;isotropic='false'       ;; grepALL
+intervalx=5.            ;; grepALL
+intervaly=5.             ;; grepALL
+
+;;;
+;;; MAP LIMITS 
+;;;
+;windowx=[-150.,-120.]        ;; grepMAP
+;windowy=[5.,35.]       ;; grepMAP
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+minalt=-5.		;; grepSEC
+maxalt=40.		;; grepSEC
+minspace=0.0  		;; grepSEC
+maxspace=35.0  		;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;; POUBELLE
+
+
+;; DEFAULT: ARWPOST.EXE ALREADY RUN (i.e. input.ctl and input.dat already there)
+;; UNCOMMENT FOLLOWING LINE TO EXTRACT FILES 
+;extract='yes'   ;;   EXECUTE ARWPOST.EXE
+                ;;   WITH THE FOLLOWING PARAMETERS :
+
+
+;@map_sea_level.idl
+;@map_ertel_vorticity.idl
+;field1='HGT'
+;field2='U'
+;winds=['U','V']
+;topo=1
+
+
+;winds=['U','V'] & field1='SWDOWN' & topo=1
+;winds=['V','W'] & field1='V' 
+;field1='ICETOT' & topo=1
+;field1='RAVE' & topo=1
+;field1='QH2O_ICE' & topo=1
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O' & field2='W'
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O_ICE' & field2='tk'
+;field1='tk' & topo=1
+;field1='V' & field2='V'
+;field1='W' & winds=['V','W']
+;field1='tk' & winds=['V','W']
+;field1='tk'
+;field1='W' & topo=1
+;field1='TSK' & topo=1
+;field1='U' & winds=['U','V'] & topo=1
+;winds=['V','W'] & field1='V'
+;winds=['V','W'] & field1='W'
+;field1='U' & winds=['U','V'] & topo=1
+;field1='HGT' & field2='HGT' 
+;field1='U' & winds=['U','V'] ;& topo=1
+;field1='PSFC' & winds=['U','V'] & field2='W'
+;field1='W' & winds=['U','V'] & field2='PSFC'
+;field1='TSURF' & topo=1 ;& winds=['U','V']
+;field1='T' & topo=1 & winds=['U','V']
+;field1='PSFC' & winds=['tk','HGT'] & topo=1
+;field1='tk' & topo=1
+;field1='tk' & winds=['U','V'] & topo=1
+;field1='T' & field2='T'
+;field1='T' & winds=['U','V'] 
+;field1='HGT' & winds=['HGT','HGT'] 
+
Index: trunk/MESOSCALE_DEV/PLOT/ARWpost/gw.def_last
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/ARWpost/gw.def_last	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/ARWpost/gw.def_last	(revision 207)
@@ -0,0 +1,284 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  -or- @report.idl
+;  -or- @movie.idl
+;
+;  this file will be saved !
+;
+;;---------------------------------------
+
+
+;-------------------------------------;
+; DATA LOCATION and PLOT DESTINATION  ;
+; default is ./                       ;
+;-------------------------------------;
+;datafolder='/d5/aslmd/LMD_MM_MARS_SIMUS/LANDING_SITES/GALE/'
+;datafolder='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_160/jour20/'
+;datafolder='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_68.5/jour20/'
+;datafolder='/d5/aslmd/WRF_Mars/EN_COURS/OMG_cstTI/'
+;datafolder='/d5/aslmd/WRF_Mars/EN_COURS/TH20WC_month4'
+datafolder='/tmp7/aslmd/MERIDIANI_FLUSH'
+;datafolder='/d5/aslmd/LMD_MM_MARS_SIMUS/PAVONIS/'
+plotfolder=datafolder
+;; for web anim and tex report (default is 'plot')
+;textitle='takezoomstress'
+;textitle='takezoomhiresstress'
+textitle='atlas_6_meridiani_flush2'
+texcomments='sol'
+
+;;; load/save ARWpost-generated text files ? default is no
+;backup_data='yes'
+;already_data='yes'
+
+;-------------------------------
+;-------------------------------
+; namelist.ARWPOST parameters
+;-------------------------------
+;-------------------------------
+
+nam1=" fields = 'HGT,U,V,TSURF' "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE FIELDS TO BE EXTRACTED 
+;; ex: tk,HGT,PSFC,U,V,W,T,tk,ICETOT,RAVE,QH2O_ICE,QH2O,PTOT,TSURF
+
+nam2=" start_date = '2024-09-07_06:00:00'
+nam3=" end_date = '2024-09-08_06:00:00'
+;nam3=" end_date   = '2024-09-13_06:00:00'
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE START/END DATE
+
+nam4=" interval_seconds = 3700 "
+;nam4=" interval_seconds = 7400 "
+;nam4=" interval_seconds = 88800 "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
+;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s, 12h: 44400s	
+
+nam5=" interp_method = 1 "	
+;nam5=" interp_method = 0 "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 		
+;; SET VERT. COORD. 0: eta levels, 1: height (inc) or pressure (dec)
+
+tabnam=[0.0, 5.0, 1.0]
+tabnam=[999.,0.,1.,4.,6.,10.,20.]
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; SET HEIGHT/PRESSURE LEVELS WITH [first alt, last alt, step]
+
+;nest='d03'  
+;; ^ ^ ^ ^
+;; SET NEST
+
+
+
+;----------------------------------------------------
+;----------------------------------------------------
+; what do you want to plot ?
+; THIS MUST BE SET ACCORDINGLY TO PREVIOUS SECTION
+;   - do not plot a field not extracted
+;   - do not ask for more plot than data available
+;----------------------------------------------------
+;----------------------------------------------------
+
+num=23		   	;; how many plots ?
+;num=7
+;num=1
+
+field1='U'		;; FILLED
+;field2='TSURF'		;; CONTOURED
+winds=['U','V']		;; VECTORS
+topo=1
+
+;;; VORTICITY
+;field1='HGT' & winds=['U','V'] & topo=1
+
+;----------------------------------
+;----------------------------------
+; what kind of plot do you want ? 
+;----------------------------------
+;----------------------------------
+
+;; first is 1
+plot='map' & level=6 ;3	
+;plot='meridional' & nlon=50
+;plot='zonal' & nlat=66
+
+;---------;
+; special ;
+;---------;
+;;; SEA-LEVEL PRESSURE
+;field1='PSFC' & winds=['tk','HGT'] & topo=1 & plot='map' & level=6 ;2 ;7
+;;; HORIZONTAL WIND VELOCITY
+;field1='U' & winds=['U','V'] & topo=1 & plot='map' & level=6 ;2 ;9
+
+
+;;useidlfile='true' ;; if you are just changing what is below...
+
+
+;----------------------------
+;----------------------------
+; change plot settings 
+;----------------------------
+;----------------------------
+
+;; uncomment to modify default plot settings
+;; | | | | | | | | | | | | | | | | | | | | |
+;; v v v v v v v v v v v v v v v v v v v v v
+
+;;;
+;;; PLOT TITLES
+;;;
+;subtitle_user='-- LMD Martian Mesoscale Model --'            ;; grepALL
+;title_user='Vertical Wind (!Nm!N.s!U-1!N)'     ;; grepALL
+;title_user='Dust opacity' ;; grepALL
+;title_axis=['x coord (km)','y coord (km)']     ;; grepALL
+
+;;;
+;;; COLOR TABLES
+;;;
+;flag_cb='false'                 ;; grepALL
+format='(F5.1)'                  ;; grepALL
+;format='(I0)'                   ;; grepALL
+;colors=128                      ;; grepALL
+pal=22                           ;; grepALL
+;pal=33                           ;; grepALL
+poscb=0.85			 ;; grepALL
+poscb=0.68                       ;; grepALL
+;; GOOD COLOR TABLES: 4, 18, 22, 16, 37, 33, 39
+
+;;;
+;;; FILL LIMITS
+;;;
+minfield_init= 0.   	;; grepALL
+maxfield_init= 25.   	;; grepALL
+
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max ;; grepALL
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min ;; grepALL
+;;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value ;; grepALL
+
+;;;
+;;; WINDS
+;;;
+windex=25.	;; grepALL
+stride=3.	;; grepALL
+
+;;;
+;;; CONTOUR
+;;;
+;overcontour=overcontour-mean(overcontour)	;; grepALL
+lev=-10. + 0.5*findgen(100) ;; grepALL
+;lev=120.+5.*findgen(50) ;; grepALL
+
+;;;
+;;; AXIS
+;;;
+;isotropic='false'       ;; grepALL
+intervalx=2.            ;; grepALL
+intervaly=2.            ;; grepALL
+
+;;;
+;;; MAP LIMITS 
+;;;
+windowx=[-20.,08.]       ;; grepMAP
+windowy=[-16.,12.]       ;; grepMAP
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-4.		;; grepSEC
+;maxalt=16.		;; grepSEC
+;minspace=-30.   	;; grepSEC
+;maxspace=0.   		;; grepSEC
+
+;;
+;; METRIC UNITS FOR VERTICAL SECTION
+;;
+;factor=20.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;; POUBELLE
+
+
+;; DEFAULT: ARWPOST.EXE ALREADY RUN (i.e. input.ctl and input.dat already there)
+;; UNCOMMENT FOLLOWING LINE TO EXTRACT FILES 
+;extract='yes'   ;;   EXECUTE ARWPOST.EXE
+                ;;   WITH THE FOLLOWING PARAMETERS :
+
+
+;@map_sea_level.idl
+;@map_ertel_vorticity.idl
+;field1='HGT'
+;field2='U'
+;winds=['U','V']
+;topo=1
+
+
+;winds=['U','V'] & field1='SWDOWN' & topo=1
+;winds=['V','W'] & field1='V' 
+;field1='ICETOT' & topo=1
+;field1='RAVE' & topo=1
+;field1='QH2O_ICE' & topo=1
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O' & field2='W'
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O_ICE' & field2='tk'
+;field1='tk' & topo=1
+;field1='V' & field2='V'
+;field1='W' & winds=['V','W']
+;field1='tk' & winds=['V','W']
+;field1='tk'
+;field1='W' & topo=1
+;field1='TSK' & topo=1
+;field1='U' & winds=['U','V'] & topo=1
+;winds=['V','W'] & field1='V'
+;winds=['V','W'] & field1='W'
+;field1='U' & winds=['U','V'] & topo=1
+;field1='HGT' & field2='HGT' 
+;field1='U' & winds=['U','V'] ;& topo=1
+;field1='PSFC' & winds=['U','V'] & field2='W'
+;field1='W' & winds=['U','V'] & field2='PSFC'
+;field1='TSURF' & topo=1 ;& winds=['U','V']
+;field1='T' & topo=1 & winds=['U','V']
+;field1='PSFC' & winds=['tk','HGT'] & topo=1
+;field1='tk' & topo=1
+;field1='tk' & winds=['U','V'] & topo=1
+;field1='T' & field2='T'
+;field1='T' & winds=['U','V'] 
+;field1='HGT' & winds=['HGT','HGT'] 
+
+dumb=000
Index: trunk/MESOSCALE_DEV/PLOT/ARWpost/gw.def_ref
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/ARWpost/gw.def_ref	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/ARWpost/gw.def_ref	(revision 207)
@@ -0,0 +1,270 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  -or- @report.idl
+;  -or- @movie.idl
+;
+;  this file will be saved !
+;
+;;---------------------------------------
+
+
+;-------------------------------------;
+; DATA LOCATION and PLOT DESTINATION  ;
+; default is ./
+;-------------------------------------;
+datafolder='/home/aslmd/ELYSIUM_3NEST/'   
+plotfolder=datafolder
+;; for web anim and tex report (default is 'plot')
+textitle='EM'
+texcomments='sol3'
+
+;;; load/save ARWpost-generated text files ? default is no
+;backup_data='yes'
+;already_data='yes'
+
+;-------------------------------
+;-------------------------------
+; namelist.ARWPOST parameters
+;-------------------------------
+;-------------------------------
+
+nam1=" fields = 'HGT' "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE FIELDS TO BE EXTRACTED 
+;; ex: tk,HGT,PSFC,U,V,W,T,tk,ICETOT,RAVE,QH2O_ICE,QH2O,PTOT,TSURF
+
+nam2=" start_date = '2024-07-03_01:00:00' " 
+nam3=" end_date   = '2024-07-03_01:00:00' "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE START/END DATE
+
+nam4=" interval_seconds = 14800 "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
+;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s, 12h: 44000s	
+
+nam5=" interp_method = 1 "	
+nam5=" interp_method = 0 "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 		
+;; SET VERT. COORD. 0: eta levels, 1: height (inc) or pressure (dec)
+
+tabnam=[0.,6.,0.1]   	
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; SET HEIGHT/PRESSURE LEVELS WITH [first alt, last alt, step]
+
+nest='d01'  
+;; ^ ^ ^ ^
+;; SET NEST
+
+
+
+;----------------------------------------------------
+;----------------------------------------------------
+; what do you want to plot ?
+; THIS MUST BE SET ACCORDINGLY TO PREVIOUS SECTION
+;   - do not plot a field not extracted
+;   - do not ask for more plot than data available
+;----------------------------------------------------
+;----------------------------------------------------
+
+num=1		   	;; how many plots ?
+
+
+field1='HGT'		;; FILLED
+field2='HGT'		;; CONTOURED
+;winds=['U','V']	;; VECTORS
+;topo=1
+
+
+;;; SEA-LEVEL PRESSURE
+;field1='PSFC' & winds=['tk','HGT'] & topo=1 & level=7
+;;; HORIZONTAL WIND VELOCITY
+;field1='U' & winds=['U','V'] & topo=1
+;;; VORTICITY
+;field1='T' & winds=['U','V'] & topo=1
+
+
+;----------------------------------
+;----------------------------------
+; what kind of plot do you want ? 
+;----------------------------------
+;----------------------------------
+
+;; first is 1
+plot='map' & level=1 	
+;plot='meridional' & nlon=100
+;plot='zonal' & nlat=100
+
+;---------;
+; special ;
+;---------;
+;;; SEA-LEVEL PRESSURE
+;field1='PSFC' & winds=['tk','HGT'] & topo=1 & plot='map' & level=7
+;;; HORIZONTAL WIND VELOCITY
+;field1='U' & winds=['U','V'] & topo=1 & plot='map' & level=9
+
+;;useidlfile='true' ;; if you are just changing what is below...
+;;extract='no' ;; SPECIFIC FOR ATLAS
+
+
+;----------------------------
+;----------------------------
+; change plot settings 
+;----------------------------
+;----------------------------
+
+;; uncomment to modify default plot settings
+;; | | | | | | | | | | | | | | | | | | | | |
+;; v v v v v v v v v v v v v v v v v v v v v
+
+;;;
+;;; PLOT TITLES
+;;;
+;subtitle_user='LMD mesoscale model'            ;; grepALL
+;title_user='Vertical Wind (!Nm!N.s!U-1!N)'     ;; grepALL
+;title_axis=['x coord (km)','y coord (km)']     ;; grepALL
+
+;;;
+;;; COLOR TABLES
+;;;
+;flag_cb='false'                ;; grepALL
+;format='(I0)'                  ;; grepALL
+;colors=128                      ;; grepALL
+;pal=33                          ;; grepALL
+;; GOOD COLOR TABLES: 4, 18, 22, 16, 37, 33
+
+;;;
+;;; FILL LIMITS
+;;;
+;minfield_init=-80.	;; grepALL
+;maxfield_init=80.	;; grepALL
+
+;lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max ;; grepALL
+;lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min ;; grepALL
+;lim_blank = 10 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value ;; grepALL
+
+;;;
+;;; WINDS
+;;;
+;windex=40.	;; grepALL
+;stride=3.	;; grepALL
+
+;;;
+;;; CONTOUR
+;;;
+;overcontour=overcontour-mean(overcontour)	;; grepALL
+;lev=[2.,4.,6.,8.,10.,12.,14.,16.] ;; grepALL 
+
+;;;
+;;; AXIS
+;;;
+;isotropic='false'       ;; grepALL
+;intervalx=1.            ;; grepALL
+;intervaly=2.            ;; grepALL
+
+;;;
+;;; MAP LIMITS 
+;;;
+;windowy=[23.,26.5]       ;; grepMAP
+;windowx=[145.,150.]      ;; grepMAP
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=2.		;; grepSEC
+;maxalt=26.		;; grepSEC
+;minspace=144.0  	;; grepSEC
+;maxspace=151.0  	;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;; POUBELLE
+
+
+;; DEFAULT: ARWPOST.EXE ALREADY RUN (i.e. input.ctl and input.dat already there)
+;; UNCOMMENT FOLLOWING LINE TO EXTRACT FILES 
+;extract='yes'   ;;   EXECUTE ARWPOST.EXE
+                ;;   WITH THE FOLLOWING PARAMETERS :
+
+
+;@map_sea_level.idl
+;@map_ertel_vorticity.idl
+;field1='HGT'
+;field2='U'
+;winds=['U','V']
+;topo=1
+
+
+;winds=['U','V'] & field1='SWDOWN' & topo=1
+;winds=['V','W'] & field1='V' 
+;field1='ICETOT' & topo=1
+;field1='RAVE' & topo=1
+;field1='QH2O_ICE' & topo=1
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O' & field2='W'
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O_ICE' & field2='tk'
+;field1='tk' & topo=1
+;field1='V' & field2='V'
+;field1='W' & winds=['V','W']
+;field1='tk' & winds=['V','W']
+;field1='tk'
+;field1='W' & topo=1
+;field1='TSK' & topo=1
+;field1='U' & winds=['U','V'] & topo=1
+;winds=['V','W'] & field1='V'
+;winds=['V','W'] & field1='W'
+;field1='U' & winds=['U','V'] & topo=1
+;field1='HGT' & field2='HGT' 
+;field1='U' & winds=['U','V'] ;& topo=1
+;field1='PSFC' & winds=['U','V'] & field2='W'
+;field1='W' & winds=['U','V'] & field2='PSFC'
+;field1='TSURF' & topo=1 ;& winds=['U','V']
+;field1='T' & topo=1 & winds=['U','V']
+;field1='PSFC' & winds=['tk','HGT'] & topo=1
+;field1='tk' & topo=1
+;field1='tk' & winds=['U','V'] & topo=1
+;field1='T' & field2='T'
+;field1='T' & winds=['U','V'] 
+;field1='HGT' & winds=['HGT','HGT'] 
+
Index: trunk/MESOSCALE_DEV/PLOT/ARWpost/gw.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/ARWpost/gw.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/ARWpost/gw.pro	(revision 207)
@@ -0,0 +1,597 @@
+pro gw, typeplot
+
+
+;-----------------------------------------
+; Read files generated by ARWpost & plot
+;
+; typeplot is s for see		(.ps are not saved, .def saved)
+;	      t for trace	(.ps are saved, .def saved)
+;	      r for report	(same as t + tex report)
+;	      m for movie	(same as t + gif movie)
+;	      w for web page    (same as t + html animation)
+;             g for simple grads output
+;
+; default is 's'
+;
+; use:
+;  1. set parameters in gw.def
+;  2. @gwc
+;  3. gw, 's' (or 't' or 'r' or 'm' or 'w' or 'g')
+;     or simply: gw
+; 
+;-----------------------------------------
+; A. Spiga, Mars 2008
+;-----------------------------------------
+
+
+nomovie='yes'
+grads='blabla'
+useidlfile='false'
+
+if (n_elements(typeplot) eq 0) then typeplot='s'
+if (typeplot eq 'g') then grads='true'
+
+print, '---------------------'
+print, 'init. please wait ...'
+print, '---------------------'
+
+;
+; init.
+;
+field1='' & field2='' & winds=['','']
+backup_data='no' & already_data='no'
+datafolder='./' & plotfolder='./'
+textitle='plot' & texcomments='plot'
+topo=0
+extract='yes' ;;a question is asked
+
+;
+; defining fields, coordinates, type of plot ... etc ...
+;
+@user.idl
+
+;
+; extracting/interpolating fields from WRF NETCDF files
+;
+if (typeplot eq 'g') then SPAWN, 'cp -f gw.def '+plotfolder+'/grads_gw.def'
+if (useidlfile eq 'true') then extract='no'
+if (extract eq 'yes') then begin
+	print, 'EXTRACT DATA. OK ?'
+        if (n_elements(dumb) eq 0) then begin  ;; give dumb in user.idl if one does not want to be asked questions !
+            if (grads ne 'true') then read, dumb, prompt='type 1 to proceed, 0 to keep the same input >>> ' else dumb=999
+        endif
+	if (dumb ne 0) then begin
+        	print, 'WE WILL EXTRACT DATA USING ARWPOST.EXE'
+		if (n_elements(nest) eq 0) then nest='d01'
+        	call_arwpost, nam1, nam2, nam3, nam4, nam5, tabnam, nest, datafolder, grads
+	endif 
+endif
+if (already_data eq 'yes') then begin
+	if (nam5 eq " interp_method = 0 ") then coord='model_level'
+	if ((nam5 eq " interp_method = 1 ") and (tabnam(0) lt tabnam(1))) then coord='height'
+        SPAWN, 'ln -sf  '+datafolder+'/'+coord+'.input.ctl input.ctl'
+        SPAWN, 'ln -sf  '+datafolder+'/'+coord+'.input.dat input.dat'
+endif
+
+;-----------------------------;
+; STARTING TO READ INPUT.CTL  ;
+;-----------------------------;
+
+;
+; get the local time
+;
+interv=0. & openr, 99, 'timefil' & readf,99,interv & close, 99
+
+;
+; get preliminar info on coordinates
+;
+wnx=1 & wny=1 & wnz=1 & wnt=1 & txt='' & param=[0.,0.,0.,0.,0.,0.,0.,0.]
+
+openr, 1, 'input.ctl'
+while not eof(1) do begin
+    readf,1,txt
+    match=STRPOS(txt,'linear')
+	if (match ne -1) then begin
+		wnx=(STRPOS(txt,'xdef') eq -1)*wnx  ;0 if linear
+		wny=(STRPOS(txt,'ydef') eq -1)*wny  ;0 if linear
+                wnz=(STRPOS(txt,'zdef') eq -1)*wnz  ;0 if linear 
+                wnt=(STRPOS(txt,'tdef') eq -1)*wnt  ;0 if linear
+                paramstart=STRSPLIT(txt, 'r', LENGTH=paramlength)
+        	paramchar=STRMID(txt,paramstart(1),paramlength(1))
+		READS, paramchar, start, step
+		param=param+[start*(STRPOS(txt,'xdef') ne -1),$
+			step*(STRPOS(txt,'xdef') ne -1),$
+			start*(STRPOS(txt,'ydef') ne -1),$
+			step*(STRPOS(txt,'ydef') ne -1),$
+			start*(STRPOS(txt,'zdef') ne -1),$
+			step*(STRPOS(txt,'zdef') ne -1),$
+			start*(STRPOS(txt,'tdef') ne -1),$
+			step*(STRPOS(txt,'tdef') ne -1)]
+	endif	
+endwhile
+close, 1
+timebegin=param(6)
+	
+
+;---------------------------------
+; READ .CTL FILE INFORMATIONS
+;---------------------------------
+
+info=read_ascii('input.ctl', missing_value=1e37)
+infodat=info.field1
+
+;
+; second column : dimensions
+;
+
+w=where((infodat(0,*) eq 1e37) and (infodat(1,*) lt 1e37))
+dimensions=reform(infodat(1,w))
+
+nx=round(dimensions(0)) & ny=round(dimensions(1)) 
+nz=round(dimensions(2)) & nt=round(dimensions(3)) 
+fields=round(dimensions(4)) & vertical=intarr(fields)
+for i=0,fields-1 do vertical(i)=round(dimensions(5+i))
+
+;
+; first column : coordinates
+;
+
+w=where((infodat(1,*) eq 1e37) and (infodat(0,*) lt 1e37))
+if (w(0) ne -1) then coordinates=reform(infodat(0,w))
+
+if (wnx ne 0) then begin
+
+	wnx=nx
+	x=coordinates(0:nx-1)
+
+endif else begin
+
+	xmin=param(0)
+	xmax=param(0)+param(1)*(nx-1) MOD 360
+	;inc=param(0)+param(1)*(nx-1)	;cas mercator
+	;x=start+inc*findgen(nx) 
+	x=xmin+(xmax-xmin)*findgen(nx)/(nx-1)
+	
+;param(1)=param(1)-param(0) ;;bricolo plot GCM
+;xmin=param(0)
+;xmax=param(0)+param(1)*(nx-1)
+;x=xmin+(xmax-xmin)*findgen(nx)/(nx-1)
+;;x = x - (LONG(x)/180)*360.0
+;print, x
+
+	;stop
+
+endelse
+
+
+if (wny ne 0) then begin
+        wny=ny
+	y=coordinates(wnx:wnx+wny-1)
+endif else begin
+        start=param(2)
+        step=param(3)
+        y=start+step*findgen(ny)
+endelse
+if (wnz ne 0) then begin
+        wnz=nz
+	z=coordinates(wnx+wny:wnx+wny+wnz-1)
+endif else begin
+        start=param(4)
+        step=param(5)
+        z=start+step*findgen(nz)
+endelse
+t=interv*findgen(nt)/3700. + timebegin + mean(x)/15.
+lct = round(t+24) MOD 24	
+	
+;
+; get info on fields
+;
+openr, 1, 'input.ctl'
+toto=5+wnx+1+wny+1+wnz+2+fields
+infofields=strarr(toto)
+readf, 1, infofields
+close, 1
+desc_field=transpose(infofields(toto-fields:toto-1))
+
+;
+; vert coord
+;
+if (z(0) lt z(1)) then coord='height'
+if (z(0) gt z(1)) then coord='pressure'
+if ((z(0) eq 1.) and (z(nz-1) eq (z(nz-2)+1.))) then coord='model_level'
+
+
+
+;---------------------------------
+; READ .DAT FILE DATA
+;---------------------------------
+; GrADS views gridded data sets as 5-dimensional arrays 
+; varying in longitude, latitude, vertical level, variable, and time.
+;---------------------------------
+
+;-----------------------------;
+; STARTING TO READ INPUT.DATA ;
+;-----------------------------;
+print, '----------------'
+print, 'reading data ...'
+print, '----------------'
+print, 'longitudes: ', min(x), max(x), nx, ' points'
+print, 'latitudes: ', min(y), max(y), ny, ' points' 
+print, 'altitudes: ', min(z), max(z), nz, ' points'
+print, 'local times: ', min(lct), max(lct), nt, ' points'
+print, fields, ' recorded fields :'
+print, desc_field
+print, '----------------'
+
+; see http://www.dfanning.com/tips/ascii_column_data.html	
+OPENR, lun, 'input.dat', /GET_LUN
+
+
+;
+; titles and plot name
+;
+denom=textitle+'_'+plot+'_'+coord+'_'+field1
+if ((field2 ne '') and (topo eq 0)) then denom=denom+'_'+field2
+if (topo eq 1) then denom=denom+'_HGT'
+if (winds(0) ne '') then denom=denom+'_'+winds(0)+winds(1)
+        case coord of
+	'height': charlev='Altitude (km)'
+	;'pressure': begin
+	;               H=10.
+	;               p0=6.1
+	;               z=H*alog(p0/z)
+	;               charlev='Log-Pressure altitude (km)'
+	;end
+	'model_level': charlev='Model level'
+	endcase
+																							
+
+;
+; graphics settings
+;
+!p.charthick = 2.0
+!p.thick = 3.0
+!x.thick = 2.0
+!y.thick = 2.0
+
+	; plot with topography
+	if (topo eq 1) then field2='HGT'
+
+save_ps='true' ;; hardwired
+;save_ps='false'
+if (save_ps eq 'false') then begin
+		;if (save_ps ne 'false') then begin
+		;	;set_plot, 'ps'
+		;endif else begin
+	set_plot, 'x'
+	!P.MULTI = [0, 2, 3]
+	window, 0, xsize=600, ysize=900
+		;endelse
+endif
+
+no3D='false'	
+;goto, yeye 
+print, 'GENERATE PLOTS ',min([nt-1,num-1])+1
+
+for l=0,min([nt-1,num-1]) do begin 	;time loop
+		print, '************************************************************************'
+		print, 'time loop ...', l+1, ' / ', string(nt,'(I0)')  
+		T = SYSTIME(1)
+	if (useidlfile eq 'true') then $
+		restore,filename=plotfolder+'/'+denom+string(1000+l,'(I0)')+'.idl' $
+	else begin
+  for f=0, fields-1 do begin ;fields (whether 2D or 3D)	;variable loop
+  nzf=vertical(f)
+  print, 'scanning field ...', f+1, ' / ', string(fields,'(I0)')
+
+	data = FLTARR(1,nzf*ny*nx)
+	print, 'read data ...'
+	READF, lun, data	;; the IDL way, two times faster than 3 FOR loops
+	print, 'read data done'
+	
+	recognize=STRSPLIT(desc_field(f), /EXTRACT)
+	recognize=recognize[0]
+	
+;	IF (STRPOS(desc_field(f),field1) ne -1) then begin
+;       IF ( ( STRPOS(desc_field(f),field1) eq 0 ) and ( STRLEN(desc_field(f)) eq STRLEN(field1) ) ) then begin
+	IF (recognize eq field1) then begin
+		data_save=data
+		print, 'found field1 ', field1
+		data=REFORM(data,nx,ny,nzf,/OVERWRITE)
+			w=where(data eq -9999.)	; missing values: -9999 (before, was 1e20)
+			if (w(0) ne -1) then data[w]=1e37
+		CASE (plot) OF
+		'map': what_I_plot=reform(data(*,*,-1+min([level,nzf])))
+		'meridional': what_I_plot=reform(data(-1+min([nlon,nx]),*,*))
+		'zonal': what_I_plot=reform(data(*,-1+min([nlat,ny]),*))
+		ENDCASE
+		if (nzf eq 1) then no3D='true'
+		data=0. & data=data_save & data_save=0.
+	ENDIF
+;	IF ((STRPOS(desc_field(f),field2) ne -1) and (field2 ne '')) then begin
+;       IF ((STRPOS(desc_field(f),field2) eq 0) and (field2 ne '')) then begin
+;       IF ( ( STRPOS(desc_field(f),field2) eq 0 ) and ( field2 ne '' ) and ( STRLEN(desc_field(f)) eq STRLEN(field2) ) ) then begin
+        IF (recognize eq field2) then begin
+		data_save=data
+		print, 'found field2 ', field2
+		if (topo eq 1) then begin
+			data=data/100.
+			data=round(data)
+			data=float(data)/10.
+		endif	
+		data=REFORM(data,nx,ny,nzf,/OVERWRITE)
+                        w=where(data eq -9999.)   ; missing values
+			if (w(0) ne -1) then data[w]=1e37
+		CASE (plot) OF
+		'map': overcontour=reform(data(*,*,-1+min([level,nzf])))
+		'meridional': overcontour=reform(data(-1+min([nlon,nx]),*,*))
+		'zonal': overcontour=reform(data(*,-1+min([nlat,ny]),*))
+		ENDCASE
+		data=0. & data=data_save & data_save=0.
+	ENDIF   
+;	IF (STRPOS(desc_field(f),winds(0)) ne -1 and (winds(0) ne '')) then begin
+;       IF (STRPOS(desc_field(f),winds(0)) eq 0 and (winds(0) ne '')) then begin
+	IF (recognize eq winds(0)) then begin
+		data_save=data
+		print, 'found wind1 ', winds(0)
+	        data=REFORM(data,nx,ny,nzf,/OVERWRITE)
+                        w=where(data eq -9999.)   ; missing values
+			if (w(0) ne -1) then data[w]=!Values.F_NAN
+		CASE (plot) OF
+                'map': overvector_x=reform(data(*,*,-1+min([level,nzf])))
+                'meridional': overvector_x=reform(data(-1+min([nlon,nx]),*,*))
+                'zonal': overvector_x=reform(data(*,-1+min([nlat,ny]),*))
+		ENDCASE
+		data=0. & data=data_save & data_save=0.
+	ENDIF 
+;	IF (STRPOS(desc_field(f),winds(1)) ne -1 and (winds(1) ne '')) then begin
+;       IF (STRPOS(desc_field(f),winds(1)) eq 0 and (winds(1) ne '')) then begin
+        IF (recognize eq winds(1)) then begin
+		data_save=data
+		print, 'found wind2 ', winds(1)
+		data=REFORM(data,nx,ny,nzf,/OVERWRITE)
+                        w=where(data eq -9999.)   ; missing values
+	                if (w(0) ne -1) then data[w]=!Values.F_NAN
+                CASE (plot) OF
+                'map': overvector_y=reform(data(*,*,-1+min([level,nzf])))
+                'meridional': overvector_y=reform(data(-1+min([nlon,nx]),*,*))
+                'zonal': overvector_y=reform(data(*,-1+min([nlat,ny]),*))
+                ENDCASE
+		data=0. & data=data_save & data_save=0.
+	ENDIF
+	data=0.		;; free memory
+	data_save=0.         ;; free memory
+	
+  endfor
+	  save, $
+	 	what_I_plot, $
+	        overcontour, overvector_x, overvector_y, $
+	 	x, y, z, lct, filename=plotfolder+'/'+denom+string(1000+l,'(I0)')+'.idl'
+	  endelse
+
+	if (n_elements(overcontour) eq 0) then overcontour=0.
+	if (n_elements(overvector_x) eq 0) then overvector_x=0.
+	if (n_elements(overvector_y) eq 0) then overvector_y=0.
+
+	@gw_name.idl
+
+;;--------------------------------------------------------
+;; NB: you can use the winds fields to combine variables
+;;--------------------------------------------------------
+@wind_stress.idl	;** WIND STRESS
+@sea_level.idl		;** HYDROSTATIC REDUCTION TO LEVEL OF REFERENCE
+;@ertel_vorticity.idl	;** ERTEL POTENTIAL VORTICITY
+@tau_cloud.idl          ;** CLOUD OPACITY
+@wind_velocity.idl	;** 3D WIND VELOCITY
+@hwind_velocity.idl	;** HORIZONTAL WIND VELOCITY 
+;what_I_plot=what_I_plot-median(what_I_plot)
+;;--------------------------------------------------------
+;; NB: you can use the winds fields to combine variables
+;;--------------------------------------------------------
+
+	title=title+', LT '+string(lct(l),'(I0)')
+
+;;--------------------------------------------------------
+;;--------------------------------------------------------
+;       getcdf, file='zefolder/wrfinput_d01', charvar='MARS_TI', invar=what_I_plot ;;; changer minfield et maxfield
+       ;;print, size(what_I_plot)
+       ;;getcdf, file='../WPS/geo_em.d01.nc', charvar='THERMAL_INERTIA', invar=yeyeye
+       ;;title = 'Thermal Inertia (J m!U-2!N s!U-0.5!N K!U-1!N)' & no3D='true' & pal=3 & format='(I0)'
+       ;;what_I_plot(2:153,2:153)=reform(yeyeye(*,*,0))
+       ;what_I_plot=reform(what_I_plot(*,*,0)) & help, what_I_plot
+;       getcdf, file='zefolder/wrfinput_d01', charvar='MARS_ALB', invar=what_I_plot ;;; changer minfield et maxfield
+;       title = 'Albedo' & no3D='true' & pal=1 & format='(F5.2)'
+;       what_I_plot=reform(what_I_plot(*,*,0)) & help, what_I_plot
+;;--------------------------------------------------------
+;;--------------------------------------------------------
+
+	if (save_ps ne 'false') then begin
+		save_ps=denom+string(1000+l,'(I0)')
+			;        device, filename=save_ps+'.ps', /color, bits=16
+		PS_Start, filename=save_ps+'.ps'
+                !P.Charsize = 1.2
+	endif
+
+;**************************
+smoothampl=2
+smoothampl=0 ;; no smooth
+;**************************
+
+	CASE (plot) OF
+	'map': begin
+        	case coord of
+		   'height': charlev=string(round(z(level-1)*1000.),'(I0)')+' m AMR'
+		   'pressure': charlev=string(round(z(level-1)*100.),'(I0)')+' Pa'
+		   'model_level': charlev=string(round(z(level-1)),'(I0)')
+		endcase
+        	if (no3D ne 'true') then title=title+', at level '+charlev
+		print, title
+	map_latlon, $
+		smooth(what_I_plot,[smoothampl,smoothampl],/EDGE_TRUNCATE), $	; 2D field
+        	x, $                                  ; 1D latitude
+        	y, $                                  ; 1D longitude
+        	minfield=0., $               ; minimum value of plotted field (=0: calculate)
+        	maxfield=0., $               ; maximum value of plotted field (=0: calculate)
+        	overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+        	overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+        	overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        	ct=pal, $                               ; color table (33-rainbow is default)
+        	colors=colors, $                        ; number of colors/levels (32 is default)
+        	title=title, $                     ; title of the plot ('' is default)
+        	format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+	end
+	'zonal': begin
+		displaylat=float(round(y(nlat-1)*10))/10.
+		title=title+ ', section at latitude '+string(displaylat,format='(1F6.1)')+ '!Uo!N '
+	        print, title
+	section, $
+		smooth(what_I_plot,[smoothampl,smoothampl],/EDGE_TRUNCATE), $   ; 2D field
+                x, $                                ; horizontal coordinate
+                z, $                             ; altitude coordinate
+                minfield=0., $               ; minimum value of plotted field (=0: calculate)
+                maxfield=0., $               ; maximum value of plotted field (=0: calculate)
+                minspace=0., $                    ; minimum value of space window (=0: calculate)
+                maxspace=0., $                    ; maximum value of space window (=0: calculate)
+                overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+                overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+                overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+                colors=colors, $                        ; number of colors/levels (32 is default)
+                title_plot=title, $                ; title of the plot ('Profile' is default)
+                title_axis=['Longitude',charlev], $             ; title of the [x,y] axis (['Field','Altitude'] is default)
+                ct=pal, $                               ; color table (33-rainbow is default)
+                format=format
+ 	end
+        'meridional': begin
+                displaylon=float(round(x(nlon-1)*10))/10.
+                title=title+', section at longitude '+string(displaylon,format='(1F6.1)')+ '!Uo!N '
+                print, title
+        section, $
+                smooth(what_I_plot,[smoothampl,smoothampl],/EDGE_TRUNCATE), $   ; 2D field
+                y, $                                ; horizontal coordinate
+                z, $                             ; altitude coordinate
+                minfield=0., $               ; minimum value of plotted field (=0: calculate)
+                maxfield=0., $               ; maximum value of plotted field (=0: calculate)
+                minspace=0., $                    ; minimum value of space window (=0: calculate)
+                maxspace=0., $                    ; maximum value of space window (=0: calculate)
+                overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+                overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+                overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+                colors=colors, $                        ; number of colors/levels (32 is default)
+                title_plot=title, $                ; title of the plot ('Profile' is default)
+                title_axis=['Latitude',charlev], $             ; title of the [x,y] axis (['Field','Altitude'] is default)
+                ct=pal, $                               ; color table (33-rainbow is default)
+                format=format
+        end
+ 	endcase	 
+
+PS_End, /PNG
+
+;		 if (save_ps ne 'false') then begin
+;	               device, /close
+;	;               SPAWN, './ps2png -a ; \rm '+save_ps+'.ps '+save_ps+'.eps '
+;	               SPAWN, './ps2png ; \rm '+save_ps+'.ps '+save_ps+'.eps '
+	               if (typeplot eq 's') then begin
+	                 SPAWN, 'display '+save_ps+'.png &'
+	               endif 
+;	         endif
+
+;PRINT, 1000*(SYSTIME(1) - T), ' milliSeconds'
+PRINT, SYSTIME(1) - T, ' seconds to process'
+endfor
+
+CLOSE, lun
+print, '...done !'
+help, /memory
+print, '---------'
+
+
+yeye:
+
+CASE (typeplot) OF
+;'g': begin
+;        SPAWN, 'cp -f gw.def '+plotfolder+'/grads_'+denom+'.def' 
+;end
+'s': begin
+	;SPAWN, 'find '+denom+'????.ps -exec display {} \;'
+	SPAWN, 'cp -f gw.def '+plotfolder+'/see_'+denom+'.def' ; \rm ./'+denom+'????.ps ./'+denom+'????.eps ' ;;./'+denom+'????.png'
+end
+'t': begin
+	SPAWN, 'mv -f ./'+denom+'????.ps ./'+denom+'????.png '+plotfolder+'/'
+	SPAWN, 'cp -f gw.def '+plotfolder+'/'+denom+'.def'
+end
+'r': begin
+	SPAWN, 'touch report.comments ; \rm report.comments ; echo '+textitle+' > report.comments ; echo '+texcomments+' >> report.comments'
+	SPAWN, 'rm -f '+denom+'_.ps ; echo executing ... base '+denom+'????.ps < report.comments'
+	SPAWN, 'base '+denom+'????.ps < report.comments ; mv -f base.ps '+denom+'_.ps'
+
+	SPAWN, 'mv -f ./'+denom+'????.ps '+plotfolder+'/'
+	SPAWN, 'mv -f ./'+denom+'_.ps '+plotfolder+'/'
+	SPAWN, 'cp -f gw.def '+plotfolder+'/'+denom+'.def'
+end
+'m': begin
+	print, 'generating movie ...'
+	SPAWN, 'rm -rf temp ; mkdir temp ; mv -f '+denom+'????.ps temp ; cp bigconvert200 temp ; cd temp'
+	SPAWN, 'bigconvert200 *.ps ; convert -delay 60 *.png movie.gif ; cd ..'
+	if (nomovie ne 'yes') then SPAWN, 'animate temp/movie.gif &' 
+	print, 'movie done'
+
+	SPAWN, 'mv -f temp/'+denom+'????.ps '+plotfolder+'/'
+	SPAWN, 'mv -f temp/movie.gif '+plotfolder+'/'+denom+'.gif'
+	SPAWN, 'mv -f temp/'+denom+'????.png '+plotfolder+'/'
+	SPAWN, 'cp -f gw.def '+plotfolder+'/'+denom+'.def'
+end
+'w': begin
+;
+;
+netfolder='/u/aslmd/WWW/ANIMATIONS/'
+;netfolder='/home/aslmd/'
+;
+; set also textitle
+;
+        ;print, 'generating frames ...'
+	;;        SPAWN, 'rm -rf temp ; mkdir temp ; mv -f '+denom+'????.ps temp/ ; ls temp/'
+	;;;        SPAWN, "find temp/* -exec convert -antialias -density 100x100 -crop 0x0 {} '{}.png' \;"
+	;;SPAWN, "cd temp ; ../ps2png ; cd .."
+	;;	SPAWN, 'ls temp/'
+	;;        ;SPAWN, 'mv -f temp/'+denom+'????.ps '+plotfolder+'/'
+        ;SPAWN, 'cp -f gw.def '+plotfolder+'/web_'+denom+'.def'
+	;;; webpage
+	;;SPAWN, 'rm -rf '+netfolder+textitle+'_'+denom+' ; mkdir '+netfolder+textitle+'_'+denom
+	;SPAWN, 'mkdir '+netfolder+textitle
+	;;SPAWN, 'mv -f temp/'+denom+'????.png '+netfolder+textitle+'/'
+	;SPAWN, 'mv -f temp/'+denom+'????.png '+netfolder+textitle+'/'
+	;SPAWN, 'chmod 777 -R '+netfolder+textitle
+	;SPAWN, 'rm -rf '+denom+'.html ; more header.html > '+textitle+'_'+denom+'.html'
+	;genanim, num, textitle, denom 
+	;SPAWN, 'more templist >> '+textitle+'_'+denom+'.html ; rm -rf templist'
+	;SPAWN, 'more body.html >> '+textitle+'_'+denom+'.html'
+	;SPAWN, 'mv -f '+textitle+'_'+denom+'.html '+netfolder+'/'
+
+   print, 'generating frames ...'
+   cmd = 'echo unix'
+   cmd = cmd + ' ; cp -f gw.def '+plotfolder+'/web_'+denom+'.def'
+   ;;; webpage
+   ;cmd = cmd + ' ; mkdir '+netfolder+textitle
+   cmd = cmd + ' ; mv -f ./'+denom+'????.png '+netfolder+'/' ;+textitle+'/'
+   ;cmd = cmd + ' ; chmod 777 -R '+netfolder+textitle
+   cmd = cmd + ' ; rm -rf '+denom+'.html ; cat header.html > '+denom+'.html'
+   SPAWN, cmd
+   genanim, num, textitle, denom 
+   cmd = 'echo unix'
+   cmd = cmd + ' ; cat templist >> '+denom+'.html ; rm -rf templist'
+   cmd = cmd + ' ; cat body.html >> '+denom+'.html'
+   cmd = cmd + ' ; mv -f '+denom+'.html '+netfolder+'/'
+   cmd = cmd + ' ; rm -rf ./*.epsi ./*.ps'
+   SPAWN, cmd
+
+end	
+ENDCASE
+
+if (backup_data eq 'yes') then SPAWN, 'cp -f namelist.ARWpost '+datafolder+'/'+coord+'.namelist.ARWpost'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.ctl '+datafolder+'/'+coord+'.input.ctl'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.dat '+datafolder+'/'+coord+'.input.dat'
+
+
+
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/ARWpost/gw_name.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/ARWpost/gw_name.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/ARWpost/gw_name.idl	(revision 207)
@@ -0,0 +1,103 @@
+;
+; FILL HERE SOME FIELD-DEPENDENT SETTINGS 
+;
+
+case field1 of
+'HGT': begin 
+        title='Topography (km)'
+        pal=16
+        format='(F7.0)'
+	what_I_plot=what_I_plot/1000.
+end
+'tk': begin
+        title='Temperature (K)'
+        pal=3
+        format='(F4.0)'
+end
+'TSURF': begin
+        title='Surface Temperature (K)'
+        pal=3
+	format='(F4.0)'
+	no3D='true'
+end
+'U': begin
+        title='Zonal wind (!Nm!N.s!U-1!N)'
+        if (winds(0) eq 'U') then title='Wind field (!Nm!N.s!U-1!N)'
+        pal=33
+end
+'V': begin
+        title='Meridional wind (!Nm!N.s!U-1!N)'
+        if (winds(0) eq 'V') then title='Wind field (!Nm!N.s!U-1!N)'
+        pal=33
+end
+'T': begin
+	print, 'coucou'
+	what_I_plot = what_I_plot + 220.
+	title='Potential temperature (K)'
+end
+'W': begin
+        title='Vertical wind (!Nm!N.s!U-1!N)'
+        pal=33  ;;pal=16
+        format='(F6.2)'
+end
+'ICETOT': begin
+	title='Water ice column (!7l!3m-pr)'
+	pal=22
+	format='(F5.1)'
+	what_I_plot=what_I_plot*1000.
+end
+'MTOT': begin
+        title='Water vapor column (!7l!3m-pr)'
+        pal=22
+        format='(F5.1)'
+        what_I_plot=what_I_plot*1000.
+end
+'RAVE': begin
+	title='Average water ice radius (!7l!3m)'
+	pal=22
+	format='(F5.1)'
+	what_I_plot=what_I_plot*1e6
+end
+'RICE': begin
+        title='Water ice radius (!7l!3m)'
+        pal=22
+        format='(F5.1)'
+        what_I_plot=what_I_plot*1e6
+end
+'QH2O': begin
+        title='Water vapor mixing ratio (ppm)'
+        pal=33
+        format='(F5.1)'
+	format='(I0)'
+        what_I_plot=what_I_plot*1e6
+end
+'QH2O_ICE': begin
+        title='Water ice mixing ratio (ppm)'
+        pal=22
+        format='(F5.1)'
+        format='(I0)'
+        what_I_plot=what_I_plot*1e6
+end
+'USTM': begin
+        title='Friction velocity (!Nm!N.s!U-1!N)'
+        pal=22
+        format='(F4.2)'
+        no3D='true'
+end
+else: begin
+	title=''
+	pal=33
+	format='(F6.2)'
+end
+endcase
+
+case field2 of
+'T': begin
+        overcontour = overcontour + 220.
+end
+;'HGT': begin
+;	overcontour = overcontour/1000.
+;end
+else:
+endcase
+
Index: trunk/MESOSCALE_DEV/PLOT/ARWpost/gwc
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/ARWpost/gwc	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/ARWpost/gwc	(revision 207)
@@ -0,0 +1,47 @@
+
+;
+; every time you modify gw.def, launch @gwc
+;
+
+
+;
+; START FROM SCRATCH
+;
+.reset_session
+
+
+;
+; USER PARAMETERS
+;
+print, 'reading user parameters ...'
+SPAWN, 'touch user.idl ; \rm user.idl ; grep -v grep gw.def > user.idl'
+@user.idl
+
+
+;
+; PLOT PARAMETERS
+;
+what_to_do='\rm param_plot.idl ; grep grepALL gw.def > param_plot.idl'
+
+if ((plot eq 'meridional') or (plot eq 'zonal')) then what_to_do=what_to_do+' ; grep grepSEC gw.def >> param_plot.idl'
+if (plot eq 'map') then what_to_do=what_to_do+' ; grep grepMAP gw.def >> param_plot.idl'
+
+SPAWN, what_to_do
+
+SPAWN, 'grep nam2 gw.def >> param_plot.idl'
+
+print, 'done !'
+
+
+;;;SPAWN, '\rm param_plot.idl ; grep grepALL gw.def > param_plot.idl'
+;;;if ((plot eq 'meridional') or (plot eq 'zonal')) then SPAWN, 'grep grepSEC gw.def >> param_plot.idl'
+;;;if (plot eq 'map') then SPAWN, 'grep grepMAP gw.def >> param_plot.idl'
+
+
+
+;
+; ALWAYS RE-COMPILE
+;
+.compile gw
+.compile map_latlon
+.compile section
Index: trunk/MESOSCALE_DEV/PLOT/ARWpost/namelist.ARWpost_ref
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/ARWpost/namelist.ARWpost_ref	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/ARWpost/namelist.ARWpost_ref	(revision 207)
@@ -0,0 +1,13 @@
+&io
+!------------------------------------------------------------------------------------
+! do not modify
+!------------------------------------------------------------------------------------
+ io_form_input  = 2,
+ input_root_name = './zefolder/wrfout_zenest'
+ output_root_name = './input'
+ plot = 'list'
+ output_type = 'idl'          !**** or choose 'grads' 
+ mercator_defs = .true.       !**** choose false if grads 
+!------------------------------------------------------------------------------------
+! end do not modify
+!------------------------------------------------------------------------------------
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/README
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/README	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/README	(revision 207)
@@ -0,0 +1,30 @@
+launch
+
+idl> example
+
+[before: cp param_plot.idl.minimal param_plot.idl]
+
+----
+
+I/O
+
+input: IDL save file example.idl
+output: ps and png figure
+
+----
+
+routines
+
+map_latlon.pro: to plot the fields
+param_plot.idl: settings for the plot (not compulsory)
+example.pro: main routine
+
+colorbar.pro, plot_vector.pro, vector.pro: needed by map_latlon.pro (from Coyote IDL and IDL for meteorology, slightly modified)
+fsc/*: to have nice postscript files (from Coyote IDL, slightly modified)(not compulsory, just have to change example.pro and use set_plot)
+
+
+added:
+profile
+section
+getcdf
+reverse_ct
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/colorbar.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/colorbar.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/colorbar.pro	(revision 207)
@@ -0,0 +1,474 @@
+;+
+; NAME:
+;   COLORBAR
+;
+; PURPOSE:
+;
+;       The purpose of this routine is to add a color bar to the current
+;       graphics window.
+;
+; AUTHOR:
+;
+;   FANNING SOFTWARE CONSULTING
+;   David Fanning, Ph.D.
+;   1645 Sheely Drive
+;   Fort Collins, CO 80526 USA
+;   Phone: 970-221-0438
+;   E-mail: davidf@dfanning.com
+;   Coyote's Guide to IDL Programming: http://www.dfanning.com/
+;
+; CATEGORY:
+;
+;       Graphics, Widgets.
+;
+; CALLING SEQUENCE:
+;
+;       COLORBAR
+;
+; INPUTS:
+;
+;       None.
+;
+; KEYWORD PARAMETERS:
+;
+;       ANNOTATECOLOR: The name of the "annotation color" to use. The names are those for
+;                     FSC_COLOR, and using the keyword implies that FSC_COLOR is also in
+;                     your !PATH. If this keyword is used, the annotation color is loaded
+;                     *after* the color bar is displayed. The color will be represented
+;                     as theColor = FSC_COLOR(ANNOTATECOLOR, COLOR). This keyword is provide
+;                     to maintain backward compatibility, but also to solve the problem of
+;                     and extra line in the color bar when this kind of syntax is used in
+;                     conjunction with the indexed (DEVICE, DECOMPOSED=0) model is used:
+;
+;                          LoadCT, 33
+;                          TVImage, image
+;                          Colorbar, Color=FSC_Color('firebrick')
+;
+;                     The proper syntax for device-independent color is like this:
+;
+;                          LoadCT, 33
+;                          TVImage, image
+;                          Colorbar, AnnotateColor='firebrick', Color=255
+;
+;       BOTTOM:       The lowest color index of the colors to be loaded in
+;                     the bar.
+;
+;       CHARSIZE:     The character size of the color bar annotations. Default is !P.Charsize.
+;
+;       COLOR:        The color index of the bar outline and characters. Default
+;                     is !P.Color..
+;
+;       DIVISIONS:    The number of divisions to divide the bar into. There will
+;                     be (divisions + 1) annotations. The default is 6.
+;
+;       FONT:         Sets the font of the annotation. Hershey: -1, Hardware:0, True-Type: 1.
+;
+;       FORMAT:       The format of the bar annotations. Default is '(I0)'.
+;
+;       INVERTCOLORS: Setting this keyword inverts the colors in the color bar.
+;
+;       MAXRANGE:     The maximum data value for the bar annotation. Default is
+;                     NCOLORS.
+;
+;       MINRANGE:     The minimum data value for the bar annotation. Default is 0.
+;
+;       MINOR:        The number of minor tick divisions. Default is 2.
+;
+;       NCOLORS:      This is the number of colors in the color bar.
+;
+;       NODISPLAY:    COLORBAR uses FSC_COLOR to specify some of it colors. Normally, 
+;                     FSC_COLOR loads "system" colors as part of its palette of colors.
+;                     In order to do so, it has to create an IDL widget, which in turn 
+;                     has to make a connection to the windowing system. If your program 
+;                     is being run without a window connection, then this program will 
+;                     fail. If you can live without the system colors (and most people 
+;                     don't even know they are there, to tell you the truth), then setting 
+;                     this keyword will keep them from being loaded, and you can run
+;                     COLORBAR without a display.
+;
+;       POSITION:     A four-element array of normalized coordinates in the same
+;                     form as the POSITION keyword on a plot. Default is
+;                     [0.88, 0.10, 0.95, 0.90] for a vertical bar and
+;                     [0.10, 0.88, 0.90, 0.95] for a horizontal bar.
+;
+;       RANGE:        A two-element vector of the form [min, max]. Provides an
+;                     alternative way of setting the MINRANGE and MAXRANGE keywords.
+;
+;       REVERSE:      Setting this keyword reverses the colors in the colorbar.
+;
+;       RIGHT:        This puts the labels on the right-hand side of a vertical
+;                     color bar. It applies only to vertical color bars.
+;
+;       TICKNAMES:    A string array of names or values for the tick marks.
+;
+;       TITLE:        This is title for the color bar. The default is to have
+;                     no title.
+;
+;       TOP:          This puts the labels on top of the bar rather than under it.
+;                     The keyword only applies if a horizontal color bar is rendered.
+;
+;       VERTICAL:     Setting this keyword give a vertical color bar. The default
+;                     is a horizontal color bar.
+;
+; COMMON BLOCKS:
+;
+;       None.
+;
+; SIDE EFFECTS:
+;
+;       Color bar is drawn in the current graphics window.
+;
+; RESTRICTIONS:
+;
+;       The number of colors available on the graphics display device (not the
+;       PostScript device) is used unless the NCOLORS keyword is used.
+;
+;       Requires the FSC_COLOR program from the Coyote Library:
+;
+;          http://www.dfanning.com/programs/fsc_color.pro
+;
+; EXAMPLE:
+;
+;       To display a horizontal color bar above a contour plot, type:
+;
+;       LOADCT, 5, NCOLORS=100
+;       CONTOUR, DIST(31,41), POSITION=[0.15, 0.15, 0.95, 0.75], $
+;          C_COLORS=INDGEN(25)*4, NLEVELS=25
+;       COLORBAR, NCOLORS=100, POSITION=[0.15, 0.85, 0.95, 0.90]
+;
+; MODIFICATION HISTORY:
+;
+;       Written by: David W. Fanning, 10 JUNE 96.
+;       10/27/96: Added the ability to send output to PostScript. DWF
+;       11/4/96: Substantially rewritten to go to screen or PostScript
+;           file without having to know much about the PostScript device
+;           or even what the current graphics device is. DWF
+;       1/27/97: Added the RIGHT and TOP keywords. Also modified the
+;            way the TITLE keyword works. DWF
+;       7/15/97: Fixed a problem some machines have with plots that have
+;            no valid data range in them. DWF
+;       12/5/98: Fixed a problem in how the colorbar image is created that
+;            seemed to tickle a bug in some versions of IDL. DWF.
+;       1/12/99: Fixed a problem caused by RSI fixing a bug in IDL 5.2. Sigh... DWF.
+;       3/30/99: Modified a few of the defaults. DWF.
+;       3/30/99: Used NORMAL rather than DEVICE coords for positioning bar. DWF.
+;       3/30/99: Added the RANGE keyword. DWF.
+;       3/30/99: Added FONT keyword. DWF
+;       5/6/99: Many modifications to defaults. DWF.
+;       5/6/99: Removed PSCOLOR keyword. DWF.
+;       5/6/99: Improved error handling on position coordinates. DWF.
+;       5/6/99. Added MINOR keyword. DWF.
+;       5/6/99: Set Device, Decomposed=0 if necessary. DWF.
+;       2/9/99: Fixed a problem caused by setting BOTTOM keyword, but not NCOLORS. DWF.
+;       8/17/99. Fixed a problem with ambiguous MIN and MINOR keywords. DWF
+;       8/25/99. I think I *finally* got the BOTTOM/NCOLORS thing sorted out. :-( DWF.
+;       10/10/99. Modified the program so that current plot and map coordinates are
+;            saved and restored after the colorbar is drawn. DWF.
+;       3/18/00. Moved a block of code to prevent a problem with color decomposition. DWF.
+;       4/28/00. Made !P.Font default value for FONT keyword. DWF.
+;       9/26/00. Made the code more general for scalable pixel devices. DWF.
+;       1/16/01. Added INVERTCOLORS keyword. DWF.
+;       5/11/04. Added TICKNAME keyword. DWF.
+;       9/29/05. Added REVERSE keywords, which does the *exact* same thing as
+;           INVERTCOLORS, but I can never remember the latter keyword name. DWF.
+;       1/2/07. Added ANNOTATECOLOR keyword. DWF.
+;       4/14/07. Changed the default FORMAT to I0. DWF.
+;       5/1/07. Unexpected consequence of default format change is colorbar annotations
+;           no longer match contour plot levels. Changed to explicit formating of
+;           colorbar axis labels before PLOT command. DWF.
+;       5/25/07. Previous change has unanticipated effect on color bars using
+;           logarithmic scaling, which is not really supported, but I have an
+;           article on my web page describing how to do it: http://www.dfanning.com/graphics_tips/logcb.html.
+;           Thus, I've fixed the program to accommodate log scaling, while still not OFFICIALLY
+;           supporting it. DWF.
+;       10/3/07. Method used to calculate TICKNAMES produces incorrect values in certain cases when
+;           the min and max range values are integers. Now force range values to be floats. DWF.
+;       10/17/07. Accidentaly use of INTERP keyword in CONGRID results in wrong bar values for
+;           low NCOLORS numbers when INVERTCOLORS or REVERSE keyword is used. Removed INTERP keyword. DWF.
+;       11/10/07. Finished fixing program to accommodate log scaling in ALL possible permutations. DWF.
+;       8 Feb 2008. Added CRONJOB keyword and decided to use month names when I write the date. DWF.
+;       8 Feb 2008. Renamed CRONJOB to NODISPLAY to better reflect its purpose. DWF.
+;      21 May 2008. Changed the default CHARSIZE to !P.CHARSIZE from 1.0. DWF.
+;-
+;
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright 2000-2008 Fanning Software Consulting.
+;
+; This software is provided "as-is", without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose, including commercial applications, and to alter it and
+; redistribute it freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product, an acknowledgment in the product documentation
+;    would be appreciated, but is not required.
+;
+; 2. Altered source versions must be plainly marked as such, and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software, visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+
+
+PRO COLORBAR, BOTTOM=bottom, CHARSIZE=charsize, COLOR=color, DIVISIONS=divisions, $
+   FORMAT=format, POSITION=position, MAXRANGE=maxrange, MINRANGE=minrange, NCOLORS=ncolors, $
+   TITLE=title, VERTICAL=vertical, TOP=top, RIGHT=right, MINOR=minor, $
+   RANGE=range, FONT=font, TICKLEN=ticklen, _EXTRA=extra, INVERTCOLORS=invertcolors, $
+   TICKNAMES=ticknames, REVERSE=reverse, ANNOTATECOLOR=annotatecolor, XLOG=xlog, YLOG=ylog, $
+   NODISPLAY=nodisplay
+
+    compile_opt idl2
+
+    ; Return to caller on error.
+    On_Error, 2
+
+    ; Save the current plot state.
+    bang_p = !P
+    bang_x = !X
+    bang_Y = !Y
+    bang_Z = !Z
+    bang_Map = !Map
+
+    ; Are scalable pixels available on the device?
+    IF (!D.Flags AND 1) NE 0 THEN scalablePixels = 1 ELSE scalablePixels = 0
+
+    ; Which release of IDL is this?
+    thisRelease = Float(!Version.Release)
+
+    ; Check and define keywords.
+    IF N_ELEMENTS(ncolors) EQ 0 THEN BEGIN
+
+       ; Most display devices to not use the 256 colors available to
+       ; the PostScript device. This presents a problem when writing
+       ; general-purpose programs that can be output to the display or
+       ; to the PostScript device. This problem is especially bothersome
+       ; if you don't specify the number of colors you are using in the
+       ; program. One way to work around this problem is to make the
+       ; default number of colors the same for the display device and for
+       ; the PostScript device. Then, the colors you see in PostScript are
+       ; identical to the colors you see on your display. Here is one way to
+       ; do it.
+
+       IF scalablePixels THEN BEGIN
+          oldDevice = !D.NAME
+
+             ; What kind of computer are we using? SET_PLOT to appropriate
+             ; display device.
+
+          thisOS = !VERSION.OS_FAMILY
+          thisOS = STRMID(thisOS, 0, 3)
+          thisOS = STRUPCASE(thisOS)
+          CASE thisOS of
+             'MAC': SET_PLOT, thisOS
+             'WIN': SET_PLOT, thisOS
+             ELSE: SET_PLOT, 'X'
+          ENDCASE
+
+          ; Here is how many colors we should use.
+          ncolors = !D.TABLE_SIZE
+          SET_PLOT, oldDevice
+        ENDIF ELSE ncolors = !D.TABLE_SIZE
+    ENDIF
+    IF N_ELEMENTS(bottom) EQ 0 THEN bottom = 0B
+    IF N_ELEMENTS(charsize) EQ 0 THEN charsize = !P.Charsize
+    IF N_ELEMENTS(format) EQ 0 THEN format = '(I0)'
+    IF N_ELEMENTS(color) EQ 0 THEN color = !P.Color
+    minrange = (N_ELEMENTS(minrange) EQ 0) ? 0. : Float(minrange)
+    maxrange = (N_ELEMENTS(maxrange) EQ 0) ? Float(ncolors) : Float(maxrange)
+    IF N_ELEMENTS(ticklen) EQ 0 THEN ticklen = 0.2
+    IF N_ELEMENTS(minor) EQ 0 THEN minor = 2
+    IF N_ELEMENTS(range) NE 0 THEN BEGIN
+       minrange = Float(range[0])
+       maxrange = Float(range[1])
+    ENDIF
+    IF N_ELEMENTS(divisions) EQ 0 THEN divisions = 6
+    IF N_ELEMENTS(font) EQ 0 THEN font = !P.Font
+    IF N_ELEMENTS(title) EQ 0 THEN title = ''
+    xlog = Keyword_Set(xlog)
+    ylog = Keyword_Set(ylog)
+
+    ; You can't have a format set *and* use ticknames.
+    IF N_ELEMENTS(ticknames) NE 0 THEN format = ""
+
+    ; If the format is NOT null, then format the ticknames yourself.
+    IF (xlog XOR ylog) EQ 0 THEN BEGIN
+        IF format NE "" THEN BEGIN
+           step = (maxrange - minrange) / divisions
+           levels = minrange > (Indgen(divisions+1) * step + minrange) < maxrange
+           IF StrPos(StrLowCase(format), 'i') NE -1 THEN levels = Round(levels)
+           ticknames = String(levels, Format=format)
+           format = "" ; No formats allowed in PLOT call now that we have ticknames.
+        ENDIF
+    ENDIF
+
+    IF KEYWORD_SET(vertical) THEN BEGIN
+       bar = REPLICATE(1B,20) # BINDGEN(ncolors)
+       IF Keyword_Set(invertcolors) THEN bar = Reverse(bar, 2)
+       IF N_ELEMENTS(position) EQ 0 THEN BEGIN
+          position = [0.88, 0.1, 0.95, 0.9]
+       ENDIF ELSE BEGIN
+          IF position[2]-position[0] GT position[3]-position[1] THEN BEGIN
+             position = [position[1], position[0], position[3], position[2]]
+          ENDIF
+          IF position[0] GE position[2] THEN Message, "Position coordinates can't be reconciled."
+          IF position[1] GE position[3] THEN Message, "Position coordinates can't be reconciled."
+       ENDELSE
+    ENDIF ELSE BEGIN
+       bar = BINDGEN(ncolors) # REPLICATE(1B, 20)
+       IF Keyword_Set(invertcolors) THEN bar = Reverse(bar, 1)
+       IF N_ELEMENTS(position) EQ 0 THEN BEGIN
+          position = [0.1, 0.88, 0.9, 0.95]
+       ENDIF ELSE BEGIN
+          IF position[3]-position[1] GT position[2]-position[0] THEN BEGIN
+             position = [position[1], position[0], position[3], position[2]]
+          ENDIF
+          IF position[0] GE position[2] THEN Message, "Position coordinates can't be reconciled."
+          IF position[1] GE position[3] THEN Message, "Position coordinates can't be reconciled."
+       ENDELSE
+    ENDELSE
+
+    ; Scale the color bar.
+     bar = BYTSCL(bar, TOP=(ncolors-1) < (255-bottom)) + bottom
+
+     IF Keyword_Set(reverse) THEN BEGIN
+       IF Keyword_Set(vertical) THEN bar = Reverse(bar,2) ELSE bar = Reverse(bar,1)
+     ENDIF
+
+    ; Get starting locations in NORMAL coordinates.
+    xstart = position[0]
+    ystart = position[1]
+
+    ; Get the size of the bar in NORMAL coordinates.
+    xsize = (position[2] - position[0])
+    ysize = (position[3] - position[1])
+
+    ; Display the color bar in the window. Sizing is
+    ; different for PostScript and regular display.
+    IF scalablePixels THEN BEGIN
+
+       TV, bar, xstart, ystart, XSIZE=xsize, YSIZE=ysize, /Normal
+
+    ENDIF ELSE BEGIN
+
+       bar = CONGRID(bar, CEIL(xsize*!D.X_VSize), CEIL(ysize*!D.Y_VSize))
+
+       ; Decomposed color off if device supports it.
+       CASE  StrUpCase(!D.NAME) OF
+            'X': BEGIN
+                IF thisRelease GE 5.2 THEN Device, Get_Decomposed=thisDecomposed
+                Device, Decomposed=0
+                ENDCASE
+            'WIN': BEGIN
+                IF thisRelease GE 5.2 THEN Device, Get_Decomposed=thisDecomposed
+                Device, Decomposed=0
+                ENDCASE
+            'MAC': BEGIN
+                IF thisRelease GE 5.2 THEN Device, Get_Decomposed=thisDecomposed
+                Device, Decomposed=0
+                ENDCASE
+            ELSE:
+       ENDCASE
+
+       TV, bar, xstart, ystart, /Normal
+
+       ; Restore Decomposed state if necessary.
+       CASE StrUpCase(!D.NAME) OF
+          'X': BEGIN
+             IF thisRelease GE 5.2 THEN Device, Decomposed=thisDecomposed
+             ENDCASE
+          'WIN': BEGIN
+             IF thisRelease GE 5.2 THEN Device, Decomposed=thisDecomposed
+             ENDCASE
+          'MAC': BEGIN
+             IF thisRelease GE 5.2 THEN Device, Decomposed=thisDecomposed
+             ENDCASE
+          ELSE:
+       ENDCASE
+
+    ENDELSE
+
+    ; Annotate the color bar.
+    IF N_Elements(annotateColor) NE 0 THEN $
+      color = FSC_Color(annotateColor, color, NODISPLAY=Keyword_Set(nodisplay))
+
+;SPIGA
+;SPIGA
+loadct, 0, /silent
+color=0
+
+
+    IF KEYWORD_SET(vertical) THEN BEGIN
+
+       IF KEYWORD_SET(right) THEN BEGIN
+
+          PLOT, [minrange,maxrange], [minrange,maxrange], /NODATA, XTICKS=1, $
+             YTICKS=divisions, XSTYLE=1, YSTYLE=9, $
+             POSITION=position, COLOR=color, CHARSIZE=charsize, /NOERASE, $
+             XTICKFORMAT='(A1)', YTICKFORMAT='(A1)', YMINOR=minor, _EXTRA=extra, $
+             YTICKNAME=ticknames, FONT=font, YLOG=ylog
+
+          AXIS, YAXIS=1, YRANGE=[minrange, maxrange], YTICKFORMAT=format, YTICKS=divisions, $
+             YTICKLEN=ticklen, YSTYLE=1, COLOR=color, CHARSIZE=charsize, $
+             FONT=font, YTITLE=title, _EXTRA=extra, YMINOR=minor, YTICKNAME=ticknames, YLOG=ylog
+
+       ENDIF ELSE BEGIN
+
+          PLOT, [minrange,maxrange], [minrange,maxrange], /NODATA, XTICKS=1,  $
+             YTICKS=divisions, YSTYLE=1, XSTYLE=1, TITLE=title, $
+             POSITION=position, COLOR=color, CHARSIZE=charsize, /NOERASE, $
+             XTICKFORMAT='(A1)', YTICKFORMAT=format, YMinor=minor, _EXTRA=extra, $
+             YTICKNAME=ticknames, YLOG=ylog, YTICKLEN=ticklen
+
+       ENDELSE
+
+    ENDIF ELSE BEGIN
+
+       IF KEYWORD_SET(top) THEN BEGIN
+
+          PLOT, [minrange,maxrange], [minrange,maxrange], /NODATA, XTICKS=divisions, $
+             YTICKS=1, XSTYLE=9, YSTYLE=1, $
+             POSITION=position, COLOR=color, CHARSIZE=charsize, /NOERASE, $
+             YTICKFORMAT='(A1)', XTICKFORMAT='(A1)', XTICKLEN=ticklen, $
+             XRANGE=[minrange, maxrange], FONT=font, XMINOR=minor,_EXTRA=extra, $
+             XTICKNAME=ticknames, XLOG=xlog
+
+          AXIS, XTICKS=divisions, XSTYLE=1, COLOR=color, CHARSIZE=charsize, $
+             XTICKFORMAT=format, XTICKLEN=ticklen, XRANGE=[minrange, maxrange], XAXIS=1, $
+             FONT=font, XTITLE=title, _EXTRA=extra, XCHARSIZE=charsize, XMINOR=minor, $
+             XTICKNAME=ticknames, XLOG=xlog
+
+       ENDIF ELSE BEGIN
+
+          PLOT, [minrange,maxrange], [minrange,maxrange], /NODATA, XTICKS=divisions, $
+             YTICKS=1, XSTYLE=1, YSTYLE=1, TITLE=title, $
+             POSITION=position, COLOR=color, CHARSIZE=charsize, /NOERASE, $
+             YTICKFORMAT='(A1)', XTICKFORMAT=format, XTICKLEN=ticklen, $
+             XRANGE=[minrange, maxrange], FONT=font, XMinor=minor, _EXTRA=extra, $
+             XTICKNAME=ticknames, XLOG=xlog
+
+        ENDELSE
+
+    ENDELSE
+
+    ; Restore the previous plot and map system variables.
+    !P = bang_p
+    !X = bang_x
+    !Y = bang_y
+    !Z = bang_z
+    !Map = bang_map
+
+END
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/dbltostr.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/dbltostr.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/dbltostr.pro	(revision 207)
@@ -0,0 +1,1 @@
+link fsc/dbltostr.pro
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/error_message.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/error_message.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/error_message.pro	(revision 207)
@@ -0,0 +1,1 @@
+link fsc/error_message.pro
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/example.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/example.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/example.pro	(revision 207)
@@ -0,0 +1,26 @@
+
+pro example
+
+name='example'
+PS_Start, filename=name+'.ps'
+!P.Charsize = 1.2
+
+restore, filename='example.idl'
+
+map_latlon, $
+            what_I_plot, $   			  ; 2D field
+            x, $                                  ; 1D latitude
+            y, $                                  ; 1D longitude
+            minfield=0., $                	  ; minimum value of plotted field (=0: calculate)
+            maxfield=0., $               	  ; maximum value of plotted field (=0: calculate)
+            overcontour=overcontour, $            ; another 2D field to overplot with contour lines (=0: no)
+            overvector_x=overvector_x, $          ; wind vector - x component (=0: no)
+            overvector_y=overvector_y, $          ; wind vector - y component (=0: no)
+            ct=pal, $                             ; color table (33-rainbow is default)
+            colors=colors, $                      ; number of colors/levels (32 is default)
+            title=title, $                        ; title of the plot ('' is default)
+            format=format                         ; format of colorbar annotations ('(F6.2)' is default)
+
+PS_End, /PNG
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/dbltostr.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/dbltostr.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/dbltostr.pro	(revision 207)
@@ -0,0 +1,141 @@
+;+
+; NAME:
+;       DBLTOSTR
+;
+; PURPOSE:
+;
+;       This is a program for converting a double precision numerical value
+;       to a string. It was originally offered by BioPhys on the IDL newsgroup.
+;
+; AUTHOR:
+;
+;       FANNING SOFTWARE CONSULTING
+;       David Fanning,  Ph.D.
+;       1645 Sheely Drive
+;       Fort Collins,  CO 80526 USA
+;       Phone: 970-221-0438
+;       E-mail: davidf@dfanning.com
+;       Coyote's Guide to IDL Programming: http://www.dfanning.com
+;
+; CATEGORY:
+;
+;       Utility
+;
+; CALLING SEQUENCE:
+;
+;       stringValue  =  DblToStr(value)
+;
+; INPUTS:
+;
+;       value - A double-precision or floating point value to be converted to a string.
+;
+; OUTPUTS:
+;
+;       stringValue - The converted string value.
+;
+; KEYWORDS:
+;
+;       None.
+;
+; RESTRICTIONS:
+;
+;       Assumes 14 significant digits of precision.
+;
+; MODIFICATION HISTORY:
+;
+;       Written by BioPhys and offered to the IDL newsgroup,  7 November 2005.
+;       Slightly modified and renamed by David Fanning,  30 November,  2005.
+;-
+;
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright © 2005 Fanning Software Consulting.
+;
+; This software is provided "as-is",  without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose,  including commercial applications,  and to alter it and
+; redistribute it freely,  subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product,  an acknowledgment in the product documentation
+;    would be appreciated,  but is not required.
+;
+; 2. Altered source versions must be plainly marked as such,  and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software,  visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+
+
+FUNCTION DBLTOSTR,  value
+
+   ; Error handling.
+   On_Error,  2
+   IF N_Elements(value) EQ 0 THEN Message,  'Double precision or floaing value must be passed to the function.'
+
+   ; Get the data type.
+   theType = Size(value, /Type)
+   IF theType NE 4 AND theType NE 5 THEN BEGIN
+       value = Double(value)
+       theType = 5
+   ENDIF
+
+   ; Data extension.
+   typeExt = theType EQ 4?'E':'D'
+
+   ; Create a string, using the full-widtet G format.
+   rawstr = StrTrim(String(value, Format = '(g)'), 2)
+
+   ; Extract the sign from the string and remove it for the moment.
+   sign = StrMid(rawstr, 0, 1) EQ '-'?'-':''
+   rawstr = sign EQ ''?rawstr:StrMid(rawstr, 1)
+
+   ; Is there an exponent in the string? If so, remove that for the moment.
+   epos = StrPos(rawstr, 'e')
+   indx = epos gt -1?StrMid(rawstr, epos+1):''
+   rawstr = indx EQ ''?rawstr:StrMid(rawstr, 0, epos)
+
+   ; Find the position of the decimal point.
+   dpos = StrPos(rawstr, '.')
+
+   ; Rounding process (assumes 14 significant digits).
+   outstr = StrArr(15)
+   FOR i = 0, 14 DO outstr[i] = StrMid(rawstr, i, 1)
+   aux = Fix(StrMid(rawstr, 16, 1)) GE 5?1:0
+   FOR i = 14,  0,  -1 DO BEGIN
+      IF i NE dpos then BEGIN
+         sumstr = StrTrim(String(aux+fix(outstr[i])), 2)
+         sumlen = StrLen(sumstr)
+         outstr[i] = StrMid(sumstr, sumlen-1, 1)
+         aux = sumlen EQ 1?0:1
+      ENDIF
+   ENDFOR
+
+   ; Throw away '0's at the end.
+   ii = 14
+   WHILE outstr[ii] EQ '0' DO BEGIN
+      ii = ii-1
+   ENDWHILE
+
+   ; Reconstruct the string.
+   saux = aux NE 0?'1':''
+   outstr = sign + saux + StrJoin(outstr[0:ii]) + typeExt + indx
+
+   ; Return it.
+   RETURN, outstr
+
+END
+
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/error_message.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/error_message.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/error_message.pro	(revision 207)
@@ -0,0 +1,269 @@
+;+
+; NAME:
+;    ERROR_MESSAGE
+;
+; PURPOSE:
+;
+;    The purpose of this function  is to have a device-independent
+;    error messaging function. The error message is reported
+;    to the user by using DIALOG_MESSAGE if widgets are
+;    supported and MESSAGE otherwise.
+;
+;    In general, the ERROR_MESSAGE function is not called directly.
+;    Rather, it is used in a CATCH error handler. Errors are thrown
+;    to ERROR_MESSAGE with the MESSAGE command. A typical CATCH error
+;    handler is shown below.
+;
+;       Catch, theError
+;       IF theError NE 0 THEN BEGIN
+;          Catch, /Cancel
+;          ok = Error_Message()
+;          RETURN
+;       ENDIF
+;
+;    Error messages would get into the ERROR_MESSAGE function by
+;    throwing an error with the MESSAGE command, like this:
+;
+;       IF test NE 1 THEN Message, 'The test failed.'
+;
+; AUTHOR:
+;
+;   FANNING SOFTWARE CONSULTING
+;   David Fanning, Ph.D.
+;   1645 Sheely Drive
+;   Fort Collins, CO 80526 USA
+;   Phone: 970-221-0438
+;   E-mail: davidf@dfanning.com
+;   Coyote's Guide to IDL Programming: http://www.dfanning.com/
+;
+; CATEGORY:
+;
+;    Utility.
+;
+; CALLING SEQUENCE:
+;
+;    ok = Error_Message(the_Error_Message)
+;
+; INPUTS:
+;
+;    the_Error_Message: This is a string argument containing the error
+;       message you want reported. If undefined, this variable is set
+;       to the string in the !Error_State.Msg system variable.
+;
+; KEYWORDS:
+;
+;    ERROR: Set this keyword to cause Dialog_Message to use the ERROR
+;       reporting dialog. Note that a bug in IDL causes the ERROR dialog
+;       to be used whether this keyword is set to 0 or 1!
+;
+;    INFORMATIONAL: Set this keyword to cause Dialog_Message to use the
+;       INFORMATION dialog instead of the WARNING dialog. Note that a bug
+;       in IDL causes the ERROR dialog to be used if this keyword is set to 0!
+;
+;    TITLE: Set this keyword to the title of the DIALOG_MESSAGE window. By
+;       default the keyword is set to 'System Error' unless !ERROR_STATE.NAME
+;       equals "IDL_M_USER_ERR", in which case it is set to "Trapped Error'.
+;
+;    TRACEBACK: Setting this keyword results in an error traceback
+;       being printed to standard output with the PRINT command. Set to
+;       1 (ON) by default. Use TRACEBACK=0 to turn this functionality off.
+;
+; OUTPUTS:
+;
+;    Currently the only output from the function is the string "OK".
+;
+; RESTRICTIONS:
+;
+;    The WARNING Dialog_Message dialog is used by default.
+;
+; EXAMPLE:
+;
+;    To handle an undefined variable error:
+;
+;    IF N_Elements(variable) EQ 0 THEN $
+;       ok = Error_Message('Variable is undefined')
+;
+; MODIFICATION HISTORY:
+;
+;    Written by: David W. Fanning, 27 April 1999.
+;    Added the calling routine's name in the message and NoName keyword. 31 Jan 2000. DWF.
+;    Added _Extra keyword. 10 February 2000. DWF.
+;    Forgot to add _Extra everywhere. Fixed for MAIN errors. 8 AUG 2000. DWF.
+;    Adding call routine's name to Traceback Report. 8 AUG 2000. DWF.
+;    Added ERROR, INFORMATIONAL, and TITLE keywords. 19 SEP 2002. DWF.
+;    Removed the requirement that you use the NONAME keyword with the MESSAGE
+;      command when generating user-trapped errors. 19 SEP 2002. DWF.
+;    Added distinctions between trapped errors (errors generated with the
+;      MESSAGE command) and IDL system errors. Note that if you call ERROR_MESSAGE
+;      directly, then the state of the !ERROR_STATE.NAME variable is set
+;      to the *last* error generated. It is better to access ERROR_MESSAGE
+;      indirectly in a Catch error handler from the MESSAGE command. 19 SEP 2002. DWF.
+;    Change on 19 SEP 2002 to eliminate NONAME requirement did not apply to object methods.
+;      Fixed program to also handle messages from object methods. 30 JULY 2003. DWF.
+;    Removed obsolete STR_SEP and replaced with STRSPLIT. 27 Oct 2004. DWF.
+;    Made a traceback the default case without setting TRACEBACK keyword. 19 Nov 2004. DWF.
+;    Added check for window connection specifically for CRON jobs. 6 May 2008. DWF.
+;-
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright 1999-2008 Fanning Software Consulting
+;
+; This software is provided "as-is", without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose, including commercial applications, and to alter it and
+; redistribute it freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product, an acknowledgment in the product documentation
+;    would be appreciated, but is not required.
+;
+; 2. Altered source versions must be plainly marked as such, and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software, visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+
+
+FUNCTION ERROR_MESSAGE, theMessage, Error=error, Informational=information, $
+   Traceback=traceback, NoName=noname, Title=title, _Extra=extra
+
+   On_Error, 2
+   
+   ; Check for presence and type of message.
+   
+   IF N_Elements(theMessage) EQ 0 THEN theMessage = !Error_State.Msg
+   s = Size(theMessage)
+   messageType = s[s[0]+1]
+   IF messageType NE 7 THEN BEGIN
+      Message, "The message parameter must be a string.", _Extra=extra
+   ENDIF
+   IF N_Elements(traceback) EQ 0 THEN traceback = 1
+   
+   ; Get the call stack and the calling routine's name.
+   Help, Calls=callStack
+   callingRoutine = (StrSplit(StrCompress(callStack[1])," ", /Extract))[0]
+   
+   
+   
+   
+   ; Are widgets supported?
+   widgetsSupported = ((!D.Flags AND 65536L) NE 0)
+   
+   ; It is not enough to know if widgets are supported. In CRON jobs, widgets are
+   ; supported, but there is no X connection and pop-up dialogs are not allowed.
+   ; Here is a quick test to see if we can connect to a windowing system. If not,
+   ; then we are going to assume widgets are not supported.
+   Catch, theError
+   IF theError NE 0 THEN BEGIN
+      Catch, /CANCEL
+      widgetsSupported = 0
+      GOTO, testWidgetSupport
+   ENDIF
+   theWindow = !D.Window
+   Window, /FREE, XSIZE=5, YSIZE=5, /PIXMAP
+   Catch, /CANCEL
+   
+   testWidgetSupport: ; Come here if you choke on creating a window.
+   IF !D.Window NE theWindow THEN BEGIN
+      WDelete, !D.Window
+      IF theWindow GE 0 THEN WSet, theWindow
+   ENDIF
+   
+   IF widgetsSupported THEN BEGIN
+   
+      ; If this is an error produced with the MESSAGE command, it is a trapped
+      ; error and will have the name "IDL_M_USER_ERR".
+      IF !ERROR_STATE.NAME EQ "IDL_M_USER_ERR" THEN BEGIN
+   
+         IF N_Elements(title) EQ 0 THEN title = 'Trapped Error'
+   
+            ; If the message has the name of the calling routine in it,
+            ; it should be stripped out. Can you find a colon in the string?
+   
+         ; Is the calling routine an object method? If so, special processing
+         ; is required. Object methods will have two colons together.
+         doublecolon = StrPos(theMessage, "::")
+         IF doublecolon NE -1 THEN BEGIN
+   
+            prefix = StrMid(theMessage, 0, doublecolon+2)
+            submessage = StrMid(theMessage, doublecolon+2)
+            colon = StrPos(submessage, ":")
+            IF colon NE -1 THEN BEGIN
+   
+               ; Extract the text up to the colon. Is this the same as
+               ; the callingRoutine? If so, strip it.
+               IF StrMid(theMessage, 0, colon+StrLen(prefix)) EQ callingRoutine THEN $
+                  theMessage = StrMid(theMessage, colon+1+StrLen(prefix))
+            ENDIF
+         ENDIF ELSE BEGIN
+   
+            colon = StrPos(theMessage, ":")
+            IF colon NE -1 THEN BEGIN
+   
+               ; Extract the text up to the colon. Is this the same as
+               ; the callingRoutine? If so, strip it.
+               IF StrMid(theMessage, 0, colon) EQ callingRoutine THEN $
+                  theMessage = StrMid(theMessage, colon+1)
+            ENDIF
+   
+         ENDELSE
+   
+   
+         ; Add the calling routine's name, unless NONAME is set.
+         IF Keyword_Set(noname) THEN BEGIN
+            answer = Dialog_Message(theMessage, Title=title, _Extra=extra, $
+               Error=error, Information=information)
+         ENDIF ELSE BEGIN
+            answer = Dialog_Message(StrUpCase(callingRoutine) + ": " + $
+               theMessage, Title=title, _Extra=extra, $
+               Error=error, Information=information)
+         ENDELSE
+   
+      ENDIF ELSE BEGIN
+   
+         ; Otherwise, this is an IDL system error.
+         IF N_Elements(title) EQ 0 THEN title = 'System Error'
+   
+         IF StrUpCase(callingRoutine) EQ "$MAIN$" THEN $
+            answer = Dialog_Message(theMessage, _Extra=extra, Title=title, $
+               Error=error, Information=information) ELSE $
+         IF Keyword_Set(noname) THEN BEGIN
+            answer = Dialog_Message(theMessage, _Extra=extra, Title=title, $
+               Error=error, Information=information)
+         ENDIF ELSE BEGIN
+            answer = Dialog_Message(StrUpCase(callingRoutine) + "--> " + $
+               theMessage, _Extra=extra, Title=title, $
+               Error=error, Information=information)
+         ENDELSE
+      ENDELSE
+   ENDIF ELSE BEGIN
+         Message, theMessage, /Continue, /NoPrint, /NoName, /NoPrefix, _Extra=extra
+         Print, '%' + callingRoutine + ': ' + theMessage
+         answer = 'OK'
+   ENDELSE
+   
+   ; Provide traceback information if requested and this is NOT an informational message.
+   IF Keyword_Set(traceback) AND ~Keyword_Set(informational)THEN BEGIN
+      Help, /Last_Message, Output=traceback
+      Print,''
+      Print, 'Traceback Report from ' + StrUpCase(callingRoutine) + ':'
+      Print, ''
+      FOR j=0,N_Elements(traceback)-1 DO Print, "     " + traceback[j]
+   ENDIF
+   
+   RETURN, answer
+END ; ----------------------------------------------------------------------------
+
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_base_filename.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_base_filename.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_base_filename.pro	(revision 207)
@@ -0,0 +1,201 @@
+;+
+; NAME:
+;    FSC_BASE_FILENAME
+;
+; PURPOSE:
+;
+;    The purpose of this is to extract from a long file path, the
+;    base file name. That is, the name of the actual file without
+;    the preceeding directory information or the final file extension.
+;    The directory information and file extension can be obtained via
+;    keywords. The file is named so as not to interfere with FILE_BASENAME,
+;    which was introduced in IDL 6.0 and performs a similar function.
+;
+; AUTHOR:
+;
+;   FANNING SOFTWARE CONSULTING
+;   David Fanning, Ph.D.
+;   1645 Sheely Drive
+;   Fort Collins, CO 80526 USA
+;   Phone: 970-221-0438
+;   E-mail: davidf@dfanning.com
+;   Coyote's Guide to IDL Programming: http://www.dfanning.com/
+;
+; CATEGORY:
+;
+;    Utility.
+;
+; CALLING SEQUENCE:
+;
+;    baseFilename = FSC_Base_Filename(thePath)
+;
+; INPUTS:
+;
+;    thePath:      This is the file path you wish to extract a base file name from.
+;                  It is a string variable of the sort returned from Dialog_Pickfile.
+;
+; KEYWORDS:
+;
+;    DIRECTORY:      The directory information obtained from the input file path.
+;                    The directory always ends in a directory separator character.
+;
+;    EXTENSION:      The file extension associated with the input file path.
+;
+;    PATH_SEPARATOR: The string to use as a path separator. If undefined, the output
+;                    of PATH_SEP() will be used.
+;
+; RETURN_VALUE:
+;
+;    baseFilename:   The base filename, stripped of directory and file extension information.
+;
+; RESTRICTIONS:
+;
+;    This is a quick and dirty program. It has been tested on Windows machines and *lightly*
+;    tested on UNIX machines. Please contact me at the e-mail address above if you discover
+;    problems.
+;
+; EXAMPLE:
+;
+;    IDL> thePath = "C:\rsi\idl7.8\lib\jester.pro"
+;    IDL> Print, FSC_Base_Filename(thePath, Directory=theDirectory, Extension=theExtension)
+;         jester
+;    IDL> Print, theDirectory
+;         C:\rsi\idl7.8\lib\
+;    IDL> Print, theExtension
+;         pro
+;
+;
+; MODIFICATION HISTORY:
+;
+;    Written by: David W. Fanning, 31 July 2003.
+;    Modified by KaRo, 13 Feb. 2005 to allow dots in the filename.
+;    Added PATH_SEPARATOR keyword. 25 July 2005. DWF.
+;    Added ability to recongnize directory by path separator in last character. 19 Sept 2005. DWF.
+;-
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright © 2003-2005 Fanning Software Consulting
+;
+; This software is provided "as-is", without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose, including commercial applications, and to alter it and
+; redistribute it freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product, an acknowledgment in the product documentation
+;    would be appreciated, but is not required.
+;
+; 2. Altered source versions must be plainly marked as such, and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software, visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+
+
+FUNCTION FSC_Base_Filename, filename, $
+   Directory=directory, $
+   Extension=extension, $
+   Path_Separator=pathsep
+
+   On_Error, 2
+
+   ; Default values.
+   directory = ""
+   extension = ""
+   file = ""
+
+   ; If there is no filename, return NULL.
+   IF (N_Elements(filename) EQ 0) OR (filename EQ "") THEN RETURN, file
+
+   ; Is a path separator specified?
+   IF N_Elements(pathsep) EQ 0 THEN pathsep = Path_Sep()
+
+   ; If the last element of filename is a path separator, then separation is easy.
+   IF StrMid(filename, StrLen(filename)-1, 1) EQ pathsep THEN BEGIN
+      directory = filename
+      RETURN, file
+   ENDIF
+
+   ; Split the file by the path separator and extract into parts.
+   parts = StrSplit(filename, pathsep, /Extract)
+   IF StrMid(filename, 0, 1) EQ pathsep AND N_Elements(parts) GT 1 THEN parts[0] = pathsep + parts[0]
+   numParts = N_Elements(parts)
+
+   ; Put the parts back together after identifying them.
+   CASE numParts OF
+      1: BEGIN
+            subparts = StrSplit(filename, ".", /Extract)
+            numsubParts = N_Elements(subparts)
+            CASE numsubParts OF
+               1: file = subparts[0]
+               2: BEGIN
+                     file = subparts[0]
+                     extension = subparts[1]
+                  END
+               ELSE: BEGIN
+                     file = StrJoin(subparts[0:numsubParts-2],'.')
+                     extension = subparts[numsubParts-1]
+                  END
+            ENDCASE
+         END
+
+      2: BEGIN
+            file = parts[1]
+            directory = parts[0] + pathsep
+            subparts = StrSplit(file, ".", /Extract)
+            numsubParts = N_Elements(subparts)
+            CASE numsubParts OF
+               1: file = subparts[0]
+               2: BEGIN
+                     file = subparts[0]
+                     extension = subparts[1]
+                  END
+               ELSE: BEGIN
+                     file = StrJoin(subparts[0:numsubParts-2],'.')
+                     extension = subparts[numsubParts-1]
+                  END
+            ENDCASE
+         END
+
+      ELSE: BEGIN
+
+            file = parts[numParts-1]
+            subparts = StrSplit(file, ".", /Extract)
+            numsubParts = N_Elements(subparts)
+            CASE numsubParts OF
+               1: file = subparts[0]
+               2: BEGIN
+                     file = subparts[0]
+                     extension = subparts[1]
+                  END
+               ELSE: BEGIN
+                     file = StrJoin(subparts[0:numsubParts-2],'.')
+                     extension = subparts[numsubParts-1]
+                  END
+            ENDCASE
+            directory = parts[0]
+            FOR j=1,numParts-2 DO BEGIN
+               directory = directory + pathsep + parts[j]
+            ENDFOR
+            directory = directory + pathsep
+         END
+
+   ENDCASE
+
+   RETURN, file
+
+END
+
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_droplist.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_droplist.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_droplist.pro	(revision 207)
@@ -0,0 +1,602 @@
+;+
+; NAME:
+;   FSC_DROPLIST
+;
+; PURPOSE:
+;
+;   The purpose of this compound widget is to provide an alternative
+;   to the DROPLIST widget offered in the IDL distribution. What has
+;   always annoyed me about a droplist is that you can't get the current
+;   "value" of a droplist easily. This compound widget makes this and
+;   other tasks much easier.
+;
+; AUTHOR:
+;
+;   FANNING SOFTWARE CONSULTING
+;   David Fanning, Ph.D.
+;   1645 Sheely Drive
+;   Fort Collins, CO 80526 USA
+;   Phone: 970-221-0438
+;   E-mail: davidf@dfanning.com
+;   Coyote's Guide to IDL Programming: http://www.dfanning.com/
+;
+; CATEGORY:
+;
+;   General programming.
+;
+; CALLING SEQUENCE:
+;
+;   droplistObj = FSC_Droplist(parent, Title='Animals: ", Value=['Dog'. 'Cat', 'Coyote'], Index=2)
+;
+;   The return value of the FSC_Droplist (droplistObj in this example) is
+;   an object reference. Interaction with the droplist will occur through
+;   object methods.
+;
+; INPUT PARAMETERS:
+;
+;   parent -- The parent widget ID of the compound widget. Required.
+;
+; INPUT KEYWORDS:
+;
+; Any keyword that is appropriate for the Widget_Droplist function can be used.
+; In addition, these keywords are explicitly defined.
+;
+;   EVENT_FUNC -- Set this keyword to the name of an Event Handler Function.
+;   EVENT_PRO -- Set this keyword to the name of an Event Handler Procedure.
+;   FORMAT -- A format specifier for the "format" of the values in the droplist.
+;   INDEX -- The index number of the current selection.
+;   SPACES -- A two-element array that indicates the number of blank spaces to be added
+;             to the the beginning and end of the formatted values. If a single number
+;             is provided, this number of blank spaces is added to both the beginning
+;             and the end of the value.
+;   TITLE -- The title of the droplist widget.
+;   UNAME -- The user name of the droplist widget. (Only available in IDL 5.2 and higher.)
+;   UVALUE -- The normal "user value" of the droplist.
+;   VALUE -- An array of the droplist "selections". May be any data type.
+;
+; COMMON BLOCKS:
+;
+;   None.
+;
+; DEPENDENCIES:
+;
+;   Requires ERROR_MESSAGE from the Coyote Library..
+;
+; EVENT STRUCTURE:
+;
+;   An event is returned each time the droplist value is changed. The event structure
+;   is defined like this:
+;
+;   event = { FSC_DROPLIST_EVENT, $ ; The name of the event structure.
+;             ID: 0L, $             ; The ID of the compound widget's top-level base.
+;             TOP: 0L, $            ; The widget ID of the top-level base of the hierarchy.
+;             HANDLER: 0L, $        ; The event handler ID. Filled out by IDL.
+;             INDEX: 0L, $          ; The index number of the current selection.
+;             SELECTION:Ptr_New() $ ; A pointer to the current selection "value".
+;             SELF:Obj_New() }      ; The object reference of the compound widget.
+;
+; PUBLIC OBJECT METHODS:
+;
+;   GetID -- A function with no arguments that returns the widget identifier
+;      of the droplist widget.
+;
+;      droplistID = droplistObj->GetID()
+;
+;   GetIndex -- A function with no arguments that returns the index
+;      number of the current droplist selection.
+;
+;      currentIndex = droplistObj->GetIndex()
+;
+;   GetSelection -- A function with no arguments that returns the current
+;      droplist selection.
+;
+;      currentSelection = droplistObj->GetSelection()
+;
+;   GetUValue -- A function with no arguments that returns the "user value"
+;      of the compound widget i.e., the value set with the UVALUE keyword).
+;
+;      myUValue = droplistObj->GetUValue()
+;
+;   GetValues -- A function with no arguments that returns the "values" or
+;      "selections" for the droplist.
+;
+;      possibleSelections = droplistObj->GetValues()
+;
+;   Resize -- A procedure that sets the X screen size of the droplist. It is
+;      defined like this:
+;
+;      PRO Resize, newSize, ParentSize=parentSize
+;
+;      The "newSize" keyword is the new X screen size. If this argument is
+;      missing, the screen X size of the compound widget's parent is used.
+;      The parentSize keyword is an output keyword that returns the X screen
+;      size of the compound widget's parent.
+;
+;      droplistObj->Resize, 400
+;
+;      Note that not all devices (e.g., X Windows devices) support droplist resizing.
+;
+;   SetIndex -- A procedure that sets the current droplist selection based on
+;      the given index. This is equivalent to Widget_Control, droplistID, Set_Droplist_Select=newIndex
+;
+;      droplistObj->SetIndex, newIndex
+;
+;   SetSelection -- Whereas a regular droplist widget can only be set by index
+;      number, this compound widget can also be set by a "selection". The new selection
+;      can be any data type and corresponds to one of the "values" of the droplist.
+;
+;      droplistObj->SetSelection, newSelection
+;
+;   SetValues -- Sets the possible selections of the droplist widget. The CurrentIndex keyword
+;      will allow the current index of the selection to be changed to:
+;
+;      newChoices = ['dog', 'cat', 'coyote']
+;      droplistObj->SetValues, newChoices, CurrentIndex=2
+;
+;
+; EXAMPLE:
+;
+;   An example program is provided at the end of the FSC_DROPLIST code. To run it,
+;   type these commands:
+;
+;      IDL> .Compile FSC_DROPLIST
+;      IDL> Example
+;
+; MODIFICATION HISTORY:
+;
+;   Written by: David W Fanning, 17 Jan 2000. DWF.
+;   Added FORMAT and SPACES keywords 28 April 2000. DWF.
+;   Fixed a small problem with event processing when the EVENT_FUNC keyword
+;      was used. 29 Dec 2000. DWF.
+;   Attached the UNAME value to the TLB of the compound widget instead
+;      of to the droplist widget itself. 11 Jan 2001. DWF.
+;   Fixed a problem when the droplist was part of a modal widget and used the
+;      EVENT_PRO keyword. 27 Oct 2003. DWF.
+;   Added a SetValue method for setting all the values in the droplist at once. 12 Nov 2004. DWF.
+;   Fixed type on line 346/ 6 Feb 2008. DWF.
+;-
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright 2000-2008 Fanning Software Consulting
+;
+; This software is provided "as-is", without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose, including commercial applications, and to alter it and
+; redistribute it freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product, an acknowledgment in the product documentation
+;    would be appreciated, but is not required.
+;
+; 2. Altered source versions must be plainly marked as such, and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software, visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+;
+
+
+
+PRO FSC_Droplist_Kill_Notify, droplistID
+
+; This procedure is called automatically when the droplist is destroy. The
+; purpose is to destroy the self object so there are no memory leaks.
+
+Widget_Control,droplistID, Get_UValue=self
+Obj_Destroy, self
+END ;--------------------------------------------------------------------------
+
+
+FUNCTION FSC_Droplist::EventHandler, event
+
+; This is the event handler method of the object. The purpose is to set the
+; object's current selection and index number. If an event handler has
+; been specified, a FSC_DROPLIST event is sent to the proper event handler.
+
+   ; Set the current selection and index number.
+
+*self.selection = (*self.value)[event.index]
+self.index = event.index
+
+   ; If we need to send an event package the event up. Include both
+   ; the index number (what normal droplist events produce), the current
+   ; selection, and the self object reference.
+
+thisEvent = {FSC_Droplist_EVENT, ID:self.tlb, TOP:event.top, HANDLER:event.handler, $
+ INDEX:self.index, SELECTION:self.selection, SELF:self}
+
+   ; Send the event if requested. If it is requested, no events returned.
+
+IF self.event_pro NE "" THEN BEGIN
+   Call_Procedure, self.event_pro, thisEvent
+   thisEvent = 0
+   IF Obj_Valid(self) EQ 0 THEN RETURN, thisEvent ; Modal widget destroyed.
+ENDIF
+
+IF self.event_func NE "" THEN BEGIN
+   ok = Call_Function(self.event_func, thisEvent)
+   thisEvent = 0
+ENDIF
+
+RETURN, thisEvent
+END ;--------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Droplist_Events, event
+
+; This is the droplist event handler. The purpose of this procedure is to
+; get the self object reference and call the object's own event method.
+; The event handler method will return 0 if an event handler procedure or
+; function has been called. Otherwise, it will return the event.
+
+Widget_Control, event.id, Get_UValue=self
+theEvent = self->EventHandler(event)
+RETURN, theEvent
+END ;--------------------------------------------------------------------------
+
+
+
+PRO FSC_Droplist::Sensitive, value
+
+; This method makes the droplist sensitive (value=1) or insensitive (value=0).
+
+Widget_Control, self.droplistID, Sensitive=value
+END ;--------------------------------------------------------------------------
+
+
+
+PRO FSC_Droplist::Resize, newSize,  ParentSize=parentSize
+
+; This method resizes the droplist. If the variable "newSize" is not provided,
+; the new size is set by the parent widget's X screen size. This makes it possible
+; to have the droplist sized to fit it's parent base widget.
+
+   ; Get the parent widget's geometry and X screen size.
+
+parentGeometry = Widget_Info(self.parent, /Geometry)
+parentSize = parentGeometry.scr_xsize
+
+   ; Has a size been provided? In not, use the parent's X screen size.
+
+IF N_Elements(newSize) EQ 0 THEN BEGIN
+   newSize = parentGeometry.scr_xsize
+ENDIF
+
+   ; Resize the droplist widget.
+
+Widget_Control, self.droplistID, Scr_XSize=newSize
+END ;--------------------------------------------------------------------------
+
+
+
+PRO FSC_Droplist::SetSelection, selection
+
+; This method sets the current selection of the droplist by means of
+; the selection "value". With a normal droplist you must set the selection
+; by specifying an index number.
+
+   ; Find the selection in the value. Return it's index number.
+
+IF N_Elements(selection) EQ 0 THEN selection = (*self.value)[0]
+index = Where(StrUpCase( Strtrim(*self.value,2) ) EQ StrUpCase( StrTrim(selection,2) ), count)
+
+   ; If you can't find the selection, print an error message.
+
+IF count EQ 0 THEN BEGIN
+   uname = Widget_Info(self.droplistID,/UName)
+   ok = Error_Message('No item with name "' + uname + ':' + $
+      StrTrim(selection,2) + '" exists. Returning...')
+   RETURN
+ENDIF
+
+   ; Set the current index and selection for the object.
+
+index = 0 > index < (N_Elements(*self.value) - 1)
+self.index = index
+*self.selection = selection
+
+   ; Set the current selection for the droplist widget.
+
+Widget_Control, self.droplistID, Set_Droplist_Select=self.index
+END ;--------------------------------------------------------------------------
+
+
+
+PRO FSC_Droplist::SetIndex, index
+
+; This method sets the current selection by means of its index number.
+
+   ; Make sure the index number is there and valid.
+
+IF N_Elements(index) EQ 0 THEN index = 0
+self.index = 0 > index < (N_Elements(*self.value) - 1)
+
+   ; Set the current selection.
+
+*self.selection = (*self.value)[index]
+
+   ; Set the selection on the droplist widget.
+
+Widget_Control, self.droplistID, Set_Droplist_Select=self.index
+
+END ;--------------------------------------------------------------------------
+
+
+
+PRO FSC_Droplist::SetValues, theValues, CurrentIndex=currentIndex
+
+; This method allows all the values in the droplist to be changed simultaneously.
+
+  IF Ptr_Valid(self.value) THEN *self.value = theValues ELSE self.value = Ptr_New(theValues)
+  Widget_Control, self.droplistID, Set_Value=*self.value
+
+  IF N_Elements(currentIndex) EQ 0 THEN currentIndex = self.index ELSE self.index = currentIndex < (N_Elements(theValues)-1)
+  IF currentIndex GT (N_Elements(*self.value)-1) THEN BEGIN
+     currentIndex = 0
+     self.index = currentIndex
+  ENDIF
+  IF Ptr_Valid(self.selection) THEN *self.selection = (*self.value)[self.index] ELSE $
+    self.selection = Ptr_New((*self.value)[self.index])
+  Widget_Control, self.droplistID, Set_Droplist_Select=self.index
+END ;--------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Droplist::GetIndex
+
+; This method returns the index number of the current selection.
+
+RETURN, self.index
+END ;--------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Droplist::GetSelection
+
+; This method returns the "value" of the current selection.
+
+RETURN, *self.selection
+END ;--------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Droplist::GetValues
+
+; This method returns the current "values" or "selections" of the droplist.
+
+RETURN, *self.value
+END ;--------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Droplist::GetUValue
+
+; This method returns the "user value" of the droplist.
+
+RETURN, *self.storage
+END ;--------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Droplist::GetID
+
+; This method returns the droplist widget identifier.
+
+RETURN, self.droplistID
+END ;--------------------------------------------------------------------------
+
+
+
+PRO FSC_Droplist::CLEANUP
+
+; This is the object's cleanup method. Free's up all the pointers used in the
+; object.
+
+Ptr_Free, self.value
+Ptr_Free, self.selection
+Ptr_Free, self.storage
+END ;--------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Droplist::INIT, $
+   parent, $                    ; The widget ID of the droplist's parent widget. Required.
+   debug=debug, $               ; Turns full error handling on for INIT catch error handler.
+   Event_Func=event_func, $     ; The name of an event handler function.
+   Event_Pro=event_pro, $       ; The name of an event handler procedure.
+   _Extra=extra, $              ; A keyword that allows any droplist keyword to be used in initialization.
+   Format=format, $             ; The format of the "value" of the droplist.
+   Index=index, $               ; The index number of the current selection.
+   Spaces=spaces, $             ; Number of blank spaces to add to formatted "values".
+   Title=title, $               ; The text that goes in the TITLE of the droplist.
+   UName=uname, $               ; A user name. Left for the user of the cw_droplist program.
+   UValue=storage, $            ; A user value. Left for the user of the cw_droplist program.
+   Value=value                  ; The "value" or selections of the droplist. May be any data type.
+
+   ; Catch any errors.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = Error_Message(!Error_State.Msg, Traceback=Keyword_Set(debug))
+   RETURN, 0
+ENDIF
+
+; This is the object's initialization method.
+
+IF N_Elements(parent) EQ 0 THEN BEGIN
+   ok = Error_Message('Parent parameter must be provided. Returning...')
+   RETURN, 0
+ENDIF
+
+   ; Check for presence of keywords.
+
+IF N_Elements(title) EQ 0 THEN title = 'Selection: '
+IF N_Elements(value) EQ 0 THEN value = ['Dog', 'Cat', 'Coyote']
+IF N_Elements(storage) EQ 0 THEN storage = ""
+IF N_Elements(index) EQ 0 THEN index = 0
+IF N_Elements(event_pro) EQ 0 THEN event_pro = ""
+IF N_Elements(event_func) EQ 0 THEN event_func = ""
+IF N_Elements(uname) EQ 0 THEN uname = ""
+IF N_Elements(spaces) EQ 0 THEN BEGIN
+   forwardSpace = ""
+   trailingSpace = ""
+ENDIF ELSE BEGIN
+   IF N_Elements(spaces) EQ 2 THEN BEGIN
+      IF spaces[0] LE 0 THEN forwardSpace = "" ELSE forwardSpace = String(Replicate(32B,spaces[0]))
+      IF spaces[1] LE 0 THEN trailingSpace = "" ELSE trailingSpace = String(Replicate(32B,spaces[1]))
+   ENDIF ELSE BEGIN
+      IF spaces[0] LE 0 THEN forwardSpace = "" ELSE forwardSpace = String(Replicate(32B,spaces[0]))
+      IF spaces[0] LE 0 THEN trailingSpace = "" ELSE trailingSpace = String(Replicate(32B,spaces[0]))
+   ENDELSE
+ENDELSE
+index = 0 > index < (N_Elements(value) - 1)
+
+   ; Create the droplist widget. UName only available for IDL 5.2 and higher.
+
+IF Float(!Version.Release) GE 5.2 THEN BEGIN
+
+   IF Keyword_Set(format) THEN theValue = String(value, Format=format) ELSE theValue = StrTrim(value,2)
+   self.tlb = Widget_Base(parent, UValue=storage, UName=uname)
+   self.droplistID = Widget_Droplist(self.tlb, $
+         Title=title, $
+         Value=forwardSpace + theValue + trailingSpace, $
+         _Extra=extra, $
+         Kill_Notify='FSC_Droplist_Kill_Notify', $
+         Event_Func='FSC_Droplist_Events', $
+         UValue=self)
+
+ ENDIF ELSE BEGIN
+
+   IF Keyword_Set(format) THEN theValue = String(value, Format=format) ELSE theValue = StrTrim(value,2)
+   self.tlb = Widget_Base(parent, UValue=storage)
+   self.droplistID = Widget_Droplist(self.tlb, $
+         Title=title, $
+         Value=forwardSpace + theValue + trailingSpace, $
+         _Extra=extra, $
+         Kill_Notify='FSC_Droplist_Kill_Notify', $
+         Event_Func='FSC_Droplist_Events', $
+         UValue=self)
+
+ENDELSE
+
+   ; Set the current selection on the droplist.
+
+selection = Value[index]
+Widget_Control, self.droplistID, Set_Droplist_Select=index
+
+   ; Populate the object.
+
+self.storage = Ptr_New(storage)
+self.index = index
+self.title = title
+self.parent = parent
+self.selection = Ptr_New(selection)
+self.event_func = event_func
+self.event_pro = event_pro
+self.value = Ptr_New(value)
+
+RETURN, 1
+END ;--------------------------------------------------------------------------
+
+
+
+PRO FSC_Droplist__DEFINE
+
+   struct = { FSC_Droplist, $          ; The FSC_DROPLIST object class definition.
+              title:"", $              ; The droplist title.
+              value:Ptr_New(), $       ; The values or selections on the droplist.
+              parent:0L, $             ; The widget identifer of the parent widget.
+              tlb:0L, $                ; The top-level base of the compound widget. .
+              droplistID:0L, $         ; The droplist widget identifier.
+              selection:Ptr_New(), $   ; The current droplist selection.
+              storage:Ptr_New(), $     ; The storage locaton for the "user value".
+              event_pro:"", $          ; The name of an event handler procedure.
+              event_func:"", $         ; The name of an event handler function.
+              index:0 $                ; The index number of the current selecton.
+            }
+END ;--------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Droplist, parent, Title=title, Value=value, _Extra=extra
+
+   ; This is the compound widget function call. It's purpose is to
+   ; create the compound widget object and return it.
+
+RETURN, Obj_New('FSC_Droplist', parent, Title=title, Value=value, _Extra=extra)
+END ;--------------------------------------------------------------------------
+
+
+
+PRO Example_Events, event
+Widget_Control, event.top, Get_UValue=droplists
+thisEvent = Tag_Names(event, /Structure_Name)
+CASE thisEvent OF
+   'FSC_DROPLIST_EVENT': BEGIN
+      thisDroplist = event.self->GetUValue()
+      Print, ""
+      Print, thisDroplist + ' Selection: ', *event.selection
+      Print, thisDroplist + ' Index Number: ', event.index
+      ENDCASE
+   'WIDGET_BUTTON': BEGIN
+      Widget_Control, event.id, Get_UValue=thisValue
+      CASE thisValue OF ; Set the droplists by "selection".
+         'SET_DROPLIST1': droplists[0]->SetSelection, 'Coyote'
+         'SET_DROPLIST2': droplists[1]->SetSelection, 99.8
+         ELSE: Widget_Control, event.top, /Destroy
+      ENDCASE
+      ENDCASE
+ENDCASE
+END ;---------------------------------------------------------------------------
+
+
+PRO Example
+
+; Droplist 1 is filled with string selections.
+; Droplist 2 is filled with number selections.
+
+tlb = Widget_Base(Title='FSC_Droplist Example', Column=1)
+animals = ['Dog', 'Cat', 'Opposum', 'Coyote']
+numbers = [45.6, 18.3, 21.5, 99.8]
+
+   ; Create the droplists.
+
+droplist1 = FSC_Droplist(tlb, Value=animals, Index=3, UValue='DROPLIST 1')
+droplist2 = FSC_Droplist(tlb, Value=numbers, Index=1, UValue='DROPLIST 2', $
+   Format='(F5.2)', Spaces=[2,0], Debug=1)
+
+   ; Other widgets.
+
+button = Widget_Button(tlb, Value='Set Droplist 1 to "Coyote"', UValue='SET_DROPLIST1')
+button = Widget_Button(tlb, Value='Set Droplist 2 to 99.8', UValue='SET_DROPLIST2')
+button = Widget_Button(tlb, Value='Quit', UValue='QUIT')
+
+   ; Resize the droplists.
+
+droplist1->Resize, 200
+droplist2->Resize, 200
+
+Widget_Control, tlb, /Realize, Set_UValue=[droplist1, droplist2]
+XManager, 'Example', tlb, Event_Handler='Example_Events', /No_Block
+
+; Test of SetValues method:
+;      Wait, 2
+;      newChoices = ['dog', 'cat', 'coyote']
+;      droplist1->SetValues, newChoices, CurrentIndex=2
+
+END ;---------------------------------------------------------------------------
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_field.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_field.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_field.pro	(revision 207)
@@ -0,0 +1,1734 @@
+;+
+; NAME:
+;   FSC_FIELD
+;
+; PURPOSE:
+;
+;   The purpose of this compound widget is to provide an alternative
+;   to the CW_FIELD widget offered in the IDL distribution. One weakness
+;   of the CW_FIELD compound widget is that the text widgets do not
+;   look editable to the users on Windows platforms. This program
+;   corrects that deficiency and adds some features that I think
+;   will be helpful. For example, you can now assign an event handler
+;   to the compound widget, ask for positive numbers only, and limit
+;   the number of digits in a number, or the number of digits to the
+;   right of a decimal point. The program is written as a widget object,
+;   which allows the user to call object methods directly, affording
+;   even more flexibility in use. This program replaces the earlier
+;   programs FSC_INPUTFIELD and COYOTE_FIELD.
+;
+;   The program consists of a label widget next to a one-line text widget.
+;   The "value" of the compound widget is shown in the text widget. If the
+;   value is a number, it will not be possible (generally) to type
+;   alphanumeric values in the text widget. String values behave like
+;   strings in any one-line text widget.
+;
+; AUTHOR:
+;
+;   FANNING SOFTWARE CONSULTING
+;   David Fanning, Ph.D.
+;   1645 Sheely Drive
+;   Fort Collins, CO 80526 USA
+;   Phone: 970-221-0438
+;   E-mail: davidf@dfanning.com
+;   Coyote's Guide to IDL Programming: http://www.dfanning.com/
+;
+; CATEGORY:
+;
+;   General programming.
+;
+; TYPICAL CALLING SEQUENCE:
+;
+;   fieldID = FSC_FIELD(parent, Title="X Size:", Value=256, Object=fieldObject, Digits=3)
+;
+; INPUT PARAMETERS:
+;
+;   parent -- The parent widget ID of the compound widget. Required.
+;
+; INPUT KEYWORDS:
+;
+;   COLUMN        Set this keyword to have the Label widget above the Text widget.
+;                 The default is to have the Label widget in a row with the Text widget.
+;
+;   CR_ONLY       Set this keyword if you only want Carriage Return events returned to
+;                 your event handler. If this keyword is not set, all events are returned.
+;                 Setting this keyword has no effect unless either the EVENT_PRO or
+;                 EVENT_FUNC keyword is used.
+;
+;   DECIMAL       Set this keyword to the number of digits to the right of the decimal
+;                 point in floating point or double precision numbers. Ignored for STRING values.
+;
+;   DIGITS        Set this keyword to the number of digits permitted in integer numbers.
+;
+;   EVENT_FUNC    Set this keyword to the name of an event handler function. If this
+;                 keyword is undefined and the Event_Pro keyword is undefined,
+;                 all compound widget events are handled internally and not
+;                 passed on to the parent widget.
+;
+;   EVENT_PRO     Set this keyword to the name of an event handler procedure. If this
+;                 keyword is undefined and the Event_Func keyword is undefined,
+;                 all compound widget events are handled internally and not
+;                 passed on to the parent widget.
+;
+;   FIELDFONT     The font name for the text in the text widget.
+;
+;   FRAME         Set this keyword to put a frame around the compound widget.
+;
+;   FOCUS_EVENTS  Set this keyword to enable event generation for keyboard focus
+;                 events. Ignored unless EVENT_FUNC or EVENT_PRO keywords are specified.
+;
+;   HIGHLIGHT     Set this keyword to highlight the existing text if the widget gain
+;                 the keyboard focus. This keyword MUST be set for tabbing to work naturally
+;                 in IDL 6.2 and higher.
+;
+;   LABEL_LEFT    Set this keyword to align the text on the label to the left.
+;
+;   LABEL_RIGHT   Set this keyword to align the text on the label to the right.
+;
+;   LABELFONT     The font name for the text in the label widget.
+;
+;   LABELSIZE     The X screen size of the label widget.
+;
+;   NAME          A string containing the name of the object. The default is ''.
+;
+;   NOEDIT        Set this keyword to allow no user editing of the input text widget.
+;
+;   NONSENSITIVE  Set this keyword to make the input text widget non-sensitive.
+;
+;   POSITIVE      Set this keyword if you want only positive numbers allowed.
+;
+;   SCR_XSIZE     The X screen size of the compound widget.
+;
+;   SCR_YSIZE     The Y screen size of the compound widget.
+;
+;   TITLE         The string text placed on the label widget.
+;
+;   UNDEFINED     Set this keyword to the value to use for "undefined" values. If
+;                 not set, then !Value.F_NAN is used for numerical fields and a
+;                 NULL string is used for string fields. This applies to values
+;                 obtained with the GET_VALUE method or the GET_VALUE function.
+;
+;   UVALUE        A user value for any purpose.
+;
+;   VALUE         The "value" of the compound widget. Any type of integer, floating, or string
+;                 variable is allowed. The data "type" is determined automatically from the
+;                 value supplied with this keyword. Be sure you set the type appropriately for
+;                 your intended use of the value.
+;
+;   XSIZE         The X size of the text widget in the usual character units.
+;
+; OUTPUT KEYWORDS:
+;
+;   OBJECT        Set this keyword to a named variable to receive the compound widget's
+;                 object reference. This is required if you wish to call methods on the object.
+;                 Note that the object reference is also available in the event structure
+;                 generated by the widget object. Note that the object reference will be
+;                 necessary if you want to get or set values in the compound widget.
+;
+; COMMON BLOCKS:
+;
+;   None.
+;
+; RESTRICTIONS:
+;
+;   Requires DBLTOSTR from the Coyote Library:
+;      http://www.dfanning.com/programs/dbltostr.pro
+;
+; EVENT STRUCTURE:
+;
+;   All events are handled internally unless either the Event_Pro or Event_Func
+;   keywords are used to assign an event handler to the compound widget. By
+;   default all events generated by the text widget are passed to the assigned
+;   event handler. If you wish to receive only Carriage Return events, set the
+;   CR_Only keyword.
+;
+;   event = { FSC_FIELD_EVENT, $   ; The name of the event structure.
+;             ID: 0L, $            ; The ID of the compound widget's top-level base.
+;             TOP: 0L, $           ; The widget ID of the top-level base of the hierarchy.
+;             HANDLER: 0L, $       ; The event handler ID. Filled out by IDL.
+;             OBJECT: Obj_New(), $ ; The "self" object reference. Provided so you can call methods.
+;             VALUE: Ptr_New(), $  ; A pointer to the widget value.
+;             TYPE:""              ; A string indicating the type of data in the VALUE field.
+;           }
+;
+;   Note that if the field is "empty", the VALUE will be a pointer
+;   to an undefined variable. You should check this value before you
+;   use it. You code will look something like this:
+;
+;     IF N_Elements(*event.value) EQ 0 THEN $
+;         Print, 'Current Value UNDEFINED.' ELSE $
+;         Print, 'Current Value: ', *event.value
+;
+; GETTING and SETTING VALUES:
+;
+;   Almost all the properties of the widget can be obtained or set via
+;   the object's GetProperty and SetProperty methods (described below).
+;   Traditional compound widgets have the ability to get and set the "value"
+;   of the compound widget identifier (e.g., fieldID in the calling
+;   sequence above). Unfortunately, it is impossible to retreive a variable
+;   in this way when the variable is undefined. In practical terms, this
+;   means that the undefined variable must be set to *something*. You can
+;   determine what that something is with the UNDEFINED keyword, or I will set
+;   it to !VALUES.F_NAN for numerical fields and to the null string for string
+;   fields. In any case, you will have to check for undefined variables before
+;   you try to do something with the value. For a numerical field, the code
+;   might look something like this:
+;
+;      fieldID = FSC_FIELD(parent, Title="X Size:", Value=256, Object=fieldObject, Digits=3)
+;      currentValue = fieldObject->Get_Value()
+;      IF Finite(currentValue) EQ 0 THEN Print, 'Value is Undefined' ELSE Print, currentValue
+;
+;   Additional examples are provided in the numerical example fields in Example Program below.
+;
+;   Setting the value of the compound widget is the same as calling the Set_Value
+;   method on the object reference. In other words, these two statements are equivalent.
+;
+;        fieldObject->Set_Value, 45.4
+;        Widget_Control, fieldID, Set_Value=45.4
+;
+;   The data type of the value is determined from the value itself. Be sure you set it appropriately.
+;
+; OBJECT PROCEDURE METHODS:
+;
+;   GetProperty -- This method allows various properties of the widget to be
+;       returned via output keywords. The keywords that are available are:
+;
+;       CR_Only -- A flag, if set, means only report carriage return events.
+;       DataType -- The data type of the field variable.
+;       Decimal -- Set this keyword to the number of digits to the right of the decimal
+;              point in FLOATVALUE and DOUBLEVALUE numbers.
+;       Digits -- Set this keyword to the number of digits permitted in INTERGERVALUE and LONGVALUE numbers.
+;       Event_Func -- The name of the event handler function.
+;       Event_Pro -- The name of the event handler function.
+;       Has_Focus -- Set to 1 if the text widget currently has the keyboard focus.
+;       Highlight -- The highlight flag.
+;       NoEdit -- The NoEdit flag.
+;       NonSensitive -- The NonSensitive flag.
+;       Undefined -- The "value" of any undefined value.
+;       UValue -- The user value assigned to the compound widget.
+;       Value -- The "value" of the compound widget.
+;     Name -- A scalar string name of the object.
+;
+;   Resize -- This method allows you to resize the compound widget's text field.
+;        The value parameter is an X screen size for the entire widget. The text
+;        widget is sized by using the value obtained from this value minus the
+;        X screen size of the label widget.
+;
+;          objectRef->Resize, screen_xsize_value
+;
+;   Set_Value -- This method allows you to set the "value" of the field. It takes
+;       one positional parameter, which is the value.
+;
+;          objectRef->Set_Value, 5
+;
+;   SetProperty -- This method allows various properties of the widget to be
+;       set via input keywords. The keywords that are available are:
+;
+;       CR_Only -- Set this keyword if you only want Carriage Return events.
+;       Decimal -- Set this keyword to the number of digits to the right of the decimal
+;              point in FLOAT and DOUBLE numbers.
+;       Digits -- Set this keyword to the number of digits permitted in INTERGER and LONG numbers.
+;       Event_Func -- Set this keyword to the name of an Event Function.
+;       Event_Pro -- Set this keyword to the name of an Event Procedure.
+;       Highlight -- Set this keyword to highlight the existing text
+;                    when the widget gets the keyboard focus
+;       LabelSize --  The X screen size of the Label Widget.
+;       Name -- A scalar string name of the object. (default = '')
+;       NoEdit -- Set this keyword to make the text widget uneditable
+;       NonSensitive -- Set this keyword to make the widget nonsensitive
+;       Scr_XSize -- The X screen size of the text widget.
+;       Scr_YSize -- The Y screen size of the text widget.
+;       Title -- The text to go on the Label Widget.
+;       UValue -- A user value for any purpose.
+;       Value -- The "value" of the compound widget.
+;       XSize -- The X size of the Text Widget.
+;
+;   SetTabNext -- This method allows you to specify which field to go to when a TAB character
+;      is typed in the text widget. See the Example program below for an example of how to
+;      use this method.
+;
+; OBJECT FUNCTIONS METHODS:
+;
+;      Get_Value -- Returns the "value" of the field. No parameters. Will be undefined
+;          if a "number" field is blank. Should be checked before using:
+;
+;          IF N_Elements(objectRef->Get_Value()) NE 0 THEN Print, Value is: ', objectRef->Get_Value()
+;
+;      GetID -- Returns the widget identifier of the compound widget's top-level base.
+;         (The first child of the parent widget.) No parameters.
+;
+;      GetLabelSize -- Returns the X screen size of the label widget. No parameters.
+;
+;      GetTextID -- Returns the widget identifier of the compound widget's text widget.
+;         No parameters.
+;
+;      GetTextSize -- Returns the X screen size of the text widget. No parameters.
+;
+; PRIVATE OBJECT METHODS:
+;
+;   Although there is really no such thing as a "private" method in IDL's
+;   object implementation, some methods are used internally and not meant to
+;   be acessed publicly. Here are a few of those methods. I list them because
+;   it may be these private methods are ones you wish to override in subclassed
+;   objects.
+;
+;      MoveTab -- This method moves the focus to the widget identified in the "next" field,
+;        which must be set with the SetTabNext method. No parameters. Called automatically
+;        when a TAB character is typed in the text widget.
+;
+;      Text_Events -- The main event handler method for the compound widget. All
+;        text widget events are processed here.
+;
+;      ReturnValue -- This function method accepts a string input value and converts
+;        it to the type of data requested by the user.
+;
+;      Validate -- This function method examines all text input and removes unwanted
+;        characters, depending upon the requested data type for the field. It makes it
+;        impossible, for example, to type alphanumeric characters in an INTEGER field.
+;
+; EXAMPLE:
+;
+;   An example program is provided at the end of the FSC_FIELD code. To run it,
+;   type these commands:
+;
+;      IDL> .Compile FSC_Field
+;      IDL> Example
+;
+; MODIFICATION HISTORY:
+;
+;   Written by: David W. Fanning, 18 October 2000. Based heavily on an earlier
+;      FSC_INPUTFIELD program and new ideas about the best way to write
+;      widget objects.
+;   Added LABEL_LEFT, LABEL_RIGHT, and UNDEFINED keywords. 29 Dec 2000. DWF.
+;   Modified the way the value is returned in the GET_VALUE method and the
+;      GET_VALUE function. Modified Example program to demonstrate. 30 Dec 2000. DWF.
+;   Added NOEDIT and NONSENSITIVE keywords, with corresponding SETEDIT and SETSENNSITIVE
+;      methods. 19 Jan 2001. DWF.
+;   Actually followed through with the changes I _said_" I made 29 Dec 2000. (Don't ask....) 13 June 2001. DWF.
+;   Added GetTextSize and GetLabelSize methods for obtaining the X screen
+;      size of the text and label widgets, respectively. 21 July 2001. DWF.
+;   Fixed a problem in SetProperty method where I was setting self.xsize, which doesn't exist. 24 April 2002. DWF.
+;   Small modification to the SetEdit method. 6 August 2003. DWF.
+;   Added Highlight keyword. Ported Focus_Events keyword from
+;      fsc_inputfield.pro. Updated documentation. 17 November
+;      2004. DWF and Benjamin Hornberger
+;   Added Has_Focus keyword to the GetProperty method. 18 November
+;      2004. Benjamin Hornberger
+;   Fixed bug in GetProperty method (set value to *self.undefined if
+;      *self.value is undefined. 24 Feb 2004. Benjamin Hornberger
+;   Modified FOCUS_EVENTS keyword handling so that *all* focus events are now
+;      passed to specified event handlers. Check event.select to see if the
+;      widget is gaining or losing focus. 10 August 2005. DWF.
+;   Added new tabbing functionality, introduced in IDL 6.2. To use tabbing
+;      functionality natually, the HIGHTLIGHT keywords must be set.
+;      See included EXAMPLE program for details. 10 August 2005. DWF.
+;   Added functionality to covert double precision values to strings properly. 30 Nov 2005. DWF.
+;-
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright © 1999-2005 Fanning Software Consulting
+;
+; This software is provided "as-is", without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose, including commercial applications, and to alter it and
+; redistribute it freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product, an acknowledgment in the product documentation
+;    would be appreciated, but is not required.
+;
+; 2. Altered source versions must be plainly marked as such, and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software, visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+;
+
+
+
+FUNCTION FSC_Field_Error_Message, theMessage, Traceback=traceback, NoName=noName, _Extra=extra
+
+On_Error, 2
+
+   ; Check for presence and type of message.
+
+IF N_Elements(theMessage) EQ 0 THEN theMessage = !Error_State.Msg
+s = Size(theMessage)
+messageType = s[s[0]+1]
+IF messageType NE 7 THEN BEGIN
+   Message, "The message parameter must be a string.", _Extra=extra
+ENDIF
+
+   ; Get the call stack and the calling routine's name.
+
+Help, Calls=callStack
+callingRoutine = (StrSplit(StrCompress(callStack[1])," ", /Extract))[0]
+
+   ; Are widgets supported? Doesn't matter in IDL 5.3 and higher.
+
+widgetsSupported = ((!D.Flags AND 65536L) NE 0) OR Float(!Version.Release) GE 5.3
+IF widgetsSupported THEN BEGIN
+   IF Keyword_Set(noName) THEN answer = Dialog_Message(theMessage, _Extra=extra) ELSE BEGIN
+      IF StrUpCase(callingRoutine) EQ "$MAIN$" THEN answer = Dialog_Message(theMessage, _Extra=extra) ELSE $
+         answer = Dialog_Message(StrUpCase(callingRoutine) + ": " + theMessage, _Extra=extra)
+   ENDELSE
+ENDIF ELSE BEGIN
+      Message, theMessage, /Continue, /NoPrint, /NoName, /NoPrefix, _Extra=extra
+      Print, '%' + callingRoutine + ': ' + theMessage
+      answer = 'OK'
+ENDELSE
+
+   ; Provide traceback information if requested.
+
+IF Keyword_Set(traceback) THEN BEGIN
+   Help, /Last_Message, Output=traceback
+   Print,''
+   Print, 'Traceback Report from ' + StrUpCase(callingRoutine) + ':'
+   Print, ''
+   FOR j=0,N_Elements(traceback)-1 DO Print, "     " + traceback[j]
+ENDIF
+
+RETURN, answer
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Field::GetLabelSize
+
+; This method returns the X screen size of the label widget.
+
+geom = Widget_Info(self.labelID, /Geometry)
+RETURN, geom.scr_xsize
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Field::GetTextSize
+
+; This method returns the X screen size of the text widget.
+
+geom = Widget_Info(self.textID, /Geometry)
+RETURN, geom.scr_xsize
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_Field::MoveTab
+
+   ; If the TABNEXT field has a valid widget, will set the
+   ; focus to this widget when a TAB event occurs in the widget.
+
+IF  NOT Widget_Info(self.tabnext, /Valid_ID) THEN RETURN
+Widget_Control, self.tabnext, /Input_Focus
+Widget_Control, self.tabnext, Get_Value=theText
+theText = theText[0]
+Widget_Control, self.tabnext, Set_Text_Select=[0,StrLen(theText)]
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_Field::SetTabNext, nextID
+
+; This method assigns a text id the TABNEXT field of
+; the object. This is required for the MOVETAB method.
+
+self.tabnext = nextID
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Field::GetTextID
+
+; This method returns the ID of the text widget of the compound widget.
+
+RETURN, self.textID
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_Field::Resize, newsize
+
+; This method resizes the widget by making the text widget fit the new size.
+
+l = Widget_Info(self.labelID, /Geometry)
+Widget_Control, self.textID, Scr_XSize = (newsize - l.scr_xsize)
+
+   ; Set the text widget sensitivitiy.
+
+
+Widget_Control, self.textID, Sensitive=1-Keyword_Set(self.nonsensitive)
+
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Field::GetID
+
+; This method returns the ID of the top-level base of the compound widget.
+
+RETURN, self.tlb
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Field::Geometry
+
+; This method returns the geometry of the compound widget.
+
+RETURN, Widget_Info(self.tlb,/Geometry)
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Field::Get_Value
+
+; This method returns the actual value of the compound widget.
+
+IF N_Elements(*self.theValue) EQ 0 THEN RETURN, *self.undefined ELSE RETURN, *self.theValue
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_Field::Set_Value, value
+
+; This method sets the value of the compound widget.
+
+   ; Error Handling.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_Field_Error_Message(/Traceback)
+   RETURN
+ENDIF
+
+dataType = Size(value, /TNAME)
+CASE dataType OF
+   'BYTE'   : BEGIN
+      genType = 'INTEGER'
+      dataType = 'INT'
+      positive = 1
+      value = Fix(value)
+      Message, 'BYTE data not supported. Value will be converted to INT.', /Informational
+      END
+   'INT'    : genType = 'INTEGER'
+   'LONG'   : genType = 'INTEGER'
+   'LONG64' : genType = 'INTEGER'
+   'UINT'   : genType = 'UNSIGNED'
+   'ULONG'  : genType = 'UNSIGNED'
+   'ULONG64': genType = 'UNSIGNED'
+   'FLOAT'  : genType = 'FLOAT'
+   'DOUBLE' : genType = 'DOUBLE'
+   'STRING' : genType = 'STRING'
+   ELSE     : Message, 'Data type ' + dataType + ' is not supported. Returning.'
+ENDCASE
+self.dataType = dataType
+self.gentype = genType
+
+IF self.gentype EQ 'DOUBLE' THEN theText = DblToStr(value) ELSE theText = StrTrim(value,2)
+theText = self->Validate(theText)
+
+   ; Load the value in the widget.
+
+Widget_Control, self.textID, Set_Value=theText, Set_Text_Select=[StrLen(theText),0]
+self.theText = theText
+
+   ; Set the actual value of the compound widget.
+
+*self.theValue = self->ReturnValue(theText)
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Field::Validate, value
+
+; This function eliminates illegal characters from a string that represents
+; a number. The return value is a properly formatted string that can be turned into
+; an INT, LONG, FLOAT, or DOUBLE value. This is a "private" method.
+;
+; + 43B
+; - 45B
+; . 46B
+; 0 - 9 48B -57B
+; 'eEdD' [101B, 69B, 100B, 68B]
+
+   ; Error Handling.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_Field_Error_Message(/Traceback)
+   testValue = self->ReturnValue(value)
+   IF String(testValue) NE 'NULLVALUE' THEN numCheck = Finite(testValue) ELSE numCheck = 1
+   IF numCheck THEN BEGIN
+      RETURN, retValue
+   ENDIF ELSE BEGIN
+      ok = Dialog_Message('The requested number is not representable.')
+      RETURN, ""
+   ENDELSE
+ENDIF
+
+   ; A null string should be returned at once.
+
+IF N_Elements(value) EQ 0 THEN value = ""
+value = value[0]
+IF value EQ "" THEN RETURN, String(value)
+
+   ; No leading or trailing blank characters to evaluate.
+
+value = StrTrim(value, 2)
+
+   ; A string value should be returned at once. Nothing to check.
+
+IF StrUpCase(self.gentype) EQ 'STRING' THEN RETURN, String(value)
+
+   ; Check integers and longs. A "-" or "+" in the first character is allowed. Otherwise,
+   ; only number between 0 and 9, or 43B to 57B.
+
+IF self.gentype EQ 'INTEGER' THEN BEGIN
+
+   returnValue = Ptr_New(/Allocate_Heap)
+   asBytes = Byte(value)
+
+   IF self.positive THEN BEGIN
+      IF (asBytes[0] EQ 43B) OR $
+         (asBytes[0] GE 48B AND asBytes[0] LE 57B) THEN *returnValue = [asBytes[0]]
+   ENDIF ELSE BEGIN
+      IF (asBytes[0] EQ 45B) OR (asBytes[0] EQ 43B) OR $
+         (asBytes[0] GE 48B AND asBytes[0] LE 57B) THEN *returnValue = [asBytes[0]]
+   ENDELSE
+   length = StrLen(asBytes)
+   IF length EQ 1 THEN BEGIN
+      IF N_Elements(*returnValue) EQ 0 THEN  *returnValue = [32B] ELSE $
+            *returnValue = [asBytes[0]]
+   ENDIF ELSE BEGIN
+      FOR j=1,length-1 DO BEGIN
+         IF (asBytes[j] GE 48B AND asBytes[j] LE 57B) THEN BEGIN
+            IF N_Elements(*returnValue) EQ 0 THEN  *returnValue = [asBytes[j]] ELSE $
+               *returnValue = [*returnValue, asBytes[j]]
+         ENDIF
+      ENDFOR
+  ENDELSE
+  IF N_Elements(*returnValue) NE 0 THEN retValue = String(*returnValue) ELSE retValue = ""
+  Ptr_Free, returnValue
+
+      ; Check for digit restrictions.
+
+  IF self.digits GT 0 THEN BEGIN
+      retValue = StrTrim(retValue, 2)
+      IF StrMid(retValue, 0, 1) EQ "-" THEN digits = self.digits + 1 ELSE digits = self.digits
+      retValue = StrMid(retValue, 0, digits)
+  ENDIF
+
+  RETURN, retValue
+
+ENDIF
+
+   ; Check unsigned data types.
+
+IF self.gentype EQ 'UNSIGNED' THEN BEGIN
+
+   returnValue = Ptr_New(/Allocate_Heap)
+   asBytes = Byte(value)
+
+   IF self.positive THEN BEGIN
+      IF (asBytes[0] GE 48B AND asBytes[0] LE 57B) THEN *returnValue = [asBytes[0]]
+   ENDIF ELSE BEGIN
+      IF (asBytes[0] GE 48B AND asBytes[0] LE 57B) THEN *returnValue = [asBytes[0]]
+   ENDELSE
+   length = StrLen(asBytes)
+   IF length EQ 1 THEN BEGIN
+      IF N_Elements(*returnValue) EQ 0 THEN  *returnValue = [32B] ELSE $
+            *returnValue = [asBytes[0]]
+   ENDIF ELSE BEGIN
+      FOR j=1,length-1 DO BEGIN
+         IF (asBytes[j] GE 48B AND asBytes[j] LE 57B) THEN BEGIN
+            IF N_Elements(*returnValue) EQ 0 THEN  *returnValue = [asBytes[j]] ELSE $
+               *returnValue = [*returnValue, asBytes[j]]
+         ENDIF
+      ENDFOR
+  ENDELSE
+  IF N_Elements(*returnValue) NE 0 THEN retValue = String(*returnValue) ELSE retValue = ""
+  Ptr_Free, returnValue
+
+      ; Check for digit restrictions.
+
+  IF self.digits GT 0 THEN BEGIN
+      retValue = StrTrim(retValue, 2)
+      digits = self.digits
+      retValue = StrMid(retValue, 0, digits)
+  ENDIF
+
+  RETURN, retValue
+
+ENDIF
+
+   ; Check floating values. (+,-) in first character or after 'eEdD'.
+   ; Only numbers, signs, decimal points, and 'eEdD' allowed.
+
+IF (self.gentype EQ 'FLOAT') OR (self.gentype EQ 'DOUBLE') THEN BEGIN
+   returnValue = Ptr_New(/Allocate_Heap)
+   asBytes = Byte(value)
+   IF self.positive THEN BEGIN
+      IF (asBytes[0] EQ 43B) OR $
+         (asBytes[0] GE 48B AND asBytes[0] LE 57B) OR $
+         (asBytes[0] EQ 46B) THEN *returnValue = [asBytes[0]]
+      IF (asBytes[0] EQ 46B) THEN haveDecimal = 1 ELSE haveDecimal = 0
+   ENDIF ELSE BEGIN
+      IF (asBytes[0] EQ 45B) OR (asBytes[0] EQ 43B) OR $
+         (asBytes[0] GE 48B AND asBytes[0] LE 57B) OR $
+         (asBytes[0] EQ 46B) THEN *returnValue = [asBytes[0]]
+      IF (asBytes[0] EQ 46B) THEN haveDecimal = 1 ELSE haveDecimal = 0
+   ENDELSE
+   haveExponent = 0
+   length = StrLen(asBytes)
+   prevByte = asBytes[0]
+   exponents = Byte('eEdD')
+   IF length EQ 1 THEN BEGIN
+      IF N_Elements(*returnValue) EQ 0 THEN  *returnValue = [32B] ELSE $
+            *returnValue = [asBytes[0]]
+   ENDIF ELSE BEGIN
+      FOR j=1,length-1 DO BEGIN
+         IF (asBytes[j] GE 48B AND asBytes[j] LE 57B) THEN BEGIN
+            IF N_Elements(*returnValue) EQ 0 THEN  *returnValue = [asBytes[j]] ELSE $
+               *returnValue = [*returnValue, asBytes[j]]
+            prevByte = asBytes[j]
+         ENDIF ELSE BEGIN
+
+            ; What kind of thing is it?
+
+            IF (asBytes[j] EQ 46B) THEN BEGIN ; A decimal point.
+               IF haveDecimal EQ 0 THEN BEGIN
+                  *returnValue = [*returnValue, asBytes[j]]
+                  haveDecimal = 1
+                  prevByte = asBytes[j]
+               ENDIF
+            ENDIF
+
+            IF (asBytes[j] EQ 45B) OR (asBytes[j] EQ 43B) THEN BEGIN ; A + or - sign.
+               index = Where(exponents EQ prevByte, count)
+               IF count EQ 1 AND haveExponent THEN BEGIN
+                  *returnValue = [*returnValue, asBytes[j]]
+                  haveDecimal = 1
+                  prevByte = asBytes[j]
+               ENDIF
+            ENDIF
+
+            index = Where(exponents EQ asBytes[j], count)
+            IF count EQ 1 AND haveExponent EQ 0 THEN BEGIN ; An exponent
+               *returnValue = [*returnValue, asBytes[j]]
+               haveExponent = 1
+               prevByte = asBytes[j]
+            ENDIF
+         ENDELSE
+      ENDFOR
+   ENDELSE
+      IF N_Elements(*returnValue) NE 0 THEN BEGIN
+
+      retValue = String(*returnValue)
+      retValue = StrTrim(retValue, 2)
+
+               ; Check for decimal restrictions
+
+      IF self.decimal GE 0 THEN BEGIN
+         theDecimalPt = StrPos(retValue, '.')
+         IF theDecimalPt NE -1 THEN retValue = StrMid(retValue, 0, theDecimalPt + self.decimal + 1)
+      ENDIF
+
+   ENDIF ELSE retValue = ""
+   Ptr_Free, returnValue
+
+      ; Is this a representable number?
+
+   testValue = self->ReturnValue(retValue)
+   IF String(testValue) NE 'NULLVALUE' THEN numCheck = Finite(testValue) ELSE numCheck = 1
+   IF numCheck THEN BEGIN
+      RETURN, retValue
+   ENDIF ELSE BEGIN
+      ok = Dialog_Message('The requested number is not representable.')
+      RETURN, ""
+   ENDELSE
+ENDIF
+
+
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Field::ReturnValue, inputValue
+
+; This method takes a string and turns it into a number,
+; depending upon the current data type of the compound widget.
+; This is a "private" method. For numbers, if the input value
+; is a null string, then an undefined variable is returned.
+
+   ; Error Handling.
+
+ON_IOERROR, CatchIt
+
+CASE self.datatype OF
+   'BYTE': IF inputValue EQ "" OR inputValue EQ "-" OR inputValue EQ "+" THEN $
+      retValue = 'NULLVALUE' ELSE retValue = Fix(inputValue)
+   'INT': IF inputValue EQ "" OR inputValue EQ "-" OR inputValue EQ "+" THEN $
+      retValue = 'NULLVALUE' ELSE retValue = Fix(inputValue)
+   'LONG': IF inputValue EQ "" OR inputValue EQ "-" OR inputValue EQ "+" THEN $
+      retValue = 'NULLVALUE' ELSE retValue = Long(inputValue)
+   'LONG64': IF inputValue EQ "" OR inputValue EQ "-" OR inputValue EQ "+" THEN $
+      retValue = 'NULLVALUE' ELSE retValue = Long64(inputValue)
+   'UINT': IF inputValue EQ "" OR inputValue EQ "-" OR inputValue EQ "+" THEN $
+      retValue = 'NULLVALUE' ELSE retValue = UInt(inputValue)
+   'ULONG': IF inputValue EQ "" OR inputValue EQ "-" OR inputValue EQ "+" THEN $
+      retValue = 'NULLVALUE' ELSE retValue = ULong(inputValue)
+   'ULONG64': IF inputValue EQ "" OR inputValue EQ "-" OR inputValue EQ "+" THEN $
+      retValue = 'NULLVALUE' ELSE retValue = ULong64(inputValue)
+   'FLOAT' : IF inputValue EQ "" OR inputValue EQ "-" OR inputValue EQ "+" THEN $
+      retValue = 'NULLVALUE' ELSE retValue = Float(inputValue)
+   'DOUBLE': IF inputValue EQ "" OR inputValue EQ "-" OR inputValue EQ "+" THEN $
+      retValue = 'NULLVALUE' ELSE retValue = Double(inputValue)
+   'STRING' : retValue = inputValue
+ENDCASE
+
+RETURN, retValue
+
+CatchIt:
+   retValue = 'NULLVALUE'
+   RETURN, retValue
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Field::TextEvents, event
+
+; The event handler method for the text widget of the compound widget.
+
+   ; Error Handling.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_Field_Error_Message(/Traceback)
+   RETURN, 0
+ENDIF
+
+   ; Get the previous text, the current cursor location in the text widget,
+   ; and indicate this is not a Carriage Return event.
+
+previousText = self.theText
+textLocation = Widget_Info(event.id, /Text_Select)
+cr_event = 0
+
+; Handle keyboard focus events.
+IF Tag_Names(event, /structure_name) EQ 'WIDGET_KBRD_FOCUS' THEN BEGIN
+    IF event.enter THEN BEGIN
+        self.has_focus = 1L
+        IF self.highlight THEN BEGIN
+            Widget_Control, self.textID, get_value=text
+            text = text[0]
+            Widget_Control, self.textID, set_text_select=[0, Strlen(text)]
+        ENDIF
+
+        IF self.focus THEN BEGIN
+
+              ; Get the current contents of text widget. Validate it.
+
+            Widget_Control, self.textID, Get_Value=newText
+            newText = newText[0]
+            validText = self->Validate(newText)
+
+               ; Load the valid text.
+
+           self.theText = validText
+           testValue  = self->ReturnValue(validText)
+           IF String(testValue) EQ "NULLVALUE" THEN BEGIN
+               Ptr_Free, self.theValue
+               self.theValue = Ptr_New(/Allocate_Heap)
+           ENDIF ELSE *self.theValue = testValue
+
+           ; Send the keyboard focus events if there is an event handler to accept them.
+           IF self.event_func NE "" THEN BEGIN
+              thisEvent = {FSC_Field_Event, self.tlb, event.top, 0L, self.theValue, self.dataType, self}
+              RETURN, thisEvent
+           ENDIF
+
+           IF self.event_pro NE "" THEN BEGIN
+              thisEvent = {FSC_Field_Event, self.tlb, event.top, 0L, self.theValue, self.dataType, self}
+              RETURN, thisEvent
+           ENDIF
+
+       ENDIF
+
+       RETURN, 0
+
+    ENDIF ELSE BEGIN
+
+        self.has_focus = 0L
+        Widget_Control, self.textID, set_text_select=[0]
+
+        IF self.focus THEN BEGIN
+
+              ; Get the current contents of text widget. Validate it.
+
+            Widget_Control, self.textID, Get_Value=newText
+            newText = newText[0]
+            validText = self->Validate(newText)
+
+               ; Load the valid text.
+
+           self.theText = validText
+           testValue  = self->ReturnValue(validText)
+           IF String(testValue) EQ "NULLVALUE" THEN BEGIN
+               Ptr_Free, self.theValue
+               self.theValue = Ptr_New(/Allocate_Heap)
+           ENDIF ELSE *self.theValue = testValue
+
+           ; Send the keyboard focus events if there is an event handler to accept them.
+           IF self.event_func NE "" THEN BEGIN
+              thisEvent = {FSC_Field_Event, self.tlb, event.top, 0L, self.theValue, self.dataType, self}
+              RETURN, thisEvent
+           ENDIF
+
+           IF self.event_pro NE "" THEN BEGIN
+              thisEvent = {FSC_Field_Event, self.tlb, event.top, 0L, self.theValue, self.dataType, self}
+              RETURN, thisEvent
+           ENDIF
+
+       ENDIF
+
+    ENDELSE
+
+   RETURN, 0
+
+ENDIF
+
+   ; What kind of event is this?
+
+possibleTypes = ['INSERT SINGLE CHARACTER', 'INSERT MULTIPLE CHARACTERS', 'DELETE TEXT', 'SELECT TEXT']
+thisType = possibleTypes[event.type]
+
+   ; Branch on event type.
+
+CASE thisType OF
+
+   'INSERT SINGLE CHARACTER': BEGIN
+
+            ; If the character is a TAB see if there is something to do.
+
+         IF event.ch EQ 9B THEN BEGIN
+            self->MoveTab
+            RETURN, 0
+         ENDIF
+
+            ; Get the current contents of text widget. Validate it.
+
+         Widget_Control, self.textID, Get_Value=newText
+         newText = newText[0]
+         validText = self->Validate(newText)
+
+            ; If it is valid, leave it alone. If not, go back to previous text.
+
+         IF validText NE newText THEN BEGIN
+
+            Widget_Control, self.textID, Set_Value=previousText, Set_Text_Select=[textLocation[0]-1,0]
+
+         ENDIF ELSE BEGIN
+
+            self.theText = validText
+            testValue  = self->ReturnValue(validText)
+            IF String(testValue) EQ "NULLVALUE" THEN BEGIN
+               Ptr_Free, self.theValue
+               self.theValue = Ptr_New(/Allocate_Heap)
+            ENDIF ELSE *self.theValue = testValue
+
+         ENDELSE
+
+            ; Is this a Carriage Return event?
+
+         IF event.ch EQ 10B then cr_event = 1
+      ENDCASE
+
+   'INSERT MULTIPLE CHARACTERS': BEGIN
+
+            ; Same as above, but for all the characters you are inserting.
+
+         Widget_Control, self.textID, Get_Value=newText
+         newText = newText[0]
+         validText = self->Validate(newText)
+         IF validText NE newText THEN BEGIN
+            Widget_Control, self.textID, Set_Value=previousText, Set_Text_Select=[textLocation[0]-1,0]
+         ENDIF ELSE BEGIN
+            self.theText = validText
+            testValue  = self->ReturnValue(validText)
+            IF String(testValue) EQ "NULLVALUE" THEN BEGIN
+               Ptr_Free, self.theValue
+               self.theValue = Ptr_New(/Allocate_Heap)
+            ENDIF ELSE *self.theValue = testValue
+         ENDELSE
+      ENDCASE
+
+   'DELETE TEXT': BEGIN
+
+            ; Get the current contents of text widget. Validate it.
+
+         Widget_Control, self.textID, Get_Value=newText
+         newText = newText[0]
+         validText = self->Validate(newText)
+
+            ; Load the valid text.
+
+        Widget_Control, self.textID, Set_Value=validText, Set_Text_Select=[textLocation[0],0]
+        self.theText = validText
+        testValue  = self->ReturnValue(validText)
+        IF String(testValue) EQ "NULLVALUE" THEN BEGIN
+            Ptr_Free, self.theValue
+            self.theValue = Ptr_New(/Allocate_Heap)
+        ENDIF ELSE *self.theValue = testValue
+
+      ENDCASE
+
+   'SELECT TEXT': ; Nothing to do.
+
+ENDCASE
+
+   ; Do you report all events, or only Carriage Return events?
+
+IF self.cr_only THEN BEGIN
+
+   IF self.event_func NE "" THEN BEGIN
+      thisEvent = {FSC_Field_Event, self.tlb, event.top, 0L, self.theValue, self.dataType, self}
+      IF cr_event THEN RETURN, thisEvent
+   ENDIF
+
+   IF self.event_pro NE "" THEN BEGIN
+      thisEvent = {FSC_Field_Event, self.tlb, event.top, 0L, self.theValue, self.dataType, self}
+      IF cr_event THEN RETURN, thisEvent
+   ENDIF
+
+ENDIF ELSE BEGIN
+
+   IF self.event_func NE "" THEN BEGIN
+      thisEvent = {FSC_Field_Event, self.tlb, event.top, 0L, self.theValue, self.dataType, self}
+      RETURN, thisEvent
+   ENDIF
+
+   IF self.event_pro NE "" THEN BEGIN
+      thisEvent = {FSC_Field_Event, self.tlb, event.top, 0L, self.theValue, self.dataType, self}
+      RETURN, thisEvent
+   ENDIF
+
+ENDELSE
+
+RETURN, 0
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_Field::GetProperty, $
+;
+; This method allows you to obtain various properties of the compound widget via output keywords.
+;
+   CR_Only=cr_only, $               ; Set this keyword if you only want Carriage Return events.
+   DataType=datatype, $             ; The datatype of the compound widget.
+   Decimal=decimal, $               ; The number of digits to the right of the decimal point in FLOAT numbers.
+   Digits=digits, $                 ; The number of digits permitted in INTERGERVALUE and LONGVALUE numbers.
+   Event_Func=event_func, $         ; Set this keyword to the name of an Event Function.
+   Event_Pro=event_pro, $           ; Set this keyword to the name of an Event Procedure.
+   Focus_Events=focus_events, $     ; Set this keyword to inquire whether or not events are reported when the keyboard focus is lost.
+   Has_Focus=has_focus, $           ; Set this keyword to inquire whether of not the widget has the keyboard focus currently.
+   Highlight=highlight, $           ; The highlight flag.
+   Name=Name, $                     ; The name of the object.
+   NoEdit=noedit, $                 ; Setting this keywords makes the text widget non-editable.
+   NonSensitive=nonsensitive, $     ; Setting this keywords makes the text widget non-sensitive.
+   Undefined=undefined, $           ; The "value" of any undefined value.
+   UValue=uvalue, $                 ; A user value for any purpose.
+   Value=value                      ; The "value" of the compound widget.
+
+   ; Error Handling.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_Field_Error_Message(/Traceback)
+   RETURN
+ENDIF
+
+   ; Get the properties.
+
+cr_only = self.cr_only
+datatype = self.datatype
+decimal = self.decimal
+digits = self.digits
+event_func = self.event_func
+event_pro = self.event_pro
+focus_events = self.focus
+has_focus = self.has_focus
+highlight = self.highlight
+name = self.name
+noedit = self.noedit
+nonsensitive = self.nonsensitive
+Widget_Control, self.tlb, Get_UValue=uvalue
+IF N_Elements(*self.theValue) EQ 0 THEN value = *self.undefined ELSE value = *self.thevalue
+undefined = *self.undefined
+
+END ;--------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_Field::SetProperty, $
+;
+; This method allows you to set various properties of the compound widget.
+;
+   CR_Only=cr_only, $               ; Set this keyword if you only want Carriage Return events.
+   Decimal=decimal, $               ; Set this keyword to the number of digits to the right of the decimal point in FLOAT values..
+   Digits=digits, $                 ; Set this keyword to the number of digits permitted in INTEGER values.
+   Event_Func=event_func, $         ; Set this keyword to the name of an Event Function.
+   Event_Pro=event_pro, $           ; Set this keyword to the name of an Event Procedure.
+   Focus_Events=focus_events, $     ; Set this keyword to turn on or off event reporting when the keyboard focus is lost.
+   Highlight=highlight, $           ; Set this keyword to highlight the text when it gets keyboard focus.
+   LabelSize=labelsize, $           ; The X screen size of the Label Widget.
+   Name=name, $                     ; A scalar string name for the object.
+   NoEdit=noedit, $                 ; Setting this keywords makes the text widget non-editable.
+   NonSensitive=nonsensitive, $     ; Setting this keywords makes the text widget non-sensitive.
+   Scr_XSize=scr_xsize, $           ; The X screen size of the text widget.
+   Scr_YSize=scr_ysize, $           ; The Y screen size of the text widget.
+   Title=title, $                   ; The text to go on the Label Widget.
+   Undefined=undefinded, $          ; Set to "value" of undefined value.
+   UValue=uvalue, $                 ; A user value for any purpose.
+   Value=value, $                   ; The "value" of the compound widget.
+   XSize=xsize                      ; The X size of the Text Widget.
+
+   ; Error Handling.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_Field_Error_Message(/Traceback)
+   RETURN
+ENDIF
+
+   ; Set the properties, if needed.
+
+IF N_Elements(cr_only) NE 0 THEN self.cr_only = cr_only
+IF Keyword_Set(decimal)THEN self.decimal = decimal
+IF Keyword_Set(digits)THEN self.digits = digits
+IF N_Elements(event_func) NE 0 THEN self.event_func = event_func
+IF N_Elements(event_pro) NE 0 THEN self.event_pro = event_pro
+IF N_Elements(focus_events) NE 0 THEN self.focus = keyword_set(focus)
+IF N_Elements(highlight) NE 0 THEN self.highlight = Keyword_Set(highlight)
+IF N_Elements(labelsize) NE 0 THEN BEGIN
+   Widget_Control, self.labelID, XSize=labelsize
+ENDIF
+IF N_Elements(scr_xsize) NE 0 THEN BEGIN
+   Widget_Control, self.textID, Scr_XSize=scr_xsize
+ENDIF
+IF N_Elements(scr_ysize) NE 0 THEN BEGIN
+   Widget_Control, self.textID, Scr_YSize=scr_ysize
+ENDIF
+IF N_Elements(title) NE 0 THEN Widget_Control, self.labelID, Set_Value=title
+IF N_Elements(uvalue) NE 0 THEN Widget_Control, self.tlb, Set_UValue=uvalue
+If N_Elements(name) NE 0 Then self.name = String(name[0])
+IF N_Elements(xsize) NE 0 THEN BEGIN
+   Widget_Control, self.textID, XSize=xsize
+ENDIF
+IF N_Elements(noedit) THEN BEGIN
+   self.noedit = Keyword_Set(noedit)
+   Widget_Control, self.textID, Editable=1-self.noedit
+ENDIF
+IF N_Elements(nonsensitive) THEN BEGIN
+   self.nonsensitive = Keyword_Set(nonsensitive)
+   Widget_Control, self.textID, Sensitive=1-self.nonsensitive
+ENDIF
+
+   ; Set up the value.
+
+IF N_Elements(value) NE 0 THEN BEGIN
+
+   ; Set up data type and general type.
+
+   dataType = Size(value, /TNAME)
+   CASE dataType OF
+      'BYTE'   : BEGIN
+         genType = 'INTEGER'
+         dataType = 'INT'
+         positive = 1
+         *self.theValue = Fix(*self.theValue)
+         Message, 'BYTE data not supported. Value will be converted to INT.', /Informational
+         END
+      'INT'    : genType = 'INTEGER'
+      'LONG'   : genType = 'INTEGER'
+      'LONG64' : genType = 'INTEGER'
+      'UINT'   : genType = 'UNSIGNED'
+      'ULONG'  : genType = 'UNSIGNED'
+      'ULONG64': genType = 'UNSIGNED'
+      'FLOAT'  : genType = 'FLOAT'
+      'DOUBLE' : genType = 'DOUBLE'
+      'STRING' : genType = 'STRING'
+      ELSE     : BEGIN
+         Ptr_Free, self.theValue
+         self.theValue = Ptr_New(/Allocate_Heap)
+         Message, 'Data type ' + dataType + ' is not supported. Returning.', /NoName
+         END
+   ENDCASE
+   self.theText = StrTrim(value, 2)
+   *self.theValue = self->ReturnValue(self.theText)
+   Widget_Control, self.textID, Set_Value=self.theText
+   self.dataType = datatype
+   self.genType = genType
+   IF N_Elements(undefined) EQ 0 THEN BEGIN
+   IF genType EQ 'STRING' THEN undefined = "" ELSE undefined = !VALUES.F_NAN
+ENDIF
+
+ENDIF
+
+END ;--------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_Field::SetEdit, editvalue
+
+   ; Error Handling.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_Field_Error_Message(/Traceback)
+   RETURN
+ENDIF
+
+IF N_Elements(editvalue) NE 0 THEN $
+   Widget_Control, self.textID, Editable=Keyword_Set(editvalue)
+END ;--------------------------------------------------------------------------------------------------------------
+
+
+PRO FSC_Field::SetSensitive, value
+
+   ; Error Handling.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_Field_Error_Message(/Traceback)
+   RETURN
+ENDIF
+
+IF N_Elements(value) EQ 0 THEN value = 1
+self.nonsensitive = 1-value
+Widget_Control, self.textID, Sensitive=value
+END ;--------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Field::INIT, $         ; The compound widget FSC_Field INIT method..
+   parent, $                        ; The parent widget. Required for all compound widgets.
+   Column=column, $                 ; Set this keyword to have Label above Text Widget.
+   CR_Only=cr_only, $               ; Set this keyword if you only want Carriage Return events.
+   Decimal=decimal, $               ; Set this keyword to the number of digits to the right of the decimal point in FLOAT.
+   Digits=digits, $                 ; Set this keyword to the number of digits permitted in INTEGER values.
+   Event_Func=event_func, $         ; Set this keyword to the name of an Event Function.
+   Event_Pro=event_pro, $           ; Set this keyword to the name of an Event Procedure.
+   _Extra=extra, $                  ; Passes along extra keywords to the text widget.
+   FieldFont=fieldfont, $           ; The font name for the text in the Text Widget.
+   Focus_Events=focus_events, $     ; Set this keyword to enable event reporting when the keyboard focus is lost or gained.
+   Frame=frame, $                   ; Set this keyword to put a frame around the compound widget.
+   Highlight=highlight, $           ; If this keyword is set, the text is highlighted.
+   Label_Left=label_left, $         ; Set this keyword to align the label to the left of the label.
+   Label_Right=label_right, $       ; Set this keyword to align the labe to the right of the label.
+   LabelFont=labelfont, $           ; The font name for the text in the Label Widget.
+   LabelSize=labelsize, $           ; The X screen size of the Label Widget.
+   Name=name, $                     ; A scalar string name for the object.
+   NoEdit=noedit, $                 ; Setting this keywords makes the text widget non-editable.
+   NonSensitive=nonsensitive, $     ; Setting this keywords makes the text widget non-sensitive.
+   Positive=positive, $             ; Set this keyword to indicate only positive numbers allowed in the field.
+   Scr_XSize=scr_xsize, $           ; The X screen size of the text widget.
+   Scr_YSize=scr_ysize, $           ; The Y screen size of the text widget.
+   Title=title, $                   ; The text to go on the Label Widget.
+   Undefined=undefined, $           ; Set to the value for "undefined" field values.
+   UValue=uvalue, $                 ; A user value for any purpose.
+   Value=value, $                   ; The "value" of the compound widget.
+   XSize=xsize                      ; The X size of the Text Widget.
+
+   ; Error Handling.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_Field_Error_Message(/Traceback)
+   RETURN, 0
+ENDIF
+
+   ; A parent is required.
+
+IF N_Elements(parent) EQ 0 THEN BEGIN
+   Message, 'A PARENT argument is required. Returning...', /NoName
+ENDIF
+
+   ; Check keyword values.
+
+IF N_Elements(column) EQ 0 THEN column = 0
+IF N_Elements(digits) EQ 0 THEN digits = 0 ELSE digits = Fix(digits)
+IF N_Elements(decimal) EQ 0 THEN decimal = -1 ELSE decimal = Fix(decimal)
+IF N_Elements(event_func) EQ 0 THEN event_func = ""
+IF N_Elements(event_pro) EQ 0 THEN event_pro = ""
+IF N_Elements(fieldfont) EQ 0 THEN fieldfont = ""
+IF N_Elements(frame) EQ 0 THEN frame = 0
+IF N_Elements(labelfont) EQ 0 THEN labelfont = ""
+IF N_Elements(labelsize) EQ 0 THEN labelsize = 0
+IF N_Elements(name) EQ 0 THEN name = ""
+noedit = Keyword_Set(noedit)
+nonsensitive = Keyword_Set(nonsensitive)
+positive = Keyword_Set(positive)
+IF N_Elements(scr_xsize) EQ 0 THEN scr_xsize = 0
+IF N_Elements(scr_ysize) EQ 0 THEN scr_ysize = 0
+IF N_Elements(title) EQ 0 THEN title = "Input Value: "
+IF N_Elements(uvalue) EQ 0 THEN uvalue = ""
+IF N_Elements(value) EQ 0 THEN value = ""
+IF N_Elements(xsize) EQ 0 THEN xsize = 0
+
+   ; What data type are we looking for?
+
+dataType = Size(value, /TNAME)
+CASE dataType OF
+   'BYTE'   : BEGIN
+      genType = 'INTEGER'
+      dataType = 'INT'
+      positive = 1
+      value = Fix(value)
+      Message, 'BYTE data not supported. Value will be converted to INT.', /Informational
+      END
+   'INT'    : genType = 'INTEGER'
+   'LONG'   : genType = 'INTEGER'
+   'LONG64' : genType = 'INTEGER'
+   'UINT'   : genType = 'UNSIGNED'
+   'ULONG'  : genType = 'UNSIGNED'
+   'ULONG64': genType = 'UNSIGNED'
+   'FLOAT'  : genType = 'FLOAT'
+   'DOUBLE' : genType = 'DOUBLE'
+   'STRING' : genType = 'STRING'
+   ELSE     : Message, 'Data type ' + dataType + ' is not supported. Returning.', /NoName
+ENDCASE
+
+IF N_Elements(undefined) EQ 0 THEN BEGIN
+   IF genType EQ 'STRING' THEN undefined = "" ELSE undefined = !VALUES.F_NAN
+ENDIF
+
+   ; Populate the object.
+
+self.cr_only = Keyword_Set(cr_only)
+self.datatype = datatype
+self.decimal = decimal
+self.digits = digits
+self.focus = Keyword_Set(focus_events)
+self.highlight = Keyword_Set(highlight)
+self.gentype = genType
+self.parent = parent
+self.event_pro = event_pro
+self.event_func = event_func
+self.positive = positive
+self.undefined = Ptr_New(undefined)
+self.noedit = noedit
+self.nonsensitive = nonsensitive
+If N_Elements(name) NE 0 Then self.name = String(name[0])
+IF Keyword_Set(column) THEN row = 0 ELSE row = 1
+
+   ; Validate the input value.
+
+IF self.gentype EQ 'DOUBLE' THEN value = DblToStr(value) ELSE value = StrTrim(value,2)
+value = self->Validate(value)
+self.theText = value
+
+   ; Create the widgets.
+
+self.tlb = Widget_Base( parent, $  ; The top-level base of the compound widget.
+   Frame=frame, $
+   Row=row, $
+   Column=Keyword_Set(column), $
+   Base_Align_Center=1, $
+   UName=name, $
+   UValue=uvalue, $
+   Event_Pro=event_pro, $
+   Func_Get_Value='FSC_Field_Get_Compound_Widget_Value', $
+   Pro_Set_Value='FSC_Field_Set_Compound_Widget_Value', $
+   Event_Func=event_func )
+
+; Update for tabbing in IDL 6.2.
+IF Float(!Version.Release) GT 6.1 THEN BEGIN
+   Widget_Control, self.tlb, TAB_MODE=1
+ENDIF
+
+self.labelID = Widget_Label( self.tlb, Value=title, Font=labelfont, $ ; The Label Widget.
+  Scr_XSize=labelsize, UValue=self, Align_Left=Keyword_Set(label_left), Align_Right=Keyword_Set(label_right))
+
+self.textID = Widget_Text( self.tlb, $  ; The Text Widget.
+   Value=value, $
+   XSize=xsize, $
+   YSize=1, $
+   Scr_XSize=scr_xsize, $
+   Scr_YSize=scr_ysize, $
+   sensitive=1-self.nonsensitive, $
+   Font=fieldfont, $
+   All_Events=1, $
+   _Extra=extra, $
+   kbrd_focus_events=1, $
+   Event_Func='FSC_Field_Event_Handler', $
+   UValue={Method:"TextEvents", Object:self}, $
+   Kill_Notify='FSC_Field_Kill_Notify', $
+   Editable=1-noedit )
+
+self.theValue = Ptr_New(self->ReturnValue(value))
+
+   ; If CR_ONLY or FOCUS_EVENTS are turned on and EVENT_PRO and EVENT_FUNC keywords are
+   ; unspecified, issue a warning message to the command log.
+
+IF self.cr_only AND (self.event_pro EQ "" AND self.event_func EQ "") THEN $
+   Message, /Information, 'WARNING: There is no specified event handler for carriage return events for this widget. Events will be swallowed.'
+IF self.focus AND (self.event_pro EQ "" AND self.event_func EQ "") THEN $
+   Message, /Information, 'WARNING: There is no specified event handler for keyboard focus events for this widget. Events will be swallowed.'
+
+RETURN, 1
+END ;--------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_Field::CLEANUP
+
+; This method makes sure there are not pointers left on the heap.
+
+Ptr_Free, self.theValue
+Ptr_Free, self.undefined
+END ;--------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Field_Event_Handler, event
+
+; The main event handler for the compound widget. It reacts
+; to "messages" in the UValue of the text widget.
+; The message indicates which object method to call. A message
+; consists of an object method and the self object reference.
+
+Widget_Control, event.ID, Get_UValue=theMessage
+event = Call_Method(theMessage.method, theMessage.object, event)
+
+RETURN, event
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_Field_Event__Define
+
+; The FSC_Field Event Structure. Sent only if EVENT_PRO or EVENT_FUNC keywords
+; have defined an event handler for the top-level base of the compound widget.
+
+   event = { FSC_Field_Event, $   ; The name of the event structure.
+             ID: 0L, $            ; The ID of the compound widget's top-level base.
+             TOP: 0L, $           ; The widget ID of the top-level base of the hierarchy.
+             HANDLER: 0L, $       ; The event handler ID. Filled out by IDL.
+             Value: Ptr_New(), $  ; A pointer to the widget value.
+             Type: "", $          ; A string indicating the type of data in the VALUE field.
+             Object: Obj_New()}   ; The "self" object.
+
+
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_Field_Set_Compound_Widget_Value, tlb, value
+
+; This utilty routine is invoked when the user tries to set
+; the value of the compound widget using the base widget
+; identifier of the top-level base of the compound widget.
+; The self object is located, and the Set_Value method is called
+; on the object.
+
+firstChildID = Widget_Info(tlb, /Child)
+Widget_Control, firstChildID, Get_UValue=self
+self->Set_Value, value
+END ;--------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_Field_Get_Compound_Widget_Value, tlb
+
+; This utilty routine is invoked when the user tries to get
+; the value of the compound widget using the base widget
+; identifier of the top-level base of the compound widget.
+; The self object is located, and the Get_Value method is called
+; on the object.
+
+firstChildID = Widget_Info(tlb, /Child)
+Widget_Control, firstChildID, Get_UValue=self
+IF N_Elements(self->Get_Value()) EQ 0 THEN RETURN, *self.undefined ELSE RETURN, self->Get_Value()
+END ;--------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_Field_Kill_Notify, textID
+
+; This widget call-back procedure makes sure the self object is
+; destroyed when the widget is destroyed.
+
+Widget_Control, textID, Get_UValue=message
+Obj_Destroy, message.object
+END ;--------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_Field__Define
+
+   objectClass = { FSC_FIELD, $             ; The object class name.
+                   parent: 0L, $            ; The parent widget ID.
+                   tlb: 0L, $               ; The top-level base of the compound widget.
+                   labelID: 0L, $           ; The label widget ID.
+                   textID: 0L, $            ; The text widget ID.
+                   theText: "", $           ; The actual text in the text widget.
+                   theValue: Ptr_New(), $   ; The actual "value" of the text in the text widget. :-)
+                   event_func: "", $        ; The name of the specified event handler function.
+                   event_pro: "", $         ; The name of the specified event handler procedrue
+                   cr_only: 0L, $           ; A flag meaning send only carriage return events.
+                   focus: 0L, $             ; A flag to indicate that events should be reported if the keyboard focus is lost
+                   has_focus: 0L, $         ; A flag to indicate that the widget has the keyboard focus currently.
+                   highlight: 0L, $         ; A flag for highlighting.
+                   tabnext: 0L, $           ; The identifier of a widget to receive the cursor focus if a TAB character is detected.
+                   decimal: 0, $            ; The number of decimals points in FLOAT and DOUBLE numbers.
+                   digits: 0, $             ; The number of digits in INT and LONG numbers.
+                   positive: 0, $           ; A flag meaning only positive numbers allowed.
+                   datatype: "",$           ; The type of data to be returned from the text widget.
+                   gentype: "", $           ; The "general" type of data: INTEGER, UNSIGNED, FLOAT, or STRING.
+                   undefined: Ptr_New(), $  ; The "undefined" value. Used in Get_Value methods, etc.
+                   noedit: 0L, $            ; A flag indicating whether text widget is editable (0) or not (1).
+                   nonsensitive: 0L, $      ; A flag indicating whether text widget is sensitive (0) or not (1).
+                   name:"" $                ; a scalar string name for the object
+                  }
+
+END ;--------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_FIELD, $               ; The compound widget FSC_Field.
+   parent, $                        ; The parent widget. Required for all compound widgets.
+   Column=column, $                 ; Set this keyword to have Label above Text Widget.
+   CR_Only=cr_only, $               ; Set this keyword if you only want Carriage Return events.
+   Decimal=decimal, $               ; Set this keyword to the number of digits to the right of the decimal point in FLOAT numbers.
+   Digits=digits, $                 ; Set this keyword to the number of digits permitted in INTEGER numbers.
+   Event_Func=event_func, $         ; Set this keyword to the name of an Event Function.
+   Event_Pro=event_pro, $           ; Set this keyword to the name of an Event Procedure.
+   _Extra=extra, $                  ; Passes along extra keywords to the text widget.
+   FieldFont=fieldfont, $           ; The font name for the text in the Text Widget.
+   Focus_Events=focus_events, $     ; Set this keyword to enable event reporting when the keyboard focus is lost.
+   Frame=frame, $                   ; Set this keyword to put a frame around the compound widget.
+   Highlight=highlight, $           ; If this keyword is set, the text is highlighted.
+   Label_Left=label_left, $         ; Set this keyword to align the label to the left of the label.
+   Label_Right=label_right, $       ; Set this keyword to align the labe to the right of the label.
+   LabelFont=labelfont, $           ; The font name for the text in the Label Widget.
+   LabelSize=labelsize, $           ; The X screen size of the Label Widget.
+   Name=name, $                     ; The name of the object.
+   NoEdit=noedit, $                 ; Setting this keywords makes the text widget non-editable.
+   NonSensitive=nonsensitive, $     ; Setting this keywords makes the text widget non-sensitive.
+   Object = obj, $                  ; An output keyword that contains the object reference.
+   Positive=positive, $             ; Set this keyword to indicate only positive numbers allowed in the field.
+   Scr_XSize=scr_xsize, $           ; The X screen size of the text widget.
+   Scr_YSize=scr_ysize, $           ; The Y screen size of the text widget.
+   Title=title, $                   ; The text to go on the Label Widget.
+   Undefined=undefined, $           ; Set to the value for "undefined" field values.
+   UValue=uvalue, $                 ; A user value for any purpose.
+   Value=value, $                   ; The "value" of the compound widget.
+   XSize=xsize                      ; The X size of the Text Widget.
+
+obj = Obj_New("FSC_FIELD", $
+   parent, $                        ; The parent widget. Required for all compound widgets.
+   Column=column, $                 ; Set this keyword to have Label above Text Widget.
+   CR_Only=cr_only, $               ; Set this keyword if you only want Carriage Return events.
+   Decimal=decimal, $               ; Set this keyword to the number of digits to the right of the decimal point in FLOAT numbers.
+   Digits=digits, $                 ; Set this keyword to the number of digits permitted in INTEGER numbers.
+   Event_Func=event_func, $         ; Set this keyword to the name of an Event Function.
+   Event_Pro=event_pro, $           ; Set this keyword to the name of an Event Procedure.
+   _Extra=extra, $                  ; Passes along extra keywords to the text widget.
+   FieldFont=fieldfont, $           ; The font name for the text in the Text Widget.
+   Focus_events=focus_events, $     ; Set this keyword to enable event reporting when the keyboard focus is lost.
+   Frame=frame, $                   ; Set this keyword to put a frame around the compound widget.
+   Highlight=highlight, $           ; If this keyword is set, the text is highlighted.
+   Label_Left=label_left, $         ; Set this keyword to align the label to the left of the label.
+   Label_Right=label_right, $       ; Set this keyword to align the labe to the right of the label.
+   LabelFont=labelfont, $           ; The font name for the text in the Label Widget.
+   LabelSize=labelsize, $           ; The X screen size of the Label Widget.
+   Name=name, $                     ; The name of the object.
+   NoEdit=noedit, $                 ; Setting this keywords makes the text widget non-editable.
+   NonSensitive=nonsensitive, $     ; Setting this keywords makes the text widget non-sensitive.
+   Positive=positive, $             ; Set this keyword to indicate only positive numbers allowed in the field.
+   Scr_XSize=scr_xsize, $           ; The X screen size of the text widget.
+   Scr_YSize=scr_ysize, $           ; The Y screen size of the text widget.
+   Title=title, $                   ; The text to go on the Label Widget.
+   Undefined=undefined, $           ; Set to the value for "undefined" field values.
+   UValue=uvalue, $                 ; A user value for any purpose.
+   Value=value, $                   ; The "value" of the compound widget.
+   XSize=xsize)                     ; The X size of the Text Widget.
+
+IF Obj_Valid(obj) THEN RETURN, obj->GetID() ELSE RETURN, -1L
+END ;--------------------------------------------------------------------------------------------------------------
+
+
+
+PRO Example_Event, event
+
+
+; An example event handler for FSC_Field.
+
+Widget_Control, event.top, Get_UValue=info
+Widget_Control, event.id, Get_UValue=thisEvent
+
+
+; Not interested in losing keyboard focus events.
+theName = Tag_Names(event, /Structure_Name)
+IF theName EQ 'WIDGET_KBRD_EVENT' THEN BEGIN
+   IF event.type EQ 0 THEN RETURN
+ENDIF
+
+; What kind of event is this?
+CASE thisEvent OF
+   'Field 1 Event': BEGIN
+
+      ; Demonstate various ways to test if the value from this field is undefined.
+
+      Print, ''
+      IF N_Elements(*event.value) EQ 0 THEN Print, 'Field 1 Value is Undefined from Event Structure' ELSE $
+         Print, 'Field 1 Value from Event Structure: ', *event.value
+
+      Widget_Control, info.field1id, Get_Value=theValue
+      IF Finite(theValue) EQ 0 THEN Print, 'Field 1 Value is Undefined and Assigned Value: ', theValue ELSE $
+         Print, 'Field 1 Value via Widget Get_Value Function: ', theValue
+
+
+      IF Finite(info.field1->Get_Value()) EQ 0 THEN Print, 'Field 1 Value is Undefined from Object Get_Value Function' ELSE $
+         Print, 'Field 1 Value via Object Get_Value Function: ', info.field1->Get_Value()
+
+      END
+   'Field 2 Event': BEGIN
+      Print, ''
+      IF N_Elements(*event.value) EQ 0 THEN Print, 'Field 2 Value is Undefined' ELSE $
+         Print, 'Field 2 Value: ', *event.value
+
+      theValue = info.field2->Get_Value()
+      IF theValue EQ -9999.0 THEN Print, 'Field 2 Value is Undefined and Assigned Value: ', theValue ELSE $
+         Print, 'Field 2 Value via Object Get_Value Function: ', theValue
+
+      END
+
+   'Print It': BEGIN
+      theValue =info.field3->Get_Value()
+      Print, ''
+      Print, 'Field 3 Value: ', theValue
+      END
+   'Set It': BEGIN
+      info.field3->Set_Value, 'Coyote Rules!'
+      END
+   'Quit': Widget_Control, event.top, /Destroy
+   'ChangeToUInt': BEGIN
+      info.field1->SetProperty, Title='Unsigned:', Value=UINT(RandomU(seed, 1)*100)
+      END
+   'ChangeToFloat': BEGIN
+      info.field1->SetProperty, Title='Float:', Value=RandomU(seed, 1)*100
+      END
+   'ChangeToString': BEGIN
+      info.field1->SetProperty, Title='String:', Value='Coyote Jules'
+      END
+   'PrintFloat': BEGIN
+      IF N_Elements(info.field2->Get_Value()) EQ 0 THEN Print, 'Field 2 Value is Undefined' ELSE $
+         Print, 'Field 2 Value: ', info.field2->Get_Value()
+      END
+   'LabelSize': BEGIN
+      Widget_Control, event.top, Update=0
+      currentSize = info.labelsize
+      info.field1->SetProperty, LabelSize=info.labelsize
+      info.field2->SetProperty, LabelSize=info.labelsize
+      info.field3->SetProperty, LabelSize=info.labelsize
+      IF currentsize EQ 75 THEN info.labelsize = 50 ELSE info.labelsize = 75
+      Widget_Control, event.top, Update=1
+      END
+   'MakeEditable': BEGIN
+      Widget_Control, event.id, Get_Value=buttonValue
+      CASE buttonValue OF
+         'Make String Field Editable': BEGIN
+            info.field3->SetEdit, 1
+            Widget_Control, event.id, Set_Value='Make String Field Non-Editable'
+            END
+         'Make String Field Non-Editable': BEGIN
+            info.field3->SetEdit, 0
+            Widget_Control, event.id, Set_Value='Make String Field Editable'
+            END
+      ENDCASE
+      END
+   'MakeSensitive': BEGIN
+      Widget_Control, event.id, Get_Value=buttonValue
+      CASE buttonValue OF
+         'Make String Field Sensitive': BEGIN
+            info.field3->SetSensitive, 1
+            Widget_Control, event.id, Set_Value='Make String Field Non-Sensitive'
+            END
+         'Make String Field Non-Sensitive': BEGIN
+            info.field3->SetSensitive, 0
+            Widget_Control, event.id, Set_Value='Make String Field Sensitive'
+            END
+      ENDCASE
+      END
+ENDCASE
+
+IF Widget_Info(event.top, /Valid_ID) THEN Widget_Control, event.top, Set_UValue=info
+END ;--------------------------------------------------------------------------------------------------------------
+
+
+
+PRO Example, field1, field2, field3
+
+; An example program to exercise some of the features of FSC_FIELD.
+
+tlb = Widget_Base(Column=1)
+button = Widget_Button(tlb, Value='Change First Field to Float', $
+   UValue='ChangeToFloat')
+button = Widget_Button(tlb, Value='Change First Field to String', $
+   UValue='ChangeToString')
+button = Widget_Button(tlb, Value='Change First Field to Unsigned Integer', $
+   UValue='ChangeToUInt')
+
+   ; Create an integer field, no more than 4 digits in the value.
+
+field1id = FSC_FIELD(tlb, Title='Integer:', LabelSize=50, Digits=4, Object=field1, $
+   Value=5, UValue='Field 1 Event', Event_Pro='Example_Event', /CR_Only, /Highlight)
+
+   ; Create a floating point field. Only two decimal points to the right of the decimal.
+   ; Set the Undefined value to -9999.0.
+
+field = FSC_FIELD(tlb, Title='Double:', LabelSize=50, Value=-123456789.1234567891234D, Object=field2, Undefined=-9999.0, $
+   /CR_Only, UValue='Field 2 Event', Event_Pro='Example_Event', Decimal=8, /Highlight)
+
+   ; Create a string field.
+
+field = FSC_FIELD(tlb, Title='String:', LabelSize=50, Value='Coyote Rules!', Object=field3, /Nonsensitive, /Highlight)
+
+   ; Set up TABing between fields.
+
+;field1->SetTabNext, field2->GetTextID()
+;field2->SetTabNext, field3->GetTextID()
+;field3->SetTabNext, field1->GetTextID()
+
+button = Widget_Button(tlb, Value='Print Value of String', UValue="Print It")
+button = Widget_Button(tlb, Value='Set Value of String', UValue='Set It')
+button = Widget_Button(tlb, Value='Change Size of Labels', UValue='LabelSize')
+button = Widget_Button(tlb, Value='Print Floating Value', UValue='PrintFloat')
+button = Widget_Button(tlb, Value='Make String Field Editable', UValue='MakeEditable')
+button = Widget_Button(tlb, Value='Make String Field Sensitive', UValue='MakeSensitive')
+button = Widget_Button(tlb, Value='Quit', UValue='Quit')
+Widget_Control, tlb, /Realize, Set_UValue={field1:field1, field2:field2, field3:field3, field1id:field1id, labelsize:75}
+XManager, 'example', tlb, /No_Block
+END
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_fileselect.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_fileselect.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_fileselect.pro	(revision 207)
@@ -0,0 +1,1170 @@
+;+
+; NAME:
+;   FSC_FILESELECT
+;
+; PURPOSE:
+;
+;   The purpose of this compound widget is to provide a means
+;   by which the user can type or select a file name. The
+;   program is written as an "object widget", meaning that
+;   the guts of the program is an object of class FSC_FILESELECT.
+;   This is meant to be an example of the obvious advantages of
+;   writing compound widget programs as objects.
+;
+; AUTHOR:
+;
+;   FANNING SOFTWARE CONSULTING
+;   David Fanning, Ph.D.
+;   1645 Sheely Drive
+;   Fort Collins, CO 80526 USA
+;   Phone: 970-221-0438
+;   E-mail: davidf@dfanning.com
+;   Coyote's Guide to IDL Programming: http://www.dfanning.com/
+;
+; CATEGORY:
+;
+;   General programming.
+;
+; CALLING SEQUENCE:
+;
+;   filenameID = FSC_FileSelect(parent)
+;
+; INPUT PARAMETERS:
+;
+;   parent -- The parent widget ID of the compound widget. Required.
+;
+; INPUT KEYWORDS:
+;
+;   Event_Pro -- The event handler procedure for this compound widget.By default: "".
+;   Event_Func -- The event handler function for this compound widget. By default: "".
+;
+;      If neither EVENT_PRO or EVENT_FUNC is defined, program events are handled internally by the compound widget.
+;
+;   DirectoryName -- The initial name of the directory. By defaut: current directory.
+;   Filename -- The initial file name in the filename text widget.
+;   Filter -- The file filter. By default: "*".
+;   Frame -- Set this keyword for a frame around the compound widget.
+;   LabelFont -- The font for the label widget. By default: "".
+;   LabelName -- The text on the label widgt. By default: "Filename: ".
+;   LabelSize -- The X screen size of the label widget. By default: 0.
+;   MustExist -- A flag that indicates selected files must exist. By default: 0.
+;   NoMaxSize -- A flag to prohibit automatic text widget sizing. By default: 0.
+;
+;     If this keyword is not set, the compound widget will automatically resize itself to
+;     the largest widget in its parent base widget. It will do this by changing the size of
+;     the text widgets holding the file and directory names.
+;
+;   Read -- Set this keyword to have file selection for reading a file. By default: 1.
+;   SelectDirectory -- The default directory for file selection. In other words, this is the
+;     default directory for DIALOG_PICKFILE, which is accessed via the BROWSE buttons.
+;   SelectFont -- The font for the "Browse" button. By default: "".
+;   SelectTitle -- The title bar text on the file selection dialog. By default: "Select a File...".
+;   TextFont -- The font for the filename text widget. By default: "".
+;   UValue -- User value for any purpose.
+;   Write -- Set this keyword to open a file for writing. By default: 0.
+;   XSize -- The X size of the text widget holding the filename. By default: StrLen(filename) * 1.5 > 40.
+;
+; OUTPUT KEYWORDS:
+;
+;   ObjectRef -- Assign this keyword to an output variable that will hold the internal object reference.
+;                With the object reference you can call object methods to easily change many properties of
+;                the compound widget.
+;
+; COMMON BLOCKS:
+;
+;   None.
+;
+; RESTRICTIONS:
+;
+;   Requires the folling files from the Coyote Library:
+;
+;      http://www.dfanning.com/programs/error_message.pro
+;
+; EVENT STRUCTURE:
+;
+;   All events are handled internally unless either the Event_Pro or Event_Func
+;   keywords are used to assign an event handler to the compound widget. All events
+;   generated by the text widgets are passed to the assigned event handler.
+;
+;   event = { CW_FILESELECT, $     ; The name of the event structure.
+;             ID: 0L, $            ; The ID of the compound widget's top-level base.
+;             TOP: 0L, $           ; The widget ID of the top-level base of the hierarchy.
+;             HANDLER: 0L, $       ; The event handler ID. Filled out by IDL.
+;             Basename: "", $      ; The base filename without directory specifiers.
+;             Filename: "", $      ; The fully qualified filename.
+;             Directory: "", $     ; The name of the current file directory.
+;           }
+;
+; EXAMPLE:
+;
+;   An example program is provided at the end of the FSC_FILESELECT code. To run it,
+;   type these commands:
+;
+;      IDL> .Compile fsc_fileselect
+;      IDL> Example
+;
+;   Or, if you want to obtain the object reference, type this:
+;
+;      IDL> Example, theObject
+;
+;   Now you can call the object's methods. For example:
+;
+;      IDL theObject->SetProperty, XSize=150
+;
+; GETTING and SETTING VALUES:
+;
+;   So as not to disrupt the accepted paradigm in using compound widgets, you
+;   can use the return value of the FSC_FILESELECT function with WIDGET_CONTROL to
+;   get and set the "value" of the widget.
+;
+;       Widget_Control, filenameID, Set_Value='C:\RSI\IDL52\DATA\cyclone.dat'
+;
+;   The program will automatically separate the file name portion of the value
+;   from the directory portion and put things in the correct text widgets.
+;
+;   Similarly, you can get the "value" of the widget:
+;
+;       Widget_Control, filenameID, Get_Value=theValue
+;       Print, theValue
+;
+;           C:\RSI\IDL52\DATA\cyclone.dat
+;
+;   The return value is the fully qualified file path to the file.
+;
+; USING OBJECT METHODS to CHANGE PROGRAM PROPERTIES:
+;
+;   If you obtain the object reference, you have a great deal more control
+;   over the properties of the compound widget. You obtain the object reference
+;   by calling the function like this:
+;
+;      filenameID = FSC_FILESELECT(parent, ObjectRef=theObject)
+;
+; OBJECT PROCEDURE METHODS:
+;
+;   GetProperty -- This method allows various properties of the widget to be
+;       returned via output keywords. The keywords that are available are:
+;
+;      DirectoryName -- The current directory.
+;      Event_Func -- The name of the event handler function for this compound widget.
+;      Event_Pro -- The name of the event handler procedure for this compound widget.
+;      Filename -- The current base filename.
+;      Filter -- The current file filter.
+;      LabelName -- The text on the label widget.
+;      LabelSize -- The X screen size of the label widget.
+;      MustExist -- A flag that indicates selected files must exist to be selected.
+;      Parent -- The parent widget of the compound widget.
+;      Read=read -- The file selection for reading flag.
+;      SelectTitle -- The title bar text on the file selection dialog.
+;      TLB -- The top-level base of the compound widget.
+;      UValue -- The user value of the compound widget.
+;      Write -- The file selection for writing flag.
+;      XSize -- The X size of the text widget holding the filename.
+;
+;   LabelSize -- This method makes sure that the directory name and file name labels
+;      are the same size. Normally, this procedure is called internally. No parameters.
+;
+;   MatchSize -- This method resizes the compound widget so that it is as long as the
+;      the longest widget in the parent base widget. This is done automatically upon
+;      realization unless the NOMAXSIZE keyword is set. The method aids in writing
+;      resizeable widget programs.
+;
+;   SetProperty -- This method allows various properties of the widget to be
+;       set via input keywords. The keywords that are available are:
+;
+;      DirectoryName -- The current directory.
+;      Event_Func -- The name of the event handler function for this compound widget.
+;      Event_Pro -- The name of the event handler procedure for this compound widget.
+;      Filename -- The current base filename.
+;      Filter -- The current file filter.
+;      LabelName -- The text on the label widget.
+;      LabelSize -- The X screen size of the label widget.
+;      MustExist -- A flag that indicates selected files must exist to be selected.
+;      Read -- The file selection for reading flag.
+;      SelectTitle -- The title bar text on the file selection dialog.
+;      UValue -- The user value of the compound widget.
+;      Write -- The file selection for writing flag.
+;      XSize -- The X size of the text widget holding the filename.
+;
+;   TextSelect - Allows you to create a selection in filename text widget. See the
+;                documentation for the SET_TEXT_SELECT keyword to Widget_Control.
+;
+;      selection -- A two-element array containing the starting position and selection length.
+;
+; OBJECT FUNCTION METHODS:
+;
+;      GetFileName -- Returns the fully qualified filename. No parameters.
+;
+;      GetTLB -- Returns the top-level base ID of the compound widget. No Parameters.
+;
+;      Inspect_DirectoryName -- Inspects the directory name for correctness. Requires one positional parameter.
+;
+;        directoryName -- The name of the directory from the directory text widget.
+;        textSelection -- The current text selection position.
+;
+;        At the moment all this does is remove any blank characters from either
+;        end of the directory name and makes sure the last character of the directory
+;        name does not end in a subdirectory specifier (except for VMS).
+;
+;     Inspect_Filename -- Inspects the file name for correctness. Requires one positional parameter.
+;
+;        filename -- The name of the file from the filename text widget.
+;        textSelection -- The current text selection position.
+;
+;        At the moment all this does is remove any blank characters from either
+;        end of the file name
+;
+; MODIFICATION HISTORY:
+;
+;   Written by: David W. Fanning, 21 NOV 1999.
+;   Fixed bug in File Name selection button. 18 MAR 2000. DWF.
+;   Fixed an error in which directory the Browse buttons should start
+;       searching. 29 SEP 2000. DWF.
+;   Previously returned events only for typing in text widgets. Now
+;       Browse button events are also returned. 29 SEP 2000. DWF.
+;   Fixed a bug in setting the file filter. 29 SEP 2000. DWF.
+;   Removed the Directory Browse button 10 AUG 2002. DWF.
+;   Added ERROR_MESSAGE to error handling. 10 AUG 2002. DWF.
+;   Changed the ability to specify a file filter as a string array, instead
+;       of just as a scalar string. This required the use of a pointer, which
+;       meant that I had to remove the FILTER field from the CW_FILESELECT
+;       event structure to avoid likely memory leakage. This is a dangerous
+;       change because it means programs that relied on this (I expect there
+;       are very, very few) will break and it goes against my philosopy of
+;       keeping my programs backward compatible. Let me know if you have
+;       problems. In testing, I discoved no problems in my own code. 31 OCT 2002. DWF.
+;   Fixed a problem with DIALOG_PICKFILE that sometimes allowed users to change
+;       directories without selecting a file. 3 Nov 2002. DWF.
+;   Fixed a problem with widget resizing with the help of Bob Portman that had plagued
+;       me from the beginning. Thanks, Bob! 5 August 2003. DWF
+;   Added TEXTSELECT method. 5 Aug 2003. DWF.
+;   Had to add FORWARD_FUNCTION statement to get error handler compiled when using
+;       DIRECTORY keyword. 24 Nov 2003. DWF.
+;   Fixed a problem with too many events going to an event handler specified with
+;       the EVENT_PRO or EVENT_FUNC keyword from the text widget. Now only Carriage
+;       Return events are passed on to the user-specified event handler. 8 July 2004. DWF.
+;   Replace all "\" characters with "/" characters in directory names. 8 Januay 2006. DWF.
+;-
+;
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright © 2000-2006 Fanning Software Consulting
+;
+; This software is provided "as-is", without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose, including commercial applications, and to alter it and
+; redistribute it freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product, an acknowledgment in the product documentation
+;    would be appreciated, but is not required.
+;
+; 2. Altered source versions must be plainly marked as such, and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software, visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+
+
+
+PRO FSC_FileSelect::Directory_Events, event
+
+; This method handles any typing in the directory name text widget.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   ok = Error_Message(/Traceback)
+   RETURN
+ENDIF
+
+   ; Don't deal with selection events.
+
+IF event.type EQ 3 THEN RETURN
+
+   ; Inspect the directory name and set it.
+
+Widget_Control, self.dirtextID, Get_Value=dirname
+dirname = dirname[0]
+textSelection = Widget_Info(self.dirtextID, /Text_Select)
+dirname = self->Inspect_DirectoryName(dirname, textSelection[0])
+dirname = StrJoin( StrSplit(dirname, '\\', /Regex, /Extract, /Preserve_Null), '/')
+
+self.directoryname = dirname
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_FileSelect::Filename_Events, event
+
+; This method handles any typing in the file name text widget.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   ok = Error_Message(/Traceback)
+   RETURN
+ENDIF
+
+   ; Don't deal with selection events.
+
+IF event.type EQ 3 THEN RETURN
+
+   ; Inspect the file name and set it.
+
+Widget_Control, self.filetextID, Get_Value=filename
+filename = filename[0]
+textSelection = Widget_Info(self.filetextID, /Text_Select)
+filename = self->Inspect_Filename(filename, textSelection[0])
+filename = StrJoin( StrSplit(filename, '\\', /Regex, /Extract, /Preserve_Null), '/')
+self.filename = filename
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_FileSelect::GetFilename
+
+; This method returns the fully-qualified filename. Checks to be
+; sure the last character in the directory name is not a directory
+; specifier.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   ok = Error_Message()
+   RETURN, -1
+ENDIF
+
+   ; Get the correct directory separator.
+
+CASE StrUpCase(!Version.OS_Family) OF
+   'MACOS'   : sep = ':'    ; Macintoshes
+   'VMS'     : sep = ']'    ; VMS machines
+   ELSE      : sep = '/'    ; Unix machines
+ENDCASE
+
+IF StrUpCase(!Version.OS_Family) NE "VMS" THEN BEGIN
+   length = StrLen(self.directoryName)
+   WHILE StrMid(self.directoryName, length-1, 1) EQ sep DO BEGIN
+      self.directoryName = StrMid(self.directoryName, 0, length-1)
+      Widget_Control, self.dirTextID, Set_Value=self.directoryName
+      length = StrLen(self.directoryName)
+   ENDWHILE
+ENDIF
+
+filename = Filepath(Root_Dir=self.directoryName, self.filename)
+filename = StrJoin( StrSplit(filename, '\\', /Regex, /Extract, /Preserve_Null), '/')
+RETURN, filename
+END ;-------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_FileSelect::GetNoMaxSize
+RETURN, self.nomaxsize
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_FileSelect::GetProperty, $
+   DirectoryName=dirname, $        ; The current directory.
+   Event_Func=event_func, $        ; The name of the event handler function for this compound widget.
+   Event_Pro=event_pro, $          ; The name of the event handler procedure for this compound widget.
+   Filename=filename, $            ; The current filename.
+   Filter=filter, $                ; The current file filter.
+   LabelName=labelname, $          ; The text on the label widget.
+   LabelSize=labelsize, $          ; The X screen size of the label widget.
+   MustExist=mustexist, $          ; A flag that indicates selected files must exist to be selected.
+   Parent=parent, $                ; The parent widget of the compound widget.
+   Read=read, $                    ; The file selection for reading flag.
+   SelectTitle=selecttitle, $      ; The title bar text on the file selection dialog.
+   TLB=tlb, $                      ; The top-level base of the compound widget.
+   UValue=uvalue, $                ; The user value of the compound widget.
+   Write=write, $                  ; The file selection for writing flag.
+   XSize=xsize                     ; The X size of the text widget holding the filename.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   ok = Error_Message()
+   RETURN
+ENDIF
+
+dirname = self.directoryname
+event_pro = self.event_pro
+event_func = self.event_func
+filename = self.filename
+filter = *self.filter
+labelname = self.labelname
+labelsize = self.labelsize
+mustexist = self.mustexist
+parent=self.parent
+read = self.read
+selecttitle = self.selecttitle
+tlb = self.tlb
+uvalue = *self.uvalue
+wirte = self.write
+xsize = self.xsize
+
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_FileSelect::GetTLB
+RETURN, self.tlb
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_FileSelect::Inspect_DirectoryName, dirname, textSelection
+
+; This method removes leading and trailing blank characters
+; in the directory name.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   ok = Error_Message()
+   RETURN, -1
+ENDIF
+
+thisDir = StrTrim(dirname, 2)
+IF StrLen(thisDir) NE StrLen(dirname) THEN $
+   textSelection = textSelection-( StrLen(dirname) - StrLen(thisDir) )
+Widget_Control, Set_Value=thisDir, self.dirtextID, Set_Text_Select=[textSelection, 0]
+RETURN, thisDir
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_FileSelect::Inspect_Filename, filename, textSelection
+
+; This method removes leading and trailing blank characters
+; in the filename.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = Error_Message()
+   RETURN, -1
+ENDIF
+
+thisFile = StrTrim(filename, 2)
+IF StrLen(thisFile) NE StrLen(filename) THEN $
+   textSelection = textSelection-( StrLen(filename) - StrLen(thisFile) )
+Widget_Control, Set_Value=thisFile, self.filetextID, Set_Text_Select=[textSelection, 0]
+RETURN, thisFile
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_FileSelect::LabelSize
+
+; This method ensures the directory and filename labels are the same size.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   ok = Error_Message()
+   RETURN
+ENDIF
+
+fgeo = Widget_Info(self.filelabelID, /Geometry)
+dgeo = Widget_Info(self.dirlabelID, /Geometry)
+bestSize = fgeo.scr_xsize > dgeo.scr_xsize
+Widget_Control, self.fileLabelID, Scr_XSize=bestSize
+Widget_Control, self.dirLabelID, Scr_XSize=bestSize
+END ;-------------------------------------------------------------------------------
+
+
+
+PRO FSC_FileSelect::MatchSize
+
+; This method makes the compound widget the same size as the largest
+; widget in the parent base widget. It does this by adjusting
+; the text widget sizes.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   ok = Error_Message()
+   RETURN
+ENDIF
+
+   ; Get the geometries of the filename widgets.
+
+tgeo = Widget_Info(self.tlb, /Geometry)
+fgeo = Widget_Info(self.filetextID, /Geometry)
+bbgeo = Widget_Info(self.filebaseID, /Geometry)
+lbgeo = Widget_Info(Widget_Info(self.dirbaseID, /Parent), /Geometry)
+rbgeo = Widget_Info(Widget_Info(self.filebrowseID, /Parent), /Geometry)
+
+   ; Add the bits and bobs together.
+
+fspacing = tgeo.space
+fpadding = 2*tgeo.xpad + 2*lbgeo.xpad
+ffixedsize = ( bbgeo.scr_xsize - 2*bbgeo.margin - (fgeo.scr_xsize) + $
+               rbgeo.scr_xsize - 2*rbgeo.margin )
+
+   ; Get the geometries of the directory name widgets.
+
+fgeo = Widget_Info(self.dirtextID, /Geometry)
+bbgeo = Widget_Info(self.dirbaseID, /Geometry)
+
+   ; Add the bits and bobs together.
+
+dspacing = tgeo.space
+dpadding = 2*tgeo.xpad + 2*lbgeo.xpad
+dfixedsize = ( bbgeo.scr_xsize - 2*bbgeo.margin - (fgeo.scr_xsize) + $
+               rbgeo.scr_xsize - 2*rbgeo.margin )
+
+   ; Go find all the children and find the biggest one of them.
+
+thisSize = 0
+childID = Widget_Info(self.parent, /Child)
+geom = Widget_Info(childID, /Geometry)
+testSize = geom.scr_xsize - 2*geom.margin
+thisSize = thisSize > testSize
+WHILE childID NE 0 DO BEGIN
+   childID = Widget_Info(childID, /Sibling)
+   IF childID GT 0 THEN BEGIN
+      geom = Widget_Info(childID, /Geometry)
+      testSize = geom.scr_xsize - 2*geom.margin
+      thisSize = thisSize > testSize
+   ENDIF
+ENDWHILE
+
+   ; Resize the widgets
+
+ftextsize = thisSize - (fspacing + fpadding + ffixedsize)
+Widget_Control, self.filetextID, Scr_XSize=ftextsize
+
+dtextsize = thisSize - (dspacing + dpadding + dfixedsize)
+Widget_Control, self.dirtextID, Scr_XSize=dtextsize
+
+END ;-------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_FileSelect_RStrPos, Expr, SubStr, Pos
+
+  ON_ERROR, 2
+  N = N_PARAMS()
+  if (n lt 2) then message, 'Incorrect number of arguments.'
+
+  ; Is expr an array or a scalar? In either case, make a result
+  ; that matches.
+  if (size(expr, /n_dimensions) eq 0) then result = 0 $
+  else result = make_array(dimension=size(expr,/dimensions), /INT)
+
+  RSubStr = STRING(REVERSE(BYTE(SubStr))) ; Reverse the substring
+
+  for i = 0, n_elements(expr) - 1 do begin
+    Len = STRLEN(Expr[i])
+    IF (N_ELEMENTS(Pos) EQ 0) THEN Start=0 ELSE Start = Len - Pos
+
+    RString = STRING(REVERSE(BYTE(Expr[i]))) ; Reverse the string
+
+    SubPos = STRPOS(RString, RSubStr, Start)
+    IF SubPos NE -1 THEN SubPos = Len - SubPos - STRLEN(SubStr)
+    result[i] = SubPos
+  endfor
+
+  RETURN, result
+END ;-------------------------------------------------------------------------
+
+
+
+PRO FSC_FileSelect::Select_File, event
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   ok = Error_Message()
+   RETURN
+ENDIF
+
+; Use the file selection dialog to obtain a filename.
+
+currentFilename = self.filename
+self.filename = ""
+filename = Dialog_Pickfile( File=self.filename, $
+                            Filter=*self.filter, $
+                            Path=self.directoryname, $
+                            Get_Path=thePath, $
+                            Must_Exist=self.mustexist, $
+                            Read=self.read, $
+                            Title=self.selecttitle, $
+                            Write=self.write )
+
+IF filename EQ "" THEN BEGIN
+   self.filename = currentFilename
+   RETURN
+ENDIF
+
+   ; Remove the directory from the name.
+
+index = StrLen(thePath)
+theFilename = StrMid(filename, index)
+
+   ; Strip the last directory separator.
+
+length = StrLen(thePath)
+thePath = StrMid(thePath, 0, length-1)
+
+   ; Inspect the file name to make sure it is valid.
+
+textSelection = Widget_Info(self.filetextID, /Text_Select)
+filename = self->Inspect_Filename(filename, textSelection[0])
+
+   ; Update the display.
+
+self->SetProperty, Filename=theFilename, DirectoryName=thePath
+
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_FileSelect::SetFilename, theName
+
+; This method separates the filename into directory and filename
+; and adds them to the interface.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   ok = Error_Message()
+   RETURN
+ENDIF
+
+; Change back slashes to forward slashes.
+theName = StrJoin( StrSplit(theName, '\\', /Regex, /Extract, /Preserve_Null), '/')
+
+   ; Get the correct directory separator.
+
+CASE StrUpCase(!Version.OS_Family) OF
+   'MACOS'   : sep = ':'    ; Macintoshes
+   'VMS'     : sep = ']'    ; VMS machines
+   ELSE      : sep = '/'    ; Unix machines
+ENDCASE
+
+index = FSC_FileSelect_RStrPos(theName, sep)
+IF index EQ -1 THEN BEGIN
+   self->SetProperty, Filename=theName
+   self.filename = theName
+ENDIF ELSE BEGIN
+   directoryName = StrMid(theName, 0, index)
+   filename = StrMid(theName, index+1)
+   self->SetProperty, Filename=filename, Directory=directoryName
+   self.filename = filename
+   self.directoryName = directoryName
+ENDELSE
+END ;-------------------------------------------------------------------------------
+
+
+
+PRO FSC_FileSelect::SetProperty, $
+   DirectoryName=dirname, $        ; The initial name of the directory. By defaut: current directory.
+   Event_Func=event_func, $        ; The event handler function for this compound widget.
+   Event_Pro=event_pro, $          ; The event handler procedure for this compound widget.
+   Filename=filename, $            ; The initial file name in the filename text widget.
+   Filter=filter, $                ; The file filter.
+   LabelName=labelname, $          ; The text on the label widgt.
+   LabelSize=labelsize, $          ; The X screen size of the label widget.
+   MustExist=mustexist, $          ; A flag that indicates selected files must exist.
+   Read=read, $                    ; Set this keyword to have file selection for reading a file.
+   SelectTitle=selecttitle, $      ; The title bar text on the file selection dialog.
+   UValue=uvalue, $                ; User value for any purpose.
+   Write=write, $                  ; Set this keyword to open a file for writing.
+   XSize=xsize                     ; The X size of the text widget holding the filename.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   ok = Error_Message()
+   RETURN
+ENDIF
+
+IF N_Elements(dirname) NE 0 THEN BEGIN
+   dirname = StrJoin( StrSplit(dirname, '\\', /Regex, /Extract, /Preserve_Null), '/')
+   self.directoryname = dirname
+   Widget_Control, self.dirtextID, Set_Value=dirname
+ENDIF
+
+IF N_Elements(event_pro) NE 0 THEN BEGIN
+   self.event_pro = event_pro
+   Widget_Control, self.tlb, Event_Pro=event_pro
+ENDIF
+
+IF N_Elements(event_func) NE 0 THEN BEGIN
+   self.event_func = event_func
+   Widget_Control, self.tlb, Event_Func=event_func
+ENDIF
+
+IF N_Elements(filename) NE 0 THEN BEGIN
+   self.filename = filename
+   strlength = StrLen(filename)
+   Widget_Control, self.filetextID, Set_Value=filename
+ENDIF
+
+IF N_Elements(labelname) NE 0 THEN BEGIN
+   self.labelname = labelname
+   Widget_Control, self.filelabelID, Set_Value=labelname
+ENDIF
+
+IF N_Elements(labelsize) NE 0 THEN BEGIN
+   Widget_Control, self.filelabelID, Scr_XSize=labelsize
+ENDIF
+
+IF N_Elements(filter) NE 0 THEN *self.filter = filter
+IF N_Elements(mustexist) NE 0 THEN self.mustexist = mustexist
+IF N_Elements(read) NE 0 THEN self.read = read
+IF N_Elements(selecttitle) NE 0 THEN self.selecttitle = selecttitle
+IF N_Elements(uvalue) NE 0 THEN *self.uvalue = uvalue
+IF N_Elements(write) NE 0 THEN self.write = write
+
+IF N_Elements(xsize) NE 0 THEN BEGIN
+   Widget_Control, self.filetextID, XSize=xsize
+   Widget_Control, self.dirtextID, XSize=xsize
+ENDIF
+
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_FileSelect::TextSelect, selection
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   ok = Error_Message()
+   RETURN
+ENDIF
+
+IF N_Elements(selection) NE 2 THEN Message, 'Text selection array is not a two-element array: [beginSelection, selectionLength]'
+Widget_Control, self.fileTextID, Set_Text_Select=selection
+
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_FileSelect::CLEANUP
+Ptr_Free, self.uvalue
+Ptr_Free, self.filter
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_FileSelect::INIT, $
+   parent, $                       ; The parent widget ID of the compound widget.
+   DirectoryName=dirname, $        ; The initial name of the directory. By defaut: current directory.
+   Event_Pro=event_pro, $          ; The event handler procedure for this compound widget.By default: "".
+   Event_Func=event_func, $        ; The event handler function for this compound widget. By default: "".
+   Filename=filename, $            ; The initial file name in the filename text widget.
+   Filter=filter, $                ; The file filter. By default: "*".
+   Frame=frame, $                  ; Set this keyword for a frame around the compound widget.
+   LabelFont=labelfont, $          ; The font for the label widget. By default: "".
+   LabelName=labelname, $          ; The text on the label widgt. By default: "Filename: ".
+   LabelSize=labelsize, $          ; The X screen size of the label widget. By default: 0.
+   MustExist=mustexist, $          ; A flag that indicates selected files must exist. By default: 0.
+   NoMaxSize=nomaxsize, $          ; A flag to prohibit automatica text widget sizing. By default: 0.
+   Read=read, $                    ; Set this keyword to have file selection for reading a file. By default: 1.
+   Scr_XSize=scr_xsize, $          ; The X screen size of the compound widget. By default: 0
+   SelectFont=selectfont, $        ; The font for the "Browse" button. By default: "".
+   Selectdir=selectdir, $          ; The inital directory for file and directory selections.
+   SelectTitle=selecttitle, $      ; The title bar text on the file selection dialog. By default: "Select a File...".
+   TextFont=textfont, $            ; The font for the filename text widget. By default: "".
+   UValue=uvalue, $                ; User value for any purpose.
+   Write=write, $                  ; Set this keyword to open a file for writing. By default: 0.
+   XSize=xsize                     ; The X size of the text widget holding the filename. By default: StrLen(filename) * 1.5 > 40.
+
+Catch, theError
+;theError = 0
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = Error_Message()
+   RETURN, 0
+ENDIF
+
+   ; Populate self object.
+
+self.parent = parent
+self.directoryname = dirname
+self.event_pro = event_pro
+self.event_func = event_func
+self.filename = filename
+self.filter = Ptr_New(filter)
+self.frame = frame
+self.labelfont = labelfont
+self.labelname = labelname
+self.labelsize = labelsize
+self.mustexist = mustexist
+self.nomaxsize = nomaxsize
+self.read = read
+self.selectdir = selectdir
+self.selectfont = selectfont
+self.selecttitle = selecttitle
+self.textfont = textfont
+self.uvalue = Ptr_New(uvalue)
+self.write = write
+self.xsize = xsize
+
+
+   ; Build widgets.
+
+self.tlb = Widget_Base( self.parent, $
+                        Event_Func = self.event_func, $
+                        Event_Pro = self.event_pro, $
+                        Frame = self.frame, $
+                        Func_Get_Value='FSC_FileSelect_Get_Value', $
+                        Pro_Set_Value='FSC_FileSelect_Set_Value', $
+                        Row = 1, $
+                        Base_Align_Center=1, $
+                        UValue=*self.uvalue )
+
+   ; Put the self object in the first child of the TLB.
+
+leftbase = Widget_Base(self.tlb, Row=2, UValue=self)
+
+self.dirbaseID = Widget_Base(leftbase, Row=1)
+
+self.dirlabelID = Widget_Label( self.dirbaseID, $
+                             Font=self.labelfont, $
+                             Scr_XSize=self.labelsize, $
+                             Value='Directory: ' )
+
+
+self.dirtextID = Widget_Text( self.dirbaseID, $
+                           All_Events=1, $
+                           Editable=1, $
+                           Event_Func='FSC_FileSelect_Event_Handler', $
+                           Font=self.textfont, $
+                           UValue={method:'Directory_Events', object:self}, $
+                           Value=self.directoryname, $
+                           XSize=self.xsize, $
+                           YSize=1 )
+
+
+self.filebaseID = Widget_Base(leftbase, Row=1)
+
+self.filelabelID = Widget_Label( self.filebaseID, $
+                             Font=self.labelfont, $
+                             Kill_Notify='FSC_FileSelect_Kill_Notify', $
+                             Notify_Realize='FSC_FileSelect_Notify_Realize', $
+                             Scr_XSize=self.labelsize, $
+                             UValue=self, $
+                             Value=self.labelname )
+
+
+self.filetextID = Widget_Text( self.filebaseID, $
+                           All_Events=1, $
+                           Editable=1, $
+                           Event_Func='FSC_FileSelect_Event_Handler', $
+                           Font=self.textfont, $
+                           UValue={method:'Filename_Events', object:self}, $
+                           Value=self.filename, $
+                           XSize=self.xsize, $
+                           YSize=1 )
+
+rightbase = Widget_Base(self.tlb, Row=1, Base_Align_Center=1)
+self.filebrowseID = Widget_Button( rightbase, $
+                               Event_Func='FSC_FileSelect_Event_Handler', $
+                               UValue={method:'Select_File', object:self}, $
+                               Value='Browse')
+
+
+RETURN, 1
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_FileSelect__Define
+
+   objectClass = { FSC_FileSelect, $      ; The object class FSC_FILESELECT.
+                   parent: 0L, $          ; The ID of the parent widget.
+                   tlb: 0L, $             ; The ID of the top-level base widget for the compound widget.
+                   filebaseID: 0L, $      ; The ID of the filename base widget.
+                   dirbaseID: 0L, $       ; The ID of the directory base widget.
+                   filelabelID: 0L, $     ; The ID of the filename label widget.
+                   dirlabelID: 0L, $      ; The ID of the directory label widget.
+                   filetextID: 0L, $      ; The ID of the filename text widget.
+                   dirtextID: 0L, $       ; The ID of the directory text widget.
+                   filebrowseID: 0L, $    ; The ID of the file browse button widget.
+                   dirbrowseID: 0L, $     ; Unused currently. Left here for compatibility reasons..
+                   event_pro: "", $       ; The user-defined name of the event procedure for the widget.
+                   event_func: "", $      ; The user-defined name of the event function for the widget.
+                   filename: "", $        ; The current contents of the filename text widget.
+                   directoryname: "", $   ; The current contents of the directory text widget.
+                   frame: 0L, $           ; A flag to indicate a frame around the compound widget.
+                   filter: Ptr_New(), $   ; The current file filter used in file selection.
+                   labelfont: "", $       ; The font for the label widgets.
+                   labelname: "", $       ; The VALUE of the file name label widget.
+                   labelsize: 0L, $       ; The X screen size fo the label widgets.
+                   mustexist: 0L, $       ; If this field is 1, the user can only select files that exist.
+                   nomaxsize: 0L, $       ; This widget sizes itself to the largest widget in the base, unless this is set.
+                   read: 0L, $            ; Set this keyword to select a file for reading.
+                   selectdir: "", $       ; The inital directory used for file selection.
+                   selectfont: "", $      ; The font used for the Browse buttons.
+                   selecttitle: "", $     ; The text on the Dialog_Pickfile widget.
+                   textfont: "", $        ; The font used in the text widgets.
+                   uvalue: Ptr_New(), $   ; The user's user value. Unused by the program.
+                   write: 0L, $           ; Set this keyword to select a file for writing.
+                   xsize: 0L $            ; The X size of the text widgets.
+                 }
+
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_FileSelect_Set_Value, id, filename
+
+; This function sets the filename of the widget, using the
+; traditional "Widget_Control, fieldID, Set_Value=filename" syntax.
+; The directory will be stripped off the filename, if required.
+
+firstChild = Widget_Info(id, /Child)
+Widget_Control, firstChild, Get_UValue=self
+self->SetFilename,filename
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_FileSelect_Get_Value, id
+
+; This function returns the filename of the widget, using the
+; traditional "Widget_Control, fieldID, Get_Value=filename" syntax.
+
+firstChild = Widget_Info(id, /Child)
+Widget_Control, firstChild, Get_UValue=self
+RETURN, self->GetFilename()
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO CW_FileSelect__Define
+
+; The event structure definition. This is the event structure returned by the compound widget.
+
+   eventStructure = { CW_FileSelect, $     ; The name of the event structure.
+                      ID: 0L,  $           ; The ID of the top-level base of the compound widget.
+                      TOP: 0L, $           ; The ID of the top-level base.
+                      HANDLER: 0L, $       ; The ID of the event handler widget.
+                      Filename: "", $      ; The fully qualified file name.
+                      Basename: "", $      ; The base file name without directory attached.
+                      Directory: "" }      ; The file directory.
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_FileSelect_Event_Handler, event
+
+; The main event handler for the compound widget. It reacts
+; to "messages" in the UValues of widgets that generate events.
+; The messages indicate which object method to call. A message
+; consists of an object method and the self object reference.
+
+Widget_Control, event.ID, Get_UValue=theMessage
+
+Call_Method, theMessage.method, theMessage.object, event
+
+   ; Events will be sent only if there is an assigned event handler.
+
+self = theMessage.object
+self->GetProperty, Filename=filename, DirectoryName=directory, $
+   Event_Pro=event_pro, Event_Func=event_func
+IF event_pro NE "" OR event_func NE "" THEN BEGIN
+
+    pseudoevent = {CW_FileSelect, self->GetTLB(), event.top, 0L, $
+      Filepath(Root_Dir=directory, filename),  filename, directory}
+
+    ; Don't return events from text widgets, unless the user has typed
+    ; a cariage return.
+    eventName = Tag_Names(event, /Structure_Name)
+    IF eventName NE "" THEN BEGIN
+
+       IF StrMid(eventName, 0, 11) EQ 'WIDGET_TEXT' THEN BEGIN
+          IF (eventName EQ 'WIDGET_TEXT_CH') THEN BEGIN
+            IF (event.ch EQ 10) THEN RETURN, pseudoevent ELSE RETURN, 0
+          ENDIF ELSE RETURN, 0
+       ENDIF
+    ENDIF
+    RETURN, pseudoevent
+ENDIF ELSE RETURN, 0
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+PRO FSC_FileSelect_Notify_Realize, labelID
+
+; When the compound widget is realized, make sure sizes are correct.
+
+Widget_Control, labelID, Get_UValue=self
+IF self->GetNoMaxSize() THEN RETURN
+self->Matchsize
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_FileSelect_Kill_Notify, labelID
+
+; When the compound widget dies, destroy the self object.
+
+Widget_Control, labelID, Get_UValue=self
+Obj_Destroy, self
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_FileSelect, $
+   parent, $                       ; The parent widget ID of the compound widget.
+   Event_Pro=event_pro, $          ; The event handler procedure for this compound widget.By default: "".
+   Event_Func=event_func, $        ; The event handler function for this compound widget. By default: "".
+   DirectoryName=dirname, $        ; The initial name of the directory. By defaut: current directory.
+   Filename=filename, $            ; The initial file name in the filename text widget.
+   Filter=filter, $                ; The file filter. By default: "*".
+   Frame=frame, $                  ; Set this keyword for a frame around the compound widget.
+   LabelFont=labelfont, $          ; The font for the label widget. By default: "".
+   LabelName=labelname, $          ; The text on the label widgt. By default: "Filename: ".
+   LabelSize=labelsize, $          ; The X screen size of the label widget. By default: 0.
+   MustExist=mustexist, $          ; A flag that indicates selected files must exist. By default: 0.
+   NoMaxSize=nomaxsize, $          ; A flag to prohibit automatica text widget sizing. By default: 0.
+   ObjectRef=objectref, $          ; An output keyword containing the object reference.
+   Read=read, $                    ; Set this keyword to have file selection for reading a file. By default: 1.
+   SelectDirectory=selectdir, $    ; The default directory for file selection.
+   SelectFont=selectfont, $        ; The font for the "Browse" button. By default: "".
+   SelectTitle=selecttitle, $      ; The title bar text on the file selection dialog. By default: "Select a File...".
+   TextFont=textfont, $            ; The font for the filename text widget. By default: "".
+   UValue=uvalue, $                ; User value for any purpose.
+   Write=write, $                  ; Set this keyword to open a file for writing. By default: 0.
+   XSize=xsize                     ; The X size of the text widget holding the filename. By default: StrLen(filename) * 1.5 > 40.
+
+Catch, theError
+;theError = 0
+IF theError NE 0 THEN BEGIN
+   ok = Error_Message()
+   RETURN, 0
+ENDIF
+
+   ; Need a parent parameter.
+
+IF N_Elements(parent) EQ 0 THEN BEGIN
+   ok = Dialog_Message('FSC_FILESELECT: A parent parameter is required.')
+   RETURN, -1
+ENDIF
+
+   ; Check keyword arguments.
+
+IF N_Elements(dirname) EQ 0 THEN CD, Current=dirname
+dirname = StrJoin( StrSplit(dirname, '\\', /Regex, /Extract, /Preserve_Null), '/')
+IF N_Elements(event_pro) EQ 0 THEN event_pro = ""
+IF N_Elements(event_func) EQ 0 THEN event_func = ""
+IF N_Elements(filename) EQ 0 THEN filename = ""
+IF N_Elements(filter) EQ 0 THEN filter = '*'
+IF N_Elements(Frame) EQ 0 THEN Frame = 0
+IF N_Elements(labelfont) EQ 0 THEN labelfont = ""
+IF N_Elements(labelname) EQ 0 THEN labelname = "Filename: "
+IF N_Elements(labelsize) EQ 0 THEN labelsize = 0
+IF N_Elements(mustexist) EQ 0 THEN mustexist = 0
+IF N_Elements(nomaxsize) EQ 0 THEN nomaxsize = 0
+IF N_Elements(read) EQ 0 THEN read = 0
+IF N_Elements(selectdir) EQ 0 THEN selectdir = dirname
+IF N_Elements(selectfont) EQ 0 THEN selectfont = ""
+IF Keyword_Set(read) EQ 0 AND Keyword_Set(write) EQ 0 AND $
+   N_Elements(selecttitle) EQ 0 THEN selecttitle = "Select a File..." ELSE selecttitle = ""
+IF N_Elements(textfont) EQ 0 THEN textfont = ""
+IF N_Elements(uvalue) EQ 0 THEN uvalue = ""
+IF N_Elements(write) EQ 0 THEN write = 0
+IF N_Elements(xsize) EQ 0 THEN xsize = Long(StrLen(dirname) * 1.20 > 40)
+
+   ; Create the underlying structure.
+
+objectref = Obj_New('FSC_FileSelect', $
+   parent, $
+   DirectoryName=dirname, $
+   Event_Pro=event_pro, $
+   Event_Func=event_func, $
+   Filename=filename, $
+   Filter=filter, $
+   Frame=frame, $
+   LabelFont=labelfont, $
+   LabelName=labelname, $
+   LabelSize=labelsize, $
+   MustExist=mustexist, $
+   NoMaxSize=nomaxsize, $
+   Read=read, $
+   Scr_XSize=scr_xsize, $
+   SelectFont=selectfont, $
+   SelectTitle=selecttitle, $
+   Selectdir=selectdir, $
+   TextFont=textfont, $
+   UValue=uvalue, $
+   Write=write, $
+   XSize=xsize )
+
+   ; Return the ID of the top-level base of the compound widget.
+
+  RETURN, objectref->GetTLB()
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO Example_Set_Size, event
+Widget_Control, event.top, Get_UValue=theObject
+theObject->MatchSize
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO Example_Set_Filter, event
+Widget_Control, event.top, Get_UValue=theObject
+theObject->SetProperty, Filter='*.pro', Filename='cyclone.pro'
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO Example_Set_Filename, event
+Widget_Control, event.top, Get_UValue=theObject
+filename = Filepath(Subdir=['examples', 'data'], 'worldelv.dat')
+theObject->SetFilename, filename
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO Example_Shrink, event
+Widget_Control, event.top, Get_UValue=theObject
+theObject->SetProperty, XSize=40
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO Example_Print_Filename, event
+Widget_Control, event.top, Get_UValue=theObject
+Print, theObject->GetFilename()
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO Example_Quit, event
+Widget_Control, event.top, /Destroy
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
+
+
+PRO Example, theObject
+
+tlb = Widget_Base(Title='Exercise FSC_FILESELECT...', Column=1)
+button = Widget_Button(tlb, Value='Make Compound Widget As Big As Me', $
+   Event_Pro='Example_Set_Size', Scr_XSize=500)
+button = Widget_Button(tlb, Value='Set Filename to worldelv.data in Data Directory', $
+   Event_Pro='Example_Set_Filename')
+button = Widget_Button(tlb, Value='Print Filename', $
+   Event_Pro='Example_Print_Filename')
+button = Widget_Button(tlb, Value="Shrink the Text Fields", $
+   Event_Pro='Example_Shrink')
+CD, Current=thisDir
+filenameID = FSC_FileSelect(tlb, Directory=thisDir, Filename='fileselect.pro', $
+   /NoMaxSize, ObjectRef=theObject)
+button = Widget_Button(tlb, Value='Quit', Event_Pro='Example_Quit')
+Widget_Control, tlb, /Realize, Set_UValue=theObject
+XManager, 'example', tlb, /No_Block
+END ;-----------------------------------------------------------------------------------------------------------------------------
+
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_plotwindow.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_plotwindow.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_plotwindow.pro	(revision 207)
@@ -0,0 +1,1085 @@
+;+
+; NAME:
+;   FSC_PLOTWINDOW
+;
+; PURPOSE:
+;
+;   The purpose of this compound widget is to create a resizeable
+;   "plot window" inside a larger "page window". I'm not sure it
+;   has any value except as a utility routine for the PostScript
+;   configuration object FSC_PSCONFIG__DEFINE, but it's a neat
+;   program anyway. :-)
+;
+; AUTHOR:
+;
+;   FANNING SOFTWARE CONSULTING
+;   David Fanning, Ph.D.
+;   1645 Sheely Drive
+;   Fort Collins, CO 80526 USA
+;   Phone: 970-221-0438
+;   E-mail: davidf@dfanning.com
+;   Coyote's Guide to IDL Programming: http://www.dfanning.com/
+;
+; CATEGORY:
+;
+;   Utility routine for FSC_PSCONFIG__DEFINE.
+;
+; CALLING SEQUENCE:
+;
+;   plotwindowObject = CW_PlotWindow(parent)
+;
+; REQUIRED INPUT PARAMETERS:
+;
+;   parent - The parent base widget of this compound widget.
+;
+; RETURN VALUE:
+;
+;   plotwindowObject - The object reference of the compound widget.
+;
+; KEYWORDS:
+;
+;   COLOR - If set, display the window in "color". This is the default on 24-bit devices.
+;   DEBUG - Set this keyword to turn traceback error handling on in the error handling code.
+;   EVENT_PRO - The event procedure for the widget. Required for events to be generated. Otherwise, all events are handled internally.
+;   LANDSCAPE - If set, display the page in landscape mode. Otherwise the page is display in portrait mode.
+;   PAGESIZE - The "pagesize" of the widget. Possible values are: "LETTER", "LEDGER", "LEGAL", "A4", and "DISPLAY".
+;   UNITS - A string indicating INCHES or CENTIMETER units. DEVICE units represented by a null string, "".
+;   UVALUE - A user value for the caller of this program.
+;   WINDOWCOLOR - A three-element array specifying the background window color (RGB).
+;   WINDOWSIZE - The size of the "window" on the page. A four-element array of normalized coordinates in the form [x0, y0, x1, y1].
+;
+; EVENT STRUCTURE:
+;
+;   The event structure that is returned from this compound widget is defined like this,
+;   where the sizes and offsets locate the target "window" on the page in normalized units:
+;
+;      event = {ID:0L, TOP:0L, HANDLER:0L, XSize:0.0, YSize:0.0, XOffset:0.0, YOffset:0.0}
+;
+; MODIFICATIONS:
+;
+;   Written by David Fanning, 31 January 2000.
+;   Fixed a small bug that prevented it working on Macintosh computers. 26 Sept 2000. DWF.
+;   Added a "DISPLAY" page size, so the program can be used to position
+;      plots and other graphics in a display window. The "page area" will
+;      have the same aspect ratio is the current graphics window. 17 March 2001. DWF.
+;   Changed some of the tolerances for "closeness" from 0.1 to 0.025 to allow smaller
+;      sizing for colorbars and other small objects. 6 July 2005. DWF.
+;-
+;
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright © 2000-2001 Fanning Software Consulting
+;
+; This software is provided "as-is", without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose, including commercial applications, and to alter it and
+; redistribute it freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product, an acknowledgment in the product documentation
+;    would be appreciated, but is not required.
+;
+; 2. Altered source versions must be plainly marked as such, and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software, visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+;
+
+
+FUNCTION FSC_PLOTWINDOW_Error_Message, theMessage, Traceback=traceback, NoName=noName
+
+On_Error, 2
+
+   ; Check for presence and type of message.
+
+IF N_Elements(theMessage) EQ 0 THEN theMessage = !Error_State.Msg
+s = Size(theMessage)
+messageType = s[s[0]+1]
+IF messageType NE 7 THEN BEGIN
+   Message, "The message parameter must be a string."
+ENDIF
+
+   ; Get the call stack and the calling routine's name.
+
+Help, Calls=callStack
+callingRoutine = (StrSplit(StrCompress(callStack[1])," ", /Extract))[0]
+
+   ; Are widgets supported? Doesn't matter in IDL 5.3 and higher.
+
+widgetsSupported = ((!D.Flags AND 65536L) NE 0) OR Float(!Version.Release) GE 5.3
+IF widgetsSupported THEN BEGIN
+   IF Keyword_Set(noName) THEN answer = Dialog_Message(theMessage) ELSE BEGIN
+      IF StrUpCase(callingRoutine) EQ "$MAIN$" THEN answer = Dialog_Message(theMessage) ELSE $
+         answer = Dialog_Message(StrUpCase(callingRoutine) + ": " + theMessage)
+   ENDELSE
+ENDIF ELSE BEGIN
+      Message, theMessage, /Continue, /NoPrint, /NoName, /NoPrefix
+      Print, '%' + callingRoutine + ': ' + theMessage
+      answer = 'OK'
+ENDELSE
+
+   ; Provide traceback information if requested.
+
+IF Keyword_Set(traceback) THEN BEGIN
+   Help, /Last_Message, Output=traceback
+   FOR j=0,N_Elements(traceback)-1 DO Print, traceback[j]
+ENDIF
+
+RETURN, answer
+END ;----------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PLOTWINDOW_Normalize, range, Position=position
+
+On_Error, 1
+IF N_Params() EQ 0 THEN Message, 'Please pass range vector as argument.'
+
+IF (N_Elements(position) EQ 0) THEN position = [0.0, 1.0] ELSE $
+    position=Float(position)
+range = Float(range)
+
+scale = [((position[0]*range[1])-(position[1]*range[0])) / $
+    (range[1]-range[0]), (position[1]-position[0])/(range[1]-range[0])]
+
+RETURN, scale
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW::Refresh
+self.theWindow->Draw, self.theView
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW::SetWindowColor, theColor
+
+; Set the background color of the view.
+
+self.theView->SetProperty, Color=theColor
+self.theWindow->Draw, self.theView
+END ;----------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PLOTWINDOW::GetUValue
+
+; Get the user value of the compound widget.
+
+parent = Widget_Info(self.drawID, /Parent)
+Widget_Control, parent, Get_UValue=theValue
+RETURN, theValue
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW::SetColor, on_off
+
+; Sets the color of the plot window. Different colors
+; depending on depth of visual class.
+
+IF on_off THEN BEGIN
+   self.theBackground->SetProperty, Color=[255,255,150]
+   self.thePlot->SetProperty, Color=[255, 0, 0]
+ENDIF ELSE BEGIN
+   Device, Get_Visual_Depth=theDepth
+   IF theDepth GT 8 THEN backColor = [210, 200, 180] ELSE backColor = [220, 220, 220]
+   self.theBackground->SetProperty, Color=backColor
+   self.thePlot->SetProperty, Color=[0, 0, 0]
+ENDELSE
+
+   ; Draw the view.
+
+IF Obj_Valid(self.theWindow) THEN self.theWindow->Draw, self.theView
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW::SetUnits, units
+
+; Sets the type of units to report in.
+
+possibleUnits = ["INCHES", "CENTIMETERS", ""]
+units = StrUpCase(units)
+index = WHERE(possibleUnits EQ units, count)
+IF count EQ 0 THEN BEGIN
+   ok = Dialog_Message('Unknown units: ' + units + '. Returning...')
+   RETURN
+ENDIF
+self.units = units
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW::GetWindowLocation, xsize, ysize, xoffset, yoffset
+
+; Returns the current size and offsets of the plot window in
+; units of inches or centimeters, as appropriate.
+
+xsize = self.xlength
+ysize = self.ylength
+xoffset = self.x1
+yoffset = self.y1
+
+factor = Float(self.pixels_per_inch)
+
+CASE self.units OF
+   'INCHES': BEGIN
+      xsize_in_pixels = (xsize * self.xsize)
+      ysize_in_pixels = (ysize * self.ysize)
+      xoff_in_pixels = (xoffset * self.xsize)
+      yoff_in_pixels = (yoffset * self.ysize)
+      xsize = (xsize_in_pixels / factor)
+      ysize = (ysize_in_pixels / factor)
+      xoffset = (xoff_in_pixels / factor)
+      yoffset = (yoff_in_pixels / factor)
+      ENDCASE
+   'CENTIMETERS': BEGIN
+      xsize_in_pixels = (xsize * self.xsize)
+      ysize_in_pixels = (ysize * self.ysize)
+      xoff_in_pixels = (xoffset * self.xsize)
+      yoff_in_pixels = (yoffset * self.ysize)
+      xsize = (xsize_in_pixels / factor * 2.54)
+      ysize = (ysize_in_pixels / factor * 2.54)
+      xoffset = (xoff_in_pixels / factor * 2.54)
+      yoffset = (yoff_in_pixels / factor * 2.54)
+      ENDCASE
+   "" :
+   ELSE: ok = Dialog_Message('Unknown units: ' + self.units + '. Returning...')
+ENDCASE
+
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW::SetWindowLocation, xsize, ysize, xoffset, yoffset
+
+; Sets the location of the plot window in the view.
+; Converts inches or centimeters to pixels.
+
+factor = Float(self.pixels_per_inch)
+
+CASE self.units OF
+   'INCHES': BEGIN
+      xsize_in_pixels = (xsize * factor)
+      ysize_in_pixels = (ysize * factor)
+      xoff_in_pixels = (xoffset * factor)
+      yoff_in_pixels = (yoffset * factor)
+      x1 = 0.0 > (xoff_in_pixels / self.xsize) < 0.85
+      y1 = 0.0 > (yoff_in_pixels / self.ysize) < 0.85
+      x2 = (x1 + (xsize_in_pixels / self.xsize)) < 1.0
+      y2 = (y1 + (ysize_in_pixels / self.ysize)) < 1.0
+      ENDCASE
+   'CENTIMETERS': BEGIN
+      xsize_in_pixels = (xsize * factor / 2.54)
+      ysize_in_pixels = (ysize * factor / 2.54)
+      xoff_in_pixels = (xoffset * factor / 2.54)
+      yoff_in_pixels = (yoffset * factor / 2.54)
+      x1 = 0.0 > (xoff_in_pixels / self.xsize) < 0.85
+      y1 = 0.0 > (yoff_in_pixels / self.ysize) < 0.85
+      x2 = (x1 + (xsize_in_pixels / self.xsize)) < 1.0
+      y2 = (y1 + (ysize_in_pixels / self.ysize)) < 1.0
+      ENDCASE
+   "" :
+   ELSE: ok = Dialog_Message('Unknown units: ' + self.units + '. Returning...')
+ENDCASE
+
+self.xlength = x2 - x1
+self.ylength = y2 - y1
+self.x1 = x1
+self.x2 = x2
+self.y1 = y1
+self.y2 = y2
+self->SetWindowSize, [x1, y1, x2, y2]
+
+END ;----------------------------------------------------------------------------------
+
+PRO FSC_PLOTWINDOW::SetWindowSize, position
+
+; Set the size of the plot window. Axes have to be
+; rescaled appropriately.
+
+IF N_Elements(position) EQ 0 THEN position = [0.2, 0.2, 0.8, 0.8]
+
+x1 = position[0]
+y1 = position[1]
+x2 = position[2]
+y2 = position[3]
+
+new = FltArr(2,5)
+new[0,*] = [x1, x1, x2, x2, x1]
+new[1,*] = [y1, y2, y2, y1, y1]
+
+   ; Modify the graphics objects.
+
+self.theBackground->SetProperty, Data=new
+xs = FSC_PlotWindow_Normalize([0,100], Position=[new[0,0]+0.05, new[0,2]-0.05])
+ys = FSC_PlotWindow_Normalize([-1,1], Position=[new[1,0]+0.05, new[1,1]-0.05])
+
+self.theXAxis->SetProperty, XCoord_Conv=xs, Location=[1000, new[1,0]+0.05, 0]
+self.theYAxis->SetProperty, YCoord_Conv=ys, Location=[new[0,0]+.05, 1000, 0]
+self.thePlot->SetProperty, XCoord_Conv=xs, YCoord_Conv=ys
+self.x1 = new[0,0]
+self.x2 = new[0,2]
+self.y1 = new[1,0]
+self.y2 = new[1,1]
+self.xlength = self.x2 - self.x1
+self.ylength = self.y2 - self.y1
+
+   ; Draw the view after resetting the transformation matrix.
+
+self.theModel->Reset
+self.theWindow->Draw, self.theView
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW::SetPageSize, pagesize, Landscape=landscape, TLB=tlb
+
+; Sets the page size of the window.
+
+; 200 pixels = 11 inches.
+; Letter 8.5 x 11.
+; Ledger 11 x 17.
+; Legal 8.5 x 14.
+; A4 8.27 x 11.7.
+
+STANDARD_SIZE = self.pixels_per_inch * 11.0
+
+IF N_Elements(pagesize) EQ 0 THEN pagesize = "LETTER"
+pagesize = StrUpCase(pagesize)
+IF N_Elements(tlb) EQ 0 THEN tlb = self.base
+
+CASE pagesize OF
+   'LETTER': BEGIN
+         xsize = STANDARD_SIZE * (8.5/11.0)
+         ysize = STANDARD_SIZE
+      ENDCASE
+   'LEDGER': BEGIN
+         xsize = STANDARD_SIZE
+         ysize = STANDARD_SIZE * (17.0/11.0)
+      ENDCASE
+   'LEGAL': BEGIN
+         xsize = STANDARD_SIZE * (8.5/11.0)
+         ysize = STANDARD_SIZE * (14.0/11.0)
+      ENDCASE
+   'A4': BEGIN
+         xsize = STANDARD_SIZE * (8.27/11.0)
+         ysize = STANDARD_SIZE * (11.7/11.0)
+      ENDCASE
+   'DISPLAY': BEGIN
+         xsize = 300
+         ratio = Float(!D.Y_Size) / !D.X_Size
+         ysize = 300 * ratio
+      ENDCASE
+   ELSE: BEGIN
+         ok = Dialog_Message('Unknown page size: ' + pagesize + '. Returning...')
+         RETURN
+      ENDCASE
+ENDCASE
+
+IF Keyword_Set(landscape) THEN BEGIN
+   temp = xsize
+   xsize = ysize
+   ysize = temp
+ENDIF
+
+self.xsize = ROUND(xsize)
+self.ysize = ROUND(ysize)
+self.pagesize = pagesize
+
+   ; Bugs in X windows implementation of window resizing necessitate
+   ; destroying and re-creating the draw widget window.
+
+IF !D.Name NE 'X' THEN BEGIN
+
+   self.theWindow->SetProperty, Dimensions=[xsize, ysize]
+
+ENDIF ELSE BEGIN
+
+   Widget_Control, tlb, Update=0
+   Widget_Control, self.drawID, Kill_Notify=""
+   Widget_Control, self.drawID, /Destroy
+   self.drawID = Widget_Draw(self.base, Button_Events=1, Expose_Events=1, $
+      Retain=0, Graphics_Level=2, XSize=xsize, YSize=ysize, $
+      Event_Pro='FSC_PLOTWINDOW_Events', UValue=self, Renderer=1, $
+      Kill_Notify='FSC_PLOTWINDOW_Kill_Notify', Motion_Events=1)
+   Widget_Control, self.drawID, /Realize
+   Widget_Control, self.drawID, Get_Value=theWindow
+   self.theWindow = theWindow
+   Widget_Control, tlb, Update=1
+
+ENDELSE
+
+self.thewindow->Draw, self.theView
+
+END ;----------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PLOTWINDOW::GetPagePixels, pagesize, Landscape=landscape
+
+; Given the page size or type, returns the xsize and ysize
+; of the draw widget in pixels.
+
+; 198 pixels = 11 inches.
+; Letter 8.5 x 11.
+; Ledger 11 x 17.
+; Legal 8.5 x 14.
+; A4 8.27 x 11.7.
+
+STANDARD_SIZE = self.pixels_per_inch * 11.0
+
+IF N_Elements(pagesize) EQ 0 THEN pagesize = "LETTER"
+pagesize = StrUpCase(pagesize)
+
+CASE pagesize OF
+   'LETTER': BEGIN
+         xsize = STANDARD_SIZE * (8.5/11.0)
+         ysize = STANDARD_SIZE
+      ENDCASE
+   'LEDGER': BEGIN
+         xsize = STANDARD_SIZE
+         ysize = STANDARD_SIZE * (17.0/11.0)
+      ENDCASE
+   'LEGAL': BEGIN
+         xsize = STANDARD_SIZE * (8.5/11.0)
+         ysize = STANDARD_SIZE * (14.0/11.0)
+      ENDCASE
+   'A4': BEGIN
+         xsize = STANDARD_SIZE * (8.27/11.0)
+         ysize = STANDARD_SIZE * (11.7/11.0)
+      ENDCASE
+   'DISPLAY': BEGIN
+         xsize = 300
+         ratio = Float(!D.Y_Size) / !D.X_Size
+         ; Check for *very* strange windows.
+         IF ratio LT 0.2 THEN ratio = 1.0
+         IF ratio GT 5 THEN ratio = 1.0
+         ysize = 300 * ratio
+      ENDCASE
+ENDCASE
+
+IF Keyword_Set(landscape) THEN BEGIN
+   temp = xsize
+   xsize = ysize
+   ysize = temp
+ENDIF
+
+RETURN, [ROUND(xsize), ROUND(ysize)]
+
+END ;----------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PLOTWINDOW::GetPosition
+
+; Returns the current position of the plot window in
+; the view. Normalized coordinates.
+
+RETURN, [self.x1, self.y1, self.x2, self.y2]
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW::Resize, event, direction
+
+; Performs window resizing, depending upon which of eight
+; possible directions you can move the window.
+
+IF direction EQ 'NONE' OR direction EQ 'MOVE' THEN BEGIN
+   RETURN
+ENDIF
+
+   ; Calculate movement in normalized coordinates. Update start coords.
+
+deltax = (event.x - self.currentX) / self.xsize
+deltay = (event.y - self.currentY) / self.ysize
+self.currentX = event.x
+self.currentY = event.y
+
+CASE direction OF
+   'SE': BEGIN
+         x1 = self.x1
+         x2 = (self.x2 + deltax) < 1.0
+         y1 = (self.y1 + deltay) > 0.0
+         y2 = self.y2
+         IF x2 LE x1 + 0.025 THEN x2 = x1 + 0.025
+         IF y1 GE y2 - 0.025 THEN y1 = y2 - 0.025
+         END
+   'E' : BEGIN
+         x1 = self.x1
+         x2 = (self.x2 + deltax) < 1.0
+         y1 = self.y1
+         y2 = self.y2
+         IF x2 LE x1 + 0.025 THEN x2 = x1 + 0.1
+         END
+   'SW': BEGIN
+         x1 = (self.x1 + deltax) > 0.0
+         x2 = self.x2
+         y1 = (self.y1 + deltay) > 0.0
+         y2 = self.y2
+         IF x1 GE x2 - 0.025 THEN x1 = x2 - 0.025
+         IF y1 GE y2 - 0.025 THEN y1 = y2 - 0.025
+         END
+   'S' : BEGIN
+         x1 = self.x1
+         x2 = self.x2
+         y1 = (self.y1 + deltay) > 0.0
+         y2 = self.y2
+         IF y1 GE y2 - 0.025 THEN y1 = y2 - 0.025
+         END
+   'N' : BEGIN
+         x1 = self.x1
+         x2 = self.x2
+         y1 = self.y1
+         y2 = (self.y2  + deltay) < 1.0
+         IF y2 LE y1 + 0.025 THEN y2 = y1 + 0.025
+         END
+   'NE': BEGIN
+         x1 = self.x1
+         x2 = (self.x2 + deltax) < 1.0
+         y1 = self.y1
+         y2 = (self.y2 + deltay) < 1.0
+         IF x2 LE x1 + 0.025 THEN x2 = x1 + 0.025
+         IF y2 LE y1 + 0.025 THEN y2 = y1 + 0.025
+         END
+   'W' : BEGIN
+         x1 = (self.x1  + deltax) > 0.0
+         x2 = self.x2
+         y1 = self.y1
+         y2 = self.y2
+         IF x1 GE x2 - 0.025 THEN x1 = x2 - 0.025
+         END
+   'NW': BEGIN
+         x1 = (self.x1 + deltax) > 0.0
+         x2 = self.x2
+         y1 = self.y1
+         y2 = (self.y2 + deltay) < 1.0
+         IF x1 GE x2 - 0.025 THEN x1 = x2 - 0.025
+         IF y2 LE y1 + 0.025 THEN y2 = y1 + 0.025
+
+         END
+ENDCASE
+
+new = FltArr(2,5)
+new[0,*] = [x1, x1, x2, x2, x1]
+new[1,*] = [y1, y2, y2, y1, y1]
+
+   ; Modify the graphics objects.
+
+self.theBackground->SetProperty, Data=new
+
+xs = FSC_PlotWindow_Normalize([0,100], Position=[new[0,0]+0.05, new[0,2]-0.05]) > 10e-6
+ys = FSC_PlotWindow_Normalize([-1,1], Position=[new[1,0]+0.05, new[1,1]-0.05]) > 10e-6
+
+self.theXAxis->SetProperty, XCoord_Conv=xs, Location=[1000, new[1,0]+0.05, 0]
+self.theYAxis->SetProperty, YCoord_Conv=ys, Location=[new[0,0]+.05, 1000, 0]
+self.thePlot->SetProperty, XCoord_Conv=xs, YCoord_Conv=ys
+self.x1 = new[0,0]
+self.x2 = new[0,2]
+self.y1 = new[1,0]
+self.y2 = new[1,1]
+self.xlength = self.x2 - self.x1
+self.ylength = self.y2 - self.y1
+
+   ; Draw the view after resetting the transformation matrix.
+
+self.theModel->Reset
+self.theWindow->Draw, self.theView
+
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW::CenterPlot, event
+
+   ; Centers the plot in the window.
+
+new = FltArr(2,5)
+self.x1 = (1.0 - self.xlength) / 2.0
+self.x2 = self.x1 + self.xlength
+self.y1 = (1.0 - self.ylength) / 2.0
+self.y2 = self.y1 + self.ylength
+
+new[0,*] = [self.x1, self.x1, self.x2, self.x2, self.x1]
+new[1,*] = [self.y1, self.y2, self.y2, self.y1, self.y1]
+
+   ; Modify the graphics objects.
+
+self.theBackground->SetProperty, Data=new
+
+xs = FSC_PlotWindow_Normalize([0,100], Position=[new[0,0]+0.05, new[0,2]-0.05])
+ys = FSC_PlotWindow_Normalize([-1,1], Position=[new[1,0]+0.05, new[1,1]-0.05])
+
+self.theXAxis->SetProperty, XCoord_Conv=xs, Location=[1000, new[1,0]+0.05, 0]
+self.theYAxis->SetProperty, YCoord_Conv=ys, Location=[new[0,0]+.05, 1000, 0]
+self.thePlot->SetProperty, XCoord_Conv=xs, YCoord_Conv=ys
+self.x1 = new[0,0]
+self.x2 = new[0,2]
+self.y1 = new[1,0]
+self.y2 = new[1,1]
+
+   ; Draw the view after resetting the transformation matrix.
+
+self.theModel->Reset
+self.theWindow->Draw, self.theView
+
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW::MovePlot, event
+
+   ; Calculate movement in normalized coordinates. Update start coords.
+
+deltax = (event.x - self.currentX) / self.xsize
+deltay = (event.y - self.currentY) / self.ysize
+self.currentX = event.x
+self.currentY = event.y
+
+   ; Translate the selected model.
+
+self.theModel->Translate, deltax, deltay, 0
+
+   ; Get the current transformation matrix.
+
+matrix = self.theModel->GetCTM()
+
+   ; Get the vertices of the polygon object.
+
+self.theBackground->GetProperty, Data=vertices
+
+   ; Apply the transformation matrix to the vertices.
+
+new = FltArr(2,5)
+FOR j=0,4 DO BEGIN
+   v = [vertices[*, j], 0.0, 1.0]
+   new[*, j] = (matrix ## v)[0:1]
+ENDFOR
+
+IF new[0,0] LT 0.0 THEN new[0,*] = [0.0, 0.0, self.xlength, self.xlength, 0.0]
+IF new[0,2] GT 1.0 THEN new[0,*] = [1.0-self.xlength, 1.0-self.xlength, 1.0, 1.0, 1.0-self.xlength]
+IF new[1,0] LT 0.0 THEN new[1,*] = [0.0, self.ylength, self.ylength, 0.0, 0.0]
+IF new[1,1] GT 1.0 THEN new[1,*] = [1.0-self.ylength, 1.0, 1.0, 1.0-self.ylength, 1.0-self.ylength]
+
+   ; Modify the graphics objects.
+
+self.theBackground->SetProperty, Data=new
+
+xs = FSC_PlotWindow_Normalize([0,100], Position=[new[0,0]+0.05, new[0,2]-0.05])
+ys = FSC_PlotWindow_Normalize([-1,1], Position=[new[1,0]+0.05, new[1,1]-0.05])
+
+self.theXAxis->SetProperty, XCoord_Conv=xs, Location=[1000, new[1,0]+0.05, 0]
+self.theYAxis->SetProperty, YCoord_Conv=ys, Location=[new[0,0]+.05, 1000, 0]
+self.thePlot->SetProperty, XCoord_Conv=xs, YCoord_Conv=ys
+self.x1 = new[0,0]
+self.x2 = new[0,2]
+self.y1 = new[1,0]
+self.y2 = new[1,1]
+
+   ; Draw the view after resetting the transformation matrix.
+
+self.theModel->Reset
+self.theWindow->Draw, self.theView
+
+END ;----------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PLOTWINDOW::WhichButtonReleased, event
+
+; Determines which button was used.
+
+buttons = ['NONE', 'LEFT', 'MIDDLE', 'NONE', 'RIGHT']
+RETURN, buttons[event.release]
+END ;----------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PLOTWINDOW::WhichButtonPressed, event
+
+; Determines which button was used.
+
+buttons = ['NONE', 'LEFT', 'MIDDLE', 'NONE', 'RIGHT']
+RETURN, buttons[event.press]
+END ;----------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PLOTWINDOW::InTarget, x, y, DIRECTION=direction
+
+; Given a location of the cursor in the window returns the
+; target location and the direction the window should be
+; resized in. Have to be within 2.5% of window edge to be
+; in moveable target.
+
+x = x / self.xsize
+y = y / self.ysize
+
+xtest = -1
+IF x GE self.x1 AND x LE self.x1 + 0.025 THEN xtest = 0
+IF x GT self.x1 + 0.025 AND x LT self.x2 - 0.025 THEN xtest = 1
+IF x GE self.x2 - 0.025 AND x LE self.x2 THEN xtest = 2
+ytest = -1
+IF y GE self.y1 AND y LE self.y1 + 0.1 THEN ytest = 0
+IF y GT self.y1 + 0.025 AND y LT self.y2 - 0.025 THEN ytest = 1
+IF y GE self.y2 - 0.025 AND y LE self.y2 THEN ytest = 2
+
+IF xtest EQ -1 OR ytest EQ -1 THEN BEGIN
+   retVal = 'ORIGINAL'
+   direction = 'NONE'
+ENDIF
+IF xtest EQ 0 AND ytest EQ  0 THEN BEGIN
+   retVal = 'SIZE_SW'
+   direction = 'SW'
+ENDIF
+IF xtest EQ 0 AND ytest EQ  1 THEN BEGIN
+    retVal = 'SIZE_EW'
+   direction = 'W'
+ENDIF
+IF xtest EQ 0 AND ytest EQ  2 THEN BEGIN
+    retVal = 'SIZE_NW'
+   direction = 'NW'
+ENDIF
+IF xtest EQ 1 AND ytest EQ  0 THEN BEGIN
+    retVal = 'SIZE_NS'
+   direction = 'S'
+ENDIF
+IF xtest EQ 1 AND ytest EQ  1 THEN BEGIN
+    retVal = 'MOVE'
+   direction = 'MOVE'
+ENDIF
+IF xtest EQ 1 AND ytest EQ  2 THEN BEGIN
+    retVal = 'SIZE_NS'
+   direction = 'N'
+ENDIF
+IF xtest EQ 2 AND ytest EQ  0 THEN BEGIN
+    retVal = 'SIZE_SE'
+   direction = 'SE'
+ENDIF
+IF xtest EQ 2 AND ytest EQ  1 THEN BEGIN
+    retVal = 'SIZE_EW'
+   direction = 'E'
+ENDIF
+IF xtest EQ 2 AND ytest EQ  2 THEN BEGIN
+    retVal = 'SIZE_NE'
+   direction = 'NE'
+ENDIF
+
+RETURN, retVal
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW::Realize
+
+Widget_Control, self.drawID, Get_Value=theWindow
+self.theWindow = theWindow
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW_Notify_Realize, drawID
+Widget_Control, drawID, Get_UValue=self
+self->Realize
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW::Process_Events, event
+
+; Handles draw widget events.
+
+possibleEvents = ['DOWN', 'UP', 'MOTION', 'SCROLL', 'EXPOSE']
+thisEvent = possibleEvents[event.type]
+
+   ; Are we inside a target? If so, change cursor.
+
+target = self->InTarget(event.x, event.y, Direction=direction)
+self.theWindow->SetCurrentCursor, target
+
+
+   ; What kind of event is this?
+
+CASE thisEvent OF
+   'EXPOSE': self.theWindow->Draw, self.theView
+   'UP': BEGIN
+         thisButton = self->WhichButtonReleased(event)
+         Widget_Control, event.id, Clear_Events=1
+         CASE self.action OF
+            'MOVE': BEGIN
+               self.currentX = -1
+               self.currentY = -1
+               self.action = ""
+               self->GetWindowLocation, xsize, ysize, xoffset, yoffset
+               IF self.event_pro NE "" THEN BEGIN
+                  thisEvent = {ID:event.id, TOP:event.top, HANDLER:event.handler, $
+                     xsize:xsize, ysize:ysize, xoffset:xoffset, yoffset:yoffset}
+                  Call_Procedure, self.event_pro, thisEvent
+               ENDIF
+               ENDCASE
+            'ORIGINAL':
+            'RESIZE': BEGIN
+               self.currentX = -1
+               self.currentY = -1
+               self.action = ""
+               self.direction = "NONE"
+               self->GetWindowLocation, xsize, ysize, xoffset, yoffset
+               IF self.event_pro NE "" THEN BEGIN
+                  thisEvent = {ID:event.id, TOP:event.top, HANDLER:event.handler, $
+                     xsize:xsize, ysize:ysize, xoffset:xoffset, yoffset:yoffset}
+                  Call_Procedure, self.event_pro, thisEvent
+               ENDIF
+               ENDCASE
+            ELSE:
+         ENDCASE
+         ENDCASE
+   'DOWN': BEGIN
+         thisButton = self->WhichButtonPressed(event)
+         IF thisButton EQ 'MIDDLE' THEN BEGIN
+            self->CenterPlot, event
+            self->GetWindowLocation, xsize, ysize, xoffset, yoffset
+            IF self.event_pro NE "" THEN BEGIN
+                  thisEvent = {ID:event.id, TOP:event.top, HANDLER:event.handler, $
+                     xsize:xsize, ysize:ysize, xoffset:xoffset, yoffset:yoffset}
+                  Call_Procedure, self.event_pro, thisEvent
+            ENDIF
+            RETURN
+         ENDIF
+         CASE target OF
+            'ORIGINAL': RETURN
+            'MOVE': BEGIN
+               self.currentX = event.x
+               self.currentY = event.y
+               self.action = 'MOVE'
+               ENDCASE
+            ELSE: BEGIN
+               self.currentX = event.x
+               self.currentY = event.y
+               self.action = 'RESIZE'
+               self.direction = direction
+               ENDCASE
+         ENDCASE
+         ENDCASE
+   'MOTION': BEGIN
+         CASE self.action OF
+            'MOVE': self->MovePlot, event
+            'RESIZE': self->Resize, event, self.direction
+            ELSE:
+         ENDCASE
+         ENDCASE
+ENDCASE
+
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW_Events, event
+
+; Widget event handler. Calls event handler method.
+
+Widget_Control, event.id, Get_UValue=self
+self->Process_Events, event
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW_Kill_Notify, drawID
+
+; Destroy the plot window object when the window is destroyed.
+
+Widget_Control, drawID, Get_UValue=self
+Obj_Destroy, self
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW::CLEANUP
+Obj_Destroy, self.theModel
+Obj_Destroy, self.theWindow
+Obj_Destroy, self.theView
+Obj_Destroy, self.plotModel
+END ;----------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PLOTWINDOW::INIT, $
+   parent, $                  ; The parent base widget of this compound widget. Required.
+   PageSize=pagesize, $       ; The "pagesize" of the widget. Possible values are: "LETTER", "LEDGER", "LEGAL", "A4", and "DISPLAY".
+   WindowSize=windowsize, $   ; The size of the "window" on the page. A four-element array of normalized coordinates in the form [x0, y0, x1, y1].
+   Event_Pro=event_pro, $     ; The event procedure for the widget.
+   Units=units, $             ; A string indicating INCHES or CENTIMETER units. DEVICE units represented by a null string, "".
+   UValue=uvalue, $           ; A user value for the caller of this program.
+   Landscape=landscape, $     ; If set, display the page in landscape mode. Otherwise the page is display in portrait mode.
+   Color=color, $             ; If set, display the window in "color". This is the default on 24-bit devices.
+   Debug=debug, $             ; Set this keyword to turn traceback error handling on in the error handling code.
+   WindowColor=windowColor    ; A three-element array specifying the background window color (RGB).
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PlotWindow_Error_Message(Traceback=Keyword_Set(debug))
+   RETURN, 0
+ENDIF
+
+IF N_Elements(pagesize) EQ 0 THEN pageSize = 'LETTER'
+IF N_Elements(windowsize) EQ 0 THEN windowsize = [0.2, 0.2, 0.8, 0.8]
+IF N_Elements(event_pro) EQ 0 THEN event_pro = ""
+IF N_Elements(units) EQ 0 THEN units=""
+IF N_Elements(uvalue) EQ 0 THEN uvalue=""
+IF N_Elements(landscape) EQ 0 THEN landscape = 0
+Device, Get_Visual_Depth=theDepth
+self.pixels_per_inch = 18
+sizes = self->GetPagePixels(pageSize, Landscape=landscape)
+xsize = sizes[0]
+ysize = sizes[1]
+IF N_Elements(windowColor) EQ 0 THEN $
+   IF theDepth GT 8 THEN windowColor = [60, 140, 140] ELSE windowColor = [80, 80, 80]
+
+IF N_Elements(color) EQ 0 THEN BEGIN
+   Device, Get_Visual_Depth=theDepth
+   IF theDepth GT 8 THEN color = 1 ELSE color = 0
+ENDIF ELSE color = Keyword_Set(color)
+
+x1 = windowsize[0]
+x2 = windowsize[2]
+y1 = windowsize[1]
+y2 = windowsize[3]
+
+data = Findgen(101)
+data = Sin(data/5) / Exp(data/20)
+
+self.thePlot = Obj_New('IDLgrPlot', data, Color=[0,0,0])
+self.thePlot->SetProperty, XCoord_Conv=FSC_PlotWindow_Normalize([0,100], $
+   Position=[x1+0.05, x2-0.05]) > 10e-6, $
+   YCoord_Conv=FSC_PlotWindow_Normalize([-1,1], Position=[y1+0.05, y2-0.05]) > 10e-6
+
+self.theXAxis = Obj_New('IDLgrAxis', 0, Color=[0,0,0], Ticklen=0.025, $
+   Minor=4, Range=[0,100], Location=[1000, y1+0.05 , 0.0], /NoText)
+self.theXAxis->SetProperty, XCoord_Conv=FSC_PlotWindow_Normalize([0,100], $
+   Position=[x1+0.05, x2-0.05]) > 10e-6
+
+self.theYAxis = Obj_New('IDLgrAxis', 1, Color=[0,0,0], Ticklen=0.025, $
+   Minor=4, Range=[-1,1], Location=[x1+0.05, 1000, 0.0], /NoText)
+self.theYAxis->SetProperty, YCoord_Conv=FSC_PlotWindow_Normalize([-1,1], $
+   Position=[y1+0.05, y2-0.05]) > 10e-6
+
+self.plotModel = Obj_New('IDLgrModel')
+
+IF theDepth GT 8 THEN theColor = [210, 200, 180] ELSE theColor = [255,255,255]
+self.theBackground = Obj_New('IDLgrPolygon', Color=theColor, $
+   [x1, x1, x2, x2, x1], [y1, y2, y2, y1, y1])
+
+self.theModel = Obj_New('IDLgrModel', Select_Target=1)
+self.theModel->Add, self.theBackground
+
+self.plotModel->Add, self.theXAxis
+self.plotModel->Add, self.theYAxis
+self.plotModel->Add, self.thePlot
+self.plotModel->Translate, 0, 0, 0.1
+
+self.theView = Obj_New('IDLgrView', Color=windowColor,  Viewplane_Rect=[0,0,1,1])
+self.theView->Add, self.theModel
+self.theView->Add, self.plotModel
+
+self.base = Widget_Base(parent, UValue=uvalue)
+self.drawID = Widget_Draw(self.base, Button_Events=1, Expose_Events=1, $
+   Retain=0, Graphics_Level=2, XSize=xsize, YSize=ysize, $
+   Event_Pro='FSC_PLOTWINDOW_Events', UValue=self, Renderer=1, $
+   Kill_Notify='FSC_PLOTWINDOW_Kill_Notify', Motion_Events=1, $
+   Notify_Realize='FSC_PLOTWINDOW_Notify_Realize')
+
+self.pagesize = pagesize
+self.landscape = Keyword_Set(landscape)
+self.x1 = x1
+self.x2 = x2
+self.y1 = y1
+self.y2 = y2
+self.xsize = Float(xsize)
+self.ysize = Float(ysize)
+self.currentX = -1
+self.currentY = -1
+self.xlength = x2 - x1
+self.ylength = y2 - y1
+self.units = units
+self.event_pro = event_pro
+self.color = color
+self->SetColor, color
+RETURN, 1
+END ;----------------------------------------------------------------------------------
+
+
+
+PRO FSC_PLOTWINDOW__DEFINE
+
+   struct = { FSC_PLOTWINDOW,          $ ; The object class name.
+              action:"",               $ ; A flag to indicate whether you are moving or resizing the plot window.
+              base: 0L,                $ ; The top-level base of the compound widget.
+              color:0,                 $ ; A flag to indicate if the window is in "color" or not.
+              currentX:0,              $ ; The starting X location for resizing.
+              currentY:0,              $ ; The starting Y location for resizing.
+              direction:"",            $ ; The direction of resizing movement.
+              event_pro:"",            $ ; The name of an event handler to call.
+              drawID:0L,               $ ; The draw widget identifier.
+              pageSize:"",             $ ; A string to indicate the "type" of page: Letter, A4, etc.
+              pixels_per_inch:0,       $ ; The pixel per inch scaling. 18 pixels/inch hardcoded.
+              landscape: 0,            $ ; A flag to indicate the window should be in landscape mode.
+              plotModel:Obj_New(),     $ ; The model for the plot and axes objects.
+              theBackground:Obj_New(), $ ; The background filled polygon.
+              thePlot:Obj_New(),       $ ; The plot object.
+              theModel:Obj_New(),      $ ; The model for the background object.
+              theView:Obj_New(),       $ ; The object view.
+              theWindow:Obj_New(),     $ ; The object window.
+              theXAxis:Obj_New(),      $ ; The X axis object.
+              theYAxis:Obj_New(),      $ ; The Y axis object.
+              units:"",                $ ; A string indicating INCHES or CENTIMETER units.
+              x1:0.0,                  $ ; The x location of lower-left corner of plot window. (Normalized coordinates.)
+              x2:0.0,                  $ ; The x location of upper-right corner of plot window. (Normalized coordinates.)
+              xlength:0.0,             $ ; The length of the plot window in x. (Normalized coordinates.)
+              xsize:0.0,               $ ; The current X size of the draw widget. (Device coordinates.)
+              y1:0.0,                  $ ; The y location of lower-left corner of plot window. (Normalized coordinates.)
+              y2:0.0,                  $ ; The yx location of upper-right corner of plot window. (Normalized coordinates.)
+              ylength:0.0,             $ ; The length of the plot window in y. (Normalized coordinates.)
+              ysize:0.0                $ ; The current X size of the draw widget. (Device coordinates.)
+            }
+END ;----------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PLOTWINDOW, parent, PageSize=pagesize, WindowSize=windowsize, $
+   Event_Pro=event_pro, Units=units, UValue=uvalue, Landscape=landscape, $
+   Color=color
+
+; A wrapper function so this object can be treated as a compound
+; widget function.
+
+IF N_Elements(pagesize) EQ 0 THEN pageSize = 'LETTER'
+IF N_Elements(windowsize) EQ 0 THEN windowsize = [0.15, 0.15, 0.85, 0.85]
+IF N_Elements(event_pro) EQ 0 THEN event_pro = ""
+IF N_Elements(units) EQ 0 THEN units=""
+color = Keyword_Set(color)
+landscape = Keyword_Set(landscape)
+IF N_Elements(parent) EQ 0 THEN BEGIN
+   ok = Dialog_Message('Parent parameter is required. Returning...')
+   RETURN, Obj_New()
+ENDIF
+
+RETURN, Obj_New('FSC_PLOTWINDOW', parent, PageSize=pagesize, WindowSize=windowsize, $
+   Event_Pro=event_pro, Units=units, UValue=uvalue, Landscape=landscape, Color=color)
+END ;----------------------------------------------------------------------------------
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_psconfig.html
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_psconfig.html	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_psconfig.html	(revision 207)
@@ -0,0 +1,1194 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+
+<html>
+
+<!-- ************** HEADER INFORMATION ************-->
+
+<head>
+<META name="Description" content="FSC_PSConfig Program for Configuring the IDL PostScript Device">
+<META name="Author" content="David W. Fanning, Ph.D.">
+<META name="Keywords" content="IDL, PostScript, configure, configuring, PostScript Device">
+<title>Configuring the IDL PostScript Device</title>
+</head>
+
+
+
+<!-- ************** CONSULTING BANNER ************-->
+
+<BODY VLINK="#FF0000" BACKGROUND="http://www.dfanning.com/images/graymarble.gif">
+<CENTER><IMG SRC="http://www.dfanning.com/images/banner.gif" WIDTH=443
+HEIGHT=111 ALT="Fanning Consulting Services (25K)"></CENTER>
+
+
+
+<!-- ************** BODY ************-->
+
+<CENTER><h1>Configuring the PostScript Device</h1></CENTER>
+
+<p>The <B>FSC_PSConfig</B> program is a 
+program for configuring the IDL PostScript device. The
+program is similar to (but much more powerful than) <B>PS_Form</B>, an older program offered 
+by Fanning Software Consulting. The <B>FSC_PSConfig</B> program is written as an object. 
+
+<p>In addition to configuring
+the PostScript device, the <B>FSC_PSConfig</B> program 
+allows you to keep track of the current state of the PostScript device at all times. 
+European users will be pleased to know that support for the A4 page and
+centimeter units are built into the program and can easily be set as program defaults.
+One of the most useful features of the <B>FSC_PSConfig</B> program 
+is its ability to collect user input via a graphical user interface, which--on a Windows
+machine with a 24-bit graphics display--looks similar to the illustration below. 
+
+<!-- ************** GRAPHIC EXAMPLE ************-->
+<P><CENTER><IMG SRC="http://www.dfanning.com/programs/docs/fsc_psconfig_pic1.jpg" 
+ALT="The FSC_PSConfig graphical user interface for gathering user input."></CENTER>
+
+<!-- ************** HORIZONTAL RULE IMAGE ************-->
+<P ALIGN=CENTER><IMG SRC="http://www.dfanning.com/images/hruler.gif" WIDTH=782 HEIGHT=3
+   ALT="-------"></P>
+
+<H2><A NAME="TOC">Table of Contents</A></H2>
+<UL>
+<LI><A HREF="#OVERVIEW">Program Overview</A>
+<LI><A HREF="#METHODS">Using the Program</A>
+	<UL>
+	<LI><A HREF="#INIT">Initializing the Program</A>
+      <LI><A HREF="#GUI">Description of the Graphical User Interface</A>
+      <LI><A HREF="#SETPROPERTY">Setting Program Properties</A>
+      <LI><A HREF="#KEYWORDS">Setting PostScript Configuration Keywords</A>
+      <LI><A HREF="#CLEANUP">Cleaning Up the Program</A>
+	</UL>
+<LI><A HREF="#EXAMPLE">Example Program Using <b>FSC_PSConfig</B></A>
+<LI><A HREF="#WRAPPER">A Wrapper Function for <b>FSC_PSConfig</B></A>
+<LI><A HREF="#CUSTOMIZING">Customizing Your Source Code</A>
+<LI><A HREF="#OTHERCODE">Other FSC Programs Needed to Run this Program</A>
+<LI><A HREF="#ORDERING">Disclaimer and Licensing Information</A>
+</UL>
+
+<!-- ************** HORIZONTAL RULE IMAGE ************-->
+<P ALIGN=CENTER><IMG SRC="http://www.dfanning.com/images/hruler.gif" WIDTH=782 HEIGHT=3
+   ALT="-------"></P>
+
+
+<H2><A NAME="OVERVIEW">Program Overview</A></H2>
+
+<p>How you use the <B>FSC_PSConfig</B> program is completely up to you.
+It has been designed to accommodate  different programming styles. For example, it can be
+called from the IDL command line or from within other IDL programs. Typically,
+the program is used by initializing the object (you can have as many of the objects as you
+like, so each program can have its own PostScript configuration setup), 
+gathering user input via the built-in Graphical User Interface (GUI), configuring the PostScript device, 
+and drawing your PostScript plot.
+Here is a typical sequence of commands. Each step will be explained in detail below,
+but this is a short overview of a typical session. (Users uninterested in the power
+of the <B>FSC_PSConfig</B> object can access most of the functionality through the
+<A HREF="#WRAPPER"><b>PSConfig</b></A> wrapper function described below.)
+
+<H3>Initializing the Object</H3>
+
+<P>The first step is to initialize the object. There are a number of keywords
+that can be used to set properties of the <B>FSC_PSConfig</B> object, but suppose you are going
+to leave it up to the user to determine exactly how the PostScript device should
+be configured. Then you might simply initialize the object like this:
+
+<PRE>
+   psObject = Obj_New("FSC_PSConfig")
+</PRE>
+
+<P>If you typically display PostScript output on an A4 page and prefer
+size and offset units to be displayed in centimeters rather than inches,
+then you can initialize the object with the <B>European</B> keyword set, like
+this. 
+<PRE>
+   psObject = Obj_New("FSC_PSConfig", /European)
+</PRE>
+
+<P>The A4 page and centimeter units are now the default for this object.
+Selecting a European style can also be selected via a check box
+on the graphical user interface.
+
+<H3>Gathering User Input</H3>
+
+<P>Next, you might gather the user's input into how he or she would
+like the PostScript device to be configured. You can do this
+with a graphical user interface in either modal (blocking) or 
+non-modal mode. Suppose you wish the program to wait for the user's input.
+You would invoke the graphical user interface in blocking mode with this command:
+
+<PRE>
+   psObject->GUI
+</PRE>
+
+<H3>Configuring the PostScript Device</H3>
+
+<P>The real purpose of the <B>FSC_PSConfig</B> object is to return
+keywords that are appropriate for the PostScript device. The way the
+PostScript device is configured is to make the PostScript device the
+current graphics device, and then pass these keywords to the PostScript
+device via the <B>Device</B> command using the "keyword inheritance"
+mechanism and the <B>_Extra</B> keyword. The keywords are obtained from the
+object by calling the <b>GetKeywords</b> method. A typical sequence of
+commands looks like this:
+
+<PRE>
+   thisDevice = !D.Name
+   Set_Plot, "PS"
+   Device, _Extra=psObject->GetKeywords()
+</PRE>
+
+<H3>Drawing the PostScript Graphics</H3>
+
+<p>The PostScript graphics are now written to the PostScript file in
+the normal way. (Here a simple <b>Plot</b> command is used, but the graphics command
+or commands can be as elaborate as you like.)
+
+<PRE>
+   Plot, data
+</PRE>
+
+<H3>Cleaning Up</H3>
+
+<P>The final step is to clean up. Note that you do not have to
+destroy the object, as shown here. In fact, you may want to keep
+the object around for the entire IDL session, so you always know
+the current configuration of the PostScript device. Repeated calls
+to invoke the graphical user interface will show the current
+state of the PostScript device. Typical clean-up commands will be
+similar to these:
+
+<PRE>
+   Device, /Close_File
+   Set_Plot, thisDevice
+   Obj_Destroy, psObject
+</PRE>
+
+<P><CENTER>[<A HREF="#TOC">Return to Contents</A>]</CENTER>
+<!-- ************** HORIZONTAL RULE IMAGE ************-->
+<P ALIGN=CENTER><IMG SRC="http://www.dfanning.com/images/hruler.gif" WIDTH=782 HEIGHT=3
+   ALT="-------"></P>
+
+<H2><A NAME="METHODS">Using the Program</A></H2>
+
+<p>The <B>FSC_PSConfig</B> program is used by calling the program's object methods. This section
+provides a detailed description of the object methods available to the user. (There are
+a number of other methods in the object that are used internally to run the program and 
+should not normally be accessed by the user of the program. These are not described here,
+although they are extensively documented in the source code.)
+
+<H3><A NAME="INIT">Initializing the Program</A></H3>
+
+<P>The object is initialized by creating an object of the <B>FSC_PSCONFIG</B> object class:
+
+<PRE>
+   psObject = Obj_New("FSC_PSConfig")
+</PRE>
+
+<p>At the time the object is initialized, various keywords can be used to set
+properties of the object. These keywords are typically (but not exclusively) the same keywords that
+can be used to configure the PostScript device (i.e., the keywords appropriate
+for the <B>Device</B> command when the PostScript device is the current graphics
+device). Here is a complete description of the <B>INIT</B> method keywords you can use.
+
+<UL>
+<LI><B>AvantGarde</B> - Set this keyword to select the AvantGarde font. Turned off by default.
+<LI><B>Bits_per_Pixel</B> - The number of image bits saved for each image pixel: 2, 4, or 8. The default is 8.
+<LI><B>Bold</B> - Set this keyword to select the Bold font style. Turned off by default.
+<LI><B>BookStyle</B> - Set this keyword to select the Book font style. Turned off by default.
+<LI><B>Bookman</B> - Set this keyword to select the Bookman font. Turned off by default.
+<LI><B>Color</B> - Set this keyword to select Color PostScript output. Turned off by default.
+<LI><B>Courier</B> - Set this keyword to select the Courier font. Turned off by default.
+<LI><B>Debug</B> - Set this keyword to turn traceback information on for error messages. 
+This is useful for debugging program code. Turned off by default.
+<LI><B>DefaultSetup</B> - Set this keyword to the "name" of a default style. Current styles (you
+can easily create and add your own to the source code) are the following:
+	<UL>
+      <LI><B>"System (Portrait)"</B> - The normal "default" system set-up. Also, <B>"System"</B>.
+      <LI><B>"System (Landcape)"</B> - The normal "default" landscape system set-up. 
+      <LI><B>"Centered (Portrait)"</B> - The window centered on the page. Also, <B>"Center"</B> or "Centered".
+      <LI><B>"Centered (Landscape)"</B> - The window centered on the landscape page. Also, <B>"Landscape"</B>.
+      <LI><B>"Square (Portrait)"</B> - A square plot, centered on the page. 
+      <LI><B>"Square (Landscape)"</B> - A square plot, centered on the landscape page. 
+      <LI><B>"Figure (Small)"</B> - A small encapsulated figure size, centered on page. Also, <B>"Encapsulated"</B> or <B>"Encapsulate"</B>.
+      <LI><B>"Figure (Large)"</B> - A larger encapsulated figure size, centered on page. Also, <B>"Figure"</B>.
+      <LI><B>"Color (Portrait)"</B> - A "centered" plot, with color turned on. Also, <B>"Color"</B>.
+     <LI><B>"Color (Landscape)"</B> - A "centered" landscape plot, with color turned on.
+	</UL>
+<LI><B>Demi</B> - Set this keyword to select the Demi font style. Turned off by default.
+<LI><B>Directory</B> - Set thie keyword to the name of the starting directory. The current directory is used by default.
+<LI><B>Encapsulate</B> - Set this keyword to select Encapsulated PostScript output. Turned off by default.
+<LI><B>European</B> - Set this keyword to indicate "european" mode (i.e., A4 page and centimeter units). Turned off by default.
+<LI><B>Filename</B> - Set thie keyword to the name of the PostScript file. In the source code version the default is "idl.ps", but
+in the shareware version this keyword cannot be set and is always "coyote.ps". 
+<LI><B>FontSize</B> - ; Set this keyword to the font size. Between 6 and 36. Default is 12.
+<LI><B>FontType</B> - ; Set this keyword to indicate the type of fon
+you want selected. Hershey Fonts: -1, Hardward Fonts: 0, and True-Type Fonts: 1.<LI><B>Helvetica</B> - Set this keyword to select the Helvetica font. This is the default selection.
+<LI><B>Inches</B> - Set this keyword to indicate sizes and offsets are in inches as opposed to centimeters.  
+Set by <B>European</B> keyword by default.
+<LI><B>Italic</B> - Set this keyword to select the Italic font style. Turned off by default.
+<LI><B>Isolatin</B> - Set this keyword to select ISOlatin1 encoding. Turned off by default.
+<LI><B>Landscape</B> - Set this keyword to select Landscape page output. Portrait page output is the default.
+<LI><B>Light</B> - Set this keyword to select the Light font style. Turned off by default.
+<LI><B>Medium</B> - Set this keyword to select the Medium font style. Turned off by default.
+<LI><B>Name</B> - Set this keyword to the "name" of the object. This can be anything you like. 
+Objects that have different names can display their graphical user interfaces simultaneously. The
+object name appears on the title of the graphical user interface.
+<LI><B>Narrow</B> - Set this keyword to select the Narrow font style. Turned off by default.
+<LI><B>Oblique</B> - Set this keyword to select the Oblique font style. Turned off by default.
+<LI><B>PageType</B> - Set this keyword to the "type" of page. Possible values are:
+	<UL>
+	<LI><B>"Letter"</B> - 8.5 by 11 inches. (Default, unless the <B>European</B> keyword is set.)
+	<LI><B>"Legal"</B> - 8.5 by 14 inches.
+	<LI><B>"Ledger"</B> - 11 by 17 inches.
+	<LI><B>"A4"</B> - 21.0 by 29.7 centimeters. (Default, if the <B>European</B> keyword is set.)
+	</UL>
+<LI><B>Palatino</B> - Set this keyword to select the Palatino font.  Turned off by default.
+<LI><B>Preview</B> - Set this keyword to select Preview mode: 0 is "none", 1 is "EPSI", or 2 is "EPSF".
+<LI><B>Schoolbook</B> - Set this keyword to select the Schoolbook font. Turned off by default.
+<LI><B>Set_Font</B> - Set this keyword to the name of a font passed to PostScript with Set_Plot keyword.
+<LI><B>Symbol</B> - Set this keyword to select the Symbol font. Turned off by default.
+<LI><B>Times</B> - Set this keyword to select the Times font. Turned off by default.
+<LI><B>TrueType</B> - Set this keyword to select True-Type fonts. Turned off by default.
+<LI><B>XOffset</B> - Set this keyword to the X Offset.  Uses "System (Portrait)" defaults. (Note: offset calculated from lower-left corner of page.)
+<LI><B>XSize</B> - Set this keyword to the X size of the PostScript "window". Uses "System (Portrait)" defaults.
+<LI><B>YOffset</B> - Set this keyword to the Y Offset.  Uses "System (Portrait)" defaults. (Note: offset calculated from lower-left corner of page.)
+<LI><B>YSize</B> - Set this keyword to the Y size of the PostScript "window". Uses "System (Portrait)" defaults.
+<LI><B>ZapfChancery</B> - Set this keyword to select the ZapfChancery font. Turned off by default.
+<LI><B>ZapfDingbats</B> - Set this keyword to select the ZapfDingbats font. Turned off by default.
+</UL>
+
+<p>For example, to select a centered, color, encapsulated PostScript file, using the Times Bold PostScript
+font, and named <em>myplot.eps</em>, you can initialize the object like this:
+
+<PRE>
+   psObject = Obj_New("FSC_PSConfig", /Color, /Encapsulate, /Times, /Bold, Filename="myplot.eps")
+</PRE>
+
+<P><CENTER>[<A HREF="#TOC">Return to Contents</A>]</CENTER>
+<!-- ************** HORIZONTAL RULE IMAGE ************-->
+<P ALIGN=CENTER><IMG SRC="http://www.dfanning.com/images/hruler.gif" WIDTH=782 HEIGHT=3
+   ALT="-------"></P>
+
+
+<H3><A NAME="GUI">Description of the Graphical User Interface</A></H3>
+
+<P>The program's graphical user interface is invoked by calling the object's <B>GUI</B>
+method, like this:
+
+<PRE>
+   psObject->GUI
+</PRE>
+
+<p>Keywords are available with this method that control how the
+graphical user interfaces appears and what properties it has. Called as above,
+the interface is a blocking widget. This means the IDL command line will block
+and user will be unable to enter IDL commands at the command line until the widget
+is dismissed by clicking either the <em>Cancel</em> or the <em>Accept</em> button.
+Valid keywords for this method are these:
+
+<UL>
+<LI><B>Cancel</B> - Set this output keyword to a named variable that will be set to 1 if the user
+selected the <em>Cancel</em> button, and to 0 if the user selected the <em>Accept</Em> button. Note that
+this value only has meaning when the widget is is blocking (or modal) mode. In non-modal mode, the value
+is always set to 0.
+
+<PRE>
+      psObject->GUI, Group_Leader=event.top, Cancel=cancelled
+</PRE>
+
+<LI><B>FontInfo</B> - This keyword is set if you want the user to be able to
+configure the PostScript device with font information as well. Please see the
+description of how to use font information below, but the graphical interface will
+look similar to this.
+
+<PRE>
+      psObject->GUI, FontInfo=1
+</PRE>
+
+<P><CENTER><IMG SRC="http://www.dfanning.com/programs/docs/fsc_psconfig_pic3.jpg" 
+ALT="The FSC_PSConfig graphical user interface with the font information displayed."></CENTER>
+
+<p>Users have the ability to select Hershey, Hardware, or True-Type fonts, as well as many
+font "properties".
+
+
+<LI><B>Group_Leader</B> - Set this keyword to the identifier of a widget which is the group leader for
+the graphical user interface. This keyword <em>must</em> be set if you want modal (as opposed to just 
+blocking) behavior from the program. In other words, you will probably <em>always</em> set this keyword
+if you are calling the GUI from within another widget program. For example, from within a widget program,
+the graphical user interface should be invoked like this:
+
+<PRE>
+      psObject->GUI, Group_Leader=event.top
+</PRE>
+
+
+<LI><B>NoBlock</B> - This keyword is set if you want non-modal, and non-blocking
+behavior from the program. This is the mode you would use, for example, if you want
+the graphical user interface to stay on the display so you can change the PostScript
+set-up at will. Notice that in this mode the <em>Cancel</em> button is named <em>Dismiss</em>
+and the <em>Accept</em> button is named <em>Apply</em>.
+
+<PRE>
+      psObject->GUI, /NoBlock
+</PRE>
+
+<!-- ************** GRAPHIC EXAMPLE ************-->
+<P><CENTER><IMG SRC="http://www.dfanning.com/programs/docs/fsc_psconfig_pic2.jpg" 
+ALT="The FSC_PSConfig graphical user interface in non-modal and non-saved mode."></CENTER>
+
+
+<p>In non-modal mode, selecting the <em>Apply</em> button will save the current PostScript
+configuration. Note that the PostScript graphics window changes background color if the
+current configuration shown on the form is not currently saved. (The program is shown in its
+ unsaved condition in the illustration
+above.) Upon saving the configuration,
+the background color will change back to its default color. The <em>Revert</em> button will
+revert to the last saved configuration.
+</UL>
+
+<H4>The Left Panel</H4>
+
+<p>The left panel of the graphical user interface contains eight droplist widgets
+and looks like this. A description of each droplist follows the illustration.
+
+<!-- ************** GRAPHIC EXAMPLE ************-->
+<P><CENTER><IMG SRC="http://www.dfanning.com/programs/docs/fsc_psconfig_pic4.jpg" 
+ALT="The left panel of the FSC_PSConfig graphical user interface."></CENTER>
+
+
+
+<UL>
+<LI><B>Page Size</B> - This droplist controls the page size. It should be set to the type of output
+you intend to print, since offsets and sizes will be based on the page size selected. This will be
+set to "Letter" by default, unless the <b>European</b> keyword has been set, in which case 
+the "A4" option is the default.
+<LI><B>Orientation</B> - This droplist controls whether the page will be in portrait or landscape
+oreintation. The <b>Portrait</b> and <b>Landscape</b> Device keywords are set from this droplist.
+<LI><B>Units</B> - This droplist controls whether the size and offsets are measured in inches or centimeters.
+The <b>Inches</b> Device keyword is set from this droplist.
+<LI><B>Encapsulation</B> - This droplist controls whether <b>Encapsulated</b> Device keyword is set. If
+encapsulation is turned <em>Off</em>, then the <b>Preview Mode</b> droplist is insensitive.
+
+<LI><B>Preview Mode</B> - This droplist selects the value of the <b>Preview</b> Device keyword. 
+It is sensitive to user input only if the <em>Encapsulation</em> droplist is turned <em>On</em>
+"None" sets the keyword to 0, "ESPI" sets the keyword to 1, and "ESPF" sets the
+keyword to 2. If you wish IDL to create a preview image for Macintoshs or PCs, then you should choose
+the "ESPF" option.
+
+<LI><B>Color Output</B> - This droplist controls whether <b>Color</b> Device keyword is set. 
+<LI><B>Bits Per Image Pixel</B> - This droplist controls the value of the <b>Bits_Per_Pixel</b> 
+Device keyword. 
+<LI><B>Default Setups</B> - This droplist selects the various default set-ups, which 
+change multiple program settings at once. The choices in this droplist are easily modified by
+the user in the source code. Typically they would be choices in use at your facility.
+<LI><B>European Style</B> - This checkbox controls the Page Size and Units keywords. If checked,
+an A4 page size is used, and centimeters are used for Units. 
+</UL>
+
+<H4>The Center Panel</H4>
+
+<P>The center panel of the graphical user interface contains the size and offset
+information, directions for operating the PostScript "plot", and fields to
+indicate the output directory and file names. It looks similar to the
+illustration below. An explanation of each item follows the illustration.
+
+
+<!-- ************** GRAPHIC EXAMPLE ************-->
+<P><CENTER><IMG SRC="http://www.dfanning.com/programs/docs/fsc_psconfig_pic5.jpg" 
+ALT="The center panel of the FSC_PSConfig graphical user interface."></CENTER>
+
+<UL>
+<LI><B>X Size</B> - This text field contains the X size of the PostScript "window". Its value is
+used to set the <B>XSize</B> Device keyword. After entering a value in this field you <em>must</em>
+enter a carriage return in the field for the new information to be transmitted to the plot window
+in the right panel.
+
+<LI><B>Y Size</B> - This text field contains the Y size of the PostScript "window". Its value is
+used to set the <B>YSize</B> Device keyword. After entering a value in this field you <em>must</em>
+enter a carriage return in the field for the new information to be transmitted to the plot window
+in the right panel.
+
+<LI><B>X Offset</B> - This text field contains the X offset of the PostScript "window". Its value is
+used to set the <B>XOffset</B> Device keyword. After entering a value in this field you <em>must</em>
+enter a carriage return in the field for the new information to be transmitted to the plot window
+in the right panel. Offsets are always calculated from the lower-left corner of the page regardless of
+the orientation, unlike the way you configure the PostScript device. The complexities of PostScript
+are handled behind the scenes and are not passed along to unsuspecting end-users. 
+
+<LI><B>Y Offset</B> - This text field contains the Y offset of the PostScript "window". Its value is
+used to set the <B>YOffset</B> Device keyword. After entering a value in this field you <em>must</em>
+enter a carriage return in the field for the new information to be transmitted to the plot window
+in the right panel. Offsets are always calculated from the lower-left corner of the page regardless of
+the orientation, unlike the way you configure the PostScript device. The complexities of PostScript
+are handled behind the scenes and are not passed along to unsuspecting end-users. 
+
+<LI><B>Directory</B> - The name of the directory where the PostScript file is to be
+written. The <em>Browse</em> button following the text field calls the IDL <b>Dialog_Pickfile</b>
+command with the <b>Directory</B> keyword set for directory selection.
+
+<LI><B>Filename</B> - The name of the output PostScript file. The <em>Browse</em> button 
+following the text field calls the IDL <b>Dialog_Pickfile</b>
+command for file selection. The <em>Directory</em> and
+<em>Filename</em> values are put together to constuct the value of the Device <B>Filename</B>
+keyword. 
+
+</UL>
+
+<p>If the <b>FontInfo</b> keyword is set when the graphical user interface is invoked, the
+center panel may also contain graphical elements allowing user input into font selections.
+These additional fields are described below the illustration.
+
+<!-- ************** GRAPHIC EXAMPLE ************-->
+<P><CENTER><IMG SRC="http://www.dfanning.com/programs/docs/fsc_psconfig_pic6.jpg" 
+ALT="The center panel of the FSC_PSConfig graphical user interface with font information turned on."></CENTER>
+
+<UL>
+<LI><B>Font Type</B> - This droplist sets the font type. The other font options 
+are available only if the <em>Font Type</Em> droplist
+selection is set to something other than the "Vector (Hershey)".
+Note that the <em>Font Type</Em> droplist default selection depends upon the
+value of the <B>!P.Font</B> system variable when the graphical user interface
+is invoked, although it can be also be set via a <b>FontType</b> keyword when the grahical
+user interface is invoked. For example, the illustration above was produced with
+this syntax:
+<PRE>
+   IDL> psObject->GUI, /FontInfo, FontType=1
+</PRE>
+
+<LI><B>Font</B> - This droplist allows selection of one of the 10 font families
+available on most PostScript printers. A selection here sets the corresponding
+Device keyword.
+
+<LI><B>Font Style Box</B> - This non-exclusive base allows you to set the eight
+font styles that can be set for the PostScript device. These font styles are applied
+to the font selection described above to modify it with the selected style. 
+Note that which font styles are available for
+which font family is not controlled by IDL, but is a function of the fonts installed
+on your computer or printer. Thus, you must use this information carefully. The corresponding
+Device keyword is set according to each style selection.
+
+<LI><B>Clear Font Styles</B> - This button clears all the font style attributes
+selections described above.
+
+<LI><B>Font Size</B> - This droplist allows you to select the font size in point
+sizes from 6 to 36. The default size is 12. The <b>FontSize</B> Device keyword is
+set to this value.
+
+<LI><B>True-Type</B> - This droplist sets the Device <b>True_Type</B> keyword. If it is
+turned on true-type fonts are used for output if they are available.
+
+<LI><B>ISOlatin1</B> - This droplist sets the Device <b>ISOlatin1</B> keyword. If it is
+turned on isolatin encoding is used for output. This allows output in many languages other
+than English.
+
+</UL>
+
+<H4>The Right Panel</H4>
+
+<P>The right panel of the graphical user interface contains the representation of
+the PostScript page. This window will change shape and size as different page sizes and orientations
+are selected. It looks similar to the illustration below. (Note that the colors you see here will only
+appear on 24-bit displays. On 8-bit displays the colors are less exciting.)
+
+
+<!-- ************** GRAPHIC EXAMPLE ************-->
+<P><CENTER><IMG SRC="http://www.dfanning.com/programs/docs/fsc_psconfig_pic7.jpg" 
+ALT="The righ panel of the FSC_PSConfig graphical user interface."></CENTER>
+
+<p>The "plot" in the window can be moved and resized by the user. It represents
+the "window" on the PostScript page where graphics will be drawn. As such, it controls
+the <B>XSize</B>, <B>YSize</B>, <B>XOffset</B>, and <B>YOffset</B> Device keywords.
+The plot window can be moved by clicking somewhere inside it and dragging. If you locate
+the cursor near an edge of the plot, you can click and drag to resize the window. Cursor changes
+will occur to indicate whether you are in drag or resize mode. Notice
+as you do that the size and offset fields in the right panel are updated with the new
+window sizes and offsets. Notice that the background color of the window changes if
+the current configuration shown on the form hasn't been saved and the program is in non-blocking
+mode. It will look similar to
+the illustration below. The backgound color does not change if the graphical user interface
+is in blocking mode. (Non-blocking mode is selected with the <b>NoBlock</B> keyword when the
+graphical user interface is invoked.)
+
+<!-- ************** GRAPHIC EXAMPLE ************-->
+<P><CENTER><IMG SRC="http://www.dfanning.com/programs/docs/fsc_psconfig_pic11.jpg" 
+ALT="The righ panel of the FSC_PSConfig graphical user interface."></CENTER>
+
+
+
+<p>The plot window can be centered in the page by clicking the middle mouse button
+anywhere inside the PostScript page representation. Note that the middle mouse button
+can be simulated if you don't have a three-button mouse. For example, on PCs a <em>Ctrl-Click</em>
+is interpreted as a middle mouse click. <em>Option-Click</em> on a Macintosh will do the same.
+
+<p>If the <em>Color Output</em> droplist is turned <em>On</em>, then the plot
+is shown in color as a visual clue to the color property. 
+
+<!-- ************** GRAPHIC EXAMPLE ************-->
+<P><CENTER><IMG SRC="http://www.dfanning.com/programs/docs/fsc_psconfig_pic8.jpg" 
+ALT="The center panel of the FSC_PSConfig graphical user interface in color."></CENTER>
+
+<H4>The Action Button Panel</H4>
+
+<p>The action button panel looks different, depending upon whether the graphical user
+interface is is blocking (modal) mode or in  non-blocking mode. Here is what it looks
+like in non-blocking mode.
+
+<!-- ************** GRAPHIC EXAMPLE ************-->
+<P><CENTER><IMG SRC="http://www.dfanning.com/programs/docs/fsc_psconfig_pic9.jpg" 
+ALT="The button panel of the FSC_PSConfig graphical user interface in non-blocking mode."></CENTER>
+
+<P>Here is how it appears in blocking mode. 
+
+<!-- ************** GRAPHIC EXAMPLE ************-->
+<P><CENTER><IMG SRC="http://www.dfanning.com/programs/docs/fsc_psconfig_pic10.jpg" 
+ALT="The button panel of the FSC_PSConfig graphical user interface in blocking mode."></CENTER>
+
+<p>Notice that in blocking mode the <em>Dismiss</em> button is named <em>Cancel</em> and
+the <em>Apply</em> button is named <em>Accept</em>, but they have similar functions. The only
+real difference is that the <em>Accept</em> button destroys the widget (as do the <em>Dismiss</em>
+and <em>Cancel</em> buttons), while the <em>Apply</em> button does not. 
+
+<UL>
+<LI><B>Dismiss</B> or <B>Cancel</B> - This button destroys the graphical user interface.
+The last saved configuration of the graphical user interface is in effect.
+
+<LI><B>Revert</B> - This button restores the last saved configuration of the graphical
+user interface. A configuration is saved when the <em>Apply</em> or <em>Accept</em>
+button is selected.
+
+<LI><B>Help</B> - This button provides a Help message to the user and points the
+user to the program documentation. This action may have been customized for your facility.
+
+<LI><B>Apply</B> or <B>Accept</B> - This button saves the current configuration of the 
+graphical user interface. If the button is the <em>Accept</em> button, the graphical user
+interface is also destroyed and the block released.
+
+<P> Note that the name of this button can be changed by using the <B>Accept_Button_Name</B>
+keyword when the graphical user interface is invoked. For example, you might want to name
+the button "Print". You would do it like this:
+
+<PRE>
+   IDL> psObject->GUI, Accept_Button_Name='Print'
+</PRE>
+</UL>
+
+<p>The buttons would now look like this:
+
+<P><CENTER><IMG SRC="http://www.dfanning.com/programs/docs/fsc_psconfig_pic12.jpg" 
+ALT="The button panel of the FSC_PSConfig graphical user interface in blocking mode."></CENTER>
+
+<P><CENTER>[<A HREF="#TOC">Return to Contents</A>]</CENTER>
+<!-- ************** HORIZONTAL RULE IMAGE ************-->
+<P ALIGN=CENTER><IMG SRC="http://www.dfanning.com/images/hruler.gif" WIDTH=782 HEIGHT=3
+   ALT="-------"></P>
+
+
+<H2><A NAME="SETPROPERTY">Setting Program Properties</A></H2>
+
+<p>The current configuration of the <b>FSC_PSConfig</B> object can be set at any time by
+using the <b>SetProperty</B> method of the object. The keywords that can be used to set
+properties are nearly identical to the keywords avaiable for the <b>INIT</b> method. Here is 
+a list of the keywords and thier meaning.
+
+<UL>
+<LI><B>AvantGarde</B> - Set this keyword to select the AvantGarde font.
+<LI><B>Bits_per_Pixel</B> - The number of image bits saved for each image pixel: 2, 4, or 8.
+<LI><B>Bold</B> - Set this keyword to select the Bold font style. 
+<LI><B>BookStyle</B> - Set this keyword to select the Book font style. 
+<LI><B>Bookman</B> - Set this keyword to select the Bookman font. T
+<LI><B>Color</B> - Set this keyword to select Color PostScript output. 
+<LI><B>Courier</B> - Set this keyword to select the Courier font. 
+<LI><B>DefaultSetup</B> - Set this keyword to the "name" of a default style. Factory styles (you
+can easily create and add your own to the source code) are the following:
+	<UL>
+      <LI><B>"System (Portrait)"</B> - The normal "default" system set-up. Also, <B>"System"</B>.
+      <LI><B>"System (Landcape)"</B> - The normal "default" landscape system set-up. 
+      <LI><B>"Centered (Portrait)"</B> - The window centered on the page. Also, <B>"Center"</B> or "Centered".
+      <LI><B>"Centered (Landscape)"</B> - The window centered on the landscape page. Also, <B>"Landscape"</B>.
+      <LI><B>"Square (Portrait)"</B> - A square plot, centered on the page. 
+      <LI><B>"Square (Landscape)"</B> - A square plot, centered on the landscape page. 
+      <LI><B>"Figure (Small)"</B> - A small encapsulated figure size, centered on page. Also, <B>"Encapsulated"</B> or <B>"Encapsulate"</B>.
+      <LI><B>"Figure (Large)"</B> - A larger encapsulated figure size, centered on page. Also, <B>"Figure"</B>.
+      <LI><B>"Color (Portrait)"</B> - A "centered" plot, with color turned on. Also, <B>"Color"</B>.
+     <LI><B>"Color (Landscape)"</B> - A "centered" landscape plot, with color turned on.
+	</UL>
+<LI><B>Demi</B> - Set this keyword to select the Demi font style. 
+<LI><B>Directory</B> - Set thie keyword to the name of the starting directory. 
+<LI><B>Encapsulate</B> - Set this keyword to select Encapsulated PostScript output.
+<LI><B>European</B> - Set this keyword to indicate "european" mode (i.e., A4 page and centimeter units). 
+<LI><B>Filename</B> - Set thie keyword to the name of the PostScript file. In the source code version the default is "idl.ps", but
+in the shareware version this keyword cannot be set and is always "coyote.ps". 
+<LI><B>FontSize</B> - ; Set this keyword to the font size. Between 6 and 36. 
+<LI><B>FontType</B> - ; Set this keyword to indicate the type of fon
+you want selected. Hershey Fonts: -1, Hardward Fonts: 0, and True-Type Fonts: 1.<LI><B>Helvetica</B> - Set this keyword to select the Helvetica font. This is the default selection.
+<LI><B>Helvetica</B> - Set this keyword to select the Helvetica font. 
+<LI><B>Inches</B> - Set this keyword to indicate sizes and offsets are in inches as opposed to centimeters.  
+<LI><B>Italic</B> - Set this keyword to select the Italic font style. 
+<LI><B>Isolatin</B> - Set this keyword to select ISOlatin1 encoding. 
+<LI><B>Landscape</B> - Set this keyword to select Landscape page output. 
+<LI><B>Light</B> - Set this keyword to select the Light font style. 
+<LI><B>Medium</B> - Set this keyword to select the Medium font style. 
+<LI><B>Name</B> - Set this keyword to the "name" of the object. This can be anything you like. 
+Objects that have different names can display their graphical user interfaces simultaneously. The
+object name appears on the title of the graphical user interface.
+<LI><B>Narrow</B> - Set this keyword to select the Narrow font style. 
+<LI><B>Oblique</B> - Set this keyword to select the Oblique font style. 
+<LI><B>PageType</B> - Set this keyword to the "type" of page. Possible values are:
+	<UL>
+	<LI><B>"Letter"</B> - 8.5 by 11 inches. (Default, unless the <B>European</B> keyword is set.)
+	<LI><B>"Legal"</B> - 8.5 by 14 inches.
+	<LI><B>"Ledger"</B> - 11 by 17 inches.
+	<LI><B>"A4"</B> - 21.0 by 29.7 centimeters. (Default, if the <B>European</B> keyword is set.)
+	</UL>
+<LI><B>Palatino</B> - Set this keyword to select the Palatino font.  
+<LI><B>Preview</B> - Set this keyword to select Preview mode: 0 is "none", 1 is "EPSI", or 2 is "EPSF".
+<LI><B>Schoolbook</B> - Set this keyword to select the Schoolbook font. 
+<LI><B>Set_Font</B> - Set this keyword to the name of a font passed to PostScript with Set_Plot keyword.
+<LI><B>Symbol</B> - Set this keyword to select the Symbol font. 
+<LI><B>Times</B> - Set this keyword to select the Times font. 
+<LI><B>TrueType</B> - Set this keyword to select True-Type fonts. 
+<LI><B>Update</B> - Set this keyword if you wish to immediately update the graphical user
+interface after setting a property. The default is to set the property without updating the
+display.
+<LI><B>XOffset</B> - Set this keyword to the X Offset. 
+<LI><B>XSize</B> - Set this keyword to the X size of the PostScript "window".
+<LI><B>YOffset</B> - Set this keyword to the Y Offset.  Uses "System (Portrait)" defaults. 
+<LI><B>YSize</B> - Set this keyword to the Y size of the PostScript "window". 
+<LI><B>ZapfChancery</B> - Set this keyword to select the ZapfChancery font. 
+<LI><B>ZapfDingbats</B> - Set this keyword to select the ZapfDingbats font.
+</UL>
+
+<p>For example, to create a 7 x 5 inch window on a PostScript 
+landscape page, with color output turned on, and immediately update the display, you can type this:
+
+<PRE>
+  psObject->SetProperty, /Landscape, /Color, /Update, XSize=7, YSize=5, /Inches, XOffset=1, YOffset=1
+</PRE>
+
+<P><CENTER>[<A HREF="#TOC">Return to Contents</A>]</CENTER>
+<!-- ************** HORIZONTAL RULE IMAGE ************-->
+<P ALIGN=CENTER><IMG SRC="http://www.dfanning.com/images/hruler.gif" WIDTH=782 HEIGHT=3
+   ALT="-------"></P>
+
+<H3><A NAME="KEYWORDS">Setting PostScript Configuration Keywords</A></H3>
+
+<P>The whole purpose of the <B>FSC_PSConfig</B> program is to configure the PostScript device
+by setting the appropriate <b>Device</B> command keywords. This is done by obtaining a structure in which
+the fields of the structure are the names of the appropriate keywords, and the values of the fields are
+appropriate for configuring the device the way you want it configured. You pass this structure to the 
+<b>Device</B> command  by means of <em>keyword inheritance</em>. In other words, you use the <b>_Extra</b>
+keyword to accept the structure. 
+
+<p>The keyword structure is obtained from the object by calling the <b>GetKeywords</b> method, like
+this:
+
+<PRE>
+   keywordStructure = psObject->GetKeywords()
+</PRE>
+
+<p>To verify what this structure looks like, type this:
+
+<PRE>
+   IDL> Help, keywordStructure, /Structure
+</PRE>
+
+<P>Depending upon how your object is configured, you should see something like this:
+
+<PRE>
+   ** Structure <15037f8>, 24 tags, length=68, refs=1:
+      BITS_PER_PIXEL  INT              8
+      COLOR           INT              0
+      ENCAPSULATED    INT              0
+      FILENAME        STRING    'D:\RSI\IDL53\DAVID\coyote.ps'
+      FONT_SIZE       INT             12
+      INCHES          INT              1
+      ISOLATIN1       INT              0
+      PREVIEW         INT              0
+      TT_FONT         INT              0
+      XOFFSET         FLOAT           1.75000
+      XSIZE           FLOAT           5.00000
+      YOFFSET         FLOAT           3.50000
+      YSIZE           FLOAT           4.00000
+      PORTRAIT        INT              1
+      LANDSCAPE       INT              0
+      HELVETICA       INT              1
+      BOLD            INT              1
+      BOOK            INT              0
+      DEMI            INT              0
+      ITALIC          INT              1
+      LIGHT           INT              0
+      MEDIUM          INT              0
+      NARROW          INT              0
+      OBLIQUE         INT              0
+</PRE>
+
+<p>Note that your structure may have other keywords defined, depending upon
+how your object is configured. This is typical.
+
+<p>These keywords are passed to the PostScript device via the <b>_Extra</b> keyword
+to the <b>Device</B> command. Be sure to select the PostScript device first. The code
+will typically look something like this:
+
+<PRE>
+   thisDevice = !D.Name
+   Set_Plot, "PS"
+   Device, _Extra=psObject->GetKeywords()
+</PRE>
+
+<P>Once the PostScript device is configured, you issue your graphics
+command or commands as normal. They will go into the PostScript "window" you
+have described on the PostScript page. Then, be sure to close the file. The code might look
+something like this:
+
+<PRE>
+   Plot, data, Title='Experiment 5A'
+   Device, /Close_File
+   Set_Plot, thisDevice
+</PRE>
+
+<H4>A Note About Fonts</H4> 
+
+<p>Although the PostScript device allows you to set information about PostScript fonts 
+(if you set the <b>FontInfo</B> keyword when you invoked the GUI),
+there is no guarantee that your graphics commands will be rendered in PostScript fonts.
+In fact, this is a function of the <b>!P.Font</b> system variable or the <b>Font</B> keyword
+on a graphics command, and has nothing to do with how the PostScript device
+is configured <em>per se</em>. This makes it a bit tricky to put font property widgets on a graphical
+user interface, since the unaware user may be surprised that the output doesn't look like
+the configuration he or she selected.
+
+<p>I've attempted to get around this problem by letting you know of the
+user's wishes for font type. But this information doesn't come back in the
+device keyword structure. Rather, it is returned in a <b>FontType</B> output keyword
+from the <b>GetKeywords</b> method. In fact, I recommend you always call the method
+like this when you have asked the user to specify font information in the GUI:
+
+<PRE>
+   thisDevice = !D.Name
+   Set_Plot, "PS"
+   Device, _Extra=psObject->GetKeywords(<B>FontType=fonttype</B>)
+</PRE>
+
+<p>This allows you to set the font type correctly on your graphics commands. For example,
+you could write code like this:
+
+<PRE>
+   currentFontType = !P.Font
+   <b>!P.Font = fonttype</b>
+   Plot, data, Title='Experiment 5A'
+   Device, /Close_File
+   Set_Plot, thisDevice
+   !P.Font = currentFontType
+</PRE>
+
+<p>Or, even more simply, you could write code like this:
+
+<PRE>
+   Plot, data, Title='Experiment 5A', <b>Font=fonttype</B>
+   Device, /Close_File
+   Set_Plot, thisDevice
+</PRE>
+
+<P><CENTER>[<A HREF="#TOC">Return to Contents</A>]</CENTER>
+<!-- ************** HORIZONTAL RULE IMAGE ************-->
+<P ALIGN=CENTER><IMG SRC="http://www.dfanning.com/images/hruler.gif" WIDTH=782 HEIGHT=3
+   ALT="-------"></P>
+
+<H3><A NAME="CLEANUP">Cleaning Up the Program</A></H3>
+
+<P>Since the <b>FSC_PSConfig</B> program is an object, it is persistent in
+the IDL session. This is one of the huge advantages of objects. For example,
+you can create an PostScript configuration object in a start-up file and
+always have it available in your IDL session. You will always have access
+to the current configuration of the PostScript device.
+
+<p>But as a persistent entity, you must destroy it when you are done with
+it or you will have heap memory leaking in your IDL session. This is especially
+true if you create these objects in other program modules. This is no different for
+other memory-leaking entities: pointers, pixmaps, etc. The way you clean up an object
+is to destroy it with the <b>Obj_Destroy</b> command, like this:
+
+<PRE>
+   Obj_Destroy, psObject
+</PRE>
+
+<P><CENTER>[<A HREF="#TOC">Return to Contents</A>]</CENTER>
+<!-- ************** HORIZONTAL RULE IMAGE ************-->
+<P ALIGN=CENTER><IMG SRC="http://www.dfanning.com/images/hruler.gif" WIDTH=782 HEIGHT=3
+   ALT="-------"></P>
+
+
+<H2><A NAME="EXAMPLE">Example Program using <b>FSC_PSConfig</B></A></H2>
+
+<P>Sometimes the best way to see how to use a new program is to see an example.
+Here is an example program, named <A HREF="http://www.dfanning.com/tip_examples/ps_plotter.pro">PS_Plotter</A>,
+that uses the <b>FSC_PSConfig</B> object to create a window on the PostScript page 
+for two plots: an image plot
+and a histogram plot of the image data. You will need another useful program from
+my library to run the program: <A HREF="http://www.dfanning.com/programs/tvimage.pro">TVImage</A>. 
+(<B>TVImage</b> is needed because the normal IDL <b>TV</B> command doesn't honor
+the <b>!P.Multi</b> system variable. Nor is the <b>TV</B> command written in the
+device-independent way required here.) Here is the compete code for the <b>PS_Plotter</b>
+program.
+
+<PRE>
+   PRO PS_Plotter, image, $
+      European=european, $   ; Set this keyword if you want European measurements.
+      Object=object          ; Output variable to return FSC_PSConfig object.
+
+      ; Get an image if one is not passed in.
+
+   IF N_Elements(image) EQ 0 THEN BEGIN
+      image = BytArr(360, 360)
+      file = Filepath(SubDirectory=['examples', 'data'], 'worldelv.dat')
+      OpenR, lun, file, /Get_Lun
+      ReadU, lun, image
+      Free_Lun, lun
+   ENDIF 
+
+      ; Create the PostScript configuration object.
+
+   object = Obj_New('FSC_PSConfig', European=Keyword_Set(european))
+
+      ; We want hardware fonts.
+
+   thisFontType = !P.Font
+   !P.Font = 1
+
+      ; Get user input to PostScript configuration.
+
+   object->GUI
+
+      ; Configure the PostScript Device.
+
+   thisDevice = !D.Name
+   Set_Plot, 'PS'
+   keywords = object->GetKeywords(FontType=fonttype)
+   Device, _Extra=keywords
+
+      ; Draw the example plots.
+
+   !P.Multi = [ 0, 1, 2]
+   TVImage, image
+   Plot, Histogram(image), Title='Example Histogram Plot', XTitle='Pixel Value', $
+      YTitle='Number of Pixels', XStyle=1, Max_Value=5000
+
+      ; Clean up.
+
+   !P.Multi = 0
+   Device, /Close_File
+   Set_Plot, thisDevice
+   !P.Font = thisfontType
+
+      ; Return the PS_Configuration object or destroy it.
+
+   IF Arg_Present(object) EQ 0 THEN Obj_Destroy, object
+   END
+</PRE>
+
+<p>If you will be printing on letter-size paper, you want to run the program
+like this. You will see the graphical user interface of the object in the
+middle of your display. Fill out the form the way you would like the output
+file to be configured and click the <em>Accept</em> button.
+
+<PRE>
+   IDL> PS_Plotter
+</PRE>
+
+<P>If you are in a country that uses A4 paper, you might want to
+call the program like this:
+
+<PRE>
+   IDL> PS_Plotter, /European
+</PRE>
+
+<p>A PostScript file will be created in the specified directory. You 
+can print it or use a PostScript file viewer (e.g., Ghostview) to view
+the file.
+
+<p>Called as above, the <b>FSC_PSConfig</b> object is created and destroyed
+when the program exits. However, you may wish to play around with some of the
+object's properties. You can return the object from the <b>PS_Plotter</b> program by
+using the optional <b>Object</b> keyword, like this:
+
+<PRE>
+   IDL> PS_Plotter, Object=psObject
+</PRE>
+
+<p>If you want to see how the PostScript file
+was just configured, you can examine the PostScript Device keywords
+that were used to create the file:
+
+<PRE>
+   IDL> Help, psObject->GetKeywords(), /Structure
+</PRE>
+
+<P>Be sure to destroy the object when you are finished with it.
+
+<PRE>
+   IDL> Obj_Destroy, psObject
+</PRE>
+
+<P><CENTER>[<A HREF="#TOC">Return to Contents</A>]</CENTER>
+<!-- ************** HORIZONTAL RULE IMAGE ************-->
+<P ALIGN=CENTER><IMG SRC="http://www.dfanning.com/images/hruler.gif" WIDTH=782 HEIGHT=3
+   ALT="-------"></P>
+
+
+<H2><A NAME="WRAPPER">A Wrapper Function for <b>FSC_PSConfig</b></A></H2>
+
+<P>A number of people are still uncomfortable using objects. So for those
+people, I have written a function named <A HREF="http://www.dfanning.com/programs/psconfig.pro">PSConfig</A>,
+which acts very much like (in fact, can probably be used as a replacement for)
+the old PostScript configuration program, <b>PS_Form</B>.
+
+<p>The <B>PSConfig</b> program creates the <b>FSC_PSConfig</b> object, calls
+the graphical user interface in blocking mode, and then returns the device
+keywords necessary to configure the PostScript device. The program can be used
+with commands similar to these:
+
+<PRE>
+   keywords = PSConfig(Cancel=cancelled)
+   IF NOT cancelled THEN BEGIN
+      thisDevice = !D.Name
+      Set_Plot, "PS"
+      Device, _Extra=keywords
+      Plot, Findgen(11)
+      Device, /Close_File
+      Set_Plot, thisDevice
+   ENDIF
+</PRE>
+
+<p> You can use the same keywords with <b>PSConfig</B> that 
+you use for the <b>FSC_PSConfig</B> object.
+<P><CENTER>[<A HREF="#TOC">Return to Contents</A>]</CENTER>
+<!-- ************** HORIZONTAL RULE IMAGE ************-->
+<P ALIGN=CENTER><IMG SRC="http://www.dfanning.com/images/hruler.gif" WIDTH=782 HEIGHT=3
+   ALT="-------"></P>
+
+<H2><A NAME="CUSTOMIZING">Customizing Your Source Code</A></H2>
+
+<P>I've tried to write the <B>FSC_PSConfig</B> program in such a way that it can be
+easily customized and extended by you at your site. In particular, it will be easy to
+add new default set-ups and other page types to the program. The
+code itself is extensively documented to indicate how this can
+be done. But, to give you an example, here is how you would add another
+default set-up, named <em>Company Viewgraph</em> to the code.
+
+<h3>Step 1: Add the Name to the Set-Up List</H3>
+
+<P>Open the <em>fsc_psconfig__define.pro</em> file and find the
+<em>DefaultList</em> method. (For example, search for "::DefaultList".)
+Add your new default name to the list shown there. For example, you would find this code:
+
+<PRE>
+defaultlist = [ 'System (Portrait)', $
+                'System (Landscape)', $
+                'Centered (Portrait)', $
+                'Centered (Landscape)', $
+                'Square (Portrait)', $
+                'Square (Landscape)', $
+                'Figure (Small)', $
+                'Figure (Large)', $
+                'Color (Portrait)', $
+                'Color (Landscape)' ]
+</PRE>
+
+<p>and change it to this:
+
+<PRE>
+defaultlist = [ 'System (Portrait)', $
+                'System (Landscape)', $
+                'Centered (Portrait)', $
+                'Centered (Landscape)', $
+                'Square (Portrait)', $
+                'Square (Landscape)', $
+                'Figure (Small)', $
+                'Figure (Large)', $
+                'Color (Portrait)', $
+                'Color (Landscape)' <b>, $
+                'Company Viewgraph'</b>]
+</PRE>
+
+<H3>Step 2: Create the New Set-Up</H3>
+
+<p>Next, find the <em>SetDefault</em> method (it will be just below the
+<em>DefaultList</em> method you just found) and copy one of the defualt
+setups you find in the CASE statement in that code. For example, here
+is the <em>System (Portrait)</em> method found there:
+
+<PRE>
+CASE thisDefault OF
+
+   'System (Portrait)': BEGIN
+         self.bitsSet = '8'
+         self.colorSet = 0
+         self.directorySet = directoryName
+         self.encapsulationSet = 0
+         self.filenameSet = defaultFilename + ".ps"
+         self.fonttypeSet = !P.Font
+         self.fontsizeSet = 12
+         self.fontStyleSet = Replicate(0, 8)
+         self.fontnameSet = "Helvetica"
+         self.inchesSet = units
+         self.landscapeSet = 0
+         self.isolatinSet = 0
+         self.pagetypeSet = pagetype
+         self.previewSet = 0
+         self.truetypeSet = 0
+         IF self.european THEN self.xoffsetSet = 1.61 ELSE self.xoffsetSet = 0.75
+         IF self.european THEN self.yoffsetSet = 14.65 ELSE self.yoffsetSet = 5.0
+         IF self.european THEN self.xsizeSet = 17.80 ELSE self.xsizeSet = 7.0
+         IF self.european THEN self.ysizeSet = 12.70 ELSE self.ysizeSet = 5.0
+         self.defaultsSet = 'System (Portrait)'
+      ENDCASE
+</PRE>
+
+<p>Modify each of the fields you want to change there, and add your changed
+values to the CASE statement. For example, your
+<em>Company Viewgraph</em> set-up might be defined like this. Note that you
+will have to provide both inches and centimeter units for the sizes and offsets.
+
+<PRE>
+   'Company Viewgraph': BEGIN
+         self.bitsSet = '8'
+         self.colorSet = 1
+         self.directorySet = "C:\Company\Viewgraphs"
+         self.encapsulationSet = 0
+         self.filenameSet = "viewgraph_1.view"
+         self.fonttypeSet = 1
+         self.fontsizeSet = 18
+         self.fontStyleSet = Replicate(0, 8)
+         self.fontnameSet = "Helvetica"
+         self.inchesSet = units
+         self.landscapeSet = 0
+         self.isolatinSet = 0
+         self.pagetypeSet = pagetype
+         self.previewSet = 0
+         self.truetypeSet = 0
+         IF self.european THEN self.xoffsetSet = 0.75 * 2.54 ELSE self.xoffsetSet = 0.75
+         IF self.european THEN self.yoffsetSet = 0.75 * 2.54ELSE self.yoffsetSet = 0.75
+         IF self.european THEN self.xsizeSet = 7.0 * 2.54 ELSE self.xsizeSet = 7.0
+         IF self.european THEN self.ysizeSet = 9.5 *2.54 ELSE self.ysizeSet = 9.5
+         self.defaultsSet = 'Company Viewgraph'
+      ENDCASE
+</PRE>
+
+<P><CENTER>[<A HREF="#TOC">Return to Contents</A>]</CENTER>
+<!-- ************** HORIZONTAL RULE IMAGE ************-->
+<P ALIGN=CENTER><IMG SRC="http://www.dfanning.com/images/hruler.gif" WIDTH=782 HEIGHT=3
+   ALT="-------"></P>
+
+<H2><A NAME="OTHERCODE">Other FSC Programs Needed to Run this Program</A></H2>
+
+<P>This <B>FSC_PSConfig</B> program uses a number of other programs from the Coyote library. 
+Here are the programs you will need.
+
+<UL>
+<LI><A HREF="http://www.dfanning.com/programs/fsc_psconfig__define.pro">fsc_psconfig__define.pro</A> - The 
+main PostScript configuration object program. (What I call <b>FSC_PSConfig</B>.)
+<LI><A HREF="http://www.dfanning.com/programs/fsc_field.pro">fsc_field.pro</A> - A CW_Field replacement compound widget, written as an object.
+<LI><A HREF="http://www.dfanning.com/programs/fsc_fileselect.pro">fsc_fileselect.pro</A> - A file selection compound widget, written as an object.
+<LI><A HREF="http://www.dfanning.com/programs/fsc_droplist.pro">fsc_droplist.pro</A> - A droplist compound widget, written as an object.
+<LI><A HREF="http://www.dfanning.com/programs/fsc_plotwindow.pro">fsc_plotwindw.pro</A> - A 
+utility object program required by <b>FSC_PSConfig</B>.
+</UL>
+
+<p>In addition, you may want the following wrapper and example programs, respectively:
+
+<UL>
+<LI><A HREF="http://www.dfanning.com/programs/psconfig.pro">psconfig.pro</A> - A wrapper function for the
+<B>FSC_PSConfig</B> object.
+<LI><A HREF="http://www.dfanning.com/tip_examples/ps_plotter.pro">ps_plotter.pro</A> - An example
+program that uses the <B>FSC_PSConfig</B> object.
+<LI><A HREF="http://www.dfanning.com/programs/tvimage.pro">tvimage.pro</A> - A device-independent image display program, which
+honors the !P.Multi system variable.</UL>
+
+<p>If you would like to download all these programs at once,
+you can download this <A HREF="../fsc_psconfig.zip">zip file</A> (56KB).
+
+<P><CENTER>[<A HREF="#TOC">Return to Contents</A>]</CENTER>
+<!-- ************** HORIZONTAL RULE IMAGE ************-->
+<P ALIGN=CENTER><IMG SRC="http://www.dfanning.com/images/hruler.gif" WIDTH=782 HEIGHT=3
+   ALT="-------"></P>
+
+<H2><A NAME="ORDERING">Disclaimer and Licensing Information</A></H2>
+
+<H3>Warranties</H3>
+
+<P>Fanning Software Consulting makes no warranties, either express or implied, as
+to the condition of the software described here or its fitness for any particular purpose. All software
+code is provided as is. IDL is a registered trademark of <A HREF="http://www.rsinc.com/">Research Systems, Inc.</A>
+for the computer software used to created these programs. A licensed version of IDL is required to 
+run these programs.
+
+<H3>Licensing the Software</H3>
+
+<p>All programs written by Fanning Software Consulting and described
+in this article are issued under a license certified and approved by the 
+Open Source Initiative. The following license is attached to the header of
+each program. Please do not removed the license information if you distribute
+this source code in any form.
+
+<PRE>
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright © 2000 Fanning Software Consulting
+;
+; This software is provided "as-is", without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose, including commercial applications, and to alter it and
+; redistribute it freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product, an acknowledgment in the product documentation
+;    would be appreciated, but is not required.
+;
+; 2. Altered source versions must be plainly marked as such, and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software, visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+</PRE>
+
+<H3>Reporting Program Bugs</H3>
+
+<P>Every attempt is made to keep these programs accurate and bug
+free. If you find a bug, I will be happy to attempt to fix it. Please
+report any bugs or feature requests to:
+
+<P>David Fanning<br>
+Fanning Software Consulting <br>
+1645 Sheely Drive <br>
+Fort Collins, CO 80526 USA <br>
+Phone: 970-221-0438<br>
+Fax: 970-221-4762<br>
+E-Mail: david@dfanning.com
+
+<P><CENTER>[<A HREF="http://www.dfanning.com/documents/programs.html">Return to Programs Page</A>]</CENTER>
+<!-- ************** HORIZONTAL RULE IMAGE ************-->
+<P ALIGN=CENTER><IMG SRC="http://www.dfanning.com/images/hruler.gif" WIDTH=782 HEIGHT=3
+   ALT="-------"></P>
+
+
+<!-- ************** UPDATE NOTICE ************-->
+
+<P><CENTER>
+Copyright &copy; 1997-2002 David W. Fanning<BR>
+Last Updated 30 October 2002</CENTER>
+
+</body>
+</html>
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_psconfig__define.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_psconfig__define.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/fsc_psconfig__define.pro	(revision 207)
@@ -0,0 +1,2724 @@
+;+
+; NAME:
+;   FSC_PSCONFIG__DEFINE
+;
+; PURPOSE:
+;
+;   The purpose of this program is to implement an object that
+;   can keep track of--and allow the user to change--the current
+;   configuration of the PostScript device.
+;
+; AUTHOR:
+;
+;   FANNING SOFTWARE CONSULTING
+;   David Fanning, Ph.D.
+;   1645 Sheely Drive
+;   Fort Collins, CO 80526 USA
+;   Phone: 970-221-0438
+;   E-mail: davidf@dfanning.com
+;   Coyote's Guide to IDL Programming: http://www.dfanning.com/
+;
+; CATEGORY:
+;
+;   General programming.
+;
+; DOCUMENTATION:
+;
+;   Complete documentation for the FSC_PSCONFIG object, including
+;   keyword and method descriptions, and example programs using the object
+;   can be found on the Coyote's Guide to IDL Programming web page:
+;
+;     http://www.dfanning.com/programs/docs/fsc_psconfig.html
+;
+;   Or, if you would prefer, you can download a self-contained PDF file:
+;
+;     http://www.dfanning.com/programs/docs/fsc_psconfig.pdf
+;
+; KEYWORDS:
+;
+;   Any keyword accepted by the FSC_PSCONFIG object can be used with
+;   this program. Here are a few of the most popular keywords.
+;
+;   Bits_per_Pixel - The number of image bits saved for each image pixel: 2, 4, or 8. The default is 8.
+;   Color - Set this keyword to select Color PostScript output. Turned on by default.
+;   DefaultSetup - Set this keyword to the "name" of a default style. Current styles (you can easily
+;     create and add your own to the source code) are the following:
+;
+;       "System (Portrait)" - The normal "default" system set-up. Also, "System".
+;       "System (Landscape)" - The normal "default" landscape system set-up.
+;       "Centered (Portrait)" - The window centered on the page. Also, "Center" or "Centered".
+;       "Centered (Landscape)" - The window centered on the landscape page. Also, "Landscape".
+;       "Square (Portrait)" - A square plot, centered on the page.
+;       "Square (Landscape)" - A square plot, centered on the landscape page.
+;       "Figure (Small)" - A small encapsulated figure size, centered on page. Also, "Encapsulated" or "Encapsulate".
+;       "Figure (Large)" - A larger encapsulated figure size, centered on page. Also, "Figure".
+;       "Color (Portrait)" - A "centered" plot, with color turned on. Also, "Color".
+;       "Color (Landscape)" - A "centered" landscape plot, with color turned on.
+;
+;   Directory - Set this keyword to the name of the starting directory. The current directory is used by default.
+;   Encapsulate - Set this keyword to select Encapsulated PostScript output. Turned off by default.
+;   European - Set this keyword to indicate "european" mode (i.e., A4 page and centimeter units). Turned off by default.
+;   Filename - Set thie keyword to the name of the PostScript file. The default is "idl.ps".
+;   Inches - Set this keyword to indicate sizes and offsets are in inches as opposed to centimeters. Set by European keyword by default.
+;   Landscape - Set this keyword to select Landscape page output. Portrait page output is the default.
+;   PageType - Set this keyword to the "type" of page. Possible values are:
+;       "Letter" - 8.5 by 11 inches. (Default, unless the European keyword is set.)
+;       "Legal" - 8.5 by 14 inches.
+;       "Ledger" - 11 by 17 inches.
+;       "A4" - 21.0 by 29.7 centimeters. (Default, if the European keyword is set.)
+;   XOffset - Set this keyword to the X Offset. Uses "System (Portrait)" defaults. (Note: offset calculated from lower-left corner of page.)
+;   XSize - Set this keyword to the X size of the PostScript "window". Uses "System (Portrait)" defaults.
+;   YOffset - Set this keyword to the Y Offset. Uses "System (Portrait)" defaults. (Note: offset calculated from lower-left corner of page.)
+;   YSize - Set this keyword to the Y size of the PostScript "window". Uses "System (Portrait)" defaults.
+;
+;   In addition, the following keywords can be used:
+;
+;   CANCEL -- An output keyword that will be set to 1 if the user
+;   chooses the Cancel button on the form. It will be 0 otherwise.
+;
+;   FONTINFO -- Set this keyword is you wish to have font information
+;   appear on the form. The default is to not include font information.
+;
+;   FONTTYPE -- Set this keyword to a named variable that will indicate
+;   the user's preference for font type. Values will be -1 (Hershey fonts),
+;   0 (hardware fonts), and 1 (true-type fonts). This keyword will always
+;   return -1 unless the FONTINFO keyword has also been set.
+;
+;   GROUP_LEADER -- Set this keyword to a widget identifier of the widget
+;   you wish to be a group leader for this program.
+;
+; EXAMPLE:
+;
+;   A simple sequence of using the object would look something like this:
+;
+;     psObject = Obj_New("FSC_PSCONFIG")
+;     psObject->GUI
+;     psKeywords = psObject->GetKeywords()
+;     thisDevice = !D.Name
+;     Set_Plot, 'PS'
+;     Device, _Extra=psKeywords
+;     TVImage, image
+;     Device, /Close_File
+;     Set_Plot, thisDevice
+;     Obj_Destroy, psObject
+;
+;  Note that the object can also be called from the PS_CONFIG interface:
+;
+;     psKeywords = PSConfig()
+;
+; OTHER PROGRAMS NEEDED:
+;
+;   The following programs are required to run this one:
+;
+;     fsc_droplist.pro
+;     fsc_fileselect.pro
+;     fsc_field.pro
+;     fsc_plotwindow
+;
+; MODIFICATIONS:
+;
+;   Written by David W. Fanning, 31 January 2000.
+;   Added capability to call GUI methods when the current graphics device
+;      doesn't support windows. Device is restored when the GUI exits. 11 May 2000. DWF.
+;   Changed the default value for the Color keyword to 1. 16 May 2000. DWF.
+;   Fixed a bug where filename changed when switching Setups. 8 AUG 2000. DWF.
+;   Fixed a bug when saving setup in Landscape mode. 8 AUG 2000. DWF.
+;   Added the ability to Get and Set the object's name via the SetProperty
+;      and a very abbreviated GetProperty method. Also added a GetName method. 26 SEP 2000. DWF.
+;   Fixed a problem in which the proper configuration was not restored if in Landscape mode. 20 Nov 2000. DWF.
+;   Made a number of modifications at the request of Martin Schultz. 4 Dec 2000. DWF.
+;   Fixed a bug when setting file  and directory names with the SetProperty method. 18 Dec 2000. DWF.
+;   Fixed a small problem in initializing the page size properly. 3 Jan 2001. DWF.
+;   Corrected a problem that resulted from a change to FSC_DROPLIST. 6 Jan 2001. DWF.
+;   Added the ability to restore the font type instead of always reverting to !P.Font. 7 Jan 2001. DWF.
+;   Increased the length of the file/directory name fields. 7 Jan 2001. DWF.
+;   Fixed another problem with Landscape mode interacting with A4 paper size. 7 Jan 2001. DWF.
+;   Seems I only half fixed the previous problem. :-( 26 April 2001. DWF.
+;   Forgot to update program to reflect change in FSC_FIELD. Fixed 26 April 2001. DWF.
+;   Changed BOOKMAN keyword to BKMAN to avoid conflict with BOOKSTYLE keyword. 26 April 2001. DWF.
+;   Modified the System Defaults to say "None" if none is used. Improved documentation. 10 September 2001. DWF.
+;   Added the ability to specify a filename at the same time as a Default Setup. 10 September 2001. DWF.
+;   Fixed a small problem in not setting new page sizes appropriately. 22 May 2002. DWF.
+;   Fixed a problem that occurred when the Accept button was not named "Accept". 6 May 2003.DWF.
+;   Whoops! I was a bit overly agressive on that last fix. :-( 17 July 2003. DWF.
+;   Fixed a problem with setting page types when using the DEFAULTSETUP keyword. 31 July 2003. DWF.
+;   Fixed a problem with turning encapsulation on in the GUI. Renamed ENCAPSULATE keyword ENCAPSULATED
+;      to avoid obvious errors. 31 July 2003. DWF.
+;   Removed obsolete STR_SEP and replaced with STRSPLIT. 27 Oct 2004. DWF.
+;   Now honoring EUROPEAN keyword when setting system default setups in the INIT method. 12 Nov 2004. DWF.
+;   Added CMYK output option 24 August 2007. Assumes LANGUAGE_LEVEL=2 printer. L. Anderson.
+;   Fixed a problem with the filename on WINDOWS computers coming back with forward slashes instead of
+;       backward slashes. 20 May 2008. DWF.
+;-
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright (c) 2000-2008 Fanning Software Consulting
+;
+; This software is provided "as-is", without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose, including commercial applications, and to alter it and
+; redistribute it freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product, an acknowledgment in the product documentation
+;    would be appreciated, but is not required.
+;
+; 2. Altered source versions must be plainly marked as such, and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software, visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+;
+
+
+FUNCTION FSC_PSCONFIG_RStrPos, Expr, SubStr, Pos
+
+; This function finds the last occurance of a substring
+; in a string. It was made obsolete in IDL 5.3. It is
+; provided here for backwards compatibility. It normally
+; resides in the IDL obsolete directory.
+
+; PURPOSE:
+;  This function finds the last occurrence of a substring within
+;  an object string. If the substring is found in the expression,
+;  RSTRPOS returns the character position of the match, otherwise
+;  it returns -1.
+;
+; CATEGORY:
+;  String processing.
+;
+; CALLING SEQUENCE:
+;        Result = RSTRPOS(Expr, SubStr [, Pos])
+;
+; INPUTS:
+;       Expr:  The expression string in which to search for the substring.
+;  SubStr: The substring to search for.
+;
+; OPTIONAL INPUTS:
+;  Pos:  The character position before which the search is begun.
+;           If Pos is omitted, the search begins at the last character
+;           of Expr.
+;
+; OUTPUTS:
+;        Returns the position of the substring, or -1 if the
+;   substring was not found within Expr.
+;
+
+  ON_ERROR, 2
+  N = N_PARAMS()
+  if (n lt 2) then message, 'Incorrect number of arguments.'
+
+  ; Is expr an array or a scalar? In either case, make a result
+  ; that matches.
+  if (size(expr, /n_dimensions) eq 0) then result = 0 $
+  else result = make_array(dimension=size(expr,/dimensions), /INT)
+
+  RSubStr = STRING(REVERSE(BYTE(SubStr))) ; Reverse the substring
+
+  for i = 0, n_elements(expr) - 1 do begin
+    Len = STRLEN(Expr[i])
+    IF (N_ELEMENTS(Pos) EQ 0) THEN Start=0 ELSE Start = Len - Pos
+
+    RString = STRING(REVERSE(BYTE(Expr[i]))) ; Reverse the string
+
+    SubPos = STRPOS(RString, RSubStr, Start)
+    IF SubPos NE -1 THEN SubPos = Len - SubPos - STRLEN(SubStr)
+    result[i] = SubPos
+  endfor
+
+  RETURN, result
+END ;-------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG_CenterTLB, tlb
+
+; This procedure centers the given top-level base on the display.
+
+   ; Get the screen size and find its center.
+
+screenSize = Get_Screen_Size()
+IF screenSize[0] GT 2000 THEN screenSize[0] = screenSize[0]/2 ; Dual monitors.
+xCenter = screenSize(0) / 2
+yCenter = screenSize(1) / 2
+
+   ; Get the size of the widget program and calculate a half-size.
+
+geom = Widget_Info(tlb, /Geometry)
+xHalfSize = geom.Scr_XSize / 2
+yHalfSize = geom.Scr_YSize / 2
+
+   ; Position the widget program on the display.
+
+Widget_Control, tlb, XOffset = xCenter-xHalfSize, $
+   YOffset = yCenter-yHalfSize
+
+END ;-------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PSCONFIG_Error_Message, theMessage, Traceback=traceback, $
+   NoName=noName
+
+; Handles program errors.
+
+On_Error, 2
+
+   ; Check for presence and type of message.
+
+IF N_Elements(theMessage) EQ 0 THEN theMessage = !Error_State.Msg
+s = Size(theMessage)
+messageType = s[s[0]+1]
+IF messageType NE 7 THEN BEGIN
+   Message, "The message parameter must be a string."
+ENDIF
+
+   ; Get the call stack and the calling routine's name.
+
+Help, Calls=callStack
+callingRoutine = (StrSplit(StrCompress(callStack[1])," ", /Extract))[0]
+
+   ; Are widgets supported? Doesn't matter in IDL 5.3 and higher.
+
+widgetsSupported = ((!D.Flags AND 65536L) NE 0) OR Float(!Version.Release) GE 5.3
+IF widgetsSupported THEN BEGIN
+   IF Keyword_Set(noName) THEN answer = Dialog_Message(theMessage) ELSE BEGIN
+      IF StrUpCase(callingRoutine) EQ "$MAIN$" THEN answer = Dialog_Message(theMessage) ELSE $
+         answer = Dialog_Message(StrUpCase(callingRoutine) + ": " + theMessage)
+   ENDELSE
+ENDIF ELSE BEGIN
+      Message, theMessage, /Continue, /NoPrint, /NoName, /NoPrefix
+      Print, '%' + callingRoutine + ': ' + theMessage
+      answer = 'OK'
+ENDELSE
+
+   ; Provide traceback information if requested.
+
+IF Keyword_Set(traceback) THEN BEGIN
+   Help, /Last_Message, Output=traceback
+   FOR j=0,N_Elements(traceback)-1 DO Print, traceback[j]
+ENDIF
+
+RETURN, answer
+END ;---------------------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG_Events, event
+
+; This is the main event hander for the program. Its purpose
+; is to dispatch events to the appropriate event handler
+; methods by parsing the user value of the widget causing
+; the event.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+   ; Get the instructions from the widget causing the event and
+   ; act on them.
+
+thisEvent = Tag_Names(event, /Structure_Name)
+CASE thisEvent OF
+
+   'FSC_DROPLIST_EVENT' : BEGIN
+         Widget_Control, event.id, Get_UValue=instructions
+      ENDCASE
+
+   'FSC_FIELD_EVENT': BEGIN
+         Widget_Control, event.id, Get_UValue=instructions
+      ENDCASE
+
+   'WIDGET_BUTTON': BEGIN
+         Widget_Control, event.id, Get_UValue=instructions
+      ENDCASE
+
+   'WIDGET_DRAW': BEGIN
+         Widget_Control, event.id, Get_UValue=instructions
+      ENDCASE
+
+   ELSE: BEGIN ; FSC_PLOTWINDOW events.
+         Widget_Control, event.id, Get_UValue=object
+         instructions = object->GetUValue()
+      ENDCASE
+
+ENDCASE
+
+   ; Turn the status light to OFF, if necessary.
+
+IF instructions.method NE 'HELP' AND instructions.method NE 'REVERT' $
+   AND instructions.method NE 'ACCEPT' THEN instructions.object->StatusLight, 0
+IF instructions.method NE 'NULL' THEN $
+   Call_Method, instructions.method, instructions.object, event
+
+END ;--------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PSCONFIG_Normalize, range, Position=position
+
+; The program creates a scaling and translating factor for
+; positioning objects in the view coordinate system.
+
+On_Error, 1
+IF N_Params() EQ 0 THEN Message, 'Please pass range vector as argument.'
+
+IF (N_Elements(position) EQ 0) THEN position = [0.0, 1.0] ELSE $
+    position=Float(position)
+range = Float(range)
+
+scale = [((position[0]*range[1])-(position[1]*range[0])) / $
+    (range[1]-range[0]), (position[1]-position[0])/(range[1]-range[0])]
+
+RETURN, scale
+END ;-------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG_Help_Event, event
+
+; Destroy the HELP widget window.
+
+Widget_Control, event.top, /Destroy
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG_Restore_Device, id
+Widget_Control, id, Get_UValue=thisDevice
+Set_Plot, thisDevice
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::Accept, event
+
+; This method handles the event from the ACCEPT or APPLY buttons.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+   ; Get all the values from the form and load the appropriate
+   ; self fields.
+
+self.cancel = 0
+self.pageTypeSet = self.pageTypeID->GetSelection()
+self.landscapeSet = self.orientationID->GetIndex()
+self.inchesSet = self.unitsID->GetIndex()
+self.cmykSet = self.cmykID->GetIndex()
+self.colorSet = self.colorID->GetIndex()
+self.encapsulationSet = self.encapsulationID->GetIndex()
+self.previewSet = self.previewID->GetIndex()
+IF self.encapsulationSet EQ 0 THEN self.previewSet = 0
+self.bitsSet = self.bitsID->GetSelection()
+
+IF N_Elements(self.xsizeID->Get_Value()) EQ 0 THEN BEGIN
+   IF self.inchesSet THEN xsize = 1.0 ELSE xsize = 2.54
+   self.xsizeID->Set_Value, xsize
+ENDIF ELSE xsize = self.xsizeID->Get_Value()
+self.xsizeSet = xsize
+
+IF N_Elements(self.ysizeID->Get_Value()) EQ 0 THEN BEGIN
+   IF self.inchesSet THEN ysize = 1.0 ELSE ysize = 2.54
+   self.ysizeID->Set_Value, ysize
+ENDIF ELSE ysize = self.ysizeID->Get_Value()
+self.ysizeSet = ysize
+
+IF N_Elements(self.xoffsetID->Get_Value()) EQ 0 THEN BEGIN
+   xoffset = 0.0
+   self.xoffsetID->Set_Value, xoffset
+ENDIF ELSE xoffset = self.xoffsetID->Get_Value()
+self.xoffsetSet = xoffset
+
+IF N_Elements(self.yoffsetID->Get_Value()) EQ 0 THEN BEGIN
+   yoffset = 0.0
+   self.yoffsetID->Set_Value, yoffset
+ENDIF ELSE yoffset = self.yoffsetID->Get_Value()
+self.yoffsetSet = yoffset
+
+self.plotID->SetWindowLocation, xsize, ysize, xoffset, yoffset
+
+   ; Get the font information if it is on the form.
+
+IF self.fontInfo THEN BEGIN
+   ;fonttype = self.fontTypeID->GetIndex()
+   ;self.fonttypeSet = fonttype - 1
+   self.fontsizeSet = self.fontsizeID->GetSelection()
+
+   values = self.fontnameID->GetValues()
+   selection = self.fontnameID->GetSelection()
+   index = Where(StrUpCase(values) EQ StrUpCase(selection))
+   FOR j=1,7 DO BEGIN
+      cmd = "self." + values[j] + " = 0"
+      ok = Execute(cmd)
+      IF NOT ok THEN ok = Dialog_Message("Problem executing statment: " + cmd)
+   ENDFOR
+   IF index[0] NE 0 THEN ok = Execute("self." + values[index[0]] + " = 1")
+   self.fontnameSet = values[index[0]]
+
+   self.isolatinSet = self.isolatinID->GetIndex()
+   IF Obj_Valid(self.set_fontID) THEN self.set_fontSet = self.Set_FontID->Get_Value()
+   self.truetypeSet = self.truetypeID->GetIndex()
+   self.fontTypeSet = self.fontTypeID->GetIndex() - 1
+ENDIF
+
+   ; Get the filename information.
+
+self.filenameID->GetProperty, File=filename, Directory=directory
+self.filenameSet = filename
+self.directorySet = directory
+self.fullFilenameSet=self.filenameID->GetFileName()
+
+   ; If this is WINDOWS, then forward slashes need to be converted to backward slashes.
+   
+IF StrUpCase(!Version.OS_FAMILY) EQ 'WINDOWS' THEN BEGIN
+   self.directorySet = StrJoin( StrSplit(self.directorySet, '/', /Regex, /Extract, /Preserve_Null), '\')
+   self.fullFilenameSet = StrJoin( StrSplit(self.fullFilenameSet, '/', /Regex, /Extract, /Preserve_Null), '\')
+ENDIF
+
+   ; Set the status light if this is the APPLY button
+
+Widget_Control, event.id, Get_UValue=buttonInfo
+IF N_Elements(buttonInfo) NE 0 THEN $
+   IF buttonInfo.method EQ 'APPLY' THEN self->StatusLight, 1
+
+   ; Save this configuration.
+
+self->SaveConfiguration
+
+   ; Destroy the widget if this is a modal widget.
+
+IF N_Elements(buttonInfo) NE 0 THEN $
+   IF buttonInfo.method EQ 'ACCEPT' AND Widget_Info(self.tlb, /Valid_ID) THEN BEGIN
+   Widget_Control, self.tlb, /Destroy
+   self.noblock = 0
+ENDIF
+
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::Cancel, event
+
+; If the cancel button was clicked, set the cancel flag to 1 and
+; destroy the widget.
+
+self.cancel = 1
+self.noblock = 0
+Widget_Control, event.top, /Destroy
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::ClearStyles, event
+
+; This event handler method responds to the Clear button by setting
+; turning all the font style buttons off..
+
+self->UpDateFontStyle, /Clear
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::Color, event
+
+; This event handler method responds to changes in the Color droplist.
+
+
+self.plotID->SetColor, event.index
+
+; Set sensitivity of cmyk button
+
+self.cmykID->Sensitive, event.index
+END ;--------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PSCONFIG::Construct_Full_Filename
+
+; This method returns the fully-qualified filename. Checks to be
+; sure the last character in the directory name is not a directory
+; specifier.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN, ""
+ENDIF
+
+   ; Get the correct directory separator.
+
+CASE StrUpCase(!Version.OS_Family) OF
+   'WINDOWS' : sep = '\'    ; PCs
+   'MACOS'   : sep = ':'    ; Macintoshes
+   'VMS'     : sep = ']'    ; VMS machines
+   ELSE      : sep = '/'    ; Unix machines
+ENDCASE
+
+IF StrUpCase(!Version.OS_Family) NE "VMS" THEN BEGIN
+   length = StrLen(self.directorySet)
+   WHILE StrMid(self.directorySet, length-1, 1) EQ sep DO BEGIN
+      self.directorySet = StrMid(self.directorySet, 0, length-1)
+      length = StrLen(self.directorySet)
+   ENDWHILE
+ENDIF
+
+RETURN, Filepath(Root_Dir=self.directorySet, self.filenameSet)
+END ;-------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PSCONFIG::DefaultList
+
+; This method defines the default settings values in the Defaults droplist.
+; To add your own defaults, start by adding the new default name here. Then
+; add your default setup to the SetDefault method below.
+
+defaultlist = [ 'None', $
+                'System (Portrait)', $
+                'System (Landscape)', $
+                'Centered (Portrait)', $
+                'Centered (Landscape)', $
+                'Square (Portrait)', $
+                'Square (Landscape)', $
+                'Figure (Small)', $
+                'Figure (Large)', $
+                'Color (Portrait)', $
+                'Color (Landscape)' ]
+
+RETURN, defaultList
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::Defaults, event
+
+; This event handler method responds to changes in the Defaults droplist.
+
+self->SetDefault, *event.selection
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::Encapsulate, event
+
+; This method responds to a change in the Encapsulation droplist widget.
+
+IF event.index THEN self.previewID->Sensitive, 1 ELSE self.previewID->Sensitive, 0
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::FontType, event
+
+; This event handler method responds to changes in the Font Type droplist.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+   ; Font styles, etc. can only be on if hardware or
+   ; true-type fonts are selected.
+
+CASE event.index OF
+
+   0: BEGIN
+   Widget_Control, self.fontnameID->GetID(), Sensitive=0
+   Widget_Control, self.stylebaseID, Sensitive=0
+   Widget_Control, self.clearbuttonID, Sensitive=0
+   Widget_Control, self.fontSizeID->GetID(), Sensitive=0
+   Widget_Control, self.truetypeID->GetID(), Sensitive=0
+   Widget_Control, self.isolatinID->GetID(), Sensitive=0
+   IF Obj_Valid(self.set_fontID) THEN Widget_Control, self.set_fontID->GetID(), Sensitive=0
+   ENDCASE
+
+   ELSE: BEGIN
+   Widget_Control, self.fontnameID->GetID(), Sensitive=1
+   Widget_Control, self.stylebaseID, Sensitive=1
+   Widget_Control, self.clearbuttonID, Sensitive=1
+   Widget_Control, self.fontSizeID->GetID(), Sensitive=1
+   Widget_Control, self.truetypeID->GetID(), Sensitive=1
+   Widget_Control, self.isolatinID->GetID(), Sensitive=1
+   IF Obj_Valid(self.set_fontID) THEN Widget_Control, self.set_fontID->GetID(), Sensitive=1
+   ENDCASE
+
+ENDCASE
+
+fontname = *event.selection
+CASE StrUpCase(fontname) OF
+   "TRUE-TYPE": BEGIN
+      self.truetypeID->SetIndex, 1
+      self.trueTypeSet = 1
+      self.fontTypeSet = 1
+   ENDCASE
+   "HARDWARE" : BEGIN
+      self.trueTypeSet = 0
+      self.fontTypeSet = 0
+      ENDCASE
+   ELSE: BEGIN
+      self.trueTypeSet = 0
+      self.fontTypeSet = -1
+      self.truetypeID->SetIndex, 0
+   ENDCASE
+ENDCASE
+
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::EuroStyle, event
+
+; This event handler sets and unset the "European Style" button.
+
+IF event.select EQ 1 THEN BEGIN
+
+   Widget_Control, event.top, Update=0
+   self.european = 1
+   IF self.inchesSet EQ 1 THEN BEGIN
+      sizes = self->GetSizes()
+      self.xsizeSet = sizes[0] * 2.54
+      self.ysizeSet = sizes[1] * 2.54
+      self.xoffsetSet = sizes[2] * 2.54
+      self.yoffsetSet = sizes[3] * 2.54
+   ENDIF
+   self.inchesSet = 0
+   self.pageTypeSet = 'A4'
+   self.plotID->SetUnits, 'Centimeters'
+   Widget_Control, event.top, Update=1
+
+ENDIF ELSE BEGIN
+
+   Widget_Control, event.top, Update=0
+   self.european = 0
+   IF self.inchesSet EQ 0 THEN BEGIN
+      sizes = self->GetSizes()
+      self.xsizeSet = sizes[0] / 2.54
+      self.ysizeSet = sizes[1] / 2.54
+      self.xoffsetSet = sizes[2] / 2.54
+      self.yoffsetSet = sizes[3] / 2.54
+   self.inchesSet = 1
+   self.pageTypeSet = 'LETTER'
+   self.plotID->SetUnits, 'Inches'
+   Widget_Control, event.top, Update=1
+
+   ENDIF
+
+ENDELSE
+self->UpdateDisplay
+self.plotID->CenterPlot
+END ;--------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PSCONFIG::GetKeywords, FontType=fonttype
+
+; This method creates and returns a structure with the PostScript Device
+; keywords as fields in the structure.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN, {Cancel:1}
+ENDIF
+
+  ; I am shielding the user from the strangeness of PostScript
+  ; Landscape mode, in which the X and Y offsets are rotated
+  ; 180 degrees. Thus, in the form, the offsets are calculated from
+  ; the lower-left corner in both Landscape and Portrait mode.
+  ; This means I have to monkey around to get the proper offsets
+  ; if the form is in Landscape mode.
+
+IF self.landscapeSet EQ 1 THEN BEGIN
+    pageDims = self->PageDimensions()
+       ; Switch x and y offsets
+    yoffset = pageDims[1] - self.xoffsetSet
+    xoffset = self.yoffsetSet
+ENDIF ELSE BEGIN
+    xoffset = self.xoffsetSet
+    yoffset = self.yoffsetSet
+ENDELSE
+
+   ; Create the basic structure.
+
+struct = { $
+   bits_per_pixel: Fix(self.bitsSet), $
+   cmyk: self.cmykSet, $
+   color: self.colorSet, $
+   encapsulated: self.encapsulationSet, $
+   filename: self.fullfilenameSet, $
+   font_size: Fix(self.fontSizeSet), $
+   inches: self.inchesSet, $
+   isolatin1: self.isolatinSet, $
+   preview: self.previewSet, $
+   tt_font: self.truetypeSet, $
+   xoffset: xoffset, $
+   xsize: self.xsizeSet, $
+   yoffset: yoffset, $
+   ysize: self.ysizeSet }
+
+   ; Addition of CMYK keyword implies LANGUAGE_LEVEL keyword set to 2.
+
+IF self.cmykSet THEN struct = Create_Struct(struct, 'language_level', 2) $
+   ELSE struct = Create_Struct(struct, 'language_level', 1)
+
+   ; Return the font type information to the user.
+
+fonttype = self.fonttypeSet
+
+   ; Depending upon which widgets are set, we have to add
+   ; additional fields to the structure.
+
+IF self.landscapeSet THEN BEGIN
+   struct = Create_Struct(struct, 'landscape', 1)
+   struct = Create_Struct(struct, 'portrait', 0)
+ENDIF ELSE BEGIN
+   struct = Create_Struct(struct, 'portrait', 1)
+   struct = Create_Struct(struct, 'landscape', 0)
+ENDELSE
+IF self.set_fontSet NE "" THEN struct = Create_Struct(struct, 'set_font', self.set_font)
+
+   ; What about font keywords?
+
+IF self.avantgarde THEN struct = Create_Struct(struct, 'avantgarde', 1)
+IF self.bookman THEN struct = Create_Struct(struct, 'bkman', 1)
+IF self.courier THEN struct = Create_Struct(struct, 'courier', 1)
+IF self.helvetica THEN struct = Create_Struct(struct, 'helvetica', 1)
+IF self.palatino THEN struct = Create_Struct(struct, 'palatino', 1)
+IF self.schoolbook THEN struct = Create_Struct(struct, 'schoolbook', 1)
+IF self.symbol THEN struct = Create_Struct(struct, 'symbol', 1)
+IF self.times THEN struct = Create_Struct(struct, 'times', 1)
+IF self.zapfdingbats THEN struct = Create_Struct(struct, 'zapfdingbats', 1)
+IF self.zapfchancery THEN struct = Create_Struct(struct, 'zapfchancery', 1)
+
+   ; What about style keywords?
+
+IF self.fontStyleSet[0] THEN struct = Create_Struct(struct, 'bold', 1) ELSE struct = Create_Struct(struct, 'bold', 0)
+IF self.fontStyleSet[1] THEN struct = Create_Struct(struct, 'book', 1) ELSE struct = Create_Struct(struct, 'book', 0)
+IF self.fontStyleSet[2] THEN struct = Create_Struct(struct, 'demi', 1) ELSE struct = Create_Struct(struct, 'demi', 0)
+IF self.fontStyleSet[3] THEN struct = Create_Struct(struct, 'italic', 1) ELSE struct = Create_Struct(struct, 'italic', 0)
+IF self.fontStyleSet[4] THEN struct = Create_Struct(struct, 'light', 1) ELSE struct = Create_Struct(struct, 'light', 0)
+IF self.fontStyleSet[5] THEN struct = Create_Struct(struct, 'medium', 1) ELSE struct = Create_Struct(struct, 'medium', 0)
+IF self.fontStyleSet[6] THEN struct = Create_Struct(struct, 'narrow', 1) ELSE struct = Create_Struct(struct, 'narrow', 0)
+IF self.fontStyleSet[7] THEN struct = Create_Struct(struct, 'oblique', 1) ELSE struct = Create_Struct(struct, 'oblique', 0)
+
+   ; Return the keyword stucture.
+
+RETURN, struct
+END ;--------------------------------------------------------------------------------
+
+
+
+
+FUNCTION FSC_PSConfig::GetName
+
+; This method returns the "name" of the object.
+
+RETURN, self.name
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSConfig::GetProperty, Name=name, _Extra=extra
+
+; This GetProperty method is set up only to be able to obtain
+; the name of the object. This makes the object compatible with
+; Martin Shultz's container object. All other keywords are swallowed
+; silently. Note that the GetName method can also be used.
+
+name = self.name
+END ;--------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PSCONFIG::GetSizes
+
+RETURN, [self.xsizeID->Get_Value(), self.ysizeID->Get_Value(), $
+   self.xoffsetID->Get_Value(), self.yoffsetID->Get_Value()]
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::GUI, Group_Leader=leader, NoBlock=noblock, Cancel=cancel, $
+   FontInfo=fontinfo, Accept_Button_Name=acceptButtonName, FontType=fonttype
+
+; This method displays the graphical user interface without font information.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+   ; Can't run this program in a device that doesn't support windows.
+
+self.thisDevice = !D.Name
+IF (!D.Flags AND 256) EQ 0 THEN BEGIN
+   thisOS = StrUpCase(!Version.OS_Family)
+   CASE thisOS OF
+      'MACOS': Set_Plot, 'Mac'
+      'WINDOWS': Set_Plot, 'Win'
+      ELSE: Set_Plot, 'X'
+   ENDCASE
+ENDIF
+
+   ; If the user wants font information, then call the GUIFont method.
+
+IF Keyword_Set(fontinfo) THEN BEGIN
+   self->GUIFont, Group_Leader=leader, NoBlock=noblock, Cancel=cancel, $
+      Accept_Button_Name=acceptButtonName, FontType=fonttype
+   RETURN
+ENDIF
+
+IF N_Elements(acceptButtonName) EQ 0 THEN BEGIN
+   IF Keyword_Set(noblock) THEN BEGIN
+      acceptButtonName = 'Apply'
+   ENDIF ELSE BEGIN
+      acceptButtonName = 'Accept'
+   ENDELSE
+ENDIF
+
+   ; Only one GUI at a time with the same name.
+
+IF XRegistered('fsc_psconfig_' + self.name) GT 0 THEN RETURN
+
+   ;Set default values.
+
+self.fontInfo = 0
+CW_FIELD_SIZE = 5
+IF Keyword_Set(noblock) THEN BEGIN
+   cancelButVal = 'Dismiss'
+ENDIF ELSE BEGIN
+   cancelButVal = 'Cancel'
+ENDELSE
+
+self.fontTypeSet = !P.Font
+IF Keyword_Set(noblock) THEN self.cancel = 0 ELSE self.cancel = 1
+
+   ; Modal TLB if possible.
+
+IF self.name NE "" THEN tlbTitle = self.name + ": Configure PostScript Device" ELSE $
+   tlbTitle = "Configure PostScript Device"
+
+IF N_Elements(leader) EQ 0 OR Keyword_Set(noblock) THEN BEGIN
+   tlb = Widget_Base(Title=tlbTitle, Column=1, Base_Align_Center=1)
+ENDIF ELSE BEGIN
+   tlb = Widget_Base(Title=tlbTitle, Column=1, $
+      Base_Align_Center=1, Group_Leader=leader, /Modal)
+ENDELSE
+
+self.tlb = tlb
+
+   ; Widget sub-bases.
+
+   topBase = Widget_Base(tlb, Row=1, UValue=self.thisDevice, Kill_Notify='FSC_PSConfig_Restore_Device')
+      leftTopBase = Widget_Base(topBase, Column=1)
+         controlBase = Widget_Base(leftTopBase, Column=1, /Frame)
+         euroBase = Widget_Base(leftTopBase, row=1, /NonExclusive)
+      rightTopBase = Widget_Base(topBase, Column=1, Base_Align_Center=1, Frame=1)
+         sizebase = Widget_Base(rightTopBase, Column=2)
+      middleTopBase = Widget_Base(topBase, Column=1, Base_Align_Center=1)
+   actionBase = Widget_Base(tlb, Row=1, Base_Align_Center=1)
+
+   ; Create droplist widgets.
+
+values = ['Letter', 'A4', 'Legal', 'Ledger']
+self.pageTypeID = FSC_Droplist(controlBase, Value=values, Title='Page Size:', $
+   UValue={Method:'PageSize', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.pageTypeID->SetSelection, self.pageTypeSet
+self.pagetype = self.pageTypeSet
+
+values = ['Portrait', 'Landscape']
+self.orientationID = FSC_Droplist(controlBase, Value=values, Title='Orientation:', $
+   UValue={Method:'Orientation', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.orientationID->SetIndex, self.landscapeSet
+
+values = ['Centimeters', 'Inches']
+self.unitsID = FSC_Droplist(controlBase, Value=values, Title='Units:', $
+   UValue={Method:'Units', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.unitsID->SetIndex, self.inchesSet
+
+values = ['Off', 'On']
+self.encapsulationID = FSC_Droplist(controlBase, Value=values, Title='Encapsulation:', $
+   UValue={Method:'ENCAPSULATE', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.encapsulationID->SetIndex, self.encapsulationSet
+
+values = ['None', 'EPSI', 'EPSF']
+self.previewID = FSC_Droplist(controlBase, Value=values, Title='Preview Mode:', $
+   UValue={Method:'NULL', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.previewID->SetIndex, self.previewSet
+
+values = ['Off', 'On']
+self.colorID = FSC_Droplist(controlBase, Value=values, Title='Color Output:', $
+   UValue={Method:'COLOR', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.colorID->SetIndex, self.colorSet
+
+values = ['Off', 'On']
+self.cmykID = FSC_Droplist(controlBase, Value=values, Title = 'CMYK Output', $
+    UValue={Method:'NULL', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.cmykID->SetIndex, self.cmykSet
+IF ~self.colorset THEN self.cmykID->Sensitive, 0
+
+values = ['8', '4', '2']
+self.bitsID = FSC_Droplist(controlBase, Value=values, Title='Bits Per Image Pixel:', $
+   UValue={Method:'NULL', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.bitsID->SetSelection, self.bitsSet
+
+values = self->DefaultList()
+self.defaultsID = FSC_Droplist(controlBase, Value=values, Title='Setups:', $
+   UValue={Method:'DEFAULTS', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.defaultsID->SetSelection, self.defaultsSet
+
+euroSetUPID = Widget_Button(euroBase, Value='European Style', UValue={Method:'EUROSTYLE', Object:self})
+IF self.european THEN Widget_Control, euroSetUpID, /Set_Button
+IF self.inchesSet THEN unit = 'INCHES' ELSE unit = 'CENTIMETERS'
+
+windowDims = self->PageDimensions()
+shortside = Min(windowDims, Max=longside)
+IF self.landscapeSet THEN BEGIN
+   windowsize = [self.xoffsetSet/longside, self.yoffsetSet/shortside, $
+      self.xsizeSet/longside + self.xoffsetSet/longside, self.ysizeSet/shortside + self.yoffsetSet/shortside]
+ENDIF ELSE BEGIN
+   windowsize = [self.xoffsetSet/shortside, self.yoffsetSet/longside, $
+      self.xsizeSet/shortside + self.xoffsetSet/shortside, self.ysizeSet/longside + self.yoffsetSet/longside]
+ENDELSE
+
+   ; Create the plot window.
+
+self.plotID = FSC_PlotWindow(middleTopBase, Units=unit, PageSize=self.pagetypeSet, $
+   Landscape=self.landscapeSet, WindowSize=windowsize, Event_Pro='FSC_PSCONFIG_Events', $
+   UValue={Method:'PLOTWINDOW', Object:self})
+
+   ; Create size and offset windows.
+
+xsizeID = FSC_Field(sizebase, Title=' X Size: ', Value=self.xsizeSet, Object=xsizeObj, $
+   /Float, XSize=CW_FIELD_SIZE, Decimal=2, /CR_Only, Event_Pro='FSC_PSCONFIG_Events', $
+   UValue={Method:'WINDOWSIZE', Object:self}, /Positive, /Label_Left)
+self.xsizeID = xsizeObj
+ysizeID = FSC_Field(sizebase, Title=' Y Size: ', Value=self.ysizeSet, Object=ysizeObj, $
+   /Float, XSize=CW_FIELD_SIZE, Decimal=2, /CR_Only, Event_Pro='FSC_PSCONFIG_Events', $
+   UValue={Method:'WINDOWSIZE', Object:self}, /Positive, /Label_Left)
+self.ysizeID = ysizeObj
+
+xoffsetID = FSC_Field(sizebase, Title=' X Offset: ', Value=self.xoffsetSet, Object=xoffsetObj, $
+   /Float, XSize=CW_FIELD_SIZE, Decimal=2, /CR_Only, Event_Pro='FSC_PSCONFIG_Events', $
+   UValue={Method:'WINDOWSIZE', Object:self}, /Positive, /Label_Left)
+self.xoffsetID = xoffsetObj
+
+yoffsetID = FSC_Field(sizebase, Title=' Y Offset: ', Value=self.yoffsetSet, Object=yoffsetObj, $
+   /Float, XSize=CW_FIELD_SIZE, Decimal=2, /CR_Only, Event_Pro='FSC_PSCONFIG_Events', $
+   UValue={Method:'WINDOWSIZE', Object:self}, /Positive, /Label_Left)
+self.yoffsetID = yoffsetObj
+
+   ; Set up TABing between fields.
+
+self.xsizeID->SetTabNext, self.ysizeID->GetTextID()
+self.ysizeID->SetTabNext, self.xoffsetID->GetTextID()
+self.xoffsetID->SetTabNext, self.yoffsetID->GetTextID()
+self.yoffsetID->SetTabNext, self.xsizeID->GetTextID()
+
+   ; Create directions widgets.
+
+labelBase = Widget_Base(rightTopBase, Column=1, Base_Align_Center=1)
+label = Widget_Label(labelBase, Value='Directions')
+label = Widget_Label(labelBase, Value='Move or resize the PostScript "plot" on the', /Align_Left)
+label = Widget_Label(labelBase, Value='page with left or right buttons. Click the middle', /Align_Left)
+label = Widget_Label(labelBase, Value='button in the window to center plot on the page.', /Align_Left)
+
+   ; Create filename widgets.
+
+dummy = FSC_FileSelect(rightTopBase, Filename=self.filenameSet, $
+   Directory=self.directorySet, XSIZE=40, ObjectRef=filenameID)
+self.filenameID = filenameID
+
+   ; Create bottom button widgets.
+
+cancel = Widget_Button(actionBase, Value=cancelButVal, UValue={Method:'CANCEL', Object:self})
+self.revertID = Widget_Button(actionBase, Value='Revert', UValue={Method:'REVERT', Object:self}, Sensitive=0)
+helper = Widget_Button(actionBase, Value='Help', UValue={Method:'HELP', Object:self})
+self.acceptID = Widget_Button(actionBase, Value=acceptButtonName, UValue={Method:'ACCEPT', Object:self})
+
+   ; Size the widgets.
+
+t = Widget_Info(leftTopBase, /Geometry)
+targetSize = t.scr_xsize
+self.pageTypeID->Resize, ParentSize=targetsize
+self.orientationID->Resize, targetsize
+self.unitsID->Resize, targetsize
+self.encapsulationID->Resize, targetsize
+self.previewID->Resize, targetsize
+self.cmykID->Resize, targetsize
+self.colorID->Resize, targetsize
+self.bitsID->Resize, targetsize
+self.defaultsID->Resize, targetsize
+
+IF self.encapsulationID->GetIndex() THEN self.previewID->Sensitive, 1 ELSE self.previewID->Sensitive, 0
+self.plotID->SetColor, self.colorSet
+
+   ; Center and realize TLB.
+
+FSC_PSConfig_CenterTLB, tlb
+Widget_Control, tlb, /Realize
+
+self.noblock = Keyword_Set(noblock)
+
+   ; Save the current configuration.
+
+self->SaveConfiguration
+
+XManager, 'fsc_psconfig_' + self.name, tlb, Event_Handler='FSC_PSCONFIG_EVENTS', $
+  No_Block=Keyword_Set(noblock)
+IF Keyword_Set(noblock) THEN cancel = 0 ELSE cancel = self.cancel
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::GUIFont, Cancel=cancel, Group_Leader=leader, NoBlock=noblock, $
+   NoFont=nofont, Accept_Button_Name=acceptButtonName, FontType=fonttype
+
+; This method displays the graphical user interface with font information
+; in place.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+   ; Can't run this program in a device that doesn't support windows.
+
+self.thisDevice = !D.Name
+IF (!D.Flags AND 256) EQ 0 THEN BEGIN
+   thisOS = StrUpCase(!Version.OS_Family)
+   CASE thisOS OF
+      'MACOS': Set_Plot, 'Mac'
+      'WINDOWS': Set_Plot, 'Win'
+      ELSE: Set_Plot, 'X'
+   ENDCASE
+ENDIF
+
+   ; If the NoFont keyword is set, call the non-font GUI method.
+
+IF Keyword_Set(nofont) THEN BEGIN
+   self->Gui, Cancel=cancel, Group_Leader=leader, NoBlock=Keyword_Set(noblock), $
+      Accept_Button_Name=acceptButtonName, FontType=fonttype
+   RETURN
+ENDIF
+
+IF N_Elements(acceptButtonName) EQ 0 THEN BEGIN
+   IF Keyword_Set(noblock) THEN BEGIN
+      acceptButtonName = 'Apply'
+   ENDIF ELSE BEGIN
+      acceptButtonName = 'Accept'
+   ENDELSE
+ENDIF
+
+   ; Only one GUI at a time with the same name.
+
+IF XRegistered('fsc_psconfig_' + self.name) GT 0 THEN RETURN
+
+   ;Set default values.
+
+self.fontInfo = 1
+CW_FIELD_SIZE = 5
+IF Keyword_Set(noblock) THEN BEGIN
+   cancelButVal = 'Dismiss'
+ENDIF ELSE BEGIN
+   cancelButVal = 'Cancel'
+ENDELSE
+
+IF N_Elements(fonttype) EQ 0 THEN fonttype = self.fontTypeSet
+self.fontTypeSet = fonttype
+
+IF self.fontTypeSet EQ 1 THEN self.trueTypeSet = 1
+IF Keyword_Set(noblock) THEN self.cancel = 0 ELSE self.cancel = 1
+
+IF self.name NE "" THEN tlbTitle = self.name + ": Configure PostScript Device" ELSE $
+   tlbTitle = "Configure PostScript Device"
+
+   ; Modal TLB if possible.
+
+IF N_Elements(leader) EQ 0 OR Keyword_Set(noblock) THEN BEGIN
+   tlb = Widget_Base(Title=tlbTitle, Column=1, Base_Align_Center=1)
+ENDIF ELSE BEGIN
+   tlb = Widget_Base(Title=tlbTitle, Column=1, $
+      Base_Align_Center=1, Group_Leader=leader, /Modal)
+ENDELSE
+
+self.tlb = tlb
+
+   ; Sub-base hierarchy.
+
+   topBase = Widget_Base(tlb, Row=1, UValue=self.thisDevice, Kill_Notify='FSC_PSConfig_Restore_Device')
+      leftTopBase = Widget_Base(topBase, Column=1)
+         controlBase = Widget_Base(leftTopBase, Column=1, /Frame)
+         euroBase = Widget_Base(leftTopBase, row=1, /NonExclusive)
+      rightTopBase = Widget_Base(topBase, Column=1)
+         sizebase = Widget_Base(rightTopBase, Row=1, /Frame)
+         fontbase = Widget_Base(rightTopBase, Column=1, Base_Align_Left=1, Frame=1)
+            firstRow = Widget_Base(fontbase, Row=1)
+            secondRow = Widget_Base(fontbase, Row=1)
+            thirdRow = Widget_Base(fontbase, Row=1)
+            fourthRow = Widget_Base(fontbase, Row=1)
+      middleTopBase = Widget_Base(topBase, Column=1, Base_Align_Center=1)
+   actionBase = Widget_Base(tlb, Row=1, Base_Align_Center=1)
+
+   ; Create droplist widgets.
+
+values = ['Letter', 'A4', 'Legal', 'Ledger']
+self.pageTypeID = FSC_Droplist(controlBase, Value=values, Title='Page Size:', $
+   UValue={Method:'PageSize', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.pageTypeID->SetSelection, self.pageTypeSet
+self.pagetype = self.pageTypeSet
+
+values = ['Portrait', 'Landscape']
+self.orientationID = FSC_Droplist(controlBase, Value=values, Title='Orientation:', $
+   UValue={Method:'Orientation', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.orientationID->SetIndex, self.landscapeSet
+
+values = ['Centimeters', 'Inches']
+self.unitsID = FSC_Droplist(controlBase, Value=values, Title='Units:', $
+   UValue={Method:'Units', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.unitsID->SetIndex, self.inchesSet
+
+values = ['Off', 'On']
+self.encapsulationID = FSC_Droplist(controlBase, Value=values, Title='Encapsulation:', $
+   UValue={Method:'ENCAPSULATE', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.encapsulationID->SetIndex, self.encapsulationSet
+
+values = ['None', 'EPSI', 'EPSF']
+self.previewID = FSC_Droplist(controlBase, Value=values, Title='Preview Mode:', $
+   UValue={Method:'NULL', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.previewID->SetIndex, self.previewSet
+
+values = ['Off', 'On']
+self.colorID = FSC_Droplist(controlBase, Value=values, Title='Color Output:', $
+   UValue={Method:'COLOR', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.colorID->SetIndex, self.colorSet
+
+values = ['Off', 'On']
+self.cmykID = FSC_Droplist(controlBase, Value=values, Title = 'CMYK Output', $
+    UValue={Method:'CMYK', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.cmykID->SetIndex, self.cmykSet
+
+values = ['8', '4', '2']
+self.bitsID = FSC_Droplist(controlBase, Value=values, Title='Bits Per Image Pixel:', $
+   UValue={Method:'NULL', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.bitsID->SetSelection, self.bitsSet
+
+values = self->DefaultList()
+self.defaultsID = FSC_Droplist(controlBase, Value=values, Title='Setups:', $
+   UValue={Method:'DEFAULTS', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+self.defaultsID->SetSelection, self.defaultsSet
+
+euroSetUpID = Widget_Button(euroBase, Value='European Style', UValue={Method:'EUROSTYLE', Object:self})
+IF self.european THEN Widget_Control, euroSetUpID, /Set_Button
+IF self.inchesSet THEN unit = 'INCHES' ELSE unit = 'CENTIMETERS'
+
+windowDims = self->PageDimensions()
+shortside = Min(windowDims, Max=longside)
+IF self.landscapeSet THEN BEGIN
+   windowsize = [self.xoffsetSet/longside, self.yoffsetSet/shortside, $
+      self.xsizeSet/longside + self.xoffsetSet/longside, self.ysizeSet/shortside + self.yoffsetSet/shortside]
+ENDIF ELSE BEGIN
+   windowsize = [self.xoffsetSet/shortside, self.yoffsetSet/longside, $
+      self.xsizeSet/shortside + self.xoffsetSet/shortside, self.ysizeSet/longside + self.yoffsetSet/longside]
+ENDELSE
+
+   ; Create the plot window.
+
+self.plotID = FSC_PlotWindow(middleTopBase, Units=unit, PageSize=self.pagetypeSet, $
+   Landscape=self.landscapeSet, WindowSize=windowsize, Event_Pro='FSC_PSCONFIG_Events', $
+   UValue={Method:'PLOTWINDOW', Object:self})
+
+   ; Create size and offset windows.
+
+xsizeID = FSC_Field(sizebase, Title=' X Size: ', Value=self.xsizeSet, Object=xsizeObj, $
+   /Float, XSize=CW_FIELD_SIZE, Decimal=2, /CR_Only, Event_Pro='FSC_PSCONFIG_Events', $
+   UValue={Method:'WINDOWSIZE', Object:self}, /Positive, /Label_Left)
+self.xsizeID = xsizeObj
+ysizeID = FSC_Field(sizebase, Title=' Y Size: ', Value=self.ysizeSet, Object=ysizeObj, $
+   /Float, XSize=CW_FIELD_SIZE, Decimal=2, /CR_Only, Event_Pro='FSC_PSCONFIG_Events', $
+   UValue={Method:'WINDOWSIZE', Object:self}, /Positive, /Label_Left)
+self.ysizeID = ysizeObj
+
+xoffsetID = FSC_Field(sizebase, Title=' X Offset: ', Value=self.xoffsetSet, Object=xoffsetObj, $
+   /Float, XSize=CW_FIELD_SIZE, Decimal=2, /CR_Only, Event_Pro='FSC_PSCONFIG_Events', $
+   UValue={Method:'WINDOWSIZE', Object:self}, /Positive, /Label_Left)
+self.xoffsetID = xoffsetObj
+
+yoffsetID = FSC_Field(sizebase, Title=' Y Offset: ', Value=self.yoffsetSet, Object=yoffsetObj, $
+   /Float, XSize=CW_FIELD_SIZE, Decimal=2, /CR_Only, Event_Pro='FSC_PSCONFIG_Events', $
+   UValue={Method:'WINDOWSIZE', Object:self}, /Positive, /Label_Left)
+self.yoffsetID = yoffsetObj
+
+   ; Set up TABing between fields.
+
+self.xsizeID->SetTabNext, self.ysizeID->GetTextID()
+self.ysizeID->SetTabNext, self.xoffsetID->GetTextID()
+self.xoffsetID->SetTabNext, self.yoffsetID->GetTextID()
+self.yoffsetID->SetTabNext, self.xsizeID->GetTextID()
+
+   ; Create the font widgets.
+
+values = ['Vector (Hershey)', 'Hardware', 'True-Type']
+self.fontTypeID = FSC_Droplist(firstRow, Value=values, Title='Font Type: ', $
+   UValue={Method:'FONTTYPE', Object:self}, Event_Pro='FSC_PSCONFIG_Events') ;, UName='Font Type')
+self.fontTypeID->SetIndex, (0 > (self.fonttypeSet + 1) < 2)
+
+self.fontnameID = FSC_Droplist(firstrow, Value=*self.fontnames, Title='Font: ', $
+   UValue={Method:'NULL', Object:self}, Event_Pro='FSC_PSCONFIG_Events') ;, UName='Font Name')
+self.fontnameID->SetSelection, self.fontNameSet
+
+values = ['Bold','Book', 'Demi', 'Italic', 'Light', 'Medium', 'Narrow', 'Oblique']
+self.styleBaseID = Widget_Base(secondRow, Column=4, /Nonexclusive, /Frame)
+FOR j=0,7 DO BEGIN
+      self.fontStyleButtonID[j] = Widget_Button(self.styleBaseID, Value=values[j], $
+         UValue={Method:'STYLEBUTTONS', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+      Widget_Control, self.fontStylebuttonID[j], Set_Button=self.fontStyleSet[j]
+ENDFOR
+FOR j=0,7 DO IF self.fontStyleSet[j] THEN Widget_Control, self.fontStyleButtonID[j], Set_Button=1
+
+clearBaseID = Widget_Base(secondRow)
+self.clearButtonID = Widget_Button(clearBaseID, Value='Clear Font Styles', YOffset=15, XOffset=6, $
+         UValue={Method:'CLEARSTYLES', Object:self}, Event_Pro='FSC_PSCONFIG_Events')
+
+   ; More droplist widgets.
+
+values = Indgen(31) + 6
+self.fontSizeID = FSC_Droplist(thirdrow, Value=StrTrim(values,2), Title='Font Size: ', $
+   UValue={Method:'NULL', Object:self}, Event_Pro='FSC_PSCONFIG_Events') ;, UName='Font Size')
+self.fontSizeID->SetSelection, StrTrim(self.fontsizeSet,2)
+
+self.truetypeID = FSC_Droplist(thirdrow, Value=['No', 'Yes'], Title='True-Type: ', $
+   UValue={Method:'NULL', Object:self}, Event_Pro='FSC_PSCONFIG_Events') ;, UName='True-Type Fonts')
+self.truetypeID->SetIndex, self.truetypeSet
+
+self.isolatinID = FSC_Droplist(thirdrow, Value=['Off', 'On'], Title='ISOlatin1: ', $
+   UValue={Method:'NULL', Object:self}, Event_Pro='FSC_PSCONFIG_Events') ;, UName='Isolatin Encoding')
+self.isolatinID->SetIndex, self.isolatinSet
+
+;self.set_fontID = FSC_InputField(fourthRow, Value=self.set_fontSet, $
+;   UValue={Method:'NULL', Object:self}, Event_Pro='FSC_PSCONFIG_Events', $
+;   Title='Set_Font Name: ', XSize=35, /StringValue)
+
+   ; The directions widgets.
+
+labelBase = Widget_Base(middleTopBase, Column=1, Base_Align_Center=1)
+label = Widget_Label(labelBase, Value='Directions')
+label = Widget_Label(labelBase, Value='Move or resize the PostScript "plot" on the', /Align_Left)
+label = Widget_Label(labelBase, Value='page with left or right buttons. Click the middle', /Align_Left)
+label = Widget_Label(labelBase, Value='button in the window to center plot on the page.', /Align_Left)
+
+   ; The file name widgets.
+
+dummy = FSC_FileSelect(rightTopBase, Filename=self.filenameSet, $
+   Directory=self.directorySet, XSIZE=40, ObjectRef=filenameID)
+self.filenameID = filenameID
+
+   ; The bottom button widgets.
+
+cancel = Widget_Button(actionBase, Value=cancelButVal, UValue={Method:'CANCEL', Object:self})
+self.revertID = Widget_Button(actionBase, Value='Revert', UValue={Method:'REVERT', Object:self}, Sensitive=0)
+helper = Widget_Button(actionBase, Value='Help', UValue={Method:'HELP', Object:self})
+self.acceptID = Widget_Button(actionBase, Value=acceptButtonName, UValue={Method:'ACCEPT', Object:self})
+
+   ; Size the widgets for layout.
+
+t = Widget_Info(leftTopBase, /Geometry)
+targetSize = t.scr_xsize
+self.pageTypeID->Resize, ParentSize=targetsize
+self.orientationID->Resize, targetsize
+self.unitsID->Resize, targetsize
+self.encapsulationID->Resize, targetsize
+self.previewID->Resize, targetsize
+self.cmykID->Resize, targetsize
+self.colorID->Resize, targetsize
+self.bitsID->Resize, targetsize
+self.defaultsID->Resize, targetsize
+
+t = Widget_Info(fontbase, /Geometry)
+targetsize = t.scr_xsize / 2
+self.fontTypeID->Resize, targetsize
+self.fontnameID[0]->Resize, targetsize
+
+targetsize = t.scr_xsize / 3
+self.truetypeID->Resize, targetsize
+self.isoLatinID->Resize, targetsize
+self.fontSizeID->Resize, targetsize
+
+targetsize = t.scr_xsize
+IF Obj_Valid(self.set_fontID) THEN self.set_fontID->Resize, targetsize
+
+   ; Some widgets need to be turned off.
+
+IF self.encapsulationID->GetIndex() THEN self.previewID->Sensitive, 1 ELSE self.previewID->Sensitive, 0
+self.plotID->SetColor, self.colorSet
+IF self.fontTypeSet EQ -1 THEN BEGIN
+   Widget_Control, self.fontnameID->GetID(), Sensitive=0
+   Widget_Control, self.stylebaseID, Sensitive=0
+   Widget_Control, self.clearbuttonID, Sensitive=0
+   Widget_Control, self.fontSizeID->GetID(), Sensitive=0
+   Widget_Control, self.truetypeID->GetID(), Sensitive=0
+   Widget_Control, self.isolatinID->GetID(), Sensitive=0
+   IF Obj_Valid(self.set_fontID) THEN Widget_Control, self.set_fontID->GetID(), Sensitive=0
+ENDIF
+
+   ; Center and realize the top-level base.
+
+FSC_PSConfig_CenterTLB, tlb
+Widget_Control, tlb, /Realize
+
+self.noblock = Keyword_Set(noblock)
+
+   ; Save the current configuration.
+
+self->SaveConfiguration
+
+XManager, 'fsc_psconfig_' + self.name, tlb, Event_Handler='FSC_PSCONFIG_EVENTS', $
+  No_Block=Keyword_Set(noblock)
+IF Keyword_Set(noblock) THEN cancel = 0 ELSE cancel = self.cancel
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::Help, event
+
+; This is the text that pops up in the HELP WINDOW when the
+; Help button is selected. Feel free to change it to whatever
+; you like. The "textsize" variable below the help text should
+; be set to the number of lines of textual information.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+helptext = [ $
+"                                                              ", $
+"  The FSC_PSConfig object is a Open Source program written    ", $
+"  by David Fanning of Fanning Software Consulting. Complete   ", $
+"  program documenation is available on the FSC web page:      ", $
+"                                                              ", $
+"     http://www.dfanning.com/programs/docs/fsc_psconfig.html  ", $
+"                                                              ", $
+"  Other IDL programs, as well as many IDL programming tips    ", $
+"  and techniques can be found on the Coyote's Guide to IDL    ", $
+"  Programming web page. Please take a moment to look around.  ", $
+"                                                              ", $
+"     Fanning Software Consulting                              ", $
+"     1645 Sheely Drive                                        ", $
+"     Fort Collins, CO 80526                                   ", $
+"     Phone: 970-221-0438   Fax: 970-221-4762                  ", $
+"     E-Mail: david@dfanning.com                               ", $
+"     IDL Book Orders: 1-888-461-0155                          ", $
+"     Coyote's Guide: http://www.dfanning.com/                 ", $
+"                                                              " ]
+textsize = 19
+
+   ; Only one help display at a time, please.
+
+IF XRegistered('fsc_psconfig_help') GT 0 THEN RETURN
+
+   ; Creat the widgets for the HELP WINDOW.
+
+base = Widget_Base(Column=1, Group_Leader=self.acceptID)
+textID = Widget_Text(base, Value=helptext, Scr_XSize=500, YSize=textsize)
+IF NOT Widget_Info(self.tlb, /Modal) THEN button = Widget_Button(base, Value='Dismiss')
+FSC_PSConfig_CenterTLB, base
+Widget_Control, base, /Realize
+XManager, 'fsc_psconfig_help', base, /Just_Reg
+END ;--------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PSCONFIG::PageDimensions
+
+; This method sets up the page size. If you add a new page size,
+; you must add its dimensions (in inches) to the CASE statement below.
+
+; Letter 8.5 x 11.
+; Ledger 11 x 17.
+; Legal 8.5 x 14.
+; A4 8.27 x 11.7.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN, [0,0]
+ENDIF
+
+CASE StrUpCase(self.pagetype) OF
+   'LETTER': BEGIN
+         shortside = 8.5
+         longside = 11.0
+      ENDCASE
+   'LEDGER': BEGIN
+         shortside = 11.0
+         longside = 17.0
+      ENDCASE
+   'LEGAL': BEGIN
+         shortside = 8.5
+         longside = 14.0
+      ENDCASE
+   'A4': BEGIN
+         shortside = 8.27
+         longside = 11.70
+      ENDCASE
+;   ELSE: BEGIN
+;         shortside = 8.5
+;         longside = 11.0
+;      ENDCASE
+ENDCASE
+
+IF self.inchesSet EQ 0 THEN BEGIN
+   shortside = shortside * 2.54
+   longside = longside * 2.54
+ENDIF
+
+RETURN, [shortside, longside]
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::Orientation, event
+
+; This event handler method responds to changes in the Orientation droplist.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+pagetype = self.pageTypeID->GetSelection()
+Widget_Control, event.top, Update=0
+self.plotID->SetPageSize, pagetype, Landscape=event.index, TLB=self.tlb
+self.plotID->GetWindowLocation, xsize, ysize, xoffset, yoffset
+self->UpdateSizes, xsize, ysize, xoffset, yoffset
+self.landscapeSet = event.index
+Widget_Control, event.top, Update=1
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::PageSize, event
+
+; This event handler method responds to changes in the Page Size droplist.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+   ; Landscape is the default orientation for LEDGER output.
+
+IF StrUpCase(*event.selection) EQ "LEDGER" THEN BEGIN
+   landscapeValue = 1
+   self.orientationID->SetIndex, 1
+ENDIF ELSE landscapeValue = self.orientationID->GetIndex()
+
+   ; Change the page size. Get the window location and update the display.
+
+Widget_Control, event.top, Update=0
+self.plotID->SetPageSize, *event.selection, Landscape=landscapeValue, TLB=self.tlb
+self.plotID->GetWindowLocation, xsize, ysize, xoffset, yoffset
+self->UpdateSizes, xsize, ysize, xoffset, yoffset
+self.pagetype = *event.selection
+Widget_Control, event.top, Update=1
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::PlotWindow, event
+
+; The plot window moved or changed size. Update the size and offset widgets.
+
+self->UpdateSizes, event.xsize, event.ysize, event.xoffset, event.yoffset
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::Revert, event
+
+; This method allows the user to revert to the previously
+; saved configuration. All buttons, droplists, etc. are set
+; to their previously saved values.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+   ; Reset the widget setting variables.
+
+self.bitsSet = self.bitsRevert
+self.defaultsSet = self.defaultsRevert
+self.directorySet = self.directoryRevert
+self.encapsulationSet = self.encapsulationRevert
+self.filenameSet = self.filenameRevert
+self.fontsizeSet = self.fontsizeRevert
+self.fontstyleSet = self.fontstyleRevert
+self.fonttypeSet = self.fonttypeRevert
+self.fontnameSet = self.fontnameRevert
+self.inchesSet = self.inchesRevert
+self.isolatinSet = self.isolatinRevert
+self.landscapeSet = self.landscapeRevert
+self.pagetypeSet = self.pagetypeRevert
+self.previewSet = self.previewRevert
+self.set_fontSet = self.set_fontRevert
+self.truetypeSet = self.truetypeRevert
+self.cmykSet = self.cmykRevert
+self.colorSet = self.colorRevert
+self.xoffsetSet = self.xoffsetRevert
+self.xsizeSet = self.xsizeRevert
+self.yoffsetSet = self.yoffsetRevert
+self.ysizeSet = self.ysizeRevert
+
+IF Obj_Valid(self.plotID) THEN BEGIN
+   IF self.inchesSet THEN plotUnits = 'INCHES' ELSE plotUnits = 'CENTIMETERS'
+   self.plotID->SetUnits, plotUnits
+ENDIF
+
+   ; Turn off updating while you update the plot window.
+
+Widget_Control, event.top, Update=0
+self.plotID->SetPageSize, self.pagetypeSet, Landscape=self.landscapeSet, TLB=self.tlb
+self.plotID->SetWindowLocation, self.xsizeSet, self.ysizeSet, self.xoffsetSet, self.yoffsetSet
+self.plotID->SetColor, self.colorSet
+
+   ; Make sure the Preview droplist is set correctly.
+
+IF self.encapsulationSet THEN self.previewID->Sensitive, 1 ELSE self.previewID->Sensitive, 0
+
+   ; The statuslight should be set to SAFE.
+
+self->StatusLight, 1
+
+   ; Update the display.
+
+self->UpdateDisplay
+Widget_Control, event.top, Update=1
+self.plotID->Refresh
+
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::SaveConfiguration
+
+; This method saves the current configuration. Reversion
+; variables are set so the REVERT button can be used to
+; return to the previously saved configuration.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+self.bitsRevert = self.bitsSet
+self.cmykRevert = self.cmykSet
+self.colorRevert = self.colorSet
+self.defaultsRevert = self.defaultsSet
+self.directoryRevert = self.directorySet
+self.encapsulationRevert = self.encapsulationSet
+self.filenameRevert = self.filenameSet
+self.fontnameRevert = self.fontnameSet
+self.fontsizeRevert = self.fontsizeSet
+self.fontstyleRevert = self.fontstyleSet
+self.fonttypeRevert = self.fonttypeSet
+self.inchesRevert = self.inchesSet
+self.isolatinRevert = self.isolatinSet
+self.landscapeRevert = self.landscapeSet
+self.pagetypeRevert = self.pagetypeSet
+self.previewRevert = self.previewSet
+self.truetypeRevert = self.truetypeSet
+self.set_fontRevert = self.set_fontSet
+self.xoffsetRevert = self.xoffSetSet
+self.yoffsetRevert = self.yoffSetSet
+self.xsizeRevert = self.xsizeSet
+self.ysizeRevert = self.ysizeSet
+
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::SetDefault, defaultname
+
+; This method implements the default setups. To add your own default
+; setups, add the new default name to the list in the DefaultList method
+; above. Then add the default settings in the CASE statement below.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+   ; Set the page type and page units here, based on EUROPEAN setting.
+
+IF self.european THEN BEGIN
+   pagetype = 'A4'
+   units = 0
+ENDIF ELSE BEGIN
+   pagetype = 'LETTER'
+   units = 1
+ENDELSE
+
+   ; Get the directory name.
+
+IF Obj_Valid(self.filenameID) THEN BEGIN
+   self.filenameID->GetProperty, Directory=directoryName
+ENDIF ELSE BEGIN
+   CD, Current=directoryName
+ENDELSE
+
+   ; Get the file name.
+
+IF Obj_Valid(self.filenameID) THEN BEGIN
+   self.filenameID->GetProperty, Filename=defaultFileName
+   index = FSC_PSConfig_RStrPos( defaultFileName, "." )
+   IF index GE 0 THEN defaultFileName = StrMid(defaultFileName, 0, index)
+ENDIF ELSE BEGIN
+   IF self.filenameSet NE "" THEN defaultFilename = self.filenameSet ELSE defaultFileName = "idl"
+ENDELSE
+
+   ; Get the names of the defaults on the default list.
+
+defaultlist = self->DefaultList()
+
+   ; If the defaultname variable is undefined, choose the first one
+   ; in the list.
+
+IF N_Elements(defaultname) EQ 0 THEN defaultname = defaultlist[0]
+defaultname = String(defaultname)
+
+   ; Define synonyms.
+
+IF StrUpCase(defaultname) EQ 'SYSTEM' THEN defaultname = 'System (Portrait)'
+IF StrUpCase(defaultname) EQ 'PORTRAIT' THEN defaultname = 'Centered (Portrait)'
+IF StrUpCase(defaultname) EQ 'LANDSCAPE' THEN defaultname = 'Centered (Landscape)'
+IF StrUpCase(defaultname) EQ 'CENTER' THEN defaultname = 'Centered (Portrait)'
+IF StrUpCase(defaultname) EQ 'CENTERED' THEN defaultname = 'Centered (Portrait)'
+IF StrUpCase(defaultname) EQ 'FIGURE' THEN defaultname = 'Figure (Large)'
+IF StrUpCase(defaultname) EQ 'ENCAPSULATED' THEN defaultname = 'Figure (Small)'
+IF StrUpCase(defaultname) EQ 'ENCAPSULATE' THEN defaultname = 'Figure (Small)'
+IF StrUpCase(defaultname) EQ 'COLOR' THEN defaultname = 'Color (Portrait)'
+IF StrUpCase(defaultname) EQ 'NONE' THEN defaultname = 'None'
+
+
+index = Where(StrUpCase(defaultlist) EQ StrUpCase(defaultname), count)
+IF count EQ 0 THEN BEGIN
+   ok = Dialog_Message(['Default set-up "' + defaultname + '" is', $
+      'unknown. Using system defaults.'])
+   defaultname = 'System (Portrait)'
+ENDIF
+
+thisDefault = defaultlist[index[0]]
+
+   ; The default setups. Add your setups to this CASE statement if you are
+   ; adding a new default setup.
+
+CASE thisDefault OF
+
+   'System (Portrait)': BEGIN
+         self.bitsSet = '8'                          ; Sets the Bits-per-Pixels keyword.
+         self.colorSet = 0                           ; Sets the Color keyword.
+         self.directorySet = directoryName           ; Sets the directory name of the PostScript file.
+         self.encapsulationSet = 0                   ; Sets the Encapsulation keyword.
+         self.filenameSet = defaultFilename + ".ps"  ; Sets the filename of the PostScript file.
+         self.fonttypeSet = !P.Font                  ; Sets the Font keyword.
+         self.fontsizeSet = 12                       ; Sets the Font_Size keyword.
+         self.fontStyleSet = Replicate(0, 8)         ; Sets the font style keywords in this order: Bold, Book, Demi, Italic, Light, Medium, Narrow, and Oblique.
+         self.fontnameSet = "Helvetica"              ; Sets the PostScript font name. All PostScript font names acceptable.
+         self.inchesSet = units                      ; Sets the Inches keyword.
+         self.landscapeSet = 0                       ; Sets the Landscape keyword.
+         self.isolatinSet = 0                        ; Sets the Isolatin1 keyword.
+         self.pagetypeSet = pagetype                 ; Sets the page type. Possible values include "Letter", "A4", etc.
+         self.pagetype = pagetype                    ; Sets the page type. Possible values include "Letter", "A4", etc.
+         self.previewSet = 0                         ; Sets the Preview keyword.
+         self.truetypeSet = 0                        ; Sets the TT_Font keyword.
+         IF self.european THEN self.xoffsetSet = 1.61 ELSE self.xoffsetSet = 0.75 ; Sets the XOffset keyword.
+         IF self.european THEN self.yoffsetSet = 14.65 ELSE self.yoffsetSet = 5.0 ; Sets the YOffset keyword.
+         IF self.european THEN self.xsizeSet = 17.80 ELSE self.xsizeSet = 7.0     ; Sets the XSize keyword.
+         IF self.european THEN self.ysizeSet = 12.70 ELSE self.ysizeSet = 5.0     ; Sets the YSize keyword.
+         self.defaultsSet = 'System (Portrait)'
+      ENDCASE
+
+   'System (Landscape)': BEGIN
+         self.bitsSet = '8'
+         self.colorSet = 0
+         self.directorySet = directoryName
+         self.encapsulationSet = 0
+         self.filenameSet = defaultFilename + ".ps"
+         self.fonttypeSet = !P.Font
+         self.fontsizeSet = 12
+         self.fontstyleSet = Replicate(0, 8)
+         self.fontnameSet = "Helvetica"
+         self.inchesSet = units
+         self.landscapeSet = 1
+         self.isolatinSet = 0
+         self.pagetypeSet = pagetype
+         self.pagetype = pagetype
+         self.previewSet = 0
+         self.truetypeSet = 0
+         IF self.european THEN self.xoffsetSet = 1.76 ELSE self.xoffsetSet = 0.75
+         IF self.european THEN self.yoffsetSet = 1.69 ELSE self.yoffsetSet = 0.75
+         IF self.european THEN self.xsizeSet = 26.25 ELSE self.xsizeSet = 9.5
+         IF self.european THEN self.ysizeSet = 17.63 ELSE self.ysizeSet = 7.0
+         self.defaultsSet = 'System (Landscape)'
+     ENDCASE
+
+   'Centered (Portrait)': BEGIN
+         self.bitsSet = '8'
+         self.colorSet = 1
+         self.directorySet = directoryName
+         self.encapsulationSet = 0
+         self.filenameSet = defaultFilename + ".ps"
+         self.fonttypeSet = !P.Font
+         self.fontsizeSet = 12
+         self.fontstyleSet = Replicate(0, 8)
+         self.fontnameSet = "Helvetica"
+         self.inchesSet = units
+         self.landscapeSet = 0
+         self.isolatinSet = 0
+         self.pagetypeSet = pagetype
+         self.pagetype = pagetype
+         self.previewSet = 0
+         self.truetypeSet = 0
+         IF self.european THEN self.xoffsetSet = 3.51 ELSE self.xoffsetSet = 1.5
+         IF self.european THEN self.yoffsetSet = 3.68 ELSE self.yoffsetSet = 1.5
+         IF self.european THEN self.xsizeSet = 14.00 ELSE self.xsizeSet = 5.5
+         IF self.european THEN self.ysizeSet = 22.40 ELSE self.ysizeSet = 8.0
+         self.defaultsSet = 'Centered (Portrait)'
+      ENDCASE
+
+   'Centered (Landscape)': BEGIN
+         self.bitsSet = '8'
+         self.colorSet = 1
+         self.directorySet = directoryName
+         self.encapsulationSet = 0
+         self.filenameSet = defaultFilename + ".ps"
+         self.fonttypeSet = !P.Font
+         self.fontsizeSet = 12
+         self.fontstyleSet = Replicate(0, 8)
+         self.fontnameSet = "Helvetica"
+         self.inchesSet = units
+         self.landscapeSet = 1
+         self.isolatinSet = 0
+         self.pagetypeSet = pagetype
+         self.pagetype = pagetype
+         self.previewSet = 0
+         self.truetypeSet = 0
+         IF self.european THEN self.xoffsetSet = 3.66 ELSE self.xoffsetSet = 1.5
+         IF self.european THEN self.yoffsetSet = 3.52 ELSE self.yoffsetSet = 1.5
+         IF self.european THEN self.xsizeSet = 22.43 ELSE self.xsizeSet = 8.0
+         IF self.european THEN self.ysizeSet = 13.97 ELSE self.ysizeSet = 5.5
+         self.defaultsSet = 'Centered (Landscape)'
+      ENDCASE
+
+   'Square (Portrait)': BEGIN
+         self.bitsSet = '8'
+         self.colorSet = 1
+         self.directorySet = directoryName
+         self.encapsulationSet = 0
+         self.filenameSet = defaultFilename + ".ps"
+         self.fonttypeSet = !P.Font
+         self.fontsizeSet = 12
+         self.fontstyleSet = Replicate(0, 8)
+         self.fontnameSet = "Helvetica"
+         self.inchesSet = units
+         self.landscapeSet = 0
+         self.isolatinSet = 0
+         self.pagetypeSet = pagetype
+         self.pagetype = pagetype
+         self.previewSet = 0
+         self.truetypeSet = 0
+         IF self.european THEN self.xoffsetSet = 2.26 ELSE self.xoffsetSet = 1.0
+         IF self.european THEN self.yoffsetSet = 6.63 ELSE self.yoffsetSet = 2.25
+         IF self.european THEN self.xsizeSet = 16.50 ELSE self.xsizeSet = 6.5
+         IF self.european THEN self.ysizeSet = 16.50 ELSE self.ysizeSet = 6.5
+         self.defaultsSet = 'Square (Portrait)'
+      ENDCASE
+
+   'Square (Landscape)': BEGIN
+         self.bitsSet = '8'
+         self.colorSet = 1
+         self.directorySet = directoryName
+         self.encapsulationSet = 0
+         self.filenameSet = defaultFilename + ".ps"
+         self.fonttypeSet = !P.Font
+         self.fontsizeSet = 12
+         self.fontstyleSet = Replicate(0, 8)
+         self.fontnameSet = "Helvetica"
+         self.inchesSet = units
+         self.landscapeSet = 1
+         self.isolatinSet = 0
+         self.pagetypeSet = pagetype
+         self.pagetype = pagetype
+         self.previewSet = 0
+         self.truetypeSet = 0
+         IF self.european THEN self.xoffsetSet = 6.63 ELSE self.xoffsetSet = 2.25
+         IF self.european THEN self.yoffsetSet = 2.26 ELSE self.yoffsetSet = 1.0
+         IF self.european THEN self.xsizeSet = 16.50 ELSE self.xsizeSet = 6.5
+         IF self.european THEN self.ysizeSet = 16.50 ELSE self.ysizeSet = 6.5
+         self.defaultsSet = 'Square (Landscape)'
+      ENDCASE
+
+   'Figure (Small)': BEGIN
+         self.bitsSet = '8'
+         self.colorSet = 1
+         self.directorySet = directoryName
+         self.encapsulationSet = 1
+         self.filenameSet = defaultFilename + ".eps"
+         self.fonttypeSet = !P.Font
+         self.fontsizeSet = 12
+         self.fontstyleSet = Replicate(0, 8)
+         self.fontnameSet = "Helvetica"
+         self.inchesSet = units
+         self.landscapeSet = 0
+         self.isolatinSet = 0
+         self.pagetypeSet = pagetype
+         self.pagetype = pagetype
+         self.previewSet = 2
+         self.truetypeSet = 0
+         IF self.european THEN self.xoffsetSet = 6.06 ELSE self.xoffsetSet = 2.5
+         IF self.european THEN self.yoffsetSet = 11.71 ELSE self.yoffsetSet = 4.25
+         IF self.european THEN self.xsizeSet = 8.89 ELSE self.xsizeSet = 3.5
+         IF self.european THEN self.ysizeSet = 6.35 ELSE self.ysizeSet = 2.5
+         self.defaultsSet = 'Figure (Small)'
+      ENDCASE
+
+   'Figure (Large)': BEGIN
+         self.bitsSet = '8'
+         self.colorSet = 1
+         self.directorySet = directoryName
+         self.encapsulationSet = 1
+         self.filenameSet = defaultFilename + ".eps"
+         self.fonttypeSet = 0
+         self.fontsizeSet = 12
+         self.fontstyleSet = Replicate(0, 8)
+         self.fontnameSet = "Helvetica"
+         self.inchesSet = units
+         self.landscapeSet = 0
+         self.isolatinSet = 0
+         self.pagetypeSet = pagetype
+         self.pagetype = pagetype
+         self.previewSet = 2
+         self.truetypeSet = 0
+         IF self.european THEN self.xoffsetSet = 4.16 ELSE self.xoffsetSet = 1.75
+         IF self.european THEN self.yoffsetSet = 9.8 ELSE self.yoffsetSet = 3.5
+         IF self.european THEN self.xsizeSet = 12.70 ELSE self.xsizeSet = 5.0
+         IF self.european THEN self.ysizeSet = 10.16 ELSE self.ysizeSet = 4.0
+         self.defaultsSet = 'Figure (Large)'
+      ENDCASE
+
+   'Color (Portrait)': BEGIN
+         self.bitsSet = '8'
+         self.colorSet = 1
+         self.directorySet = directoryName
+         self.encapsulationSet = 0
+         self.filenameSet = defaultFilename + ".ps"
+         self.fonttypeSet = !P.Font
+         self.fontsizeSet = 12
+         self.fontstyleSet = Replicate(0, 8)
+         self.fontnameSet = "Helvetica"
+         self.inchesSet = units
+         self.landscapeSet = 0
+         self.isolatinSet = 0
+         self.pagetypeSet = pagetype
+         self.pagetype = pagetype
+         self.previewSet = 0
+         self.truetypeSet = 0
+         IF self.european THEN self.xoffsetSet = 3.51 ELSE self.xoffsetSet = 1.5
+         IF self.european THEN self.yoffsetSet = 3.68 ELSE self.yoffsetSet = 1.5
+         IF self.european THEN self.xsizeSet = 14.00 ELSE self.xsizeSet = 5.5
+         IF self.european THEN self.ysizeSet = 22.40 ELSE self.ysizeSet = 8.0
+         self.defaultsSet = 'Color (Portrait)'
+      ENDCASE
+
+   'Color (Landscape)': BEGIN
+         self.bitsSet = '8'
+         self.colorSet = 1
+         self.directorySet = directoryName
+         self.encapsulationSet = 0
+         self.filenameSet = defaultFilename + ".ps"
+         self.fonttypeSet = !P.Font
+         self.fontsizeSet = 12
+         self.fontstyleSet = Replicate(0, 8)
+         self.fontnameSet = "Helvetica"
+         self.inchesSet = units
+         self.landscapeSet = 1
+         self.isolatinSet = 0
+         self.pagetypeSet = pagetype
+         self.pagetype = pagetype
+         self.previewSet = 0
+         self.truetypeSet = 0
+         IF self.european THEN self.xoffsetSet = 3.66 ELSE self.xoffsetSet = 1.5
+         IF self.european THEN self.yoffsetSet = 3.52 ELSE self.yoffsetSet = 1.5
+         IF self.european THEN self.xsizeSet = 22.43 ELSE self.xsizeSet = 8.0
+         IF self.european THEN self.ysizeSet = 13.97 ELSE self.ysizeSet = 5.5
+         self.defaultsSet = 'Color (Landscape)'
+      ENDCASE
+
+   ELSE: self.defaultsSet = 'None'
+ENDCASE
+
+
+IF Obj_Valid(self.plotID) THEN BEGIN
+   IF self.inchesSet THEN plotUnits = 'INCHES' ELSE plotUnits = 'CENTIMETERS'
+   self.plotID->SetUnits, plotUnits
+ENDIF
+
+   ; If the font information is on the display, update it.
+
+IF self.fontInfo THEN BEGIN
+
+   IF self.fontTypeSet EQ -1 THEN BEGIN
+      Widget_Control, self.fontnameID->GetID(), Sensitive=0
+      Widget_Control, self.stylebaseID, Sensitive=0
+      Widget_Control, self.clearbuttonID, Sensitive=0
+      Widget_Control, self.fontSizeID->GetID(), Sensitive=0
+      Widget_Control, self.truetypeID->GetID(), Sensitive=0
+      Widget_Control, self.isolatinID->GetID(), Sensitive=0
+      IF Obj_Valid(self.set_fontID) THEN Widget_Control, self.set_fontID->GetID(), Sensitive=0
+   ENDIF ELSE BEGIN
+      Widget_Control, self.fontnameID->GetID(), Sensitive=1
+      Widget_Control, self.stylebaseID, Sensitive=1
+      Widget_Control, self.clearbuttonID, Sensitive=1
+      Widget_Control, self.fontSizeID->GetID(), Sensitive=1
+      Widget_Control, self.truetypeID->GetID(), Sensitive=1
+      Widget_Control, self.isolatinID->GetID(), Sensitive=1
+      IF Obj_Valid(self.set_fontID) THEN Widget_Control, self.set_fontID->GetID(), Sensitive=1
+
+ENDELSE
+
+ENDIF
+
+   ; Update the display.
+
+self->UpDateDisplay
+
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::StatusLight, safe
+
+; This method sets the status light (the background color of the
+; page window). Safe equal 1 means the current configuration is saved.
+; Safe equal 0 means the current configuration is not saved. The
+; REVERT button is turned on or off to reflect the current SAFE state.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+safe = Keyword_Set(safe)
+
+   ; Different colors based on depth of visual class.
+
+Device, Get_Visual_Depth=theDepth
+IF safe THEN BEGIN
+   IF theDepth GT 8 THEN windowColor = [60, 140, 140] ELSE windowColor = [80, 80, 80]
+   Widget_Control, self.revertID, Sensitive=0
+ENDIF ELSE BEGIN
+   IF theDepth GT 8 THEN windowColor = [200, 133, 133] ELSE windowColor = [140, 140, 140]
+      Widget_Control, self.revertID, Sensitive=1
+ENDELSE
+
+   ; Update the background window color. Done only in NOBLOCK conditions.
+
+IF self.noblock THEN self.plotID->SetWindowColor, windowColor
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::StyleButtons, event
+
+; This event handler method responds to changes in the font style buttons.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+index = Where(self.fontStyleButtonID EQ event.id)
+index = index[0]
+self.fontStyleSet[index] = event.select
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::Units, event
+
+; This event handler method responds to changes in the Units droplist.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+units = self.unitsID->GetSelection()
+self.plotID->SetUnits, units
+self.plotID->GetWindowLocation, xsize, ysize, xoffset, yoffset
+self->UpdateSizes, xsize, ysize, xoffset, yoffset
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::UpdateDisplay
+
+; This method updates the GUI display with the current object settings.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+   ; Can only update if widget is valid and realized.
+
+IF Widget_Info(self.tlb, /Valid_ID) EQ 0 THEN RETURN
+IF Widget_Info(self.tlb, /Realized) EQ 0 THEN RETURN
+
+   ; Set the normal GUI widgets.
+
+self.bitsID->SetSelection, self.bitsSet
+self.cmykID->SetIndex, self.cmykSet
+self.colorID->SetIndex, self.colorSet
+self.filenameID->SetProperty, Directory=self.directorySet, Filename=self.filenameSet
+self.encapsulationID->SetIndex, self.encapsulationSet
+self.unitsID->SetIndex, self.inchesSet
+self.orientationID->SetIndex, self.landscapeSet
+self.pagetypeID->SetSelection, self.pagetypeSet
+self.previewID->SetIndex, self.previewSet
+self.xsizeID->Set_Value, self.xsizeSet
+self.ysizeID->Set_Value, self.ysizeSet
+self.xoffsetID->Set_Value, self.xoffsetSet
+self.yoffsetID->Set_Value, self.yoffsetSet
+self.defaultsID->SetSelection, self.defaultsSet
+
+   ; If font information is on the display, set that too.
+
+IF self.fontInfo THEN BEGIN
+   self.fontTypeID->SetIndex, (0 > (self.fonttypeSet + 1) < 2)
+   self.fontsizeID->SetSelection, StrTrim(self.fontsizeSet,2)
+   self.isolatinID->SetIndex, self.isolatinSet
+   self->UpDateFontStyle
+   self.fontnameID->SetSelection, self.fontnameSet
+   IF Obj_Valid(self.set_fontID) THEN self.set_fontID->Set_Value, self.set_fontSet
+   self.truetypeID->SetIndex, self.truetypeSet
+ENDIF
+
+   ; Update the plot window and set the size and offset widgets.
+
+self.plotID->SetPageSize, self.pagetypeSet, Landscape=self.landscapeSet, TLB=self.tlb
+self.plotID->SetWindowLocation, self.xsizeSet, self.ysizeSet, self.xoffsetSet, self.yoffsetSet
+self.plotID->GetWindowLocation, xsize, ysize, xoffset, yoffset
+self.xsizeID->Set_Value, xsize
+self.ysizeID->Set_Value, ysize
+self.xoffsetID->Set_Value, xoffset
+self.yoffsetID->Set_Value, yoffset
+self.plotID->SetColor, self.colorSet
+
+IF self.encapsulationSet THEN self.previewID->Sensitive, 1 ELSE self.previewID->Sensitive, 0
+
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::UpdateFontStyle, Clear = Clear
+
+; This method updates the font style box. If the CLEAR keyword
+; is set, all the widgets are turned OFF.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+IF Keyword_Set(clear) THEN BEGIN
+   FOR j=0,7 DO BEGIN
+      Widget_Control, self.fontstyleButtonID[j], Set_Button=0
+      self.fontStyleSet[j] = 0
+   ENDFOR
+ENDIF ELSE BEGIN
+   FOR j=0,7 DO Widget_Control, self.fontstyleButtonID[j], Set_Button=self.fontStyleSet[j]
+ENDELSE
+
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::UpdateSizes, xsize, ysize, xoffset, yoffset
+
+; This method updates the size and offset widgets.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+self.xsizeID->Set_Value, xsize
+self.ysizeID->Set_Value, ysize
+self.xoffsetID->Set_Value, xoffset
+self.yoffsetID->Set_Value, yoffset
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::WindowSize, event
+
+; This is the event handler method that responds to events
+; in the XSize, YSize, XOffset, and YOffset text widgets.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=self.debug)
+   RETURN
+ENDIF
+
+   ; Get the values in the appropriate widgets.
+
+IF N_Elements(self.xsizeID->Get_Value()) EQ 0 THEN BEGIN
+   IF self.inchesSet THEN xsize = 1.0 ELSE xsize = 2.54
+ENDIF ELSE xsize = self.xsizeID->Get_Value()
+IF N_Elements(self.ysizeID->Get_Value()) EQ 0 THEN BEGIN
+   IF self.inchesSet THEN ysize = 1.0 ELSE ysize = 2.54
+ENDIF ELSE ysize = self.ysizeID->Get_Value()
+IF N_Elements(self.xoffsetID->Get_Value()) EQ 0 THEN xoffset = 0.0 $
+   ELSE xoffset = self.xoffsetID->Get_Value()
+IF N_Elements(self.yoffsetID->Get_Value()) EQ 0 THEN yoffset = 0.0 $
+   ELSE yoffset = self.yoffsetID->Get_Value()
+
+   ; Change the plot window to these sizes and offsets.
+
+self.plotID->SetWindowLocation, xsize, ysize, xoffset, yoffset
+
+   ; The input values may be bogus. Get the "real" values from the
+   ; plot object and update the size and offset widgets.
+
+self.plotID->GetWindowLocation, xsize, ysize, xoffset, yoffset
+self.xsizeID->Set_Value, xsize
+self.ysizeID->Set_Value, ysize
+self.xoffsetID->Set_Value, xoffset
+self.yoffsetID->Set_Value, yoffset
+END ;--------------------------------------------------------------------------------
+
+
+
+
+PRO FSC_PSCONFIG::SetProperty,        $ ; The SetProperty method of the object.
+   AvantGarde=avantgarde,             $ ; Set this keyword to select the AvantGarde font.
+   Bits_per_Pixel=bits_per_pixel,     $ ; The number of image bits saved for each image pixel: 2, 4, or 8.
+   Bold=bold,                         $ ; Set this keyword to select the Bold font style.
+   BookStyle=book,                    $ ; Set this keyword to select the Book font style.
+   Bkman=bookman,                     $ ; Set this keyword to select the Bookman font.
+   CMYK=cmyk,                         $ ; Set this keywprd to use CMYK colors instead of RGB.
+   Color=color,                       $ ; Set this keyword to select Color PostScript output.
+   Courier=courier,                   $ ; Set this keyword to select the Courier font.
+   DefaultSetup=defaultsetup,         $ ; Set this keyword to the "name" of a default style.
+   Demi=demi,                         $ ; Set this keyword to select the Demi font style.
+   Directory=directory,               $ ; Set thie keyword to the name of the starting directory. Current directory by default.
+   Encapsulated=encapsulated,         $ ; Set this keyword to select Encapsulated PostScript output.
+   European=european,                 $ ; Set this keyword to indicate "european" mode (i.e., A4 page and centimeter units).
+   Filename=filename,                 $ ; Set this keyword to the name of the file. Default: 'idl.ps'
+   FontSize=fontsize,                 $ ; Set this keyword to the font size. Between 6 and 36. Default is 12.
+   FontType=fonttype,                 $ ; Set this keyword to select the font type: -1 is Hershey, 0 is hardward, 1 is true-type.
+   Helvetica=helvetica,               $ ; Set this keyword to select the Helvetica font.
+   Inches=inches,                     $ ; Set this keyword to indicate sizes and offsets are in inches as opposed to centimeters.
+   Italic=italic,                     $ ; Set this keyword to select the Italic font style.
+   Isolatin=isolatin,                 $ ; Set this keyword to select ISOlatin1 encoding.
+   Landscape=landscape,               $ ; Set this keyword to select Landscape output.
+   Light=light,                       $ ; Set this keyword to select the Light font style.
+   Medium=medium,                     $ ; Set this keyword to select the Medium font style.
+   Name=name,                         $ ; This is the "name" of the object.
+   Narrow=narrow,                     $ ; Set this keyword to select the Narrow font style.
+   Oblique=oblique, $                 $ ; Set this keyword to select the Oblique font style.
+   PageType=pagetype,                 $ ; Set this keyword to the "type" of page: 'Letter', 'Legal', 'Ledger', or 'A4'.
+   Palatino=palatino,                 $ ; Set this keyword to select the Palatino font.
+   Preview=preview,                   $ ; Set this keyword to select Preview mode: 0, 1, or 2.
+   Schoolbook=schoolbook,             $ ; Set this keyword to select the Schoolbook font.
+   Set_Font=set_font,                 $ ; Set this keyword to the name of a font passed to PostScript with Set_Plot keyword.
+   Symbol=symbol,                     $ ; Set this keyword to select the Symbol font.
+   Times=times,                       $ ; Set this keyword to select the Times font.
+   TrueType=truetype,                 $ ; Set this keyword to select True-Type fonts.
+   UpDate=update, $                   $ ; Set this keyword to update the GUI if it is on the display.
+   XOffset=xoffset,                   $ ; Set this keyword to the XOffset. (Note: offset calculated from lower-left corner of page.)
+   XSize=xsize,                       $ ; Set this keyword to the X size of the PostScript "window".
+   YOffset=yoffset,                   $ ; Set this keyword to the YOffset. (Note: offset calculated from lower-left corner of page.)
+   YSize=ysize,                       $ ; Set this keyword to the Y size of the PostScript "window".
+   ZapfChancery=zapfchancery,         $ ; Set this keyword to select the ZapfChancery font.
+   ZapfDingbats=zapfdingbats            ; Set this keyword to select the ZapfDingbats font.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=Keyword_Set(self.debug))
+   RETURN
+ENDIF
+
+   ; Check for undefined variables.
+
+IF N_Elements(bits_per_pixel) NE 0 THEN BEGIN
+   IF bits_per_pixel EQ 2 OR bits_per_pixel EQ 4 OR bits_per_pixel EQ 8 THEN $
+      self.bitsSet = StrTrim(bits_per_pixel,2) ELSE self.bitsSet = '8'
+ENDIF
+IF N_Elements(color) NE 0 THEN self.colorSet = color
+IF N_Elements(directory) NE 0 THEN self.directorySet = directory
+IF N_Elements(filename) NE 0 THEN self.filenameSet = filename
+self.fullfilenameSet = self->Construct_Full_Filename()
+IF N_Elements(fontsize) NE 0 THEN self.fontsizeSet = fontsize
+IF N_Elements(fonttype) NE 0 THEN self.fonttypeSet = fonttype
+IF N_Elements(encapsulated) NE 0 THEN self.encapsulationSet = encapsulated
+IF Keyword_Set(inches) NE 0 THEN self.inchesSet = inches
+IF N_Elements(landscape) NE 0 THEN self.landscape = landscape
+IF Keyword_Set(name) NE 0 THEN self.name = name
+IF N_Elements(pagetype) NE 0 THEN BEGIN
+   self.pagetypeSet = pagetype
+   self.pagetype = pagetype
+ENDIF
+IF N_Elements(preview) NE 0 THEN self.previewSet = 0 > preview < 2
+
+IF N_Elements(set_font) NE 0 THEN self.set_fontSet = set_font
+IF N_Elements(xsize) NE 0 THEN self.xsizeSet = xsize
+IF N_Elements(ysize) NE 0 THEN self.ysizeSet = ysize
+
+   ; Offsets are weird.
+
+dims = self->PageDimensions()
+IF N_Elements(xoffset) NE 0 THEN IF self.landscape THEN self.xoffsetSet = dims[1] - yoffset ELSE self.xoffsetSet = xoffset
+IF N_Elements(yoffset) NE 0 THEN IF self.landscape THEN self.yoffsetSet = xoffset ELSE self.yoffsetSet = yoffset
+
+
+avantgarde = Keyword_Set(avantgarde)
+bold = Keyword_Set(bold)
+book = Keyword_Set(book)
+bookman = Keyword_Set(bookman)
+cmyk = Keyword_Set(cmyk)
+courier = Keyword_Set(courier)
+demi = Keyword_Set(demi)
+encapsulated = Keyword_Set(encapsulated)
+european = Keyword_Set(european)
+helvetica = Keyword_Set(helvetica)
+isolatin = Keyword_Set(isolatin)
+italic = Keyword_Set(italic)
+landscape = Keyword_Set(landscape)
+light = Keyword_Set(light)
+medium = Keyword_Set(medium)
+narrow = Keyword_Set(narrow)
+oblique = Keyword_Set(oblique)
+palatino = Keyword_Set(palatino)
+schoolbook = Keyword_Set(schoolbook)
+symbol = Keyword_Set(symbol)
+times = Keyword_Set(times)
+truetype = Keyword_Set(truetype)
+zapfchancery = Keyword_Set(zapfchancery)
+zapfdingbats = Keyword_Set(zapfdingbats)
+
+fontset = [avantgarde, bookman, courier, helvetica, palatino, schoolbook, symbol, times, zapfchancery, zapfdingbats]
+index = Where(fontset EQ 1, count)
+IF count EQ 0 THEN self.fontnameSet = 'Helvetica' ELSE self.fontnameSet = (*self.fontnames)[index[0]]
+IF self.fontnameSet EQ 'AvantGarde' THEN self.avantgarde = 1 ELSE self.avantgarde = 0
+IF self.fontnameSet EQ 'Bookman' THEN self.bookman = 1 ELSE self.bookman = 0
+IF self.fontnameSet EQ 'Courier' THEN self.courier = 1 ELSE self.courier = 0
+IF self.fontnameSet EQ 'Helvetica' THEN self.helvetica = 1 ELSE self.helvetica = 0
+IF self.fontnameSet EQ 'Palatino' THEN self.palatino = 1 ELSE self.palatino = 0
+IF self.fontnameSet EQ 'Schoolbook' THEN self.schoolbook = 1 ELSE self.schoolbook = 0
+IF self.fontnameSet EQ 'Symbol' THEN self.symbol = 1 ELSE self.symbol = 0
+IF self.fontnameSet EQ 'Times' THEN self.times = 1 ELSE self.times = 0
+IF self.fontnameSet EQ 'ZapfChancery' THEN self.zapfchancery = 1 ELSE self.zapfchancery = 0
+IF self.fontnameSet EQ 'ZapfDingbats' THEN self.zapfdingbats = 1 ELSE self.zapfdingbats = 0
+self.fontstyleSet = [bold, book, demi, italic, light, medium, narrow, oblique]
+
+   ; Populate the self object by saving the configuration.
+
+self->SaveConfiguration
+
+   ; Update the display if required.
+
+IF Keyword_Set(update) THEN self->UpdateDisplay
+
+END ;--------------------------------------------------------------------------------
+
+
+
+PRO FSC_PSCONFIG::CLEANUP
+Ptr_Free, self.fontnames
+END ;--------------------------------------------------------------------------------
+
+
+
+FUNCTION FSC_PSCONFIG::INIT,          $ ; The INIT method of the FSC_PSCONFIG object.
+   AvantGarde=avantgarde,             $ ; Set this keyword to select the AvantGarde font.
+   Bits_per_Pixel=bits_per_pixel,     $ ; The number of image bits saved for each image pixel: 2, 4, or 8.
+   Bold=bold,                         $ ; Set this keyword to select the Bold font style.
+   BookStyle=book,                    $ ; Set this keyword to select the Book font style.
+   Bkman=bookman,                     $ ; Set this keyword to select the Bookman font.
+   CMYK=cmyk,                         $ ; Set this keywprd to use CMYK colors instead of RGB.
+   Color=color,                       $ ; Set this keyword to select Color PostScript output.
+   Courier=courier,                   $ ; Set this keyword to select the Courier font.
+   Debug=debug,                       $ ; Set this keyword to get traceback information when errors are encountered.
+   DefaultSetup=defaultsetup,         $ ; Set this keyword to the "name" of a default style.
+   Demi=demi,                         $ ; Set this keyword to select the Demi font style.
+   Directory=directory,               $ ; Set thie keyword to the name of the starting directory. Current directory by default.
+   Encapsulated=encapsulated,         $ ; Set this keyword to select Encapsulated PostScript output.
+   European=european,                 $ ; Set this keyword to indicate "european" mode (i.e., A4 page and centimeter units).
+   Filename=filename,                 $ ; Set this keyword to the name of the file. Default: 'idl.ps'
+   FontSize=fontsize,                 $ ; Set this keyword to the font size. Between 6 and 36. Default is 12.
+   FontType=fonttype,                 $ ; Set this keyword to select the font type: -1 is Hershey, 0 is hardward, 1 is true-type.
+   Helvetica=helvetica,               $ ; Set this keyword to select the Helvetica font.
+   Inches=inches,                     $ ; Set this keyword to indicate sizes and offsets are in inches as opposed to centimeters.
+   Italic=italic,                     $ ; Set this keyword to select the Italic font style.
+   Isolatin=isolatin,                 $ ; Set this keyword to select ISOlatin1 encoding.
+   Landscape=landscape,               $ ; Set this keyword to select Landscape output.
+   Light=light,                       $ ; Set this keyword to select the Light font style.
+   Medium=medium,                     $ ; Set this keyword to select the Medium font style.
+   Name=name,                         $ ; The "name" of the object. Objects with different names can have their
+                                        ; graphical user interfaces appear simultaneously on the display.
+   Narrow=narrow,                     $ ; Set this keyword to select the Narrow font style.
+   Oblique=oblique, $                 $ ; Set this keyword to select the Oblique font style.
+   PageType=pagetype,                 $ ; Set this keyword to the "type" of page: 'Letter', 'Legal', 'Ledger', or 'A4'.
+   Palatino=palatino,                 $ ; Set this keyword to select the Palatino font.
+   Preview=preview,                   $ ; Set this keyword to select Preview mode: 0, 1, or 2.
+   Schoolbook=schoolbook,             $ ; Set this keyword to select the Schoolbook font.
+   Set_Font=set_font,                 $ ; Set this keyword to the name of a font passed to PostScript with Set_Plot keyword.
+   Symbol=symbol,                     $ ; Set this keyword to select the Symbol font.
+   Times=times,                       $ ; Set this keyword to select the Times font.
+   TrueType=truetype,                 $ ; Set this keyword to select True-Type fonts.
+   XOffset=xoffset,                   $ ; Set this keyword to the XOffset. (Note: offset calculated from lower-left corner of page.)
+   XSize=xsize,                       $ ; Set this keyword to the X size of the PostScript "window".
+   YOffset=yoffset,                   $ ; Set this keyword to the YOffset. (Note: offset calculated from lower-left corner of page.)
+   YSize=ysize,                       $ ; Set this keyword to the Y size of the PostScript "window".
+   ZapfChancery=zapfchancery,         $ ; Set this keyword to select the ZapfChancery font.
+   ZapfDingbats=zapfdingbats            ; Set this keyword to select the ZapfDingbats font.
+
+   ; Error handling.
+
+Catch, theError
+IF theError NE 0 THEN BEGIN
+   Catch, /Cancel
+   ok = FSC_PSConfig_Error_Message(Traceback=Keyword_Set(debug))
+   RETURN, 1
+ENDIF
+
+self.debug = Keyword_Set(debug)
+
+
+   ; Set the available PostScript fonts.
+
+availableFonts = [                      $
+        'AvantGarde',                   $
+        'Bookman',                      $
+        'Courier',                      $
+        'Helvetica',                    $
+        'Palatino',                     $
+        'Schoolbook',                   $
+        'Symbol',                       $
+        'Times',                        $
+        'ZapfChancery',                 $
+        'ZapfDingbats']
+
+self.fontnames = Ptr_New(availableFonts)
+
+   ; Default font and font type.
+
+fontname = "Helvetica"
+IF N_Elements(fonttype) EQ 0 THEN fonttype = !P.Font
+IF N_Elements(filename) NE 0 THEN self.filenameSet = filename
+
+   ; European style
+self.european = Keyword_Set(european)
+
+   ; Set default values if a default setup was not asked for.
+
+IF N_Elements(defaultsetup) EQ 0 THEN BEGIN
+
+   self.defaultsSet = 'None'
+   IF N_Elements(bits_per_pixel) EQ 0 THEN bits_per_pixel = 8
+   IF N_Elements(bits_per_pixel) NE 0 THEN BEGIN
+   IF bits_per_pixel EQ 2 OR bits_per_pixel EQ 4 OR bits_per_pixel EQ 8 THEN $
+      self.bitsSet = StrTrim(bits_per_pixel,2) ELSE self.bitsSet = '8'
+ENDIF
+   IF N_Elements(color) EQ 0 THEN color = 1 ELSE color = 0 > color < color
+   IF N_Elements(directory) EQ 0 THEN CD, Current=directory
+   IF N_Elements(filename) EQ 0 THEN filename = "idl.ps"
+   IF N_Elements(fontsize) EQ 0 THEN fontsize = 12
+   IF Keyword_Set(inches) EQ 0 THEN IF Keyword_Set(european) THEN inches = 0 ELSE inches = 1
+   IF N_Elements(name) EQ 0 THEN name = ""
+   IF N_Elements(pagetype) EQ 0 THEN IF Keyword_Set(european) THEN pagetype = "A4" ELSE pagetype = "LETTER"
+   IF N_Elements(preview) EQ 0 THEN preview = 0
+   IF N_Elements(set_font) EQ 0 THEN set_font = ""
+   IF N_Elements(xoffset) EQ 0 THEN IF inches THEN xoffset = 1.75 ELSE xoffset = 1.75 * 2.54
+   IF N_Elements(xsize) EQ 0 THEN IF inches THEN xsize = 5 ELSE xsize = 5.0 * 2.54
+   IF N_Elements(yoffset) EQ 0 THEN IF inches THEN yoffset = 3.5 ELSE yoffset = 3.5 * 2.54
+   IF N_Elements(ysize) EQ 0 THEN IF inches THEN ysize = 4 ELSE ysize = 4.0 * 2.54
+
+   avantgarde = Keyword_Set(avantgarde)
+   bold = Keyword_Set(bold)
+   book = Keyword_Set(book)
+   bookman = Keyword_Set(bookman)
+   cmyk = Keyword_Set(cmyk)
+   courier = Keyword_Set(courier)
+   demi = Keyword_Set(demi)
+   encapsulated = Keyword_Set(encapsulated)
+   european = Keyword_Set(european)
+   helvetica = Keyword_Set(helvetica)
+   isolatin = Keyword_Set(isolatin)
+   italic = Keyword_Set(italic)
+   landscape = Keyword_Set(landscape)
+   light = Keyword_Set(light)
+   medium = Keyword_Set(medium)
+   narrow = Keyword_Set(narrow)
+   oblique = Keyword_Set(oblique)
+   palatino = Keyword_Set(palatino)
+   schoolbook = Keyword_Set(schoolbook)
+   symbol = Keyword_Set(symbol)
+   times = Keyword_Set(times)
+   truetype = Keyword_Set(truetype)
+   zapfchancery = Keyword_Set(zapfchancery)
+   zapfdingbats = Keyword_Set(zapfdingbats)
+
+   fontset = [avantgarde, bookman, courier, helvetica, palatino, schoolbook, symbol, times, zapfchancery, zapfdingbats]
+   index = Where(fontset EQ 1, count)
+   IF count EQ 0 THEN self.fontnameSet = 'Helvetica' ELSE self.fontnameSet = (*self.fontnames)[index[0]]
+   IF self.fontnameSet EQ 'AvantGarde' THEN self.avantgarde = 1 ELSE self.avantgarde = 0
+   IF self.fontnameSet EQ 'Bookman' THEN self.bookman = 1 ELSE self.bookman = 0
+   IF self.fontnameSet EQ 'Courier' THEN self.courier = 1 ELSE self.courier = 0
+   IF self.fontnameSet EQ 'Helvetica' THEN self.helvetica = 1 ELSE self.helvetica = 0
+   IF self.fontnameSet EQ 'Palatino' THEN self.palatino = 1 ELSE self.palatino = 0
+   IF self.fontnameSet EQ 'Schoolbook' THEN self.schoolbook = 1 ELSE self.schoolbook = 0
+   IF self.fontnameSet EQ 'Symbol' THEN self.symbol = 1 ELSE self.symbol = 0
+   IF self.fontnameSet EQ 'Times' THEN self.times = 1 ELSE self.times = 0
+   IF self.fontnameSet EQ 'ZapfChancery' THEN self.zapfchancery = 1 ELSE self.zapfchancery = 0
+   IF self.fontnameSet EQ 'ZapfDingbats' THEN self.zapfdingbats = 1 ELSE self.zapfdingbats = 0
+
+   self.bitsSet = StrTrim(bits_per_pixel, 2)
+   self.cmykSet = cmyk
+   self.colorSet = color
+   self.directorySet = directory
+   self.european = european
+   self.encapsulationSet = encapsulated
+   self.filenameSet = filename
+   self.fonttypeSet = -1 > fonttype < 1
+   self.fontsizeSet = Strtrim( 6 > Fix(fontsize) < 36, 2)
+   self.fontstyleSet = [bold, book, demi, italic, light, medium, narrow, oblique]
+   self.inchesSet = inches
+   self.isolatinSet = isolatin
+   self.landscapeSet = landscape
+   self.name = name
+   self.pagetype = pagetype
+   self.pagetypeSet = pagetype
+   self.previewSet = preview
+   self.truetypeSet = truetype
+   self.set_fontSet = set_font
+
+   ; Offsets are harder to set because I am trying to shield the
+   ; user from PostScript weirdness.
+
+   IF landscape THEN BEGIN
+      dims = self->PageDimensions()
+      self.xoffsetSet = dims[1] - yoffset
+      self.xsizeSet = xsize
+      self.yoffsetSet = xoffset
+      self.ysizeSet = ysize
+   ENDIF ELSE BEGIN
+      self.xoffsetSet = xoffset
+      self.xsizeSet = xsize
+      self.yoffsetSet = yoffset
+      self.ysizeSet = ysize
+   ENDELSE
+
+   ; Get the correct directory separator.
+
+CASE StrUpCase(!Version.OS_Family) OF
+   'WINDOWS' : sep = '\'    ; PCs
+   'MACOS'   : sep = ':'    ; Macintoshes
+   'VMS'     : sep = ']'    ; VMS machines
+   ELSE      : sep = '/'    ; Unix machines
+ENDCASE
+
+index = FSC_PSCONFIG_RStrPos(directory, sep)
+IF index EQ - 1 THEN BEGIN
+   self.fullFilenameSet = directory + sep + filename
+ENDIF ELSE BEGIN
+   IF index EQ (StrLen(directory) - 1) THEN self.fullFilenameSet = directory + filename ELSE $
+       self.fullFilenameSet = directory + sep + filename
+ENDELSE
+
+ENDIF ELSE self->SetDefault, defaultsetup
+
+   ; Save this configuration.
+
+self->SaveConfiguration
+
+RETURN, 1
+END ;--------------------------------------------------------------------------------
+
+
+PRO FSC_PSCONFIG__DEFINE
+
+   struct = { FSC_PSCONFIG,            $
+
+                  ; Font specifiers.
+
+              avantgarde: 0,           $
+              bkman: 0,                $
+              bookman: 0,              $
+              courier: 0,              $
+              helvetica: 0,            $
+              palatino: 0,             $
+              portrait: 0,             $
+              schoolbook: 0,           $
+              symbol: 0,               $
+              times: 0,                $
+              zapfchancery: 0,         $
+              zapfdingbats: 0,         $
+
+                  ; Widget identifiers.
+
+              clearbuttonID: 0L,            $ ; Clear Font Style settings button.
+              tlb: 0L,                      $ ; The top-level base of the GUI.
+              acceptID: 0L,                 $ ; The Accept or Apply button ID.
+              revertID: 0L,                 $ ; The Revert button ID.
+              pagetypeID: Obj_New(),        $ ; The pagetype droplist ID.
+              orientationID: Obj_New(),     $ ; The orientation droplist ID.
+              unitsID: Obj_New(),           $ ; The units droplist ID.
+              encapsulationID: Obj_New(),   $ ; The encapsulation droplist ID.
+              previewID: Obj_New(),         $ ; The preview droplist ID.
+              colorID: Obj_New(),           $ ; The color droplist ID.
+              cmykID: Obj_New(),            $ ; The cmyk droplist ID.
+              bitsID: Obj_New(),            $ ; The bits droplist ID.
+              defaultsID: Obj_New(),        $ ; The defaults droplist ID.
+              plotID: Obj_New(),            $ ; The plot window ID.
+              filenameID: Obj_New(),        $ ; The filename widget ID.
+              fontnameID: Obj_New(),        $ ; The font name droplist ID.
+              fontsizeID: Obj_New(),        $ ; The font size droplist ID.
+              fontstyleID: Obj_New(),       $ ; The font style droplist ID.
+              fontstyleButtonID: LonArr(8), $ ; The pagetype droplist ID.
+              fonttypeID: Obj_New(),        $ ; The font style button IDs.
+              isolatinID: Obj_New(),        $ ; The isolatin1 droplist ID.
+              set_fontID: Obj_New(),        $ ; The set font text widget ID.
+              stylebaseID: 0L,              $ ; The style base widget ID.
+              truetypeID: Obj_New(),        $ ; The true-type droplist ID.
+              xsizeID: Obj_New(),           $ ; The xsize field ID.
+              ysizeID: Obj_New(),           $ ; The ysize field  ID.
+              xoffsetID: Obj_New(),         $ ; The xoffset field  ID.
+              yoffsetID: Obj_New(),         $ ; The yoffset field ID.
+
+                  ; Data values and flags.
+
+               debug: 0,             $ ; Set if debugging in turned on.
+               fontInfo: 0,          $ ; Set if the user wants font information on GUI.
+               fontnames: Ptr_New(), $ ; The allowed font names.
+               european: 0,          $ ; Set if European units and page size are in effect.
+               pagetype: "",         $ ; The current page size or type.
+               name: "",             $ ; The "name" of the object.
+               noblock: 0,           $ ; A flag that tells whether the GUI is in NOBLOCK state.
+               cancel: 0,            $ ; A flag that tells the status of the Cancel button.
+               thisDevice: "",       $ ; The entry graphics device. Will be restored.
+
+                  ; GUI property identifiers.
+
+               bitsSet: "",             $ ; Sets the bits_per_pixel value.
+               cmykSet:0,               $ ; Sets the CMYK on/off value.
+               colorSet: 0,             $ ; Sets the color on/off value.
+               defaultsSet: "",         $ ; Sets the default setup value.
+               directorySet: "",        $ ; Sets the directory name value.
+               inchesSet: 0,            $ ; Sets the units value.
+               isolatinSet: 0,          $ ; Sets the isolatin1 value.
+               encapsulationSet: 0,     $ ; Sets the encapsulation value.
+               filenameSet: "",         $ ; Sets the file name value.
+               fullFilenameSet: "",     $ ; Sets the fully-qualified filename.
+               fontsizeSet: "",         $ ; Sets the font size value.
+               fontstyleSet: IntArr(8), $ ; Sets the font style values.
+               fontnameSet: "",         $ ; Sets the font name value.
+               fonttypeSet: 0,          $ ; Sets the font type value.
+               landscapeSet: 0,         $ ; Sets the orientation value.
+               pagetypeSet: "",         $ ; Sets the page type or size value.
+               previewSet: 0,           $ ; Sets the preview value.
+               set_fontSet: "",         $ ; Sets the Set_Font font name value.
+               truetypeSet: 0,          $ ; Sets the true-type font value.
+               xoffsetSet: 0.0,         $ ; Sets the xoffset value.
+               xsizeSet: 0.0,           $ ; Sets the xsize value.
+               yoffsetSet: 0.0,         $ ; Sets the yoffset value.
+               ysizeSet: 0.0,           $ ; Sets the ysize value.
+
+                  ; GUI revert property identifiers. Mirrors of GUI property identifiers above.
+
+               bitsRevert: "", $
+               cmykRevert:0, $
+               colorRevert: 0, $
+               defaultsRevert: "", $
+               directoryRevert: "", $
+               inchesRevert: 0, $
+               isolatinRevert: 0, $
+               encapsulationRevert: 0, $
+               filenameRevert: "", $
+               fontsizeRevert: "", $
+               fontstyleRevert: IntArr(8), $
+               fontnameRevert: "", $
+               fonttypeRevert: 0, $
+               landscapeRevert: 0, $
+               pagetypeRevert: "", $
+               previewRevert: 0, $
+               set_fontRevert: "", $
+               truetypeRevert: 0, $
+               xoffsetRevert: 0.0, $
+               xsizeRevert: 0.0, $
+               yoffsetRevert: 0.0, $
+               ysizeRevert: 0.0 $
+
+}
+
+END
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/ps_plotter.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/ps_plotter.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/ps_plotter.pro	(revision 207)
@@ -0,0 +1,60 @@
+PRO PS_Plotter, image, $
+   European=european, $   ; Set this keyword if you want European measurements.
+   Font=font, $           ; Set this keyword if you want font information.
+   Object=object          ; Output variable to return FSC_PSConfig object.
+
+   ; Get an image if one is not passed in.
+
+IF N_Elements(image) EQ 0 THEN BEGIN
+   image = BytArr(360, 360)
+   file = Filepath(SubDirectory=['examples', 'data'], 'worldelv.dat')
+   OpenR, lun, file, /Get_Lun
+   ReadU, lun, image
+   Free_Lun, lun
+ENDIF
+
+   ; Create the PostScript configuration object.
+
+object = Obj_New('FSC_PSConfig', European=Keyword_Set(european))
+
+   ; We want hardware fonts.
+
+thisFontType = !P.Font
+!P.Font = 1
+
+   ; Get user input to PostScript configuration.
+
+IF Keyword_Set(font) THEN object->GUI, /Font ELSE object->GUI
+
+   ; Configure the PostScript Device.
+
+thisDevice = !D.Name
+Set_Plot, 'PS'
+keywords = object->GetKeywords(FontType=fonttype)
+Device, _Extra=keywords
+
+   ; Draw the example plots.
+
+!P.Multi = [ 0, 1, 2]
+TVImage, image
+Plot, Histogram(image), Title='Example Histogram Plot', XTitle='Pixel Value', $
+   YTitle='Number of Pixels', XStyle=1, Max_Value=5000
+!P.Multi = 0
+
+   ; Clean up.
+
+Device, /Close_File
+Set_Plot, thisDevice
+!P.Font = thisfontType
+
+   ; Return the PS_Configuration object or destroy it.
+
+IF Arg_Present(object) EQ 0 THEN Obj_Destroy, object
+END ;--------------------------------------------------------------------------------
+
+
+
+
+
+
+
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/ps_start.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/ps_start.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/ps_start.pro	(revision 207)
@@ -0,0 +1,265 @@
+;+
+; NAME:
+;   PS_START/PS_END
+;
+; PURPOSE:
+;
+;    The purpose of PS_START and PS_END is to make it easy to set-up
+;    for and close a PostScript file. The programs work in close conjunction
+;    with PSCONFIG, another program from the Coyote Library.
+;
+;    If ImageMagick  (http://www.imagemagick.org/script/index.php) is installed 
+;    on your computer, you can easily convert PostScript output to JPEG, PNG, and TIFF
+;    image output. (See the keywords to PS_END.)
+;
+; AUTHOR:
+;
+;   FANNING SOFTWARE CONSULTING
+;   David Fanning, Ph.D.
+;   1645 Sheely Drive
+;   Fort Collins, CO 80526 USA
+;   Phone: 970-221-0438
+;   E-mail: davidf@dfanning.com
+;   Coyote's Guide to IDL Programming: http://www.dfanning.com/
+;
+; CATEGORY:
+;
+;       Graphics, File Output, PostScript
+;
+; CALLING SEQUENCE:
+;
+;       PS_START
+;       Various graphics commands here...
+;       PS_END
+;
+; KEYWORD PARAMETERS FOR PS_START:
+;
+;       GUI:          The default behavior is to use PSCONFIG to configure the
+;                     PostScript device silently. If you wish to allow the user
+;                     to interatively configure the PostScript device, set this
+;                     keyword.
+;
+;       SCALE_FACTOR: Set this to the PostScript scale factor. By default: 1.
+;
+;       Any keyword supported by PSCONFIG can be used to configure the PostScript device.
+;       Common keywords would include FILENAME, XSIZE, YSIZE, XOFFSET, YOFFSET, etc. See
+;       the PSCONFIG documentation for details.
+;
+; KEYWORD PARAMETERS FOR PS_END:
+;
+;      All keywords for PS_END require that ImageMagick is installed on your computer
+;      and is configured correctly. Image conversion is done by spawning a "convert" 
+;      command to ImageMagick.
+;
+;       JPEG:         Set this keyword to convert the PostScript output file to a JPEG image.
+;       PNG:          Set this keyword to convert the PostScript output file to a PNG image.
+;       TIFF:         Set this keyword to convert the PostScript output file to a TIFF image.
+;
+; COMMON BLOCKS:
+;
+;       _$FSC_PS_START_   Contains the PS_STRUCT structure for communication between
+;                         PS_START and PS_END.
+;
+; SIDE EFFECTS:
+;
+;       When PS_START is called, the current graphics device is set to "PS" (the PostScript 
+;       device). When PS_END is called the current graphics device is returned to the device
+;       in effect when PS_START was called.
+;
+; RESTRICTIONS:
+;
+;       Requires numerous programs from the Coyote Library. To convert PostScript files
+;       to PNG, JPEG, and TIFF files requires ImageMagick be installed on your
+;       computer and configured correctly. You can download Coyote Library programs here:
+;
+;             http://www.dfanning.com/programs/coyoteprograms.zip
+;
+;       ImageMagick can be found here:
+;
+;              http://www.imagemagick.org/script/index.php
+;
+; EXAMPLE:
+;
+;       To create a line plot in a PostScript file named lineplot.ps and
+;       also create a PNG file named lineplot.png for display in a browser,
+;       type these commands.
+;
+;       PS_Start, FILENAME='lineplot.ps'
+;       Plot, Findgen(11), COLOR=FSC_Color('navy'), /NODATA, XTITLE='Time', YTITLE='Signal'
+;       OPlot, Findgen(11), COLOR=FSC_Color('indian red')
+;       OPlot, Findgen(11), COLOR=FSC_Color('olive'), PSYM=2
+;       PS_End, /PNG
+;
+; NOTES:
+;
+;       You can easily configure any modifications you like for your PostScript output
+;       by setting fields in the plot and axis system variables (!P, !X, !Y, and !Z).
+;       The modifications currently made by default in this program are these:
+;
+;          !P.Charsize = 1.5
+;          !P.Thick = 2
+;          !X.Thick = 2
+;          !Y.Thick = 2
+;          !Z.Thick = 2
+;          !P.Symsize = 1.25
+;          !P.Font = 1
+;
+; MODIFICATION HISTORY:
+;
+;       Written by: David W. Fanning, 20 May 2008.
+;-
+;
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright 2008 Fanning Software Consulting.
+;
+; This software is provided "as-is", without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose, including commercial applications, and to alter it and
+; redistribute it freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product, an acknowledgment in the product documentation
+;    would be appreciated, but is not required.
+;
+; 2. Altered source versions must be plainly marked as such, and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software, visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+PRO FSC_PS_SETUP__DEFINE
+
+    struct = { FSC_PS_SETUP, $
+               currentDevice: "", $
+               setup: 0, $
+               convert: "", $
+               filename: "", $
+               p: !P, $
+               x: !X, $
+               y: !Y, $
+               z: !Z $
+              }
+            
+END ;---------------------------------------------------------------
+
+
+
+PRO PS_END, JPEG=jpeg, PNG=png, TIFF=tiff
+
+   COMMON _$FSC_PS_START_, ps_struct
+   
+   ON_ERROR, 2 ; Return to caller.
+   
+   ; Close the PostScript file, if this is PostScript device.
+   IF !D.Name EQ 'PS' THEN Device, /CLOSE_FILE
+   
+   ; Need to convert with ImageMagick?
+   IF Keyword_Set(png) THEN ps_struct.convert = 'PNG'
+   IF Keyword_Set(jpeg) THEN ps_struct.convert = 'JPEG'
+   IF Keyword_Set(tiff) THEN ps_struct.convert = 'TIFF'
+   IF ps_struct.convert NE "" THEN BEGIN
+
+        basename = FSC_Base_Filename(ps_struct.filename, DIRECTORY=theDir, EXTENSION=theExtension)
+        CASE 1 OF
+            ps_struct.convert EQ 'PNG':  outfilename = Filepath(ROOT_DIR=theDir, basename + '.png')
+            ps_struct.convert EQ 'JPEG': outfilename = Filepath(ROOT_DIR=theDir, basename + '.jpg')
+            ps_struct.convert EQ 'TIFF': outfilename = Filepath(ROOT_DIR=theDir, basename + '.tif')
+        ENDCASE
+        IF N_Elements(outfilename) NE "" THEN BEGIN
+;;; resize fait baisser la taille, density bcp moins
+;            cmd = 'convert +antialias -density 300 ' + ps_struct.filename + ' -resize 25% ' + outfilename
+;            cmd = 'convert -density 600 ' + ps_struct.filename + ' -resize 12% ' + outfilename
+cmd = 'ps2epsi '+ps_struct.filename+' 2> /dev/null ; gs -sDEVICE=png16m -dTextAlphaBits=4 -sOutputFile='+outfilename+' -dNOPAUSE -dBATCH -dEPSCrop -r500x500 '+basename+'.epsi > /dev/null 2> /dev/null'
+            SPAWN, cmd
+        ENDIF
+        
+   ENDIF
+   
+   ; Clean up.
+   Set_Plot, ps_struct.currentDevice
+   !P = ps_struct.p
+   !X = ps_struct.x
+   !Y = ps_struct.y
+   !Z = ps_struct.z
+   ps_struct.setup = 0
+   ps_struct.currentDevice = ""
+   ps_struct.filename = ""
+   ps_struct.convert = ""
+
+END ;---------------------------------------------------------------
+
+
+
+PRO PS_START, SCALE_FACTOR=scale_factor, GUI=gui, _EXTRA=extra
+
+   COMMON _$FSC_PS_START_, ps_struct
+   
+   ; Define the PS structure.
+   IF N_Elements(ps_struct) EQ 0 THEN ps_struct = {FSC_PS_SETUP}
+   
+   ; If the setup flag is on, then we have to close the previous
+   ; start command before we can continue.
+   IF ps_struct.setup EQ 1 THEN PS_END
+   
+   ; Save current setup information in the PS_STRUCT structure.
+   ps_struct.setup = 1
+   ps_struct.currentDevice = !D.Name
+   ps_struct.p = !P
+   ps_struct.x = !X
+   ps_struct.y = !Y
+   ps_struct.z = !Z
+   
+   ; Change any parameters you feel like changing.
+;;;;;;; AYMERIC
+;   !P.Charsize = 1.75
+;   !P.Thick = 2
+;   !X.Thick = 2
+;   !Y.Thick = 2
+   !Z.Thick = 2
+   !P.Symsize = 1.25
+   !P.Font = 1
+
+;;;;;;; AYMERIC
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+
+
+   Device, Set_Font='Helvetica', /TT_FONT
+
+   ; Configure the PostScript Device
+   cancelled = 0
+   sizes = PSWindow(_Extra=extra)
+   keywords = PSConfig(_Extra=extra, INCHES=sizes.inches, XSIZE=sizes.xsize, YSIZE=sizes.ysize, $
+      XOFFSET=sizes.xoffset, YOFFSET=sizes.yoffset, Cancel=cancelled, NOGUI=(1-Keyword_Set(gui)))
+   IF cancelled THEN BEGIN
+        PS_END
+        RETURN
+   ENDIF
+   Set_Plot, 'PS'
+   Device, _EXTRA=keywords
+   
+   ; What about scale factor?
+   IF N_Elements(scale_factor) NE 0 THEN $
+        DEVICE, SCALE_FACTOR=scale_factor ELSE $
+        DEVICE, SCALE_FACTOR=1
+   
+   ; Store filename.
+   ps_struct.filename = keywords.filename
+   
+END
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/psconfig.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/psconfig.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/psconfig.pro	(revision 207)
@@ -0,0 +1,303 @@
+;+
+; NAME:
+;   PSCONFIG
+;
+; PURPOSE:
+;
+;   This program is simply a function wrapper for the FSC_PSCONFIG
+;   object program (fsc_psconfig__define.pro). It was written so
+;   that it could serve as a drop-in replacement for the PS_FORM
+;   program it replaces. It calls the object program's graphical
+;   user interface as a modal widget and returns the DEVICE keywords
+;   collected from the form in a form that is appropriate for
+;   configuring the PostScript device.
+;
+;   It is now possible to call the program without a graphical user
+;   interface, thus getting the default keywords directly. This is
+;   appropriate for many applications. Use the NOGUI keyword when
+;   you call the program. For example, like this:
+;
+;       Set_Plot, 'PS'
+;       Device, _Extra=PSConfig(/NoGUI, Filename='myfilename.eps')
+;
+; AUTHOR:
+;
+;   FANNING SOFTWARE CONSULTING
+;   David Fanning, Ph.D.
+;   1645 Sheely Drive
+;   Fort Collins, CO 80526 USA
+;   Phone: 970-221-0438
+;   E-mail: davidf@dfanning.com
+;   Coyote's Guide to IDL Programming: http://www.dfanning.com/
+;
+; CALLING SEQUENCE:
+;
+;   psKeywords = PSConfig()
+;
+; CATEGORY:
+;
+;   Configuring PostScript output.
+;
+; DOCUMENTATION:
+;
+;   Complete documentation for the FSC_PSCONFIG object, including
+;   keyword and method descriptions, and example programs using the object
+;   can be found on the Coyote's Guide to IDL Programming web page:
+;
+;     http://www.dfanning.com/programs/docs/fsc_psconfig.html
+;
+; INPUT:
+;
+;    psConfigObject -- An optional FSC_PSCONFIG object reference can be
+;       passed as an argument to the function. The object is not destroyed
+;       if passed in as an argument.
+;
+;       psConfigObject = Obj_New("FSC_PSCONFIG")
+;       keywords = PSConfig(psConfigObject)
+;
+;    Having the object means that you have an on-going and current record
+;    of exactly how your PostScript device is configured. Be sure to destroy
+;    the object when you are finished with it.
+;
+; KEYWORDS:
+;
+;   NOGUI:   Setting this keyword returns the default keyword settings directly,
+;            without allowing user interaction.
+;
+;   Any keyword accepted by the FSC_PSCONFIG object can be used with
+;   this program. Here are a few of the most popular keywords.
+;
+;   Bits_per_Pixel - The number of image bits saved for each image pixel: 2, 4, or 8. The default is 8.
+;   Color - Set this keyword to select Color PostScript output. Turned on by default.
+;   DefaultSetup - Set this keyword to the "name" of a default style. Current styles (you can easily
+;     create and add your own to the source code) are the following:
+;
+;       "System (Portrait)" - The normal "default" system set-up. Also, "System".
+;       "System (Landcape)" - The normal "default" landscape system set-up.
+;       "Centered (Portrait)" - The window centered on the page. Also, "Center" or "Centered".
+;       "Centered (Landscape)" - The window centered on the landscape page. Also, "Landscape".
+;       "Square (Portrait)" - A square plot, centered on the page.
+;       "Square (Landscape)" - A square plot, centered on the landscape page.
+;       "Figure (Small)" - A small encapsulated figure size, centered on page. Also, "Encapsulated" or "Encapsulate".
+;       "Figure (Large)" - A larger encapsulated figure size, centered on page. Also, "Figure".
+;       "Color (Portrait)" - A "centered" plot, with color turned on. Also, "Color".
+;       "Color (Landscape)" - A "centered" landscape plot, with color turned on.
+;
+;   Directory - Set this keyword to the name of the starting directory. The current directory is used by default.
+;   Encapsulate - Set this keyword to select Encapsulated PostScript output. Turned off by default.
+;   European - Set this keyword to indicate "european" mode (i.e., A4 page and centimeter units). Turned off by default.
+;   Filename - Set thie keyword to the name of the PostScript file. The default is "idl.ps".
+;   Inches - Set this keyword to indicate sizes and offsets are in inches as opposed to centimeters. Set by European keyword by default.
+;   Landscape - Set this keyword to select Landscape page output. Portrait page output is the default.
+;   PageType - Set this keyword to the "type" of page. Possible values are:
+;       "Letter" - 8.5 by 11 inches. (Default, unless the European keyword is set.)
+;       "Legal" - 8.5 by 14 inches.
+;       "Ledger" - 11 by 17 inches.
+;       "A4" - 21.0 by 29.7 centimeters. (Default, if the European keyword is set.)
+;   XOffset - Set this keyword to the X Offset. Uses "System (Portrait)" defaults. (Note: offset calculated from lower-left corner of page.)
+;   XSize - Set this keyword to the X size of the PostScript "window". Uses "System (Portrait)" defaults.
+;   YOffset - Set this keyword to the Y Offset. Uses "System (Portrait)" defaults. (Note: offset calculated from lower-left corner of page.)
+;   YSize - Set this keyword to the Y size of the PostScript "window". Uses "System (Portrait)" defaults.
+;
+;   In addition, the following keywords can be used:
+;
+;   CANCEL -- An output keyword that will be set to 1 if the user
+;   chooses the Cancel button on the form. It will be 0 otherwise.
+;
+;   FONTINFO -- Set this keyword is you wish to have font information
+;   appear on the form. The default is to not include font information.
+;
+;   FONTTYPE -- Set this keyword to a named variable that will indicate
+;   the user's preference for font type. Values will be -1 (Hershey fonts),
+;   0 (hardware fonts), and 1 (true-type fonts). This keyword will always
+;   return -1 unless the FONTINFO keyword has also been set.
+;
+;   GROUP_LEADER -- Set this keyword to a widget identifier of the widget
+;   you wish to be a group leader for this program.
+;
+; EXAMPLE:
+;
+;   To have the user specify PostScript configuration parameters, use
+;   the program like this:
+;
+;     keywords = PSConfig(Cancel=cancelled)
+;     IF cancelled THEN RETURN
+;     thisDevice = !D.Name
+;     Set_Plot, 'PS'
+;     Device, _Extra=keywords
+;     Plot, findgen(11) ; Or whatever graphics commands you use.
+;     Device, /Close_File
+;     Set_Plot, thisDevice
+;
+; OTHER PROGRAMS NEEDED:
+;
+;   The following programs are required to run this one:
+;
+;     fsc_droplist.pro
+;     fsc_fileselect.pro
+;     fsc_inputfield.pro
+;     fsc_plotwindow
+;     fsc_psconfig__define.pro
+;
+; MODIFICATIONS:
+;
+;   Written by David W. Fanning, 31 January 2000.
+;   Added NOGUI keyword to allow default keywords to be obtained without
+;     user interaction. 11 Oct 2004. DWF.
+;   Added CMYK option 24 August 2007. Requires LANGUAGE_LEVEL=2 printer. L. Anderson
+;-
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright (c) 2000-2007 Fanning Software Consulting
+;
+; This software is provided "as-is", without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose, including commercial applications, and to alter it and
+; redistribute it freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product, an acknowledgment in the product documentation
+;    would be appreciated, but is not required.
+;
+; 2. Altered source versions must be plainly marked as such, and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software, visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+
+
+FUNCTION PSConfig,                    $
+   psObject,                          $ ; A FSC_PSCONFIG object. If psObject is present, all input keywords
+                                        ; except Group_Leader and FontInfo are ignored.
+   AvantGarde=avantgarde,             $ ; Set this keyword to select the AvantGarde font.
+   Bits_per_Pixel=bits_per_pixel,     $ ; The number of image bits saved for each image pixel: 2, 4, or 8.
+   Bold=bold,                         $ ; Set this keyword to select the Bold font style.
+   BookStyle=book,                    $ ; Set this keyword to select the Book font style.
+   Bkman=bookman,                     $ ; Set this keyword to select the Bookman font.
+   Cancel=cancelled,                  $ ; This output keyword will be set to 1 if the user CANCELs. Set to 0 otherwise.
+   Color=color,                       $ ; Set this keyword to select Color PostScript output.
+   Courier=courier,                   $ ; Set this keyword to select the Courier font.
+   CMYK=cmyk,                         $ ; Set this keyword to use CMYK colors instead of RGB. (Requires LANGUAGE_LEVEL=2 printer.)
+   Debug=debug,                       $ ; Set this keyword to get traceback information when errors are encountered.
+   DefaultSetup=defaultsetup,         $ ; Set this keyword to the "name" of a default style.
+   Demi=demi,                         $ ; Set this keyword to select the Demi font style.
+   Directory=directory,               $ ; Set thie keyword to the name of the starting directory. Current directory by default.
+   Encapsulate=encapsulate,           $ ; Set this keyword to select Encapsulated PostScript output.
+   European=european,                 $ ; Set this keyword to indicate "european" mode (i.e., A4 page and centimeter units).
+   Filename=filename,                 $ ; Set this keyword to the name of the file. Default: 'idl.ps'
+   FontInfo=fontinfo,                 $ ; Set this keyword if you want font information in the FSC_PSCONFIG GUI.
+   FontSize=fontsize,                 $ ; Set this keyword to the font size. Between 6 and 36. Default is 12.
+   FontType=fonttype,                 $ ; An input/output keyword that will have the FontType. Will be !P.Font unless FontInfo is selected.
+   Group_Leader=group_leader,         $ ; The group leader of the PSConfig modal widget.
+   Helvetica=helvetica,               $ ; Set this keyword to select the Helvetica font.
+   Inches=inches,                     $ ; Set this keyword to indicate sizes and offsets are in inches as opposed to centimeters.
+   Italic=italic,                     $ ; Set this keyword to select the Italic font style.
+   Isolatin=isolatin,                 $ ; Set this keyword to select ISOlatin1 encoding.
+   Landscape=landscape,               $ ; Set this keyword to select Landscape output.
+   Light=light,                       $ ; Set this keyword to select the Light font style.
+   Medium=medium,                     $ ; Set this keyword to select the Medium font style.
+   Name=name,                         $ ; The "name" of the object.
+   Narrow=narrow,                     $ ; Set this keyword to select the Narrow font style.
+   NOGUI=nogui, $                     $ ; Return the default keywords directly, without user interaction.
+   Oblique=oblique, $                 $ ; Set this keyword to select the Oblique font style.
+   PageType=pagetype,                 $ ; Set this keyword to the "type" of page: 'Letter', 'Legal', 'Ledger', or 'A4'.
+   Palatino=palatino,                 $ ; Set this keyword to select the Palatino font.
+   Preview=preview,                   $ ; Set this keyword to select Preview mode: 0, 1, or 2.
+   Schoolbook=schoolbook,             $ ; Set this keyword to select the Schoolbook font.
+   Set_Font=set_font,                 $ ; Set this keyword to the name of a font passed to PostScript with Set_Plot keyword.
+   Symbol=symbol,                     $ ; Set this keyword to select the Symbol font.
+   Times=times,                       $ ; Set this keyword to select the Times font.
+   TrueType=truetype,                 $ ; Set this keyword to select True-Type fonts.
+   XOffset=xoffset,                   $ ; Set this keyword to the XOffset. (Note: offset calculated from lower-left corner of page.)
+   XSize=xsize,                       $ ; Set this keyword to the X size of the PostScript "window".
+   YOffset=yoffset,                   $ ; Set this keyword to the YOffset. (Note: offset calculated from lower-left corner of page.)
+   YSize=ysize,                       $ ; Set this keyword to the Y size of the PostScript "window".
+   ZapfChancery=zapfchancery,         $ ; Set this keyword to select the ZapfChancery font.
+   ZapfDingbats=zapfdingbats            ; Set this keyword to select the ZapfDingbats font.
+
+On_Error, 2
+
+IF N_Elements(psObject) EQ 0 THEN BEGIN
+   psObject = Obj_New('FSC_PSCONFIG', $
+      AvantGarde=avantgarde,             $
+      Bits_per_Pixel=bits_per_pixel,     $
+      Bold=bold,                         $
+      BookStyle=book,                    $
+      Bkman=bookman,                     $
+      CMYK=cmyk,                         $
+      Color=color,                       $
+      Courier=courier,                   $
+      Debug=debug,                       $
+      DefaultSetup=defaultsetup,         $
+      Demi=demi,                         $
+      Directory=directory,               $
+      Encapsulate=encapsulate,           $
+      European=european,                 $
+      Filename=filename,                 $
+      FontSize=fontsize,                 $
+      FontType=fonttype,                 $
+      Helvetica=helvetica,               $
+      Inches=inches,                     $
+      Italic=italic,                     $
+      Isolatin=isolatin,                 $
+      Landscape=landscape,               $
+      Light=light,                       $
+      Medium=medium,                     $
+      Name=name,                         $
+      Narrow=narrow,                     $
+      Oblique=oblique,                   $
+      PageType=pagetype,                 $
+      Palatino=palatino,                 $
+      Preview=preview,                   $
+      Schoolbook=schoolbook,             $
+      Set_Font=set_font,                 $
+      Symbol=symbol,                     $
+      Times=times,                       $
+      TrueType=truetype,                 $
+      XOffset=xoffset,                   $
+      XSize=xsize,                       $
+      YOffset=yoffset,                   $
+      YSize=ysize,                       $
+      ZapfChancery=zapfchancery,         $
+      ZapfDingbats=zapfdingbats )
+      create = 1
+ENDIF ELSE BEGIN
+   type = Size(psObject, /Type)
+   IF type NE 11 THEN BEGIN
+      Message, 'Object Reference required as an argument'
+   ENDIF
+   create = 0
+ENDELSE
+
+   ; Call the GUI of the FSC_PSCONFIG object.
+
+IF Keyword_Set(nogui) EQ 0 THEN $
+   psObject->GUI, Group_Leader=group_leader, Cancel=cancelled, FontInfo=Keyword_Set(fontinfo)
+
+   ; Get the PostScript device keywords, along with the font type information.
+
+keywords = psObject->GetKeywords(FontType=fonttype)
+
+   ; If this program created the psObject, destroy it. Otherwise leave it.
+
+IF create THEN Obj_Destroy, psObject
+
+   ; Return the PostScript device keywords.
+
+RETURN, keywords
+END ;----------------------------------------------------------------------
+
+
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/pswindow.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/pswindow.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/pswindow.pro	(revision 207)
@@ -0,0 +1,337 @@
+;+
+; NAME:
+;    PSWINDOW
+;
+; PURPOSE:
+;
+;    This function is used to calculate the size of a PostScript
+;    window that has the same aspect ratio (ratio of height to
+;    width) as the current display graphics window. It creates
+;    the largest possible PostScript output window with the
+;    desired aspect ratio. This assures that graphics output
+;    looks similar, if not identical, to PostScript output.
+;
+; AUTHOR:
+;
+;   FANNING SOFTWARE CONSULTING
+;   David Fanning, Ph.D.
+;   1645 Sheely Drive
+;   Fort Collins, CO 80526 USA
+;   Phone: 970-221-0438
+;   E-mail: davidf@dfanning.com
+;   Coyote's Guide to IDL Programming: http://www.dfanning.com/
+;
+; CATEGORY:
+;
+;    Graphics.
+;
+; CALLING SEQUENCE:
+;
+;    pageInfo = PSWINDOW()
+;
+; INPUTS:
+;
+;    None.
+;
+; KEYWORD PARAMETERS:
+;
+;    CM: Normally the structure value that is returned from this
+;    function reports its values in inches. Setting this keyword
+;    causes the return values to be in units of centimeters.
+;
+;    FUDGE: A quick way to set symetrical XFUDGE and YFUDGE factors.
+;    If this keyword is set to a value, XFUDGE and YFUDGE keywords are
+;    set to the same value.
+;
+;    LANDSCAPE: Normally this function assumes a PostScript window
+;    in Portrait mode. Setting this keyword assumes you want
+;    the graphic in Landscape mode.
+;
+;    MARGIN:  The margin around the edges of the plot. The value must be
+;    a floating point value between 0.0 and 0.5. It is expressed in
+;    normalized coordinate units. The default margin is 0.05.
+;
+;    PAGESIZE: Set this keyword to a string indicating the type
+;    of PostScript page size you want. Current values are "LETTER",
+;    "LEGAL", and "A4". Default is "LETTER".
+;
+;    PRINTER: Set this keyword if the output will be used to
+;    configure the PRINTER device, rather than the PS device.
+;    (In the PRINTER device, offsets are always calculated from
+;    the lower-left corner of the page and do not rotate in
+;    Landscape mode, as they do with the PS device.) Note that
+;    the PRINTER device is only able to accept these keywords
+;    in IDL 5.1 and higher.
+;
+;    XFUDGE: Printers calculate the offset point from the printable
+;    edge of the paper (sometimes), rather from the corner of the paper.
+;    For example, on my Lexmark printer, both X and Y offsets are
+;    calculated from a point 0.25 inches in from the edge. This keyword
+;    allows you to set a "fudge" factor that will be subtracted from
+;    the XOFFSET that is returned to the user. This allows you to create
+;    output that is centered on the page. The fudge factor should be in
+;    the same units as the returned size and offset values.
+;
+;    YFUDGE: Printers calculate the offset point from the printable
+;    edge of the paper (sometimes), rather from the corner of the paper.
+;    For example, on my Lexmark printer, both X and Y offsets are
+;    calculated from a point 0.25 inches in from the edge. This keyword
+;    allows you to set a "fudge" factor that will be subtracted from
+;    the YOFFSET that is returned to the user. This allows you to create
+;    output that is centered on the page. The fudge factor should be in
+;    the same units as the returned size and offset values.
+;
+; OUTPUTS:
+;
+;    pageInfo: The output value is a named structure defined like
+;    this:
+;
+;      pageInfo = {PSWINDOW_STRUCT, XSIZE:0.0, YSIZE:0.0, $
+;         XOFSET:0.0, YOFFSET:0.0, INCHES:0, PORTRAIT:0, LANDSCAPE:0}
+;
+;    The units of the four size fields are inches unless the CM
+;    keyword is set.
+;
+;    The output can be used to immediately configure the PostScript
+;    or Printer device, like this:
+;
+;       Set_Plot, 'PS' ; or 'PRINTER'
+;       Device, _Extra=pageInfo
+;
+; RESTRICTIONS:
+;
+;    The aspect ratio of the current graphics window is calculated
+;    like this:
+;
+;       aspectRatio = FLOAT(!D.Y_VSIZE) / !D.X_VSIZE
+;
+; EXAMPLE:
+;
+;    To create a PostScript output window with the same aspect
+;    ratio as the curently active display window, type:
+;
+;     pageInfo = PSWINDOW()
+;     SET_PLOT, 'PS'
+;     DEVICE, _Extra=pageInfo
+;
+;     To configure the PRINTER device:
+;
+;     pageInfo = PSWINDOW(/Printer, Fudge=0.25)
+;     SET_PLOT, 'PRINTER'
+;     DEVICE, _Extra=pageInfo
+;
+; MODIFICATION HISTORY:
+;
+;    Written by: David W. Fanning, November 1996.
+;       Fixed a bug in which the YOFFSET was calculated incorrectly
+;          in Landscape mode. 12 Feb 97.
+;       Took out a line of code that wasn't being used. 14 Mar 97.
+;       Added correct units keyword to return structure. 29 JUN 98. DWF
+;       Fixed a bug in how landscape offsets were calculated. 19 JUL 99. DWF.
+;       Fixed a bug in the way margins were used to conform to my
+;          original conception of the program. 19 JUL 99. DWF.
+;       Added Landscape and Portrait fields to the return structure. 19 JUL 99. DWF.
+;       Added PageSize keyword, changed MARGIN keyword, and completely
+;          rewrote most of the intenal code. 9 FEB 2000. DWF.
+;       Fixed a bug in how I calculated the aspect ratio. 1 MAR 2000. DWF.
+;       Added PRINTER keyword to return proper offset values for the
+;          PRINTER device, where the offset location is not rotated. 1 MAR 2000. DWF.
+;       Added PRINTER fudge factors to take into account that printer offsets are
+;          calculated from the printable area of the paper, rather than the corner
+;          of the paper. 8 AUG 2000. DWF.
+;       Changed the default margin to 0.05 from 0.15. 29 Nov 2004, DWF.
+;-
+;
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright © 2000-2004 Fanning Software Consulting
+;
+; This software is provided "as-is", without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose, including commercial applications, and to alter it and
+; redistribute it freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product, an acknowledgment in the product documentation
+;    would be appreciated, but is not required.
+;
+; 2. Altered source versions must be plainly marked as such, and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software, visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+
+
+
+FUNCTION PSWINDOW_ASPECT, aspectRatio, MARGIN=margin, WindowAspect=wAspectRatio
+
+ON_ERROR, 1
+
+   ; Check for aspect ratio parameter and possibilities.
+
+IF N_PARAMS() EQ 0 THEN aspectRatio = 1.0
+
+IF aspectRatio EQ 0 THEN BEGIN
+   MESSAGE, 'Aspect Ratio of 0. Changing to 1...', /Informational
+   aspectRatio = 1.0
+ENDIF
+
+s = SIZE(aspectRatio)
+IF s(s(0)+1) NE 4 THEN $
+   MESSAGE, 'Aspect Ratio is not a FLOAT. Take care...', /Informational
+
+   ; Check for margins.
+
+IF N_ELEMENTS(margin) EQ 0 THEN margin = 0.15
+
+   ; Error checking.
+
+IF margin LT 0 OR margin GE 0.5 THEN $
+   MESSAGE, 'The MARGIN keyword value must be between 0.0 and 0.5.'
+
+   ; Calculate the aspect ratio of the current window.
+
+IF N_Elements(wAspectRatio) EQ 0 THEN wAspectRatio = FLOAT(!D.Y_VSIZE) / !D.X_VSIZE
+
+   ; Calculate normalized positions in window.
+
+IF (aspectRatio LE wAspectRatio) THEN BEGIN
+   xstart = margin
+   ystart = 0.5 - (0.5 - margin) * (aspectRatio / wAspectRatio)
+   xend = 1.0 - margin
+   yend = 0.5 + (0.5 - margin) * (aspectRatio / wAspectRatio)
+ENDIF ELSE BEGIN
+   xstart = 0.5 - (0.5 - margin) * (wAspectRatio / aspectRatio)
+   ystart = margin
+   xend = 0.5 + (0.5 - margin) * (wAspectRatio / aspectRatio)
+   yend = 1.0 - margin
+ENDELSE
+
+position = [xstart, ystart, xend, yend]
+
+RETURN, position
+END ; ----------------------------------------------------------------------------------
+
+
+
+FUNCTION PSWINDOW, LANDSCAPE=landscape, CM=cm, MARGIN=margin, $
+   PageSize=pagesize, Printer=printer, Fudge=fudge, XFudge=xfudge, YFudge=yfudge
+
+   ; Set up default values.
+
+landscape = Keyword_Set(landscape)
+cm = Keyword_Set(cm)
+printer = Keyword_Set(printer)
+inches = 1
+
+   ; Set up printer fudge factors, if necessary.
+
+IF N_Elements(fudge) NE 0 THEN BEGIN
+   xfudge = fudge
+   yfudge = fudge
+ENDIF
+IF N_Elements(xfudge) EQ 0 THEN xfudge = 0.0
+IF N_Elements(yfudge) EQ 0 THEN yfudge = 0.0
+
+   ; Get the page size.
+
+IF N_Elements(pagesize) EQ 0 THEN pagesize = 'LETTER' $
+   ELSE pagesize = StrUpCase(pagesize)
+CASE pagesize OF
+   'LETTER': BEGIN
+      shortside = 8.5
+      longside = 11.0
+      ENDCASE
+   'LEGAL': BEGIN
+      shortside = 8.5
+      longside = 14.0
+      ENDCASE
+    'A4': BEGIN
+      shortside = 8.27
+      longside = 11.7
+      ENDCASE
+    ELSE: BEGIN
+      Message, 'Unknown page size. Using LETTER...', /Informational
+      shortside = 8.5
+      longside = 11.0
+      ENDCASE
+ENDCASE
+
+   ; Need measurements in centimeters?
+
+IF KEYWORD_SET(cm) THEN BEGIN
+      shortside = shortside * 2.54
+      longside = longside * 2.54
+      inches = 0
+ENDIF
+
+   ; Determine the margin of the window on the page.
+
+IF N_ELEMENTS(margin) EQ 0 THEN margin=0.05
+
+   ; Get the aspect ratio of the current display window. Aspect ratio
+   ; is ratio of xsize/ysize.
+
+aspectRatio = FLOAT(!D.Y_VSIZE) / !D.X_VSIZE
+
+   ; Get the aspect ratio of the page.
+
+IF Keyword_Set(landscape) THEN pAspectRatio = shortside / longside $
+   ELSE pAspectRatio = longside / shortside
+
+   ; Get the position on the page for this window.
+
+pos = PSWindow_Aspect(aspectRatio, Margin=margin, WindowAspect=pAspectRatio)
+
+   ; Convert normalized position coordinates to size units.
+
+IF KEYWORD_SET(landscape) THEN BEGIN
+   IF printer THEN BEGIN
+      xsize = (pos[2] - pos[0]) * longside
+      ysize = (pos[3] - pos[1]) * shortside
+      yoffset = pos[1] * shortside - yfudge
+      xoffset = pos[0] * longside - xfudge
+      landscape = 1
+      portrait = 0
+   ENDIF ELSE BEGIN
+      xsize = (pos[2] - pos[0]) * longside
+      ysize = (pos[3] - pos[1]) * shortside
+      xoffset = pos[1] * shortside
+      yoffset = longside - (pos[0] * longside)
+      landscape = 1
+      portrait = 0
+   ENDELSE
+ENDIF ELSE BEGIN
+   xsize = (pos[2] - pos[0]) * shortside
+   ysize = (pos[3] - pos[1]) * longside
+   IF printer THEN BEGIN
+      xoffset = pos[0] * shortside - xfudge
+      yoffset = pos[1] * longside - yfudge
+   ENDIF ELSE BEGIN
+      xoffset = pos[0] * shortside
+      yoffset = pos[1] * longside
+   ENDELSE
+   landscape = 0
+   portrait = 1
+ENDELSE
+
+   ; Return the proper DEVICE data structure.
+
+RETURN, {PSWINDOW_STRUCT, XSIZE:xsize, YSIZE:ysize, $
+   XOFFSET:xoffset, YOFFSET:yoffset, INCHES:inches, $
+   PORTRAIT:portrait, LANDSCAPE:landscape}
+
+END
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/tvimage.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/tvimage.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc/tvimage.pro	(revision 207)
@@ -0,0 +1,1020 @@
+;+
+; NAME:
+;     TVIMAGE
+;
+; PURPOSE:
+;     This purpose of TVIMAGE is to enable the TV command in IDL
+;     to be a completely device-independent and color-decomposition-
+;     state independent command. On 24-bit displays color decomposition
+;     is always turned off for 8-bit images and on for 24-bit images.
+;     The color decomposition state is restored for those versions of
+;     IDL that support it (> 5.2). Moreover, TVIMAGE adds features
+;     that TV lacks. For example, images can be positioned in windows
+;     using the POSITION keyword like other IDL graphics commands.
+;     TVIMAGE also supports the !P.MULTI system variable, unlike the
+;     TV command. TVIMAGE was written to work especially well in
+;     resizeable graphics windows. Note that if you wish to preserve
+;     the aspect ratio of images in resizeable windows, you should set
+;     the KEEP_ASPECT_RATIO keyword, described below. TVIMAGE works
+;     equally well on the display, in the PostScript device, and in
+;     the Printer and Z-Graphics Buffer devices. The TRUE keyword is
+;     set automatically to the correct value for 24-bit images, so you
+;     don't need to specify it when using TVIMAGE.
+;
+; AUTHOR:
+;       FANNING SOFTWARE CONSULTING:
+;       David Fanning, Ph.D.
+;       1645 Sheely Drive
+;       Fort Collins, CO 80526 USA
+;       Phone: 970-221-0438
+;       E-mail: davidf@dfanning.com
+;       Coyote's Guide to IDL Programming: http://www.dfanning.com/
+;
+; CATEGORY:
+;     Graphics display.
+;
+; CALLING SEQUENCE:
+;
+;     TVIMAGE, image
+;
+; INPUTS:
+;     image:    A 2D or 3D image array. It should be byte data.
+;
+;       x  :    The X position of the lower-left corner of the image.
+;               This parameter is only recognized if the TV keyword is set.
+;               If the Y position is not used, X is taken to be the image
+;               "position" in the window. See the TV command documenation
+;               for details.
+;
+;       y  :    The Y position of the lower-left corner of the image.
+;               This parameter is only recognized if the TV keyword is set.
+;
+; KEYWORD PARAMETERS:
+;
+;     ACOLOR:   Set this keyword to the axis color. If a byte or integer value,
+;               it will assume you are using INDEXED color mode. If a long integer
+;               is will assume you are using DECOMPOSED color mode. If a string,
+;               is will pass the string color name along to FSC_COLOR for processing.
+;
+;     AXES:     Set this keyword to draw a set of axes around the image.
+;
+;     AXKEYWORDS:   An IDL structure variable of PLOT keywords as structure fields
+;               and keyword values as the values of the fields. Pass directly to the
+;               PLOT command that draws the axes for the image. Ignored unless the
+;               AXES keyword is set. For example,
+;
+;               TVImage, image, /AXES, AXKEYWORDS={CHARSIZE:1.5, XTITLE:'Distance (mm)', $
+;                    YTITLE:'Signal', TICKLEN:-0.025}, ACOLOR='NAVY'
+;
+;     BACKGROUND:   This keyword specifies the background color. Note that
+;               the keyword ONLY has effect if the ERASE keyword is also
+;               set or !P.MULTI is set to multiple plots and TVIMAGE is
+;               used to place the *first* plot. Can be a string (e.g., 'ivory'), or
+;               a 24-bit value that can be decomposed into a color, or an 8-bit
+;               index number into the current color table. ERASE and BACKGROUND
+;               should only be used on 24-bit devices that support windows!
+;
+;     BREWER:   If set, applies only to BACKGROUND AND ACOLOR keywords. Selects
+;               brewer colors, rather than standard FSC_COLOR colors as strings.
+;
+;     ERASE:    If this keyword is set an ERASE command is issued
+;               before the image is displayed. ERASE and BACKGROUND 
+;               should only be used on 24-bit devices that support windows! 
+;               The keyword is ignored on 8-bit devices or devices that do
+;               not support windows.
+;
+;     _EXTRA:   This keyword picks up any TV keywords you wish to use.
+;
+;     HALF_HALF: If set, will tell CONGRID to extrapolate a *half* row
+;               and column on either side, rather than the default of
+;               one full row/column at the ends of the array.  If you
+;               are interpolating images with few rows, then the
+;               output will be more consistent with this technique.
+;               This keyword is intended as a replacement for
+;               MINUS_ONE, and both keywords probably should not be
+;               used in the same call to CONGRID.
+;
+;     KEEP_ASPECT_RATIO: Normally, the image will be resized to fit the
+;               specified position in the window. If you prefer, you can
+;               force the image to maintain its aspect ratio in the window
+;               (although not its natural size) by setting this keyword.
+;               The image width is fitted first. If, after setting the
+;               image width, the image height is too big for the window,
+;               then the image height is fitted into the window. The
+;               appropriate values of the POSITION keyword are honored
+;               during this fitting process. Once a fit is made, the
+;               POSITION coordiates are re-calculated to center the image
+;               in the window. You can recover these new position coordinates
+;               as the output from the POSITION keyword.
+;
+;     MARGIN:   A single value, expressed as a normalized coordinate, that
+;               can easily be used to calculate a position in the window.
+;               The margin is used to calculate a POSITION that gives
+;               the image an equal margin around the edge of the window.
+;               The margin must be a number in the range 0.0 to 0.333. This
+;               keyword is ignored if the POSITION or OVERPLOT keywords are
+;               used. It is also ignored when TVImage is executed in a
+;               multi-plot window, EXCEPT if it's value is zero. In this
+;               special case, the image will be drawn into its position in
+;               the multi-plot window with no margins whatsoever. (The
+;               default is to have a slight margin about the image to separate
+;               it from other images or graphics.
+;
+;     MINUS_ONE: The value of this keyword is passed along to the CONGRID
+;               command. It prevents CONGRID from adding an extra row and
+;               column to the resulting array, which can be a problem with
+;               small image arrays.
+;
+;     NOINTERPOLATION: Setting this keyword disables the default bilinear
+;               interpolation done to the image when it is resized. Nearest
+;               neighbor interpolation is done instead. This is preferred
+;               when you do not wish to change the pixel values of the image.
+;               This keyword must be set, for example, when you are displaying
+;               GIF files that come with their own non-IDL color table vectors.
+;
+;     NORMAL:   Setting this keyword means image position coordinates x and y
+;               are interpreted as being in normalized coordinates. This keyword
+;               is only valid if the TV keyword is set.
+;
+;     OVERPLOT: Setting this keyword causes the POSITION keyword to be ignored
+;               and the image is positioned in the location established by the
+;               last graphics command. For example:
+;
+;                    Plot, Findgen(11), Position=[0.1, 0.3, 0.8, 0.95]
+;                    TVImage, image, /Overplot
+;
+;     POSITION: The location of the image in the output window. This is
+;               a four-element floating array of normalized coordinates of
+;               the type given by !P.POSITION or the POSITION keyword to
+;               other IDL graphics commands. The form is [x0, y0, x1, y1].
+;               The default is [0.0, 0.0, 1.0, 1.0]. Note that this keyword is ALSO
+;               an output keyword. That is to say, upon return from TVIMAGE
+;               this keyword (if passed by reference) contains the actual
+;               position in the window where the image was displayed. This
+;               may be different from the input values if the KEEP_ASPECT_RATIO
+;               keyword is set, or if you are using TVIMAGE with the POSITION
+;               keyword when !P.MULTI is set to something other than a single
+;               plot. One use for the output values might be to position other
+;               graphics (e.g., a colorbar) in relation to the image.
+;
+;               Note that the POSITION keyword should not, normally, be used
+;               when displaying multiple images with !P.MULTI. If it *is* used,
+;               its meaning differs slightly from its normal meaning. !P.MULTI
+;               is responsible for calculating the position of graphics in the
+;               display window. Normally, it would be a mistake to use a POSITION
+;               graphics keyword on a graphics command that was being drawn with
+;               !P.MULTI. But in this special case, TVIMAGE will use the POSITION
+;               coordinates to calculate an image position in the actual position
+;               calculated for the image by !P.MULTI. The main purpose of this
+;               functionality is to allow the user to display images along with
+;               colorbars when using !P.MULTI. See the example below.
+;
+;    QUIET:      There are situations when you would prefer that TVIMAGE does not
+;                advertise itself by filling out the FSC_$TVIMAGE common block. For
+;                example, if you are using TVIMAGE to draw a color bar, it would
+;                not be necessary. Setting this keyword means that TVIMAGE just
+;                goes quietly about it's business without bothering anyone else.
+;
+;    SCALE:     Set this keyword to byte scale the image before display.
+;
+;     TV:       Setting this keyword makes the TVIMAGE command work much
+;               like the TV command, although better. That is to say, it
+;               will still set the correct DECOMPOSED state depending upon
+;               the kind of image to be displayed (8-bit or 24-bit). It will
+;               also allow the image to be "positioned" in the window by
+;               specifying the coordinates of the lower-left corner of the
+;               image. The NORMAL keyword is activated when the TV keyword
+;               is set, which will indicate that the position coordinates
+;               are given in normalized coordinates rather than device
+;               coordinates.
+;
+;               Setting this keyword will ensure that the keywords
+;               KEEP_ASPECT_RATIO, MARGIN, MINUS_ONE, MULTI, and POSITION
+;               are ignored.
+;
+;      XRANGE:  If the AXES keyword is set, this keyword is a two-element vector
+;               giving the X axis range. By default, [0, size of image in X].
+;
+;      YRANGE:  If the AXES keyword is set, this keyword is a two-element vector
+;               giving the Y axis range. By default, [0, size of image in Y].
+;
+; OUTPUTS:
+;     None.
+;
+; SIDE EFFECTS:
+;     Unless the KEEP_ASPECT_RATIO keyword is set, the displayed image
+;     may not have the same aspect ratio as the input data set.
+;
+; RESTRICTIONS:
+;     If the POSITION keyword and the KEEP_ASPECT_RATIO keyword are
+;     used together, there is an excellent chance the POSITION
+;     parameters will change. If the POSITION is passed in as a
+;     variable, the new positions will be returned in the same variable
+;     as an output parameter.
+;
+;     If a 24-bit image is displayed on an 8-bit display, the
+;     24-bit image must be converted to an 8-bit image and the
+;     appropriate color table vectors. This is done with the COLOR_QUAN
+;     function. The TVIMAGE command will load the color table vectors
+;     and set the NOINTERPOLATION keyword if this is done. Note that the
+;     resulting color table vectors are normally incompatible with other
+;     IDL-supplied color tables. Hence, other graphics windows open at
+;     the time the image is display are likely to look strange.
+;
+;     Other programs from Coyote Library (e.g., FSC_COLOR) may also be
+;     required.
+;
+; EXAMPLE:
+;     To display an image with a contour plot on top of it, type:
+;
+;        filename = FILEPATH(SUBDIR=['examples','data'], 'worldelv.dat')
+;        image = BYTARR(360,360)
+;        OPENR, lun, filename, /GET_LUN
+;        READU, lun, image
+;        FREE_LUN, lun
+;
+;        TVIMAGE, image, POSITION=thisPosition, /KEEP_ASPECT_RATIO
+;        CONTOUR, image, POSITION=thisPosition, /NOERASE, XSTYLE=1, $
+;            YSTYLE=1, XRANGE=[0,360], YRANGE=[0,360], NLEVELS=10
+;
+;     To display four images in a window without spacing between them:
+;
+;     !P.Multi=[0,2,2]
+;     TVImage, image, Margin=0
+;     TVImage, image, Margin=0
+;     TVImage, image, Margin=0
+;     TVImage, image, Margin=0
+;     !P.Multi = 0
+;
+;     To display four image in a window with associated color bars:
+;
+;     !P.Multi=[0,2,2]
+;     p = [0.02, 0.3, 0.98, 0.98]
+;     LoadCT, 0
+;     TVImage, image, Position=p
+;     Colorbar, Position=[p[0], p[1]-0.1, p[2], p[1]-0.05]
+;     p = [0.02, 0.3, 0.98, 0.98]
+;     LoadCT, 2
+;     TVImage, image, Position=p
+;     Colorbar, Position=[p[0], p[1]-0.1, p[2], p[1]-0.05]
+;     p = [0.02, 0.3, 0.98, 0.98]
+;     LoadCT, 3
+;     TVImage, image, Position=p
+;     Colorbar, Position=[p[0], p[1]-0.1, p[2], p[1]-0.05]
+;     p = [0.02, 0.3, 0.98, 0.98]
+;     LoadCT, 5
+;     TVImage, image, Position=p
+;     Colorbar, Position=[p[0], p[1]-0.1, p[2], p[1]-0.05]
+;     !P.Multi =0
+;
+; MODIFICATION HISTORY:
+;      Written by:     David Fanning, 20 NOV 1996.
+;      Fixed a small bug with the resizing of the image. 17 Feb 1997. DWF.
+;      Removed BOTTOM and NCOLORS keywords. This reflects my growing belief
+;         that this program should act more like TV and less like a "color
+;         aware" application. I leave "color awareness" to the program
+;         using TVIMAGE. Added 24-bit image capability. 15 April 1997. DWF.
+;      Fixed a small bug that prevented this program from working in the
+;          Z-buffer. 17 April 1997. DWF.
+;      Fixed a subtle bug that caused me to think I was going crazy!
+;          Lession learned: Be sure you know the *current* graphics
+;          window! 17 April 1997. DWF.
+;      Added support for the PRINTER device. 25 June 1997. DWF.
+;      Extensive modifications. 27 Oct 1997. DWF
+;          1) Removed PRINTER support, which didn't work as expected.
+;          2) Modified Keep_Aspect_Ratio code to work with POSITION keyword.
+;          3) Added check for window-able devices (!D.Flags AND 256).
+;          4) Modified PostScript color handling.
+;      Craig Markwart points out that Congrid adds an extra row and column
+;          onto an array. When viewing small images (e.g., 20x20) this can be
+;          a problem. Added a Minus_One keyword whose value can be passed
+;          along to the Congrid keyword of the same name. 28 Oct 1997. DWF
+;      Changed default POSITION to fill entire window. 30 July 1998. DWF.
+;      Made sure color decomposition is OFF for 2D images. 6 Aug 1998. DWF.
+;      Added limited PRINTER portrait mode support. The correct aspect ratio
+;          of the image is always maintained when outputting to the
+;          PRINTER device and POSITION coordinates are ignored. 6 Aug 1998. DWF
+;      Removed 6 August 98 fixes (Device, Decomposed=0) after realizing that
+;          they interfere with operation in the Z-graphics buffer. 9 Oct 1998. DWF
+;      Added a MARGIN keyword. 18 Oct 1998. DWF.
+;      Re-established Device, Decomposed=0 keyword for devices that
+;         support it. 18 Oct 1998. DWF.
+;      Added support for the !P.Multi system variable. 3 March 99. DWF
+;      Added DEVICE, DECOMPOSED=1 command for all 24-bit images. 2 April 99. DWF.
+;      Added ability to preserve DECOMPOSED state for IDL 5.2 and higher. 4 April 99. DWF.
+;      Added TV keyword to allow TVIMAGE to work like the TV command. 11 May 99. DWF.
+;      Added the OVERPLOT keyword to allow plotting on POSITION coordinates
+;         estabished by the preceding graphics command. 11 Oct 99. DWF.
+;      Added automatic recognition of !P.Multi. Setting MULTI keyword is no
+;         longer required. 18 Nov 99. DWF.
+;      Added NOINTERPOLATION keyword so that nearest neighbor interpolation
+;         is performed rather than bilinear. 3 Dec 99. DWF
+;      Changed ON_ERROR condition from 1 to 2. 19 Dec 99. DWF.
+;      Added Craig Markwardt's CMCongrid program and removed RSI's. 24 Feb 2000. DWF.
+;      Added HALF_HALF keyword to support CMCONGRID. 24 Feb 2000. DWF.
+;      Fixed a small problem with image start position by adding ROUND function. 19 March 2000. DWF.
+;      Updated the PRINTER device code to take advantage of available keywords. 2 April 2000. DWF.
+;      Reorganized the code to handle 24-bit images on 8-bit displays better. 2 April 2000. DWF.
+;      Added BACKGROUND keyword. 20 April 2000. DWF.
+;      Fixed a small problem in where the ERASE was occuring. 6 May 2000. DWF.
+;      Rearranged the PLOT part of code to occur before decomposition state
+;         is changed to fix Background color bug in multiple plots. 23 Sept 2000. DWF.
+;      Removed MULTI keyword, which is no longer needed. 23 Sept 2000. DWF.
+;      Fixed a small problem with handling images that are slices from 3D image cubes. 5 Oct 2000. DWF.
+;      Added fix for brain-dead Macs from Ben Tupper that restores Macs ability to
+;         display images. 8 June 2001. DWF.
+;      Fixed small problem with multiple plots and map projections. 29 June 2003. DWF.
+;      Converted all array subscripts to square brackets. 29 June 2003. DWF.
+;      Removed obsolete STR_SEP and replaced with STRSPLIT. 27 Oct 2004. DWF.
+;      Small modification at suggestion of Karsten Rodenacker to increase size of
+;         images in !P.MULTI mode. 8 December 2004. DWF.
+;      Minor modifications on Karsten Rodenacker's own account concerning margination
+;         and TV behaviour. 8 December 2004. KaRo
+;      There was a small inconsistency in how the image was resized for PostScript as
+;         opposed to the display, which could occasionally result in a small black line
+;         to the right of the image. This is now handled consistently. 3 January 2007. DWF.
+;      Made a small change to CMCONGRID to permit nearest-neighbor interpolation for 3D arrays.
+;         Previously, any 24-bit image was interpolated, no matter the setting of the NOINTERP
+;         keyword. 22 April 2007. DWF.
+;      Updated the program for the 24-bit Z-buffer in IDL 6.4. 11 June 2007. DWF.
+;      Added new POSITION keyword functionality for !P.MULTI display. 9 Sept 2007. DWF.
+;      Bit one too many times. Added _STRICT_EXTRA keywords for all _EXTRA keywords. 1 Feb 2008. DWF.
+;      Added FSC_$TVIMAGE common block for interactive interaction with TVINFO. 16 March 2008. DWF.
+;      Added SCALE keyword. 18 March 2008. DWF.
+;      Added keywords to allow axes to be drawn around the image. 18 March 2008. DWF.
+;      Added QUIET keyword to allow by-passing of FSC_$TVIMAGE common block updating. 21 March 2008. DWF.
+;      Made BACKGROUND and ERASE valid keywords only on 24-bit devices. Ignored on others. 28 May 2008. DWF.
+;      Cannot make color work in device independent way for axes, unless I handle axis color directly. To this
+;          end, I have added an ACOLOR keyword. 16 June 2008. DWF.
+;      Added BREWER keyword so I can specify Brewer colors with BACKGROUND and ACOLOR keywords. 16 June 2008. DWF.
+;-
+;
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright 2000-2008 Fanning Software Consulting.
+;
+; This software is provided "as-is", without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose, including commercial applications, and to alter it and
+; redistribute it freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product, an acknowledgment in the product documentation
+;    would be appreciated, but is not required.
+;
+; 2. Altered source versions must be plainly marked as such, and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software, visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+;
+;
+; NAME:
+;  TVIMAGE_CONGRID
+;
+; PURPOSE:
+;       Shrink or expand the size of an array by an arbitrary amount.
+;       This IDL procedure simulates the action of the VAX/VMS
+;       CONGRID/CONGRIDI function.
+;
+;  This function is similar to "REBIN" in that it can resize a
+;       one, two, or three dimensional array.   "REBIN", however,
+;       requires that the new array size must be an integer multiple
+;       of the original size.   CONGRID will resize an array to any
+;       arbitrary size (REBIN is somewhat faster, however).
+;       REBIN averages multiple points when shrinking an array,
+;       while CONGRID just resamples the array.
+;
+; CATEGORY:
+;       Array Manipulation.
+;
+; CALLING SEQUENCE:
+;  array = TVIMAGE_CONGRID(array, x, y, z)
+;
+; INPUTS:
+;       array:  A 1, 2, or 3 dimensional array to resize.
+;               Data Type : Any type except string or structure.
+;
+;       x:      The new X dimension of the resized array.
+;               Data Type : Int or Long (greater than or equal to 2).
+;
+; OPTIONAL INPUTS:
+;       y:      The new Y dimension of the resized array.   If the original
+;               array has only 1 dimension then y is ignored.   If the
+;               original array has 2 or 3 dimensions then y MUST be present.
+;
+;       z:      The new Z dimension of the resized array.   If the original
+;               array has only 1 or 2 dimensions then z is ignored.   If the
+;               original array has 3 dimensions then z MUST be present.
+;
+; KEYWORD PARAMETERS:
+;       INTERP: If set, causes linear interpolation to be used.
+;               Otherwise, the nearest-neighbor method is used.
+;
+;       CUBIC:  If set, uses "Cubic convolution" interpolation.  A more
+;               accurate, but more time-consuming, form of interpolation.
+;               CUBIC has no effect when used with 3 dimensional arrays.
+;
+;       MINUS_ONE:
+;               If set, will prevent CONGRID from extrapolating one row or
+;               column beyond the bounds of the input array.   For example,
+;               If the input array has the dimensions (i, j) and the
+;               output array has the dimensions (x, y), then by
+;               default the array is resampled by a factor of (i/x)
+;               in the X direction and (j/y) in the Y direction.
+;               If MINUS_ONE is present (AND IS NON-ZERO) then the array
+;               will be resampled by the factors (i-1)/(x-1) and
+;               (j-1)/(y-1).
+;
+;       HALF_HALF:
+;               If set, will tell CONGRID to extrapolate a *half* row
+;               and column on either side, rather than the default of
+;               one full row/column at the ends of the array.  If you
+;               are interpolating images with few rows, then the
+;               output will be more consistent with this technique.
+;               This keyword is intended as a replacement for
+;               MINUS_ONE, and both keywords probably should not be
+;               used in the same call to CONGRID.
+;
+; OUTPUTS:
+;  The returned array has the same number of dimensions as the original
+;       array and is of the same data type.   The returned array will have
+;       the dimensions (x), (x, y), or (x, y, z) depending on how many
+;       dimensions the input array had.
+;
+; PROCEDURE:
+;       IF the input array has three dimensions, or if INTERP is set,
+;       then the IDL interpolate function is used to interpolate the
+;       data values.
+;       If the input array has two dimensions, and INTERP is NOT set,
+;       then the IDL POLY_2D function is used for nearest neighbor sampling.
+;       If the input array has one dimension, and INTERP is NOT set,
+;       then nearest neighbor sampling is used.
+;
+; EXAMPLE:
+;       ; vol is a 3-D array with the dimensions (80, 100, 57)
+;       ; Resize vol to be a (90, 90, 80) array
+;       vol = TVIMAGE_CONGRID(vol, 90, 90, 80)
+;
+; MODIFICATION HISTORY:
+;       DMS, Sept. 1988.
+;       DMS, Added the MINUS_ONE keyword, Sept. 1992.
+;  Daniel Carr. Re-wrote to handle one and three dimensional arrays
+;                    using INTERPOLATE function.
+;  DMS, RSI, Nov, 1993.  Added CUBIC keyword.
+;       Craig Markwardt, Dec, 1997.  Added halfhalf keyword to
+;                        more evenly distribute "dead" pixel row
+;       Use uniformly spaced grid points for half_half W. Landsman   Feb. 2000
+;              (and slightly modified by C. Markwardt 14 Feb 2000)
+;  DWF, FSC, 22 Apr 2007. Modified the program so that 3D arrays use nearest-neighbor
+;       interpolation unless the INTERP keyword is set.
+;  DWF, FSC, 22 Apr 2007. Function renamed from CMCONGRID to TVIMAGE_CONGRID on
+;       recommendation of Craig Markwardt as he wants no part of this. :-)
+
+
+FUNCTION TVIMAGE_CONGRID, arr, x, y, z, Interp=int, Minus_One=m1, Cubic = cubic, $
+                    Half_Half=hh
+
+    ON_ERROR, 2    ;Return to caller if error
+    s = Size(arr)
+    
+    IF ((s[0] EQ 0) OR (s[0] GT 3)) THEN $
+       Message, 'Array must have 1, 2, or 3 dimensions.'
+    
+    ;  Supply defaults = no interpolate, and no minus_one.
+    if n_elements(int) le 0 then int = 0 else int = keyword_set(int)
+    if n_elements(m1) le 0 then m1 = 0 else m1 = keyword_set(m1)
+    
+    ; Compute offsets pixel offsets for half_half
+    halfx = 0.0 & halfy = 0.0 & halfz = 0.0
+    if keyword_set(hh) then begin
+        if s[0] GE 1 then halfx = -0.5 + (float(s[1])/x)
+        if s[0] GE 2 then halfy = -0.5 + (float(s[2])/y)
+        if s[0] GE 3 then halfz = -0.5 + (float(s[3])/z)
+    endif
+    cub = KEYWORD_SET(cubic)
+    if cub THEN int = 1  ;Cubic implies interpolate
+    
+    
+    CASE s[0] OF
+       1: BEGIN          ; *** ONE DIMENSIONAL ARRAY
+       srx = float(s[1] - m1)/(x-m1) * findgen(x) + halfx
+          IF int THEN $
+             RETURN, INTERPOLATE(arr, srx, CUBIC = cub) ELSE $
+             RETURN, arr(ROUND(srx))
+       ENDCASE
+       2: BEGIN ; *** TWO DIMENSIONAL ARRAY
+       IF int THEN BEGIN
+         srx = float(s[1] - m1) / (x-m1) * findgen(x) + halfx
+         sry = float(s[2] - m1) / (y-m1) * findgen(y) + halfy
+              RETURN, INTERPOLATE(arr, srx, sry, /GRID, CUBIC=cub)
+       ENDIF ELSE $
+         RETURN, POLY_2D(arr, $
+          [[0,0],[(s[1]-m1)/float(x-m1),0]], $ ;Use poly_2d
+          [[0,(s[2]-m1)/float(y-m1)],[0,0]],int,x,y)
+    
+       ENDCASE
+       3: BEGIN ; *** THREE DIMENSIONAL ARRAY
+       srx = float(s[1] - m1) / (x-m1) * findgen(x) + halfx
+       sry = float(s[2] - m1) / (y-m1) * findgen(y) + halfy
+       srz = float(s[3] - m1) / (z-m1) * findgen(z) + halfz
+       IF int THEN BEGIN
+          RETURN, interpolate(arr, srx, sry, srz, /grid)
+       ENDIF ELSE BEGIN
+          RETURN, interpolate(arr, round(srx), round(sry), round(srz), /grid)
+       ENDELSE
+       ENDCASE
+    ENDCASE
+    
+    RETURN, arr_r
+END
+;--------------------------------------------------------------------------
+
+
+
+FUNCTION TVIMAGE_ERROR, theMessage, Traceback=traceback, NoName=noName, _Extra=extra
+
+    On_Error, 2
+    
+    ; Check for presence and type of message.
+    IF N_Elements(theMessage) EQ 0 THEN theMessage = !Error_State.Msg
+    s = Size(theMessage)
+    messageType = s[s[0]+1]
+    IF messageType NE 7 THEN BEGIN
+       Message, "The message parameter must be a string.", _Extra=extra
+    ENDIF
+    
+    ; Get the call stack and the calling routine's name.
+    Help, Calls=callStack
+    callingRoutine = (StrSplit(StrCompress(callStack[1])," ", /Extract))[0]
+    
+    ; Are widgets supported? Doesn't matter in IDL 5.3 and higher.
+    widgetsSupported = ((!D.Flags AND 65536L) NE 0) OR Float(!Version.Release) GE 5.3
+    IF widgetsSupported THEN BEGIN
+       IF Keyword_Set(noName) THEN answer = Dialog_Message(theMessage, _Extra=extra) ELSE BEGIN
+          IF StrUpCase(callingRoutine) EQ "$MAIN$" THEN answer = Dialog_Message(theMessage, _Extra=extra) ELSE $
+             answer = Dialog_Message(StrUpCase(callingRoutine) + ": " + theMessage, _Extra=extra)
+       ENDELSE
+    ENDIF ELSE BEGIN
+          Message, theMessage, /Continue, /NoPrint, /NoName, /NoPrefix, _Extra=extra
+          Print, '%' + callingRoutine + ': ' + theMessage
+          answer = 'OK'
+    ENDELSE
+    
+    ; Provide traceback information if requested.
+    IF Keyword_Set(traceback) THEN BEGIN
+       Help, /Last_Message, Output=traceback
+       Print,''
+       Print, 'Traceback Report from ' + StrUpCase(callingRoutine) + ':'
+       Print, ''
+       FOR j=0,N_Elements(traceback)-1 DO Print, "     " + traceback[j]
+       Print, ''
+    ENDIF
+    
+    RETURN, answer
+END
+
+
+
+PRO TVIMAGE, image, x, y, $
+   ACOLOR=acolor, $
+   AXIS=axis, $
+   AXES=axes, $
+   AXKEYWORDS=axkeywords, $
+   BACKGROUND=background, $
+   BREWER=brewer, $
+   ERASE=eraseit, $
+   HALF_HALF=half_half, $
+   KEEP_ASPECT_RATIO=keep, $
+   MARGIN=margin, $
+   MINUS_ONE=minusOne, $
+   NOINTERPOLATION=nointerp, $
+   NORMAL=normal, $
+   POSITION=position, $
+   OVERPLOT=overplot, $
+   QUIET=quiet, $
+   SCALE=scale, $
+   TV=tv, $
+   XRANGE=plotxrange, $
+   YRANGE=plotyrange, $
+   _EXTRA=extra
+
+    ; Error handling.
+    Catch, theError
+    IF theError NE 0 THEN BEGIN
+       Catch, /Cancel
+       ok = TVIMAGE_ERROR(Traceback=1, /Error)
+       IF Ptr_Valid(ptr) THEN BEGIN
+            image = Temporary(*ptr)
+            Ptr_Free, ptr
+       ENDIF
+       RETURN
+    ENDIF
+    
+    ; Set up a common block as input to TVINFO.
+    COMMON FSC_$TVIMAGE, _tvimage_xsize, _tvimage_ysize, $
+                         _tvimage_winxsize, _tvimage_winysize, $
+                         _tvimage_position, _tvimage_winID, $
+                         _tvimage_current
+    
+    ; Check for image parameter and keywords.
+    IF N_Elements(image) EQ 0 THEN MESSAGE, 'You must pass a valid image argument.', /NoName
+    
+    ; Did the user want me to scale the image.
+    IF Keyword_Set(scale) THEN BEGIN
+        ptr = Ptr_New(image, /NO_COPY)
+        image = BytScl(*ptr)
+    ENDIF
+    IF N_Elements(acolor) EQ 0 THEN acolor = !P.Color
+    IF Keyword_Set(axis) THEN axes = 1
+    axes = Keyword_Set(axes)
+    brewer = Keyword_Set(brewer)
+    interp = 1.0 - Keyword_Set(nointerp)
+    half_half = Keyword_Set(half_half)
+    minusOne = Keyword_Set(minusOne)
+    IF N_Elements(background) EQ 0 THEN background = !P.Background
+    IF Keyword_Set(eraseit) THEN BEGIN
+         IF (!D.Flags AND 256) NE 0 THEN BEGIN
+            Device, Get_Visual_Depth=theDepth
+            IF theDepth GE 24 THEN BEGIN
+               varType = Size(background, /TNAME)
+               CASE 1 OF
+                  varType EQ 'BYTE' OR varType EQ 'INT': BEGIN
+                     TVLCT, r, g, b, /GET
+                     Erase, Color=background
+                     TVLCT, r, g, b
+                     END
+                  varType EQ 'LONG': BEGIN
+                     Device, Decomposed=1, Get_Decomposed=theState
+                     Erase, Color=background
+                     Device, Decomposed=theState
+                     END
+                  varType EQ 'STRING': BEGIN
+                     Device, Decomposed=1, Get_Decomposed=theState
+                     Erase, Color=FSC_Color(background, BREWER=brewer)
+                     Device, Decomposed=theState
+                     END
+                  ELSE: BEGIN
+                     TVLCT, r, g, b, /GET
+                     Erase, Color=background
+                     TVLCT, r, g, b
+                     END
+               ENDCASE
+            ENDIF
+         ENDIF
+    ENDIF
+    IF (N_Elements(margin) GT 0) AND (Keyword_Set(margin) EQ 0) THEN vmargin=[0.,0.] ELSE vmargin=[1.,1.]
+    
+    ; Check image size.
+    s = Size(image)
+    IF s[0] LT 2 OR s[0] GT 3 THEN $
+       MESSAGE, 'Argument does not appear to be an image. Returning...', /NoName
+    
+    ; Allow 24-bit images and 2D images that are sent in as 3D
+    ; arrays where one dimension is a 1.
+    IF s[0] EQ 3 THEN BEGIN
+       IF (s[1] NE 3L) AND (s[2] NE 3L) AND (s[3] NE 3L) THEN BEGIN
+          IF (s[1] NE 1L) AND (s[2] NE 1L) AND (s[3] NE 1L) THEN BEGIN
+             MESSAGE, 'Argument does not appear to be a 24-bit image. Returning...', /NoName
+          ENDIF ELSE BEGIN
+             IF s[1] EQ 1 THEN single = 1
+             IF s[2] EQ 1 THEN single = 2
+             IF s[3] EQ 1 THEN single = 3
+             CASE single OF
+                1: image = Reform(image, s[2], s[3])
+                2: image = Reform(image, s[1], s[3])
+                3: image = Reform(image, s[1], s[2])
+             ENDCASE
+             s = Size(image)
+          ENDELSE
+       ENDIF
+    ENDIF ELSE s = Size(image)
+    
+    ; If a window is not open, open one, otherwise in X devices you get incorrect
+    ; window size information the first time you call TVIMAGE.
+    IF (!D.FLAGS AND 256) NE 0 THEN IF !D.Window EQ -1 THEN Window
+    
+    ; Which release of IDL is this?
+    thisRelease = Float(!Version.Release)
+    
+    ; Doing multiple plots?
+    IF Total(!P.Multi) GT 0 THEN multi = 1 ELSE multi = 0
+    
+    ; Check for position and overplot keywords.
+    IF N_Elements(position) EQ 0 THEN BEGIN
+       IF Keyword_Set(multi) AND (Keyword_Set(overplot) NE 1) THEN BEGIN
+          Plot, Findgen(11), XStyle=4, YStyle=4, /NoData, Background=background, XMargin=vmargin, YMargin=vmargin
+          position = [!X.Window[0], !Y.Window[0], !X.Window[1], !Y.Window[1]]
+       ENDIF ELSE BEGIN
+          IF Keyword_Set(overplot) THEN BEGIN
+             position = [!X.Window[0], !Y.Window[0], !X.Window[1], !Y.Window[1]]
+          ENDIF ELSE position = [0.0, 0.0, 1.0, 1.0]
+       ENDELSE
+    ENDIF ELSE BEGIN
+       IF Keyword_Set(multi) AND (Keyword_Set(overplot) NE 1)THEN BEGIN
+    
+          ; Draw the invisible plot to get plot position.
+          Plot, Findgen(11), XStyle=4, YStyle=4, /NoData, Background=background, XMargin=vmargin, YMargin=vmargin
+    
+          ; Use position coordinates to indicate position in this set of coordinates.
+          xrange = !X.Window[1] - !X.Window[0]
+          xstart = !X.Window[0] + position[0]*xrange
+          xend = xrange * (position[2] - position[0]) + xstart
+    
+          yrange = !Y.Window[1] - !Y.Window[0]
+          ystart = !Y.Window[0] + position[1]*yrange
+          yend = yrange * (position[3] - position[1]) + ystart
+    
+          ; New position based on !P.MULTI position.
+          position = [xstart, ystart, xend, yend]
+    
+       ENDIF ELSE BEGIN
+          IF Keyword_Set(overplot) THEN BEGIN
+             position = [!X.Window[0], !Y.Window[0], !X.Window[1], !Y.Window[1]]
+          ENDIF ELSE position = Float(position)
+       ENDELSE
+    ENDELSE
+    
+    ; Check for margin keyword.
+    IF (Keyword_Set(multi) EQ 0) AND (Keyword_Set(overplot) EQ 0) THEN BEGIN
+       IF N_Elements(margin) NE 0 THEN BEGIN
+               margin = 0.0 > margin < 0.33
+               position = [position[0] + margin, position[1] + margin, $
+                           position[2] - margin, position[3] - margin]
+       ENDIF
+    ENDIF
+    
+    ; 2D image.
+    IF s[0] EQ 2 THEN BEGIN
+    
+       imgXsize = FLOAT(s[1])
+       imgYsize = FLOAT(s[2])
+       true = 0
+    
+       ; Decomposed color off if device supports it.
+       CASE  StrUpCase(!D.NAME) OF
+            'X': BEGIN
+                Device, Get_Visual_Depth=thisDepth
+                IF thisRelease GE 5.2 THEN Device, Get_Decomposed=thisDecomposed
+                Device, Decomposed=0
+                ENDCASE
+            'WIN': BEGIN
+    
+                Device, Get_Visual_Depth=thisDepth
+                IF thisRelease GE 5.2 THEN Device, Get_Decomposed=thisDecomposed
+                Device, Decomposed=0
+                ENDCASE
+            'MAC': BEGIN
+                Device, Get_Visual_Depth=thisDepth
+                IF thisRelease GE 5.2 THEN Device, Get_Decomposed=thisDecomposed
+                Device, Decomposed=0
+                ENDCASE
+            'Z': BEGIN
+                ; Fix for 24-bit Z-buffer.
+                IF (Float(!Version.Release) GE 6.4) THEN BEGIN
+                   Device, Get_Decomposed=thisDecomposed, Get_Pixel_Depth=thisDepth
+                   Device, Decomposed=0
+                ENDIF ELSE thisDepth = 8
+                ENDCASE
+            ELSE: thisDepth = 8
+       ENDCASE
+    
+    ENDIF
+    
+    ; 3D image.
+    IF s[0] EQ 3 THEN BEGIN
+    
+       IF s[1] EQ 3 THEN true = 1 ; Pixel interleaved
+       IF s[2] EQ 3 THEN true = 2 ; Row interleaved
+       IF s[3] EQ 3 THEN true = 3 ; Band interleaved
+    
+       ; Decomposed color on if device supports it.
+       CASE StrUpCase(!D.NAME) OF
+          'X': BEGIN
+             Device, Get_Visual_Depth=thisDepth
+             IF thisRelease GE 5.2 THEN Device, Get_Decomposed=thisDecomposed
+             IF thisDepth GT 8 THEN Device, Decomposed=1
+             ENDCASE
+          'WIN': BEGIN
+             Device, Get_Visual_Depth=thisDepth
+             IF thisRelease GE 5.2 THEN Device, Get_Decomposed=thisDecomposed
+             IF thisDepth GT 8 THEN Device, Decomposed=1
+             ENDCASE
+          'MAC': BEGIN
+             Device, Get_Visual_Depth=thisDepth
+             IF thisRelease GE 5.2 THEN Device, Get_Decomposed=thisDecomposed
+             IF thisDepth GT 8 THEN Device, Decomposed=1
+             ENDCASE
+          'Z': BEGIN
+             ; Fix for 24-bit Z-buffer.
+             IF (Float(!Version.Release) GE 6.4) THEN BEGIN
+                Device, Get_Pixel_Depth=thisDepth
+                IF thisDepth GT 8 THEN Device, Decomposed=1
+             ENDIF
+             ENDCASE
+          ELSE: thisDepth = 8
+       ENDCASE
+    
+       CASE true OF
+          1: BEGIN
+             imgXsize = FLOAT(s[2])
+             imgYsize = FLOAT(s[3])
+             ENDCASE
+          2: BEGIN
+             imgXsize = FLOAT(s[1])
+             imgYsize = FLOAT(s[3])
+             ENDCASE
+          3: BEGIN
+             imgXsize = FLOAT(s[1])
+             imgYsize = FLOAT(s[2])
+             ENDCASE
+       ENDCASE
+    
+    ENDIF
+    
+    ; Check for TV keyword. If present, then act like a TV command.
+    IF Keyword_Set(tv) THEN BEGIN
+    
+       IF N_Params() GE 3 OR N_Params() EQ 1 THEN BEGIN
+         IF N_Elements(x) EQ 0 THEN x = 0
+         IF N_Elements(y) EQ 0 THEN y = 0
+         IF Keyword_Set(normal) THEN TV, image, x, y, True=true, _STRICT_EXTRA=extra, /Normal ELSE $
+                                     TV, image, x, y, True=true, _STRICT_EXTRA=extra, /Device
+       ENDIF ELSE BEGIN
+         IF N_Params() EQ 2 THEN BEGIN
+             IF Keyword_Set(normal) THEN TV, image, x, True=true, _STRICT_EXTRA=extra, /Normal ELSE $
+                                         TV, image, x, True=true, _STRICT_EXTRA=extra, /Device
+         ENDIF
+       ENDELSE
+       GoTo, restoreDecomposed
+    
+    ENDIF
+    
+    ; Maintain aspect ratio (ratio of height to width)?
+    IF KEYWORD_SET(keep) THEN BEGIN
+    
+       ; Find aspect ratio of image.
+       ratio = FLOAT(imgYsize) / imgXSize
+    
+       ; Find the proposed size of the image in pixels without aspect
+       ; considerations.
+       xpixSize = (position(2) - position(0)) * !D.X_VSize
+       ypixSize = (position(3) - position(1)) * !D.Y_VSize
+    
+       ; Try to fit the image width. If you can't maintain
+       ; the aspect ratio, fit the image height.
+       trialX = xpixSize
+       trialY = trialX * ratio
+       IF trialY GT ypixSize THEN BEGIN
+          trialY = ypixSize
+          trialX = trialY / ratio
+       ENDIF
+    
+       ; Recalculate the position of the image in the window.
+       position[0] = (((xpixSize - trialX) / 2.0) / !D.X_VSize) + position[0]
+       position[2] = position[0] + (trialX/FLOAT(!D.X_VSize))
+       position[1] = (((ypixSize - trialY) / 2.0) / !D.Y_VSize)  + position[1]
+       position[3] = position[1] + (trialY/FLOAT(!D.Y_VSize))
+    
+    ENDIF
+    
+    ; Calculate the image size and start locations.
+    xsize = Ceil((position[2] - position[0]) * !D.X_VSIZE)
+    ysize = Ceil((position[3] - position[1]) * !D.Y_VSIZE)
+    xstart = Round(position[0] * !D.X_VSIZE)
+    ystart = Round(position[1] * !D.Y_VSIZE)
+    
+    ; Display the image. Sizing different for scalable pixels devices.
+    IF (!D.Flags AND 1) NE 0 THEN BEGIN
+    
+       ; Need a gray-scale color table if this is a true
+       ; color image.
+       IF true GT 0 THEN LOADCT, 0, /Silent
+       TV, image, xstart, ystart, XSIZE=xsize, $
+          YSIZE=ysize, _STRICT_EXTRA=extra, True=true
+    
+    ENDIF ELSE BEGIN ; All other devices.
+    
+       CASE true OF
+          0: TV, TVIMAGE_CONGRID(image, xsize, ysize, INTERP=interp, $
+                MINUS_ONE=minusOne, HALF_HALF=half_half), xstart, $
+                ystart, _STRICT_EXTRA=extra
+          1: IF thisDepth GT 8 THEN BEGIN
+                TV, TVIMAGE_CONGRID(image, 3, xsize, ysize, INTERP=interp, $
+                   MINUS_ONE=minusOne, HALF_HALF=half_half), xstart, $
+                   ystart, _STRICT_EXTRA=extra, True=1
+             ENDIF ELSE BEGIN
+                image2d = Color_Quan(image, 1, r, g, b)
+                TVLCT, r, g, b
+                TV, TVIMAGE_CONGRID(image2d, xsize, ysize, INTERP=0, $
+                   MINUS_ONE=minusOne, HALF_HALF=half_half), xstart, $
+                   ystart, _STRICT_EXTRA=extra, True=0
+             ENDELSE
+          2: IF thisDepth GT 8 THEN BEGIN
+                TV, TVIMAGE_CONGRID(image, xsize, 3, ysize, INTERP=interp, $
+                   MINUS_ONE=minusOne, HALF_HALF=half_half), xstart, $
+                   ystart, _STRICT_EXTRA=extra, True=2
+             ENDIF ELSE BEGIN
+                image2d = Color_Quan(image, 2, r, g, b, _STRICT_EXTRA=extra)
+                TVLCT, r, g, b
+                TV, TVIMAGE_CONGRID(image2d, xsize, ysize, INTERP=0, $
+                   MINUS_ONE=minusOne, HALF_HALF=half_half), xstart, $
+                   ystart, _STRICT_EXTRA=extra, True=0
+             ENDELSE
+          3: IF thisDepth GT 8 THEN BEGIN
+                TV, TVIMAGE_CONGRID(image, xsize, ysize, 3, INTERP=interp, $
+                   MINUS_ONE=minusOne, HALF_HALF=half_half), xstart, $
+                   ystart, _STRICT_EXTRA=extra, True=3
+             ENDIF ELSE BEGIN
+                image2d = Color_Quan(image, 3, r, g, b, _STRICT_EXTRA=extra)
+                TVLCT, r, g, b
+                TV, TVIMAGE_CONGRID(image2d, xsize, ysize, INTERP=0, $
+                   MINUS_ONE=minusOne, HALF_HALF=half_half), xstart, $
+                   ystart, _STRICT_EXTRA=extra, True=0
+             ENDELSE
+      ENDCASE
+    ENDELSE
+        
+    ; Restore Decomposed state if necessary.
+    RestoreDecomposed:
+    
+    CASE StrUpCase(!D.NAME) OF
+       'X': BEGIN
+          IF thisRelease GE 5.2 THEN Device, Decomposed=thisDecomposed
+          ENDCASE
+       'WIN': BEGIN
+          IF thisRelease GE 5.2 THEN Device, Decomposed=thisDecomposed
+          ENDCASE
+       'MAC': BEGIN
+          IF thisRelease GE 5.2 THEN BEGIN
+             Device, Decomposed=thisDecomposed
+    
+             ; Here is a hack that fixes a longstanding Mac problem with
+             ; color tables after changing the decomposed state.
+             TV, [0]
+          ENDIF
+          ENDCASE
+       'Z': BEGIN
+          IF thisRelease GE 6.4 THEN Device, Decomposed=thisDecomposed
+          ENDCASE
+       ELSE:
+    ENDCASE
+
+    ; Set up common block parameters, but only if device supports windows.
+    ; And only if the QUIET flag is not turned on.
+    IF ~Keyword_Set(quiet) THEN BEGIN
+        IF (!D.FLAGS AND 256) NE 0 THEN BEGIN
+            _tvimage_xsize = imgXsize
+            _tvimage_ysize = imgYsize
+            _tvimage_winID = !D.Window
+            _tvimage_winxsize = !D.X_Size
+            _tvimage_winysize = !D.Y_Size
+            _tvimage_position = position
+            _tvimage_current = 1
+        ENDIF 
+    ENDIF
+    
+    ; If the user wanted axes, draw them now.
+    IF axes THEN BEGIN
+    
+         ; Save plot system variables and current color table.
+        bangp = !P
+        bangx = !X
+        bangy = !Y
+        TVLCT, r, g, b, /GET
+    
+        ; If axes color is string, convert it.
+        IF Size(acolor, /TNAME) EQ 'STRING' THEN acolor = FSC_COLOR(acolor, BREWER=brewer)    
+    
+        ; Need a data range?
+        IF N_Elements(plotxrange) EQ 0 THEN plotxrange = [0, imgXsize]
+        IF N_Elements(plotyrange) EQ 0 THEN plotyrange = [0, imgYsize]
+        PLOT, [0], /NODATA, /NOERASE, XRANGE=plotxrange, YRANGE=plotyrange, $
+            XSTYLE=1, YSTYLE=1, POSITION=position, COLOR=acolor, _STRICT_EXTRA=axkeywords
+            
+        ; Clean up after yourself.
+        TVLCT, r, g, b
+        !P = bangp
+        !X = bangx
+        !Y = bangy
+    ENDIF
+
+    ; If you scaled the data, but the image back.
+    IF Ptr_Valid(ptr) THEN BEGIN
+        image = Temporary(*ptr)
+        Ptr_Free, ptr
+    ENDIF
+END
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_base_filename.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_base_filename.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_base_filename.pro	(revision 207)
@@ -0,0 +1,1 @@
+link fsc/fsc_base_filename.pro
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_droplist.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_droplist.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_droplist.pro	(revision 207)
@@ -0,0 +1,1 @@
+link fsc/fsc_droplist.pro
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_field.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_field.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_field.pro	(revision 207)
@@ -0,0 +1,1 @@
+link fsc/fsc_field.pro
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_fileselect.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_fileselect.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_fileselect.pro	(revision 207)
@@ -0,0 +1,1 @@
+link fsc/fsc_fileselect.pro
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_plotwindow.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_plotwindow.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_plotwindow.pro	(revision 207)
@@ -0,0 +1,1 @@
+link fsc/fsc_plotwindow.pro
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_psconfig.html
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_psconfig.html	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_psconfig.html	(revision 207)
@@ -0,0 +1,1 @@
+link fsc/fsc_psconfig.html
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_psconfig__define.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_psconfig__define.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/fsc_psconfig__define.pro	(revision 207)
@@ -0,0 +1,1 @@
+link fsc/fsc_psconfig__define.pro
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/getcdf.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/getcdf.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/getcdf.pro	(revision 207)
@@ -0,0 +1,16 @@
+pro getcdf, $
+	file=file, $
+	charvar=charvar, $
+	invar=invar	
+
+T = SYSTIME(1)
+
+cdfid = ncdf_open(file)
+varid=ncdf_varid(cdfid,charvar)
+ncdf_varget, cdfid, varid, invar
+
+print, 'got '+charvar+' in '+file+' within ', SYSTIME(1) - T, ' seconds'
+print, '         size is', size(invar, /Dimensions) 
+
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/map_latlon.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/map_latlon.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/map_latlon.pro	(revision 207)
@@ -0,0 +1,593 @@
+pro map_latlon, $
+	what_I_plot, $				; 2D field
+	lon, $					; 1D latitude OR 2D
+	lat, $					; 1D longitude OR 2D
+	minfield=minfield_init, $		; minimum value of plotted field (=0: calculate)
+	maxfield=maxfield_init, $		; maximum value of plotted field (=0: calculate)
+	overcontour=overcontour, $		; another 2D field to overplot with contour lines (=0: no)
+	overvector_x=overvector_x, $		; wind vector - x component (=0: no)
+	overvector_y=overvector_y, $		; wind vector - y component (=0: no)
+	ct=pal, $				; color table (33-rainbow is default)
+	colors=colors, $			; number of colors/levels (32 is default)
+	title=title_user, $			; title of the plot ('' is default)
+	format=format				; format of colorbar annotations ('(F6.2)' is default)
+
+;--------------------------------------------
+;
+; A general routine to plot lat/lon maps
+;
+; USE:	- map_latlon, what_I_plot 	
+;	- map_latlon, what_I_plot, lon, lat
+;	- ... and see options above
+;
+;--------------------------------------------
+; A. Spiga, August 2007
+;--------------------------------------------
+
+
+
+
+;---------------------------
+; a few permanent settings
+;---------------------------
+;
+missing_value=1.e30
+flag_cb='true'
+;-- optional:
+;-- user defined parameters
+; do not forget to type '.compile map_latlon' to update changes
+SPAWN, 'touch param_plot.idl'
+@param_plot.idl
+;
+;------------------
+
+
+;------------------
+; user settings
+;------------------
+if (n_elements(lon) eq 0) then begin
+	lon=findgen(n_elements(what_I_plot(*,0)))
+endif
+if (n_elements(lat) eq 0) then lat=findgen(n_elements(what_I_plot(0,*)))
+if (n_elements(minfield_init) eq 0) then minfield_init=0.
+if (n_elements(maxfield_init) eq 0) then maxfield_init=0.
+if (n_elements(overcontour) eq 0) then overcontour=0.
+if ((n_elements(overvector_x) eq 0) or (n_elements(overvector_y) eq 0)) then begin
+	overvector_x=0.
+	overvector_y=0.
+endif
+if (n_elements(colors) eq 0) then colors=32
+if (n_elements(title_user) eq 0) then title_user=''
+if (n_elements(subtitle_user) eq 0) then subtitle_user=''
+if (n_elements(pal) eq 0) then pal=33
+if (n_elements(format) eq 0) then format='(F6.2)'
+if (format eq '') then format='(F6.2)'
+;if (n_elements(xtitleset) eq 0) then xtitleset='longitude'
+;if (n_elements(ytitleset) eq 0) then ytitleset='latitude'
+if (n_elements(title_axis) ne 2) then begin
+        xtitleset='longitude'
+        ytitleset='latitude'
+endif else begin
+        xtitleset=title_axis(0)
+        ytitleset=title_axis(1)
+endelse
+if (n_elements(isotropic) eq 0) then isotropic='true'
+if (n_elements(coord2d) eq 0) then coord2d='false'
+
+;------------------
+; limits
+;------------------
+;if (minfield_init*maxfield_init eq 0) then begin   
+if (minfield_init eq maxfield_init) then begin
+	;---different min/max for each layer
+	w=where(abs(what_I_plot) lt missing_value)
+	if (w(0) ne -1) then begin
+		minfield=min(what_I_plot[w])
+		maxfield=max(what_I_plot[w])
+;goodscale, $
+;     what_I_plot, $
+;     minfield, $
+;     maxfield
+	endif else begin
+		what_I_plot=0.
+		print, 'no valid values in this field' 
+	endelse
+endif else begin
+	;---user-defined limits	
+	minfield=minfield_init 
+	maxfield=maxfield_init
+	;;w=where(what_I_plot lt minfield) & if (w(0) ne -1) then what_I_plot[w]=minfield
+	;;w=where(what_I_plot gt maxfield) & if (w(0) ne -1) then what_I_plot[w]=maxfield
+endelse
+
+if ((minfield+maxfield eq 0) and (abs(minfield) ne abs(maxfield))) then begin
+	print, 'nothing to plot ... skipping this plot ...'
+endif else begin
+
+
+;-----------------------------------------
+; fix the possible longitude ugliness :)
+; ...get rid of the -180/180 limit
+;-----------------------------------------
+
+;;;;; PB WITH 2D COORDINATES
+;w=where(lon eq min(lon))
+;if (w(0) ne 0) then begin
+;	lon[0:w(0)-1]=lon[0:w(0)-1]-360
+;endif
+
+
+;---------------
+; adapt ticks
+;---------------
+if (n_elements(windowx) eq 0) then windowx=[min(lon),max(lon)]
+if (n_elements(windowy) eq 0) then windowy=[min(lat),max(lat)]
+if (n_elements(intervalx) eq 0) then intervalx=round((windowx(1)-windowx(0))/8.)
+if (n_elements(intervaly) eq 0) then intervaly=round((windowy(1)-windowy(0))/5.)
+
+
+;------------------
+; plot window
+;------------------
+
+	;lons=lon & lats=lat
+	;;--------------------------------------------
+	;;
+	;; ANOMALY
+	;;
+	;w=where( (lon ge windowx(0)) and (lon le windowx(1)) ) & w2=where( (lat ge windowy(0)) and (lat le windowy(1)) )
+	;yeah=fltarr(n_elements(w),n_elements(w2)) & for i=0,n_elements(w)-1 do for j=0,n_elements(w2)-1 do yeah(i,j)=what_I_plot(w(i),w2(j))
+	;what_I_plot = yeah - mean(yeah)
+	;lon=lon[w] & lat=lat[w2]
+	;;--------------------------------------------
+
+
+	; to ensure the right limits
+	dumb_what_I_plot=what_I_plot
+	dumb_what_I_plot(*,*)=minfield & print, minfield
+	dumb_what_I_plot(0,0)=maxfield & print, maxfield
+
+;;
+;;
+;subtitle_hunhun = subtitle_user
+;subtitle_user = ''
+;;
+;;
+
+
+pospos = [0.10, 0.12, 0.90, 0.92] ;; iso
+;pospos = [0.15, 0.35, 0.95, 0.95] ;; non-iso
+
+if (isotropic eq 'true') then begin
+        loadct, 0, /silent
+        if ( coord2d ne 'polar' ) then begin
+                ;;trace non polaire
+                contour, /nodata, $
+                         /isotropic, $
+                         position=pospos, $
+                         dumb_what_I_plot,      lon,                            lat, $
+                         title=title_user,      xtitle=xtitleset,               ytitle=ytitleset, $
+                         xrange=windowx,                yrange=windowy, $
+                         xtickinterval=intervalx,       ytickinterval=intervaly, $
+                         subtitle=subtitle_user, color=0
+        endif else begin
+                ;;trace avec MAP_SET -- MAP_SET -- MAP_SET 
+                print,'------------------- Polar plot'
+                contour, /nodata, $
+                         /isotropic, $
+                         /overplot, $
+                         dumb_what_I_plot,      lon,                            lat, $
+                         title=title_user,      xtitle=xtitleset,               ytitle=ytitleset, $
+                         xrange=windowx,                yrange=windowy, $
+                         xtickinterval=intervalx,       ytickinterval=intervaly, $
+                         subtitle=subtitle_user, color=0
+        endelse
+        subtitle_user = ''
+endif else begin
+        pospos = [0.15, 0.35, 0.95, 0.95] ;; non-iso
+	loadct, 0, /silent
+        if ( coord2d ne 'polar' ) then begin
+                ;;trace non polaire
+                contour, /nodata, $
+                         position=pospos, $
+                         dumb_what_I_plot,      lon,                            lat, $
+                         title=title_user,      xtitle=xtitleset,               ytitle=ytitleset, $
+                         xrange=windowx,                yrange=windowy, $
+                         xtickinterval=intervalx,       ytickinterval=intervaly, $
+                         color=0,subtitle=subtitle_user
+        endif else begin
+                ;;trace avec MAP_SET -- MAP_SET -- MAP_SET 
+                print,'------------------- Polar plot'
+                contour, /nodata, $
+                         /overplot, $
+                         dumb_what_I_plot,      lon,                            lat, $
+                         title=title_user,      xtitle=xtitleset,               ytitle=ytitleset, $
+                         xrange=windowx,                yrange=windowy, $
+                         xtickinterval=intervalx,       ytickinterval=intervaly, $
+                         color=0,subtitle=subtitle_user
+        endelse
+endelse	
+
+;------------------
+; plot field
+;------------------
+
+; to avoid spurious blank zones
+nlevels=colors
+levp=minfield+(findgen(nlevels)/float(nlevels-1))*(maxfield-minfield)
+
+loadct,pal,/silent
+;reverse_ct
+if (pal eq 0) then reverse_ct
+if (pal eq 21) then reverse_ct
+contour, what_I_plot, $
+	lon,lat, $
+;	nlevels=colors, $
+	levels=levp, $
+	/cell_fill, $
+	max_value=maxfield, $
+	min_value=minfield, $
+	/overplot
+
+
+;nlat=128.
+;oplot, lat*0.+nlat*100./1000., linestyle=1
+
+;;; ANOMALY
+;lon=lons
+;lat=lats
+
+;------------------
+; colorbar
+;------------------
+
+;if (flag_cb eq 'true') then begin
+;        format_colorbar=format
+;        colorbar, $
+;                position=[0.15, 0.85, 0.95, 0.90], $
+;                divisions=8, $
+;                range=[float(minfield),float(maxfield)], $
+;                format=format_colorbar
+;endif
+;goto, skip_new
+
+if (flag_cb eq 'true') then begin
+format_colorbar=format
+
+;;; ndiv peut etre regle
+if (n_elements(ndiv) eq 0) then ndiv=10
+
+;if (n_elements(poscb) eq 0) then poscb=0.95
+;if (n_elements(poscb) eq 0) then poscb=0.80
+if (n_elements(poscb) eq 0) then poscb=0.70
+
+     if (isotropic eq 'true') then begin
+       ;poscb=0.85 & 
+       pos=[poscb, 0.12, poscb+0.03, 0.92]
+       ;poscb=0.95 & pos=[poscb, 0.12, poscb+0.03, 0.92]
+;       poscb=0.96 & pos=[poscb, 0.12, poscb+0.03, 0.92]
+;       poscb=0.05 & pos=[poscb, 0.12, poscb+0.03, 0.92]
+               ;colorbar = Obj_New("COLORBAR",$
+               ; Range=[float(minfield),float(maxfield)],$
+               ; /vertical, $
+               ; Ncolors=255,$
+               ; charsize=0.85,$
+               ; format=format_colorbar,$
+               ; major=ndiv,$
+               ; ticklen=-0.15,$
+               ; position=pos)
+               ;colorbar->Draw
+               ;Obj_Destroy, colorbar
+        colorbar, $
+                /vertical, $
+                position=pos, $
+                range=[float(minfield),float(maxfield)], $
+                divisions=ndiv, $
+                ncolors=255,$
+;               charsize=0.85,$
+                ticklen=-0.15,$
+                format=format_colorbar
+
+xyouts, pos(2), 0.01, subtitle_user, charsize=0.8, alignment=1., /NORMAL
+
+	if (n_elements(nam2) ne 0) then begin
+		thedate=STRSPLIT(nam2, /EXTRACT)
+		thedate=STRSPLIT(thedate(2),"'",/EXTRACT)
+		thedate=STRSPLIT(thedate(0),"_",/EXTRACT) 
+		thedate=STRSPLIT(thedate(0),"-",/EXTRACT) 
+		xyouts, pos(2), 0.01, 'LMD Martian Mesoscale Model - d'+thedate(2)+'/m'+thedate(1), charsize=0.7, alignment=1., /NORMAL 
+	endif else begin
+		thedate=''
+	endelse
+;;
+;;
+;;
+;xyouts, pos(2), 0.01, 'LMD Mars Mesoscale Model / '+subtitle_hunhun, charsize=0.95, alignment=1., /NORMAL
+;;
+;;
+;;
+
+     endif else begin
+
+	pos=[0.15, 0.17, 0.95, 0.20]
+	if (subtitle_user eq '') then pos=[0.15, 0.20, 0.95, 0.23]
+
+               ;colorbar = Obj_New("COLORBAR",$
+               ; Range=[float(minfield),float(maxfield)],$
+               ; Ncolors=255,$
+               ; charsize=0.85,$
+               ; format=format_colorbar,$
+               ; major=ndiv,$
+               ; ticklen=-0.15,$
+               ; position=pos)
+               ;colorbar->Draw
+               ;Obj_Destroy, colorbar
+        colorbar, $
+                position=pos, $
+                range=[float(minfield),float(maxfield)], $
+                divisions=ndiv, $
+                ncolors=255,$
+;               charsize=0.85,$
+                ticklen=-0.15,$
+                format=format_colorbar
+
+	if (n_elements(nam2) ne 0) then begin
+		thedate=STRSPLIT(nam2, /EXTRACT) 
+		thedate=STRSPLIT(thedate(2),"'",/EXTRACT) 
+		thedate=STRSPLIT(thedate(0),"_",/EXTRACT) 
+		thedate=STRSPLIT(thedate(0),"-",/EXTRACT) 
+		xyouts, 0.95, pos(1)-0.08, 'LMD Martian Mesoscale Model - d'+thedate(2)+'/m'+thedate(1), charsize=0.7, alignment=1., /NORMAL 
+	endif else begin
+		thedate=''
+	endelse
+
+      endelse	
+endif
+
+skip_new:
+
+;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;
+;;; ajouter un point
+;loadct, 0
+;xyouts, 353.87-360, -1.88, '+', ALIGNMENT=0.5, CHARSIZE=2, CHARTHICK=2
+;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;
+
+;goto, nocontour 
+;print, 'contour' 
+;--------------------
+; overplot contour
+;--------------------
+if (n_elements(overcontour) ne 1) then begin
+
+	w=where(abs(overcontour) lt missing_value)
+	if (w(0) ne -1) then begin
+		min_contour=min(overcontour[w])
+		max_contour=max(overcontour[w])
+	endif
+
+
+; to avoid spurious blank zones
+nlevels=colors/2
+if (n_elements(lev) eq 0) then lev=min_contour+(findgen(nlevels)/float(nlevels-1))*(max_contour-min_contour)
+
+;lev=round(lev)
+;yeah=UNIQ(lev) & lev=lev[yeah]
+
+colcont = 150 ;75
+if (pal eq 16) then colcont=0 ;noir
+if (pal eq 4) then colcont=255 ;blanc
+
+if (isotropic eq 'true') then begin
+loadct,0,/silent
+;reverse_ct
+contour, overcontour, $
+	lon,lat, $
+/overplot, $ 
+;	nlevels=colors/2, $
+	levels=lev, $
+	C_LINESTYLE = (lev LT 0.0), $   ;; dotted lines if negative
+	max_value=max_contour, $
+	min_value=min_contour, $	
+	c_labels=findgen(n_elements(lev))*0., $
+;        c_charsize=!P.charsize/2, $
+	color=colcont;75;0;50;75;100tropclair;150;0;, $
+;	/noerase, $
+;	xtitle=xtitleset, $
+;	xrange=windowx, $
+;	ytitle=ytitleset, $
+;	yrange=windowy, $
+;       position=pospos, $
+;	/isotropic, $
+;	xtickinterval=intervalx, $
+;	ytickinterval=intervaly 
+endif else begin
+loadct,0,/silent
+contour, overcontour, $
+        lon,lat, $
+/overplot, $
+;        nlevels=colors/2, $ 
+        levels=lev, $
+        C_LINESTYLE = (lev LT 0.0), $   ;; dotted lines if negative
+        max_value=max_contour, $
+        min_value=min_contour, $
+        c_labels=findgen(n_elements(lev))*0., $
+        color=colcont;, $
+;        /noerase, $
+;        xtitle=xtitleset, $ 
+;        xrange=windowx, $
+;        ytitle=ytitleset, $
+;        yrange=windowy, $
+;;       position=[0.15, 0.15, 0.95, 0.75], $
+;        xtickinterval=intervalx, $
+;        ytickinterval=intervaly 
+endelse	
+
+
+endif
+nocontour:
+
+;--------------------
+; overplot wind
+;--------------------
+if (n_elements(overvector_x)*n_elements(overvector_y) ne 1) then begin
+
+	w=where(abs(overvector_x) ge missing_value)  ; u and v have the same missing values ...
+	if (w(0) ne -1) then begin
+		overvector_x[w]=0.
+		overvector_y[w]=0.
+	endif
+		
+
+len=2.0
+if (n_elements(windex) eq 0) then windex=20. 
+ref_mag=round(windex)
+mytext=STRTRIM(STRING(ref_mag),2)+'ms!E-1!N'
+
+if (n_elements(stride) eq 0) then begin
+;stride=3 		; STRIDE: Pick every nth vector for plotting. (1)
+;stride=2
+stride=5
+endif else begin
+stride=round(stride)
+endelse
+	
+ref_pos=[0.10, 0.90] 	
+ref_pos=[0.15, 0.10]
+ref_pos=[0.20, 0.05]
+;ref_pos=[0.20, 0.02]
+
+s=size(lon)
+if (s[0] eq 1) then begin
+ zeu=overvector_x
+ zev=overvector_y
+ longs=lon
+ lats=lat
+endif else begin
+ minlat=min(lat) & maxlat=max(lat) & minlon=min(lon) & maxlon=max(lon)
+ npoints=2*n_elements(lon(*,0))  ;; trop de points, mais au moins on ne perd rien (2 et 3 donnent results similaires)
+ TRIANGULATE, lon, lat, tr
+ zeu = GRIDDATA( lon, lat, overvector_x, /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN )
+ zev = GRIDDATA( lon, lat, overvector_y, /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN )
+ longs =  minlon + (maxlon - minlon)*findgen(npoints)/float(npoints-1)
+ lats =  minlat + (maxlat - minlat)*findgen(npoints)/float(npoints-1)
+endelse
+
+wlon=where( (longs gt windowx(0)) and (longs lt windowx(1)) )
+wlat=where( (lats gt windowy(0)) and (lats lt windowy(1)) )
+
+if ((wlon(0) eq -1) or (wlat(0) eq -1)) then begin
+	print, 'wrong window settings'
+        print, windowx(0), windowx(1)
+	print, longs
+	print, windowy(0), windowy(1)
+	print, lats
+	stop 
+endif
+
+myu=dblarr(n_elements(longs),n_elements(lats))
+myv=dblarr(n_elements(longs),n_elements(lats))
+
+myu(*,*)=!Values.F_NAN
+myv(*,*)=!Values.F_NAN
+
+for i=0,n_elements(wlon)-1 do begin
+for j=0,n_elements(wlat)-1 do begin	
+	myu(wlon(i),wlat(j))=zeu(wlon(i),wlat(j))
+        myv(wlon(i),wlat(j))=zev(wlon(i),wlat(j))
+endfor	
+endfor	
+
+	;; eliminate vector for colorbar clarity ?
+	;nxs=1
+	;nxe=n_elements(longs(*))-2
+	;nys=1
+	;nye=n_elements(lats(*))-2
+	;myu=overvector_x(nxs:nxe,nys:nye)
+	;myv=overvector_y(nxs:nxe,nys:nye)
+	;longs=lon(nxs:nxe)
+	;lats=lat(nys:nye)
+
+loadct,0,/silent
+VECTOR, myu, myv, longs, lats, LENGTH=len, REF_MAG=ref_mag,$
+        STRIDE=stride, TYPE=2, HEAD_LEN=0.3, ANGLE=30, $
+        REF_POS=ref_pos, REF_TEXT=mytext,$
+        ALIGN=0.5, COLOR=1, /OVERPLOT;, /NOERASE
+
+yeah:
+endif
+
+
+endelse
+
+
+
+goto, why_contour_end
+;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;
+
+if (n_elements(overcontour) ne 1) then begin
+
+        w=where(abs(overcontour) lt missing_value)
+        if (w(0) ne -1) then begin
+                min_contour=min(overcontour[w])
+                max_contour=max(overcontour[w])
+        endif
+
+
+; to avoid spurious blank zones
+nlevels=colors/2
+if (n_elements(lev) eq 0) then lev=min_contour+(findgen(nlevels)/float(nlevels-1))*(max_contour-min_contour)
+;lev=round(lev)
+;yeah=UNIQ(lev) & lev=lev[yeah]
+
+
+if (isotropic eq 'true') then begin
+loadct,0,/silent
+contour, overcontour, $
+        lon,lat, $
+;       nlevels=colors/2, $
+        levels=lev, $
+        C_LINESTYLE = (lev LT 0.0), $   ;; dotted lines if negative
+        max_value=max_contour, $
+        min_value=min_contour, $
+        c_labels=findgen(nlevels), $ ;*0., $
+        color=0, $
+        /noerase, $
+        xtitle=xtitleset, $
+        xrange=windowx, $
+        ytitle=ytitleset, $
+        yrange=windowy, $
+;        position=[0.15, 0.15, 0.95, 0.75], $
+        /isotropic, $
+        xtickinterval=intervalx, $
+        ytickinterval=intervaly
+endif else begin
+loadct,0,/silent
+contour, overcontour, $
+        lon,lat, $
+;       nlevels=colors/2, $ 
+        levels=lev, $
+        C_LINESTYLE = (lev LT 0.0), $   ;; dotted lines if negative
+        max_value=max_contour, $
+        min_value=min_contour, $
+        c_labels=findgen(nlevels), $
+        color=0, $
+        /noerase, $
+        xtitle=xtitleset, $
+        xrange=windowx, $
+        ytitle=ytitleset, $
+        yrange=windowy, $
+        position=[0.15, 0.15, 0.95, 0.75], $
+        xtickinterval=intervalx, $
+        ytickinterval=intervaly
+endelse
+
+
+endif
+
+why_contour_end:
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/param_plot.idl.minimal
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/param_plot.idl.minimal	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/param_plot.idl.minimal	(revision 207)
@@ -0,0 +1,22 @@
+;subtitle_user='-- LMD Martian Mesoscale Model --'            ;; grepALL
+title_user='Friction velocity (!Nm!N.s!U-1!N) at local time 16h'     ;; grepALL
+;title_axis=['x coord (km)','y coord (km)']     ;; grepALL
+;flag_cb='false'                ;; grepALL
+;format='(I0)'                  ;; grepALL
+;colors=64                       ;; grepALL
+pal=22                          ;; grepALL
+minfield_init=0.3      ;; grepALL
+maxfield_init=1.3	;; grepALL
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max ;; grepALL
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min ;; grepALL
+;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value ;; grepALL
+windex=15. ;25. ;20.	;; grepALL
+stride=3. ;2.	;; grepALL
+;overcontour=overcontour-mean(overcontour)	;; grepALL
+;lev=220. + 2.*findgen(30) ;; grepALL
+lev=-10. + 1.*findgen(30) ;; grepALL
+;isotropic='false'       ;; grepALL
+intervalx=2.            ;; grepALL
+intervaly=2.             ;; grepALL
+windowx=[-130.,-112.]        ;; grepMAP
+windowy=[-18.,-2.]     ;; grepMAP
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/plot_vector.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/plot_vector.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/plot_vector.pro	(revision 207)
@@ -0,0 +1,129 @@
+PRO plot_vector, u, v, x, y, type=type, angle=angle, head_len=head_len,$
+                 maxmag=maxmag, align=align, length=length,$
+		 ref_text=ref_text, color=color, cstyle=cstyle
+;Procedure to calculate and plot a vector
+ 
+mylen=300.0 ; length of default arrow in pixels
+rev=1.0    
+x0=0.0
+y0=0.0
+x1=u/maxmag*mylen*length
+y1=v/maxmag*mylen*length
+dx=x1-x0
+IF (dx LT 0.0) THEN rev=-1.0
+dy=y1-y0
+r=SQRT(dx^2+dy^2)
+theta=ATAN(dy/dx)     
+phi=angle*!dtor
+rfrac=head_len 
+x2=x1-r*rfrac*rev*COS(theta-phi)
+y2=y1-r*rfrac*rev*SIN(theta-phi)
+x3=x1-r*rfrac*rev*COS(theta+phi)
+y3=y1-r*rfrac*rev*SIN(theta+phi)
+x4=x1-rfrac/2*r*rev*COS(theta)
+y4=y1-rfrac/2*r*rev*SIN(theta)
+;Calculate intersection of vector shaft and head points either
+;side of the shaft - see
+;http://astronomy.swin.edu.au/~pbourke/geometry/lineline2d
+;for more details
+ua=((x3-x2)*(y0-y2)-(y3-y2)*(x0-x2))/$
+   ((y3-y2)*(x1-x0)-(x3-x2)*(y1-y0))
+x5=x0+ua*(x1-x0)
+y5=y0+ua*(y1-y0) 
+               
+;Plot vectors in data space - cstyle=0
+;Position in device coordinates and then convert to data coordinates
+IF (cstyle EQ 0) THEN BEGIN
+ pt1=CONVERT_COORD(x,y, /DATA, /TO_DEVICE)
+ xpts=[x0,x1,x2,x3,x4,x5]+pt1[0]-align*dx
+ ypts=[y0,y1,y2,y3,y4,y5]+pt1[1]-align*dy
+ pts=CONVERT_COORD(xpts,ypts, /DEVICE, /TO_DATA)
+ xpts=pts[0,*]
+ ypts=pts[1,*]
+ x0=xpts[0]
+ x1=xpts[1]
+ x2=xpts[2]
+ x3=xpts[3]
+ x4=xpts[4]
+ x5=xpts[5]
+ y0=ypts[0]
+ y1=ypts[1]
+ y2=ypts[2]
+ y3=ypts[3]
+ y4=ypts[4]
+ y5=ypts[5]   
+   
+	       
+; Plot the vectors omiting any vectors with NaNs
+ z=[xpts, ypts] 	 
+ IF (TOTAL(FINITE(z)) EQ 12) THEN BEGIN
+  IF (N_ELEMENTS(TYPE) EQ 0) THEN TYPE=0
+  IF (TYPE EQ 0) THEN BEGIN	 
+    PLOTS, [x0,x1,x2,x1,x3], [y0,y1,y2,y1,y3], COLOR=color
+  ENDIF
+  IF (TYPE EQ 1) THEN BEGIN	 
+    PLOTS, [x0,x5,x3,x1,x2,x5], [y0,y5,y3,y1,y2,y5], COLOR=color
+  ENDIF  
+  IF (TYPE EQ 2) THEN BEGIN	 
+    PLOTS, [x0,x4,x2,x1,x3,x4], [y0,y4,y2,y1,y3,y4], COLOR=color
+  ENDIF
+  IF (TYPE EQ 3) THEN BEGIN	 
+    PLOTS, [x0,x1], [y0,y1], COLOR=color
+    POLYFILL, [x1,x2,x3,x1], [y1,y2,y3,y1], COLOR=color
+  ENDIF
+  IF (TYPE EQ 4) THEN BEGIN	 
+    PLOTS, [x0,x4], [y0,y4], COLOR=color
+   POLYFILL, [x1,x2,x4,x3,x1], [y1,y2,y4,y3,y1], COLOR=color
+  ENDIF
+ ENDIF
+ENDIF	
+
+
+;Plot reference vector - cstyle=1
+;Position in device coordinates and then convert to data coordinates
+IF (cstyle EQ 1) THEN BEGIN
+ pt1=CONVERT_COORD(x,y, /NORMAL, /TO_DEVICE)
+ xpts=[x0,x1,x2,x3,x4,x5]+pt1[0]
+ ypts=[y0,y1,y2,y3,y4,y5]+pt1[1]
+ x0=xpts[0]
+ x1=xpts[1]
+ x2=xpts[2]
+ x3=xpts[3]
+ x4=xpts[4]
+ x5=xpts[5]
+ y0=ypts[0]
+ y1=ypts[1]
+ y2=ypts[2]
+ y3=ypts[3]
+ y4=ypts[4]
+ y5=ypts[5]     
+	       
+; Plot the vectors omiting any vectors with NaNs
+ z=[xpts, ypts] 	 
+ IF (TOTAL(FINITE(z)) EQ 12) THEN BEGIN
+  IF (N_ELEMENTS(TYPE) EQ 0) THEN TYPE=0
+  IF (TYPE EQ 0) THEN BEGIN	 
+    PLOTS, [x0,x1,x2,x1,x3], [y0,y1,y2,y1,y3], COLOR=color, /DEVICE
+  ENDIF
+  IF (TYPE EQ 1) THEN BEGIN	 
+    PLOTS, [x0,x5,x3,x1,x2,x5], [y0,y5,y3,y1,y2,y5], COLOR=color, /DEVICE
+  ENDIF  
+  IF (TYPE EQ 2) THEN BEGIN	 
+    PLOTS, [x0,x4,x2,x1,x3,x4], [y0,y4,y2,y1,y3,y4], COLOR=color, /DEVICE
+  ENDIF
+  IF (TYPE EQ 3) THEN BEGIN	 
+    PLOTS, [x0,x1], [y0,y1], COLOR=color, /DEVICE
+    POLYFILL, [x1,x2,x3,x1], [y1,y2,y3,y1], COLOR=color, /DEVICE
+  ENDIF
+  IF (TYPE EQ 4) THEN BEGIN	 
+    PLOTS, [x0,x4], [y0,y4], COLOR=color, /DEVICE
+   POLYFILL, [x1,x2,x4,x3,x1], [y1,y2,y4,y3,y1], COLOR=color, /DEVICE
+  ENDIF
+ ENDIF
+ 
+ ;Add the reference vector text
+ IF (N_ELEMENTS(REF_TEXT) EQ 0) THEN ref_text=' '
+ XYOUTS, x0-100, y0-100, ref_text, ALIGNMENT=1.0, /DEVICE
+ENDIF
+	
+END		
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/profile.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/profile.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/profile.pro	(revision 207)
@@ -0,0 +1,171 @@
+pro profile, $
+	what_I_plot, $				; 1D vertical profile
+	column, $				; altitudes	
+	alt=alt, $				; altitude range [altmin, altmax]
+	minfield=minfield_init, $		; minimum value of plotted field (=0: calculate)
+	maxfield=maxfield_init, $		; maximum value of plotted field (=0: calculate)
+	inprofile=overplot, $			; another vertical profile to overplot
+	incolumn=overplot_column, $		; altitudes of the other vertical profile (in case /= column)
+	discrete=discrete, $			; show the profile points (= type of points in !psym)
+	title_plot=title_user, $		; title of the plot ('Profile' is default)
+	title_axis=title_axis, $		; title of the [x,y] axis (['Field','Altitude'] is default)
+	mention=mention				; add text precision within the plot window (default is nothing or '')
+
+;--------------------------------------------
+;
+; A general routine to plot 1D profiles
+;
+; USE: see comments above
+;
+; EXAMPLE:
+;	profile, findgen(30)^2, findgen(30)
+;	profile, findgen(30)^2, findgen(30), overplot=findgen(30)^2.2, discrete=4, title_plot='An example of profile'
+;	profile, findgen(30)^2, findgen(30), title_axis=['Dumb profile', 'Dumb Altitude']
+;
+;--------------------------------------------
+; A. Spiga, September 2007
+;--------------------------------------------
+
+
+
+;---------------------------
+; a few permanent settings
+;---------------------------
+;
+missing_value=1.e30
+SPAWN, 'touch param_plot.idl'
+@param_plot.idl
+;
+;------------------
+
+
+;-----------------------------
+; user and default settings
+;-----------------------------
+if (n_elements(title_user) eq 0) then title='Profile'
+if (n_elements(title_axis) ne 2) then begin
+	xtitle='Field'
+	ytitle='Altitude'
+endif else begin
+	xtitle=title_axis(0)
+	ytitle=title_axis(1)
+endelse	
+if (n_elements(maxfield_init) eq 0) then maxfield_init=0
+if (n_elements(minfield_init) eq 0) then minfield_init=0
+
+if (n_elements(column) eq 0) then column=findgen(n_elements(what_I_plot))
+if (n_elements(mention) eq 0) then mention='' 
+if (mention ne '') then mention='('+mention+')'
+
+;------------------
+; missing values
+;------------------
+w=where(abs(what_I_plot) gt missing_value)
+if (w(0) ne -1) then what_I_plot[w]=!Values.F_NAN
+
+
+;------------------
+; limits
+;------------------
+if (minfield_init*maxfield_init eq 0) then begin 
+	xrange=[min(what_I_plot),max(what_I_plot)]
+        print, xrange
+endif else begin
+	xrange=[minfield_init,maxfield_init]
+        print, xrange
+endelse
+
+if (xrange(0)*xrange(1) eq 0) then begin
+	print, 'nothing to plot ... skipping this plot ...'
+	stop
+endif
+
+  
+;---------------
+; adapt ticks
+;---------------
+;intervalx=round((xrange(1)-xrange(0))/5.)
+;intervaly=round(abs(max(column)-min(column))/5.)
+;intervalx=5.
+;intervaly=5.
+
+;if (n_elements(intervalx) eq 0) then intervalx=round((xrange(1)-xrange(0))/8.)
+;;if (n_elements(intervaly) eq 0) then intervaly=round((abs(max(column)-min(column))/5.))
+
+
+;; ----------------------------
+;; manage the altitude range
+;; ----------------------------
+;if (n_elements(alt) eq 2) then begin
+;	altmin=alt(0)
+;	altmax=alt(1)
+;	w=where((column ge altmin) and (column le altmax))
+;	if (n_elements(intervaly) eq 0) then intervaly=(altmax-altmin)/5
+;	if (w(0) ne -1) then begin
+;		column=column[w]
+;		what_I_plot=what_I_plot[w]
+;		minfield=min(what_I_plot)
+;		maxfield=max(what_I_plot)	
+;	endif
+;endif
+
+
+
+;-------------
+; plot
+;-------------
+plot, $
+	what_I_plot,column, $
+	xrange=xrange, $
+;	yrange=[min(column),max(column)], $
+yrange=alt, $
+	xtickinterval=intervalx, $
+	ytickinterval=intervaly, $	
+	xtitle=xtitle, $
+	ytitle=ytitle,$
+	title=title_user,$
+;/ylog, $
+	subtitle=mention 
+
+;-------------
+; overplot
+;-------------
+if (n_elements(discrete) ne 0) then begin
+if (discrete ne 0) then begin
+	!psym=discrete
+	oplot, $
+		what_I_plot,column
+	!psym=0
+endif
+endif	
+
+if (n_elements(overplot) gt 1) then begin
+	column_overplot=column
+	w=where(abs(overplot) gt missing_value)
+	if (w(0) ne -1) then overplot[w]=!Values.F_NAN
+	if (n_elements(overplot_column) gt 1) then column_overplot=overplot_column
+oplot, $
+	overplot, column_overplot, $
+	linestyle=2
+	if (n_elements(discrete) ne 0) then begin
+		!psym=discrete
+		oplot, $
+			overplot,column_overplot
+		!psym=0
+	endif	
+endif	
+
+
+
+;;--------------
+;; text inside
+;;--------------
+;if (n_elements(mention) ne 0) then begin
+;	alignx=(max(what_I_plot)+min(what_I_plot))/2
+;	aligny=max(column)-intervaly/2
+;	xyouts, alignx, $
+;		aligny, $
+;		mention
+;endif
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/ps_plotter.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/ps_plotter.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/ps_plotter.pro	(revision 207)
@@ -0,0 +1,1 @@
+link fsc/ps_plotter.pro
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/ps_start.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/ps_start.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/ps_start.pro	(revision 207)
@@ -0,0 +1,1 @@
+link fsc/ps_start.pro
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/psconfig.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/psconfig.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/psconfig.pro	(revision 207)
@@ -0,0 +1,1 @@
+link fsc/psconfig.pro
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/pswindow.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/pswindow.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/pswindow.pro	(revision 207)
@@ -0,0 +1,1 @@
+link fsc/pswindow.pro
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/reverse_ct.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/reverse_ct.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/reverse_ct.pro	(revision 207)
@@ -0,0 +1,7 @@
+PRO Reverse_CT
+
+; This program reverses the colors in the current color table.
+
+TVLCT, r, g, b, /Get
+TVLCT, Reverse(r), Reverse(g), Reverse(b)
+END
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/section.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/section.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/section.pro	(revision 207)
@@ -0,0 +1,452 @@
+pro section, $
+	what_I_plot, $				; 2D field
+	space, $				; horizontal coordinate
+	altitude, $				; altitude coordinate
+	minfield=minfield_init, $		; minimum value of plotted field (=0: calculate)
+	maxfield=maxfield_init, $		; maximum value of plotted field (=0: calculate)
+	minspace=minspace, $			; minimum value of space window (=0: calculate)
+	maxspace=maxspace, $			; maximum value of space window (=0: calculate)
+	overcontour=overcontour, $		; another 2D field to overplot with contour lines (=0: no)
+	overvector_x=overvector_x, $		; wind vector - x component (=0: no)
+	overvector_y=overvector_y, $		; wind vector - y component (=0: no)
+	colors=colors, $			; number of colors/levels (32 is default)
+	title_plot=title_user, $		; title of the plot ('Profile' is default)
+	title_axis=title_axis, $		; title of the [x,y] axis (['Field','Altitude'] is default)
+	ct=pal, $				; color table (33-rainbow is default)
+topo=topography, $
+	format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+
+	
+;--------------------------------------------
+;
+; A general routine to plot H/V section maps
+;
+; USE:	- section, what_I_plot 	
+;	- section, what_I_plot, space, altitude
+;	- ... and see options above
+;
+;--------------------------------------------
+; A. Spiga, September 2007
+;--------------------------------------------
+
+
+;---------------------------
+; a few permanent settings
+;---------------------------
+;
+missing_value=1.e30
+flag_cb='true'
+SPAWN, 'touch param_plot.idl'
+space_save=space
+@param_plot.idl
+;
+;------------------
+
+
+
+;------------------
+; user settings
+;------------------
+if (n_elements(title_user) eq 0) then title='Section' else title=title_user
+if (n_elements(subtitle_user) eq 0) then subtitle_user=''
+if (n_elements(title_axis) ne 2) then begin
+	xtitle='Horizontal coordinate'
+	ytitle='Altitude'
+endif else begin
+	xtitle=title_axis(0)
+	ytitle=title_axis(1)
+endelse	
+
+if (n_elements(space) eq 0) then begin
+	space=findgen(n_elements(what_I_plot(*,0)))
+endif
+if (n_elements(altitude) eq 0) then begin
+	altitude=findgen(n_elements(what_I_plot(0,*)))
+endif
+
+if (n_elements(minfield_init) eq 0) then minfield_init=0.
+if (n_elements(maxfield_init) eq 0) then maxfield_init=0.
+if (n_elements(minspace) eq 0) then minspace=0.
+if (n_elements(maxspace) eq 0) then maxspace=0.
+if (n_elements(minalt) eq 0) then minalt=min(altitude)
+if (n_elements(maxalt) eq 0) then maxalt=max(altitude)
+if (n_elements(colors) eq 0) then colors=32
+if (n_elements(title) eq 0) then title=''
+if (n_elements(pal) eq 0) then pal=33
+if (n_elements(format) eq 0) then format='(F6.2)'
+if (format eq '') then format='(F6.2)'
+
+if ((n_elements(overvector_x) eq 0) or (n_elements(overvector_y) eq 0)) then begin
+	overvector_x=0.
+	overvector_y=0.
+endif
+if (n_elements(overcontour) eq 0) then overcontour=0.
+
+
+;
+; dilatation factor (for winds mainly)
+;
+;if (n_elements(overvector_x)*n_elements(overvector_y) ne 1) then begin
+
+if (n_elements(spacekm) eq 0) then spacekm='false'
+
+if (n_elements(factor) ne 0.) then begin
+	if (factor eq 0.) then stop
+	space=space/factor
+	if (spacekm ne 'false') then xtitle=xtitle+' (km)'
+	xtitle=xtitle+' - divided by '+string(factor,'(I0)')
+endif else begin
+	factor=1.
+endelse	
+;endif
+	
+;------------------
+; limits
+;------------------
+;if (minfield_init*maxfield_init eq 0) then begin   
+if (minfield_init eq maxfield_init) then begin
+	;---different min/max for each layer
+	w=where(abs(what_I_plot) lt missing_value)
+	if (w(0) ne -1) then begin
+		minfield=min(what_I_plot[w])
+		maxfield=max(what_I_plot[w])
+	endif else begin
+		what_I_plot=0.
+		print, 'no valid values in this field' 
+		stop
+	endelse
+endif else begin
+	;---user-defined limits	
+	minfield=minfield_init 
+	maxfield=maxfield_init
+	;;w=where(what_I_plot lt minfield) & if (w(0) ne -1) then what_I_plot[w]=minfield
+	;;w=where(what_I_plot gt maxfield) & if (w(0) ne -1) then what_I_plot[w]=maxfield
+endelse
+
+if ((minfield+maxfield eq 0) and (abs(minfield) ne abs(maxfield))) then begin
+	print, 'nothing to plot ... skipping this plot ...'
+endif else begin
+
+
+
+;-----------------------------------------
+; fix the possible longitude ugliness :)
+; ...get rid of the -180/180 limit
+;-----------------------------------------
+
+if (spacekm ne 'true') then begin
+	w=where(space eq min(space))
+	if (w(0) ne 0) then begin
+		space[0:w(0)-1]=space[0:w(0)-1]-360
+	endif
+endif	
+
+
+;---------------
+; adapt ticks
+;---------------
+if ((minspace eq 0) and (maxspace eq 0)) then begin 
+	minspace=min(space)
+	maxspace=max(space)
+endif
+if (n_elements(intervalx) eq 0) then intervalx=round((maxspace-minspace)/8.)
+if (n_elements(intervaly) eq 0) then intervaly=round((maxalt-minalt)/5.)
+
+
+;------------------
+; plot window
+;------------------
+
+	; to ensure the right limits
+	dumb_what_I_plot=what_I_plot
+	dumb_what_I_plot(*,*)=minfield & print, minfield
+	dumb_what_I_plot(0,0)=maxfield & print, maxfield
+
+
+;xticks=sindgen(21)
+;xticks(*)=' '
+;;xticks(0)='-120'
+;;xticks(2)='-119'
+;;xticks(4)='-118'
+;;xticks(6)='-117'
+;;xticks(8)='-116'
+;;xticks(10)='-115'
+;;xticks(12)='-114'
+;;xticks(14)='-113'
+;;xticks(16)='-112'
+;;xticks(18)='-111'
+;;xticks(20)='-110'
+;xticks(0)='-110'
+;xticks(2)='-109'
+;xticks(4)='-108'
+;xticks(6)='-107'
+;xticks(8)='-106'
+;xticks(10)='-105'
+;xticks(12)='-104'
+;xticks(14)='-103'
+;xticks(16)='-102'
+;xticks(18)='-101'
+;xticks(20)='-100'
+;print, xticks
+
+loadct,0,/silent  
+contour, $
+	/nodata, $ 
+	dumb_what_I_plot, $
+	space, $
+	altitude, $
+	title=title, $
+	xtitle=xtitle, $
+	xrange=[minspace,maxspace], $
+	ytitle=ytitle, $
+	yrange=[minalt,maxalt], $
+	xtickinterval=intervalx, $
+	ytickinterval=intervaly, $
+;	position=[0.15, 0.15, 0.95, 0.75], $ ;;OLD OLD
+	position=[0.15, 0.35, 0.95, 0.95], $
+	subtitle=subtitle_user, $
+;/isotropic, $
+xtickname=xticks, $
+	color=0
+
+;if (n_elements(topography) gt 1) then begin
+;oplot, space, topography/1000.
+;print, max(topography)
+;endif
+
+;------------------
+; plot field
+;------------------
+
+; to avoid spurious blank zones
+nlevels=colors
+levp=minfield+(findgen(nlevels)/float(nlevels-1))*(maxfield-minfield)
+
+loadct,pal,/silent
+;reverse_ct
+contour, what_I_plot, $
+	space, $
+	altitude, $
+;	nlevels=colors, $
+	levels=levp, $
+	/cell_fill, $
+	max_value=maxfield, $
+	min_value=minfield, $	
+	/overplot
+
+
+;------------------
+; colorbar
+;------------------
+
+;if (flag_cb eq 'true') then begin
+;        format_colorbar=format
+;        colorbar, $
+;                position=[0.15, 0.85, 0.95, 0.90], $
+;                divisions=8, $
+;                range=[float(minfield),float(maxfield)], $
+;                format=format_colorbar
+;endif
+;goto, skip_new
+
+
+if (flag_cb eq 'true') then begin
+
+format_colorbar=format
+ndiv=10
+;ndiv=8
+pos=[0.15, 0.17, 0.95, 0.20]
+if (subtitle_user eq '') then pos=[0.15, 0.20, 0.95, 0.23]
+
+;colorbar = Obj_New("COLORBAR",$
+;        Range=[minfield,maxfield],$
+;        Ncolors=255,$
+;        charsize=0.85,$
+;        format=format_colorbar,$
+;        major=ndiv,$
+;        ticklen=-0.15,$
+;	position=pos)
+;colorbar->Draw
+;Obj_Destroy, colorbar
+
+        colorbar, $
+;                /vertical, $
+                position=pos, $
+                range=[float(minfield),float(maxfield)], $
+                divisions=ndiv, $
+                ncolors=255,$
+;               charsize=0.85,$
+                ticklen=-0.15,$
+                format=format_colorbar
+
+endif
+
+if (n_elements(nam2) ne 0) then thedate=STRSPLIT(nam2, /EXTRACT) & thedate=STRSPLIT(thedate(2),"'",/EXTRACT) & thedate=STRSPLIT(thedate(0),"_",/EXTRACT) & thedate=STRSPLIT(thedate(0),"-",/EXTRACT) & xyouts, 0.95, pos(1)-0.08, 'LMD Martian Mesoscale Model - d'+thedate(2)+'/m'+thedate(1), charsize=0.7, alignment=1., /NORMAL
+
+skip_new:
+
+;--------------------
+; overplot contour
+;--------------------
+if (n_elements(overcontour) ne 1) then begin
+
+	w=where(abs(overcontour) lt missing_value)
+	if (w(0) ne -1) then begin
+		min_contour=min(overcontour[w])
+		max_contour=max(overcontour[w])
+	endif
+
+
+; to avoid spurious blank zones
+nlevels=colors/2
+if (n_elements(lev) eq 0) then lev=min_contour+(findgen(nlevels)/float(nlevels-1))*(max_contour-min_contour)
+nlevels=n_elements(lev)
+
+;lev=round(lev)
+;yeah=UNIQ(lev) & lev=lev[yeah] 
+
+
+loadct,0,/silent
+contour, $
+	overcontour, $
+	space,altitude, $
+;	nlevels=colors/2, $
+	levels=lev, $
+	C_LINESTYLE = (lev LT 0.0), $	;; dotted lines if negative
+	max_value=max_contour, $
+	min_value=min_contour, $	
+	c_labels=findgen(nlevels), $
+	color=0, $ ;255, $ ;0, $
+	/noerase, $
+	/overplot
+;        xtickinterval=intervalx, $
+;        ytickinterval=intervaly, $
+;;/isotropic, $
+;;xtickname=xticks, $
+;	xtitle=xtitle, $
+;	xrange=[minspace,maxspace], $
+;	ytitle=ytitle, $
+;	yrange=[minalt,maxalt], $
+;position=[0.15, 0.15, 0.95, 0.75]
+
+
+
+endif
+
+;--------------------
+; overplot wind
+;--------------------
+if (n_elements(overvector_x)*n_elements(overvector_y) ne 1) then begin
+
+	w=where(abs(overvector_x) ge missing_value)  ; u and v have the same missing values ...
+	if (w(0) ne -1) then begin
+		overvector_x[w]=0.
+		overvector_y[w]=0.
+	endif
+		
+
+len=2.0
+if (n_elements(windex) eq 0) then begin
+	ref_mag=round(max(sqrt(overvector_x^2+overvector_y^2))/2)
+	;ref_mag=round(median(sqrt(overvector_x^2+overvector_y^2)))
+ref_mag=15.	;;ce qui est ci dessus deconne !!!
+endif else begin
+        ref_mag=round(windex)
+endelse	
+mytext=STRTRIM(STRING(ref_mag),2)+'ms!E-1!N'
+
+mytext=''
+
+if (n_elements(stride) eq 0) then begin
+stride=3                ; STRIDE: Pick every nth vector for plotting. (1)
+stride=2
+stride=5
+endif else begin
+stride=round(stride)
+endelse
+
+
+ref_pos=[0.10, 0.90] 	
+ref_pos=[0.20, 0.05]
+
+myu=overvector_x
+myv=overvector_y
+
+longs=space
+lats=altitude
+
+wlon=where( (space gt minspace) and (space lt maxspace) )
+wlat=where( (altitude gt minalt) and (altitude lt maxalt) )
+
+if ((wlon(0) eq -1) or (wlat(0) eq -1)) then begin
+        print, 'wrong window settings'
+ 	print, space
+	print, 'lim ',minspace,maxspace
+        print, altitude
+        print, 'lim ',minalt,maxalt
+ 	stop
+endif
+
+myu=dblarr(n_elements(space),n_elements(altitude))
+myv=dblarr(n_elements(space),n_elements(altitude))
+
+myu(*,*)=!Values.F_NAN
+myv(*,*)=!Values.F_NAN
+
+for i=0,n_elements(wlon)-1 do begin
+for j=0,n_elements(wlat)-1 do begin
+        myu(wlon(i),wlat(j))=overvector_x(wlon(i),wlat(j))
+        myv(wlon(i),wlat(j))=overvector_y(wlon(i),wlat(j))
+endfor
+endfor
+
+
+	;; eliminate vector for colorbar clarity ?
+	;nxs=1
+	;nxe=n_elements(longs(*))-2
+	;nys=1
+	;nye=n_elements(lats(*))-2
+	;myu=overvector_x(nxs:nxe,nys:nye)
+	;myv=overvector_y(nxs:nxe,nys:nye)
+	;longs=space(nxs:nxe)
+	;lats=altitude(nys:nye)
+
+
+;;---------------------------
+;;
+;factor=float(mean(overvector_x^2))/float(mean(overvector_y^2))
+;factor=sqrt(factor)
+;factor=factor/2
+;
+;factor=6.
+;factor=12.
+;factor=15.
+;
+;print, 'X/Z correction factor', factor
+;
+;;rapport ordre de grandeur entre mouvements verticaux et horizontaux
+;;
+;;---------------------------
+
+
+myv=myv*factor
+
+
+loadct,0,/silent
+VECTOR, myu, myv, longs, lats, LENGTH=len, REF_MAG=ref_mag,$
+        STRIDE=stride, TYPE=2, HEAD_LEN=0.3, ANGLE=30, $
+;	REF_POS=ref_pos, $
+;	REF_TEXT=mytext,$
+        ALIGN=0.5, COLOR=1, /OVERPLOT;, /NOERASE
+
+endif
+
+
+endelse
+
+space=space_save	;; careful with sequential call to section.pro
+			;; combined with modified space (e.g. with factor)
+			;; -- this save fix the issue
+
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/tvimage.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/tvimage.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/tvimage.pro	(revision 207)
@@ -0,0 +1,1 @@
+link fsc/tvimage.pro
Index: trunk/MESOSCALE_DEV/PLOT/MINIMAL/vector.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/MINIMAL/vector.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/MINIMAL/vector.pro	(revision 207)
@@ -0,0 +1,119 @@
+; vector.pro
+; vector plotting routine 
+; see http://cgam.nerc.ac.uk/graphics/idl.php for more details
+
+; Calling procedure:
+; VECTOR, U, V, X, Y
+; U and V are the vector components as two dimensional arrays.
+; X and Y are the vectors locations as one dimensional arrays.
+;
+; Optional parameters:
+; LENGTH: Length of the vector, default=1 which is 300 pixels.
+; OVERPLOT: Set this to overplot the current graphics plot.
+; STRIDE: Pick every nth vector for plotting.
+; TYPE:   Type of arrow head. 0-4, default=0
+; ANGLE:  Angle of vector head in degrees, default=22.5.
+; HEAD_LEN: Length of the arrow head relative to shaft, default=0.3
+; ALIGN:  Alignment of arrow.  Default is 0.5, range=0.0 to 1.0.
+; REF_MAG: Arrow magnitude.
+; REF_POS: Position for reference vector in normalised coordinates [x,y].
+; REF_TEXT: Text to place to the left of the reference vector.
+; COLOR: Color index of vectors
+		
+PRO VECTOR, u,v,x,y, LENGTH = length,$
+        Color=color, STRIDE=stride, ALIGN=align, $
+	REF_MAG=ref_mag, TYPE=type, ANGLE=angle, HEAD_LEN=head_len,$
+	REF_POS=ref_pos, REF_TEXT=ref_text, OVERPLOT=overplot, _EXTRA=extra
+
+;Check mapping is cylindrical or not set - reject if otherwise.
+IF ((!MAP.PROJECTION NE 0) AND (!MAP.PROJECTION NE 8)) THEN BEGIN
+  PRINT, 'Mapping must be cylindrical or unset to use the vector routine'
+  RETURN
+ENDIF
+
+;Basic checks of the input data
+a=SIZE(u)
+b=SIZE(v)
+c=SIZE(x)
+d=SIZE(y)
+IF ((a[0] NE 2) OR (b[0] NE 2)) THEN BEGIN
+  PRINT, 'u and v must be two dimensional'
+  RETURN
+ENDIF
+IF (TOTAL(ABS(b[0:2]-a[0:2])) NE 0) THEN BEGIN
+  PRINT, 'u and v must have the same size'
+  RETURN
+ENDIF
+IF ((c[0] NE 1) AND (d[0] NE 1)) THEN BEGIN
+  PRINT, 'x and y must be one dimensional'
+  RETURN
+ENDIF
+IF ((c[1]-a[1]) NE 0) THEN BEGIN
+  PRINT, 'u and x have mismatched sizes'
+  RETURN
+ENDIF
+IF ((d[1]-b[2]) NE 0) THEN BEGIN
+  PRINT, 'v and y have mismatched sizes'
+  RETURN
+ENDIF
+
+;Initialise parameters if undefined
+IF (N_ELEMENTS(STRIDE) EQ 0) THEN stride=0
+IF N_ELEMENTS(LENGTH) EQ 0 THEN length=1.0
+IF N_ELEMENTS(COLOR) EQ 0 THEN color = !P.COLOR
+IF (N_ELEMENTS(ANGLE) EQ 0) THEN angle=22.5
+IF (N_ELEMENTS(HEAD_LEN) EQ 0) THEN head_len=0.3
+IF (N_ELEMENTS(TYPE) EQ 0) THEN TYPE=0
+IF (N_ELEMENTS(ALIGN) EQ 0) THEN align=0.5	
+IF (N_ELEMENTS(REF_TEXT) EQ 0) THEN ref_text=' '
+IF (N_ELEMENTS(REF_MAG) EQ 0) THEN BEGIN
+  maxmag=MAX(ABS(SQRT(u^2.+v^2.)))
+ENDIF ELSE BEGIN
+  maxmag=ref_mag
+ENDELSE
+
+;Setup the plot area if undefined
+IF (NOT KEYWORD_SET(overplot)) THEN BEGIN
+  xs=x[0]-(x(1)-x(0))
+  xf=x[N_ELEMENTS(x)-1]+(x(1)-x(0))
+  ys=y[0]-(y(1)-y(0))
+  yf=y[N_ELEMENTS(y)-1]+(y(1)-y(0))  
+  PLOT,[xs,xf],[ys,yf], XSTYLE=1, YSTYLE=1, /NODATA,$
+       COLOR=color, _EXTRA = extra
+ENDIF
+
+;Do stride data reduction if needed	
+IF (stride GT 1) THEN BEGIN
+  mypts=FLTARR(a[1], a[2])
+  mypts[*,*]=0.0	   
+  FOR iy=0,a[2]-1,stride DO BEGIN
+  FOR ix=0,a[1]-1,stride DO BEGIN
+    IF ( ((ix/stride) EQ FIX(ix/stride)) AND $
+         ((iy/stride) EQ FIX(iy/stride)) ) THEN mypts[ix,iy]=1.0
+  ENDFOR
+  ENDFOR
+  pts=WHERE(mypts LT 1.0)
+  u[pts]=0.0
+  v[pts]=0.0
+ENDIF 
+
+;Main vector plotting loop
+FOR ix=0, N_ELEMENTS(x)-1 DO BEGIN
+FOR iy=0, N_ELEMENTS(y)-1 DO BEGIN
+  PLOT_VECTOR, u(ix,iy), v(ix,iy), x(ix), y(iy), type=type, $
+               angle=angle, head_len=head_len,$
+               maxmag=maxmag, align=align, length=length,$
+	       color=color, cstyle=0
+ENDFOR
+ENDFOR
+
+;Plot a reference vector if requested
+IF (N_ELEMENTS(REF_POS) NE 0) THEN BEGIN
+  PLOT_VECTOR, maxmag, 0.0, ref_pos[0], ref_pos[1], type=type, $
+               angle=angle, ref_text=ref_text, head_len=head_len,$
+               maxmag=maxmag, align=align, length=length,$
+	       color=color, cstyle=1
+ENDIF
+
+END
+
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/map_ecmwf.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/map_ecmwf.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/map_ecmwf.py	(revision 207)
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+
+##########################################################################
+var = ["151","146","167"]
+#var = ["167"]
+lev = ["700.","850."]
+tim = ["00"]
+date = ['10','08','2010','10','08','2010']
+dataset = ["an","pl","0"]
+dataset = ["fc","sfc","3"]
+##########################################################################
+proj = "cyl"  #"moll" "ortho" "lcc"
+#proj = "ortho"
+area = "Europe"
+#area = "Central_America"
+#area = "Southern_Hemisphere"
+#area = "Northern_Hemisphere"
+##########################################################################
+
+
+##########################################################################
+import 	numpy 				as np
+import 	matplotlib.pyplot 		as plt
+import  myplot				as myp
+import  myecmwf				as mye
+##########################################################################
+if dataset[1] == "sfc": lev = [9999.]
+[wlon,wlat] = myp.latinterv(area)
+nc = mye.get_ecmwf (var, dataset, wlat, wlon, lev, date, tim) 
+##########################################################################
+lat    = nc.variables['lat'             ][:]
+lon    = nc.variables['lon'             ][:]
+[lon2d,lat2d] = np.meshgrid(lon,lat)
+step=10.
+##########################################################################
+ntime = 0
+for i in range( np.array(var).size ):
+	for j in range( np.array(lev).size ):
+		for k in range( np.array(tim).size ):
+			if dataset[1] == "pl":	field  = nc.variables['var'+var[i]	][k,j,:,:]
+			if dataset[1] == "sfc":	field  = nc.variables['var'+var[i]  	][k,  :,:]
+			m = myp.define_proj(proj,wlon,wlat)
+			x, y = m(lon2d, lat2d)
+			#m.drawmeridians(np.r_[wlon[0]:wlon[1]:step*2], labels=[0,0,0,1], color='grey')
+			#m.drawparallels(np.r_[wlat[0]:wlat[1]:step  ], labels=[1,0,0,0], color='grey')
+			m.bluemarble()
+			#m.warpimage(myp.earthmap("nice"))
+			zeplot = m.contour(x, y, field, 20)
+			plt.clabel(zeplot, inline=1, inline_spacing=1, fontsize=7, fmt='%0i')
+			#plt.colorbar(fraction=0.05,pad=0.1)
+			plt.title(mye.ecmwf_title_field(var[i]))
+			name = str(var[i])+str(lev[j])+str(tim[k])+".png"
+			plt.savefig(name)
+			plt.clf()
+			yeah = myp.display(name)
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/map_mars_polar.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/map_mars_polar.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/map_mars_polar.py	(revision 207)
@@ -0,0 +1,83 @@
+#!/usr/bin/env python
+
+##########################################################################
+import  numpy                           as np
+import  myplot                          as myp
+import  mymath				as mym
+import  netCDF4
+import  matplotlib.pyplot as plt
+##########################################################################
+namefile  = '/home/aslmd/POLAR/POLAR_APPERE_highres/wrfout_d01_2024-03-04_06:00:00_zabg'
+namefile2 = '/home/aslmd/POLARWATERCYCLE/wrfout_d01_2024-05-03_01:00:00_zabg' 
+nc  = netCDF4.Dataset(namefile)
+[lon2d,lat2d] = myp.getcoord2d(nc)
+##########################################################################
+ntime = 5
+nvert = 1
+u   = nc.variables['Um'   ][ntime,nvert,:,:]
+v   = nc.variables['Vm'   ][ntime,nvert,:,:]
+##########################################################################
+plt.figure(1)
+##########################################################################
+[lon2d,lat2d] = myp.getcoord2d(nc)
+[wlon,wlat] = myp.latinterv("North_Pole")
+#plt.title("Polar mesoscale domain")
+m = myp.define_proj("ortho",wlon,wlat,back="vishires")
+x, y = m(lon2d, lat2d)
+m.pcolor(x, y, nc.variables['HGT'][0,:,:] / 1000.)
+###########################################################################
+myp.makeplotpng("mars_polar_mesoscale_1",folder="/u/aslmd/WWW/antichambre/",pad_inches_value=0.15)
+###########################################################################
+plt.figure(2)
+plt.subplot(121)
+[lon2d,lat2d] = myp.getcoord2d(nc)
+[wlon,wlat] = myp.latinterv("Close_North_Pole")
+plt.title("Near-surface winds at Ls=60"+mym.deg())
+m = myp.define_proj("npstere",wlon,wlat,back="vishires")
+x, y = m(lon2d, lat2d)
+myp.vectorfield(u, v, x, y, stride=5, csmooth=6, scale=15., factor=200., color='darkblue')
+###########################################################################
+plt.subplot(122)
+[wlon,wlat] = [[-180.,180.],[84.,90.]]
+plt.title("+ sensible heat flux (W/m2)")
+m = myp.define_proj("npstere",wlon,wlat,back="vishires")
+x, y = m(lon2d, lat2d)
+zeplot = m.contour(x, y, -nc.variables['HFX'][ntime,:,:],[-2.,0.,2.,4.,6.,8.,10.,12.],cmap=plt.cm.Reds)
+plt.clabel(zeplot, inline=1, inline_spacing=1, fontsize=7, fmt='%0i')
+myp.vectorfield(u, v, x, y, stride=2, scale=15., factor=200., color='darkblue')
+#plt.colorbar(pad=0.1).set_label('Downward sensible heat flux [W/m2]')
+###########################################################################
+myp.makeplotpng("mars_polar_mesoscale_2",folder="/u/aslmd/WWW/antichambre/",pad_inches_value=0.35)
+###########################################################################
+nc = netCDF4.Dataset(namefile2)
+[lon2d,lat2d] = myp.getcoord2d(nc)
+##########################################################################
+plt.figure(3)
+###########################################################################
+[wlon,wlat] = [[mym.min(lon2d),mym.max(lon2d)],[mym.min(lat2d)+7.,mym.max(lat2d)]]
+#plt.figure(2)
+#plt.title("Water vapor (pr.mic)")
+#field = np.array(nc.variables['MTOT'])
+#nnn = field.shape[2]
+#ye = plt.contour(	np.arange(field.shape[0]),\
+#			np.linspace(wlat[0],wlat[1],nnn),\
+#			np.transpose(mym.mean(field,axis=1)),\
+#			np.arange(0.,100.,5.))
+#plt.clabel(ye, inline=1, inline_spacing=1, fontsize=7, fmt='%0i')
+############################################################################
+sub = 121
+for i in range(3,23,12):
+	print i,sub
+	plt.subplot(sub)
+	plt.title("H2Ovap (pr.mic) UTC "+str(i+1)+":00")
+	m = myp.define_proj("npstere",wlon,wlat,back="vishires")
+	x, y = m(lon2d, lat2d)
+	yeah = m.contour(x, y, nc.variables['MTOT'][i,:,:],np.arange(30.,90.,10.),linewidths=1.0)
+	plt.clabel(yeah, inline=1, inline_spacing=1, width=1.0, fontsize=7, fmt='%0i')
+	sub += 1
+	print sub
+############################################################################
+myp.makeplotpng("mars_polar_mesoscale_3",folder="/u/aslmd/WWW/antichambre/", pad_inches_value=0.15)
+############################################################################
+
+#yeah = m.contour(x, y, mym.mean(nc.variables['MTOT'],axis=0),np.arange(0.,75.,5.),cmap=plt.cm.gist_rainbow,linewidths=1.5)
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/api_g95.sh
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/api_g95.sh	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/api_g95.sh	(revision 207)
@@ -0,0 +1,11 @@
+#! /bin/bash
+
+#NETCDF=/distrib/local/netcdf-4.0.1/g95_4.0.3_64/
+#echo $NETCDF
+
+touch logc
+touch loge
+\rm logc
+\rm loge
+f2py -c -m api ../../../LMD_MM_MARS/SRC/POSTPROC/api.F90 --fcompiler=g95 -L$NETCDF/lib -lnetcdf -lm -I$NETCDF/include --f90flags="-Wall -Wno=112,141,137,155 -fno-second-underscore -ffree-form" > logc 2> loge
+f2py -c -m timestuff time.F --fcompiler=g95 >> logc 2>> loge
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/api_pgf90.sh
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/api_pgf90.sh	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/api_pgf90.sh	(revision 207)
@@ -0,0 +1,15 @@
+#! /bin/bash
+
+
+#NETCDF=/distrib/local/netcdf-4.0.1/pgi_7.1-6_32/
+#NETCDF=/distrib/local/netcdf-4.0.1/pgi_7.1-6_64/
+#NETCDF=/distrib/local/netcdf-3.6.0-p1/pgi_64bits/
+NETCDF=/donnees/aslmd/MODELES/MESOSCALE/NETCDF/pgf90_64_fpic/netcdf-3.6.1/
+echo $NETCDF
+
+touch logc
+touch loge
+\rm logc
+\rm loge
+f2py -c -m api ../../../LMD_MM_MARS/SRC/POSTPROC/api.F90 --fcompiler=pg -L$NETCDF/lib -lnetcdf -lm -I$NETCDF/include --f90flags="-Mfree" > logc 2> loge
+f2py -c -m timestuff time.F --fcompiler=pg >> logc 2>> loge
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/api_wrapper.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/api_wrapper.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/api_wrapper.py	(revision 207)
@@ -0,0 +1,35 @@
+
+### A. Spiga -- LMD -- 03/07/2011
+
+def api_onelevel (  path_to_input   = './', \
+                    input_name      = 'wrfout_d0?_????-??-??_??:00:00', \
+                    path_to_output  = None, \
+                    output_name     = None, \
+                    process         = 'list', \
+                    fields          = 'tk,W,uvmet,HGT', \
+                    debug           = False, \
+                    bit64           = False, \
+                    oldvar          = True, \
+                    interp_method   = 4, \
+                    extrapolate     = 0, \
+                    unstagger_grid  = False, \
+                    onelevel        = 0.020, \
+                    nocall          = False ):
+    import api
+    import numpy as np
+
+    if not path_to_output:  path_to_output = path_to_input
+
+    if not output_name:
+        if interp_method <= 2:    output_name = input_name+'_p'
+        if interp_method == 3:    output_name = input_name+'_z'
+        if interp_method == 4:    output_name = input_name+'_zabg'
+
+    print input_name, output_name
+
+    if nocall:     pass
+    else:          api.api_main ( path_to_input, input_name, path_to_output, output_name, \
+                   process, fields, debug, bit64, oldvar, np.arange(299), \
+                   interp_method, extrapolate, unstagger_grid, onelevel )
+
+    return output_name
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/ecmwf.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/ecmwf.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/ecmwf.py	(revision 207)
@@ -0,0 +1,101 @@
+import urllib
+import urllib2
+import time
+import datetime
+
+class ECMWFDataServer:
+    def __init__(self,portal,token,email):
+        self.version = '0.3'
+        self.portal  = portal
+        self.token   = token
+        self.email   = email
+
+    def _call(self,action,args):
+
+        params = {'_token'   : self.token,
+                  '_email'   : self.email,
+                  '_action'  : action,
+                  '_version' : self.version}
+        params.update(args)
+            
+        data = urllib.urlencode(params)
+        req = urllib2.Request(self.portal, data)
+        response = urllib2.urlopen(req)
+
+        json = response.read();
+
+        undef = None;
+        json = eval(json)
+
+        if json != None:
+            if 'error' in json:
+                raise RuntimeError(json['error'])
+            if 'message' in json:
+                self.put(json['message'])
+
+        return json
+
+    def put(self,*args):
+        print datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
+        for a in args:
+            print a,
+        print
+
+        
+    def retrieve(self,args):
+        self.put("ECMWF data server batch tool version",self.version);
+        user = self._call("user_info",{});
+        self.put("Welcome to",user['name'], "from" , user['organisation']);
+
+        r = self._call('retrieve',args)
+        rid = r['request']
+
+        last  = ''
+        sleep = 0
+        while r['status'] != 'complete' and r['status'] != 'aborted':
+            text = r['status'] + '.'
+            if 'info' in r and r['info'] != None:
+                text = text + ' ' + r['info'] 
+
+            if text != last:
+                self.put("Request",text)
+                last = text
+
+            time.sleep(sleep)
+            r = self._call('status',{'request':rid})
+            if sleep < 60:
+                sleep = sleep + 1
+
+        if r['status'] != last:
+            self.put("Request",r['status'])
+
+        if 'reason' in r:
+            for m in r['reason']:
+                self.put(m)
+
+        if 'result' in r:
+            size = long(r['size'])
+            self.put("Downloading",self._bytename(size))
+            done = self._transfer(r['result'],args['target'])
+            self.put("Done")
+            if done != size:
+                raise RuntimeError("Size mismatch: " + str(done) + " and " + str(size))
+
+        self._call('delete',{'request':rid})
+        
+        if r['status'] == 'aborted':
+            raise RuntimeError("Request aborted")
+        
+    def _transfer(self,url,path):
+        result =  urllib.urlretrieve(url,path)
+        return long(result[1]['content-length'])
+        
+    def _bytename(self,size):   
+        next = {'':'K','K':'M','M':'G','G':'T','T':'P'}
+        l    = ''
+        size = size*1.0
+        while 1024 < size:
+            l = next[l]
+            size = size / 1024
+        return "%g %sbyte%s" % (size,l,'s')
+
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/myecmwf.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/myecmwf.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/myecmwf.py	(revision 207)
@@ -0,0 +1,51 @@
+def ecmwf_title_field (var):
+	### http://www.ecmwf.int/services/archive/d/table/grib_table_2_versions
+	### http://www.ecmwf.int/services/archive/d/parameters/mars=1/order=grib_parameter/table=128/
+	### http://www.atmos.albany.edu/facstaff/rmctc/ecmwfGrib/ecmwfgrib128.tbl
+	if   var == "151": name="Mean Sea Level Pressure (Pa)"          # ["151", "fc", "3", "sfc"]
+	elif var == "146": name="Sensible Heat Flux (W m^-2)"           # ["146", "fc", "3", "sfc"]
+	elif var == "130": name="Atmospheric Temperature (K)"           # ["130", "an", "0", "pl" ]
+	elif var == "167": name="2m Atmospheric Temperature (K)"        # ["167", "fc", "3", "sfc"]
+	return name
+
+def split_char_add (var,add):
+	import  numpy as np
+	varchar = ""
+	for i in range( np.array(var).size ):
+		varchar = varchar + str(var[i]) + add + "/"
+	return varchar
+
+def split_char (var):
+	varchar = split_char_add (var,"")
+	return varchar
+
+def get_ecmwf (var, dataset, wlat, wlon, lev, date, tim):
+	from ecmwf 	import ECMWFDataServer
+	from os		import system
+	from netCDF4	import Dataset
+	gbfile = 'output.grib'
+	ncfile = 'output.nc'
+	######
+	timchar = split_char (tim)
+	levchar = split_char (lev)
+	varchar = split_char_add (var,".128")
+	##########################################################################
+	## First registrer at http://data-portal.ecmwf.int/data/d/license/interim/
+	## Then get your token at http://data-portal.ecmwf.int/data/d/token/interim_daily/
+	server = ECMWFDataServer('http://data-portal.ecmwf.int/data/d/dataserver/','6948746482e9e3e29d64211e06329a2e','spiga@lmd.jussieu.fr')
+	server.retrieve({
+		'dataset'  : "interim_daily",
+		'date'     : date[2] + date[1] + date[0] + "/to/" + date[5] + date[4] + date[3],
+		'time'     : timchar,
+		'step'     : dataset[2],
+		'levtype'  : dataset[1],
+		'type'     : dataset[0],
+		'param'    : varchar,
+		'levelist' : levchar,   
+		'area'     : str(wlat[0])+"/"+str(wlon[0])+"/"+str(wlat[1])+"/"+str(wlon[1]),
+		'target'   : gbfile
+	})
+	system("cdo -f nc copy "+gbfile+" "+ncfile+" ; rm -f "+gbfile)
+	nc = Dataset(ncfile)
+	#system("rm -f "+ncfile)
+	return nc
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/mymath.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/mymath.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/mymath.py	(revision 207)
@@ -0,0 +1,15 @@
+def min (field,axis=None): 
+        import numpy as np
+        return np.array(field).min(axis=axis)
+
+def max (field,axis=None):
+        import numpy as np
+        return np.array(field).max(axis=axis)
+
+def mean (field,axis=None):
+        import numpy as np
+        return np.array(field).mean(axis=axis)
+
+def deg ():
+        return u'\u00b0'
+
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/myplot.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/myplot.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/myplot.py	(revision 207)
@@ -0,0 +1,307 @@
+def latinterv (area):
+	if   area == "Europe": 
+		wlat = [20.,80.]
+		wlon = [-50.,50.]
+	elif area == "Central_America":
+		wlat = [-10.,40.]
+		wlon = [230.,300.]
+	elif area == "Africa":
+		wlat = [-20.,50.]
+		wlon = [-50.,50.]
+	elif area == "Whole":
+		wlat = [-90.,90.]
+		wlon = [-180.,180.]
+	elif area == "Southern_Hemisphere":
+		wlat = [-90.,60.]
+		wlon = [-180.,180.]
+        elif area == "Northern_Hemisphere":
+                wlat = [-60.,90.]
+                wlon = [-180.,180.]
+        elif area == "Tharsis":
+		wlat = [-30.,60.]
+		wlon = [-170.,-10.]
+	elif area == "Whole_No_High":
+		wlat = [-60.,60.]
+		wlon = [-180.,180.]
+	elif area == "Chryse":
+                wlat = [-60.,60.]
+                wlon = [-60.,60.]
+        elif area == "North_Pole":
+                wlat = [60.,90.]
+                wlon = [-180.,180.]
+        elif area == "Close_North_Pole":
+                wlat = [75.,90.]
+                wlon = [-180.,180.]
+	return wlon,wlat
+
+#def landers (map) 
+#    map.plot(blue_calf_lon,blue_calf_lat, 'gs')
+#    return
+
+def getlschar ( namefile ):
+    #### strangely enough this does not work for api or ncrcat results!
+    from netCDF4 import Dataset
+    from timestuff import sol2ls
+    nc  = Dataset(namefile)
+    if 'Times' in nc.variables and 'vert' not in nc.variables:
+        zetime = nc.variables['Times'][0]
+        zetimestart = getattr(nc, 'START_DATE')
+        zeday = int(zetime[8]+zetime[9]) - int(zetimestart[8]+zetimestart[9])
+        if zeday < 0:    lschar=""  ## might have crossed a month... fix soon
+        else:            lschar="_Ls"+str( int( sol2ls ( getattr( nc, 'JULDAY' ) + zeday ) ) )
+        ###
+        zetime2 = nc.variables['Times'][1]
+        one  = int(zetime[11]+zetime[12]) + int(zetime[14]+zetime[15])/37.
+        next = int(zetime2[11]+zetime2[12]) + int(zetime2[14]+zetime2[15])/37. 
+        zehour    = one
+        zehourin  = abs ( next - one )
+    else:
+        lschar=""
+        zehour = 0
+        zehourin = 1  
+    return lschar, zehour, zehourin
+
+def getprefix (nc):
+    prefix = 'LMD_MMM_'
+    prefix = prefix + 'd'+str(getattr(nc,'GRID_ID'))+'_'
+    prefix = prefix + str(int(getattr(nc,'DX')/1000.))+'km_'
+    return prefix
+
+def getproj (nc):
+    map_proj = getattr(nc, 'MAP_PROJ')
+    cen_lat  = getattr(nc, 'CEN_LAT')
+    if map_proj == 2:
+        if cen_lat > 10.:    
+            proj="npstere"
+            print "NP stereographic polar domain" 
+        else:            
+            proj="spstere"
+            print "SP stereographic polar domain"
+    elif map_proj == 1: 
+        print "lambert projection domain" 
+        proj="lcc"
+    elif map_proj == 3: 
+        print "mercator projection"
+        proj="merc"
+    else:
+        proj="merc"
+    return proj    
+
+def ptitle (name):
+    from matplotlib.pyplot import title
+    title(name)
+    print name
+
+def simplinterv (lon2d,lat2d):
+    import numpy as np
+    return [[np.min(lon2d),np.max(lon2d)],[np.min(lat2d),np.max(lat2d)]]
+
+def wrfinterv (lon2d,lat2d):
+    nx = len(lon2d[0,:])-1
+    ny = len(lon2d[:,0])-1
+    return [[lon2d[0,0],lon2d[nx,ny]],[lat2d[0,0],lat2d[nx,ny]]]
+
+def makeplotpngres (filename,res,pad_inches_value=0.25,folder='',disp=True):
+    import  matplotlib.pyplot as plt
+    res = int(res)
+    name = filename+"_"+str(res)+".png"
+    if folder != '':      name = folder+'/'+name
+    plt.savefig(name,dpi=res,bbox_inches='tight',pad_inches=pad_inches_value)
+    if disp:              display(name)		
+    return
+
+def makeplotpng (filename,pad_inches_value=0.25,minres=100.,folder=''):
+    makeplotpngres(filename,minres,     pad_inches_value=pad_inches_value,folder=folder)
+    makeplotpngres(filename,minres+200.,pad_inches_value=pad_inches_value,folder=folder,disp=False)
+    return
+
+def dumpbdy (field):
+    nx = len(field[0,:])-1
+    ny = len(field[:,0])-1
+    return field[5:ny-5,5:nx-5]
+
+def getcoord2d (nc,nlat='XLAT',nlon='XLONG',is1d=False):
+    import numpy as np
+    if is1d:
+        lat = nc.variables[nlat][:]
+        lon = nc.variables[nlon][:]
+        [lon2d,lat2d] = np.meshgrid(lon,lat)
+    else:
+        lat = nc.variables[nlat][0,:,:]
+        lon = nc.variables[nlon][0,:,:]
+        [lon2d,lat2d] = [lon,lat]
+    return lon2d,lat2d
+
+def smooth (field, coeff):
+	## actually blur_image could work with different coeff on x and y
+	if coeff > 1:	result = blur_image(field,int(coeff))
+	else:		result = field
+	return result
+
+def gauss_kern(size, sizey=None):
+	import numpy as np
+	## FROM COOKBOOK http://www.scipy.org/Cookbook/SignalSmooth	
+    	# Returns a normalized 2D gauss kernel array for convolutions
+    	size = int(size)
+    	if not sizey:
+	        sizey = size
+	else:
+	        sizey = int(sizey)
+	x, y = np.mgrid[-size:size+1, -sizey:sizey+1]
+	g = np.exp(-(x**2/float(size)+y**2/float(sizey)))
+	return g / g.sum()
+
+def blur_image(im, n, ny=None) :
+	from scipy.signal import convolve
+	## FROM COOKBOOK http://www.scipy.org/Cookbook/SignalSmooth
+	# blurs the image by convolving with a gaussian kernel of typical size n. 
+	# The optional keyword argument ny allows for a different size in the y direction.
+    	g = gauss_kern(n, sizey=ny)
+    	improc = convolve(im, g, mode='same')
+    	return improc
+
+def getwinds (nc,charu='Um',charv='Vm'):
+    import numpy as np
+    u = nc.variables[charu]
+    v = nc.variables[charv]
+    if charu == 'U': u = u[:, :, :, 0:len(u[0,0,0,:])-1]
+    if charv == 'V': v = v[:, :, 0:len(v[0,0,:,0])-1, :]
+                     ### ou alors prendre les coordonnees speciales
+    return u,v
+
+def vectorfield (u, v, x, y, stride=3, scale=15., factor=250., color='black', csmooth=1, key=True):
+    ## scale regle la reference du vecteur
+    ## factor regle toutes les longueurs (dont la reference). l'AUGMENTER pour raccourcir les vecteurs.
+    import  matplotlib.pyplot               as plt
+    import  numpy                           as np
+    posx = np.min(x) - np.std(x) / 10.
+    posy = np.min(y) - np.std(y) / 10.
+    u = smooth(u,csmooth)
+    v = smooth(v,csmooth)
+    widthvec = 0.003 #0.005 #0.003
+    q = plt.quiver( x[::stride,::stride],\
+                    y[::stride,::stride],\
+                    u[::stride,::stride],\
+                    v[::stride,::stride],\
+                    angles='xy',color=color,\
+                    scale=factor,width=widthvec )
+    if color in ['white','yellow']:     kcolor='black'
+    else:                               kcolor=color
+    if key: p = plt.quiverkey(q,posx,posy,scale,\
+                   str(int(scale)),coordinates='data',color=kcolor,labelpos='S',labelsep = 0.03)
+    return 
+
+def display (name):
+    from os import system
+    system("display "+name+" > /dev/null 2> /dev/null &")
+    return name
+
+def findstep (wlon):
+    steplon = int((wlon[1]-wlon[0])/4.)  #3
+    step = 120.
+    while step > steplon and step > 15. :       step = step / 2.
+    if step <= 15.:
+        while step > steplon and step > 5.  :   step = step - 5.
+    if step <= 5.:
+        while step > steplon and step > 1.  :   step = step - 1.
+    if step <= 1.:
+        step = 1. 
+    return step
+
+def define_proj (char,wlon,wlat,back="."):
+    from    mpl_toolkits.basemap            import Basemap
+    import  numpy                           as np
+    import  matplotlib                      as mpl
+    meanlon = 0.5*(wlon[0]+wlon[1])
+    meanlat = 0.5*(wlat[0]+wlat[1])
+    if   wlat[0] >= 80.:   blat =  40. 
+    elif wlat[0] <= -80.:  blat = -40. 
+    else:                  blat = wlat[0]
+    h = 50.  ## en km
+    radius = 3397200.
+    if   char == "cyl":     m = Basemap(rsphere=radius,projection='cyl',\
+                              llcrnrlat=wlat[0],urcrnrlat=wlat[1],llcrnrlon=wlon[0],urcrnrlon=wlon[1])
+    elif char == "moll":    m = Basemap(rsphere=radius,projection='moll',lon_0=meanlon)
+    elif char == "ortho":   m = Basemap(rsphere=radius,projection='ortho',lon_0=meanlon,lat_0=meanlat)
+    elif char == "lcc":     m = Basemap(rsphere=radius,projection='lcc',lat_1=meanlat,lat_0=meanlat,lon_0=meanlon,\
+                              llcrnrlat=wlat[0],urcrnrlat=wlat[1],llcrnrlon=wlon[0],urcrnrlon=wlon[1])
+    elif char == "npstere": m = Basemap(rsphere=radius,projection='npstere', boundinglat=blat, lon_0=0.)
+    elif char == "spstere": m = Basemap(rsphere=radius,projection='spstere', boundinglat=blat, lon_0=0.)
+    elif char == "nplaea":  m = Basemap(rsphere=radius,projection='nplaea', boundinglat=wlat[0], lon_0=meanlon)
+    elif char == "laea":    m = Basemap(rsphere=radius,projection='laea',lon_0=meanlon,lat_0=meanlat,lat_ts=meanlat,\
+                              llcrnrlat=wlat[0],urcrnrlat=wlat[1],llcrnrlon=wlon[0],urcrnrlon=wlon[1])
+    elif char == "nsper":   m = Basemap(rsphere=radius,projection='nsper',lon_0=meanlon,lat_0=meanlat,satellite_height=h*1000.)
+    elif char == "merc":    m = Basemap(rsphere=radius,projection='merc',lat_ts=0.,\
+                              llcrnrlat=wlat[0],urcrnrlat=wlat[1],llcrnrlon=wlon[0],urcrnrlon=wlon[1])
+    fontsizemer = int(mpl.rcParams['font.size']*3./4.)
+    if char in ["cyl","lcc","merc","nsper","laea"]:   step = findstep(wlon)
+    else:                                             step = 10.
+    m.drawmeridians(np.r_[-180.:180.:step*2.], labels=[0,0,0,1], color='grey', fontsize=fontsizemer)
+    m.drawparallels(np.r_[-90.:90.:step], labels=[1,0,0,0], color='grey', fontsize=fontsizemer)
+    if back == ".":      m.warpimage(marsmap(),scale=0.75)
+    elif back == None:   pass 
+    else:                m.warpimage(marsmap(back),scale=0.75)
+    return m
+
+def fmtvar (whichvar="def"):
+    fmtvar    =     { \
+             "tk":           "%.0f",\
+             "tpot":         "%.0f",\
+             "def":          "%.1e",\
+             "PTOT":         "%.0f",\
+             "HGT":          "%.1e",\
+             "USTM":         "%.2f",\
+                    }
+    if whichvar not in fmtvar:
+        whichvar = "def"
+    return fmtvar[whichvar]
+
+def defcolorb (whichone="def"):
+    whichcolorb =    { \
+             "def":          "spectral",\
+             "HGT":          "spectral",\
+             "tk":           "gist_heat",\
+             "QH2O":         "PuBu",\
+             "USTM":         "YlOrRd",\
+#"RdPu",\
+                     }
+    if whichone not in whichcolorb:
+        whichone = "def"
+    return whichcolorb[whichone]
+
+def definecolorvec (whichone="def"):
+        whichcolor =    { \
+                "def":          "black",\
+                "vis":          "yellow",\
+                "vishires":     "yellow",\
+                "molabw":       "yellow",\
+                "mola":         "black",\
+                "gist_heat":    "white",\
+                "hot":          "tk",\
+                "gist_rainbow": "black",\
+                "spectral":     "black",\
+                "gray":         "red",\
+                "PuBu":         "black",\
+                        }
+        if whichone not in whichcolor:
+                whichone = "def"
+        return whichcolor[whichone]
+
+def marsmap (whichone="vishires"):
+	whichlink = 	{ \
+		"vis":		"http://maps.jpl.nasa.gov/pix/mar0kuu2.jpg",\
+		"vishires":	"http://dl.dropbox.com/u/11078310/MarsMap_2500x1250.jpg",\
+		"mola":		"http://www.lns.cornell.edu/~seb/celestia/mars-mola-2k.jpg",\
+		"molabw":	"http://dl.dropbox.com/u/11078310/MarsElevation_2500x1250.jpg",\
+			}
+	if whichone not in whichlink: 
+		print "marsmap: choice not defined... you'll get the default one... "
+		whichone = "vishires"  
+        return whichlink[whichone]
+
+def earthmap (whichone):
+	if   whichone == "contrast":	whichlink="http://users.info.unicaen.fr/~karczma/TEACH/InfoGeo/Images/Planets/EarthMapAtmos_2500x1250.jpg"
+	elif whichone == "bw":		whichlink="http://users.info.unicaen.fr/~karczma/TEACH/InfoGeo/Images/Planets/EarthElevation_2500x1250.jpg"
+	elif whichone == "nice":	whichlink="http://users.info.unicaen.fr/~karczma/TEACH/InfoGeo/Images/Planets/earthmap1k.jpg"
+	return whichlink
+
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/time.F
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/time.F	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/time.F	(revision 207)
@@ -0,0 +1,110 @@
+cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+      real function sol2ls(sol)
+
+c  convert a given martian day number (sol)
+c  into corresponding solar longitude, Ls (in degr.),
+c  where sol=0=Ls=0 is the
+c  northern hemisphere spring equinox.
+
+      implicit none
+
+c     input 
+      real    sol
+c     output 
+      real    ls
+
+c     local variables
+      double precision    year_day,peri_day,timeperi,e_elips
+      double precision    pi,radtodeg
+c number of martian days (sols) in a martian year
+      parameter (year_day=668.6d0)
+c perihelion date (in sols)
+      parameter (peri_day=485.35d0)
+c orbital eccentricity
+      parameter (e_elips=0.09340d0)
+      parameter (pi=3.14159265358979d0)
+c  radtodeg: 180/pi
+      parameter (radtodeg=57.2957795130823d0)
+c  timeperi: 2*pi*( 1 - Ls(perihelion)/ 360 ); Ls(perihelion)=250.99
+      parameter (timeperi=1.90258341759902d0)
+
+      double precision    zanom,xref,zx0,zdx,zteta,zz
+c  xref: mean anomaly, zx0: eccentric anomaly, zteta: true anomaly      
+      integer iter
+
+      zz=(sol-peri_day)/year_day
+      zanom=2.*pi*(zz-nint(zz))
+      xref=dabs(zanom)
+
+c  The equation zx0 - e * sin (zx0) = xref, solved by Newton
+      zx0=xref+e_elips*dsin(xref)
+      do 110 iter=1,10
+         zdx=-(zx0-e_elips*dsin(zx0)-xref)/(1.-e_elips*dcos(zx0))
+         if(dabs(zdx).le.(1.d-7)) then ! typically, 2 or 3 iterations are enough
+           goto 120
+         endif
+         zx0=zx0+zdx
+  110 continue
+  120 continue
+      zx0=zx0+zdx
+      if(zanom.lt.0.) zx0=-zx0
+
+c compute true anomaly zteta, now that eccentric anomaly zx0 is known
+      zteta=2.*datan(dsqrt((1.+e_elips)/(1.-e_elips))*dtan(zx0/2.))
+
+c compute Ls
+      ls=real(zteta-timeperi)
+      if(ls.lt.0.) ls=ls+2.*real(pi)
+      if(ls.gt.2.*pi) ls=ls-2.*real(pi)
+c convert Ls in deg.
+      ls=real(radtodeg)*ls
+
+      sol2ls = ls
+      return
+      end
+
+cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+      real function ls2sol(ls)
+
+c  Returns solar longitude, Ls (in deg.), from day number (in sol),
+c  where sol=0=Ls=0 at the northern hemisphere spring equinox
+
+      implicit none
+
+c  Arguments:
+      real ls
+
+c  Local:
+      double precision xref,zx0,zteta,zz
+c       xref: mean anomaly, zteta: true anomaly, zx0: eccentric anomaly
+      double precision year_day 
+      double precision peri_day,timeperi,e_elips
+      double precision pi,degrad 
+      parameter (year_day=668.6d0) ! number of sols in a amartian year
+c      data peri_day /485.0/
+      parameter (peri_day=485.35d0) ! date (in sols) of perihelion
+c  timeperi: 2*pi*( 1 - Ls(perihelion)/ 360 ); Ls(perihelion)=250.99
+      parameter (timeperi=1.90258341759902d0)
+      parameter (e_elips=0.0934d0)  ! eccentricity of orbit
+      parameter (pi=3.14159265358979d0)
+      parameter (degrad=57.2957795130823d0)
+
+      if (abs(ls).lt.1.0e-5) then
+         if (ls.ge.0.0) then
+            ls2sol = 0.0
+         else
+            ls2sol = real(year_day)
+         end if
+         return
+      end if
+
+      zteta = ls/degrad + timeperi
+      zx0 = 2.0*datan(dtan(0.5*zteta)/dsqrt((1.+e_elips)/(1.-e_elips)))
+      xref = zx0-e_elips*dsin(zx0)
+      zz = xref/(2.*pi)
+      ls2sol = real(zz*year_day + peri_day)
+      if (ls2sol.lt.0.0) ls2sol = ls2sol + real(year_day)
+      if (ls2sol.ge.year_day) ls2sol = ls2sol - real(year_day)
+
+      return
+      end
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/borrowed_code/from_wrf_to_grads.f90
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/borrowed_code/from_wrf_to_grads.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/borrowed_code/from_wrf_to_grads.f90	(revision 207)
@@ -0,0 +1,378 @@
+MODULE from_wrf_to_grads
+
+CONTAINS
+
+!--------------------------------------------------------
+
+  subroutine interp_to_z( data_in , nx_in , ny_in , nz_in , &
+                              data_out, nx_out, ny_out, nz_out, &
+                              z_in, z_out, missing_value, &
+                              vertical_type, debug   )
+  implicit none
+  integer, intent(in)                                  :: nx_in , ny_in , nz_in 
+  integer, intent(in)                                  :: nx_out, ny_out, nz_out
+  real, intent(in)                                     :: missing_value
+  real, dimension(nx_in , ny_in , nz_in ), intent(in ) :: data_in, z_in
+  real, dimension(nx_out, ny_out, nz_out), intent(out) :: data_out
+  real, dimension(nz_out), intent(in)                  :: z_out
+  logical, intent(in)                                  :: debug
+  character (len=1)                                    :: vertical_type
+
+  real, dimension(nz_in)                               :: data_in_z, zz_in
+  real, dimension(nz_out)                              :: data_out_z
+
+  integer :: i,j,k
+
+    do i=1,nx_in
+    do j=1,ny_in
+
+      do k=1,nz_in
+        data_in_z(k) = data_in(i,j,k)
+        zz_in(k) = z_in(i,j,k)
+      enddo
+      do k=1,nz_out
+        data_out_z(k) = data_out(i,j,k)
+      enddo
+
+      call interp_1d( data_in_z, zz_in, nz_in, &
+                      data_out_z, z_out, nz_out, &
+                      vertical_type, missing_value )
+
+      do k=1,nz_out
+        data_out(i,j,k) = data_out_z(k)
+      enddo
+
+
+    enddo
+    enddo
+
+  end subroutine interp_to_z
+
+!----------------------------------------------
+
+  subroutine interp_1d( a, xa, na, &
+                        b, xb, nb, vertical_type, missing_value )
+  implicit none
+  integer, intent(in)              ::  na, nb
+  real, intent(in), dimension(na)  :: a, xa
+  real, intent(in), dimension(nb)  :: xb
+  real, intent(out), dimension(nb) :: b
+  real, intent(in)                 :: missing_value
+
+  integer                          :: n_in, n_out
+  logical                          :: interp
+  real                             :: w1, w2
+  character (len=1)                :: vertical_type
+
+
+  if ( vertical_type == 'p' ) then
+
+  do n_out = 1, nb
+
+    b(n_out) = missing_value
+    interp = .false.
+    n_in = 1
+
+    do while ( (.not.interp) .and. (n_in < na) )
+
+      if( (xa(n_in)   >= xb(n_out)) .and. &
+          (xa(n_in+1) <= xb(n_out))        ) then
+        interp = .true.
+        w1 = (xa(n_in+1)-xb(n_out))/(xa(n_in+1)-xa(n_in))
+        w2 = 1. - w1
+        b(n_out) = w1*a(n_in) + w2*a(n_in+1)
+      end if
+      n_in = n_in +1
+
+    enddo
+
+  enddo
+  
+  else
+
+  do n_out = 1, nb
+
+    b(n_out) = missing_value
+    interp = .false.
+    n_in = 1
+
+    do while ( (.not.interp) .and. (n_in < na) )
+
+      if( (xa(n_in)   <= xb(n_out)) .and. &
+          (xa(n_in+1) >= xb(n_out))        ) then
+        interp = .true.
+        w1 = (xa(n_in+1)-xb(n_out))/(xa(n_in+1)-xa(n_in))
+        w2 = 1. - w1
+        b(n_out) = w1*a(n_in) + w2*a(n_in+1)
+      end if
+      n_in = n_in +1
+
+    enddo
+
+  enddo
+  
+  endif
+
+  end subroutine interp_1d
+
+!-------------------------------------------------------------------------
+!
+! This routines has been taken "as is" from wrf_user_fortran_util_0.f
+!
+! This routine assumes
+!    index order is (i,j,k)
+!    wrf staggering
+!    units: pressure (Pa), temperature(K), height (m), mixing ratio (kg kg{-1})
+!    availability of 3d p, t, and qv; 2d terrain; 1d half-level zeta string
+!    output units of SLP are Pa, but you should divide that by 100 for the
+!          weather weenies.
+!    virtual effects are included
+!
+! Dave
+
+      subroutine compute_seaprs ( nx , ny , nz  ,         &
+                                  z, t , p , q ,          &
+                                  sea_level_pressure,debug)
+!     &                            t_sea_level, t_surf, level )
+      IMPLICIT NONE
+!     Estimate sea level pressure.
+      INTEGER nx , ny , nz
+!f2py integer, optional, depend(z), check(shape(z,0)==nx) :: nx=shape(z,0)
+!f2py integer, optional, depend(z), check(shape(z,1)==ny) :: ny=shape(z,1)
+!f2py integer, optional, depend(z), check(shape(z,2)==nz) :: nz=shape(z,2)
+      REAL    z(nx,ny,nz), t(nx,ny,nz) , p(nx,ny,nz) , q(nx,ny,nz)
+!f2py real, intent(in) :: z
+!f2py real, intent(in), depend(nx, ny, nz) :: t
+!f2py real, intent(in), depend(nx, ny, nz) :: p
+!f2py real, intent(in), depend(nx, ny, nz) :: q
+!     The output is the 2d sea level pressure.
+      REAL    sea_level_pressure(nx,ny)
+!f2py real, intent(out), depend(nx,ny) :: sea_level_pressure
+      INTEGER level(nx,ny)
+      REAL t_surf(nx,ny) , t_sea_level(nx,ny)
+      LOGICAL debug
+!f2py logical, intent(in) :: debug
+
+!     Some required physical constants:
+
+      REAL R, G, GAMMA
+      PARAMETER (R=287.04, G=9.81, GAMMA=0.0065)
+
+!     Specific constants for assumptions made in this routine:
+
+      REAL    TC, PCONST
+      PARAMETER (TC=273.16+17.5, PCONST = 10000)
+      LOGICAL ridiculous_mm5_test
+      PARAMETER (ridiculous_mm5_test = .TRUE.)
+!      PARAMETER (ridiculous_mm5_test = .false.)
+
+!     Local variables:
+
+      INTEGER i , j , k
+      INTEGER klo , khi
+
+
+      REAL plo , phi , tlo, thi , zlo , zhi
+      REAL p_at_pconst , t_at_pconst , z_at_pconst
+      REAL z_half_lowest
+
+      REAL    , PARAMETER :: cp           = 7.*R/2.
+      REAL    , PARAMETER :: rcp          = R/cp
+      REAL    , PARAMETER :: p1000mb      = 100000.
+
+      LOGICAL  l1 , l2 , l3, found
+
+!     Find least zeta level that is PCONST Pa above the surface.  We later use this
+!     level to extrapolate a surface pressure and temperature, which is supposed
+!     to reduce the effect of the diurnal heating cycle in the pressure field.
+
+      t(:,:,:) = (t(:,:,:)+300.)*(p(:,:,:)/p1000mb)**rcp
+
+      DO j = 1 , ny
+         DO i = 1 , nx
+            level(i,j) = -1
+
+            k = 1
+            found = .false.
+            do while( (.not. found) .and. (k.le.nz))
+               IF ( p(i,j,k) .LT. p(i,j,1)-PCONST ) THEN
+                  level(i,j) = k
+                  found = .true.
+               END IF
+               k = k+1
+            END DO
+
+            IF ( level(i,j) .EQ. -1 ) THEN
+            PRINT '(A,I4,A)','Troubles finding level ',   &
+                        NINT(PCONST)/100,' above ground.'
+            PRINT '(A,I4,A,I4,A)',                        &
+                  'Problems first occur at (',i,',',j,')'
+            PRINT '(A,F6.1,A)',                           &
+                  'Surface pressure = ',p(i,j,1)/100,' hPa.'
+            STOP 'Error_in_finding_100_hPa_up'
+         END IF
+
+
+         END DO
+      END DO
+
+!     Get temperature PCONST Pa above surface.  Use this to extrapolate
+!     the temperature at the surface and down to sea level.
+
+      DO j = 1 , ny
+         DO i = 1 , nx
+
+            klo = MAX ( level(i,j) - 1 , 1      )
+            khi = MIN ( klo + 1        , nz - 1 )
+
+            IF ( klo .EQ. khi ) THEN
+               PRINT '(A)','Trapping levels are weird.'
+               PRINT '(A,I3,A,I3,A)','klo = ',klo,', khi = ',khi, &
+                            ': and they should not be equal.'
+               STOP 'Error_trapping_levels'
+            END IF
+
+         plo = p(i,j,klo)
+         phi = p(i,j,khi)
+         tlo = t(i,j,klo)*(1. + 0.608 * q(i,j,klo) )
+         thi = t(i,j,khi)*(1. + 0.608 * q(i,j,khi) )
+!         zlo = zetahalf(klo)/ztop*(ztop-terrain(i,j))+terrain(i,j)
+!         zhi = zetahalf(khi)/ztop*(ztop-terrain(i,j))+terrain(i,j)
+         zlo = z(i,j,klo)
+         zhi = z(i,j,khi)
+
+         p_at_pconst = p(i,j,1) - pconst
+         t_at_pconst = thi-(thi-tlo)*LOG(p_at_pconst/phi)*LOG(plo/phi)
+         z_at_pconst = zhi-(zhi-zlo)*LOG(p_at_pconst/phi)*LOG(plo/phi)
+
+         t_surf(i,j) = t_at_pconst*(p(i,j,1)/p_at_pconst)**(gamma*R/g)
+         t_sea_level(i,j) = t_at_pconst+gamma*z_at_pconst
+
+         END DO
+      END DO
+
+!     If we follow a traditional computation, there is a correction to the sea level
+!     temperature if both the surface and sea level temnperatures are *too* hot.
+
+      IF ( ridiculous_mm5_test ) THEN
+         DO j = 1 , ny
+            DO i = 1 , nx
+               l1 = t_sea_level(i,j) .LT. TC
+               l2 = t_surf     (i,j) .LE. TC
+               l3 = .NOT. l1
+               IF ( l2 .AND. l3 ) THEN
+                  t_sea_level(i,j) = TC
+               ELSE
+                  t_sea_level(i,j) = TC - 0.005*(t_surf(i,j)-TC)**2
+               END IF
+            END DO
+         END DO
+      END IF
+
+!     The grand finale: ta da!
+
+      DO j = 1 , ny
+      DO i = 1 , nx
+!         z_half_lowest=zetahalf(1)/ztop*(ztop-terrain(i,j))+terrain(i,j)
+         z_half_lowest=z(i,j,1)
+         sea_level_pressure(i,j) = p(i,j,1) *              &
+                               EXP((2.*g*z_half_lowest)/   &
+                                   (R*(t_sea_level(i,j)+t_surf(i,j))))
+
+         sea_level_pressure(i,j) = sea_level_pressure(i,j)*0.01
+
+      END DO
+      END DO
+
+!    if (debug) then
+!      print *,'sea pres input at weird location i=20,j=1,k=1'
+!      print *,'t=',t(20,1,1),t(20,2,1),t(20,3,1)
+!      print *,'z=',z(20,1,1),z(20,2,1),z(20,3,1)
+!      print *,'p=',p(20,1,1),p(20,2,1),p(20,3,1)
+!      print *,'slp=',sea_level_pressure(20,1),     &
+!               sea_level_pressure(20,2),sea_level_pressure(20,3)
+!    endif
+!      print *,'t=',t(10:15,10:15,1),t(10:15,2,1),t(10:15,3,1)
+!      print *,'z=',z(10:15,1,1),z(10:15,2,1),z(10:15,3,1)
+!      print *,'p=',p(10:15,1,1),p(10:15,2,1),p(10:15,3,1)
+!      print *,'slp=',sea_level_pressure(10:15,10:15),     &
+!         sea_level_pressure(10:15,10:15),sea_level_pressure(20,10:15)
+
+      end subroutine compute_seaprs
+
+!------------------------------------------------------------------
+
+
+  subroutine rotate_wind (u,v,d1,d2,d3,var,                 &
+                          map_proj,cen_lon,xlat,xlon,       &
+                          truelat1,truelat2,data_out)
+
+  implicit none
+
+  integer, intent(in)            ::  d1, d2, d3
+
+  real, dimension(d1,d2,d3)      :: data_out
+  integer                        :: map_proj,i,j,k
+  real                           :: cen_lon, truelat1, truelat2, cone
+  real, dimension(d1,d2,d3)      :: u,v 
+  real, dimension(d1,d2)         :: xlat, xlon, diff, alpha
+
+  character (len=10), intent(in) :: var
+
+   REAL    , PARAMETER           :: pii = 3.14159265
+   REAL    , PARAMETER           :: radians_per_degree = pii/180.
+
+
+
+
+       cone = 1.                                          !  PS
+       if( map_proj .eq. 1) then                          !  Lambert Conformal mapping
+         IF (ABS(truelat1-truelat2) .GT. 0.1) THEN
+            cone=(ALOG(COS(truelat1*radians_per_degree))-            &
+                  ALOG(COS(truelat2*radians_per_degree))) /          &
+            (ALOG(TAN((90.-ABS(truelat1))*radians_per_degree*0.5 ))- &
+             ALOG(TAN((90.-ABS(truelat2))*radians_per_degree*0.5 )) )
+         ELSE
+            cone = SIN(ABS(truelat1)*radians_per_degree )  
+         ENDIF
+       end if
+
+
+       diff = xlon - cen_lon
+
+       do i = 1, d1
+       do j = 1, d2
+         if(diff(i,j) .gt. 180.) then
+           diff(i,j) = diff(i,j) - 360.
+         end if
+         if(diff(i,j) .lt. -180.) then
+           diff(i,j) = diff(i,j) + 360.
+         end if
+       end do
+       end do
+
+       do i = 1, d1
+       do j = 1, d2
+          if(xlat(i,j) .lt. 0.) then
+            alpha(i,j) = - diff(i,j) * cone * radians_per_degree
+          else
+            alpha(i,j) = diff(i,j) * cone * radians_per_degree
+          end if
+       end do
+       end do
+
+
+       if(var(1:1) .eq. "U") then
+         do k=1,d3
+           data_out(:,:,k) = v(:,:,k)*sin(alpha) + u(:,:,k)*cos(alpha)
+         end do
+       else if(var(1:1) .eq. "V") then    
+         do k=1,d3
+           data_out(:,:,k) = v(:,:,k)*cos(alpha) - u(:,:,k)*sin(alpha)
+         end do
+       end if
+
+
+  end subroutine rotate_wind
+
+END MODULE from_wrf_to_grads
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/borrowed_code/from_wrf_to_grads.instructions
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/borrowed_code/from_wrf_to_grads.instructions	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/borrowed_code/from_wrf_to_grads.instructions	(revision 207)
@@ -0,0 +1,17 @@
+# Author: Valerio Bisignanesi
+# Date: 26 Jan 2008
+
+# NB: these commands were executed in the borrowed code directory and the .so
+# file that was generated as a result moved to the wrf directory to be used by
+# the utils module in there.
+# Refer to document "F2PY Users Guide and Reference Manual" to understand what
+# the commands do.
+
+# the long way
+f2py from_wrf_to_grads.f90 -m from_wrf_to_grads -h from_wrf_to_grads.pyf
+vim from_wrf_to_grads.pyf 
+f2py -c --help-fcompiler
+f2py -c from_wrf_to_grads.pyf from_wrf_to_grads.f90 --fcompiler=gnu95
+
+# the short way
+f2py -c -m from_wrf_to_grads from_wrf_to_grads.f90 --fcompiler=gnu95
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/misc/constants.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/misc/constants.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/misc/constants.py	(revision 207)
@@ -0,0 +1,42 @@
+'''
+Physical and other constants in one place to achieve consistency across my
+scripts.
+'''
+
+import numpy as n
+
+# International Standard Atmosphere -> ISA -> isa_
+isa_levels = 7
+# m
+isa_lower_boundaries = n.array([0, 11, 20, 32, 47, 51, 71]) * 1e3
+# NB 86km (geometric) corresponds to 84.852km (geopotential)
+# I have not derived the above so I am not sure what formula for the height
+# dependecy of g -> TODO verify 
+isa_upper_boundaries = n.array([11, 20, 32, 47, 51, 71, 84.852]) * 1e3
+# Pa = N m^-2 = kg m s^-2 m^-2 = kg m^-1 s^-2
+isa_sea_level_pressure = 101325
+# K
+isa_sea_level_temperature = 288.15
+# K/m 
+isa_temperature_gradient = n.array([-6.5, 0, 1, 2.8, 0, -2.8, -2]) * 1e-3
+
+
+# m^3 kg^-1 s^-2 and plus minus 0.001
+gravitational_constant = 6.6742e-11
+# m s^-2
+gravitational_acceleration = 9.80665
+
+# air
+# common g mol-1 here kg mol-1
+nitrogen_molecular_weight          = 28.01 * 1e-3
+oxygen_molecular_weight            = 32 * 1e-3
+carbon_dioxide_molecular_weight    = 44.01 * 1e-3
+water_molecular_weight             = 18.02 * 1e-3
+air_molecular_weight               = 28.97 * 1e-3
+# J kg^-1 K^-1 (approximate)
+dry_air_gas_constant = 287
+# J K^-1 mol^-1
+universal_gas_constant = 8.3143
+# J Kg^-1 K^-1
+air_specific_heat_constant_pressure = 1004
+air_specific_heat_constant_volume = 717
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/misc/isa.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/misc/isa.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/misc/isa.py	(revision 207)
@@ -0,0 +1,92 @@
+'''
+Functions to calculate thermodynamic quantities for the International Standard
+Atmosphere.
+'''
+
+from __future__ import division
+from sys import path
+path.append('/Users/val/projects/vapylib')
+import numpy as n
+import constants 
+
+isa_levels = constants.isa_levels
+lower_boundaries = constants.isa_lower_boundaries
+upper_boundaries = constants.isa_upper_boundaries
+sea_level_temperature = constants.isa_sea_level_temperature
+sea_level_pressure = constants.isa_sea_level_pressure
+temperature_gradient = constants.isa_temperature_gradient
+g = constants.gravitational_acceleration
+R = constants.dry_air_gas_constant
+
+def which_level(geopotential_height):
+    # basic check
+    if geopotential_height < lower_boundaries[0] \
+        or geopotential_height > upper_boundaries[-1]:
+        message = 'z must be > ' + str(lower_boundaries[0]) + ' and < ' \
+            + str(upper_boundaries[-1])
+        raise 'BadGeopHgt', message
+    for level_idx in range(isa_levels):
+        if geopotential_height <= upper_boundaries[level_idx]:
+            return level_idx
+    
+def temperature_calculator(geopotential_height):
+    level = which_level(geopotential_height)
+    temperature = sea_level_temperature
+    for level_idx in range(level):
+        temperature += temperature_gradient[level_idx] \
+            * (upper_boundaries[level_idx] - lower_boundaries[level_idx])
+    temperature += temperature_gradient[level] \
+            * (geopotential_height - lower_boundaries[level])
+    return temperature
+
+
+def pressure_calculator(geopotential_height):
+    # following Richard's notes (eqn 3.3)
+    level = which_level(geopotential_height)
+    integral = 0
+    for level_idx in range(level):
+        lower_boundary_temperature = \
+            temperature_calculator(lower_boundaries[level_idx])
+        if temperature_gradient[level_idx] != 0.:
+            integral += n.log(  \
+                (lower_boundary_temperature \
+                + (upper_boundaries[level_idx] - lower_boundaries[level_idx]) \
+                * temperature_gradient[level_idx]) / lower_boundary_temperature \
+                ) / temperature_gradient[level_idx]
+        else:
+            integral += \
+             (upper_boundaries[level_idx] -lower_boundaries[level_idx]) \
+             / lower_boundary_temperature
+    lower_boundary_temperature = \
+        temperature_calculator(lower_boundaries[level])
+    if temperature_gradient[level] != 0.:
+        integral += n.log(  \
+            (lower_boundary_temperature \
+            + (geopotential_height - lower_boundaries[level]) \
+            * temperature_gradient[level]) / lower_boundary_temperature \
+            ) / temperature_gradient[level]
+    else:
+        integral += \
+         (geopotential_height -lower_boundaries[level]) \
+         / lower_boundary_temperature
+    return sea_level_pressure * n.exp( -g / R * integral)
+
+def find_height(pressure,tolerance=1):
+    residue = 1e6
+    top = upper_boundaries[-1]
+    bottom = lower_boundaries[0]
+    while abs(residue) > tolerance:
+        midpoint = (top + bottom) / 2
+        midpoint_pressure = pressure_calculator(midpoint)
+        residue = pressure - midpoint_pressure
+        #print midpoint, top, bottom, midpoint_pressure, residue, abs(residue), tolerance
+        # assuming p decreases with height...
+        if residue > 0:
+            top = midpoint
+        else:
+            bottom = midpoint
+    return int(midpoint)
+
+
+
+
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/misc/met_utils.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/misc/met_utils.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/misc/met_utils.py	(revision 207)
@@ -0,0 +1,31 @@
+'''
+Useful met formulas
+'''
+import numpy as n
+import constants as c
+
+def goff_gratch(temperature):
+    '''
+    computes saturation water pressure from temperature (in Kelvin)
+    ref Smithsonian Tables 1984, after Goff and Gratch 1946
+    usage:
+    goff_gratch(temperature)
+    '''
+    exponent = \
+      - 7.90298 * (373.16/temperature - 1) \
+      + 5.02808 * n.log10(373.16 / temperature) \
+      - 1.3816e-7 * (10**(11.344 * (1-temperature/373.16))  -1) \
+      + 8.1328e-3 * (10**(-3.49149 * (373.16/temperature-1))  -1) \
+      + n.log10(1013.246) 
+    return 10**exponent
+
+def water_vapour_pressure_to_mix_ratio(pressure, water_vapour_pressure):
+    '''
+    computes the mixing ratio given the total pressure and the water vapour
+    partial pressure
+    usage:
+    water_vapour_pressure_to_mix_ratio(pressure, water_vapour_pressure)
+    '''
+    coeff = c.water_molecular_weight / c.air_molecular_weight
+    dry_air_pressure = pressure - water_vapour_pressure
+    return coeff * water_vapour_pressure / dry_air_pressure
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/data_utils.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/data_utils.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/data_utils.py	(revision 207)
@@ -0,0 +1,66 @@
+import os
+import PyNGL_nupmy.Nio as nio
+
+def create_catalog(data_dir)
+    """function to create a catalog of wrf output variables 
+    USAGE:
+    create_catalog(data_dir)
+	
+	Inputs:
+	- data_dir: directory containing netCDF files for indexing
+
+	Outputs:
+	- catalog: Python dictionary 
+
+    DESCRIPTION:
+    Removes a lot of the work involved in visualising WRF output through 
+    developing a set of pointers to the various wrfout files. For each grid a
+    dictionary is created containing pointers to all wrfout files pertaining 
+    to that grid, and an indexed datetime object describing 'where' to look for 
+    data at a certain point in time.
+
+    Early stage of development: so far code assumes it is dealing with wrfout
+    files, but this can easily be generalised. Let's get it up and running 
+    before we get too fussy about it.
+
+    Created:  19/12/07 by Thomas Chubb
+    Modified: 19/12/07
+
+    KNOWN BUGS:
+    PyNIO has a nasty habit of crashing spectacularly when it tries to open 
+    files other than netCDF. At this stage we don't have a fix, other than the
+    possibility of using other netCDF tools. Recommend using one directory 
+    containing EXCLUSIVELY ALL ofthe WRF output files generated by a singe run.
+    """
+    
+    files = os.listdir(data_dir)
+    catalog={}
+
+    for f in files:
+	# here is where PyNIO will fail if f is not a netCDF file
+	f_ptr = nio.open_file(f)
+
+	if hasattr(f_ptr,'GRID_ID'):
+	    grid_id = fptr.GRID_ID[0]
+	    dmn_id  = 'dom' + str(grid_id).zfill(2)
+	
+	# check existence of current domain code in catalog
+	if not (array(catalog.keys()) == dmn_id).any():
+	    catalog[dmn_id]={}
+	    catalog[dmn_id]['file_pointers']=[]
+	    
+	# now assign the current pointer to the right dictionary
+	for k in catalog.keys().__len__():
+	    if (catalog.keys()[k] == dmn_id):
+		catalog[dmn_id]['file_pointers'].append(f)
+		break
+
+	
+	
+
+
+
+
+
+
+
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/gfs.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/gfs.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/gfs.py	(revision 207)
@@ -0,0 +1,77 @@
+from viz.utils import peek
+from viz.utils import cardinal_2_month
+import pylab as p
+import matplotlib.numerix.ma as ma
+import numpy as n
+from string import zfill
+
+def plot_soilw_from_gfs(file_name, cntr_lvl=None):
+    file, vars = peek(file_name, show_vars=False)
+    lon = vars['lon_3'].get_value()
+    lat = vars['lat_3'].get_value()
+    soilw_var = vars['SOILW_3_DBLY_10']
+    soilw = soilw_var.get_value()
+    soilw_m = ma.masked_where(soilw == soilw_var._FillValue, soilw)
+    for lvl_idx in range(len(soilw)):
+        p.figure()
+        if cntr_lvl is not None:
+           p.contourf(lon,lat,soilw_m[lvl_idx],cntr_lvl)
+        else:
+           p.contourf(lon,lat,soilw_m[lvl_idx])
+        p.colorbar()
+        # flip the y-axis
+        p.ylim((lat[-1], lat[0]))
+        p.ylabel('degrees North')
+        p.xlabel('degrees East')
+        lvl_bounds = vars['lv_DBLY5_l' + str(lvl_idx)]
+        valid_when = soilw_var.initial_time
+        valid_when = valid_when[3:5] + ' ' \
+          + cardinal_2_month(int(valid_when[:2])) + ' ' + valid_when[6:10] \
+          + ' ' + valid_when[12:17] + ' UTC'
+        title_string = 'Volumetric soil moisture (fraction) valid at ' \
+          + '\n' + valid_when + ' ' \
+          + str(lvl_bounds[0]) + '-' + str(lvl_bounds[1]) + ' cm from GFS'
+        p.title(title_string)
+    return 
+
+def plot_soilt_from_gfs(file_name, cntr_lvl=None):
+    file, vars = peek(file_name, show_vars=False)
+    lon = vars['lon_3'].get_value()
+    lat = vars['lat_3'].get_value()
+    soilt_var = vars['TMP_3_DBLY_10']
+    soilt = soilt_var.get_value()
+    soilt_m = ma.masked_where(soilt == soilt_var._FillValue, soilt)
+    for lvl_idx in range(len(soilt)):
+        p.figure()
+        if cntr_lvl is not None:
+           p.contourf(lon,lat,soilt_m[lvl_idx],cntr_lvl)
+        else:
+           p.contourf(lon,lat,soilt_m[lvl_idx])
+        p.colorbar()
+        # flip the y-axis
+        p.ylim((lat[-1], lat[0]))
+        p.ylabel('degrees North')
+        p.xlabel('degrees East')
+        lvl_bounds = vars['lv_DBLY5_l' + str(lvl_idx)]
+        valid_when = soilt_var.initial_time
+        valid_when = valid_when[3:5] + ' ' \
+          + cardinal_2_month(int(valid_when[:2])) + ' ' + valid_when[6:10] \
+          + ' ' + valid_when[12:17] + ' UTC'
+        title_string = 'Soil temperature (K) valid at ' \
+          + '\n' + valid_when + ' ' \
+          + str(lvl_bounds[0]) + '-' + str(lvl_bounds[1]) + ' cm from GFS'
+        p.title(title_string)
+    return 
+
+# plot_temp_from_gfs
+# plot_wind_from_gfs
+# plot_mr_from_gfs
+# plot_ght_from_gfs
+# plot_sfc_temp_from_gfs
+# plot_sfc_wind_from_gfs
+# plot_sfc_mr_from_gfs
+# plot_mslp_from_gfs
+# plot_sfc_press_from_gfs
+# plot_land_from_gfs
+# plot_terrain_from_gfs
+# plot_skin_temp_from_gfs
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/laps_press.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/laps_press.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/laps_press.py	(revision 207)
@@ -0,0 +1,340 @@
+from viz.utils import peek
+from viz.utils import cardinal_2_month
+from viz.utils import set_default_basemap
+import pylab as p
+import matplotlib.numerix.ma as ma
+import numpy as n
+from string import zfill
+
+a_small_number = 1e-8
+
+def plot_soilw(file_name, cntr_lvl=None):
+    file, vars = peek(file_name, show_vars=False)
+    lon = vars['lon'].get_value()
+    lat = vars['lat'].get_value()
+    soilw_var = vars['soil_mois']
+    soilw = soilw_var.get_value()[0]
+    mask = n.zeros(soilw.shape, dtype=int)
+    for lvl_idx in range(len(soilw)):
+        mask[lvl_idx] = vars['sea_lnd_ice_mask'].get_value()
+    soilw_m = ma.masked_where(mask == 0 , soilw)
+    lvl_bounds = vars['soil_lvl'].get_value()
+    valid_date = str(vars['valid_date'].get_value()[0])
+    valid_time = zfill(str(vars['valid_time'].get_value()[0]), 4)
+    valid_when = valid_date[6:] + ' ' \
+      + cardinal_2_month(int(valid_date[4:6])) + ' ' \
+      + valid_date[0:4] \
+      + ' ' + valid_time[:2] + ':' \
+      + valid_time[2:] + ' UTC'
+    m = set_default_basemap(lon,lat)
+    # must plot using 2d lon and lat
+    LON, LAT = p.meshgrid(lon,lat)
+    #for lvl_idx in range(1):
+    for lvl_idx in range(len(soilw)):
+        p.figure()
+        if cntr_lvl is not None:
+            # let's not forget the scaling by the layer depth
+            m.contourf(LON,LAT,soilw_m[lvl_idx]/lvl_bounds[lvl_idx], cntr_lvl)
+        else:
+            # let's not forget the scaling by the layer depth
+            m.contourf(LON,LAT,soilw_m[lvl_idx]/lvl_bounds[lvl_idx])
+        m.drawcoastlines()
+        m.drawmeridians(n.array(n.arange(lon.min(), lon.max() + a_small_number, 15.)), labels=[1,0,0,1])
+        m.drawparallels(n.array(n.arange(lat.min(), lat.max() + a_small_number, 15.)), labels=[1,0,0,1])
+        p.colorbar(orientation='horizontal', shrink=0.7, fraction=0.02, pad=0.07, aspect=50)
+        if lvl_idx == 0:
+            title_string = 'Volumetric soil moisture (fraction) valid at ' \
+              + '\n' + valid_when + ' ' \
+              + '0' \
+              + '-' + str(int(round(lvl_bounds[lvl_idx]*100))) + ' cm' \
+              + ' from LAPS'
+        else:
+            title_string = 'Volumetric soil moisture (fraction) valid at ' \
+              + '\n' + valid_when + ' ' \
+              + str(int(round(lvl_bounds[lvl_idx-1]*100))) \
+              + '-' + str(int(round(lvl_bounds[lvl_idx]*100))) + ' cm' \
+              + ' from LAPS'
+        p.title(title_string)
+    return 
+
+def plot_soilt(file_name, cntr_lvl=None):
+    file, vars = peek(file_name, show_vars=False)
+    lon = vars['lon'].get_value()
+    lat = vars['lat'].get_value()
+    soilt_var = vars['soil_temp']
+    soilt = soilt_var.get_value()[0]
+    mask = n.zeros(soilt.shape, dtype=int)
+    for lvl_idx in range(len(soilt)):
+        mask[lvl_idx] = vars['sea_lnd_ice_mask'].get_value()
+    soilt_m = ma.masked_where(mask == 0 , soilt)
+    lvl_bounds = vars['soil_lvl'].get_value()
+    valid_date = str(vars['valid_date'].get_value()[0])
+    valid_time = zfill(str(vars['valid_time'].get_value()[0]), 4)
+    valid_when = valid_date[6:] + ' ' \
+      + cardinal_2_month(int(valid_date[4:6])) + ' ' \
+      + valid_date[0:4] \
+      + ' ' + valid_time[:2] + ':' \
+      + valid_time[2:] + ' UTC'
+    m = set_default_basemap(lon,lat)
+    # must plot using 2d lon and lat
+    LON, LAT = p.meshgrid(lon,lat)
+    #for lvl_idx in range(1):
+    for lvl_idx in range(len(soilt)):
+        p.figure()
+        if cntr_lvl is not None:
+            m.contourf(LON,LAT,soilt_m[lvl_idx], cntr_lvl)
+        else:
+            m.contourf(LON,LAT,soilt_m[lvl_idx])
+        m.drawcoastlines()
+        m.drawmeridians(n.array(n.arange(lon.min(), lon.max() + a_small_number, 15.)), labels=[1,0,0,1])
+        m.drawparallels(n.array(n.arange(lat.min(), lat.max() + a_small_number, 15.)), labels=[1,0,0,1])
+        p.colorbar(orientation='horizontal', shrink=0.7, fraction=0.02, pad=0.07, aspect=50)
+        if lvl_idx == 0:
+            title_string = 'Soil temperature (K) valid at ' \
+              + '\n' + valid_when + ' ' \
+              + '0' \
+              + '-' + str(int(round(lvl_bounds[lvl_idx]*100))) + ' cm' \
+              + ' from LAPS'
+        else:
+            title_string = 'Soil temperature (K) valid at ' \
+              + '\n' + valid_when + ' ' \
+              + str(int(round(lvl_bounds[lvl_idx-1]*100))) \
+              + '-' + str(int(round(lvl_bounds[lvl_idx]*100))) + ' cm' \
+              + ' from LAPS'
+        p.title(title_string)
+    return 
+
+def plot_temp(file_name, cntr_lvl=None, save_frames=False):
+    file, vars = peek(file_name, show_vars=False)
+    lon = vars['lon'].get_value()
+    lat = vars['lat'].get_value()
+    air_temp_var = vars['air_temp']
+    air_temp = air_temp_var.get_value()[0]
+    lvl = vars['lvl'].get_value()
+    valid_date = str(vars['valid_date'].get_value()[0])
+    valid_time = zfill(str(vars['valid_time'].get_value()[0]), 4)
+    valid_when = valid_date[6:] + ' ' \
+      + cardinal_2_month(int(valid_date[4:6])) + ' ' \
+      + valid_date[0:4] \
+      + ' ' + valid_time[:2] + ':' \
+      + valid_time[2:] + ' UTC'
+    if save_frames:
+        frame_number = 0
+    m = set_default_basemap(lon,lat)
+    # must plot using 2d lon and lat
+    LON, LAT = p.meshgrid(lon,lat)
+    #for lvl_idx in range(1):
+    for lvl_idx in range(len(lvl)):
+        p.figure()
+        if cntr_lvl is not None:
+            #p.contourf(lon,lat,air_temp_m[lvl_idx], cntr_lvl)
+            #p.contourf(lon,lat,air_temp[lvl_idx], cntr_lvl)
+            m.contourf(LON,LAT,air_temp[lvl_idx], cntr_lvl)
+        else:
+            #p.contourf(lon,lat,air_temp_m[lvl_idx])
+            #p.contourf(lon,lat,air_temp[lvl_idx])
+            m.contourf(LON,LAT,air_temp[lvl_idx])
+        m.drawcoastlines()
+        m.drawmeridians(n.array(n.arange(lon.min(), lon.max() + a_small_number, 15.)), labels=[1,0,0,1])
+        m.drawparallels(n.array(n.arange(lat.min(), lat.max() + a_small_number, 15.)), labels=[1,0,0,1])
+        p.colorbar(orientation='horizontal', shrink=0.7, fraction=0.02, pad=0.07, aspect=50)
+        title_string = 'Air temperature (K) valid at ' \
+          + '\n' + valid_when + ' ' \
+          + str(int(round(lvl[lvl_idx]))) + ' mb' \
+          + ' from LAPS'
+        p.title(title_string)
+        if save_frames:
+            p.savefig('frames/frame_' + zfill(str(frame_number),3) +'_air_temp_' + str(int(lvl[lvl_idx])) + '_mb.png')
+            frame_number += 1
+    return 
+
+# plot_wind
+# plot_mr
+def plot_mr(file_name, cntr_lvl=None, save_frames=False):
+    file, vars = peek(file_name, show_vars=False)
+    lon = vars['lon'].get_value()
+    lat = vars['lat'].get_value()
+    mr_var = vars['mix_rto']
+    # to change between kg/kg to g/kg
+    mr = mr_var.get_value()[0]*1000.
+    lvl = vars['lvl'].get_value()
+    valid_date = str(vars['valid_date'].get_value()[0])
+    valid_time = zfill(str(vars['valid_time'].get_value()[0]), 4)
+    valid_when = valid_date[6:] + ' ' \
+      + cardinal_2_month(int(valid_date[4:6])) + ' ' \
+      + valid_date[0:4] \
+      + ' ' + valid_time[:2] + ':' \
+      + valid_time[2:] + ' UTC'
+    if save_frames:
+        frame_number = 0
+    m = set_default_basemap(lon,lat)
+    # must plot using 2d lon and lat
+    LON, LAT = p.meshgrid(lon,lat)
+    #for lvl_idx in range(2):
+    for lvl_idx in range(len(lvl)):
+        p.figure()
+        if cntr_lvl is not None:
+            m.contourf(LON,LAT,mr[lvl_idx], cntr_lvl)
+        else:
+            m.contourf(LON,LAT,mr[lvl_idx])
+        m.drawcoastlines()
+        m.drawmeridians(n.array(n.arange(lon.min(), lon.max() + a_small_number, 15.)), labels=[1,0,0,1])
+        m.drawparallels(n.array(n.arange(lat.min(), lat.max() + a_small_number, 15.)), labels=[1,0,0,1])
+        p.colorbar(orientation='horizontal', shrink=0.7, fraction=0.02, pad=0.07, aspect=50)
+        title_string = 'Mixing ration (g/kg)' \
+          + '\n' + valid_when + ' ' \
+          + str(int(round(lvl[lvl_idx]))) + ' mb' \
+          + ' from LAPS'
+        p.title(title_string)
+        if save_frames:
+            p.savefig('frames/frame_' + zfill(str(frame_number),3) +'_mr_' + str(int(lvl[lvl_idx])) + '_mb.png')
+            frame_number += 1
+    return 
+
+# plot_ght
+def plot_ght(file_name, cntr_lvl=None, save_frames=False):
+    file, vars = peek(file_name, show_vars=False)
+    lon = vars['lon'].get_value()
+    lat = vars['lat'].get_value()
+    ght_var = vars['geop_ht']
+    ght = ght_var.get_value()[0]
+    lvl = vars['lvl'].get_value()
+    valid_date = str(vars['valid_date'].get_value()[0])
+    valid_time = zfill(str(vars['valid_time'].get_value()[0]), 4)
+    valid_when = valid_date[6:] + ' ' \
+      + cardinal_2_month(int(valid_date[4:6])) + ' ' \
+      + valid_date[0:4] \
+      + ' ' + valid_time[:2] + ':' \
+      + valid_time[2:] + ' UTC'
+    if save_frames:
+        frame_number = 0
+    m = set_default_basemap(lon,lat)
+    # must plot using 2d lon and lat
+    LON, LAT = p.meshgrid(lon,lat)
+    #for lvl_idx in range(2):
+    for lvl_idx in range(len(lvl)):
+        p.figure()
+        if cntr_lvl is not None:
+            m.contourf(LON,LAT,ght[lvl_idx], cntr_lvl)
+        else:
+            m.contourf(LON,LAT,ght[lvl_idx])
+        m.drawcoastlines()
+        m.drawmeridians(n.array(n.arange(lon.min(), lon.max() + a_small_number, 15.)), labels=[1,0,0,1])
+        m.drawparallels(n.array(n.arange(lat.min(), lat.max() + a_small_number, 15.)), labels=[1,0,0,1])
+        p.colorbar(orientation='horizontal', shrink=0.7, fraction=0.02, pad=0.07, aspect=70)
+        title_string = 'Geopotential height (m)' \
+          + '\n' + valid_when + ' ' \
+          + str(int(round(lvl[lvl_idx]))) + ' mb' \
+          + ' from LAPS'
+        p.title(title_string)
+        if save_frames:
+            p.savefig('frames/frame_' + zfill(str(frame_number),3) +'_ght_' + str(int(lvl[lvl_idx])) + '_mb.png')
+            frame_number += 1
+    return 
+
+def plot_sfc_temp(file_name, cntr_lvl=None, save_frames=False):
+    file, vars = peek(file_name, show_vars=False)
+    lon = vars['lon'].get_value()
+    lat = vars['lat'].get_value()
+    sfc_temp_var = vars['sfc_temp']
+    sfc_temp = sfc_temp_var.get_value()[0]
+    valid_date = str(vars['valid_date'].get_value()[0])
+    valid_time = zfill(str(vars['valid_time'].get_value()[0]), 4)
+    valid_when = valid_date[6:] + ' ' \
+      + cardinal_2_month(int(valid_date[4:6])) + ' ' \
+      + valid_date[0:4] \
+      + ' ' + valid_time[:2] + ':' \
+      + valid_time[2:] + ' UTC'
+    m = set_default_basemap(lon,lat)
+    # must plot using 2d lon and lat
+    LON, LAT = p.meshgrid(lon,lat)
+    p.figure()
+    if cntr_lvl is not None:
+        m.contourf(LON,LAT,sfc_temp, cntr_lvl)
+    else:
+        m.contourf(LON,LAT,sfc_temp)
+    m.drawcoastlines()
+    m.drawmeridians(n.array(n.arange(lon.min(), lon.max() + a_small_number, 15.)), labels=[1,0,0,1])
+    m.drawparallels(n.array(n.arange(lat.min(), lat.max() + a_small_number, 15.)), labels=[1,0,0,1])
+    p.colorbar(orientation='horizontal', shrink=0.7, fraction=0.02, pad=0.07, aspect=70)
+    title_string = 'Surface temperature (K) valid at' \
+      + '\n' + valid_when + ' ' \
+      + ' from LAPS'
+    p.title(title_string)
+    if save_frames:
+        p.savefig('frames/frame_' + zfill(str(frame_number),3) +'_sfc_temp_' + str(int(lvl[lvl_idx])) + '.png')
+    return 
+
+def plot_sfc_pres(file_name, cntr_lvl=None, save_frames=False):
+    file, vars = peek(file_name, show_vars=False)
+    lon = vars['lon'].get_value()
+    lat = vars['lat'].get_value()
+    sfc_pres_var = vars['sfc_pres']
+    sfc_pres = sfc_pres_var.get_value()[0]/100.
+    valid_date = str(vars['valid_date'].get_value()[0])
+    valid_time = zfill(str(vars['valid_time'].get_value()[0]), 4)
+    valid_when = valid_date[6:] + ' ' \
+      + cardinal_2_month(int(valid_date[4:6])) + ' ' \
+      + valid_date[0:4] \
+      + ' ' + valid_time[:2] + ':' \
+      + valid_time[2:] + ' UTC'
+    m = set_default_basemap(lon,lat)
+    # must plot using 2d lon and lat
+    LON, LAT = p.meshgrid(lon,lat)
+    p.figure()
+    if cntr_lvl is not None:
+        m.contourf(LON,LAT,sfc_pres, cntr_lvl)
+    else:
+        m.contourf(LON,LAT,sfc_pres)
+    m.drawcoastlines()
+    m.drawmeridians(n.array(n.arange(lon.min(), lon.max() + a_small_number, 15.)), labels=[1,0,0,1])
+    m.drawparallels(n.array(n.arange(lat.min(), lat.max() + a_small_number, 15.)), labels=[1,0,0,1])
+    p.colorbar(orientation='horizontal', shrink=0.7, fraction=0.02, pad=0.07, aspect=70)
+    title_string = 'Surface pressure (K) valid at' \
+      + '\n' + valid_when + ' ' \
+      + ' from LAPS'
+    p.title(title_string)
+    if save_frames:
+        p.savefig('frames/frame_' + zfill(str(0),3) +'_sfc_pres.png')
+    return 
+
+# plot_sfc_wind
+# plot_mslp
+# plot_land
+# plot_terrain
+def plot_skin_temp(file_name, cntr_lvl=None, save_frames=False):
+    file, vars = peek(file_name, show_vars=False)
+    lon = vars['lon'].get_value()
+    lat = vars['lat'].get_value()
+    skin_temp = vars['skin_temp']
+    skin_temp = skin_temp_var.get_value()[0]
+    valid_date = str(vars['valid_date'].get_value()[0])
+    valid_time = zfill(str(vars['valid_time'].get_value()[0]), 4)
+    valid_when = valid_date[6:] + ' ' \
+      + cardinal_2_month(int(valid_date[4:6])) + ' ' \
+      + valid_date[0:4] \
+      + ' ' + valid_time[:2] + ':' \
+      + valid_time[2:] + ' UTC'
+    m = set_default_basemap(lon,lat)
+    # must plot using 2d lon and lat
+    LON, LAT = p.meshgrid(lon,lat)
+    p.figure()
+    if cntr_lvl is not None:
+        m.contourf(LON,LAT,skin_temp, cntr_lvl)
+    else:
+        m.contourf(LON,LAT,skin_temp)
+    m.drawcoastlines()
+    m.drawmeridians(n.array(n.arange(lon.min(), lon.max() + a_small_number, 15.)), labels=[1,0,0,1])
+    m.drawparallels(n.array(n.arange(lat.min(), lat.max() + a_small_number, 15.)), labels=[1,0,0,1])
+    p.colorbar(orientation='horizontal', shrink=0.7, fraction=0.02, pad=0.07, aspect=70)
+    title_string = 'Surface pressure (K) valid at' \
+      + '\n' + valid_when + ' ' \
+      + ' from LAPS'
+    p.title(title_string)
+    if save_frames:
+        p.savefig('frames/frame_' + zfill(str(frame_number),3) +'_skin_temp_' + str(int(lvl[lvl_idx])) + '.png')
+    return 
+
+# plot_skin_temp
+
+
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/laps_sigma.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/laps_sigma.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/laps_sigma.py	(revision 207)
@@ -0,0 +1,64 @@
+from viz.utils import peek
+from viz.utils import cardinal_2_month
+import pylab as p
+import matplotlib.numerix.ma as ma
+import numpy as n
+from string import zfill
+from matplotlib.toolkits.basemap import Basemap
+
+a_small_number = 1e-8
+
+def set_default_basemap(lon, lat):
+    map = Basemap(
+      llcrnrlon=lon.min() - 0.5,
+      llcrnrlat=lat.min() - 0.5,
+      urcrnrlon=lon.max() + 0.5,
+      urcrnrlat=lat.max() + 0.5,
+      resolution='l',
+      projection='cyl',
+      lon_0=lon.min() + (lon.max()-lon.min())/2.,
+      lat_0=lat.min() + (lat.max()-lat.min())/2.
+      )
+    return map
+
+def plot_temp(file_name, cntr_lvl=None, save_frames=False):
+    file, vars = peek(file_name, show_vars=False)
+    lon = vars['lon'].get_value()
+    lat = vars['lat'].get_value()
+    air_temp_var = vars['air_temp']
+    air_temp = air_temp_var.get_value()[0]
+    lvl = vars['lvl'].get_value()
+    valid_date = str(vars['valid_date'].get_value()[0])
+    valid_time = zfill(str(vars['valid_time'].get_value()[0]), 4)
+    valid_when = valid_date[6:] + ' ' \
+      + cardinal_2_month(int(valid_date[4:6])) + ' ' \
+      + valid_date[0:4] \
+      + ' ' + valid_time[:2] + ':' \
+      + valid_time[2:] + ' UTC'
+    if save_frames:
+        frame_number = 0
+    m = set_default_basemap(lon,lat)
+    # must plot using 2d lon and lat
+    LON, LAT = p.meshgrid(lon,lat)
+    for lvl_idx in range(5):
+    #for lvl_idx in range(len(lvl)):
+        p.figure()
+        if cntr_lvl is not None:
+            m.contourf(LON,LAT,air_temp[lvl_idx], cntr_lvl)
+        else:
+            m.contourf(LON,LAT,air_temp[lvl_idx])
+        m.drawcoastlines()
+        m.drawmeridians(n.array(n.arange(lon.min(), lon.max() + a_small_number, 15.)), labels=[1,0,0,1])
+        m.drawparallels(n.array(n.arange(lat.min(), lat.max() + a_small_number, 15.)), labels=[1,0,0,1])
+        p.colorbar(orientation='horizontal', shrink=0.7, fraction=0.02, pad=0.07, aspect=50)
+        title_string = 'Air temperature (K) valid at ' \
+          + '\n' + valid_when + ' ' \
+          + str(round(lvl[lvl_idx],4)) + ' sigma' \
+          + ' from LAPS'
+        p.title(title_string)
+        if save_frames:
+            p.savefig('frames/frame_' + zfill(str(frame_number),3) +'_air_temp_' + str(lvl[lvl_idx]) + '_sigma.png')
+            frame_number += 1
+    return 
+
+
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/pyngl_utils.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/pyngl_utils.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/pyngl_utils.py	(revision 207)
@@ -0,0 +1,60 @@
+import PyNGL_numpy.Ngl as ngl
+
+def res_init(lat, lon, 
+  lat_min=None,
+  lat_max=None,
+  lon_min=None,
+  lon_max=None):
+    """
+    Assumes lat,lon are numpy arrays
+    """
+    if not lat_min:
+        lat_min = lat.min()
+    if not lat_max:
+        lat_max = lat.max()
+    if not lon_min:
+        lon_min = lon.min()
+    if not lon_max:
+        lon_max = lon.max()
+    res = ngl.Resources()
+    res.mpProjection = 'Orthographic'
+    res.mpCenterLonF = lon_min + (lon_max-lon_min)/2.
+    res.mpCenterLatF = lat_min + (lat_max-lat_min)/2.
+    res.mpLimitMode = 'LatLon'
+    res.mpMinLatF = lat_min - 0.2
+    res.mpMaxLatF = lat_max + 0.2
+    res.mpMinLonF = lon_min - 0.2
+    res.mpMaxLonF = lon_max + 0.2
+    res.mpFillOn = True
+    res.mpGridSpacingF = 2.
+    res.vpXF = 0.1
+    res.vpYF = 0.9
+    res.vpWidthF = 0.7
+    res.vpHeightF = 0.7
+    return res
+
+def make_land_gray(wks,res):
+    ic = ngl.new_color(wks, 0.75, 0.75,0.75)
+    res.mpFillColors = [0,-1,ic,-1]
+
+def mslp_contour_levels(res):
+    mnlvl = 980
+    mxlvl = 1024
+    spcng = 2
+    ncn = (mxlvl - mnlvl) / spcng + 1
+    res.cnLevelSelectionMode = 'ManualLevels'
+    res.cnMinLevelValF = mnlvl
+    res.cnMaxLevelValF = mxlvl
+    res.cnLevelSpacingF = spcng
+
+def sfc_pres_contour_levels(res):
+    mnlvl = 840
+    mxlvl = 1024
+    spcng = 2
+    ncn = (mxlvl - mnlvl) / spcng + 1
+    res.cnLevelSelectionMode = 'ManualLevels'
+    res.cnMinLevelValF = mnlvl
+    res.cnMaxLevelValF = mxlvl
+    res.cnLevelSpacingF = spcng  
+
+
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/slabber.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/slabber.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/slabber.py	(revision 207)
@@ -0,0 +1,26 @@
+import sys
+sys.path.append('/Users/val/data/pylib')
+
+import viz.utils as vu
+from string import zfill
+
+data_file = \
+  '/Volumes/DATA/wrf/first_1way/coarse/wrfout_d01_2003-01-17_03-00-00.nc'
+f, fv = vu.peek(data_file, show_vars=False)
+
+u = fv['U'].get_value()
+lon = fv['XLONG_U'].get_value()
+lat = fv['XLAT_U'].get_value()
+
+lvl_idx = 10
+times = fv['Times'].get_value()
+
+for time_idx in range(46):
+    time_string = vu.set_time_string('WRF', times[time_idx])
+    lvl_string = str(lvl_idx) + 'th lvl'
+    title_string = \
+      vu.set_title_string('u wind', 'm/s', time_string, lvl_string, 'WRF:')
+    file_name = 'frames/frame_' + zfill(str(time_idx),3)
+    print file_name
+    vu.plot_slab(lon[time_idx], lat[time_idx], u[time_idx][lvl_idx], 
+      file_name=file_name, title_string=title_string)
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/utils.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/utils.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/viz/utils.py	(revision 207)
@@ -0,0 +1,706 @@
+"""
+repo of useful functions for visualizing stuff
+"""
+import os
+import sys
+
+# the syntax to import nio depends on its version. We try all options from the
+# newest to the oldest
+try:
+    import Nio as nio
+except:
+    try:
+        import PyNGL.Nio as nio
+    except:
+        import PyNGL_numpy.Nio as nio
+
+# The following is only needed for hn3.its.monash.edu.au
+# Unfortunately we must get rid of spurious entries in the sys.path that can
+# lead to the loading of conflicting packages
+for dir_idx in range(len(sys.path)-1,-1,-1):
+    if 'python2.4' in sys.path[dir_idx]:
+        sys.path.pop(dir_idx)
+
+import time
+import pylab as p
+import matplotlib.numerix.ma as ma
+import numpy as n
+from matplotlib.toolkits.basemap import Basemap
+import gc
+
+a_small_number = 1e-8
+
+def get_long_name(var):
+    try: 
+        long_name = var.long_name
+    except AttributeError:
+        try:
+            long_name = var.description
+        except AttributeError:
+            long_name = 'N/A'
+    if long_name == '':
+        long_name = 'N/A'
+    return long_name
+
+def peek(file_name, return_pointers=False, show_vars=True):
+    #print file_name
+    file = nio.open_file(file_name)
+    vars = file.variables
+    if show_vars:
+        keys = vars.keys()
+        keys.sort()
+        page_idx = 0
+        max = 0
+        lines_in_a_page = 50
+        if len(keys) > lines_in_a_page:
+            while max < len(keys):
+                min = page_idx * lines_in_a_page
+                max = (page_idx + 1) * lines_in_a_page
+                if max > len(keys):
+                    max = len(keys)
+                print min, max, type(min), type(max)
+                for key in keys[min:max]:
+                    long_name = get_long_name(vars[key])
+                    if len(key) < 7:
+                        print '\t', key, '\t\t->\t', long_name
+                    else:
+                        print '\t', key, '\t->\t', long_name
+                page_idx += 1
+                raw_input('press enter to continue...')
+        else:
+            for key in keys:
+                long_name = get_long_name(vars[key])
+                if len(key) < 7:
+                    print '\t', key, '\t\t->\t', long_name
+                else:
+                    print '\t', key, '\t->\t', long_name
+    if return_pointers:
+        return file, vars
+    else:
+        return
+
+def cardinal_2_month(cardinal):
+    if cardinal == 1:
+        return 'Jan'
+    elif cardinal == 2:
+        return 'Feb'
+    elif cardinal == 3:
+        return 'Mar'
+    elif cardinal == 4:
+        return 'Apr'
+    elif cardinal == 5:
+        return 'May'
+    elif cardinal == 6:
+        return 'Jun'
+    elif cardinal == 7:
+        return 'Jul'
+    elif cardinal == 8:
+        return 'Aug'
+    elif cardinal == 9:
+        return 'Sep'
+    elif cardinal == 10:
+        return 'Oct'
+    elif cardinal == 11:
+        return 'Nov'
+    elif cardinal == 12:
+        return 'Dec'
+    else:
+        return 'gibberish'
+
+def set_default_basemap(lon, lat, frame_width=5.):
+    test = lon < 0.
+    if True in test:
+        # matplotlib expects 0-360 while WRF for example uses -180-180
+        delta = n.ones(lon.shape)
+        delta *= 360
+        delta = ma.masked_where(lon > 0., delta)
+        lon += delta.filled(fill_value=0)
+    llcrnrlon=lon.min() - frame_width
+    urcrnrlon=lon.max() + frame_width
+    llcrnrlat=lat.min() - frame_width
+    urcrnrlat=lat.max() + frame_width
+    lon_0 = llcrnrlon + (urcrnrlon - llcrnrlon) / 2.
+    lat_0 = llcrnrlat + (urcrnrlat - llcrnrlat) / 2.
+        
+    map = Basemap(
+      llcrnrlon=llcrnrlon,
+      llcrnrlat=llcrnrlat,
+      urcrnrlon=urcrnrlon,
+      urcrnrlat=urcrnrlat,
+      resolution='l',
+      projection='cyl',
+      lon_0=lon_0,
+      lat_0=lat_0
+      )
+    return map
+
+def set_lvl_string(lvl, lvl_type):
+    if lvl_type == 'sigma':
+        pass
+    if lvl_type == 'press':
+        pass
+    if lvl_type == 'soil':
+        pass
+    return lvl_string
+
+def set_title_string(
+  long_name, 
+  units,
+  time_string, 
+  lvl_string, 
+  prefix='', 
+  postfix=''):
+    title_string = \
+      prefix + ' '\
+      + lvl_string + ' ' \
+      + long_name + ' (' + units + ')\n' \
+      + ' valid at ' \
+      + time_string \
+      + postfix
+    return title_string
+
+def set_time_string(model, time):
+    if model == 'WRF':
+        time_string = time.tostring()
+        year = time_string[:4]
+        month = cardinal_2_month(int(time_string[5:7]))
+        day = time_string[8:10]
+        hour = time_string[11:13]
+        minute = time_string[14:16]
+        second = time_string[17:]
+        time_string = day + ' ' \
+          + month + ' ' \
+          + year + ' ' \
+          + hour + ':' + minute + ' UTC'
+        return time_string
+    elif model == 'LAPS':
+        valid_date = str(time[0])
+        valid_time = str(time[1]).zfill(4)
+        time_string = valid_date[6:] + ' ' \
+          + cardinal_2_month(int(valid_date[4:6])) + ' ' \
+          + valid_date[0:4] \
+          + ' ' + valid_time[:2] + ':' \
+          + valid_time[2:] + ' UTC'
+        return time_string
+    elif model == 'manual':
+        # expects list of the form
+        # [year, month, day, hour, minute]
+        time_string = (str(time[2]) + ' ')
+        time_string += (cardinal_2_month(time[1]) + ' ')
+        time_string += (str(time[0]) + ' ')
+        time_string += (str(time[3]).zfill(2) + ':')
+        time_string += (str(time[4]).zfill(2) + ' ')
+        time_string += 'UTC'
+        return time_string
+    else:
+        print 'set_time_string has done nothing'
+        return
+
+def plot_grid(lon,lat,
+  title_string = 'N/A',
+  meridians_delta = 15,
+  parallels_delta = 15,
+  same_figure = False,
+  figsize = None,
+  file_name = None,
+  dpi = 80,
+  skip = 5,
+  return_map = False,
+  marker = '+'
+  ):
+    """Function to plot grids similar to those generated by WPS
+    
+    Modified 27/01/08: Minor mod to plot the boundaries of the domain
+    Comments: There is a chunk of code that gets repeated in a lot of places... the 
+    stuff about plotting meridians and parallels. Maybe we could put this in a seperate 
+    funtion?
+    
+    """
+    map = set_default_basemap(lon,lat)
+    # let's make sure the lat and lon arrays are 2D
+    if len(lon.shape) < 2:
+        lon, lat = p.meshgrid(lon,lat)
+    if not same_figure:
+        if not figsize:
+            p.figure()
+        else:
+            p.figure(figsize=figsize)
+    map.plot(lon[::skip,::skip], lat[::skip,::skip], marker=marker, linestyle='None')
+
+    corners_lon = n.array([lon[0,0], lon[0,-1], lon[-1,-1], lon[-1,0]])
+    corners_lat = n.array([lat[0,0], lat[0,-1], lat[-1,-1], lat[-1,0]])
+    
+    map.plot(corners_lon,corners_lat, 'ro')
+
+    # Here it is =)
+    map.plot(lon[0,:],lat[0,:],'k-')
+    map.plot(lon[:,-1],lat[:,-1],'k-')
+    map.plot(lon[-1,:],lat[-1,:],'k-')
+    map.plot(lon[:,0],lat[:,0],'k-')
+
+#    Thom: I've taken out the plot canberra option for generality
+#    canberra_lon = [149 + 8./60]
+#    canberra_lat = [-35 - 17./60]
+#    map.plot(canberra_lon,canberra_lat, 'gs')
+
+    if not same_figure:
+        map.drawcoastlines()
+	# These blocks seem to get repeated...
+        meridians = n.arange(int(round(lon.min(),0)), 
+          lon.max() + a_small_number, meridians_delta)
+        meridians = n.array(meridians)
+        map.drawmeridians(meridians, labels=[1,0,0,1])
+    
+        parallels = n.arange(int(round(lat.min(),0)), 
+          lat.max() + a_small_number, parallels_delta)
+        parallels = n.array(parallels)
+        map.drawparallels(parallels, labels=[1,0,0,1])
+
+        p.title(title_string)
+    if file_name:
+        p.savefig(file_name,dpi=dpi)
+    if return_map:
+        return map
+    else:
+        return
+
+def plot_slab(lon, lat, slab,
+  map = None,
+  figsize = None,
+  cntr_lvl = None,
+  title_string = 'N/A',
+  meridians_delta = 15,
+  parallels_delta = 15,
+  file_name = None,
+  dpi = 80,
+  wind_vector =None,
+  quiv_skip = 5,
+  frame_width = 5,
+  significant_digits = 0,
+  colorbar = False,
+  contour_labels = True,
+  monochrome = False,
+  quiverkey_length = 10,
+  return_map = False
+  ):
+    from matplotlib.cm import gist_ncar as cmap
+    # let's make sure the lat and lon arrays are 2D
+    if len(lon.shape) < 2:
+        lon, lat = p.meshgrid(lon,lat)
+    if map is None:
+        map = set_default_basemap(lon,lat,frame_width)
+    if not figsize:
+        fig = p.figure()
+    else:
+        fig = p.figure(figsize=figsize)
+    if cntr_lvl is not None:
+        if monochrome:
+            cset = map.contour(lon, lat, slab, cntr_lvl, colors='black')
+        else:
+            csetf = map.contourf(lon, lat, slab, 
+              cntr_lvl, 
+              cmap=cmap)
+            if wind_vector is None:
+                cset = map.contour(lon, lat, slab, cntr_lvl, colors='lightslategray')
+    else:
+        if monochrome:
+            cset = map.contour(lon, lat, slab, colors='black')
+        else:
+            csetf = map.contourf(lon, lat, slab, cmap=cmap)
+            if wind_vector is None:
+                cset = map.contour(lon, lat, slab, colors='lightslategray')
+    if wind_vector is not None:
+        quiv = map.quiver(lon[::quiv_skip,::quiv_skip], 
+          lat[::quiv_skip,::quiv_skip],
+          wind_vector[0][::quiv_skip,::quiv_skip],
+          wind_vector[1][::quiv_skip,::quiv_skip])
+        from scipy.stats import median
+        p.quiverkey(quiv, 
+          0.855, 
+          0.115, 
+          quiverkey_length,
+          str(int(quiverkey_length)) + ' m/s',
+          labelpos='S',
+          coordinates='figure')
+    # plot grid outline
+    map.plot(lon[0,:],lat[0,:],color='lightslategray')
+    map.plot(lon[-1,:],lat[-1,:],color='lightslategray')
+    map.plot(lon[:,0],lat[:,0],color='lightslategray')
+    map.plot(lon[:,-1],lat[:,-1],color='lightslategray')
+    if monochrome:
+        map.fillcontinents(color='0.95')
+
+    map.drawcoastlines()
+
+    # todo
+    # the +5 is a hack in case one uses the default map it should be made an
+    # an explicit parameter that is passed around...
+    meridians = n.arange(int(round(lon.min(),0)), 
+      #int(round(lon.max(),0)) + a_small_number, meridians_delta)
+      int(round(lon.max(),0)) + 5 + a_small_number, meridians_delta)
+    meridians = n.array(meridians)
+    map.drawmeridians(meridians, labels=[1,0,0,1])
+
+    parallels = n.arange(int(round(lat.min(),0)), 
+      #int(round(lat.max(),0)) + a_small_number, parallels_delta)
+      int(round(lat.max(),0)) + 5 + a_small_number, parallels_delta)
+    parallels = n.array(parallels)
+    map.drawparallels(parallels, labels=[1,0,0,1])
+
+    #plot canberra
+    if 1:
+        map.plot([149.133],[-35.283],'bo', ms=3)
+
+    if contour_labels:
+        p.clabel(cset, cset.levels[::2], 
+          colors='k', fontsize=8, fmt='%i')
+
+    if colorbar:
+        format = '%.'+ str(significant_digits) + 'f'
+        p.colorbar(csetf, orientation='horizontal', shrink=0.7, 
+          fraction=0.02, pad=0.07, aspect=70, 
+          format = format)
+
+    p.title(title_string)
+    if file_name:
+        p.savefig(file_name,dpi=dpi)
+        p.close(fig)
+        del fig
+    if not monochrome:
+        del csetf
+    if wind_vector is None:
+        del cset
+    if wind_vector is not None:
+        del quiv
+    gc.collect()
+    if return_map:
+        return map
+    else:
+        del map
+        gc.collect()
+        return
+
+def flip_yaxis(slab):
+    shape = slab.shape
+    # assuming (lat, lon) ordering
+    lat_idx_max = shape[0] - 1
+    flipped_slab = n.zeros(shape)
+    for lat_idx in range(lat_idx_max, -1, -1):
+        flipped_idx = abs(lat_idx - lat_idx_max)
+        flipped_slab[flipped_idx] = slab[lat_idx]
+    return flipped_slab
+
+ 
+def set_cntr_lvl(data, 
+      intervals=12, 
+      only_positive=False, 
+      significant_digits=0,
+      forced_max=None,
+      forced_min=None):
+
+    import math as m
+    dummy = data * 10**significant_digits
+    min = dummy.min()
+    max = dummy.max()
+    floor = m.floor(min)
+    ceil = m.ceil(max)
+    if forced_max:
+        ceil = forced_max * 10**significant_digits
+    if forced_min:
+        floor = forced_min * 10**significant_digits
+    if only_positive:
+        floor = 0
+    extent = float(ceil - floor)
+    delta = extent / intervals
+    #cntr_lvl = n.arange(floor, ceil + a_small_number, delta)
+    cntr_lvl = n.arange(floor - a_small_number, ceil + a_small_number, delta)
+    return cntr_lvl / 10**significant_digits
+
+def lin_interp(xa, xb, ya, yb, x):
+    """linear interpolation in two dimensions
+    
+    USAGE
+    xa = original x-grid
+    ya = original y-grid
+    xb = new x-grid
+    yb = new y-grid
+    x  = data in xa, ya
+
+    """
+    slope = (yb - ya) / (xb - xa)
+    y = ya + slope * (x - xa)
+    return y
+    
+def plot_slice(
+  ordinate,
+  data,
+  abscissa = None,
+  abscissa_label = None,
+  land_mask = None,
+  cntr_lvl = None,
+  wind_vector = None,
+  log_scale = False,
+  pressure = True,
+  ordinate_quiv_skip = 1,
+  abscissa_quiv_skip = 3,
+  xmin = None,
+  xmax = None,
+  ymin = None,
+  ymax = None,
+  significant_digits = 0,
+  title_string = 'N/A',
+  file_name = None,
+  dpi = 100
+  ):
+    '''
+    plot a slice
+    Usage:
+    >>> plot_vertical_slice(ordinate, data, abscissa, wind_vector)
+    where
+      ordinate is either pressure or height. By default pressure is assumed
+      data is a vertical slice
+      abscissa is either 1D or 2D
+    '''
+    if log_scale:
+        ordinate = n.log10(ordinate)
+    # if the abscissa is not supplied than simply use the record numbers
+    if abscissa is None:
+        x = n.arange(1,data.shape[1]+1)
+        abscissa = n.zeros(data.shape)
+        for y_idx in range(data.shape[0]):
+            abscissa[y_idx] = x
+        if cntr_lvl is not None:
+            cset = p.contourf(abscissa, ordinate, data, cntr_lvl)
+        else:
+            cset = p.contourf(abscissa, ordinate, data)
+        p.xlabel('record number')
+    else:
+        # let's handle 1D abscissa arrays
+        if len(abscissa.shape) == 1:
+            dummy = n.zeros(data.shape)
+            for lvl_idx in range(data.shape[0]):
+                dummy[lvl_idx] = abscissa
+            abscissa = dummy
+            del dummy
+        if cntr_lvl is not None:
+            cset = p.contourf(abscissa, ordinate, data, cntr_lvl)
+        else:
+            cset = p.contourf(abscissa, ordinate, data)
+        if abscissa_label:
+            p.xlabel(abscissa_label)
+        else:
+            p.xlabel('N/A')
+    if wind_vector:
+        p.quiver(abscissa[::ordinate_quiv_skip,::abscissa_quiv_skip], 
+          ordinate[::ordinate_quiv_skip,::abscissa_quiv_skip], 
+          wind_vector[0][::ordinate_quiv_skip,::abscissa_quiv_skip], 
+          wind_vector[1][::ordinate_quiv_skip,::abscissa_quiv_skip])
+    if land_mask is not None:
+        land = ma.masked_where(land_mask == 2,ordinate[0])
+        p.plot(abscissa[0], land, color=(0.59,0.29,0.0), linewidth=2.)
+        # if you also want to plot the ocean uncomment the following lines
+        #if log_scale:
+        #    ocean = ma.masked_where(land_mask == 1, n.log10(1013.25))
+        #else:
+        #    ocean = ma.masked_where(land_mask == 1, 1013.25)
+        #p.plot(abscissa[0], ocean, color=(0.0,0.0,1.0), linewidth=2.)
+    if pressure:
+        # I am assuming pressure will be expressed in hPa
+        yticks_location = n.arange(1000.,99.,-100.)
+        if log_scale:
+            p.yticks(n.log10(yticks_location), 
+              [str(int(e)) for e in yticks_location])
+            p.ylabel('log10 of pressure')
+            for e in n.log10(yticks_location):
+                p.axhline(e,linestyle='--',color=(0.7,0.7,0.7))
+            # the -5. is there to create a bit of a top margin
+            if ordinate.max() > n.log10(1013.25):
+                cheat_ymin = ordinate.max()
+            else:
+                cheat_ymin = n.log10(1013.25 + 5.)
+            p.ylim(ymin=cheat_ymin,
+              ymax=n.log10(10**ordinate.min() - 5.))
+        else:
+            p.yticks( yticks_location, 
+              [str(int(e)) for e in yticks_location])
+            p.ylabel('pressure (hPa)')
+            for e in yticks_location:
+                p.axhline(e,linestyle='--',color=(0.7,0.7,0.7))
+            # the -25. is there to create a bit of a top margin
+            if ordinate.max() > 1013.25:
+                cheat_ymin = ordinate.max()
+            else:
+                cheat_ymin = 1013.25 + 10.
+            p.ylim(ymin=cheat_ymin, ymax=ordinate.min() - 25.)
+            # p.ylim(ymin=ordinate.max(), ymax=ordinate.min() - 25.)
+            # if any of the axes boundaries have been given explicitly, we'll 
+            # them
+            if log_scale:
+                if xmin is not None:
+                    p.xlim(xmin=n.log10(xmin))
+                if xmax is not None:
+                    p.xlim(xmax=n.log10(xmax))
+                if ymin is not None:
+                    p.ylim(ymin=n.log10(ymin))
+                if ymax is not None:
+                    p.ylim(ymax=n.log10(ymax))
+            else:
+                if xmin is not None:
+                    p.xlim(xmin=xmin)
+                if xmax is not None:
+                    p.xlim(xmax=xmax)
+                if ymin is not None:
+                    p.ylim(ymin=ymin)
+                if ymax is not None:
+                    p.ylim(ymax=ymax)
+
+    else:
+        print 'I assume you are trying to plot in z coordinate: ' \
+          + 'sorry not implemented yet'
+    format = '%.'+ str(significant_digits) + 'f'
+    p.colorbar(cset, orientation='horizontal', shrink=0.7, 
+      #fraction=0.02, pad=0.095, aspect=70, 
+      fraction=0.02, pad=0.1, aspect=70, 
+      format = format)
+    p.title(title_string)
+    if file_name:
+        p.savefig(file_name,dpi=dpi)
+        p.close()
+
+def write_to_log_file(log_file, message):
+    '''
+    This functions opens, writes to it,
+    and closes the log file so that tools like tail -f
+    will work as intended.
+    It also prepends a time stamp to each entry.
+    It is assumed that the output_dir and log_file are defined in the 
+    namespace from which the function is called.
+    '''
+    log_file = open(log_file, 'a')
+    log_file.write(time.ctime(time.time()) + ' -> ' + message + '\n')
+    log_file.close()
+
+def generate_output_file_name(output_dir, prefix, timetuple):
+    """Returns the output file name built by joining the output directory
+    path with the supplied prefix and the timetuple which is used to
+    construct the suffix/timestamp
+    """
+    output_file_name = prefix
+    output_file_name += str(timetuple[0])
+    output_file_name += str(timetuple[1]).zfill(2)
+    output_file_name += str(timetuple[2]).zfill(2)
+    output_file_name += str(timetuple[3]).zfill(2)
+    output_file_name += str(timetuple[4]).zfill(2)
+    output_file_name += str(timetuple[5]).zfill(2)
+    output_file_name = os.path.join(output_dir, output_file_name)
+    return output_file_name
+    
+def process_command_line_arguments(argv):
+    """
+    Process command line arguments in a consistent fashion for the
+    plot_wrfout elementary scripts.
+    """
+
+    def process_time_window_argument(argument):
+        """
+        Process the time window argument and return a tuple of datetime objects
+        (start_time, end_time)
+        """
+        import datetime
+        try:
+            dummy = (argument).split('-')
+            start_time = dummy[0].split('/')
+            start_time = [int(e) for e in start_time]
+        except:
+            sys.exit('\nERROR:\tI cannot make sense of the time window '
+              + argument + '\n\tI need something like '
+              + 'yyyy/mm/dd/hh/mm/ss-yyyy/mm/dd/hh/mm/ss but will also '
+              + 'cope without hours, minutes or seconds.')
+        # this is only intended to work if we have missing hour, minute, or
+        # seconds. At least the date ought to be complete!
+        while len(start_time) < 6:
+            start_time.append(0)
+        year, month, day, hour, minute, second = start_time
+        start_time = \
+          datetime.datetime(year, month, day, hour, minute, second)
+        end_time = dummy[1].split('/')
+        end_time = [int(e) for e in end_time]
+        # this is only intended to work if we have missing hour, minute, or
+        # seconds. At least the date ought to be complete!
+        while len(end_time) < 6:
+            end_time.append(0)
+        year, month, day, hour, minute, second = end_time
+        end_time = \
+          datetime.datetime(year, month, day, hour, minute, second)
+        #print start_time.ctime(), end_time.ctime()
+        return (start_time, end_time)
+
+    if len(argv) < 2:
+        sys.exit( '\nERROR:\tI need (at least) one file to extract the data from...'
+          + '\n\tPlease try something like:\n\tpython ' + argv[0] \
+          + ' wrfout_dpp_yyyy-mm-dd_hh:mm:ss')
+    else:
+        # Let's store the name of the calling script and considered it
+        # processed
+        caller = argv.pop(0)
+        # let's start with checking that the the first argument is a legit wrfout
+        # file name and that it exists
+        input_file = argv.pop(0)
+        # this should be more stringent, but I don't have time
+        if 'wrfout' not in input_file:
+            sys.exit(
+              '\nERROR:\t' + input_file + ' is not a standard wrf output file'
+              + 'name.\n\tI need something like ' 
+              + 'wrfout_dpp_yyyy-mm-dd_hh:mm:ss')
+        if not os.path.isfile(input_file):
+            sys.exit( '\nERROR:\tfile ' + input_file + ' does not exist!')
+        output_dir = None
+        time_window = None
+        # let's have a look at the arguments left, if any.
+        # every command line argument that is not the input file will come as a
+        # pair flag/value to avoid confusion. If the program cannot make sense of
+        # the input arguments it will bail out with a (possibly helpful) error 
+        # message
+        if '--output_dir' in argv:
+            flag_idx = argv.index('--output_dir')
+            value_idx = flag_idx + 1
+            # the order of the following two statements is important not to
+            # break the way we use pop
+            output_dir = argv.pop(value_idx)
+            flag = argv.pop(flag_idx)
+            if not os.path.isdir(output_dir):
+                sys.exit('\nERROR:\t' + output_dir + 'is not a directory!')
+        if '-o' in argv:
+            flag_idx = argv.index('-o')
+            value_idx = flag_idx + 1
+            # the order of the following two statements is important not to
+            # break the way we use pop
+            output_dir = argv.pop(value_idx)
+            flag = argv.pop(flag_idx)
+            if not os.path.isdir(output_dir):
+                sys.exit('\nERROR:\t' + output_dir + 'is not a directory!')
+        if '--time_window' in argv:
+            flag_idx = argv.index('--time_window')
+            value_idx = flag_idx + 1
+            # the order of the following two statements is important not to
+            # break the way we use pop
+            time_argument = argv.pop(value_idx)
+            flag = argv.pop(flag_idx)
+            time_window = process_time_window_argument(time_argument)
+        if '-t' in argv:
+            flag_idx = argv.index('-t')
+            value_idx = flag_idx + 1
+            # the order of the following two statements is important not to
+            # break the way we use pop
+            time_argument = argv.pop(value_idx)
+            flag = argv.pop(flag_idx)
+            time_window = process_time_window_argument(time_argument)
+        if len(argv) != 0:
+            unknown_arguments = ''
+            for argument in argv:
+                unknown_arguments += argument + '\n\t'
+            sys.exit('\nERROR:\tI do not know how to process the following '
+              + 'arguments:\n\t' + unknown_arguments)
+
+        return input_file, output_dir, time_window
+
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/plot_wrfout/plot_mslp.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/plot_wrfout/plot_mslp.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/plot_wrfout/plot_mslp.py	(revision 207)
@@ -0,0 +1,117 @@
+"""
+This script plots the mslp from a single wrfout file. It can be run from the
+command line as a standalone script or imported into another script and
+executed from there.
+"""
+
+import sys
+import os
+#import gc
+import pywrf.viz.utils as vu
+import pywrf.wrf.utils as wu
+  
+def generate_frames(input_file_name, output_dir=None, time_window=None):
+    """
+    Generate the the mslp frames from a single wrfout file and save them in 
+    the chosen directory. When the script is called as a standalone program
+    this function is called under the hood.
+    NB if no output directory is supplied the default will be the directory
+    from which the script is invoked.
+
+    Usage
+    >>> import plot_mslp
+    >>> plot_mslp(input_file_name, output_dir, time_window)
+    """
+    # if the output directory is not specified or invalid
+    if output_dir is None \
+      or not os.path.isdir(output_dir):
+        output_dir = os.getcwd()
+
+    log_file = os.path.join(output_dir, 'plot_mslp.log')
+    if os.path.isfile(log_file):
+        os.remove(log_file)
+    vu.write_to_log_file(log_file, 'Started execution of plot_mslp.py')
+
+    # let's check for a local plot_wrfout_config or use default
+    if os.path.isfile(os.path.join(os.getcwd(),'plot_wrfout_config.py')):
+        sys.path.insert(0, os.getcwd())
+        vu.write_to_log_file(log_file, 
+          'Using plot_wrfout_config from present working directory')
+        import plot_wrfout_config as pwc
+    else:
+        vu.write_to_log_file(log_file,
+          'Using default plot_wrfout_config')
+        import plot_wrfout_config as pwc
+
+    # We are assuming the standard wrfout names are used!
+    # lets first work out the domain flag so that we can then use it to select
+    # the right set of countours from the dictionary contained in
+    # plot_wrfout_config.py
+    # we index from the end to cope with absolute paths in the input_file_name
+    domain = input_file_name[-23:-20]
+    # we will assume the normal wrfout file name structure without a file
+    # extension. Furthemore, we assume that the file is a netcdf format. The
+    # above is reasonable but potentially fragile.
+    input_file, vars_dict = vu.peek(input_file_name + '.nc', 
+      return_pointers=True, show_vars=False)
+    times = wu.time_string_to_datetime(vars_dict['Times'].get_value())
+    # calculate the indeces for the minimum and maximum times to be plotted
+    if time_window is not None:
+        start_time = time_window[0]
+        end_time = time_window[1]
+        time_min_idx = 0
+        time_max_idx = len(times)
+        for time_idx in range(len(times)):
+            if times[time_min_idx] < start_time:
+                time_min_idx = time_idx
+        for time_idx in range(len(times) - 1, -1, -1):
+            if times[time_idx] >= end_time:
+                time_max_idx = time_idx
+    else: 
+        time_min_idx = 0
+        time_max_idx = len(times)
+    # assuming the grid does not move then we are legitimated to take 
+    # the values of latitude and longitude at the first time step
+    lon = vars_dict['XLONG'].get_value()[0]
+    lat = vars_dict['XLAT'].get_value()[0]
+
+    for time_idx in range(time_min_idx, time_max_idx):
+        vu.write_to_log_file(log_file, 
+          '\tprocessing time ' + times[time_idx].ctime())
+        time_string = vu.set_time_string('manual', times[time_idx].timetuple())
+        title_string = vu.set_title_string('pressure', 'hPa', 
+          time_string, 'Sea-level') 
+        mslp = wu.calculate_mslp_wrapper(vars_dict, time_idx)
+        wind_vector = None
+        if pwc.plot_wind_vectors:
+            zonal_wind = vars_dict['U10'].get_value()[time_idx].copy()
+            meridional_wind = vars_dict['V10'].get_value()[time_idx].copy()
+            wind_vector = (zonal_wind, meridional_wind)
+        output_file_name = vu.generate_output_file_name(output_dir, 'mslp_', 
+          times[time_idx].timetuple())
+        vu.plot_slab(lon, lat, mslp,
+          cntr_lvl=pwc.mslp_cntr_lvl[domain],
+          file_name=output_file_name,
+          colorbar=pwc.plot_colorbar,
+          contour_labels=pwc.plot_contour_labels,
+          meridians_delta=pwc.meridians_delta[domain],
+          parallels_delta=pwc.parallels_delta[domain],
+          quiv_skip=pwc.quiv_skip[domain],
+          frame_width=pwc.frame_width[domain],
+          wind_vector=wind_vector,
+          monochrome=pwc.monochrome,
+          quiverkey_length=pwc.quiverkey_length[domain],
+          title_string=title_string
+          )
+        #del mslp
+
+    input_file.close()
+    #del lon, lat, input_file, vars_dict
+    #gc.collect()
+
+    vu.write_to_log_file(log_file, 'Completed execution of plot_mslp.py')
+
+if __name__ == '__main__':
+    input_file, output_dir, time_window = \
+      vu.process_command_line_arguments_enhanced(sys.argv)
+    generate_frames(input_file, output_dir, time_window)
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/plot_wrfout/plot_sfc_mixing_ratio.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/plot_wrfout/plot_sfc_mixing_ratio.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/plot_wrfout/plot_sfc_mixing_ratio.py	(revision 207)
@@ -0,0 +1,120 @@
+"""
+This script plots the 2m water vapour mixing ratio from a single wrfout file. 
+It can be run from the command line as a standalone script or imported into 
+another script and executed from there.
+"""
+
+import sys
+import os
+#import gc
+import pywrf.viz.utils as vu
+import pywrf.wrf.utils as wu
+  
+def generate_frames(input_file_name, output_dir=None, time_window=None):
+    """
+    Generate the the sfc_water vapour mixing ratio frames from a single wrfout
+    file and save them in the chosen directory. When the script is called as 
+    a standalone program this function is called under the hood.
+    NB if no output directory is supplied the default will be the directory
+    from which the script is invoked.
+
+    Usage
+    >>> import plot_sfc_mixing_ratio
+    >>> plot_sfc_mixing_ratio(input_file_name, output_dir, time_window)
+    """
+    # if the output directory is not specified or invalid
+    if output_dir is None \
+      or not os.path.isdir(output_dir):
+        output_dir = os.getcwd()
+
+    log_file = os.path.join(output_dir, 'plot_sfc_mixing_ratio.log')
+    if os.path.isfile(log_file):
+        os.remove(log_file)
+    vu.write_to_log_file(log_file, 'Started execution of plot_sfc_mixing_ratio.py')
+
+    # let's check for a local plot_wrfout_config or use default
+    if os.path.isfile(os.path.join(os.getcwd(),'plot_wrfout_config.py')):
+        sys.path.insert(0, os.getcwd())
+        vu.write_to_log_file(log_file, 
+          'Using plot_wrfout_config from present working directory')
+        import plot_wrfout_config as pwc
+    else:
+        vu.write_to_log_file(log_file,
+          'Using default plot_wrfout_config')
+        import plot_wrfout_config as pwc
+
+    # We are assuming the standard wrfout names are used!
+    # lets first work out the domain flag so that we can then use it to select
+    # the right set of countours from the dictionary contained in
+    # plot_wrfout_config.py
+    # we index from the end to cope with absolute paths in the input_file_name
+    domain = input_file_name[-23:-20]
+    # we will assume the normal wrfout file name structure without a file
+    # extension. Furthemore, we assume that the file is a netcdf format. The
+    # above is reasonable but potentially fragile.
+    input_file, vars_dict = vu.peek(input_file_name + '.nc', 
+      return_pointers=True, show_vars=False)
+    times = wu.time_string_to_datetime(vars_dict['Times'].get_value())
+    # calculate the indeces for the minimum and maximum times to be plotted
+    if time_window is not None:
+        start_time = time_window[0]
+        end_time = time_window[1]
+        time_min_idx = 0
+        time_max_idx = len(times)
+        for time_idx in range(len(times)):
+            if times[time_min_idx] < start_time:
+                time_min_idx = time_idx
+        for time_idx in range(len(times) - 1, -1, -1):
+            if times[time_idx] >= end_time:
+                time_max_idx = time_idx
+    else: 
+        time_min_idx = 0
+        time_max_idx = len(times)
+    # assuming the grid does not move then we are legitimated to take 
+    # the values of latitude and longitude at the first time step
+    lon = vars_dict['XLONG'].get_value()[0]
+    lat = vars_dict['XLAT'].get_value()[0]
+
+    for time_idx in range(time_min_idx, time_max_idx):
+        vu.write_to_log_file(log_file, 
+          '\tprocessing time ' + times[time_idx].ctime())
+        time_string = vu.set_time_string('manual', times[time_idx].timetuple())
+        title_string = vu.set_title_string('water vapour mixing ratio', 'g/kg', 
+          time_string, 'sfc',) 
+        mixing_ratio = vars_dict['Q2'].get_value()[time_idx].copy()
+        # kg/kg -> g/kg
+        mixing_ratio = mixing_ratio * 1000.
+        wind_vector = None
+        if pwc.plot_wind_vectors:
+            zonal_wind = vars_dict['U10'].get_value()[time_idx].copy()
+            meridional_wind = vars_dict['V10'].get_value()[time_idx].copy()
+            wind_vector = (zonal_wind, meridional_wind)
+        output_file_name = vu.generate_output_file_name(output_dir,
+          'sfc_mix_ratio_', times[time_idx].timetuple())
+        vu.plot_slab(lon, lat, mixing_ratio,
+          cntr_lvl=pwc.sfc_mixing_ratio_cntr_lvl[domain],
+          file_name=output_file_name,
+          colorbar=pwc.plot_colorbar,
+          contour_labels=pwc.plot_contour_labels,
+          meridians_delta=pwc.meridians_delta[domain],
+          parallels_delta=pwc.parallels_delta[domain],
+          quiv_skip=pwc.quiv_skip[domain],
+          frame_width=pwc.frame_width[domain],
+          wind_vector=wind_vector,
+          monochrome=pwc.monochrome,
+          quiverkey_length=pwc.quiverkey_length[domain],
+          title_string=title_string
+          )
+        #del mixing_ratio
+
+    input_file.close()
+    #del lon, lat, input_file, vars_dict
+    #gc.collect()
+
+    vu.write_to_log_file(log_file, 
+      'Completed execution of plot_sfc_mixing_ratio.py')
+
+if __name__ == '__main__':
+    input_file, output_dir, time_window = \
+      vu.process_command_line_arguments_enhanced(sys.argv)
+    generate_frames(input_file, output_dir, time_window)
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/plot_wrfout/plot_wrfout_config.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/plot_wrfout/plot_wrfout_config.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/plot_wrfout/plot_wrfout_config.py	(revision 207)
@@ -0,0 +1,57 @@
+'''
+This module is a central repository of the values that the various contour
+levels should have. Each script will check first in the directory from which
+they are run for a personalized version of these files or default to the one
+in pywrf/wrf/plot_wrfout/plot_wrfout_config.py
+'''
+
+import numpy as n
+
+# I think only one style should be adopted for all the plots hence
+plot_colorbar = True
+plot_contour_labels = False
+plot_wind_vectors = True
+monochrome = False
+
+frame_width = {}
+frame_width['d01'] = 5.0
+frame_width['d02'] = 5.0
+frame_width['d03'] = 0.5
+
+quiv_skip = {}
+quiv_skip['d01'] = 5
+quiv_skip['d02'] = 12
+quiv_skip['d03'] = 10
+
+meridians_delta = {}
+meridians_delta['d01'] = 15
+meridians_delta['d02'] = 15
+meridians_delta['d03'] = 3
+
+parallels_delta = {}
+parallels_delta['d01'] = 15
+parallels_delta['d02'] = 15
+parallels_delta['d03'] = 3
+
+quiverkey_length = {}
+quiverkey_length['d01'] = 10
+quiverkey_length['d02'] = 10
+quiverkey_length['d03'] = 10
+
+mslp_cntr_lvl = {}
+# this looked pretty with the gist_ncar colormap
+# over Australia at 36km resolution
+# and grid corners (following wrfout metadata notation)
+# LAT_LL_T = -50.81659
+# LON_LL_T = 100.8601
+# LAT_UR_T = -13.36167
+# LON_UR_T = 165.0748
+mslp_cntr_lvl['d01'] = n.arange(976,1041,4)
+mslp_cntr_lvl['d02'] = n.arange(976,1041,4)
+mslp_cntr_lvl['d03'] = n.arange(1004,1028,1)
+
+
+sfc_mixing_ratio_cntr_lvl = {}
+sfc_mixing_ratio_cntr_lvl['d01'] = n.arange(0,32,2)
+sfc_mixing_ratio_cntr_lvl['d02'] = n.arange(0,32,2)
+sfc_mixing_ratio_cntr_lvl['d03'] = n.arange(0,28,1)
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/pydown/pydown.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/pydown/pydown.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/pydown/pydown.py	(revision 207)
@@ -0,0 +1,635 @@
+#!/usr/bin/python
+
+import os
+import sys
+import cPickle
+import subprocess as sp
+
+import pywrf.wrf.utils as wu
+import pywrf.wrf.pydown.utils as pdu
+
+
+def phase_description(phase_idx,pp):
+    '''
+    Returns a string that describes the phase that we are at
+
+    The 'phases' are:
+    phase 0: from wps to d01 real
+    phase 1: from d01 real to d01 wrf
+    phase 2: from d01 wrf to ppcheck
+    phase 3 ie (2 + 4*(pp-2) + 1): from ppcheck to d02 (dpp) real
+    phase 4 ie (2 + 4*(pp-2) + 2): from d02 (dpp) real to d02 (dpp) ndown
+    phase 5 ie (2 + 4*(pp-2) + 3): from d02 (dpp) ndown to d02 (dpp) wrf
+    phase 6 ie (2 + 4*(pp-2) + 4): from d02 (dpp) wrf to dppcheck
+    ...
+    for pp <= max_dom
+    '''
+    # if we are dealing we the outermost domain...
+    if phase_idx < 3:
+        if phase_idx == 0:
+            return 'Phase ' + str(phase_idx) + ': ' \
+              + 'We start by running the wps binaries and doing the housekeeping ' \
+              + 'needed to run real.exe for d' + str(pp).zfill(2) + '.'
+        elif phase_idx == 1:
+            return 'Phase ' + str(phase_idx) + ': ' \
+              + 'real.exe has completed for d' + str(pp).zfill(2) + '. ' \
+              + 'we can now move on to prepare for wrf.exe.'
+        elif phase_idx == 2:
+            return 'Phase ' + str(phase_idx) + ': ' \
+              + 'wrf.exe completed for d' + str(pp).zfill(2) + '. '\
+              + 'We are now going to archive the results and check if there ' \
+              + 'are more nests to run.'
+    # if we are dealing with one of the nests
+    else:
+        # reduce to 1-4
+        loop_idx = phase_idx - 4*(pp-2) - 2
+        if loop_idx == 1:
+            return 'Phase ' + str(phase_idx) + ': ' \
+              + 'Yup, we will now work on d' + str(pp).zfill(2) + '. '\
+              + 'We start by running real.exe for this grid by itself.'
+        elif loop_idx == 2:
+            return 'Phase ' + str(phase_idx) + ': ' \
+              + 'real.exe is done for d' + str(pp).zfill(2) + '. '\
+              + 'We now prepare to run ndown.exe for this grid and its parent.'
+        elif loop_idx == 3:
+            return 'Phase ' + str(phase_idx) + ': ' \
+              + 'ndown.exe is done for d' + str(pp).zfill(2) + '. '\
+              + 'We now prepare to run wrf.exe for this grid.'
+        elif loop_idx == 4:
+            return 'Phase ' + str(phase_idx) + ': ' \
+              + 'wrf.exe completed for d' + str(pp).zfill(2) + '. '\
+              + 'We are now going to archive the results and check if there ' \
+              + 'are more nests to run.'
+        
+def this_is_what_you_should_do_next(phase_idx):
+    '''
+    Returns a string that describes the mpi job that should be submitted and
+    checked after the previous phase
+
+    The 'phases' are:
+    phase 0: from wps to d01 real
+    phase 1: from d01 real to d01 wrf
+    phase 2: from d01 wrf to ppcheck
+    phase 3 ie (2 + 4*(pp-2) + 1): from ppcheck to d02 (dpp) real
+    phase 4 ie (2 + 4*(pp-2) + 2): from d02 (dpp) real to d02 (dpp) ndown
+    phase 5 ie (2 + 4*(pp-2) + 3): from d02 (dpp) ndown to d02 (dpp) wrf
+    phase 6 ie (2 + 4*(pp-2) + 4): from d02 (dpp) wrf to dppcheck
+    ...
+    for pp <= max_dom
+    '''
+    # if we are dealing withe the outermost domain...
+    if phase_idx < 3:
+        if phase_idx == 0:
+            return '\nCompleted phase ' + str(phase_idx) + '! ' \
+              + 'Now submit real.exe as an mpi job. Do not forget to check ' \
+              + 'the resuts ;)'
+        elif phase_idx == 1:
+            return 'Completed phase ' + str(phase_idx) + '! ' \
+              + 'Now submit wrf.exe as an mpi job. Do not forget to check ' \
+              + 'the resuts ;)'
+        elif phase_idx == 2:
+            return 'Completed phase ' + str(phase_idx) + '! ' \
+              + 'Just keep going to see if there is any more to do ;]'
+    # if we are dealing with one of the nests
+    else:
+        # reduce to 1-4
+        loop_idx = phase_idx - 4*(pp-2) - 2
+        if loop_idx == 1:
+            return 'Completed phase ' + str(phase_idx) + '! ' \
+              + 'Now submit real.exe as an mpi job. Do not forget to check ' \
+              + 'the resuts ;)'
+        elif loop_idx == 2:
+            return 'Completed phase ' + str(phase_idx) + '! ' \
+              + 'Now submit ndown.exe as an mpi job. Do not forget to check ' \
+              + 'the resuts ;)'
+        elif loop_idx == 3:
+            return 'Completed phase ' + str(phase_idx) + '! ' \
+              + 'Now submit wrf.exe as an mpi job. Do not forget to check ' \
+              + 'the resuts ;)'
+        elif loop_idx == 4:
+            return 'Completed phase ' + str(phase_idx) + '! ' \
+              + 'Just keep going to see if there is any more to do ;]'
+
+def check_with_user():
+    answer = raw_input('\nSowhaddoyouwonnadonow? Should we go ahead? [y/n]: ')
+    if answer not in ['y','n']:
+        check_with_user()
+    if answer == 'n':
+        dump_status()
+        sys.exit('Status saved: see yaa!')
+    else:
+        print
+
+def dump_status():
+    cPickle.dump((phase_completed),open(pydown_status,'w'))
+    return
+
+def load_status():
+    return cPickle.load(open(pydown_status,'r'))
+    
+
+
+# TODO make the pydown_dir a command_line argument (?)
+pydown_dir = os.getcwd()
+pydown_status = os.path.join(pydown_dir,'pydown.status')
+wps_dir = os.path.join(pydown_dir,'WPS')
+run_dir = os.path.join(pydown_dir,'WRFV2','run')
+archive_dir = os.path.join(pydown_dir,'archive')
+namelist_wps = os.path.join(wps_dir,'namelist.wps')
+namelist_input_master = os.path.join(run_dir,'namelist.input.master')
+
+#TODO consistency checks between namelist.wps and namelist.input
+# for now let's take it from namelist.input and assume the two namelists are
+# compatible
+namelist_input_master_dict = wu.read_namelist(namelist_input_master)
+max_dom = namelist_input_master_dict['&domains']['max_dom'][0]
+no_of_phases = (2 + 4*(max_dom-2) + 4) + 1
+phase_idx = 0
+pp = 1
+
+# control tower     
+# is this a brand new run or are we continuing a previous one?
+if os.path.isfile(pydown_status):
+    print '\nThis is what has been already done:\n'
+    phase_completed = load_status()
+    ready_to_roll = False
+else:
+    # Initial checks to protect fragile operations
+    fix_before_we_start = ''
+
+    if os.path.isdir(wps_dir):
+        wps_files = os.listdir(wps_dir)
+        if not ('GRIBFILE.AAA' in wps_files and 'GRIBFILE.AAB' in wps_files):
+            fix_before_we_start += "\t- There is no way for me to know which grib " \
+              + "files you want linked to generate the WRF's ICs and BCs so " \
+              + " please go back and link the ones you want.\n"
+        if 'Vtable' not in wps_files:
+            fix_before_we_start += "\t- There is no way for me to know which " \
+              + "Vtable goes with your grib files of choice so please go back " \
+              + "and link the one you want.\n"
+    else:
+        fix_before_we_start += "I couldn't find the WPS directory " \
+          + wps_dir + '\n'
+
+    if os.path.isdir(run_dir):
+        run_files = os.listdir(run_dir)
+        if 'namelist.input' in run_files:
+            fix_before_we_start += '\t- namelist.input in your ' + run_dir \
+            + ' will bother me so please move/delete it.\n'
+        if 'namelist.input.master' not in run_files:
+            fix_before_we_start += '\t- I expected to find a namelist.input.master ' \
+              + 'in your ' + run_dir + ' please put one (possibly sensible) ' \
+              + 'there for me to know what to do.\n'
+        if True in ['met_em' in file for file in run_files]:
+            fix_before_we_start += "\t- It looks like you've met_em files (or dir) " \
+              + "in your " + run_dir + ', please move/delete them.\n'
+    else:
+        fix_before_we_start += "\t- I couldn't find the run directory\n" \
+          + run_dir 
+
+    if os.path.isdir(archive_dir):
+        archive_files = os.listdir(archive_dir)
+        if not (archive_files == ['README'] 
+          or archive_files == ['README','README~']):
+            # TODO this request might just be me being lazy so make it more general
+            # if are so inclined
+            fix_before_we_start += "\t- All I would like to see in the archive " \
+              + "directory is a README file.\n" \
+              + " \t\tDon't be lazy: jot down a couple of sentences in" \
+              + " archive/README" \
+              + " describing what you set out to achieve with this run... " \
+              + " Yeah, I know it's boring, but you will thank me later ;]\n" \
+              + " \t\tIf you've done this already, then get rid of any other" \
+              + " file in the archive folder."
+    else:
+        fix_before_we_start += "\t- I couldn't find the archive directory " \
+          + archive_dir + '\n'
+
+    if fix_before_we_start != '':
+        # We've got a problem
+        print 'Please address the following and restart the script:'
+        print fix_before_we_start
+        sys.exit()
+    else:
+        # All is good (or the error is semantyc).
+        print "Welcome to pydown. I have found all I need in order to start," \
+         + "so let's begin with:"
+        print phase_description(phase_idx,pp)
+    
+    phase_completed = [False for idx in range(no_of_phases)]
+    check_with_user()
+    ready_to_roll = True
+
+if not ready_to_roll and not phase_completed[phase_idx]:
+    print '\nThis is what has to be done next:\n'
+    print phase_description(phase_idx,pp)
+    check_with_user()   
+    ready_to_roll = True
+print phase_description(phase_idx,pp)
+if ready_to_roll:
+    os.chdir(wps_dir)
+    print '\tMoved to ' + wps_dir + '.'
+    # TODO I am assuming the user has already linked the correct Vtable and
+    # grib files as I cannot extract that information from the namelists...
+
+    # Let's run the wps components
+    print '\tRunning geogrid.exe:'
+    if 'Successful completion of geogrid' not in \
+      sp.Popen('./geogrid.exe', stdout=sp.PIPE).communicate()[0]:
+        # TODO handle the error in a more useful way.
+        print "Houston we've got a problem... with geogrid.exe!"
+    else:
+        print '\t\tDone!'
+    print '\tRunning ungrib.exe:'
+    if 'Successful completion of ungrib' not in \
+      sp.Popen('./ungrib.exe', stdout=sp.PIPE).communicate()[0]:
+        # TODO handle the error in a more useful way.
+        print "Houston we've got a problem... with ungrib.exe!"
+    else:
+        print '\t\tDone!'
+    print '\tRunning metgrid.exe:'
+    if 'Successful completion of metgrid' not in \
+      sp.Popen('./metgrid.exe', stdout=sp.PIPE).communicate()[0]:
+        # TODO handle the error in a more useful way.
+        print "Houston we've got a problem... with metgrid.exe!"
+    else:
+        print '\t\tDone!'
+
+    # By this stage the wps components should have executed successfully so we
+    # move on to archive the appropriate metadata for future reference
+    print '\tZipping metadata archive:'
+    wps_metadata = 'wps_metadata.zip'
+    cmd = r'zip ' + wps_metadata + ' configure.wps Vtable namelist.wps '
+    # TODO I am assuming standard name for the ungrib intermediate files ->
+    # this should be made more general by reading it from namelist.wps
+    for file in os.listdir(os.getcwd()):
+        if 'met_em' in file \
+          or '.log' in file \
+          or 'geo_em' in file \
+          or 'GRIBFILE' in file \
+          or 'FILE' in file :
+            cmd += file + ' '
+    # The following is to ignore both stdout and stderr from the zip command
+    # TODO check if the following syntax represents a portability issue
+    if sp.call(cmd.split(), stdout=open('/dev/null','w'), stderr = sp.STDOUT) == 0:
+        print '\t\tDone!'
+
+    # let's archive the metadata and move the met_em files to a met_en dir in
+    # the run_dir moving them out of the wps directory will free it up for 
+    # other uses
+    # TODO none of the possible exceptions are caught... beware!
+    print '\tArchiving metadata:'
+    os.rename(wps_metadata,os.path.join(archive_dir,wps_metadata))
+    print '\t\tDone!'
+
+    print '\tMoving met_em* files to the run directory:'
+    os.mkdir(os.path.join(run_dir,'met_em'))
+    for file in os.listdir(os.getcwd()):
+        if 'met_em' in file:
+            os.rename(file,os.path.join(run_dir,'met_em',file))
+    print '\t\tDone!'
+    
+    # let's now clean the wps_dir
+    # TODO I am just being lazy here but the user 
+    # should be forced to regenerate Vtable and GRIBFILE.* links every time to
+    # make sure they are the right thing... beware!
+          #or 'GRIBFILE' in file \
+          #or 'Vtable' == file \
+    print '\tCleaning the wps directory:'
+    for file in os.listdir(os.getcwd()):
+        if 'geo_em' in file \
+          or 'FILE:' in file \
+          or 'PFILE:' in file:
+            os.remove(file)
+    print '\t\tDone!'
+
+    print '\tGenerating the namelist.input.d01.real:'
+    current_namelist_input = \
+      pdu.generate_namelist_input_d01_real(namelist_input_master,run_dir)
+    print '\t\tDone!'
+
+    print '\tLinking the just generated namelist.input:'
+    os.symlink(current_namelist_input,os.path.join(run_dir,'namelist.input'))
+    print '\t\tDone!'
+    
+    print '\tLinking the previously generated met_em files:'
+    for file in os.listdir(os.path.join(run_dir,'met_em')):
+        if 'd' + str(pp).zfill(2) in file:
+            os.symlink(os.path.join(run_dir,'met_em',file),
+              os.path.join(run_dir,file[:9] + '1' + file[10:]))
+    print '\t\tDone!'
+
+    phase_completed[phase_idx] = True
+    # let's be patronizing...
+    print this_is_what_you_should_do_next(phase_idx)
+    check_with_user()
+# we are finished let's move on to the next phase
+phase_idx += 1
+
+if not ready_to_roll and not phase_completed[phase_idx]:
+    print '\nThis is what has to be done next:\n'
+    print phase_description(phase_idx,pp)
+    check_with_user()   
+    ready_to_roll = True
+print phase_description(phase_idx,pp)
+if ready_to_roll:
+    # let's start with a little housekeeping to clean after the real.exe
+    os.chdir(run_dir)
+    print '\tMoved to ' + run_dir + '.'
+    print '\tMoving real log files out of the way:'
+    os.mkdir(os.path.join(run_dir,'real_logs'))
+    for file in os.listdir(os.getcwd()):
+        if 'rsl' in file \
+          or 'std' in file:
+            os.rename(file,os.path.join(run_dir,'real_logs',file))
+    print '\t\tDone!'
+    
+    print '\tGenerating the namelist.input.d01.wrf:'
+    current_namelist_input = \
+      pdu.generate_namelist_input_d01_wrf(namelist_input_master,run_dir)
+    print '\t\tDone!'
+
+    print '\tLinking the just generated namelist.input:'
+    os.remove(os.path.join(run_dir,'namelist.input'))
+    os.symlink(current_namelist_input,os.path.join(run_dir,'namelist.input'))
+    print '\t\tDone!'
+
+    phase_completed[phase_idx] = True
+    print this_is_what_you_should_do_next(phase_idx)
+    check_with_user()
+    # we are finished let's move on to the next phase
+phase_idx += 1
+
+if not ready_to_roll and not phase_completed[phase_idx]:
+    print '\nThis is what has to be done next:\n'
+    print phase_description(phase_idx,pp)
+    check_with_user()   
+    ready_to_roll = True
+print phase_description(phase_idx,pp)
+if ready_to_roll:
+    # let's start with a little housekeeping to clean after the wrf.exe
+    os.chdir(run_dir)
+    print '\tMoved to ' + run_dir + '.'
+    print '\tMoving wrf log files out of the way:'
+    os.mkdir(os.path.join(run_dir,'wrf_logs'))
+    for file in os.listdir(os.getcwd()):
+        if 'rsl' in file \
+          or 'std' in file:
+            os.rename(file,os.path.join(run_dir,'wrf_logs',file))
+    print '\t\tDone!'
+
+    # then move on to generating and archiving the metadata and wrfout_d01*
+    print '\tZipping metadata archive:'
+    wrf_metadata = 'wrf_metadata_d' + str(pp).zfill(2) + '.zip'
+    cmd = r'zip -r ' + wrf_metadata + ' wrfndi_d02 ../compile.log ' \
+      + '../configure.wrf wrfinput_d01 wrfbdy_d01 submit_wrf.sh ' \
+      + 'submit_real.sh submit_ndown.sh namelist.input ' \
+      + 'wrf_logs real_logs ndown_logs'
+    # The following is to ignore both stdout and stderr from the zip command
+    # TODO check if the following syntax represents a portability issue
+    if sp.call(cmd.split(), stdout=open('/dev/null','w'), stderr = sp.STDOUT) == 0:
+        print '\t\tDone!'
+
+    # TODO check that the appropriate directory structure exist for the archive
+    # and create it if it doesn't    
+    # TODO none of the possible exceptions are caught... beware!
+    print '\tArchiving metadata:'
+    os.rename(wrf_metadata,os.path.join(archive_dir,wrf_metadata))
+    print '\t\tDone!'
+
+    print '\tMoving wrfout_d01* files to the archive directory:'
+    for file in os.listdir(os.getcwd()):
+        if 'wrfout' in file:
+            os.rename(file,os.path.join(archive_dir,file))
+    print '\t\tDone!'
+    
+    # let's now clean the wrf_dir
+    print '\tCleaning the wrf directory:'
+    for file_or_dir in os.listdir(os.getcwd()):
+        if 'met_em.' in file_or_dir \
+          or 'wrfinput' in file_or_dir \
+          or 'wrfndi' in file_or_dir \
+          or 'namelist.input' == file_or_dir \
+          or 'wrfbdy' in file_or_dir:
+            os.remove(file_or_dir)
+        # only my logs directories will match 'logs'
+        # TODO make this more general/robust or warn the user they should not
+        # have anything that matches this check in their run_dir
+        if 'logs' in file_or_dir:
+            for nested_file in os.listdir(file_or_dir):
+                os.remove(os.path.join(file_or_dir,nested_file))
+            os.rmdir(file_or_dir)
+    print '\t\tDone!'
+
+    phase_completed[phase_idx] = True
+    print this_is_what_you_should_do_next(phase_idx)
+    check_with_user()
+# we are finished let's move on to the next phase
+phase_idx += 1
+
+while pp < max_dom:
+    pp += 1
+
+    if not ready_to_roll and not phase_completed[phase_idx]:
+        print '\nThis is what has to be done next:\n'
+        print phase_description(phase_idx,pp)
+        check_with_user()   
+        ready_to_roll = True
+    print phase_description(phase_idx,pp)
+    if ready_to_roll:
+        print '\tGenerating the namelist.input.d' + str(pp).zfill(2) + '.real:'
+        current_namelist_input = \
+          pdu.generate_namelist_input_dpp_real(pp,namelist_input_master,run_dir)
+        print '\t\tDone!'
+
+        print '\tLinking the just generated namelist.input:'
+        os.symlink(current_namelist_input,os.path.join(run_dir,'namelist.input'))
+        print '\t\tDone!'
+        
+        print '\tLinking the previously generated met_em files:'
+        for file in os.listdir(os.path.join(run_dir,'met_em')):
+            if 'd' + str(pp).zfill(2) in file:
+                os.symlink(os.path.join(run_dir,'met_em',file),
+                  os.path.join(run_dir,file[:9] + '1' + file[10:]))
+        print '\t\tDone!'
+        
+        phase_completed[phase_idx] = True
+        print this_is_what_you_should_do_next(phase_idx)
+        check_with_user()
+    # we are finished let's move on to the next phase
+    phase_idx += 1
+    
+    if not ready_to_roll and not phase_completed[phase_idx]:
+        print '\nThis is what has to be done next:\n'
+        print phase_description(phase_idx,pp)
+        check_with_user()   
+        ready_to_roll = True
+    print phase_description(phase_idx,pp)
+    if ready_to_roll:
+        # let's start with a little housekeeping to clean after the real.exe
+        os.chdir(run_dir)
+        print '\tMoved to ' + run_dir + '.'
+
+        print '\tMoving real log files out of the way:'
+        os.mkdir(os.path.join(run_dir,'real_logs'))
+        for file in os.listdir(os.getcwd()):
+            if 'rsl' in file \
+              or 'std' in file:
+                os.rename(file,os.path.join(run_dir,'real_logs',file))
+        print '\t\tDone!'
+
+        #let's prepare for ndown
+        print '\tRename wrfinput_d01 wrfndi_02 and get rid of wrfbdy_d01:'
+        os.rename('wrfinput_d01','wrfndi_d02')
+        os.remove('wrfbdy_d01')
+        print '\t\tDone!'
+
+        print '\tGenerating the namelist.input.d' + str(pp).zfill(2) + '.ndown:'
+        current_namelist_input = \
+          pdu.generate_namelist_input_dpp_ndown(pp,namelist_input_master,run_dir)
+        print '\t\tDone!'
+
+        print '\tLinking the just generated namelist.input:'
+        if os.path.isfile(os.path.join(run_dir,'namelist.input')):
+            os.remove(os.path.join(run_dir,'namelist.input'))
+        os.symlink(current_namelist_input,os.path.join(run_dir,'namelist.input'))
+        print '\t\tDone!'
+
+        # TODO this statement is untested
+        print '\tLinking the (previously calculated) wrfout_d' \
+          + str(pp-1).zfill(2)
+        for file in os.listdir(archive_dir):
+            if 'wrfout_d' + str(pp-1).zfill(2) in file:
+                os.symlink(os.path.join(archive_dir,file),
+                file[:9] + '1' + file[10:])
+        print '\t\tDone!' 
+
+        phase_completed[phase_idx] = True
+        print this_is_what_you_should_do_next(phase_idx)
+        check_with_user()
+    # we are finished let's move on to the next phase
+    phase_idx += 1
+	    
+    if not ready_to_roll and not phase_completed[phase_idx]:
+        print '\nThis is what has to be done next:\n'
+        print phase_description(phase_idx,pp)
+        check_with_user()   
+        ready_to_roll = True
+    print phase_description(phase_idx,pp)
+    if ready_to_roll:
+        # let's start with a little housekeeping to clean after the ndown.exe
+        os.chdir(run_dir)
+        print '\tMoved to ' + run_dir + '.'
+
+        print '\tMoving ndown log files out of the way:'
+        os.mkdir(os.path.join(run_dir,'ndown_logs'))
+        for file in os.listdir(os.getcwd()):
+            if 'rsl' in file \
+              or 'std' in file:
+                os.rename(file,os.path.join(run_dir,'ndown_logs',file))
+        print '\t\tDone!'
+
+        #let's prepare for wrf
+        print '\tRename wrfinput_d02 and wrfbdy_02 to wrfinput_d01 and wrfbdy_d01:'
+        os.rename('wrfinput_d02','wrfinput_d01')
+        os.rename('wrfbdy_d02','wrfbdy_d01')
+        print '\t\tDone!'
+
+        print '\tGenerating the namelist.input.d' + str(pp).zfill(2) + '.wrf:'
+        current_namelist_input = \
+          pdu.generate_namelist_input_dpp_wrf(pp,namelist_input_master,run_dir)
+        print '\t\tDone!'
+
+        print '\tLinking the just generated namelist.input:'
+        os.remove(os.path.join(run_dir,'namelist.input'))
+        os.symlink(current_namelist_input,os.path.join(run_dir,'namelist.input'))
+        print '\t\tDone!'
+
+        print '\tRemove the links to  wrfout_d' + str(pp-1).zfill(2) + '*'
+        for file in os.listdir(run_dir):
+            #if 'wrfout_d' + str(pp-1).zfill(2) in file:
+            if 'wrfout_d01' in file:
+                os.remove(file)
+        print '\t\tDone!' 
+
+        phase_completed[phase_idx] = True
+        print this_is_what_you_should_do_next(phase_idx)
+        check_with_user()
+    # we are finished let's move on to the next phase
+    phase_idx += 1
+	    
+    if not ready_to_roll and not phase_completed[phase_idx]:
+        print '\nThis is what has to be done next:\n'
+        print phase_description(phase_idx,pp)
+        check_with_user()   
+        ready_to_roll = True
+    print phase_description(phase_idx,pp)
+    if ready_to_roll:
+        # let's start with a little housekeeping to clean after the wrf.exe
+        os.chdir(run_dir)
+        print '\tMoved to ' + run_dir + '.'
+        print '\tMoving wrf log files out of the way:'
+        os.mkdir(os.path.join(run_dir,'wrf_logs'))
+        for file in os.listdir(os.getcwd()):
+            if 'rsl' in file \
+              or 'std' in file:
+                os.rename(file,os.path.join(run_dir,'wrf_logs',file))
+        print '\t\tDone!'
+
+        # then move on to generating and archiving the metadata and wrfout_d01*
+        print '\tZipping metadata archive:'
+        wrf_metadata = 'wrf_metadata_d' + str(pp).zfill(2) + '.zip'
+        cmd = r'zip -r ' + wrf_metadata + ' wrfndi_d02 ../compile.log ' \
+          + '../configure.wrf wrfinput_d01 wrfbdy_d01 submit_wrf.sh ' \
+          + 'submit_real.sh submit_ndown.sh namelist.input ' \
+          + 'wrf_logs real_logs ndown_logs'
+        # The following is to ignore both stdout and stderr from the zip command
+        # TODO check if the following syntax represents a portability issue
+        if sp.call(cmd.split(), stdout=open('/dev/null','w'), stderr = sp.STDOUT) == 0:
+            print '\t\tDone!'
+    
+        # TODO check that the appropriate directory structure exist for the archive
+        # and create it if it doesn't    
+        # TODO none of the possible exceptions are caught... beware!
+        print '\tArchiving metadata:'
+        os.rename(wrf_metadata,os.path.join(archive_dir,wrf_metadata))
+        print '\t\tDone!'
+    
+        print '\tMoving wrfout_d01* files to the archive directory:'
+        for file in os.listdir(os.getcwd()):
+            if 'wrfout' in file:
+                os.rename(file,os.path.join(archive_dir,file[:8] \
+                  + str(pp).zfill(2) + file[10:]))
+        print '\t\tDone!'
+        
+        # let's now clean the wrf_dir
+        print '\tCleaning the wrf directory:'
+        for file_or_dir in os.listdir(os.getcwd()):
+            if 'met_em.' in file_or_dir \
+              or 'wrfinput' in file_or_dir \
+              or 'wrfndi' in file_or_dir \
+              or 'wrfbdy' in file_or_dir:
+                os.remove(file_or_dir)
+            if os.path.isfile(os.path.join(run_dir,'namelist.input')):
+                os.remove(os.path.join(run_dir,'namelist.input'))
+            # only my logs directories will match 'logs'
+            # TODO make this more general/robust or warn the user they should not
+            # have anything that matches this check in their run_dir
+            if 'logs' in file_or_dir:
+                for nested_file in os.listdir(file_or_dir):
+                    os.remove(os.path.join(file_or_dir,nested_file))
+                os.rmdir(file_or_dir)
+        print '\t\tDone!'
+    
+        phase_completed[phase_idx] = True
+        print this_is_what_you_should_do_next(phase_idx)
+        check_with_user()
+    # we are finished let's move on to the next phase
+    phase_idx += 1
+
+# the presence of a pydown.status file will be assumed to mean that we want to
+# continue a partially executed run. We are now finished so we need to clean up
+# the directory not to confuse the program next time it is run.
+# TODO check that this exists before erasing it
+os.remove(pydown_status)
+print 'No more nests to run... good night and good luck.'
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/pydown/utils.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/pydown/utils.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/pydown/utils.py	(revision 207)
@@ -0,0 +1,247 @@
+import sys
+import os
+from socket import gethostname
+
+# VB the following is both host and user specific hence
+hostname = gethostname()
+user = os.getlogin()
+if hostname == 'hn3.its.monash.edu.au':
+    if user == 'vbisign':
+        sys.path.append('/nfs/1/home/vbisign/wrf/pywrf')   
+        import wrf.utils as wu
+    elif user == 'tchubb':
+        print 'Hey Thom where do you keep pywrf on this computer?'
+        sys.exit()
+        sys.path.append('/somewhere/pylib')
+        import pywrf.wrf.utils as wu
+elif hostname == 'linux450':
+    # VB Sorry Thom if this is not correct ;)
+    print 'Hey Thom where do you keep pywrf on this computer?'
+    sys.exit()
+    sys.path.append('/somewhere/pylib')
+    import pywrf.wrf.utils as wu
+elif hostname == 'val.maths.monash.edu.au' \
+  or hostname == 'valerio-bisignanesis-computer.local':
+    sys.path.append('/Users/val/Desktop/workspace/pywrf')
+    import wrf.utils as wu
+else:
+    print 'Warning: since I do not know this user/'\
+      + 'hostname combination, I am not sure of ' \
+      + ' where to find pywrf.wrf.util, I will try\n' \
+      + ' import pywrf.wrf.utils as wu'
+    import pywrf.wrf.utils as wu
+
+
+
+def generate_namelist_input_d01_real(namelist_input_master,run_dir='.'):
+    """Generate a namelist file for real.exe for the outermost domain
+    
+    The namelist file for real.exe for the outermost domain differs from the 
+    'master' namelist file by the entry in max_dom (max_dom=1)
+    """
+    namelist_dict=wu.read_namelist(namelist_input_master)
+    namelist_dict['&domains']['max_dom'][0]=1
+    output_file = os.path.join(run_dir,'namelist.input.d01.real')
+    wu.write_namelist(namelist_dict,output_file)
+    return output_file
+
+def generate_namelist_input_d01_wrf(namelist_input_master,run_dir='.'):
+    """Generate a namelist file for wrf.exe for the outermost domain
+    
+    The namelist file for wrf.exe for the outermost domain differs from the 
+    'master' namelist file by the entry in max_dom (max_dom=1)
+    """
+    namelist_dict=wu.read_namelist(namelist_input_master)
+    namelist_dict['&domains']['max_dom'][0]=1
+    output_file = os.path.join(run_dir,'namelist.input.d01.wrf')
+    wu.write_namelist(namelist_dict,output_file)
+    return output_file
+
+def generate_namelist_input_dpp_real(pp,namelist_input_master,run_dir='.'):
+    """Generate a namelist for real.exe for the pp'th domain
+    
+    This namelist will contain only one column, with max_dom = 1 and 
+    interval_seconds = grib interval
+    """
+
+    namelist_dict=wu.read_namelist(namelist_input_master)
+    idx_discard=range(int(namelist_dict['&domains']['max_dom'][0]))
+    
+    # We'll be using this list as the list of entries to 'pop' from each variable 
+    # in the namelist, so we need ot reverse siht list to preserve only the 'pp'th
+    # datum
+    idx_discard.pop(idx_discard.index(pp-1))
+    idx_discard.reverse()
+
+    for group in namelist_dict.keys():
+	for variable in namelist_dict[group].keys():
+	    dummy=namelist_dict[group][variable]
+	    if len(dummy)==1:
+		pass
+	    else:
+		for idx in idx_discard:
+		    dummy.pop(idx)
+
+
+    # &domains
+    namelist_dict['&domains']['max_dom'][0]=1
+    # grid id
+    namelist_dict['&domains']['grid_id'][0]=1
+    namelist_dict['&domains']['parent_id'][0]=0
+    namelist_dict['&domains']['parent_grid_ratio'][0]=1
+    # j_parent_start of parent is 1
+    namelist_dict['&domains']['j_parent_start'][0]=0
+    # same for i_parent_start
+    namelist_dict['&domains']['i_parent_start'][0]=0
+
+    # &time_control
+    namelist_dict['&time_control']['input_from_file'][0]='.true.'
+
+    # &bdy_control
+    # parent grid is not nested as far as WRF is concerned...
+    namelist_dict['&bdy_control']['nested'][0]='.false.'
+    # parent grid will have specified boundary conditions
+    namelist_dict['&bdy_control']['specified'][0]='.true.'
+
+   # TODO
+    # Shorten the time extent to save on CPU resources (ref. step 15 in dia)
+    # Include explicit definition of eta_levels
+
+    output_file = os.path.join(run_dir,'namelist.input.d'+str(pp).zfill(2)+'.real')
+    wu.write_namelist(namelist_dict,output_file)
+    return output_file
+    
+
+def generate_namelist_input_dpp_ndown(pp,namelist_input_master,run_dir='.'):
+    """Generate a namelist for ndown.exe for the pp'th domain
+    
+    This namelist will contain only one column, with max_dom = 1 and 
+    interval_seconds = grib interval
+    """
+
+    namelist_dict=wu.read_namelist(namelist_input_master)
+    
+    # Correcting to give BC's at time of history_interval for parent grid. 
+    # history_interval given in minutes, interval_seconds, in seconds (duh??)
+    dom_idx = pp-1 
+    history_interval = namelist_dict['&time_control']['history_interval'][dom_idx-1]
+    interval_seconds = history_interval*60
+    namelist_dict['&time_control']['interval_seconds'][0]=interval_seconds
+    
+    idx_discard=range(int(namelist_dict['&domains']['max_dom'][0]))
+    
+    # We'll be using this list as the list of entries to 'pop' from each variable 
+    # in the namelist, so we need ot reverse siht list to preserve only the 'pp'th
+    # datum
+    idx_discard.pop(idx_discard.index(dom_idx))
+    idx_discard.pop(idx_discard.index(dom_idx-1))
+    idx_discard.reverse()
+
+    for group in namelist_dict.keys():
+	for variable in namelist_dict[group].keys():
+	    dummy=namelist_dict[group][variable]
+	    if len(dummy)==1:
+		pass
+	    else:
+		for idx in idx_discard:
+		    dummy.pop(idx)
+
+    # &domain corrections
+    namelist_dict['&domains']['max_dom'][0]=2
+    # grid id
+    namelist_dict['&domains']['grid_id']=[1,2]
+    # ndown reads 1 as parent and 2 as child hence
+    namelist_dict['&domains']['parent_id']=[0,1]
+    # parent grid ratio of 'parent' is 1:
+    namelist_dict['&domains']['parent_grid_ratio'][0]=1
+    # j_parent_start of parent is 1
+    namelist_dict['&domains']['j_parent_start'][0]=0
+    # same for i_parent_start
+    namelist_dict['&domains']['i_parent_start'][0]=0
+    # currently not changing parent_time_step_ratio, but watch this space
+
+    # &time control corrections
+    namelist_dict['&time_control']['input_from_file'][0]='.true.'
+
+    # &bdy_control
+    # parent grid is not nested as far as WRF is concerned...
+    namelist_dict['&bdy_control']['nested'][0]='.false.'
+    # parent grid will have specified boundary conditions
+    namelist_dict['&bdy_control']['specified'][0]='.true.'
+
+
+    output_file = \
+      os.path.join(run_dir,'namelist.input.d'+str(pp).zfill(2)+'.ndown')
+    wu.write_namelist(namelist_dict,output_file)
+    return output_file
+
+def generate_namelist_input_dpp_wrf(pp,namelist_input_master,run_dir='.'):
+    """Generate a namelist for wrf.exe for the pp'th domain
+    
+    This namelist will contain only one column, with max_dom = 1 and 
+    interval_seconds = grib interval
+    """
+
+    namelist_dict=wu.read_namelist(namelist_input_master)
+    idx_discard=range(int(namelist_dict['&domains']['max_dom'][0]))
+    
+    # We'll be using this list as the list of entries to 'pop' from each variable 
+    # in the namelist, so we need ot reverse siht list to preserve only the 'pp'th
+    # datum
+    idx_discard.pop(idx_discard.index(pp-1))
+    idx_discard.reverse()
+
+    # multiplicative time step ratio
+    mult_time_step_ratio=1
+    # Must incluide CURRENT parent_time_step ratio as well, i.e. up to pp rather than pp-1.
+    # time_step_ratio_1*time_step_ratio_2*...*time_step_ratio_pp
+
+    for idx in range(pp):
+	mult_time_step_ratio*=namelist_dict['&domains']['parent_time_step_ratio'][idx]
+
+    for group in namelist_dict.keys():
+	for variable in namelist_dict[group].keys():
+	    dummy=namelist_dict[group][variable]
+	    if len(dummy)==1:
+		pass
+	    else:
+		for idx in idx_discard:
+		    dummy.pop(idx)
+
+    # &domains
+    # take care of time step stuff
+    # be smart... make sure that your INITIAL time step is an integer multiple of the 
+    # product of the set of parent_time_step_ratio OR come here and modify this yourself...
+    # TODO: modify this myself to handle integer arithmetics. Need to consider 
+	# time_step_fract_num and time_step_fract_den
+	
+    namelist_dict['&domains']['parent_time_step_ratio'][0]=1
+    namelist_dict['&domains']['time_step'][0]/=mult_time_step_ratio
+    
+    namelist_dict['&domains']['max_dom'][0]=1
+    # grid id
+    namelist_dict['&domains']['grid_id'][0]=1
+    namelist_dict['&domains']['parent_id'][0]=0
+    namelist_dict['&domains']['parent_grid_ratio'][0]=1
+    # j_parent_start of parent is 1
+    namelist_dict['&domains']['j_parent_start'][0]=0
+    # same for i_parent_start
+    namelist_dict['&domains']['i_parent_start'][0]=0
+
+    # &time_control
+    namelist_dict['&time_control']['input_from_file'][0]='.true.'
+
+    # &bdy_control
+    # parent grid is not nested as far as WRF is concerned...
+    namelist_dict['&bdy_control']['nested'][0]='.false.'
+    # parent grid will have specified boundary conditions
+    namelist_dict['&bdy_control']['specified'][0]='.true.'
+
+   # TODO
+    # Shorten the time extent to save on CPU resources (ref. step 15 in dia)
+    # Include explicit definition of eta_levels
+
+    output_file = os.path.join(run_dir,'namelist.input.d'+str(pp).zfill(2)+'.wrf')
+    wu.write_namelist(namelist_dict,output_file)
+    return output_file
+
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/utils.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/utils.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/utils.py	(revision 207)
@@ -0,0 +1,686 @@
+"""
+repository of wrf utilities
+"""
+import os
+import sys
+import numpy as n
+import pylab as p
+from matplotlib.numerix import ma
+from matplotlib.toolkits.basemap import Basemap
+import pywrf.viz.utils as vu
+
+
+# the syntax to import nio depends on its version. We try all options from the
+# newest to the oldest
+try:
+    import Nio as nio
+except:
+    try:
+        import PyNGL.Nio as nio
+    except:
+        import PyNGL_numpy.Nio as nio
+
+# The following is only needed for hn3.its.monash.edu.au
+# Unfortunately we must get rid of spurious entries in the sys.path that can
+# lead to the loading of conflicting packages
+for dir_idx in range(len(sys.path)-1,-1,-1):
+    if 'python2.4' in sys.path[dir_idx]:
+        sys.path.pop(dir_idx)
+
+a_small_number = 1e-8
+
+def colons_to_underscores(test=False):
+    files = os.listdir('.')
+    print 'I plan to do the following:'
+    for file in files:
+        command = 'mv ' + file + ' ' + file[:-6] + '_00_00'
+        print command
+    print 'Happy? [y/n]'
+    answer = raw_input()
+    if answer == 'y':
+        for file in files:
+            command = 'mv ' + file + ' ' + file[:-6] + '_00_00'
+            os.system(command)
+    else:
+        print 'OK, maybe next time ;]' 
+    return
+
+def wrf_to_pressure(var, pressure, press_lvl, fill_value=1e35, positive_only=False):
+    """
+    this functions vertically interpolates to pressure levels WRF fields
+    usage 
+    >>> interpolated_var(var, pressure, press_lvl, fill_value=1e35, 
+    ...    positive_only=False)
+    where 
+        var -> field to be interpolated
+        pressure -> total pressure field (p + pb)
+        press_lvl -> list or numpy array of desired levels
+        fill_value -> this is assigned to a cell if the requested pressure level
+          lies below or above the column of values supplied for that cell in 
+          the pressure array.
+        positive_only -> set this flag to true to prevent the interpolation to 
+          generate negative values for fields for which this does not make 
+          sense.
+        interpolated_var -> the interpolated field which will have shape 
+          (len(press_lvl), var.shape[1], var.shape[2])
+    NB in this current implementation of the function arrays need to be 
+      destaggerred before they operated upon. Furthermore, it is assumed the
+      function is invoked to process one frame at at time i.e. it works on 3D
+      arrays. As usual COARDS ordering of dimensions i.e. (time,lvl,lat,lon) 
+      is assumed.
+    """
+    # these are the pressure levels we want as output
+    k_max, j_max, i_max = pressure.shape
+    output = n.zeros((len(press_lvl), j_max, i_max))
+    for lvl_idx in range(len(press_lvl)):
+        for j in range(j_max):
+            for i in range(i_max):
+                # make it ascending for searchsorted
+                pressure_column = pressure[::-1,j,i]
+                if press_lvl[lvl_idx] > pressure_column.max() \
+                  or press_lvl[lvl_idx] < pressure_column.min():
+                    output[lvl_idx,j,i] = fill_value
+                else:
+                    var_column = var[::-1,j,i]
+                    press_idx = pressure_column.searchsorted(press_lvl[lvl_idx])
+                    xa = pressure_column[press_idx]
+                    xb = pressure_column[press_idx - 1]
+                    ya = var_column[press_idx]
+                    yb = var_column[press_idx - 1]
+                    x = press_lvl[lvl_idx]
+                    y = vu.lin_interp(xa, xb, ya, yb, x)
+                    if positive_only and y < 0.:
+                        y = 0.
+                    output[lvl_idx,j,i] = y
+    return output
+
+def wrf2latlon(projection, 
+  lat_0, lon_0,
+  lat_1,
+  lat_2,
+  grid_centre_lon,
+  grid_centre_lat,
+  nx,
+  ny,
+  delta,
+  staggered = False,
+  return_extra = False
+  ):
+    from pyproj import Proj
+    proj = Proj(proj=projection, lat_0=lat_0, lon_0=lon_0, lat_1=lat_1, lat_2=lat_2)
+    grid_centre_x, grid_centre_y = proj(grid_centre_lon, grid_centre_lat)
+    grid_x_extent = nx * delta
+    grid_y_extent = ny * delta
+    min_x = grid_centre_x - grid_x_extent/2.
+    min_y = grid_centre_y - grid_y_extent/2.
+    max_x = min_x + grid_x_extent
+    max_y = min_y + grid_y_extent
+    x = n.arange(min_x, max_x + a_small_number, delta)
+    y = n.arange(min_y, max_y + a_small_number, delta)  
+    X, Y = p.meshgrid(x,y)
+    lon, lat = proj(X, Y, inverse=True)
+
+    if staggered:
+        x_u = n.arange(min_x, max_x + delta + a_small_number, delta)
+        x_u -= (delta /2.)
+        X_u, Y_u = p.meshgrid(x_u,y)
+        y_v = n.arange(min_y, max_y + delta + a_small_number, delta)  
+        y_v -= (delta /2.)
+        X_v, Y_v = p.meshgrid(x,y_v)
+        lon_u, lat_u = proj(X_u, Y_u, inverse=True)
+        lon_v, lat_v = proj(X_v, Y_v, inverse=True)
+
+    llcrnrlon, llcrnrlat = proj(min_x, min_y, inverse=True)
+    urcrnrlon, urcrnrlat = proj(max_x, max_y, inverse=True)
+    map = Basemap(
+      projection = projection,
+      lon_0 = lon_0,
+      lat_0 = lat_0,
+      lat_1 = lat_1,
+      lat_2 = lat_2,
+      llcrnrlon = llcrnrlon,
+      llcrnrlat = llcrnrlat,
+      urcrnrlon = urcrnrlon,
+      urcrnrlat = urcrnrlat
+      )
+
+    if return_extra:
+        # it seems that the basemap automatically sets the origin the native
+        # coordinate system at its llcrnr (or close to it...)
+        offset = map(lon_0, lat_0)
+        if staggered:
+            X += offset[0]
+            Y += offset[1]
+            X_u += offset[0]
+            Y_u += offset[1]
+            X_v += offset[0]
+            Y_v += offset[1]
+            return lon, lat, lon_u, lat_u, lon_v, lat_v, \
+              X, Y, X_u, Y_u, X_v, Y_v, map
+        else:
+            X += offset[0]
+            Y += offset[1]
+            return lon, lat, X, Y, map
+    else: 
+        if staggered:
+            return lon, lat, lon_u, lat_u, lon_v, lat_v
+        else:
+            return lon, lat
+  
+def wrf_grid(
+  # WPS -> map_proj
+  projection,
+  # WPS -> truelat1
+  lat_1,
+  # WPS -> truelat2
+  lat_2,
+  # WPS -> stand_lon
+  lon_0,
+  # WPS -> ref_lat
+  grid_centre_lat,
+  # WPS -> ref_lon
+  grid_centre_lon,
+  delta_x,
+  delta_y,
+  # WPS -> e_we
+  nx,
+  # WPS -> e_sn
+  ny,
+  show_mass_grid = False,
+  show_stag_grids = False,
+  ):
+    if lon_0 != grid_centre_lon:
+        print 'not implemented yet -> see the source'
+        print "\tbut let's try it anyways..."
+        #return
+
+    width   = nx * delta_x
+    height  = ny * delta_y
+    frame_x = 10 * delta_x
+    frame_y = 10 * delta_y
+    m = Basemap(
+      lat_0 = grid_centre_lat,
+      # this could be a bad assumption... because lon_0 and grid_centre_lon
+      # need not be aligned, but at the same time I need to give this to
+      # basemap for the grid to be centred... I could probably fix it
+      # assigning lon_0 and then imposing a grid shift in native coordinates
+      # if ref_lon and lon_0 were not the same
+      lon_0 = lon_0,
+      lat_1 = lat_1,
+      lat_2 = lat_2,
+      width = width + 2*frame_x,
+      height = height + 2*frame_y,
+      resolution = 'l',
+      area_thresh=1000.
+      )
+    grid_centre_x, grid_centre_y = m(grid_centre_lon, grid_centre_lat)
+    min_x = grid_centre_x - width/2.
+    min_y = grid_centre_y - height/2.
+    max_x = min_x + width
+    max_y = min_y + height
+    x = n.arange(min_x, max_x + a_small_number, delta_x)
+    y = n.arange(min_y, max_y + a_small_number, delta_y)  
+    x = x[1:-1]
+    y = y[1:-1]
+    x_u = n.arange(min_x, max_x + delta_x + a_small_number, delta_x)
+    x_u -= delta_x/2.
+    x_u = x_u[1:-1]
+    y_v = n.arange(min_y, max_y + delta_y + a_small_number, delta_y)
+    y_v -= delta_y/2.
+    y_v = y_v[1:-1]
+    X, Y = p.meshgrid(x,y)
+    lon, lat = m(X, Y, inverse=True)
+    X_u, Y_u = p.meshgrid(x_u,y)
+    lon_u, lat_u = m(X_u, Y_u, inverse=True)
+    X_v, Y_v = p.meshgrid(x,y_v)
+    lon_v, lat_v = m(X_v, Y_v, inverse=True)
+    if show_mass_grid:
+        m.plot(X, Y, 'b+')
+        m.plot([grid_centre_x], [grid_centre_y], 'r+')
+        if show_stag_grids:
+            m.plot(X_u, Y_u, 'g+')
+            m.plot(X_v, Y_v, 'r+')
+        m.drawcoastlines()
+	p.show()
+    output = {
+      'map' : m,
+      'mass_stag': {
+        'lon_2d' : lon,
+        'lat_2d' : lat,
+        'x'      : x,
+        'y'      : y,
+        'x_2d'   : X,
+        'y_2d'   : Y,
+        }, 
+      'u_stag': {
+        'lon_2d' : lon_u,
+        'lat_2d' : lat_u,
+        'x'      : x_u,
+        'y'      : y,
+        'x_2d'   : X_u,
+        'y_2d'   : Y_u,
+        }, 
+      'v_stag': {
+        'lon_2d' : lon_v,
+        'lat_2d' : lat_v,
+        'x'      : x,
+        'y'      : y_v,
+        'x_2d'   : X_v,
+        'y_2d'   : Y_v,
+        } 
+      }
+
+    return output
+      
+
+def find_parent_ij(outer_grid, inner_grid):
+    projection = outer_grid[0]
+    lat_0 = outer_grid[1]
+    lon_0 = outer_grid[2]
+    lat_1 = outer_grid[3]
+    lat_2 = outer_grid[4]
+    grid_centre_lon = outer_grid[5]
+    grid_centre_lat = outer_grid[6]
+    nx = outer_grid[7]
+    ny = outer_grid[8]
+    delta = outer_grid[9]
+
+    from pyproj import Proj
+    proj = Proj(proj=projection, lat_0=lat_0, lon_0=lon_0, lat_1=lat_1, lat_2=lat_2)
+    grid_centre_x, grid_centre_y = proj(grid_centre_lon, grid_centre_lat)
+    grid_x_extent = nx * delta
+    grid_y_extent = ny * delta
+    min_x = grid_centre_x - grid_x_extent/2.
+    min_y = grid_centre_y - grid_y_extent/2.
+    max_x = min_x + grid_x_extent
+    max_y = min_y + grid_y_extent
+    outer_x = n.arange(min_x, max_x + a_small_number, delta)
+    outer_y = n.arange(min_y, max_y + a_small_number, delta)  
+
+    projection = inner_grid[0]
+    lat_0 = inner_grid[1]
+    lon_0 = inner_grid[2]
+    lat_1 = inner_grid[3]
+    lat_2 = inner_grid[4]
+    grid_centre_lon = inner_grid[5]
+    grid_centre_lat = inner_grid[6]
+    nx = inner_grid[7]
+    ny = inner_grid[8]
+    delta = inner_grid[9]
+ 
+    grid_centre_x, grid_centre_y = proj(grid_centre_lon, grid_centre_lat)
+    grid_x_extent = nx * delta
+    grid_y_extent = ny * delta
+    min_x = grid_centre_x - grid_x_extent/2.
+    min_y = grid_centre_y - grid_y_extent/2.
+    max_x = min_x + grid_x_extent
+    max_y = min_y + grid_y_extent
+    inner_x = n.arange(min_x, max_x + a_small_number, delta)
+    inner_y = n.arange(min_y, max_y + a_small_number, delta)
+
+    return outer_x.searchsorted(inner_x[0]), outer_y.searchsorted(inner_y[0])
+
+def write_namelist(namelist_dict,outfile='outfile'):
+
+    out_string=''
+    for group in namelist_dict.keys():
+	out_string += group + '\n'
+	for variable in namelist_dict[group].keys():
+	    out_string += variable + ' = ' 
+	    for element in namelist_dict[group][variable]:
+		out_string += repr(element).strip("'")+', '
+	    out_string+='\n'
+	out_string+= '/\n\n'
+
+    fid=open(outfile,'w')
+    fid.write(out_string)
+
+    return None
+
+
+
+def read_namelist(namelist_file):
+    """read contents of namelist file and return dictionary containing all options
+    
+    Created 20/01/08 by Thom Chubb.
+    Modified 20/01/08 by Thom Chubb and Valerio Bisignesi
+
+    TODO: mod_levs have a slightly different format in the namelist file, but as 
+    they come last in namelist.wps I have conveniently dropped them (with a warning
+    of course =) ). Whoever needs them first can come up with a fix for this.
+    Untested as yet with the namelist.input file. It should work fine and may be useful 
+    as a consistency check between the two files. This has been buggine me for a while.
+    """
+
+    fid=open(namelist_file)
+
+    out_dict={}
+    data = fid.readlines()
+    num_lines = len(data)
+
+    for line in data:
+	if '&' in line:
+	    # Then this line is a namelist title
+	    is_comment=False
+	    current_label = line.rstrip('\n').lstrip(' ')
+	    out_dict[current_label] ={}
+	elif '/' in line:
+	    # Then lines following this are comments until the next '&'
+	    is_comment=True
+	elif '=' in line:
+	    # Then this line contains variable information to be stored
+	    if not is_comment:
+		variable,values = line.split('=')
+		values = values.rstrip('\n').rstrip(',')
+		try:
+		    values=[int(element) for element in values.split(',')]
+		except ValueError:
+		    try:
+			values=[float(element) for element in values.split(',')]
+		    except ValueError:
+			values=[value.strip() for value in values.split(',')]
+
+		out_dict[current_label][variable.strip()]=values
+
+    return out_dict
+
+def check_namelist_consistency():
+    # TODO
+	# run time vs. run date 
+	# strict consistency between dates in namelist.wps and namelist.input not 
+	# necessary as long as dates in namelist.input are a subset of those in namelist.wps
+	# and the interval_seconds is correct
+    pass
+
+#def read_namelist_old(namelist_file):
+#    """read contents of namelist file and return dictionary containing all options
+#    
+#    Created 20/01/08 by Thom Chubb.
+#
+#    TODO: mod_levs have a slightly different format in the namelist file, but as 
+#    they come last in namelist.wps I have conveniently dropped them (with a warning
+#    of course =) ). Whoever needs them first can come up with a fix for this.
+#    Untested as yet with the namelist.input file. It should work fine and may be useful 
+#    as a consistency check between the two files. This has been buggine me for a while.
+#    """
+#
+#    fid=open(namelist_file)
+#
+#    out_dict={}
+#    data = fid.readlines()
+#    num_lines = len(data)
+#
+#    # for k in range(0,num_lines):
+#    for line in data:
+#	# str = data[k].rstrip('\n').rstrip(',').split()
+#	str = line.rstrip('\n').rstrip(',').split()
+#
+#	if str == []:
+#	    pass
+#	elif str[0] == '':  
+#	    pass
+#	elif str[0][0] == '':
+#	    pass
+#	elif str[0][0] == '/' :
+#	    is_comment=True
+#	elif str[0][0] == '&':
+#	    # Then this line is a namelist title
+#	    is_comment=False
+#	    label = str[0]
+#
+#	    if label == '&mod_levs':
+#		print ">> WARNING: mod levels don't work yet"
+#		break
+#
+#	    out_dict[label] ={}
+#
+#	else: 
+#	    if not is_comment:
+#		field = str[0]
+#		out_dict[label][field] = [] 
+#
+#
+#		for k in range(2,str.__len__()):
+#		    dat = str[k].rstrip(',')
+#		    # dat = str[k].split(',')
+#		    print str, dat
+#		    try:
+#			dat=float(dat)
+#		    except ValueError:
+#			pass
+#		    except TypeError:
+#			pass
+#
+#		    out_dict[label][field].extend(dat) 
+#	    
+#	    # out_dict[label][field] = [] 
+#	    # out_dict[label][field].append(str[2:])
+#
+#    return out_dict
+
+
+def wrf_grid_wrapper(namelist_file='namelist.wps',nest_level=0):
+    """
+    wrf_grid_wrapper(namelist_file='namelist.wps',nest_level=0):
+    Basic wrapper to easily visualise grids specified in namelist.wps
+    
+    Uses wrf.utils.read_namelist() to determine the read the appropriate variables 
+    in a specified namelist file and then calls wrf.utils.wrf_grid() to define 
+    the Basemap projection and show the grid over a map.
+
+    Created 20/01/08 by Thom Chubb.
+    Modified 27/01/08 - implemented viz.utils.plot_grid() to handle plotting and 
+    capability for viewing as many grids as desired.
+
+    TODO: Could use some more error checking, i think it will all fail if nest_levels
+    are not consecutive!! Interpolation implemented is awkward but seems to work.
+	
+	""" 
+
+    # Create namelist dictionary
+    nd = read_namelist(namelist_file)
+
+    # Field editing to make python happy
+    if nd['&geogrid']['map_proj'][0]=="'lambert'":
+	print 'debug: modify input field lambert -> lcc' 
+	nd['&geogrid']['map_proj'][0]='lcc'
+    
+    grid = []
+
+    outer_grid = wrf2latlon(nd['&geogrid']['map_proj'][0],
+		    nd['&geogrid']['ref_lat'][0],
+		    nd['&geogrid']['ref_lon'][0],
+		    nd['&geogrid']['truelat1'][0], 
+		    nd['&geogrid']['truelat2'][0],
+		    nd['&geogrid']['ref_lon'][0],
+		    nd['&geogrid']['ref_lat'][0],
+#		    nd['&geogrid']['e_we'][nest_level[0]],
+#		    nd['&geogrid']['e_sn'][nest_level[0]],
+		    nd['&geogrid']['e_we'][0],
+		    nd['&geogrid']['e_sn'][0],
+		    nd['&geogrid']['dx'][0],
+		    staggered = False,
+		    return_extra = True
+		    )
+    # print "outer_grid.shape =", outer_grid[0].shape
+
+    grid.append(outer_grid)
+    nest_level.sort()
+    # nest_level=p.sort(nest_level)
+
+    # for k in nest_level[1:]:
+    for k in range(1,max(nest_level)+1):
+	this_grid = []
+	try:
+	    e_we = nd['&geogrid']['e_we'][k]
+	except IndexError:
+	    print "Out of range. Not enough grids specified within namelist file"
+	    return 1
+	e_sn = nd['&geogrid']['e_sn'][k]
+	pgr  = nd['&geogrid']['parent_grid_ratio'][k]
+	ips  = nd['&geogrid']['i_parent_start'][k]
+	jps  = nd['&geogrid']['j_parent_start'][k]
+	print 'processing grid: ',k
+	# print e_we,e_sn,pgr,ips,jps
+	# print ips,':',(ips+(e_we/pgr)),',', jps,':',(jps+(e_sn/pgr))
+	
+	# Interpolate in grid space to estimate inner gridpoints - 
+	# care to find a more elegant approach???
+	x1=grid[-1][2][jps, ips:ips+e_we/pgr]
+	y1=grid[-1][3][jps:jps+e_sn/pgr, ips]
+	
+	a1=n.arange(0,x1.__len__(),1) 
+	a2=n.arange(0,x1.__len__(),1./pgr)
+	b1=n.arange(0,y1.__len__(),1)
+	b2=n.arange(0,y1.__len__(),1./pgr)
+
+	x2=n.interp(a2,a1,x1)
+	y2=n.interp(b2,b1,y1)
+
+	[X,Y]=n.meshgrid(x2,y2)
+
+	# convert back to navigational coordinates
+	lon,lat=grid[-1][4](X,Y,nd['&geogrid']['map_proj'])
+
+	for j in [lon,lat,X,Y,grid[-1][4]]:
+	    this_grid.append(j)
+	if (k in nest_level):	
+	    map=vu.plot_grid(this_grid[0],this_grid[1],skip=10,same_figure=True,return_map=True) 
+	grid.append(this_grid)	
+	# print grid[-1][0].shape 
+
+
+    if 0 in nest_level:
+	map=vu.plot_grid(outer_grid[0],outer_grid[1],skip=10,same_figure=True,return_map=True) 
+    map.drawmeridians(n.arange(130,180,15),labels=[1,0,0,1])
+    map.drawparallels(n.arange(0,-90,-15),labels=[1,0,0,1])
+    map.drawcoastlines()
+    map.drawrivers()
+    plot_custom_points(map)
+    p.show()
+    
+    return grid, map
+
+def calculate_mslp(p,pb,ph,phb,t,qvapor):
+    '''
+    calculate sea level pressure starting from 'raw' wrf output fields
+    usage:
+    >>> calculate_mslp(p,pb,ph,phb,t,qvapor)
+    where the arguments names correspond to the variable names in the 
+    wrfout files e.g. p(lvl,lat,lon) or p(time,lvl,lat,lon)
+    '''
+    import  from_wrf_to_grads as fw2g
+    cs = fw2g.from_wrf_to_grads.compute_seaprs
+
+    if len(p.shape) == 3:
+       # recover the full pressure field by adding perturbation and base
+       p = p + pb
+       p_t = p.transpose()
+       # same geopotential height
+       ph = (ph + phb) / 9.81
+       ph_t = ph.transpose()
+       qvapor_t = qvapor.transpose()
+       # do not add the wrf specified 300 factor as the wrapped fortran code
+       # does that for us
+       t_t = t.transpose()
+       nz = ph_t.shape[2]
+       # populate the geopotential_height at mid_levels array with
+       # averages between layers below and above
+       z = (ph_t[:,:,:nz-1] + ph_t[:,:,1:nz]) / 2.0
+       # finally "in one fell sweep"
+       # the zero is for debug purposes
+       return cs(z,t_t,p_t,qvapor_t,0).transpose()
+    elif len(p.shape) == 4:
+       mslp_shape = (p.shape[0], p.shape[2], p.shape[3])
+       mslp = n.zeros(mslp_shape)
+       for time_idx in range(p.shape[0]):
+           # recover the full pressure field by adding perturbation and base
+           dummy_p = p[time_idx] + pb[time_idx]
+           dummy_p_t = dummy_p.transpose()
+           # same geopotential height
+           dummy_ph = (ph[time_idx] + phb[time_idx]) / 9.81
+           dummy_ph_t = dummy_ph.transpose()
+           dummy_qvapor_t = qvapor[time_idx].transpose()
+           # do not add the wrf specified 300 factor as the wrapped fortran code
+           # does that for us
+           dummy_t_t = t[time_idx].transpose()
+           nz = dummy_ph_t.shape[2]
+           # populate the geopotential_height at mid_levels array with
+           # averages between layers below and above
+           z = (dummy_ph_t[:,:,:nz-1] + dummy_ph_t[:,:,1:nz]) / 2.0
+           # finally "in one fell sweep"
+           # the zero is for debug purposes
+           mslp[time_idx] = cs(z,dummy_t_t,dummy_p_t,dummy_qvapor_t,0).transpose()
+       return mslp
+    else:
+       print 'Wrong shape of the array'
+       return
+
+def calculate_mslp_wrapper(vars_dict, time_idx):
+    """Utility function to 
+    pull out the necessary variables from the wrfout file and call
+    calculate_mslp to generate the mslp field.
+    """
+    # accessing the times in the nc_file one at a time and
+    # using the .copy() method reduce the memory footprint
+    perturbation_pressure = vars_dict['P'].get_value()[time_idx].copy()
+    base_pressure = vars_dict['PB'].get_value()[time_idx].copy()
+    perturbation_geopotential = vars_dict['PH'].get_value()[time_idx].copy()
+    base_geopotential = vars_dict['PHB'].get_value()[time_idx].copy()
+    temperature = vars_dict['T'].get_value()[time_idx].copy()
+    mixing_ratio = vars_dict['QVAPOR'].get_value()[time_idx].copy()
+    mslp = calculate_mslp(
+      perturbation_pressure, 
+      base_pressure,
+      perturbation_geopotential,
+      base_geopotential,
+      temperature,
+      mixing_ratio)
+    #del perturbation_pressure, base_pressure
+    #del perturbation_geopotential, base_geopotential
+    #del temperature, mixing_ratio
+    return mslp
+
+def plot_custom_points(map):
+    """back by popular demand"""
+
+#    canberra_lon = [149 + 8./60]
+#    canberra_lat = [-35 - 17./60]
+#    map.plot(canberra_lon,canberra_lat, 'gs')
+
+    blue_calf_lon = [148.3944] 
+    blue_calf_lat = [-36.3869]  
+    map.plot(blue_calf_lon,blue_calf_lat, 'gs')
+    return
+
+def time_string_to_datetime(times):
+    '''
+    This function takes as input a numpy array of numpy string-arrays and
+    returns a list of corresponding datetime objects.
+    The array will be typically generated by a pynio get_value() call for 
+    the 'Times' variable of a wrfout file.
+    
+    Usage:
+    >>> import wrf.utils as wu
+    >>> import viz.utils as vu
+    >>> f,fv = vu.peek('some_wrfout_file' + '.nc', return_pointers=True)
+    >>> times = fv['Times'].get_value()
+    >>> times = wu.time_string_to_datetime(times)
+    '''
+    from datetime import datetime
+    # VB we know that using pynio to access the 'Times' variable in a wrfout 
+    # files we are returned a numpy array of string arrays hence
+    result = []
+    for time in times:
+        time_string = time.tostring()
+        year = int(time_string[:4])
+        month = int(time_string[5:7])
+        day = int(time_string[8:10])
+        hour = int(time_string[11:13])
+        minute = int(time_string[14:16])
+        second = int(time_string[17:])
+        # VB We assume the time is UTC so we will not bother 
+        # specifying a time zone
+        result.append(datetime(year,month,day,hour,minute,second))
+    return result
+
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/wrf_grib_encoder.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/wrf_grib_encoder.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/pywrf.example.r39/wrf/wrf_grib_encoder.py	(revision 207)
@@ -0,0 +1,2051 @@
+"""
+This function accepts the fields needed by WRF and more specifically:
+
+based on the GFS Vtable.
+Assumptions:
+ - all the 3D fields need to be on isobaric levels when they are passed to the
+   encoding function
+ - every 3D field must be supplied with a corresponding surface field
+ - the COARDS ordering of dimensions is assumed i.e. time, level, lat, lon
+
+Usage:
+
+"""
+
+#############################################################################
+# TODO
+# - change the 'data' structure to a dictionary creating appropriate labels 
+# from the dates
+#############################################################################
+import os
+import sys
+
+# the syntax to import nio depends on its version. We try all options from the
+# newest to the oldest
+try:
+    import Nio as nio
+except:
+    try:
+        import PyNGL.Nio as nio
+    except:
+        import PyNGL_numpy.Nio as nio
+
+# The following is only needed for hn3.its.monash.edu.au
+# Unfortunately we must get rid of spurious entries in the sys.path that can
+# lead to the loading of conflicting packages
+for dir_idx in range(len(sys.path)-1,-1,-1):
+    if 'python2.4' in sys.path[dir_idx]:
+        sys.path.pop(dir_idx)
+
+import numpy as n
+import pylab as p
+from matplotlib.numerix import ma
+import grib2
+from string import zfill
+import pywrf.viz.utils as vu
+from pywrf.misc.met_utils import *
+#data_directory = '/Users/val/data/laps_nc_files/press/first_try/'
+#sfc_data_directory = '/Users/val/data/laps_surface_data/'
+#data_directory = '/mnt/mac/Users/val/data/laps_nc_files/press/first_try/'
+#sfc_data_directory = '/mnt/mac/Users/val/data/laps_surface_data/'
+#data_directory = '/media/DATA/wrf/canberra_nc_files/press/'
+#sfc_data_directory = '/media/DATA/wrf/canberra_nc_files/sfc/'
+#data_directory = '/media/DATA/wrf/canberra/press/'
+#sfc_data_directory = '/media/DATA/wrf/canberra/sfc/'
+#data_directory = '/Volumes/COMMON/wrf/canberra/press/'
+#sfc_data_directory = '/Volumes/COMMON/wrf/canberra/sfc/'
+#data_directory = '/Volumes/DATA/wrf/canberra/press/'
+#sfc_data_directory = '/Volumes/DATA/wrf/canberra/sfc/'
+#data_directory = '/Users/val/Desktop/workspace/plotting/canberra/press/'
+#sfc_data_directory = '/Users/val/Desktop/workspace/plotting/canberra/sfc/'
+#data_directory = \
+#  '/nfs/1/home/vbisign/wrf/wps_data/pygrib2_test/canberra/press/analyses/'
+#sfc_data_directory = \
+#  '/nfs/1/home/vbisign/wrf/wps_data/pygrib2_test/canberra/sfc/'
+data_directory = \
+  '/nfs/1/home/vbisign/wrf/wps_data/run_003/press/'
+sfc_data_directory = \
+#sfc_data_directory = '/Users/val/Desktop/workspace/plotting/canberra/sfc/'
+# It is assumed that most people will use a single nc file as the source
+# of their fields. Neverthless, the field nc_file_name is available for those
+# that need to use multiple data sources.
+
+# the code is split in two parts... the first part gathers all the
+# information that is specific to your data source... stuff like the location
+# of the netcdf files, the name of the variables of interest in your files,
+# and any special treatment of the fields like changing units, scaling the
+# data or anything that is needed to get the data in the form required by the
+# encoding function.
+# This translates to simply having to generate a fairly pedantic dictionary
+# that spells out what needs to be done with the fields during the grib
+# encoding
+# the second part is the encoding function itself in which it is assumed the
+# data is passed in a dictionary containing the data as numpy arrays in the 
+# right units
+
+# Unfortunately it proves hard to both generalize the data structure and
+# maintain flexibility... hence at the price of making the code longer I am
+# going to process one field at the time so that it is clear to anyone what
+# the steps that are (may be) involved are...
+# I still believe it is a good idea to collect all the information needed in
+# one big dictionary for ease of retrieval
+
+
+#############################################################################
+# Preliminaries
+# This is the data structure that I will pass to the encoder
+data = []
+
+# to generate a grib2 file using Jeffrey Whitaker's grib2 class, it is necessary
+# to provide the constructor with two pieces of information:
+# - the discipline of the data to be encoded
+# - the identification section
+# this means the class will need to be reconstructed every time the discipline
+# changes
+
+
+def missing(octects):
+    # To say that something is not available in a grib field they use a 
+    # sequence of 1s as long as the space allocated (number of octects).
+    # When this sequence is read as an integer, it corresponds to the maximum
+    # representable number given the octects*8 bits of memory, hence:
+    # PS: refer to the grib documentation to know how many octects are
+    # allocated to any particular field
+    return 2**(8*octects) - 1
+
+def prepare_sfc_data(f, fv):
+    # work out which file to pick based on the base date of the first file
+    # this is based on the (fragile) assumption that nobody changed the file
+    # names from the standard laps...
+    # this was needed for the first batch of data...
+    valid_date = fv['valid_date'].get_value()[0]
+    valid_time = fv['valid_time'].get_value()[0]
+    # the following is old stuff
+    if 0:
+        # the data in each file 'starts' at 12:00pm (UTC)
+        if valid_time < 1200:
+            valid_date -= 1
+        #sfc_file = 'laps' + str(valid_date)[4:] + '_surface.nc'
+        print sfc_data_directory + sfc_file
+    # this is new and (hopefully) better
+    if 1:
+        # there is one sfc data file for each of the analysis containing the
+        # full 73 hours of diagnostic fields
+        # in the simplified case that we do not span analysis -> we start again
+        # with a different file at every analysis:
+        base_date = fv['base_date'].get_value()
+        base_time = fv['base_time'].get_value()
+        sfc_file = 'regprog.laps_pt375.' \
+          + str(base_date)[4:] + '.' + str(base_time).zfill(4)[:2] \
+          + '.slvfld.n3.nc'
+    # if we use data from a single forecast we just name the appropriate file
+    # sfc_file = 'laps0117_surface.nc'
+    sfc_f = nio.open_file(sfc_data_directory + sfc_file)
+    sfc_fv = sfc_f.variables
+    # I need this to work out which time to pick in the file...
+    sfc_valid_time = sfc_fv['valid_time'].get_value()
+    time_idx = sfc_valid_time.tolist().index(valid_time)
+    return sfc_file, sfc_f, sfc_fv, time_idx
+
+#############################################################################
+
+#############################################################################
+# this variables remain unchanged across the different times
+# BTW these (with the exception of the significance_ref_time) should not
+# affect WRF
+
+# Id of originating centre (Common Code Table C-1) -> 1 for Melbourne
+# Id of originating centre (Common Code Table C-1) -> 7 for NCEP
+centre = 7 
+# Id of orginating sub-centre (local table) -> 0 for no subcentre
+# Id of orginating sub-centre (local table) -> 3 for NCEP Central Operations
+subcentre = 0
+# GRIB Master Tables Version Number (Code Table 1.0)
+master_table = 1
+# GRIB Local Tables Version Number (Code Table 1.1) -> 0 for not used
+# GRIB Local Tables Version Number (Code Table 1.1) -> 1 for let's see what happens
+local_table = 1
+# Significance of Reference Time (Code Table 1.2) -> 1 for start of forecast
+significance_ref_time = 1
+# Production status of data (Code Table 1.3) -> 2 for research product
+production_status = 2
+# idsect[12]=Type of processed data (Code Table 1.4) -> 1 -> forecast product
+type_processed_data = 1
+
+#############################################################################
+
+# the first dimension of data will be the times to be processed
+# you will have to modify this to suit your data
+# this could mean just having a time index to get different times from the
+# same file or just pick different files for different times.
+files = os.listdir(data_directory)
+#for file in files[:2]:
+for file in files:
+    f = nio.open_file(data_directory + file)
+    fv = f.variables
+    base_date = str(fv['base_date'].get_value())
+    year = int(base_date[0:4])
+    month = int(base_date[4:6])
+    day = int(base_date[6:8])
+    # padding needed to use a string method on an integer
+    base_time = zfill(str(fv['base_time'].get_value()),4)
+    hour = int(base_time[0:2])
+    minute =  int(base_time[2:])
+    second = 0
+    # I did not generate this in the preamble above because I needed to wait
+    # for the base date and time info from the netcdf files...
+    # NB the order of the variables in the list MATTERS!
+    idsect = [
+      centre,
+      subcentre,
+      master_table,
+      local_table,
+      significance_ref_time,
+      year,
+      month,
+      day,
+      hour,
+      minute,
+      second,
+      production_status,
+      type_processed_data
+    ]
+
+    print file
+    # gdsinfo - Sequence containing information needed for the grid definition 
+    #     section.
+    gdsinfo = n.zeros((5,), dtype=int)
+    # gdsinfo[0] = Source of grid definition (see Code Table 3.0) -> 0 -> will be
+    #     specified in octects 13-14
+    gdsinfo[0] = 0
+    # gdsinfo[1] = Number of grid points in the defined grid.
+    #     TODO make it more general
+    #lat = fv['lat'].get_value()
+    # the idx was chosen to stop the data at 55S and avoid the rubbish far south
+    lat_cheat_idx = 30
+    # 1 for the full range
+    lon_cheat_idx = 1
+    lat = fv['lat'].get_value()[lat_cheat_idx:]
+    lon = fv['lon'].get_value()[:-lon_cheat_idx]
+    gdsinfo[1] = len(lat)*len(lon)
+    # gdsinfo[2] = Number of octets needed for each additional grid points defn. 
+    #     Used to define number of points in each row for non-reg grids 
+    #     (=0 for regular grid).
+    gdsinfo[2] = 0
+    # gdsinfo[3] = Interp. of list for optional points defn (Code Table 3.11)
+    #     0 -> There is no appended list
+    gdsinfo[3] = 0
+    # gdsinfo[4] = Grid Definition Template Number (Code Table 3.1)
+    #     0 -> Latitude/Longitude (or equidistant cylindrical, or Plate Carree)
+    gdsinfo[4] = 0
+    
+    # gdtmpl - Contains the data values for the specified Grid Definition 
+    #     Template ( NN=gds[4] ). Each element of this integer array contains 
+    #     an entry (in the order specified) of Grid Definition Template 3.NN
+    gdtmpl = n.zeros((19,), dtype=n.int64)
+    # In the following we refer to the lat/lon template (grid template 3.0)
+    # Oct: 15      Shape of the Earth (See Table 3.2)
+    #     0 -> spherical with radius = 6,367,470.0 m
+    #     TODO double check the radius they used in Tan's code
+    gdtmpl[0] = 0
+    # Oct: 16      Scale Factor of radius of spherical Earth
+    #     TODO hopefully (given the last option) the next 5 are ignored...
+    #     if 1 octet is the basic unit then a value of 255 should be equivalent
+    #     to all bits set to 1 -> this could be broken if more than one octect
+    #     is assigned -> maybe I should use the maximum represantable number
+    #     tailored to the number of octects?
+    #     are there any rules that make the encoder ignore automatically certain
+    #     options e.g. the oblate spheroid one when a spherical shape is assumed
+    gdtmpl[1] = missing(1)
+    # Oct: 17-20   Scale value of radius of spherical Earth
+    # NB they (grib2 std) interprets all bits set to 1 as a missing value
+    #     hence the value is base*(word_width*words_assigned) - 1
+    #     base is 2 since we are working in binary
+    #     word_width is 8 since they use octects
+    #     words_assigned is the number of words reserved to represent the value
+    #     -1 gives us the greatest representable number since we start from 0
+    gdtmpl[2] = missing(1)
+    # Oct: 21      Scale factor of major axis of oblate spheroid Earth
+    gdtmpl[3] = missing(1)
+    # Oct: 22-25   Scaled value of major axis of oblate spheroid Earth
+    gdtmpl[4] = missing(4)
+    # Oct: 26      Scale factor of minor axis of oblate spheroid Earth
+    gdtmpl[5] = missing(1)
+    # Oct: 27-30   Scaled value of minor axis of oblate spheroid Earth
+    gdtmpl[6] = missing(4)
+    # Oct: 31-34   Number of points along a parallel     
+    gdtmpl[7] = len(lon)
+    # Oct: 35-38   Number of points along a meridian
+    gdtmpl[8] = len(lat)
+    # Oct: 39-42   Basic angle of the initial production domain (see Note 1)
+    gdtmpl[9] = missing(4)
+    # Oct: 43-46   Subdivisions of basic angle used to define extreme longitudes 
+    #             and latitudes, and direction increments (see Note 1)
+    gdtmpl[10] = missing(4)
+    # Oct: 47-50   La1 - Latitude of first grid point (see Note 1)        
+    #gdtmpl.append(in_vars['lat'].get_value()[-1]*1e6)
+    gdtmpl[11] = lat[-1]*1e6
+    #gdtmpl[11] = lat[0]*1e6
+    # Oct: 51-54   Lo1 - Longitude of first grid point (see Note 1)
+    #gdtmpl.append(in_vars['lon'].get_value()[0]*1e6)
+    gdtmpl[12] = lon[0]*1e6
+    # Oct: 55      Resolution and component flags (see Table 3.3)
+    #    This should set all the bits to 0 meaning 
+    #    bit        value   meaning
+    #    1-2        ?       Reserved
+    #    3          0       i direction increments not given
+    #    4	        0       j direction increments not given
+    #    5          0       Resolved u and v components of vector quantities 
+    #                       relative to easterly and northerly directions
+    #    6-8        0       Reserved - set to zero
+    #gdtmpl[13] = 0 
+    #gdtmpl[13] = 12 
+    gdtmpl[13] = 48 
+    # Oct: 56-59   La2 - Latitude of last grid point (see Note1)     
+    #gdtmpl.append(in_vars['lat'].get_value()[0]*1e6)
+    gdtmpl[14] = lat[0]*1e6
+    #gdtmpl[14] = lat[-1]*1e6
+    # Oct: 60-63   Lo2 - Longitude of last grid point (see Note 1)
+    #gdtmpl.append(in_vars['lon'].get_value()[-1]*1e6)
+    gdtmpl[15] = lon[-1]*1e6
+    # Oct: 64-67   i (west-east) Direction increment (see Note1)     
+    #gdtmpl[16] = missing(4)
+    gdtmpl[16] = 0.375*1e6
+    # Oct: 68-71   j (south-north) Direction increment (see Note1)
+    #gdtmpl[17] = missing(4)
+    gdtmpl[17] = 0.375*1e6
+    #gdtmpl[17] = -0.375*1e6
+    #gdtmpl[17] = 33143
+    # Oct: 72      Scanning mode (flags see Table 3.4)
+    #    TODO double check if this is legit considering the flags 
+    #    This should set all the bits to 0 meaning 
+    #    bit        value   meaning
+    #    1          0       Points in the first row or column scan in +i (+x) 
+    #                       direction
+    #    2          0       Points in the first row or column scan in -i (-x) 
+    #                       direction
+    #    3          0       Adjacent pints in i(x) direction are consecutive
+    #    4	        0       All rows scan in the same direction
+    #    5-8        0       Reserved (set to zero)
+    #    NB I suspect the 3 bit might be important for the 'majoring' of the array?
+    #           	# 2^7	2^6	2^5	2^4	2^3	2^2	2^1	2^0
+    #           	# 1	2	3	4	5	6	7	8
+    gdtmpl[18] = 0 	# 0	0	0	0	0	0	0	0
+    #gdtmpl[18] = 16 	# 0	0	0	1	0	0	0	0
+    #gdtmpl[18] = 32 	# 0	0	1	0	0	0	0	0
+    #gdtmpl[18] = 64 	# 0	1	0	0	0	0	0	0
+    #gdtmpl[18] = 128 	# 1	0	0	0	0	0	0	0
+
+    #gdtmpl[18] = 192 	# 1	1	0	0	0	0	0	0
+    #gdtmpl[18] = 160 	# 1	0	1	0	0	0	0	0
+    #gdtmpl[18] = 144 	# 1	0	0	1	0	0	0	0
+    #gdtmpl[18] = 96 	# 0	1	1	0	0	0	0	0
+    #gdtmpl[18] = 80 	# 0	1	0	1	0	0	0	0
+    #gdtmpl[18] = 48  	# 0	0	1	1	0	0	0	0
+
+    #gdtmpl[18] = 224  	# 1	1	1	0	0	0	0	0
+    #gdtmpl[18] = 208  	# 1	1	0	1	0	0	0	0
+    #gdtmpl[18] = 176  	# 1	0	1	1	0	0	0	0
+    #gdtmpl[18] = 112  	# 0	1	1	1	0	0	0	0
+
+    #gdtmpl[18] = 240  	# 1	1	1	1	0	0	0	0
+
+    data.append(
+      {
+        'idsect' : idsect,
+        'gdsinfo' : gdsinfo,
+        'gdtmpl' : gdtmpl,  
+        'discipline':
+          {
+            # the first number in the list is the code for the discipline
+            'atmos': 
+               {
+                 'code':0,
+                 'fields':{'2d':{}, '3d':{}}
+               },
+            'ocean': 
+               {
+                 'code':10,
+                 'fields':{'2d':{}, '3d':{}}
+               },
+            'land': 
+               {
+                 'code':2,
+                 'fields':{'2d':{}, '3d':{}}
+               }
+          }
+      }
+    )
+    # this is the part where we extract the data from the nc files and put
+    # into the structure we will pass later to the encoder
+    # let's start with the atmospheric products specifically the surface
+    # fields
+    # each variables comes with all the metadata necessary to do its grib
+    # encoding using the addfield method of the encoder class i.e. pdtnum,
+    # pdtmpl, drtnum, drtmpl, field
+
+    # -1 stands for the last one (time) added
+    dummy = data[-1]['discipline']['atmos']['fields']['2d']
+    
+    # Let's prepare the surface pressure data and metadata
+    # Product Definition Template Number (see Code Table 4.0)
+    #     0 -> Analysis or forecast at a horizontal level or in a 
+    #          horizontal layer at a point in time.  (see Template 4.0)
+    pdtnum = 0
+    # array of zeros (int) of size 15
+    pdtmpl = n.zeros((15,),dtype=int)
+    # Follows the definition of template 4.0 
+    # Oct 10: Parameter category (see Code table 4.1). 3 -> mass
+    pdtmpl[0] = 3
+    # Oct 11: Parameter number (see Code table 4.2). 0 -> pressure
+    pdtmpl[1] = 0
+    # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+    pdtmpl[2] = 2
+    # Oct 13: Background generating process identifier 
+    # (defined by originating centre)
+    pdtmpl[3] = missing(1)
+    # Oct 14: Analysis or forecast generating process identified 
+    # (defined by originating centre)
+    pdtmpl[4] = missing(1)
+    # Oct 15-16: Hours of observational data cutoff after reference time 
+    pdtmpl[5] = missing(2)
+    # Oct 17: Minutes of observational data cutoff after reference time 
+    pdtmpl[6] = missing(1)
+    # Oct 18: Indicator of unit of time range (see Code table 4.4)
+    # 1 -> hours
+    # NB WPS expects this to be hours!
+    pdtmpl[7] = 1
+    # Oct 19-22: Forecast time in units defined by octet 18
+    pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+    # Oct 23: Type of first fixed surface (see Code table 4.5)
+    # 1 -> ground or water surface
+    pdtmpl[9] = 1
+    # Oct 24: Scale factor of first fixed surface
+    pdtmpl[10] = 0
+    # Oct 25-28: Scaled value of first fixed surface
+    pdtmpl[11] = 0
+    # Oct 29: Type of second fixed surface (see Code table 4.5)
+    pdtmpl[12] = missing(1)
+    # Oct 30: Scale factor of second fixed surface
+    pdtmpl[13] = missing(1)
+    # Oct 31-34: Scaled value of second fixed surfaces
+    pdtmpl[14] = missing(3)
+
+    # drtnum - Data Representation Template Number (see Code Table 5.0).
+    #          0 -> grid point data - simple packing
+    drtnum = 0
+    # drtmpl - Sequence with the data values for the specified Data Representation 
+    #     Template (N=drtnum). Each element of this integer array contains an 
+    #     entry (in the order specified) of Data Representation Template 5.N Note 
+    #     that some values in this template (eg. reference values, number of 
+    #     bits, etc...) may be changed by the data packing algorithms. Use this to 
+    #     specify scaling factors and order of spatial differencing, if desired.
+    drtmpl = n.zeros((5,),dtype=int)
+    # NB to make sense of the following remember (from the wmo std):
+    # The original data value Y (in the units of code table 4.2) can be recovered 
+    # with the formula:
+    # Y * 10^D= R + (X1+X2) * 2^E
+    # For simple packing and all spectral data
+    #     E = Binary scale factor,
+    #     D = Decimal scale factor
+    #     R = Reference value of the whole field,
+    #     X1 = 0,
+    #     X2 = Scaled (encoded) value.
+    
+    # Oct: 12-15. Reference value (R) (IEEE 32-bit floating-point value)
+    drtmpl[0] = 0
+    # Oct: 16-17. Binary scale factor (E)
+    drtmpl[1] = 0
+    # Oct: 18-19. Decimal scale factor (D)
+    drtmpl[2] = 0
+    # Oct: 20. Number of bits used for each packed value for simple packing, or 
+    drtmpl[3] = 24
+    # for each group reference value for complex packing or spatial differencing
+    # Oct: 21. Type of original field values (see Code Table 5.1)
+    # 0 -> floating point
+    drtmpl[4] = 0
+
+    cheat = fv['sfc_pres'].get_value()[0,lat_cheat_idx:,:-lon_cheat_idx]
+    field = n.zeros(cheat.shape)
+    for lat_idx in range(cheat.shape[0]):
+        field[-(lat_idx+1)] = cheat[lat_idx]
+
+    if 0:
+        dummy['sfc_pres'] = {
+            'long_name' : 'surface pressure',
+            'pdtnum' : pdtnum, 
+            'pdtmpl' : pdtmpl, 
+            'drtnum' : drtnum,
+            'drtmpl' : drtmpl,
+            #'field' : fv['sfc_pres'].get_value()[0]
+            #'field' : fv['sfc_pres'].get_value()[0,lat_cheat_idx:,:-lon_cheat_idx]
+            'field' : field
+          }
+
+    # Let's prepare the mean sea level pressure data and metadata
+    # Product Definition Template Number (see Code Table 4.0)
+    #     0 -> Analysis or forecast at a horizontal level or in a 
+    #          horizontal layer at a point in time.  (see Template 4.0)
+    pdtnum = 0
+    # array of zeros (int) of size 15
+    pdtmpl = n.zeros((15,),dtype=int)
+    # Follows the definition of template 4.0 
+    # Oct 10: Parameter category (see Code table 4.1). 3 -> mass
+    pdtmpl[0] = 3
+    # Oct 11: Parameter number (see Code table 4.2). 1 -> MSLP
+    pdtmpl[1] = 1
+    # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+    pdtmpl[2] = 2
+    # Oct 13: Background generating process identifier 
+    # (defined by originating centre)
+    pdtmpl[3] = missing(1)
+    # Oct 14: Analysis or forecast generating process identified 
+    # (defined by originating centre)
+    pdtmpl[4] = missing(1)
+    # Oct 15-16: Hours of observational data cutoff after reference time 
+    pdtmpl[5] = missing(2)
+    # Oct 17: Minutes of observational data cutoff after reference time 
+    pdtmpl[6] = missing(1)
+    # Oct 18: Indicator of unit of time range (see Code table 4.4)
+    # 1 -> hours
+    # NB WPS expects this to be hours!
+    pdtmpl[7] = 1
+    # Oct 19-22: Forecast time in units defined by octet 18
+    pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+    # Oct 23: Type of first fixed surface (see Code table 4.5)
+    # 101 -> sea level
+    pdtmpl[9] = 101
+    # Oct 24: Scale factor of first fixed surface
+    pdtmpl[10] = 0
+    # Oct 25-28: Scaled value of first fixed surface
+    pdtmpl[11] = 0
+    # Oct 29: Type of second fixed surface (see Code table 4.5)
+    pdtmpl[12] = missing(1)
+    # Oct 30: Scale factor of second fixed surface
+    pdtmpl[13] = missing(1)
+    # Oct 31-34: Scaled value of second fixed surfaces
+    pdtmpl[14] = missing(3)
+ 
+    # NB I am using the same drtnum and drtmpl for all data so I want
+    # replicate it in the following fields if you need to change this on a
+    # per-variable basis this is the place to redefine it. If you choose to do
+    # so then make sure you define one for each variable that follows or be
+    # aware that the last one defined will apply to all that follows.
+
+    cheat = fv['mslp'].get_value()[0,lat_cheat_idx:,:-lon_cheat_idx]
+    # to go from mb to Pa
+    #cheat *= 100.
+    cheat = cheat * 100.
+    field = n.zeros(cheat.shape)
+    for lat_idx in range(cheat.shape[0]):
+        field[-(lat_idx+1)] = cheat[lat_idx]
+
+    dummy['mslp'] = {
+        'long_name' : 'mean sea level pressure',
+        # in my data it comes in mb and I want in  Pascals
+        'pdtnum' : pdtnum, 
+        'pdtmpl' : pdtmpl, 
+        'drtnum' : drtnum,
+        'drtmpl' : drtmpl,
+        #'field' : fv['mslp'].get_value()[0]*100.
+        #'field' : fv['mslp'].get_value()[0,lat_cheat_idx:,:-lon_cheat_idx]*100.
+        'field' : field
+      }
+
+    # Let's prepare the 2m temperature data and metadata
+    # Product Definition Template Number (see Code Table 4.0)
+    #     0 -> Analysis or forecast at a horizontal level or in a 
+    #          horizontal layer at a point in time.  (see Template 4.0)
+    pdtnum = 0
+    # array of zeros (int) of size 15
+    pdtmpl = n.zeros((15,),dtype=int)
+    # Follows the definition of template 4.0 
+    # Oct 10: Parameter category (see Code table 4.1). 0 -> temperature
+    pdtmpl[0] = 0
+    # Oct 11: Parameter number (see Code table 4.2). 0 -> temperature
+    pdtmpl[1] = 0
+    # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+    pdtmpl[2] = 2
+    # Oct 13: Background generating process identifier 
+    # (defined by originating centre)
+    pdtmpl[3] = missing(1)
+    # Oct 14: Analysis or forecast generating process identified 
+    # (defined by originating centre)
+    pdtmpl[4] = missing(1)
+    # Oct 15-16: Hours of observational data cutoff after reference time 
+    pdtmpl[5] = missing(2)
+    # Oct 17: Minutes of observational data cutoff after reference time 
+    pdtmpl[6] = missing(1)
+    # Oct 18: Indicator of unit of time range (see Code table 4.4)
+    # 1 -> hours
+    # NB WPS expects this to be hours!
+    pdtmpl[7] = 1
+    # Oct 19-22: Forecast time in units defined by octet 18
+    pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+    # Oct 23: Type of first fixed surface (see Code table 4.5)
+    # 1 -> ground or water surface
+    pdtmpl[9] = 103
+    # Oct 24: Scale factor of first fixed surface
+    pdtmpl[10] = 0
+    # Oct 25-28: Scaled value of first fixed surface
+    # -> 2m above ground
+    pdtmpl[11] = 2
+    # Oct 29: Type of second fixed surface (see Code table 4.5)
+    pdtmpl[12] = missing(1)
+    # Oct 30: Scale factor of second fixed surface
+    pdtmpl[13] = missing(1)
+    # Oct 31-34: Scaled value of second fixed surfaces
+    pdtmpl[14] = missing(3)
+ 
+    # NB I am using the same drtnum and drtmpl for all data so I want
+    # replicate it in the following fields if you need to change this on a
+    # per-variable basis this is the place to redefine it. If you choose to do
+    # so then make sure you define one for each variable that follows or be
+    # aware that the last one defined will apply to all that follows.
+
+    cheat = fv['sfc_temp'].get_value()[0,lat_cheat_idx:,:-lon_cheat_idx]
+    field = n.zeros(cheat.shape)
+    for lat_idx in range(cheat.shape[0]):
+        field[-(lat_idx+1)] = cheat[lat_idx]
+
+    dummy['sfc_temp'] = {
+        'long_name' : 'surface temperature',
+        'pdtnum' : pdtnum, 
+        'pdtmpl' : pdtmpl, 
+        'drtnum' : drtnum,
+        'drtmpl' : drtmpl,
+        #'field' : fv['sfc_temp'].get_value()[0]
+        #'field' : fv['sfc_temp'].get_value()[0,lat_cheat_idx:,:-lon_cheat_idx]
+        'field' : field
+      }
+
+    # Let's prepare the 2m temperature data and metadata
+    # Product Definition Template Number (see Code Table 4.0)
+    #     0 -> Analysis or forecast at a horizontal level or in a 
+    #          horizontal layer at a point in time.  (see Template 4.0)
+    pdtnum = 0
+    # array of zeros (int) of size 15
+    pdtmpl = n.zeros((15,),dtype=int)
+    # Follows the definition of template 4.0 
+    # Oct 10: Parameter category (see Code table 4.1). 0 -> temperature
+    pdtmpl[0] = 0
+    # Oct 11: Parameter number (see Code table 4.2). 0 -> temperature
+    pdtmpl[1] = 0
+    # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+    pdtmpl[2] = 2
+    # Oct 13: Background generating process identifier 
+    # (defined by originating centre)
+    pdtmpl[3] = missing(1)
+    # Oct 14: Analysis or forecast generating process identified 
+    # (defined by originating centre)
+    pdtmpl[4] = missing(1)
+    # Oct 15-16: Hours of observational data cutoff after reference time 
+    pdtmpl[5] = missing(2)
+    # Oct 17: Minutes of observational data cutoff after reference time 
+    pdtmpl[6] = missing(1)
+    # Oct 18: Indicator of unit of time range (see Code table 4.4)
+    # 1 -> hours
+    # NB WPS expects this to be hours!
+    pdtmpl[7] = 1
+    # Oct 19-22: Forecast time in units defined by octet 18
+    pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+    # Oct 23: Type of first fixed surface (see Code table 4.5)
+    # 1 -> surface
+    pdtmpl[9] = 1
+    # Oct 24: Scale factor of first fixed surface
+    pdtmpl[10] = 0
+    # Oct 25-28: Scaled value of first fixed surface
+    # -> 2m above ground
+    pdtmpl[11] = 0
+    # Oct 29: Type of second fixed surface (see Code table 4.5)
+    pdtmpl[12] = missing(1)
+    # Oct 30: Scale factor of second fixed surface
+    pdtmpl[13] = missing(1)
+    # Oct 31-34: Scaled value of second fixed surfaces
+    pdtmpl[14] = missing(3)
+ 
+    # NB I am using the same drtnum and drtmpl for all data so I want
+    # replicate it in the following fields if you need to change this on a
+    # per-variable basis this is the place to redefine it. If you choose to do
+    # so then make sure you define one for each variable that follows or be
+    # aware that the last one defined will apply to all that follows.
+
+    cheat = fv['skin_temp'].get_value()[0,lat_cheat_idx:,:-lon_cheat_idx]
+    field = n.zeros(cheat.shape)
+    for lat_idx in range(cheat.shape[0]):
+        field[-(lat_idx+1)] = cheat[lat_idx]
+
+    dummy['skin_temp'] = {
+        'long_name' : 'skin temperature',
+        'pdtnum' : pdtnum, 
+        'pdtmpl' : pdtmpl, 
+        'drtnum' : drtnum,
+        'drtmpl' : drtmpl,
+        #'field' : fv['skin_temp'].get_value()[0]
+        #'field' : fv['skin_temp'].get_value()[0,lat_cheat_idx:,:-lon_cheat_idx]
+        'field' : field
+      }
+
+    # the next fields will come from a different file...
+    sfc_file, sfc_f, sfc_fv, time_idx = prepare_sfc_data(f,fv)
+    # DEBUG
+    #p.figure()
+    #p.contour(dummy['skin_temp']['field'])
+    #p.figure()
+    #p.contour(sfc_fv['skin_temp'].get_value()[time_idx])
+
+    # Let's prepare the 2m RH data and metadata
+    # Product Definition Template Number (see Code Table 4.0)
+    #     0 -> Analysis or forecast at a horizontal level or in a 
+    #          horizontal layer at a point in time.  (see Template 4.0)
+    pdtnum = 0
+    # array of zeros (int) of size 15
+    pdtmpl = n.zeros((15,),dtype=int)
+    # Follows the definition of template 4.0 
+    # Oct 10: Parameter category (see Code table 4.1). 1 -> moisture
+    pdtmpl[0] = 1
+    # Oct 11: Parameter number (see Code table 4.2). 1 -> RH
+    pdtmpl[1] = 1
+    # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+    pdtmpl[2] = 2
+    # Oct 13: Background generating process identifier 
+    # (defined by originating centre)
+    pdtmpl[3] = missing(1)
+    # Oct 14: Analysis or forecast generating process identified 
+    # (defined by originating centre)
+    pdtmpl[4] = missing(1)
+    # Oct 15-16: Hours of observational data cutoff after reference time 
+    pdtmpl[5] = missing(2)
+    # Oct 17: Minutes of observational data cutoff after reference time 
+    pdtmpl[6] = missing(1)
+    # Oct 18: Indicator of unit of time range (see Code table 4.4)
+    # 1 -> hours
+    # NB WPS expects this to be hours!
+    pdtmpl[7] = 1
+    # Oct 19-22: Forecast time in units defined by octet 18
+    pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+    # Oct 23: Type of first fixed surface (see Code table 4.5)
+    # 103 -> fixed height above ground
+    pdtmpl[9] = 103
+    # Oct 24: Scale factor of first fixed surface
+    pdtmpl[10] = 0
+    # Oct 25-28: Scaled value of first fixed surface
+    # -> 2m above ground
+    pdtmpl[11] = 2
+    # Oct 29: Type of second fixed surface (see Code table 4.5)
+    pdtmpl[12] = missing(1)
+    # Oct 30: Scale factor of second fixed surface
+    pdtmpl[13] = missing(1)
+    # Oct 31-34: Scaled value of second fixed surfaces
+    pdtmpl[14] = missing(3)
+ 
+    # NB I am using the same drtnum and drtmpl for all data so I want
+    # replicate it in the following fields if you need to change this on a
+    # per-variable basis this is the place to redefine it. If you choose to do
+    # so then make sure you define one for each variable that follows or be
+    # aware that the last one defined will apply to all that follows.
+
+    # The surface files do not come with mixing ratio, but we can calculate
+    # that from the dew point temperature...
+    #dew_point = sfc_fv['scrn_dewpt'].get_value()[time_idx]
+    dew_point = sfc_fv['scrn_dewpt'].get_value()[time_idx,lat_cheat_idx:,:-lon_cheat_idx]
+    vapour_pressure = goff_gratch(dew_point)
+    #sfc_temp = sfc_fv['scrn_temp'].get_value()[time_idx]
+    sfc_temp = sfc_fv['scrn_temp'].get_value()[time_idx,lat_cheat_idx:,:-lon_cheat_idx]
+    sat_vapour_pressure = goff_gratch(sfc_temp)
+    #sat_vapour_pressure = ma.masked_where(sat_vapour_pressure == 0., 
+    #  sat_vapour_pressure)
+    sfc_rh = vapour_pressure / sat_vapour_pressure * 100
+    del sfc_temp, vapour_pressure, dew_point, sat_vapour_pressure
+
+    cheat = sfc_rh
+    field = n.zeros(cheat.shape)
+    for lat_idx in range(cheat.shape[0]):
+        field[-(lat_idx+1)] = cheat[lat_idx]
+
+    dummy['sfc_rh'] = {
+        'long_name' : '2m relative humidity',
+        'pdtnum' : pdtnum, 
+        'pdtmpl' : pdtmpl, 
+        'drtnum' : drtnum,
+        'drtmpl' : drtmpl,
+        #'field' : sfc_rh.filled(fill_value=0.)
+        #'field' : sfc_rh
+        'field' : field
+      }
+
+    # Let's prepare the zonal 10m wind data and metadata
+    # Product Definition Template Number (see Code Table 4.0)
+    #     0 -> Analysis or forecast at a horizontal level or in a 
+    #          horizontal layer at a point in time.  (see Template 4.0)
+    pdtnum = 0
+    # array of zeros (int) of size 15
+    pdtmpl = n.zeros((15,),dtype=int)
+    # Follows the definition of template 4.0 
+    # Oct 10: Parameter category (see Code table 4.1). 2 -> momentum
+    pdtmpl[0] = 2
+    # Oct 11: Parameter number (see Code table 4.2). 2 -> u-component of wind
+    pdtmpl[1] = 2
+    # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+    pdtmpl[2] = 2
+    # Oct 13: Background generating process identifier 
+    # (defined by originating centre)
+    pdtmpl[3] = missing(1)
+    # Oct 14: Analysis or forecast generating process identified 
+    # (defined by originating centre)
+    pdtmpl[4] = missing(1)
+    # Oct 15-16: Hours of observational data cutoff after reference time 
+    pdtmpl[5] = missing(2)
+    # Oct 17: Minutes of observational data cutoff after reference time 
+    pdtmpl[6] = missing(1)
+    # Oct 18: Indicator of unit of time range (see Code table 4.4)
+    # 1 -> hours
+    # NB WPS expects this to be hours!
+    pdtmpl[7] = 1
+    # Oct 19-22: Forecast time in units defined by octet 18
+    pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+    # Oct 23: Type of first fixed surface (see Code table 4.5)
+    # 103 -> fixed height above ground
+    pdtmpl[9] = 103
+    # Oct 24: Scale factor of first fixed surface
+    pdtmpl[10] = 0
+    # Oct 25-28: Scaled value of first fixed surface
+    # -> 10m above ground
+    pdtmpl[11] = 10
+    # Oct 29: Type of second fixed surface (see Code table 4.5)
+    pdtmpl[12] = missing(1)
+    # Oct 30: Scale factor of second fixed surface
+    pdtmpl[13] = missing(1)
+    # Oct 31-34: Scaled value of second fixed surfaces
+    pdtmpl[14] = missing(3)
+ 
+    # NB I am using the same drtnum and drtmpl for all data so I want
+    # replicate it in the following fields if you need to change this on a
+    # per-variable basis this is the place to redefine it. If you choose to do
+    # so then make sure you define one for each variable that follows or be
+    # aware that the last one defined will apply to all that follows.
+
+    cheat = sfc_fv['q10m_zonal_wnd'].get_value()[time_idx,lat_cheat_idx:,:-lon_cheat_idx]
+    field = n.zeros(cheat.shape)
+    for lat_idx in range(cheat.shape[0]):
+        field[-(lat_idx+1)] = cheat[lat_idx]
+
+    dummy['sfc_zonal_wnd'] = {
+        'long_name' : '10m zonal wind',
+        'pdtnum' : pdtnum, 
+        'pdtmpl' : pdtmpl, 
+        'drtnum' : drtnum,
+        'drtmpl' : drtmpl,
+        #'field' : sfc_fv['q10m_zonal_wnd'].get_value()[time_idx]
+        #'field' : sfc_fv['q10m_zonal_wnd'].get_value()[time_idx,lat_cheat_idx:,:-lon_cheat_idx]
+        'field' : field
+      }
+
+    # Let's prepare the meridional 10m wind data and metadata
+    # Product Definition Template Number (see Code Table 4.0)
+    #     0 -> Analysis or forecast at a horizontal level or in a 
+    #          horizontal layer at a point in time.  (see Template 4.0)
+    pdtnum = 0
+    # array of zeros (int) of size 15
+    pdtmpl = n.zeros((15,),dtype=int)
+    # Follows the definition of template 4.0 
+    # Oct 10: Parameter category (see Code table 4.1). 2 -> momentum
+    pdtmpl[0] = 2
+    # Oct 11: Parameter number (see Code table 4.2). 3 -> v-component of wind
+    pdtmpl[1] = 3
+    # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+    pdtmpl[2] = 2
+    # Oct 13: Background generating process identifier 
+    # (defined by originating centre)
+    pdtmpl[3] = missing(1)
+    # Oct 14: Analysis or forecast generating process identified 
+    # (defined by originating centre)
+    pdtmpl[4] = missing(1)
+    # Oct 15-16: Hours of observational data cutoff after reference time 
+    pdtmpl[5] = missing(2)
+    # Oct 17: Minutes of observational data cutoff after reference time 
+    pdtmpl[6] = missing(1)
+    # Oct 18: Indicator of unit of time range (see Code table 4.4)
+    # 1 -> hours
+    # NB WPS expects this to be hours!
+    pdtmpl[7] = 1
+    # Oct 19-22: Forecast time in units defined by octet 18
+    pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+    # Oct 23: Type of first fixed surface (see Code table 4.5)
+    # 103 -> fixed height above ground
+    pdtmpl[9] = 103
+    # Oct 24: Scale factor of first fixed surface
+    pdtmpl[10] = 0
+    # Oct 25-28: Scaled value of first fixed surface
+    # -> 10m above ground
+    pdtmpl[11] = 10
+    # Oct 29: Type of second fixed surface (see Code table 4.5)
+    pdtmpl[12] = missing(1)
+    # Oct 30: Scale factor of second fixed surface
+    pdtmpl[13] = missing(1)
+    # Oct 31-34: Scaled value of second fixed surfaces
+    pdtmpl[14] = missing(3)
+ 
+    # NB I am using the same drtnum and drtmpl for all data so I want
+    # replicate it in the following fields if you need to change this on a
+    # per-variable basis this is the place to redefine it. If you choose to do
+    # so then make sure you define one for each variable that follows or be
+    # aware that the last one defined will apply to all that follows.
+
+    cheat = sfc_fv['q10m_merid_wnd'].get_value()[time_idx,lat_cheat_idx:,:-lon_cheat_idx]
+    field = n.zeros(cheat.shape)
+    for lat_idx in range(cheat.shape[0]):
+        field[-(lat_idx+1)] = cheat[lat_idx]
+
+    dummy['sfc_merid_wnd'] = {
+        'long_name' : '10m meridional wind',
+        'pdtnum' : pdtnum, 
+        'pdtmpl' : pdtmpl, 
+        'drtnum' : drtnum,
+        'drtmpl' : drtmpl,
+        #'field' : sfc_fv['q10m_merid_wnd'].get_value()[time_idx]
+        #'field' : sfc_fv['q10m_merid_wnd'].get_value()[time_idx,lat_cheat_idx:,:-lon_cheat_idx]
+        'field' : field
+      }
+  
+    if 1:
+        # Let's prepare the topography data and metadata
+        # Product Definition Template Number (see Code Table 4.0)
+        #     0 -> Analysis or forecast at a horizontal level or in a 
+        #          horizontal layer at a point in time.  (see Template 4.0)
+        pdtnum = 0
+        # array of zeros (int) of size 15
+        pdtmpl = n.zeros((15,),dtype=int)
+        # Follows the definition of template 4.0 
+        # Oct 10: Parameter category (see Code table 4.1). 3 -> mass
+        pdtmpl[0] = 3
+        # Oct 11: Parameter number (see Code table 4.2). 5 -> geopotential height
+        pdtmpl[1] = 5
+        # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+        pdtmpl[2] = 2
+        # Oct 13: Background generating process identifier 
+        # (defined by originating centre)
+        pdtmpl[3] = missing(1)
+        # Oct 14: Analysis or forecast generating process identified 
+        # (defined by originating centre)
+        pdtmpl[4] = missing(1)
+        # Oct 15-16: Hours of observational data cutoff after reference time 
+        pdtmpl[5] = missing(2)
+        # Oct 17: Minutes of observational data cutoff after reference time 
+        pdtmpl[6] = missing(1)
+        # Oct 18: Indicator of unit of time range (see Code table 4.4)
+        # 1 -> hours
+        # NB WPS expects this to be hours!
+        pdtmpl[7] = 1
+        # Oct 19-22: Forecast time in units defined by octet 18
+        pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+        # Oct 23: Type of first fixed surface (see Code table 4.5)
+        # 1 -> surface
+        pdtmpl[9] = 1
+        # Oct 24: Scale factor of first fixed surface
+        pdtmpl[10] = 0
+        # Oct 25-28: Scaled value of first fixed surface
+        pdtmpl[11] = 0
+        # Oct 29: Type of second fixed surface (see Code table 4.5)
+        pdtmpl[12] = missing(1)
+        # Oct 30: Scale factor of second fixed surface
+        pdtmpl[13] = missing(1)
+        # Oct 31-34: Scaled value of second fixed surfaces
+        pdtmpl[14] = missing(3)
+     
+        # NB I am using the same drtnum and drtmpl for all data so I want
+        # replicate it in the following fields if you need to change this on a
+        # per-variable basis this is the place to redefine it. If you choose to do
+        # so then make sure you define one for each variable that follows or be
+        # aware that the last one defined will apply to all that follows.
+    
+        cheat = fv['topog'].get_value()[lat_cheat_idx:,:-lon_cheat_idx]
+        field = n.zeros(cheat.shape)
+        for lat_idx in range(cheat.shape[0]):
+            field[-(lat_idx+1)] = cheat[lat_idx]
+
+        dummy['topog'] = {
+            'long_name' : 'topography',
+            'pdtnum' : pdtnum, 
+            'pdtmpl' : pdtmpl, 
+            'drtnum' : drtnum,
+            'drtmpl' : drtmpl,
+            #'field' : fv['topog'].get_value()
+            #'field' : fv['topog'].get_value()[lat_cheat_idx:,:-lon_cheat_idx]
+            'field' : field
+          }
+
+    if 1:
+        # Let's prepare the water equivalent accumulated snow depth
+        # data and metadata
+        # Product Definition Template Number (see Code Table 4.0)
+        #     0 -> Analysis or forecast at a horizontal level or in a 
+        #          horizontal layer at a point in time.  (see Template 4.0)
+        pdtnum = 0
+        # array of zeros (int) of size 15
+        pdtmpl = n.zeros((15,),dtype=int)
+        # Follows the definition of template 4.0 
+        # Oct 10: Parameter category (see Code table 4.1). 1 -> moisture
+        pdtmpl[0] = 1
+        # Oct 11: Parameter number (see Code table 4.2). 13 -> 
+        #   water equivalent of accumulated snow depth
+        pdtmpl[1] = 13
+        # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+        pdtmpl[2] = 2
+        # Oct 13: Background generating process identifier 
+        # (defined by originating centre)
+        pdtmpl[3] = missing(1)
+        # Oct 14: Analysis or forecast generating process identified 
+        # (defined by originating centre)
+        pdtmpl[4] = missing(1)
+        # Oct 15-16: Hours of observational data cutoff after reference time 
+        pdtmpl[5] = missing(2)
+        # Oct 17: Minutes of observational data cutoff after reference time 
+        pdtmpl[6] = missing(1)
+        # Oct 18: Indicator of unit of time range (see Code table 4.4)
+        # 1 -> hours
+        # NB WPS expects this to be hours!
+        pdtmpl[7] = 1
+        # Oct 19-22: Forecast time in units defined by octet 18
+        pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+        # Oct 23: Type of first fixed surface (see Code table 4.5)
+        # 1 -> surface
+        pdtmpl[9] = 1
+        # Oct 24: Scale factor of first fixed surface
+        pdtmpl[10] = 0
+        # Oct 25-28: Scaled value of first fixed surface
+        pdtmpl[11] = 0
+        # Oct 29: Type of second fixed surface (see Code table 4.5)
+        pdtmpl[12] = missing(1)
+        # Oct 30: Scale factor of second fixed surface
+        pdtmpl[13] = missing(1)
+        # Oct 31-34: Scaled value of second fixed surfaces
+        pdtmpl[14] = missing(3)
+     
+        # NB I am using the same drtnum and drtmpl for all data so I want
+        # replicate it in the following fields if you need to change this on a
+        # per-variable basis this is the place to redefine it. If you choose to do
+        # so then make sure you define one for each variable that follows or be
+        # aware that the last one defined will apply to all that follows.
+    
+        #dummy_field = n.zeros((len(lon),len(lat)),dtype=float)
+        dummy_field = n.zeros((len(lat),len(lon)),dtype=float)
+        dummy['weasd'] = {
+            'long_name' : 'water equivalent of accumulated snow depth',
+            'pdtnum' : pdtnum, 
+            'pdtmpl' : pdtmpl, 
+            'drtnum' : drtnum,
+            'drtmpl' : drtmpl,
+            'field' : dummy_field
+          }
+       
+    #######################################################################
+    # Finished with the 2d fields
+    # Let's move on to the 3d ones
+    #######################################################################
+    
+    dummy = data[-1]['discipline']['atmos']['fields']['3d']
+    
+    # Let's prepare the air temperature data and metadata
+    # Product Definition Template Number (see Code Table 4.0)
+    #     0 -> Analysis or forecast at a horizontal level or in a 
+    #          horizontal layer at a point in time.  (see Template 4.0)
+    pdtnum = 0
+    # array of zeros (int) of size 15
+    pdtmpl = n.zeros((15,),dtype=int)
+    # Follows the definition of template 4.0 
+    # Oct 10: Parameter category (see Code table 4.1). 0 -> temperature
+    pdtmpl[0] = 0
+    # Oct 11: Parameter number (see Code table 4.2). 0 -> temperature
+    pdtmpl[1] = 0
+    # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+    pdtmpl[2] = 2
+    # Oct 13: Background generating process identifier 
+    # (defined by originating centre)
+    pdtmpl[3] = missing(1)
+    # Oct 14: Analysis or forecast generating process identified 
+    # (defined by originating centre)
+    pdtmpl[4] = missing(1)
+    # Oct 15-16: Hours of observational data cutoff after reference time 
+    pdtmpl[5] = missing(2)
+    # Oct 17: Minutes of observational data cutoff after reference time 
+    pdtmpl[6] = missing(1)
+    # Oct 18: Indicator of unit of time range (see Code table 4.4)
+    # 1 -> hours
+    # NB WPS expects this to be hours!
+    pdtmpl[7] = 1
+    # Oct 19-22: Forecast time in units defined by octet 18
+    pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+    # Oct 23: Type of first fixed surface (see Code table 4.5)
+    # 1 -> isobaric level
+    pdtmpl[9] = 100
+    # Oct 24: Scale factor of first fixed surface
+    pdtmpl[10] = 0
+    # Oct 25-28: Scaled value of first fixed surface
+    # -> missing as there is will be defined later when the data is sliced in
+    # horizontal slabs for its encoding
+    pdtmpl[11] = missing(3)
+    # Oct 29: Type of second fixed surface (see Code table 4.5)
+    pdtmpl[12] = missing(1)
+    # Oct 30: Scale factor of second fixed surface
+    pdtmpl[13] = missing(1)
+    # Oct 31-34: Scaled value of second fixed surfaces
+    pdtmpl[14] = missing(3)
+ 
+    # NB I am using the same drtnum and drtmpl for all data so I want
+    # replicate it in the following fields if you need to change this on a
+    # per-variable basis this is the place to redefine it. If you choose to do
+    # so then make sure you define one for each variable that follows or be
+    # aware that the last one defined will apply to all that follows.
+
+    cheat = fv['air_temp'].get_value()[0,:,lat_cheat_idx:,:-lon_cheat_idx]
+    field = n.zeros(cheat.shape)
+    for lvl_idx in range(cheat.shape[0]):
+        for lat_idx in range(cheat.shape[1]):
+            field[lvl_idx,-(lat_idx+1)] = cheat[lvl_idx,lat_idx]
+
+    dummy['air_temp'] = {
+        'long_name' : '3D air temperature',
+        'pdtnum' : pdtnum, 
+        'pdtmpl' : pdtmpl, 
+        'drtnum' : drtnum,
+        'drtmpl' : drtmpl,
+        #'field' : fv['air_temp'].get_value()[0],
+        #'field' : fv['air_temp'].get_value()[0,:,lat_cheat_idx:,:-lon_cheat_idx],
+        'field' : field,
+        #'field' : '',
+        'lvl' : fv['lvl'].get_value()
+      }
+
+    # Let's prepare the 3d relative humidity data and metadata
+    # Product Definition Template Number (see Code Table 4.0)
+    #     0 -> Analysis or forecast at a horizontal level or in a 
+    #          horizontal layer at a point in time.  (see Template 4.0)
+    pdtnum = 0
+    # array of zeros (int) of size 15
+    pdtmpl = n.zeros((15,),dtype=int)
+    # Follows the definition of template 4.0 
+    # Oct 10: Parameter category (see Code table 4.1). 1 -> moisture
+    pdtmpl[0] = 1
+    # Oct 11: Parameter number (see Code table 4.2). 1 -> RH
+    pdtmpl[1] = 1
+    # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+    pdtmpl[2] = 2
+    # Oct 13: Background generating process identifier 
+    # (defined by originating centre)
+    pdtmpl[3] = missing(1)
+    # Oct 14: Analysis or forecast generating process identified 
+    # (defined by originating centre)
+    pdtmpl[4] = missing(1)
+    # Oct 15-16: Hours of observational data cutoff after reference time 
+    pdtmpl[5] = missing(2)
+    # Oct 17: Minutes of observational data cutoff after reference time 
+    pdtmpl[6] = missing(1)
+    # Oct 18: Indicator of unit of time range (see Code table 4.4)
+    # 1 -> hours
+    # NB WPS expects this to be hours!
+    pdtmpl[7] = 1
+    # Oct 19-22: Forecast time in units defined by octet 18
+    pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+    # Oct 23: Type of first fixed surface (see Code table 4.5)
+    # 1 -> isobaric level
+    pdtmpl[9] = 100
+    # Oct 24: Scale factor of first fixed surface
+    pdtmpl[10] = 0
+    # Oct 25-28: Scaled value of first fixed surface
+    # -> missing as there is will be defined later when the data is sliced in
+    # horizontal slabs for its encoding
+    pdtmpl[11] = missing(3)
+    # Oct 29: Type of second fixed surface (see Code table 4.5)
+    pdtmpl[12] = missing(1)
+    # Oct 30: Scale factor of second fixed surface
+    pdtmpl[13] = missing(1)
+    # Oct 31-34: Scaled value of second fixed surfaces
+    pdtmpl[14] = missing(3)
+ 
+    # NB I am using the same drtnum and drtmpl for all data so I want
+    # replicate it in the following fields if you need to change this on a
+    # per-variable basis this is the place to redefine it. If you choose to do
+    # so then make sure you define one for each variable that follows or be
+    # aware that the last one defined will apply to all that follows.
+
+    #mix_rto = fv['mix_rto'].get_value()[0]
+    mix_rto = fv['mix_rto'].get_value()[0,:,lat_cheat_idx:,:-lon_cheat_idx]
+    spec_hum = n.zeros(mix_rto.shape,dtype=float)
+    spec_hum = mix_rto / (mix_rto + 1)
+    #temp = fv['air_temp'].get_value()[0]
+    temp = fv['air_temp'].get_value()[0,:,lat_cheat_idx:,:-lon_cheat_idx]
+    #print temp.min(), temp.max()
+    #print temp.min()-273.16, temp.max()-273.16
+    sat_vapour_pres = goff_gratch(temp)
+    #print sat_vapour_pres.min(), sat_vapour_pres.max()
+    pres = fv['lvl'].get_value()
+    sat_spec_hum = n.zeros(mix_rto.shape,dtype=float)
+    for lvl_idx in range(len(pres)):
+        sat_spec_hum[lvl_idx] = 0.622 * sat_vapour_pres[lvl_idx] \
+          / pres[lvl_idx]
+    #sat_spec_hum = ma.masked_where(sat_spec_hum <= 1.e-9,
+    #sat_spec_hum = ma.masked_where(sat_spec_hum <= 1.e-6,
+      #sat_spec_hum)
+    rh = n.zeros(mix_rto.shape,dtype=float)
+    rh = spec_hum / sat_spec_hum * 100
+    #sys.exit()
+    del mix_rto, spec_hum, temp, sat_vapour_pres, pres, sat_spec_hum
+    
+    #cheat = rh
+    #field = n.zeros(cheat.shape)
+    #for lat_idx in range(cheat.shape[0]):
+    #    field[-(lat_idx+1)] = cheat[lat_idx]
+
+    cheat = rh
+    field = n.zeros(cheat.shape)
+    for lvl_idx in range(cheat.shape[0]):
+        for lat_idx in range(cheat.shape[1]):
+            field[lvl_idx,-(lat_idx+1)] = cheat[lvl_idx,lat_idx]
+
+    dummy['rh'] = {
+        'long_name' : '3D relative humidity',
+        'pdtnum' : pdtnum, 
+        'pdtmpl' : pdtmpl, 
+        'drtnum' : drtnum,
+        'drtmpl' : drtmpl,
+        #'field' : rh.filled(fill_value=0.),
+        #'field' : rh,
+        'field' : field,
+        'lvl' : fv['lvl'].get_value()
+      }
+    #sys.exit()
+
+    # Let's prepare the 3d zonal wind data and metadata
+    # Product Definition Template Number (see Code Table 4.0)
+    #     0 -> Analysis or forecast at a horizontal level or in a 
+    #          horizontal layer at a point in time.  (see Template 4.0)
+    pdtnum = 0
+    # array of zeros (int) of size 15
+    pdtmpl = n.zeros((15,),dtype=int)
+    # Follows the definition of template 4.0 
+    # Oct 10: Parameter category (see Code table 4.1). 2 -> momentum
+    pdtmpl[0] = 2
+    # Oct 11: Parameter number (see Code table 4.2). 2 -> u-component of the
+    # wind
+    pdtmpl[1] = 2
+    # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+    pdtmpl[2] = 2
+    # Oct 13: Background generating process identifier 
+    # (defined by originating centre)
+    pdtmpl[3] = missing(1)
+    # Oct 14: Analysis or forecast generating process identified 
+    # (defined by originating centre)
+    pdtmpl[4] = missing(1)
+    # Oct 15-16: Hours of observational data cutoff after reference time 
+    pdtmpl[5] = missing(2)
+    # Oct 17: Minutes of observational data cutoff after reference time 
+    pdtmpl[6] = missing(1)
+    # Oct 18: Indicator of unit of time range (see Code table 4.4)
+    # 1 -> hours
+    # NB WPS expects this to be hours!
+    pdtmpl[7] = 1
+    # Oct 19-22: Forecast time in units defined by octet 18
+    pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+    # Oct 23: Type of first fixed surface (see Code table 4.5)
+    # 1 -> isobaric level
+    pdtmpl[9] = 100
+    # Oct 24: Scale factor of first fixed surface
+    pdtmpl[10] = 0
+    # Oct 25-28: Scaled value of first fixed surface
+    # -> missing as there is will be defined later when the data is sliced in
+    # horizontal slabs for its encoding
+    pdtmpl[11] = missing(3)
+    # Oct 29: Type of second fixed surface (see Code table 4.5)
+    pdtmpl[12] = missing(1)
+    # Oct 30: Scale factor of second fixed surface
+    pdtmpl[13] = missing(1)
+    # Oct 31-34: Scaled value of second fixed surfaces
+    pdtmpl[14] = missing(3)
+ 
+    # NB I am using the same drtnum and drtmpl for all data so I want
+    # replicate it in the following fields if you need to change this on a
+    # per-variable basis this is the place to redefine it. If you choose to do
+    # so then make sure you define one for each variable that follows or be
+    # aware that the last one defined will apply to all that follows.
+
+    cheat = fv['zonal_wnd'].get_value()[0,:,lat_cheat_idx:,:-lon_cheat_idx]
+    field = n.zeros(cheat.shape)
+    for lvl_idx in range(cheat.shape[0]):
+        for lat_idx in range(cheat.shape[1]):
+            field[lvl_idx,-(lat_idx+1)] = cheat[lvl_idx,lat_idx]
+
+    dummy['zonal_wnd'] = {
+        'long_name' : '3D zonal wind',
+        'pdtnum' : pdtnum, 
+        'pdtmpl' : pdtmpl, 
+        'drtnum' : drtnum,
+        'drtmpl' : drtmpl,
+        #'field' : fv['zonal_wnd'].get_value()[0],
+        #'field' : fv['zonal_wnd'].get_value()[0,:,lat_cheat_idx:,:-lon_cheat_idx],
+        'field' : field,
+        #'field' : '',
+        'lvl' : fv['lvl'].get_value()
+      }
+
+    # Let's prepare the 3d zonal wind data and metadata
+    # Product Definition Template Number (see Code Table 4.0)
+    #     0 -> Analysis or forecast at a horizontal level or in a 
+    #          horizontal layer at a point in time.  (see Template 4.0)
+    pdtnum = 0
+    # array of zeros (int) of size 15
+    pdtmpl = n.zeros((15,),dtype=int)
+    # Follows the definition of template 4.0 
+    # Oct 10: Parameter category (see Code table 4.1). 2 -> momentum
+    pdtmpl[0] = 2
+    # Oct 11: Parameter number (see Code table 4.2). 2 -> v-component of the
+    # wind
+    pdtmpl[1] = 3
+    # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+    pdtmpl[2] = 2
+    # Oct 13: Background generating process identifier 
+    # (defined by originating centre)
+    pdtmpl[3] = missing(1)
+    # Oct 14: Analysis or forecast generating process identified 
+    # (defined by originating centre)
+    pdtmpl[4] = missing(1)
+    # Oct 15-16: Hours of observational data cutoff after reference time 
+    pdtmpl[5] = missing(2)
+    # Oct 17: Minutes of observational data cutoff after reference time 
+    pdtmpl[6] = missing(1)
+    # Oct 18: Indicator of unit of time range (see Code table 4.4)
+    # 1 -> hours
+    # NB WPS expects this to be hours!
+    pdtmpl[7] = 1
+    # Oct 19-22: Forecast time in units defined by octet 18
+    pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+    # Oct 23: Type of first fixed surface (see Code table 4.5)
+    # 1 -> isobaric level
+    pdtmpl[9] = 100
+    # Oct 24: Scale factor of first fixed surface
+    pdtmpl[10] = 0
+    # Oct 25-28: Scaled value of first fixed surface
+    # -> missing as there is will be defined later when the data is sliced in
+    # horizontal slabs for its encoding
+    pdtmpl[11] = missing(3)
+    # Oct 29: Type of second fixed surface (see Code table 4.5)
+    pdtmpl[12] = missing(1)
+    # Oct 30: Scale factor of second fixed surface
+    pdtmpl[13] = missing(1)
+    # Oct 31-34: Scaled value of second fixed surfaces
+    pdtmpl[14] = missing(3)
+ 
+    # NB I am using the same drtnum and drtmpl for all data so I want
+    # replicate it in the following fields if you need to change this on a
+    # per-variable basis this is the place to redefine it. If you choose to do
+    # so then make sure you define one for each variable that follows or be
+    # aware that the last one defined will apply to all that follows.
+
+    cheat =fv['merid_wnd'].get_value()[0,:,lat_cheat_idx:,:-lon_cheat_idx] 
+    field = n.zeros(cheat.shape)
+    for lvl_idx in range(cheat.shape[0]):
+        for lat_idx in range(cheat.shape[1]):
+            field[lvl_idx,-(lat_idx+1)] = cheat[lvl_idx,lat_idx]
+
+    dummy['merid_wnd'] = {
+        'long_name' : '3D meridional wind',
+        'pdtnum' : pdtnum, 
+        'pdtmpl' : pdtmpl, 
+        'drtnum' : drtnum,
+        'drtmpl' : drtmpl,
+        #'field' : fv['merid_wnd'].get_value()[0],
+        #'field' : fv['merid_wnd'].get_value()[0,:,lat_cheat_idx:,:-lon_cheat_idx],
+        'field' : field,
+        #'field' : '',
+        'lvl' : fv['lvl'].get_value()
+      }
+
+    # Let's prepare the 3d geopotential height data and metadata
+    # Product Definition Template Number (see Code Table 4.0)
+    #     0 -> Analysis or forecast at a horizontal level or in a 
+    #          horizontal layer at a point in time.  (see Template 4.0)
+    pdtnum = 0
+    # array of zeros (int) of size 15
+    pdtmpl = n.zeros((15,),dtype=int)
+    # Follows the definition of template 4.0 
+    # Oct 10: Parameter category (see Code table 4.1). 3 -> mass
+    pdtmpl[0] = 3
+    # Oct 11: Parameter number (see Code table 4.2). 5 -> geopotential height
+    pdtmpl[1] = 5
+    # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+    pdtmpl[2] = 2
+    # Oct 13: Background generating process identifier 
+    # (defined by originating centre)
+    pdtmpl[3] = missing(1)
+    # Oct 14: Analysis or forecast generating process identified 
+    # (defined by originating centre)
+    pdtmpl[4] = missing(1)
+    # Oct 15-16: Hours of observational data cutoff after reference time 
+    pdtmpl[5] = missing(2)
+    # Oct 17: Minutes of observational data cutoff after reference time 
+    pdtmpl[6] = missing(1)
+    # Oct 18: Indicator of unit of time range (see Code table 4.4)
+    # 1 -> hours
+    # NB WPS expects this to be hours!
+    pdtmpl[7] = 1
+    # Oct 19-22: Forecast time in units defined by octet 18
+    pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+    # Oct 23: Type of first fixed surface (see Code table 4.5)
+    # 1 -> isobaric level
+    pdtmpl[9] = 100
+    # Oct 24: Scale factor of first fixed surface
+    pdtmpl[10] = 0
+    # Oct 25-28: Scaled value of first fixed surface
+    # -> missing as there is will be defined later when the data is sliced in
+    # horizontal slabs for its encoding
+    pdtmpl[11] = missing(3)
+    # Oct 29: Type of second fixed surface (see Code table 4.5)
+    pdtmpl[12] = missing(1)
+    # Oct 30: Scale factor of second fixed surface
+    pdtmpl[13] = missing(1)
+    # Oct 31-34: Scaled value of second fixed surfaces
+    pdtmpl[14] = missing(3)
+ 
+    # NB I am using the same drtnum and drtmpl for all data so I want
+    # replicate it in the following fields if you need to change this on a
+    # per-variable basis this is the place to redefine it. If you choose to do
+    # so then make sure you define one for each variable that follows or be
+    # aware that the last one defined will apply to all that follows.
+
+    cheat = fv['geop_ht'].get_value()[0,:,lat_cheat_idx:,:-lon_cheat_idx]
+    field = n.zeros(cheat.shape)
+    for lvl_idx in range(cheat.shape[0]):
+        for lat_idx in range(cheat.shape[1]):
+            field[lvl_idx,-(lat_idx+1)] = cheat[lvl_idx,lat_idx]
+
+    dummy['geop_ht'] = {
+        'long_name' : 'geopotential height',
+        'pdtnum' : pdtnum, 
+        'pdtmpl' : pdtmpl, 
+        'drtnum' : drtnum,
+        'drtmpl' : drtmpl,
+        #'field' : fv['geop_ht'].get_value()[0],
+        #'field' : fv['geop_ht'].get_value()[0,:,lat_cheat_idx:,:-lon_cheat_idx],
+        'field' : field,
+        #'field' : '',
+        'lvl' : fv['lvl'].get_value()
+      }
+
+    #######################################################################
+    # Finished with the atmospheric discipline
+    # Let's move on to the oceanographic one
+    #######################################################################
+
+    if 0:
+        # Preliminaries: we need to unpack the land_sea_ice mask from the laps
+        # files.
+        #sea_lnd_ice_mask = fv['sea_lnd_ice_mask'].get_value()[0]
+        sea_lnd_ice_mask = fv['sea_lnd_ice_mask'].get_value()[0,lat_cheat_idx:,:-lon_cheat_idx]
+        shape = sea_lnd_ice_mask.shape
+        land_cover = n.zeros(shape, 'i')
+        ice_cover = n.zeros(shape, 'i')
+        # I assume (know) that the mask has 3 dimensions of which the first is time
+        # which I am going to ignore for now
+        # I am sure this could be done more elegantly with a numpy in-built
+        # function, but I am not sure about which one would it be
+        for i in range(shape[0]):
+            for j in range(shape[1]):
+                if sea_lnd_ice_mask[i,j] == 0:
+                    land_cover[i,j] = 0
+                    ice_cover[i,j] = 0
+                elif sea_lnd_ice_mask[i,j] == 1:
+                    land_cover[i,j] = 1
+                    ice_cover[i,j] = 0
+                elif sea_lnd_ice_mask[i,j] == 2:
+                    # the BoM only considers ice over water
+                    land_cover[i,j] = 0
+                    ice_cover[i,j] = 1
+                else:
+                    print 'Illegal value in the sea_land_ice mask!'
+                    sys.exit()
+    
+        dummy = data[-1]['discipline']['ocean']['fields']['2d']
+    
+        # Let's prepare the ice cover data and metadata
+        # Product Definition Template Number (see Code Table 4.0)
+        #     0 -> Analysis or forecast at a horizontal level or in a 
+        #          horizontal layer at a point in time.  (see Template 4.0)
+        pdtnum = 0
+        # array of zeros (int) of size 15
+        pdtmpl = n.zeros((15,),dtype=int)
+        # Follows the definition of template 4.0 
+        # Oct 10: Parameter category (see Code table 4.1). 2 -> ice
+        pdtmpl[0] = 2
+        # Oct 11: Parameter number (see Code table 4.2). 0 -> ice-cover 
+        # 1=ice, 0=no-ice (over water)
+        pdtmpl[1] = 0
+        # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+        pdtmpl[2] = 2
+        # Oct 13: Background generating process identifier 
+        # (defined by originating centre)
+        pdtmpl[3] = missing(1)
+        # Oct 14: Analysis or forecast generating process identified 
+        # (defined by originating centre)
+        pdtmpl[4] = missing(1)
+        # Oct 15-16: Hours of observational data cutoff after reference time 
+        pdtmpl[5] = missing(2)
+        # Oct 17: Minutes of observational data cutoff after reference time 
+        pdtmpl[6] = missing(1)
+        # Oct 18: Indicator of unit of time range (see Code table 4.4)
+        # 1 -> hours
+        # NB WPS expects this to be hours!
+        pdtmpl[7] = 1
+        # Oct 19-22: Forecast time in units defined by octet 18
+        pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+        # Oct 23: Type of first fixed surface (see Code table 4.5)
+        # 1 -> surface
+        pdtmpl[9] = 1
+        # Oct 24: Scale factor of first fixed surface
+        pdtmpl[10] = 0
+        # Oct 25-28: Scaled value of first fixed surface
+        pdtmpl[11] = 0
+        # Oct 29: Type of second fixed surface (see Code table 4.5)
+        pdtmpl[12] = missing(1)
+        # Oct 30: Scale factor of second fixed surface
+        pdtmpl[13] = missing(1)
+        # Oct 31-34: Scaled value of second fixed surfaces
+        pdtmpl[14] = missing(3)
+     
+        # NB I am using the same drtnum and drtmpl for all data so I want
+        # replicate it in the following fields if you need to change this on a
+        # per-variable basis this is the place to redefine it. If you choose to do
+        # so then make sure you define one for each variable that follows or be
+        # aware that the last one defined will apply to all that follows.
+    
+        cheat = ice_cover
+        field = n.zeros(cheat.shape)
+        for lat_idx in range(cheat.shape[0]):
+            field[-(lat_idx+1)] = cheat[lat_idx]
+
+        dummy['ice_cover'] = {
+            'long_name' : 'ice cover',
+            'pdtnum' : pdtnum, 
+            'pdtmpl' : pdtmpl, 
+            'drtnum' : drtnum,
+            'drtmpl' : drtmpl,
+            #'field' : ice_cover
+            'field' : field
+          }
+
+    #######################################################################
+    # Finished with the oceanographic discipline
+    # Let's move on to the land one
+    #######################################################################
+
+    dummy = data[-1]['discipline']['land']['fields']['2d']
+
+    if 0:
+        # Let's prepare the land cover data and metadata
+        # Product Definition Template Number (see Code Table 4.0)
+        #     0 -> Analysis or forecast at a horizontal level or in a 
+        #          horizontal layer at a point in time.  (see Template 4.0)
+        pdtnum = 0
+        # array of zeros (int) of size 15
+        pdtmpl = n.zeros((15,),dtype=int)
+        # Follows the definition of template 4.0 
+        # Oct 10: Parameter category (see Code table 4.1). 0 -> vegetation/biomass
+        pdtmpl[0] = 0
+        # Oct 11: Parameter number (see Code table 4.2). 0 -> land-cover 
+        # (1=land, 0=ocean)
+        pdtmpl[1] = 0
+        # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+        pdtmpl[2] = 2
+        # Oct 13: Background generating process identifier 
+        # (defined by originating centre)
+        pdtmpl[3] = missing(1)
+        # Oct 14: Analysis or forecast generating process identified 
+        # (defined by originating centre)
+        pdtmpl[4] = missing(1)
+        # Oct 15-16: Hours of observational data cutoff after reference time 
+        pdtmpl[5] = missing(2)
+        # Oct 17: Minutes of observational data cutoff after reference time 
+        pdtmpl[6] = missing(1)
+        # Oct 18: Indicator of unit of time range (see Code table 4.4)
+        # 1 -> hours
+        # NB WPS expects this to be hours!
+        pdtmpl[7] = 1
+        # Oct 19-22: Forecast time in units defined by octet 18
+        pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+        # Oct 23: Type of first fixed surface (see Code table 4.5)
+        # 1 -> surface
+        pdtmpl[9] = 1
+        # Oct 24: Scale factor of first fixed surface
+        pdtmpl[10] = 0
+        # Oct 25-28: Scaled value of first fixed surface
+        pdtmpl[11] = 0
+        # Oct 29: Type of second fixed surface (see Code table 4.5)
+        pdtmpl[12] = missing(1)
+        # Oct 30: Scale factor of second fixed surface
+        pdtmpl[13] = missing(1)
+        # Oct 31-34: Scaled value of second fixed surfaces
+        pdtmpl[14] = missing(3)
+     
+        # NB I am using the same drtnum and drtmpl for all data so I want
+        # replicate it in the following fields if you need to change this on a
+        # per-variable basis this is the place to redefine it. If you choose to do
+        # so then make sure you define one for each variable that follows or be
+        # aware that the last one defined will apply to all that follows.
+        
+        # I seem to remember there was a problem with the land cover that I could
+        # fix using the decimal scale factor... let's try
+        land_cover_decimal_factor = 1
+        # Oct: 18-19. Decimal scale factor (D)
+        #drtmpl[2] = land_cover_decimal_factor
+        #print 'land_cover drtmpl', drtmpl
+    
+        cheat = land_cover * 10**land_cover_decimal_factor
+        field = n.zeros(cheat.shape)
+        for lat_idx in range(cheat.shape[0]):
+            field[-(lat_idx+1)] = cheat[lat_idx]
+
+        dummy['land_cover'] = {
+            'long_name' : 'land cover',
+            'pdtnum' : pdtnum, 
+            'pdtmpl' : pdtmpl, 
+            'drtnum' : drtnum,
+            'drtmpl' : n.array([0,0,land_cover_decimal_factor,24,0]),
+            #'drtmpl' : drtmpl,
+            #'field' : land_cover * 10**land_cover_decimal_factor
+            'field' : field
+          }
+    
+        # Now put it back to what it was
+        # Oct: 18-19. Decimal scale factor (D)
+        #drtmpl[2] = 0
+        
+    if 1:
+        # Let's prepare the topography data and metadata
+        # Product Definition Template Number (see Code Table 4.0)
+        #     0 -> Analysis or forecast at a horizontal level or in a 
+        #          horizontal layer at a point in time.  (see Template 4.0)
+        pdtnum = 0
+        # array of zeros (int) of size 15
+        pdtmpl = n.zeros((15,),dtype=int)
+        # Follows the definition of template 4.0 
+        # Oct 10: Parameter category (see Code table 4.1). 0 -> vegetation/biomass
+        pdtmpl[0] = 0
+        # Oct 11: Parameter number (see Code table 4.2). 7 -> model terrain height
+        pdtmpl[1] = 7
+        # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+        pdtmpl[2] = 2
+        # Oct 13: Background generating process identifier 
+        # (defined by originating centre)
+        pdtmpl[3] = missing(1)
+        # Oct 14: Analysis or forecast generating process identified 
+        # (defined by originating centre)
+        pdtmpl[4] = missing(1)
+        # Oct 15-16: Hours of observational data cutoff after reference time 
+        pdtmpl[5] = missing(2)
+        # Oct 17: Minutes of observational data cutoff after reference time 
+        pdtmpl[6] = missing(1)
+        # Oct 18: Indicator of unit of time range (see Code table 4.4)
+        # 1 -> hours
+        # NB WPS expects this to be hours!
+        pdtmpl[7] = 1
+        # Oct 19-22: Forecast time in units defined by octet 18
+        pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+        # Oct 23: Type of first fixed surface (see Code table 4.5)
+        # 1 -> surface
+        pdtmpl[9] = 1
+        # Oct 24: Scale factor of first fixed surface
+        pdtmpl[10] = 0
+        # Oct 25-28: Scaled value of first fixed surface
+        pdtmpl[11] = 0
+        # Oct 29: Type of second fixed surface (see Code table 4.5)
+        pdtmpl[12] = missing(1)
+        # Oct 30: Scale factor of second fixed surface
+        pdtmpl[13] = missing(1)
+        # Oct 31-34: Scaled value of second fixed surfaces
+        pdtmpl[14] = missing(3)
+     
+        # NB I am using the same drtnum and drtmpl for all data so I want
+        # replicate it in the following fields if you need to change this on a
+        # per-variable basis this is the place to redefine it. If you choose to do
+        # so then make sure you define one for each variable that follows or be
+        # aware that the last one defined will apply to all that follows.
+        cheat = fv['topog'].get_value()[lat_cheat_idx:,:-lon_cheat_idx]
+        field = n.zeros(cheat.shape)
+        for lat_idx in range(cheat.shape[0]):
+            field[-(lat_idx+1)] = cheat[lat_idx]
+    
+        dummy['topog'] = {
+            'long_name' : 'topography',
+            'pdtnum' : pdtnum, 
+            'pdtmpl' : pdtmpl, 
+            'drtnum' : drtnum,
+            'drtmpl' : drtmpl,
+            #'field' : fv['topog'].get_value()
+            #'field' : fv['topog'].get_value()[lat_cheat_idx:,:-lon_cheat_idx]
+            'field' : field
+          }
+    
+    dummy = data[-1]['discipline']['land']['fields']['3d']
+
+    if 1:
+        # Let's prepare the 3d soil temperature data and metadata
+        # Product Definition Template Number (see Code Table 4.0)
+        #     0 -> Analysis or forecast at a horizontal level or in a 
+        #          horizontal layer at a point in time.  (see Template 4.0)
+        pdtnum = 0
+        # array of zeros (int) of size 15
+        pdtmpl = n.zeros((15,),dtype=int)
+        # Follows the definition of template 4.0 
+        # Oct 10: Parameter category (see Code table 4.1). 0 -> vegetation/biomass
+        pdtmpl[0] = 0
+        # Oct 11: Parameter number (see Code table 4.2). 2 -> soil temperature
+        pdtmpl[1] = 2
+        # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+        pdtmpl[2] = 2
+        # Oct 13: Background generating process identifier 
+        # (defined by originating centre)
+        pdtmpl[3] = missing(1)
+        # Oct 14: Analysis or forecast generating process identified 
+        # (defined by originating centre)
+        pdtmpl[4] = missing(1)
+        # Oct 15-16: Hours of observational data cutoff after reference time 
+        pdtmpl[5] = missing(2)
+        # Oct 17: Minutes of observational data cutoff after reference time 
+        pdtmpl[6] = missing(1)
+        # Oct 18: Indicator of unit of time range (see Code table 4.4)
+        # 1 -> hours
+        # NB WPS expects this to be hours!
+        pdtmpl[7] = 1
+        # Oct 19-22: Forecast time in units defined by octet 18
+        pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+        # Oct 23: Type of first fixed surface (see Code table 4.5)
+        # 106 -> depth below land surface
+        pdtmpl[9] = 106
+        # Oct 24: Scale factor of first fixed surface
+        # 3 -> preserve mm accuracy
+        # 2 -> preserve cm accuracy
+        soil_lvl_scaling = 2
+        pdtmpl[10] = soil_lvl_scaling
+        # Oct 25-28: Scaled value of first fixed surface
+        # -> missing as there is will be defined later when the data is sliced in
+        # horizontal slabs for its encoding
+        pdtmpl[11] = missing(3)
+        # Oct 29: Type of second fixed surface (see Code table 4.5)
+        # 106 -> depth below land surface
+        pdtmpl[12] = 106
+        # Oct 30: Scale factor of second fixed surface
+        # 3 -> preserve mm accuracy
+        pdtmpl[13] = soil_lvl_scaling
+        # Oct 31-34: Scaled value of second fixed surfaces
+        pdtmpl[14] = missing(3)
+        # -> missing as there is will be defined later when the data is sliced in
+        # horizontal slabs for its encoding
+     
+        # NB I am using the same drtnum and drtmpl for all data so I want
+        # replicate it in the following fields if you need to change this on a
+        # per-variable basis this is the place to redefine it. If you choose to do
+        # so then make sure you define one for each variable that follows or be
+        # aware that the last one defined will apply to all that follows.
+
+        # Let's interpolate linearly to the Noah levels
+	# NB for the deepest level we actually have an extrapolation
+        laps_soil_lvl = fv['soil_lvl'].get_value()
+        noah_soil_lvl = [0.10, 0.40, 1.0, 2.0]
+        #laps_soil_temp = fv['soil_temp'].get_value()[0]
+        laps_soil_temp = fv['soil_temp'].get_value()[0,:,lat_cheat_idx:,:-lon_cheat_idx]
+        shape = laps_soil_temp.shape
+        noah_soil_temp = n.zeros(shape, dtype=float)
+        max_soil_lvl = 4
+        for soil_idx in range(max_soil_lvl):
+            if soil_idx < max_soil_lvl - 1:
+                x_a = n.ones((shape[1],shape[2])) * laps_soil_lvl[soil_idx]
+                x_b = n.ones((shape[1],shape[2])) * laps_soil_lvl[soil_idx + 1]
+                y_a = laps_soil_temp[soil_idx]
+                y_b = laps_soil_temp[soil_idx + 1]
+            else:
+                # this accomplishes the extrapolation
+                x_a = n.ones((shape[1],shape[2])) * laps_soil_lvl[soil_idx - 1]
+                x_b = n.ones((shape[1],shape[2])) * laps_soil_lvl[soil_idx]
+                y_a = laps_soil_temp[soil_idx - 1]
+                y_b = laps_soil_temp[soil_idx]
+                #print x_a, '\n\n', x_b, '\n\n', y_a, '\n\n', y_b, '\n\n' 
+                #print soil_idx, x_a.shape, x_b.shape, y_a.shape, y_b.shape
+            x = n.ones((shape[1],shape[2])) * noah_soil_lvl[soil_idx]
+            noah_soil_temp[soil_idx] = vu.lin_interp(x_a, x_b, y_a, y_b, x)
+            
+            
+        cheat = noah_soil_temp
+        field = n.zeros(cheat.shape)
+        for lvl_idx in range(cheat.shape[0]):
+            for lat_idx in range(cheat.shape[1]):
+                field[lvl_idx,-(lat_idx+1)] = cheat[lvl_idx,lat_idx]
+
+        dummy['soil_temp'] = {
+            'long_name' : '3D volumetric soil temperature',
+            'pdtnum' : pdtnum, 
+            'pdtmpl' : pdtmpl, 
+            'drtnum' : drtnum,
+            'drtmpl' : drtmpl,
+            #TODO: make sure the scaling is right
+            #'field' : noah_soil_temp,
+            'field' : field,
+            'lvl' : noah_soil_lvl
+          }
+    
+   
+    if 1:
+        # Let's prepare the 3d volumetric soil moisture
+        # Product Definition Template Number (see Code Table 4.0)
+        #     0 -> Analysis or forecast at a horizontal level or in a 
+        #          horizontal layer at a point in time.  (see Template 4.0)
+        pdtnum = 0
+        # array of zeros (int) of size 15
+        pdtmpl = n.zeros((15,),dtype=int)
+        # Follows the definition of template 4.0 
+        # Oct 10: Parameter category (see Code table 4.1). 0 -> vegetation/biomass
+        pdtmpl[0] = 0
+        # Oct 11: Parameter number (see Code table 4.2). 9 -> volumetric soil
+        # moisture
+        # pdtmpl[1] = 9
+        # I don't like this choice but maybe it is going to work more easily with
+        # WRF and other NCAR utilities like cnvgrib
+        pdtmpl[1] = 192
+        # Oct 12: Type of generating process (see Code table 4.3). 2 -> forecast
+        pdtmpl[2] = 2
+        # Oct 13: Background generating process identifier 
+        # (defined by originating centre)
+        pdtmpl[3] = missing(1)
+        # Oct 14: Analysis or forecast generating process identified 
+        # (defined by originating centre)
+        pdtmpl[4] = missing(1)
+        # Oct 15-16: Hours of observational data cutoff after reference time 
+        pdtmpl[5] = missing(2)
+        # Oct 17: Minutes of observational data cutoff after reference time 
+        pdtmpl[6] = missing(1)
+        # Oct 18: Indicator of unit of time range (see Code table 4.4)
+        # 1 -> hours
+        # NB WPS expects this to be hours!
+        pdtmpl[7] = 1
+        # Oct 19-22: Forecast time in units defined by octet 18
+        pdtmpl[8] = fv['forc_hrs'].get_value()[0]
+        # Oct 23: Type of first fixed surface (see Code table 4.5)
+        # 106 -> depth below land surface
+        pdtmpl[9] = 106
+        # Oct 24: Scale factor of first fixed surface
+        # 2 -> preserve cm accuracy
+        pdtmpl[10] = 2
+        # Oct 25-28: Scaled value of first fixed surface
+        # -> missing as there is will be defined later when the data is sliced in
+        # horizontal slabs for its encoding
+        pdtmpl[11] = missing(3)
+        # Oct 29: Type of second fixed surface (see Code table 4.5)
+        # 106 -> depth below land surface
+        pdtmpl[12] = 106
+        # Oct 30: Scale factor of second fixed surface
+        # 2 -> preserve cm accuracy
+        pdtmpl[13] = 2
+        # Oct 31-34: Scaled value of second fixed surfaces
+        pdtmpl[14] = missing(3)
+        # -> missing as there is will be defined later when the data is sliced in
+        # horizontal slabs for its encoding
+     
+        # NB I am using the same drtnum and drtmpl for all data so I want
+        # replicate it in the following fields if you need to change this on a
+        # per-variable basis this is the place to redefine it. If you choose to do
+        # so then make sure you define one for each variable that follows or be
+        # aware that the last one defined will apply to all that follows.
+    
+        # in the ECMWF soil scheme the data is saved scaled by the depth of the
+        # soil layer (or so I understand...)
+    
+        # TODO work out this 'not writable' rubbish
+        #print laps_soil_mois.flags['WRITEABLE'] 
+        #laps_soil_mois.flags['WRITEABLE'] = True
+        #laps_soil_mois = fv['soil_mois'].get_value()[0]
+        #laps_soil_mois = fv['soil_mois'].get_value()[0,:,lat_cheat_idx:,:-lon_cheat_idx]
+        tmp = fv['soil_mois'].get_value()[0,:,lat_cheat_idx:,:-lon_cheat_idx]
+        shape = tmp.shape
+        laps_soil_mois = n.zeros(shape)
+        laps_soil_lvl = fv['soil_lvl'].get_value()
+        for soil_idx in range(len(laps_soil_lvl)):
+            #laps_soil_mois[soil_idx] /= laps_soil_lvl[soil_idx]
+            laps_soil_mois[soil_idx] = tmp[soil_idx] / laps_soil_lvl[soil_idx]
+   
+        # Let's interpolate linearly to the Noah levels
+	# NB for the deepest level we actually have an extrapolation
+        noah_soil_lvl = [0.10, 0.40, 1.0, 2.0]
+        noah_soil_mois = n.zeros(laps_soil_mois.shape, dtype=float)
+        max_soil_lvl = 4
+        for soil_idx in range(max_soil_lvl):
+            if soil_idx < max_soil_lvl - 1:
+                x_a = n.ones((shape[1],shape[2])) * laps_soil_lvl[soil_idx]
+                x_b = n.ones((shape[1],shape[2])) * laps_soil_lvl[soil_idx + 1]
+                y_a = laps_soil_mois[soil_idx]
+                y_b = laps_soil_mois[soil_idx + 1]
+            else:
+                # this accomplishes the extrapolation
+                x_a = n.ones((shape[1],shape[2])) * laps_soil_lvl[soil_idx - 1]
+                x_b = n.ones((shape[1],shape[2])) * laps_soil_lvl[soil_idx]
+                y_a = laps_soil_mois[soil_idx - 1]
+                y_b = laps_soil_mois[soil_idx]
+            x = n.ones((shape[1],shape[2])) * noah_soil_lvl[soil_idx]
+            noah_soil_mois[soil_idx] = vu.lin_interp(x_a, x_b, y_a, y_b, x)
+            
+ 
+        cheat = noah_soil_mois
+        field = n.zeros(cheat.shape)
+        for lvl_idx in range(cheat.shape[0]):
+            for lat_idx in range(cheat.shape[1]):
+                field[lvl_idx,-(lat_idx+1)] = cheat[lvl_idx,lat_idx]
+
+        dummy['soil_mois'] = {
+            'long_name' : '3D volumetric soil moisture',
+            'pdtnum' : pdtnum, 
+            'pdtmpl' : pdtmpl, 
+            'drtnum' : drtnum,
+            'drtmpl' : drtmpl,
+            #TODO: make sure the scaling is right
+            #'field' : noah_soil_mois,
+            'field' : field,
+            'lvl' : noah_soil_lvl
+          }
+
+    f.close()
+    sfc_f.close()
+
+#sys.exit()
+#p.show()
+
+
+
+# Multiple times can be included in a grib files as sequential messages so the
+# outermost 'dimension' of the data structure should be time
+# As I am going to use the GFS grib files from ncep as a template for my own
+# files, I will include only one time in each of the files.
+# It should be easy to wrap to modify the following code to concatenate
+# multiple times
+
+def do_the_encoding(data):
+     dummy_idx = 0
+     for time_slice in data:
+         g2e = grib2.grib2.Grib2Encode(
+           time_slice['discipline']['atmos']['code'],
+           time_slice['idsect'])
+         g2e.addgrid(time_slice['gdsinfo'],time_slice['gdtmpl'])
+         dummy = time_slice['discipline']['atmos']['fields']['2d']
+         for var_key in dummy.keys():
+             print 'Processing ' + dummy[var_key]['long_name']
+             g2e.addfield(
+               dummy[var_key]['pdtnum'],
+               dummy[var_key]['pdtmpl'],
+               dummy[var_key]['drtnum'],
+               dummy[var_key]['drtmpl'],
+               dummy[var_key]['field']
+               )
+         dummy = time_slice['discipline']['atmos']['fields']['3d']
+         for var_key in dummy.keys():
+             print 'Processing ' + dummy[var_key]['long_name']
+             for lvl_idx in range(len(dummy[var_key]['lvl'])):
+                 print '\tlevel ' + str(lvl_idx)
+                 # '*100' because it must be in Pa
+                 dummy[var_key]['pdtmpl'][11] = \
+                   dummy[var_key]['lvl'][lvl_idx]*100
+                 g2e.addfield(
+                   dummy[var_key]['pdtnum'],
+                   dummy[var_key]['pdtmpl'],
+                   dummy[var_key]['drtnum'],
+                   dummy[var_key]['drtmpl'],
+                   dummy[var_key]['field'][lvl_idx]
+                   )
+         g2e.end()
+         file_name = 'laps_' + str(time_slice['idsect'][5]) + '_' \
+           + str(zfill(time_slice['idsect'][6],2)) + '_' \
+           + str(zfill(time_slice['idsect'][7],2)) + '_' \
+           + str(zfill(time_slice['idsect'][8],2)) + 'Z_' \
+           + str(zfill(dummy[var_key]['pdtmpl'][8],2)) + '_hrs_fcst.grb2'
+         #f = open('dummy' + str(dummy_idx) + '.grb2', 'w')
+         f = open(file_name, 'w')
+         f.write(g2e.msg)
+         f.close()
+
+         g2e = grib2.grib2.Grib2Encode(
+           time_slice['discipline']['ocean']['code'],
+           time_slice['idsect'])
+         g2e.addgrid(time_slice['gdsinfo'],time_slice['gdtmpl'])
+         dummy = time_slice['discipline']['ocean']['fields']['2d']
+         for var_key in dummy.keys():
+             print 'Processing ' + dummy[var_key]['long_name']
+             g2e.addfield(
+               dummy[var_key]['pdtnum'],
+               dummy[var_key]['pdtmpl'],
+               dummy[var_key]['drtnum'],
+               dummy[var_key]['drtmpl'],
+               dummy[var_key]['field']
+               )
+         if 0:
+             dummy = time_slice['discipline']['ocean']['fields']['3d']
+             for var_key in dummy.keys():
+                 print 'Processing ' + dummy[var_key]['long_name']
+                 for lvl_idx in range(len(dummy[var_key]['lvl'])):
+                     print '\tlevel ' + str(lvl_idx)
+                     # '*100' because it must be in Pa
+                     dummy[var_key]['pdtmpl'][11] = \
+                       dummy[var_key]['lvl'][lvl_idx]*100
+                     g2e.addfield(
+                       dummy[var_key]['pdtnum'],
+                       dummy[var_key]['pdtmpl'],
+                       dummy[var_key]['drtnum'],
+                       dummy[var_key]['drtmpl'],
+                       dummy[var_key]['field'][lvl_idx]
+                       )
+             g2e.end()
+         #f = open('dummy' + str(dummy_idx) + '.grb2', 'a')
+         f = open(file_name, 'a')
+         f.write(g2e.msg)
+         f.close()
+
+         g2e = grib2.grib2.Grib2Encode(
+           time_slice['discipline']['land']['code'],
+           time_slice['idsect'])
+         g2e.addgrid(time_slice['gdsinfo'],time_slice['gdtmpl'])
+         dummy = time_slice['discipline']['land']['fields']['2d']
+         for var_key in dummy.keys():
+             print 'Processing ' + dummy[var_key]['long_name']
+             g2e.addfield(
+               dummy[var_key]['pdtnum'],
+               dummy[var_key]['pdtmpl'],
+               dummy[var_key]['drtnum'],
+               dummy[var_key]['drtmpl'],
+               dummy[var_key]['field']
+               )
+         dummy = time_slice['discipline']['land']['fields']['3d']
+         for var_key in dummy.keys():
+             print 'Processing ' + dummy[var_key]['long_name']
+             for lvl_idx in range(len(dummy[var_key]['lvl'])):
+                 print '\tlevel ' + str(lvl_idx)
+                 if lvl_idx == 0:
+                     dummy[var_key]['pdtmpl'][11] = 0
+                 else:
+                     dummy[var_key]['pdtmpl'][11] = \
+                       round(dummy[var_key]['lvl'][lvl_idx-1]* 10**soil_lvl_scaling)
+                 dummy[var_key]['pdtmpl'][14] = \
+                   round(dummy[var_key]['lvl'][lvl_idx]* 10**soil_lvl_scaling)
+                 g2e.addfield(
+                   dummy[var_key]['pdtnum'],
+                   dummy[var_key]['pdtmpl'],
+                   dummy[var_key]['drtnum'],
+                   dummy[var_key]['drtmpl'],
+                   dummy[var_key]['field'][lvl_idx]
+                   )
+         g2e.end()
+         #f = open('dummy' + str(dummy_idx) + '.grb2', 'a')
+         f = open(file_name, 'a')
+         f.write(g2e.msg)
+         f.close()
+
+         #os.system('cnvgrib -g21 ' + file_name + ' ' + file_name[:-4] + 'grb')
+         #os.system('/Users/val/src/cnvgrib-1.1.3/cnvgrib -g21 ' + file_name + ' ' + file_name[:-4] + 'grb')
+         os.system('cnvgrib -g21 ' + file_name + ' ' + file_name[:-4] + 'grb')
+         os.system('rm ' + file_name)
+ 
+         dummy_idx += 1
+         
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/domain.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/domain.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/domain.py	(revision 207)
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+
+### A. Spiga -- LMD -- 30/06/2011 -- slight modif early 07/2011
+
+def domain (namefile,proj="ortho",back="vishires",target=None,var='HGT'): 
+    from netCDF4 import Dataset
+    from myplot import getcoord2d,define_proj,makeplotpng,simplinterv,getprefix,dumpbdy
+    from matplotlib.pyplot import contourf,rcParams
+    from numpy.core.defchararray import find
+    ###
+    nc  = Dataset(namefile)
+    ###
+    [lon2d,lat2d] = getcoord2d(nc)
+    lon2d = dumpbdy(lon2d)
+    lat2d = dumpbdy(lat2d)
+    [wlon,wlat] = simplinterv(lon2d,lat2d)
+    ###
+    m = define_proj(proj,wlon,wlat,back=back)
+    x, y = m(lon2d, lat2d)
+    ###
+    what_I_plot = dumpbdy( nc.variables[var][0,:,:] )
+    contourf(x, y, what_I_plot, 40)
+    ###
+    zeplot = getprefix(nc) + "domain"
+    if not target:   zeplot = namefile[0:find(namefile,'wrfout')] + zeplot
+    else:            zeplot = target + "/" + zeplot          
+    ###
+    makeplotpng(zeplot,pad_inches_value=0.35)
+    #rcParams['savefig.facecolor'] = 'black'
+    #makeplotpng(zeplot+"b",pad_inches_value=0.35)
+
+if __name__ == "__main__":
+    import sys
+    ### to be replaced by argparse
+    from optparse import OptionParser
+    parser = OptionParser()
+    parser.add_option('-f', action='store', dest='namefile',    type="string",  default=None,       help='name of WRF file [NEEDED]')
+    parser.add_option('-p', action='store', dest='proj',        type="string",  default="ortho",    help='projection')
+    parser.add_option('-b', action='store', dest='back',        type="string",  default="vishires", help='background')
+    parser.add_option('-t', action='store', dest='target',      type="string",  default=None,       help='destination folder')
+    parser.add_option('-v', action='store', dest='var',         type="string",  default='HGT',      help='variable contoured')
+    (opt,args) = parser.parse_args()
+    if opt.namefile is None:
+        print "I want to eat one file at least ! Use domain.py -f name_of_my_file. Or type domain.py -h"
+        exit()
+    print "Options:", opt
+    domain (opt.namefile,proj=opt.proj,back=opt.back,target=opt.target,var=opt.var)
Index: trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/winds.py
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/winds.py	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/winds.py	(revision 207)
@@ -0,0 +1,364 @@
+#!/usr/bin/env python
+
+### A. Spiga -- LMD -- 30/06/2011 to 10/07/2011
+### Thanks to A. Colaitis for the parser trick
+
+
+####################################
+####################################
+### The main program to plot vectors
+def winds (namefile,\
+           nvert,\
+           proj=None,\
+           back=None,\
+           target=None,
+           stride=3,\
+           numplot=4,\
+           var=None,\
+           colorb=True,\
+           winds=True,\
+           addchar=None,\
+           interv=[0,1],\
+           vmin=None,\
+           vmax=None,\
+           tile=False,\
+           zoom=None):
+
+    ####################################################################################################################
+    ### Colorbars http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps?action=AttachFile&do=get&target=colormaps3.png
+
+    #################################
+    ### Load librairies and functions
+    from netCDF4 import Dataset
+    from myplot import getcoord2d,define_proj,makeplotpng,simplinterv,vectorfield,ptitle,latinterv,getproj,wrfinterv,dumpbdy,\
+                       fmtvar,definecolorvec,getwinds,defcolorb,getprefix
+    from mymath import deg,max,min,mean
+    from matplotlib.pyplot import contour,contourf, subplot, figure, rcParams, savefig, colorbar, pcolor
+    from matplotlib.cm import get_cmap
+    import numpy as np
+    from numpy.core.defchararray import find
+
+    ###
+    #rcParams['text.usetex'] = True
+    #rcParams['cairo.format'] = 'svg'
+
+    ######################
+    ### Load NETCDF object
+    nc  = Dataset(namefile)
+
+    ###################################
+    ### Recognize predefined file types
+    if 'controle' in nc.variables:   typefile = 'gcm'
+    elif 'vert' in nc.variables:     typefile = 'mesoapi'
+    elif 'U' in nc.variables:        typefile = 'meso'
+    else:                            
+        print "typefile not supported."
+        print nc.variables
+        exit()
+
+    ##############################################################
+    ### Try to guess the projection from wrfout if not set by user 
+    if typefile in ['mesoapi','meso']:
+        if proj == None:       proj = getproj(nc)
+                                    ### (il faudrait passer CEN_LON dans la projection ?)
+    elif typefile in ['gcm']:
+        if proj == None:       proj = "cyl"   
+                                    ## pb avec les autres (de trace derriere la sphere ?)
+
+    ############################################
+    #### Choose underlying topography by default 
+    if not back:
+        if not var:                                        back = "mola"    ## if no var:         draw mola
+        elif typefile in ['mesoapi','meso'] \
+             and proj not in ['merc','lcc','nsper','laea']:       back = "molabw"  ## if var but meso:   draw molabw
+        else:                                              pass             ## else:              draw None
+
+    ####################################################
+    ### Get geographical coordinates and plot boundaries
+    if typefile in ['mesoapi','meso']:
+        [lon2d,lat2d] = getcoord2d(nc)
+        lon2d = dumpbdy(lon2d)
+        lat2d = dumpbdy(lat2d)
+    elif typefile in ['gcm']:
+        [lon2d,lat2d] = getcoord2d(nc,nlat="latitude",nlon="longitude",is1d=True)
+    if proj == "npstere":             [wlon,wlat] = latinterv("North_Pole")
+    elif proj in ["lcc","laea"]:      [wlon,wlat] = wrfinterv(lon2d,lat2d)
+    else:                             [wlon,wlat] = simplinterv(lon2d,lat2d)
+    if zoom:  
+        dlon = abs(wlon[1]-wlon[0])/2.
+        dlat = abs(wlat[1]-wlat[0])/2.
+        [wlon,wlat] = [ [wlon[0]+zoom*dlon/100.,wlon[1]-zoom*dlon/100.],\
+                        [wlat[0]+zoom*dlat/100.,wlat[1]-zoom*dlat/100.] ]
+        print "zoom %",zoom,wlon,wlat
+
+    ##############################################################################
+    ### Get winds and know if those are meteorological winds (ie. zon, mer) or not
+    if winds:
+        if typefile is 'mesoapi': 
+            [u,v] = getwinds(nc)
+            metwind = True  ## meteorological (zon/mer)
+        elif typefile is 'gcm':
+            [u,v] = getwinds(nc,charu='u',charv='v')
+            metwind = True  ## meteorological (zon/mer)
+        elif typefile is 'meso':
+            [u,v] = getwinds(nc,charu='U',charv='V')
+            metwind = False ## geometrical (wrt grid)
+            print "Beware ! Not using meteorological winds. You trust numerical grid as being (x,y)."
+
+    #####################################################
+    ### Load the chosen variables, whether it is 2D or 3D
+    if var:
+        if var not in nc.variables: 
+            print "not found in file:",var
+            exit()
+        else:   
+            dimension = np.array(nc.variables[var]).ndim
+            if dimension == 2:     field = nc.variables[var][:,:]
+            elif dimension == 3:   field = nc.variables[var][:,:,:]
+            elif dimension == 4:   field = nc.variables[var][:,nvert,:,:]  
+        dev = np.std(field)*3.0
+        if vmin is None:  zevmin = mean(field) - dev
+        else:             zevmin = vmin
+        if vmax is None:  zevmax = mean(field) + dev
+        else:             zevmax = vmax
+        print "bounds ", zevmin, zevmax
+        ### some already defined colormaps
+        if colorb is True:    colorb = defcolorb(var)
+    else:
+        dimension = 0
+ 
+    ###########################
+    ### Get length of time axis
+    if winds:               nt = len(u[:,0,0,0])
+    elif var:  
+        if dimension == 2:  nt = 1
+        else             :  nt = len(field[:,0,0])
+
+    #########################################
+    ### Name for title and graphics save file
+    if winds:   basename = "UV_" 
+    else:       basename = ""
+    if var:     basename = basename + var
+    ###
+    if dimension == 4:
+        if typefile is 'meso':                      stralt = "_lvl" + str(nvert)
+        elif typefile is 'mesoapi':  
+            zelevel = int(nc.variables['vert'][nvert])
+            if 'altitude'       in nc.dimensions:   stralt = "_"+str(zelevel)+"m-AMR"
+            elif 'altitude_abg' in nc.dimensions:   stralt = "_"+str(zelevel)+"m-ALS"
+            elif 'bottom_top'   in nc.dimensions:   stralt = "_"+str(zelevel)+"m"
+            elif 'pressure'     in nc.dimensions:   stralt = "_"+str(zelevel)+"Pa" 
+        else:                                       stralt = ""          
+    else:
+        stralt = ""
+    ###
+    basename = basename + stralt
+
+    ##################################
+    ### Open a figure and set subplots
+    fig = figure()
+    if   numplot > 0:    
+        if   numplot == 4: 
+            sub = 221
+            fig.subplots_adjust(wspace = 0.3, hspace = 0.3)
+            rcParams['font.size'] = int( rcParams['font.size'] * 2. / 3. )
+        elif numplot == 2: 
+            sub = 121
+            fig.subplots_adjust(wspace = 0.3)
+            rcParams['font.size'] = int( rcParams['font.size'] * 3. / 4. )
+        elif numplot == 3: 
+            sub = 131
+            fig.subplots_adjust(wspace = 0.5)
+            rcParams['font.size'] = int( rcParams['font.size'] * 1. / 2. )
+        elif numplot == 6: 
+            sub = 231
+            fig.subplots_adjust(wspace = 0.4, hspace = 0.0)
+            rcParams['font.size'] = int( rcParams['font.size'] * 1. / 2. )
+        elif numplot == 8: 
+            sub = 331 #241
+            fig.subplots_adjust(wspace = 0.3, hspace = 0.3)
+            rcParams['font.size'] = int( rcParams['font.size'] * 1. / 2. )
+        elif numplot == 9:
+            sub = 331
+            fig.subplots_adjust(wspace = 0.3, hspace = 0.3)
+            rcParams['font.size'] = int( rcParams['font.size'] * 1. / 2. )
+        elif numplot == 1:
+            sub = 99999
+        else:
+            print "supported: 1,2,3,4,6,8,9"
+            exit()
+        ### Prepare time loop
+        if nt <= numplot or numplot == 1:  
+            tabrange = [0]
+            numplot = 1
+        else:                          
+            tabrange = range(0,nt,int(nt/numplot))  #nt-1
+            tabrange = tabrange[0:numplot]
+    else: 
+        tabrange = range(0,nt,1)
+        sub = 99999
+    print tabrange
+
+    #################################
+    ### Time loop for plotting device
+    found_lct = False
+    for i in tabrange:
+
+       ### Which local time ?
+       ltst = ( interv[0] + 0.5*(wlon[0]+wlon[1])/15.) + i*interv[1]
+       ltst = int (ltst * 10) / 10.
+       ltst = ltst % 24
+
+       ### General plot settings
+       if numplot > 1: 
+           subplot(sub)
+           found_lct = True
+       elif numplot == 1:
+           found_lct = True 
+            ### If only one local time is requested (numplot < 0)
+       elif numplot <= 0: 
+           if int(ltst) + numplot != 0:		continue
+           else:                  		found_lct = True
+
+       ### Map projection
+       m = define_proj(proj,wlon,wlat,back=back)
+       x, y = m(lon2d, lat2d)
+
+       #### Contour plot
+       if var:
+           if typefile in ['mesoapi','meso']:    what_I_plot = dumpbdy(field[i,:,:])
+           elif typefile in ['gcm']:             
+               if dimension == 2:                what_I_plot = field[:,:]
+               elif dimension == 3:              what_I_plot = field[i,:,:]
+           palette = get_cmap(name=colorb)
+           #palette.set_over('b', 1.0)
+           if not tile:
+               zelevels = np.linspace(zevmin,zevmax)
+               contourf( x, y, what_I_plot, 10, cmap = palette, levels = zelevels )
+           else:    
+               pcolor( x, y, what_I_plot, cmap = palette, vmin=zevmin, vmax=zevmax )
+           if var in ['HGT']:        pass
+           elif colorb:              
+                                     ndiv = 10
+                                     colorbar(fraction=0.05,pad=0.1,format=fmtvar(var),\
+                                              ticks=np.linspace(zevmin,zevmax,ndiv+1),\
+                                              extend='max',spacing='proportional')
+                                                     # both min max neither
+       ### Vector plot
+       if winds:
+           if   typefile in ['mesoapi','meso']:    
+               [vecx,vecy] = [dumpbdy(u[i,nvert,:,:]), dumpbdy(v[i,nvert,:,:])]
+               key = True
+           elif typefile in ['gcm']:               
+               [vecx,vecy] = [        u[i,nvert,:,:] ,         v[i,nvert,:,:] ]
+               key = False
+           if metwind:  [vecx,vecy] = m.rotate_vector(vecx, vecy, lon2d, lat2d)
+           if var == None:        colorvec = definecolorvec(back)
+           else:                  colorvec = definecolorvec(colorb)
+           vectorfield(vecx, vecy,\
+                      x, y, stride=stride, csmooth=stride,\
+                      scale=15., factor=300., color=colorvec, key=key)
+                                        #200.         ## or csmooth=2
+       
+       ### Next subplot
+       plottitle = basename
+       if addchar:  plottitle = plottitle + addchar + "_LT"+str(ltst)
+       else:        plottitle = plottitle + "_LT"+str(ltst)
+       ptitle( plottitle )
+       sub += 1
+
+    ##########################################################################
+    ### Save the figure in a file in the data folder or an user-defined folder
+    if typefile in ['meso','mesoapi']:   prefix = getprefix(nc)   
+    elif typefile in ['gcm']:            prefix = 'LMD_GCM_'
+    else:                                prefix = ''
+    ###
+    zeplot = prefix + basename 
+    if addchar:         zeplot = zeplot + addchar
+    if numplot <= 0:    zeplot = zeplot + "_LT"+str(abs(numplot))
+    ###
+    if not target:      zeplot = namefile[0:find(namefile,'wrfout')] + zeplot
+    else:               zeplot = target + "/" + zeplot  
+    ###
+    if found_lct:     makeplotpng(zeplot,pad_inches_value=0.35)   
+    else:             print "Local time not found"
+
+    ###############
+    ### Now the end
+    return zeplot
+
+###########################################################################################
+###########################################################################################
+### What is below relate to running the file as a command line executable (very convenient)
+if __name__ == "__main__":
+    import sys
+    from optparse import OptionParser    ### to be replaced by argparse
+    from api_wrapper import api_onelevel
+    from netCDF4 import Dataset
+    from myplot import getlschar
+
+    #############################
+    ### Get options and variables
+    parser = OptionParser()
+    parser.add_option('-f', action='store', dest='namefile',    type="string",  default=None,  help='[NEEDED] name of WRF file')
+    parser.add_option('-l', action='store', dest='nvert',       type="float",   default=0,     help='vertical level (def=0)(-i 2: p,mbar)(-i 3,4: z,km)')
+    parser.add_option('-p', action='store', dest='proj',        type="string",  default=None,  help='projection')
+    parser.add_option('-b', action='store', dest='back',        type="string",  default=None,  help='background')
+    parser.add_option('-t', action='store', dest='target',      type="string",  default=None,  help='destination folder')
+    parser.add_option('-s', action='store', dest='stride',      type="int",     default=3,     help='stride vectors (def=3)')
+    parser.add_option('-v', action='store', dest='var',         type="string",  default=None,  help='variable contoured')
+    parser.add_option('-n', action='store', dest='numplot',     type="int",     default=4,     help='number of plots (def=1)(<0: 1 plot of LT -*numplot*)')
+    parser.add_option('-i', action='store', dest='interp',      type="int",     default=None,  help='interpolation method (2: press, 3: z-amr, 4:z-als)')
+    parser.add_option('-c', action='store', dest='colorb',      type="string",  default=True,  help='change colormap')
+    parser.add_option('-x', action='store_false', dest='winds',                 default=True,  help='no wind vectors')
+    parser.add_option('-m', action='store', dest='vmin',        type="float",   default=None,  help='bounding minimum value for color plot')    
+    parser.add_option('-M', action='store', dest='vmax',        type="float",   default=None,  help='bounding maximum value for color plot') 
+    parser.add_option('-T', action='store_true', dest='tile',                   default=False, help='draw a tiled plot (no blank zone)')
+    parser.add_option('-z', action='store', dest='zoom',        type="float",   default=None,  help='zoom factor in %')
+    parser.add_option('-N', action='store_true', dest='nocall',                 default=False, help='do not recreate api file')
+    #parser.add_option('-V', action='store', dest='comb',        type="float",   default=None,  help='a defined combination of variables')
+    (opt,args) = parser.parse_args()
+    if opt.namefile is None: 
+        print "I want to eat one file at least ! Use winds.py -f name_of_my_file. Or type winds.py -h"
+        exit()
+    print "Options:", opt
+    zefile = opt.namefile    
+    zelevel = opt.nvert   
+    stralt = None
+    [lschar,zehour,zehourin] = getlschar ( zefile )  ## getlschar from wrfout (or simply return "" if another file)
+
+    #####################################################
+    ### Call Fortran routines for vertical interpolations
+    if opt.interp is not None:
+        if opt.nvert is 0 and opt.interp is 4:  zelevel = 0.010
+        ### winds or no winds
+        if opt.winds            :  zefields = 'uvmet'
+        else                    :  zefields = ''
+        ### var or no var
+        if opt.var is None      :  pass
+        elif zefields == ''     :  zefields = opt.var
+        else                    :  zefields = zefields + "," + opt.var
+        print zefields
+        zefile = api_onelevel (  path_to_input   = '', \
+                                 input_name      = zefile, \
+                                 path_to_output  = opt.target, \
+                                 fields          = zefields, \
+                                 interp_method   = opt.interp, \
+                                 onelevel        = zelevel, \
+                                 nocall          = opt.nocall )
+        print zefile
+        zelevel = 0 ## so that zelevel could play again the role of nvert
+
+    #############
+    ### Main call
+    name = winds (zefile,int(zelevel),\
+           proj=opt.proj,back=opt.back,target=opt.target,stride=opt.stride,var=opt.var,numplot=opt.numplot,colorb=opt.colorb,winds=opt.winds,\
+           addchar=lschar,interv=[zehour,zehourin],vmin=opt.vmin,vmax=opt.vmax,tile=opt.tile,zoom=opt.zoom)
+    print 'Done: '+name
+
+    #########################################################
+    ### Generate a .sh file with the used command saved in it
+    command = ""
+    for arg in sys.argv: command = command + arg + ' '
+    f = open(name+'.sh', 'w')
+    f.write(command)
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas/atlas.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas/atlas.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas/atlas.pro	(revision 207)
@@ -0,0 +1,31 @@
+;;
+;; ATLAS EXOMARS STUDY
+;;
+
+;;;zelevel='1'
+;;;firstextract = 'true'
+;;;zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-web_map_model_level_W_HGT.def'   ;; event. modifier si on ne veut pas recalculer les .idl
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+if (firstextract eq 'true') then SPAWN, "echo 'dumb=999' >> gw.def" else SPAWN, "echo 'dumb=0' >> gw.def"  ;;  juste pour le premier
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;SPAWN, "echo 'dumb=0' >> gw.def ; echo 'intervalx=1.0 ;; grepALL' >> gw.def ; echo 'intervaly=1.0 ;; grepALL' >> gw.def ; echo 'windowx=[-12.,00.] ;; grepMAP' >> gw.def ; echo 'windowy=[-08.,04.] ;; grepMAP' >> gw.def ; echo 'stride=3. ;; grepALL' >> gw.def ; sed s:'atlasMERIDIANI':'atlasMERIDIANI_closer':g gw.def | sed s:'false':'true':g > ye.def ; mv -f ye.def gw.def"  ;; attention dernier pas tres robuste, pour useidlfile
+;@gwc
+;gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;SPAWN, "echo 'intervalx=0.5 ;; grepALL' >> gw.def ; echo 'intervaly=0.5 ;; grepALL' >> gw.def ; echo 'windowx=[-08.,-04.] ;; grepMAP' >> gw.def ; echo 'windowy=[-04.,00.] ;; grepMAP' >> gw.def ; echo 'stride=1. ;; grepALL' >> gw.def ; sed s:'atlasMERIDIANI_closer':'atlasMERIDIANI_ellipse':g gw.def > ye.def ; mv -f ye.def gw.def"
+;@gwc
+;gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+
+
+;;;;
+;;;SPAWN, 'mkdir zefolder/idl_save_'+zelevel+' ; mv zefolder/*.idl zefolder/idl_save_'+zelevel+'/'
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas/atlas.pro_2
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas/atlas.pro_2	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas/atlas.pro_2	(revision 207)
@@ -0,0 +1,202 @@
+;;
+;; ATLAS EXOMARS STUDY
+;;
+
+;zelevel='1'
+;firstextract = 'true'
+;zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-web_map_model_level_W_HGT.def'   ;; event. modifier si on ne veut pas recalculer les .idl
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+if (firstextract eq 'true') then SPAWN, "echo 'dumb=999' >> gw.def"  ;;  juste pour le premier
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "echo 'dumb=0' >> gw.def ; echo 'intervalx=1.0 ;; grepALL' >> gw.def ; echo 'intervaly=1.0 ;; grepALL' >> gw.def ; echo 'windowx=[-12.,00.] ;; grepMAP' >> gw.def ; echo 'windowy=[-08.,04.] ;; grepMAP' >> gw.def ; echo 'stride=3. ;; grepALL' >> gw.def ; sed s:'atlasMERIDIANI':'atlasMERIDIANI_closer':g gw.def | sed s:'false':'true':g > ye.def ; mv -f ye.def gw.def"  ;; attention dernier pas tres robuste, pour useidlfile
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "echo 'intervalx=0.5 ;; grepALL' >> gw.def ; echo 'intervaly=0.5 ;; grepALL' >> gw.def ; echo 'windowx=[-08.,-04.] ;; grepMAP' >> gw.def ; echo 'windowy=[-04.,00.] ;; grepMAP' >> gw.def ; echo 'stride=1. ;; grepALL' >> gw.def ; sed s:'atlasMERIDIANI_closer':'atlasMERIDIANI_ellipse':g gw.def > ye.def ; mv -f ye.def gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+SPAWN, 'mkdir zefolder/idl_save_'+zelevel+' ; mv zefolder/*.idl zefolder/idl_save_'+zelevel+'/'
+
+
+
+
+stop
+
+
+
+zelevel='2'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-web_map_model_level_W_HGT.def'   ;; event. modifier si on ne veut pas recalculer les .idl
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='2'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-closer_web_map_model_level_W_HGT.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='2'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-ellipse_web_map_model_level_W_HGT.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;
+SPAWN, 'mkdir zefolder/idl_save_2 ; mv zefolder/*.idl zefolder/idl_save_2/'
+;
+
+zelevel='4'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-web_map_model_level_W_HGT.def'   ;; event. modifier si on ne veut pas recalculer les .idl
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='4'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-closer_web_map_model_level_W_HGT.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='4'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-ellipse_web_map_model_level_W_HGT.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;
+SPAWN, 'mkdir zefolder/idl_save_4 ; mv zefolder/*.idl zefolder/idl_save_4/'
+;
+
+zelevel='6'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-web_map_model_level_W_HGT.def'   ;; event. modifier si on ne veut pas recalculer les .idl
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='6'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-closer_web_map_model_level_W_HGT.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='6'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-ellipse_web_map_model_level_W_HGT.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;
+SPAWN, 'mkdir zefolder/idl_save_6 ; mv zefolder/*.idl zefolder/idl_save_6/'
+;
+
+zelevel='7'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-web_map_model_level_W_HGT.def'   ;; event. modifier si on ne veut pas recalculer les .idl
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='7'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-closer_web_map_model_level_W_HGT.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='7'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-ellipse_web_map_model_level_W_HGT.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;
+SPAWN, 'mkdir zefolder/idl_save_7 ; mv zefolder/*.idl zefolder/idl_save_7/'
+;
+
+zelevel='8'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-web_map_model_level_W_HGT.def'   ;; event. modifier si on ne veut pas recalculer les .idl
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='8'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-closer_web_map_model_level_W_HGT.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='8'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-ellipse_web_map_model_level_W_HGT.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;
+SPAWN, 'mkdir zefolder/idl_save_8 ; mv zefolder/*.idl zefolder/idl_save_8/'
+;
+
+zelevel='18'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-web_map_model_level_W_HGT.def'   ;; event. modifier si on ne veut pas recalculer les .idl
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='18'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-closer_web_map_model_level_W_HGT.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='18'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-ellipse_web_map_model_level_W_HGT.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;
+SPAWN, 'mkdir zefolder/idl_save_18 ; mv zefolder/*.idl zefolder/idl_save_18/'
+;
+
+exit
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas/atlas.sh
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas/atlas.sh	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas/atlas.sh	(revision 207)
@@ -0,0 +1,45 @@
+#! /bin/bash
+
+\rm atlas.log
+echo "print, '****************************yy'
+zelevel='1'
+firstextract = 'true'
+zeatlas='/tmp7/aslmd/atlas-web_map_model_level_U_HGT_UV.def' 
+@atlas.pro
+print, '****************************yy'
+zelevel='2'
+firstextract = 'true'
+zeatlas='/tmp7/aslmd/atlas-web_map_model_level_U_HGT_UV.def' 
+@atlas.pro
+print, '****************************yy'
+zelevel='3'
+firstextract = 'true'
+zeatlas='/tmp7/aslmd/atlas-web_map_model_level_U_HGT_UV.def' 
+@atlas.pro
+print, '****************************yy'
+zelevel='4'
+firstextract = 'true'
+zeatlas='/tmp7/aslmd/atlas-web_map_model_level_U_HGT_UV.def' 
+@atlas.pro
+print, '****************************yy'
+zelevel='5'
+firstextract = 'true'
+zeatlas='/tmp7/aslmd/atlas-web_map_model_level_U_HGT_UV.def' 
+@atlas.pro
+print, '****************************yy'
+zelevel='6'
+firstextract = 'true'
+zeatlas='/tmp7/aslmd/atlas-web_map_model_level_U_HGT_UV.def' 
+@atlas.pro
+exit" | /opt/idl-6.4/idl/bin/idl >> atlas.log 2>& 1 
+
+
+#############################
+#
+# have you modified atlas.pro ?
+# sed s/'U_HGT_UV'/'W_HGT'/g atlas.pro > ye.pro
+#
+#echo atlas.pro should have been modified
+#echo you should have had generated input files
+#
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-closer_web_map_model_level_U_HGT_UV.def
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-closer_web_map_model_level_U_HGT_UV.def	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-closer_web_map_model_level_U_HGT_UV.def	(revision 207)
@@ -0,0 +1,267 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  -or- @report.idl
+;  -or- @movie.idl
+;
+;  this file will be saved !
+;
+;;---------------------------------------
+
+
+;-------------------------------------;
+; DATA LOCATION and PLOT DESTINATION  ;
+; default is ./                       ;
+;-------------------------------------;
+datafolder='/home/aslmd/MERIDIANI_EXOMARS'
+plotfolder=datafolder
+;; for web anim and tex report (default is 'plot')
+textitle='MERIDIANI_closer_MLzeremplace'
+texcomments='sol3'
+
+;;; load/save ARWpost-generated text files ? default is no
+;backup_data='yes'
+;already_data='yes'
+
+;-------------------------------
+;-------------------------------
+; namelist.ARWPOST parameters
+;-------------------------------
+;-------------------------------
+
+nam1=" fields = 'U,V,HGT' "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE FIELDS TO BE EXTRACTED 
+;; ex: tk,HGT,PSFC,U,V,W,T,tk,ICETOT,RAVE,QH2O_ICE,QH2O,PTOT,TSURF
+
+nam2=" start_date = '2024-03-21_00:00:00' " 
+nam3=" end_date   = '2024-03-22_00:00:00' "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE START/END DATE
+
+nam4=" interval_seconds = 3700 "		
+
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
+;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s, 12h: 44400s	
+
+;nam5=" interp_method = 1 "	
+nam5=" interp_method = 0 "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 		
+;; SET VERT. COORD. 0: eta levels, 1: height (inc) or pressure (dec)
+tabnam=[0.,50.,1.]
+;tabnam=[8., 9., 0.1]
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; SET HEIGHT/PRESSURE LEVELS WITH [first alt, last alt, step]
+
+;nest='d03'  
+;; ^ ^ ^ ^
+;; SET NEST
+
+
+
+;----------------------------------------------------
+;----------------------------------------------------
+; what do you want to plot ?
+; THIS MUST BE SET ACCORDINGLY TO PREVIOUS SECTION
+;   - do not plot a field not extracted
+;   - do not ask for more plot than data available
+;----------------------------------------------------
+;----------------------------------------------------
+
+num=24		   	;; how many plots ?
+
+
+field1='U'		;; FILLED
+;field2='HGT'		;; CONTOURED
+winds=['U','V']		;; VECTORS
+topo=1
+
+
+;;; VORTICITY
+;field1='HGT' & winds=['U','V'] & topo=1
+
+
+;----------------------------------
+;----------------------------------
+; what kind of plot do you want ? 
+;----------------------------------
+;----------------------------------
+
+;; first is 1
+plot='map' & level=zeremplace	
+;plot='meridional' & nlon=89
+;plot='zonal' & nlat=66
+
+
+;---------;
+; special ;
+;---------;
+;;; SEA-LEVEL PRESSURE
+;field1='PSFC' & winds=['tk','HGT'] & topo=1 & plot='map' & level=7
+;;; HORIZONTAL WIND VELOCITY
+;field1='U' & winds=['U','V'] & topo=1 & plot='map' & level=9
+
+useidlfile='true' ;; if you are just changing what is below...
+extract='no' ;; SPECIFIC FOR ATLAS
+
+
+;----------------------------
+;----------------------------
+; change plot settings 
+;----------------------------
+;----------------------------
+
+;; uncomment to modify default plot settings
+;; | | | | | | | | | | | | | | | | | | | | |
+;; v v v v v v v v v v v v v v v v v v v v v
+
+;;;
+;;; PLOT TITLES
+;;;
+;subtitle_user='-- LMD Martian Mesoscale Model --'            ;; grepALL
+;title_user='Vertical Wind (!Nm!N.s!U-1!N)'     ;; grepALL
+;title_axis=['x coord (km)','y coord (km)']     ;; grepALL
+
+;;;
+;;; COLOR TABLES
+;;;
+;flag_cb='false'                ;; grepALL
+;format='(F4.1)'                  ;; grepALL
+;colors=128                      ;; grepALL
+;pal=39                          ;; grepALL
+;; GOOD COLOR TABLES: 4, 18, 22, 16, 37, 33, 39
+
+;;;
+;;; FILL LIMITS
+;;;
+minfield_init= 00.      ;; grepALL
+maxfield_init= 25.  	;; grepALL
+
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max ;; grepALL
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min ;; grepALL
+;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value ;; grepALL
+
+;;;
+;;; WINDS
+;;;
+windex=20.      ;; grepALL
+stride=3.       ;; grepALL
+
+;;;
+;;; CONTOUR
+;;;
+;overcontour=overcontour-mean(overcontour)      ;; grepALL
+lev=-10. + 0.5*findgen(50) ;; grepALL
+
+;;;
+;;; AXIS
+;;;
+;isotropic='false'       ;; grepALL
+intervalx=1.0            ;; grepALL
+intervaly=1.0            ;; grepALL
+
+;;;
+;;; MAP LIMITS 
+;;;
+windowx=[-12.,00.]       ;; grepMAP
+windowy=[-08.,04.]       ;; grepMAP
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-4.		;; grepSEC
+;maxalt=16.		;; grepSEC
+;minspace=-30.   	;; grepSEC
+;maxspace=0.   		;; grepSEC
+
+;;
+;; METRIC UNITS FOR VERTICAL SECTION
+;;
+;factor=20.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;; POUBELLE
+
+
+;; DEFAULT: ARWPOST.EXE ALREADY RUN (i.e. input.ctl and input.dat already there)
+;; UNCOMMENT FOLLOWING LINE TO EXTRACT FILES 
+;extract='yes'   ;;   EXECUTE ARWPOST.EXE
+                ;;   WITH THE FOLLOWING PARAMETERS :
+
+
+;@map_sea_level.idl
+;@map_ertel_vorticity.idl
+;field1='HGT'
+;field2='U'
+;winds=['U','V']
+;topo=1
+
+
+;winds=['U','V'] & field1='SWDOWN' & topo=1
+;winds=['V','W'] & field1='V' 
+;field1='ICETOT' & topo=1
+;field1='RAVE' & topo=1
+;field1='QH2O_ICE' & topo=1
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O' & field2='W'
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O_ICE' & field2='tk'
+;field1='tk' & topo=1
+;field1='V' & field2='V'
+;field1='W' & winds=['V','W']
+;field1='tk' & winds=['V','W']
+;field1='tk'
+;field1='W' & topo=1
+;field1='TSK' & topo=1
+;field1='U' & winds=['U','V'] & topo=1
+;winds=['V','W'] & field1='V'
+;winds=['V','W'] & field1='W'
+;field1='U' & winds=['U','V'] & topo=1
+;field1='HGT' & field2='HGT' 
+;field1='U' & winds=['U','V'] ;& topo=1
+;field1='PSFC' & winds=['U','V'] & field2='W'
+;field1='W' & winds=['U','V'] & field2='PSFC'
+;field1='TSURF' & topo=1 ;& winds=['U','V']
+;field1='T' & topo=1 & winds=['U','V']
+;field1='PSFC' & winds=['tk','HGT'] & topo=1
+;field1='tk' & topo=1
+;field1='tk' & winds=['U','V'] & topo=1
+;field1='T' & field2='T'
+;field1='T' & winds=['U','V'] 
+;field1='HGT' & winds=['HGT','HGT'] 
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-closer_web_map_model_level_W_HGT.def
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-closer_web_map_model_level_W_HGT.def	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-closer_web_map_model_level_W_HGT.def	(revision 207)
@@ -0,0 +1,267 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  -or- @report.idl
+;  -or- @movie.idl
+;
+;  this file will be saved !
+;
+;;---------------------------------------
+
+
+;-------------------------------------;
+; DATA LOCATION and PLOT DESTINATION  ;
+; default is ./                       ;
+;-------------------------------------;
+datafolder='/home/aslmd/MERIDIANI_EXOMARS'
+plotfolder=datafolder
+;; for web anim and tex report (default is 'plot')
+textitle='MERIDIANI_closer_MLzeremplace'
+texcomments='sol3'
+
+;;; load/save ARWpost-generated text files ? default is no
+;backup_data='yes'
+;already_data='yes'
+
+;-------------------------------
+;-------------------------------
+; namelist.ARWPOST parameters
+;-------------------------------
+;-------------------------------
+
+nam1=" fields = 'W,HGT' "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE FIELDS TO BE EXTRACTED 
+;; ex: tk,HGT,PSFC,U,V,W,T,tk,ICETOT,RAVE,QH2O_ICE,QH2O,PTOT,TSURF
+
+nam2=" start_date = '2024-03-21_00:00:00' " 
+nam3=" end_date   = '2024-03-22_00:00:00' "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE START/END DATE
+
+nam4=" interval_seconds = 3700 "		
+
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
+;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s, 12h: 44400s	
+
+;nam5=" interp_method = 1 "	
+nam5=" interp_method = 0 "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 		
+;; SET VERT. COORD. 0: eta levels, 1: height (inc) or pressure (dec)
+tabnam=[0.,50.,1.]
+;tabnam=[8., 9., 0.1]
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; SET HEIGHT/PRESSURE LEVELS WITH [first alt, last alt, step]
+
+;nest='d03'  
+;; ^ ^ ^ ^
+;; SET NEST
+
+
+
+;----------------------------------------------------
+;----------------------------------------------------
+; what do you want to plot ?
+; THIS MUST BE SET ACCORDINGLY TO PREVIOUS SECTION
+;   - do not plot a field not extracted
+;   - do not ask for more plot than data available
+;----------------------------------------------------
+;----------------------------------------------------
+
+num=24		   	;; how many plots ?
+
+
+field1='W'		;; FILLED
+;field2='HGT'		;; CONTOURED
+;winds=['U','V']	;; VECTORS
+topo=1
+
+
+;;; VORTICITY
+;field1='HGT' & winds=['U','V'] & topo=1
+
+
+;----------------------------------
+;----------------------------------
+; what kind of plot do you want ? 
+;----------------------------------
+;----------------------------------
+
+;; first is 1
+plot='map' & level=zeremplace	
+;plot='meridional' & nlon=89
+;plot='zonal' & nlat=66
+
+
+;---------;
+; special ;
+;---------;
+;;; SEA-LEVEL PRESSURE
+;field1='PSFC' & winds=['tk','HGT'] & topo=1 & plot='map' & level=7
+;;; HORIZONTAL WIND VELOCITY
+;field1='U' & winds=['U','V'] & topo=1 & plot='map' & level=9
+
+useidlfile='true' ;; if you are just changing what is below...
+extract='no' ;; SPECIFIC FOR ATLAS
+
+
+;----------------------------
+;----------------------------
+; change plot settings 
+;----------------------------
+;----------------------------
+
+;; uncomment to modify default plot settings
+;; | | | | | | | | | | | | | | | | | | | | |
+;; v v v v v v v v v v v v v v v v v v v v v
+
+;;;
+;;; PLOT TITLES
+;;;
+;subtitle_user='-- LMD Martian Mesoscale Model --'            ;; grepALL
+;title_user='Vertical Wind (!Nm!N.s!U-1!N)'     ;; grepALL
+;title_axis=['x coord (km)','y coord (km)']     ;; grepALL
+
+;;;
+;;; COLOR TABLES
+;;;
+;flag_cb='false'                ;; grepALL
+;format='(F4.1)'                  ;; grepALL
+;colors=128                      ;; grepALL
+;pal=39                          ;; grepALL
+;; GOOD COLOR TABLES: 4, 18, 22, 16, 37, 33, 39
+
+;;;
+;;; FILL LIMITS
+;;;
+minfield_init= -05.      ;; grepALL
+maxfield_init= 05.  	;; grepALL
+
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max ;; grepALL
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min ;; grepALL
+;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value ;; grepALL
+
+;;;
+;;; WINDS
+;;;
+windex=20.      ;; grepALL
+stride=3.       ;; grepALL
+
+;;;
+;;; CONTOUR
+;;;
+;overcontour=overcontour-mean(overcontour)      ;; grepALL
+lev=-10. + 0.5*findgen(50) ;; grepALL
+
+;;;
+;;; AXIS
+;;;
+;isotropic='false'       ;; grepALL
+intervalx=1.0            ;; grepALL
+intervaly=1.0            ;; grepALL
+
+;;;
+;;; MAP LIMITS 
+;;;
+windowx=[-12.,00.]       ;; grepMAP
+windowy=[-08.,04.]       ;; grepMAP
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-4.		;; grepSEC
+;maxalt=16.		;; grepSEC
+;minspace=-30.   	;; grepSEC
+;maxspace=0.   		;; grepSEC
+
+;;
+;; METRIC UNITS FOR VERTICAL SECTION
+;;
+;factor=20.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;; POUBELLE
+
+
+;; DEFAULT: ARWPOST.EXE ALREADY RUN (i.e. input.ctl and input.dat already there)
+;; UNCOMMENT FOLLOWING LINE TO EXTRACT FILES 
+;extract='yes'   ;;   EXECUTE ARWPOST.EXE
+                ;;   WITH THE FOLLOWING PARAMETERS :
+
+
+;@map_sea_level.idl
+;@map_ertel_vorticity.idl
+;field1='HGT'
+;field2='U'
+;winds=['U','V']
+;topo=1
+
+
+;winds=['U','V'] & field1='SWDOWN' & topo=1
+;winds=['V','W'] & field1='V' 
+;field1='ICETOT' & topo=1
+;field1='RAVE' & topo=1
+;field1='QH2O_ICE' & topo=1
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O' & field2='W'
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O_ICE' & field2='tk'
+;field1='tk' & topo=1
+;field1='V' & field2='V'
+;field1='W' & winds=['V','W']
+;field1='tk' & winds=['V','W']
+;field1='tk'
+;field1='W' & topo=1
+;field1='TSK' & topo=1
+;field1='U' & winds=['U','V'] & topo=1
+;winds=['V','W'] & field1='V'
+;winds=['V','W'] & field1='W'
+;field1='U' & winds=['U','V'] & topo=1
+;field1='HGT' & field2='HGT' 
+;field1='U' & winds=['U','V'] ;& topo=1
+;field1='PSFC' & winds=['U','V'] & field2='W'
+;field1='W' & winds=['U','V'] & field2='PSFC'
+;field1='TSURF' & topo=1 ;& winds=['U','V']
+;field1='T' & topo=1 & winds=['U','V']
+;field1='PSFC' & winds=['tk','HGT'] & topo=1
+;field1='tk' & topo=1
+;field1='tk' & winds=['U','V'] & topo=1
+;field1='T' & field2='T'
+;field1='T' & winds=['U','V'] 
+;field1='HGT' & winds=['HGT','HGT'] 
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-ellipse_web_map_model_level_U_HGT_UV.def
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-ellipse_web_map_model_level_U_HGT_UV.def	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-ellipse_web_map_model_level_U_HGT_UV.def	(revision 207)
@@ -0,0 +1,267 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  -or- @report.idl
+;  -or- @movie.idl
+;
+;  this file will be saved !
+;
+;;---------------------------------------
+
+
+;-------------------------------------;
+; DATA LOCATION and PLOT DESTINATION  ;
+; default is ./                       ;
+;-------------------------------------;
+datafolder='/home/aslmd/MERIDIANI_EXOMARS'
+plotfolder=datafolder
+;; for web anim and tex report (default is 'plot')
+textitle='MERIDIANI_ellipse_MLzeremplace'
+texcomments='sol3'
+
+;;; load/save ARWpost-generated text files ? default is no
+;backup_data='yes'
+;already_data='yes'
+
+;-------------------------------
+;-------------------------------
+; namelist.ARWPOST parameters
+;-------------------------------
+;-------------------------------
+
+nam1=" fields = 'U,V,HGT' "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE FIELDS TO BE EXTRACTED 
+;; ex: tk,HGT,PSFC,U,V,W,T,tk,ICETOT,RAVE,QH2O_ICE,QH2O,PTOT,TSURF
+
+nam2=" start_date = '2024-03-21_00:00:00' " 
+nam3=" end_date   = '2024-03-22_00:00:00' "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE START/END DATE
+
+nam4=" interval_seconds = 3700 "		
+
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
+;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s, 12h: 44400s	
+
+;nam5=" interp_method = 1 "	
+nam5=" interp_method = 0 "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 		
+;; SET VERT. COORD. 0: eta levels, 1: height (inc) or pressure (dec)
+tabnam=[0.,50.,1.]
+;tabnam=[8., 9., 0.1]
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; SET HEIGHT/PRESSURE LEVELS WITH [first alt, last alt, step]
+
+;nest='d03'  
+;; ^ ^ ^ ^
+;; SET NEST
+
+
+
+;----------------------------------------------------
+;----------------------------------------------------
+; what do you want to plot ?
+; THIS MUST BE SET ACCORDINGLY TO PREVIOUS SECTION
+;   - do not plot a field not extracted
+;   - do not ask for more plot than data available
+;----------------------------------------------------
+;----------------------------------------------------
+
+num=24		   	;; how many plots ?
+
+
+field1='U'		;; FILLED
+;field2='HGT'		;; CONTOURED
+winds=['U','V']		;; VECTORS
+topo=1
+
+
+;;; VORTICITY
+;field1='HGT' & winds=['U','V'] & topo=1
+
+
+;----------------------------------
+;----------------------------------
+; what kind of plot do you want ? 
+;----------------------------------
+;----------------------------------
+
+;; first is 1
+plot='map' & level=zeremplace	
+;plot='meridional' & nlon=89
+;plot='zonal' & nlat=66
+
+
+;---------;
+; special ;
+;---------;
+;;; SEA-LEVEL PRESSURE
+;field1='PSFC' & winds=['tk','HGT'] & topo=1 & plot='map' & level=7
+;;; HORIZONTAL WIND VELOCITY
+;field1='U' & winds=['U','V'] & topo=1 & plot='map' & level=9
+
+useidlfile='true' ;; if you are just changing what is below...
+extract='no' ;; SPECIFIC FOR ATLAS
+
+
+;----------------------------
+;----------------------------
+; change plot settings 
+;----------------------------
+;----------------------------
+
+;; uncomment to modify default plot settings
+;; | | | | | | | | | | | | | | | | | | | | |
+;; v v v v v v v v v v v v v v v v v v v v v
+
+;;;
+;;; PLOT TITLES
+;;;
+;subtitle_user='-- LMD Martian Mesoscale Model --'            ;; grepALL
+;title_user='Vertical Wind (!Nm!N.s!U-1!N)'     ;; grepALL
+;title_axis=['x coord (km)','y coord (km)']     ;; grepALL
+
+;;;
+;;; COLOR TABLES
+;;;
+;flag_cb='false'                ;; grepALL
+;format='(F4.1)'                  ;; grepALL
+;colors=128                      ;; grepALL
+;pal=39                          ;; grepALL
+;; GOOD COLOR TABLES: 4, 18, 22, 16, 37, 33, 39
+
+;;;
+;;; FILL LIMITS
+;;;
+minfield_init= 00.      ;; grepALL
+maxfield_init= 25.  	;; grepALL
+
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max ;; grepALL
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min ;; grepALL
+;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value ;; grepALL
+
+;;;
+;;; WINDS
+;;;
+windex=20.      ;; grepALL
+stride=1.       ;; grepALL
+
+;;;
+;;; CONTOUR
+;;;
+;overcontour=overcontour-mean(overcontour)      ;; grepALL
+lev=-10. + 0.5*findgen(50) ;; grepALL
+
+;;;
+;;; AXIS
+;;;
+;isotropic='false'       ;; grepALL
+intervalx=0.5            ;; grepALL
+intervaly=0.5            ;; grepALL
+
+;;;
+;;; MAP LIMITS 
+;;;
+windowx=[-08.,-04.]       ;; grepMAP
+windowy=[-04.,00.]       ;; grepMAP
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-4.		;; grepSEC
+;maxalt=16.		;; grepSEC
+;minspace=-30.   	;; grepSEC
+;maxspace=0.   		;; grepSEC
+
+;;
+;; METRIC UNITS FOR VERTICAL SECTION
+;;
+;factor=20.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;; POUBELLE
+
+
+;; DEFAULT: ARWPOST.EXE ALREADY RUN (i.e. input.ctl and input.dat already there)
+;; UNCOMMENT FOLLOWING LINE TO EXTRACT FILES 
+;extract='yes'   ;;   EXECUTE ARWPOST.EXE
+                ;;   WITH THE FOLLOWING PARAMETERS :
+
+
+;@map_sea_level.idl
+;@map_ertel_vorticity.idl
+;field1='HGT'
+;field2='U'
+;winds=['U','V']
+;topo=1
+
+
+;winds=['U','V'] & field1='SWDOWN' & topo=1
+;winds=['V','W'] & field1='V' 
+;field1='ICETOT' & topo=1
+;field1='RAVE' & topo=1
+;field1='QH2O_ICE' & topo=1
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O' & field2='W'
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O_ICE' & field2='tk'
+;field1='tk' & topo=1
+;field1='V' & field2='V'
+;field1='W' & winds=['V','W']
+;field1='tk' & winds=['V','W']
+;field1='tk'
+;field1='W' & topo=1
+;field1='TSK' & topo=1
+;field1='U' & winds=['U','V'] & topo=1
+;winds=['V','W'] & field1='V'
+;winds=['V','W'] & field1='W'
+;field1='U' & winds=['U','V'] & topo=1
+;field1='HGT' & field2='HGT' 
+;field1='U' & winds=['U','V'] ;& topo=1
+;field1='PSFC' & winds=['U','V'] & field2='W'
+;field1='W' & winds=['U','V'] & field2='PSFC'
+;field1='TSURF' & topo=1 ;& winds=['U','V']
+;field1='T' & topo=1 & winds=['U','V']
+;field1='PSFC' & winds=['tk','HGT'] & topo=1
+;field1='tk' & topo=1
+;field1='tk' & winds=['U','V'] & topo=1
+;field1='T' & field2='T'
+;field1='T' & winds=['U','V'] 
+;field1='HGT' & winds=['HGT','HGT'] 
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-ellipse_web_map_model_level_W_HGT.def
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-ellipse_web_map_model_level_W_HGT.def	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-ellipse_web_map_model_level_W_HGT.def	(revision 207)
@@ -0,0 +1,267 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  -or- @report.idl
+;  -or- @movie.idl
+;
+;  this file will be saved !
+;
+;;---------------------------------------
+
+
+;-------------------------------------;
+; DATA LOCATION and PLOT DESTINATION  ;
+; default is ./                       ;
+;-------------------------------------;
+datafolder='/home/aslmd/MERIDIANI_EXOMARS'
+plotfolder=datafolder
+;; for web anim and tex report (default is 'plot')
+textitle='MERIDIANI_ellipse_MLzeremplace'
+texcomments='sol3'
+
+;;; load/save ARWpost-generated text files ? default is no
+;backup_data='yes'
+;already_data='yes'
+
+;-------------------------------
+;-------------------------------
+; namelist.ARWPOST parameters
+;-------------------------------
+;-------------------------------
+
+nam1=" fields = 'W,HGT' "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE FIELDS TO BE EXTRACTED 
+;; ex: tk,HGT,PSFC,U,V,W,T,tk,ICETOT,RAVE,QH2O_ICE,QH2O,PTOT,TSURF
+
+nam2=" start_date = '2024-03-21_00:00:00' " 
+nam3=" end_date   = '2024-03-22_00:00:00' "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE START/END DATE
+
+nam4=" interval_seconds = 3700 "		
+
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
+;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s, 12h: 44400s	
+
+;nam5=" interp_method = 1 "	
+nam5=" interp_method = 0 "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 		
+;; SET VERT. COORD. 0: eta levels, 1: height (inc) or pressure (dec)
+tabnam=[0.,50.,1.]
+;tabnam=[8., 9., 0.1]
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; SET HEIGHT/PRESSURE LEVELS WITH [first alt, last alt, step]
+
+;nest='d03'  
+;; ^ ^ ^ ^
+;; SET NEST
+
+
+
+;----------------------------------------------------
+;----------------------------------------------------
+; what do you want to plot ?
+; THIS MUST BE SET ACCORDINGLY TO PREVIOUS SECTION
+;   - do not plot a field not extracted
+;   - do not ask for more plot than data available
+;----------------------------------------------------
+;----------------------------------------------------
+
+num=24		   	;; how many plots ?
+
+
+field1='W'		;; FILLED
+;field2='HGT'		;; CONTOURED
+;winds=['U','V']	;; VECTORS
+topo=1
+
+
+;;; VORTICITY
+;field1='HGT' & winds=['U','V'] & topo=1
+
+
+;----------------------------------
+;----------------------------------
+; what kind of plot do you want ? 
+;----------------------------------
+;----------------------------------
+
+;; first is 1
+plot='map' & level=zeremplace	
+;plot='meridional' & nlon=89
+;plot='zonal' & nlat=66
+
+
+;---------;
+; special ;
+;---------;
+;;; SEA-LEVEL PRESSURE
+;field1='PSFC' & winds=['tk','HGT'] & topo=1 & plot='map' & level=7
+;;; HORIZONTAL WIND VELOCITY
+;field1='U' & winds=['U','V'] & topo=1 & plot='map' & level=9
+
+useidlfile='true' ;; if you are just changing what is below...
+extract='no' ;; SPECIFIC FOR ATLAS
+
+
+;----------------------------
+;----------------------------
+; change plot settings 
+;----------------------------
+;----------------------------
+
+;; uncomment to modify default plot settings
+;; | | | | | | | | | | | | | | | | | | | | |
+;; v v v v v v v v v v v v v v v v v v v v v
+
+;;;
+;;; PLOT TITLES
+;;;
+;subtitle_user='-- LMD Martian Mesoscale Model --'            ;; grepALL
+;title_user='Vertical Wind (!Nm!N.s!U-1!N)'     ;; grepALL
+;title_axis=['x coord (km)','y coord (km)']     ;; grepALL
+
+;;;
+;;; COLOR TABLES
+;;;
+;flag_cb='false'                ;; grepALL
+;format='(F4.1)'                  ;; grepALL
+;colors=128                      ;; grepALL
+;pal=39                          ;; grepALL
+;; GOOD COLOR TABLES: 4, 18, 22, 16, 37, 33, 39
+
+;;;
+;;; FILL LIMITS
+;;;
+minfield_init= -05.      ;; grepALL
+maxfield_init= 05.  	;; grepALL
+
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max ;; grepALL
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min ;; grepALL
+;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value ;; grepALL
+
+;;;
+;;; WINDS
+;;;
+windex=20.      ;; grepALL
+stride=1.       ;; grepALL
+
+;;;
+;;; CONTOUR
+;;;
+;overcontour=overcontour-mean(overcontour)      ;; grepALL
+lev=-10. + 0.5*findgen(50) ;; grepALL
+
+;;;
+;;; AXIS
+;;;
+;isotropic='false'       ;; grepALL
+intervalx=0.5            ;; grepALL
+intervaly=0.5            ;; grepALL
+
+;;;
+;;; MAP LIMITS 
+;;;
+windowx=[-08.,-04.]       ;; grepMAP
+windowy=[-04.,00.]       ;; grepMAP
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-4.		;; grepSEC
+;maxalt=16.		;; grepSEC
+;minspace=-30.   	;; grepSEC
+;maxspace=0.   		;; grepSEC
+
+;;
+;; METRIC UNITS FOR VERTICAL SECTION
+;;
+;factor=20.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;; POUBELLE
+
+
+;; DEFAULT: ARWPOST.EXE ALREADY RUN (i.e. input.ctl and input.dat already there)
+;; UNCOMMENT FOLLOWING LINE TO EXTRACT FILES 
+;extract='yes'   ;;   EXECUTE ARWPOST.EXE
+                ;;   WITH THE FOLLOWING PARAMETERS :
+
+
+;@map_sea_level.idl
+;@map_ertel_vorticity.idl
+;field1='HGT'
+;field2='U'
+;winds=['U','V']
+;topo=1
+
+
+;winds=['U','V'] & field1='SWDOWN' & topo=1
+;winds=['V','W'] & field1='V' 
+;field1='ICETOT' & topo=1
+;field1='RAVE' & topo=1
+;field1='QH2O_ICE' & topo=1
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O' & field2='W'
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O_ICE' & field2='tk'
+;field1='tk' & topo=1
+;field1='V' & field2='V'
+;field1='W' & winds=['V','W']
+;field1='tk' & winds=['V','W']
+;field1='tk'
+;field1='W' & topo=1
+;field1='TSK' & topo=1
+;field1='U' & winds=['U','V'] & topo=1
+;winds=['V','W'] & field1='V'
+;winds=['V','W'] & field1='W'
+;field1='U' & winds=['U','V'] & topo=1
+;field1='HGT' & field2='HGT' 
+;field1='U' & winds=['U','V'] ;& topo=1
+;field1='PSFC' & winds=['U','V'] & field2='W'
+;field1='W' & winds=['U','V'] & field2='PSFC'
+;field1='TSURF' & topo=1 ;& winds=['U','V']
+;field1='T' & topo=1 & winds=['U','V']
+;field1='PSFC' & winds=['tk','HGT'] & topo=1
+;field1='tk' & topo=1
+;field1='tk' & winds=['U','V'] & topo=1
+;field1='T' & field2='T'
+;field1='T' & winds=['U','V'] 
+;field1='HGT' & winds=['HGT','HGT'] 
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-web_map_model_level_U_HGT_UV.def
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-web_map_model_level_U_HGT_UV.def	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-web_map_model_level_U_HGT_UV.def	(revision 207)
@@ -0,0 +1,267 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  -or- @report.idl
+;  -or- @movie.idl
+;
+;  this file will be saved !
+;
+;;---------------------------------------
+
+
+;-------------------------------------;
+; DATA LOCATION and PLOT DESTINATION  ;
+; default is ./                       ;
+;-------------------------------------;
+datafolder='/home/aslmd/MERIDIANI_EXOMARS'
+plotfolder=datafolder
+;; for web anim and tex report (default is 'plot')
+textitle='MERIDIANI_MLzeremplace'
+texcomments='sol3'
+
+;;; load/save ARWpost-generated text files ? default is no
+;backup_data='yes'
+;already_data='yes'
+
+;-------------------------------
+;-------------------------------
+; namelist.ARWPOST parameters
+;-------------------------------
+;-------------------------------
+
+nam1=" fields = 'U,V,HGT' "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE FIELDS TO BE EXTRACTED 
+;; ex: tk,HGT,PSFC,U,V,W,T,tk,ICETOT,RAVE,QH2O_ICE,QH2O,PTOT,TSURF
+
+nam2=" start_date = '2024-03-21_00:00:00' " 
+nam3=" end_date   = '2024-03-22_00:00:00' "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE START/END DATE
+
+nam4=" interval_seconds = 3700 "		
+
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
+;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s, 12h: 44400s	
+
+;nam5=" interp_method = 1 "	
+nam5=" interp_method = 0 "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 		
+;; SET VERT. COORD. 0: eta levels, 1: height (inc) or pressure (dec)
+tabnam=[0.,50.,1.]
+;tabnam=[8., 9., 0.1]
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; SET HEIGHT/PRESSURE LEVELS WITH [first alt, last alt, step]
+
+;nest='d03'  
+;; ^ ^ ^ ^
+;; SET NEST
+
+
+
+;----------------------------------------------------
+;----------------------------------------------------
+; what do you want to plot ?
+; THIS MUST BE SET ACCORDINGLY TO PREVIOUS SECTION
+;   - do not plot a field not extracted
+;   - do not ask for more plot than data available
+;----------------------------------------------------
+;----------------------------------------------------
+
+num=24		   	;; how many plots ?
+
+
+field1='U'		;; FILLED
+;field2='HGT'		;; CONTOURED
+winds=['U','V']		;; VECTORS
+topo=1
+
+
+;;; VORTICITY
+;field1='HGT' & winds=['U','V'] & topo=1
+
+
+;----------------------------------
+;----------------------------------
+; what kind of plot do you want ? 
+;----------------------------------
+;----------------------------------
+
+;; first is 1
+plot='map' & level=zeremplace	
+;plot='meridional' & nlon=89
+;plot='zonal' & nlat=66
+
+
+;---------;
+; special ;
+;---------;
+;;; SEA-LEVEL PRESSURE
+;field1='PSFC' & winds=['tk','HGT'] & topo=1 & plot='map' & level=7
+;;; HORIZONTAL WIND VELOCITY
+;field1='U' & winds=['U','V'] & topo=1 & plot='map' & level=9
+
+useidlfile='false' ;; if you are just changing what is below...
+extract='no' ;; SPECIFIC FOR ATLAS
+
+
+;----------------------------
+;----------------------------
+; change plot settings 
+;----------------------------
+;----------------------------
+
+;; uncomment to modify default plot settings
+;; | | | | | | | | | | | | | | | | | | | | |
+;; v v v v v v v v v v v v v v v v v v v v v
+
+;;;
+;;; PLOT TITLES
+;;;
+;subtitle_user='-- LMD Martian Mesoscale Model --'            ;; grepALL
+;title_user='Vertical Wind (!Nm!N.s!U-1!N)'     ;; grepALL
+;title_axis=['x coord (km)','y coord (km)']     ;; grepALL
+
+;;;
+;;; COLOR TABLES
+;;;
+;flag_cb='false'                ;; grepALL
+;format='(F4.1)'                  ;; grepALL
+;colors=128                      ;; grepALL
+;pal=39                          ;; grepALL
+;; GOOD COLOR TABLES: 4, 18, 22, 16, 37, 33, 39
+
+;;;
+;;; FILL LIMITS
+;;;
+minfield_init= 00.      ;; grepALL
+maxfield_init= 25.  	;; grepALL
+
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max ;; grepALL
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min ;; grepALL
+;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value ;; grepALL
+
+;;;
+;;; WINDS
+;;;
+windex=20.	;; grepALL
+stride=5.	;; grepALL
+
+;;;
+;;; CONTOUR
+;;;
+;overcontour=overcontour-mean(overcontour)	;; grepALL
+lev=-10. + 0.5*findgen(50) ;; grepALL
+
+;;;
+;;; AXIS
+;;;
+;isotropic='false'       ;; grepALL
+intervalx=2.0            ;; grepALL
+intervaly=2.0             ;; grepALL
+
+;;;
+;;; MAP LIMITS 
+;;;
+windowx=[-20.,08.]       ;; grepMAP
+windowy=[-16.,12.]       ;; grepMAP
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-4.		;; grepSEC
+;maxalt=16.		;; grepSEC
+;minspace=-30.   	;; grepSEC
+;maxspace=0.   		;; grepSEC
+
+;;
+;; METRIC UNITS FOR VERTICAL SECTION
+;;
+;factor=20.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;; POUBELLE
+
+
+;; DEFAULT: ARWPOST.EXE ALREADY RUN (i.e. input.ctl and input.dat already there)
+;; UNCOMMENT FOLLOWING LINE TO EXTRACT FILES 
+;extract='yes'   ;;   EXECUTE ARWPOST.EXE
+                ;;   WITH THE FOLLOWING PARAMETERS :
+
+
+;@map_sea_level.idl
+;@map_ertel_vorticity.idl
+;field1='HGT'
+;field2='U'
+;winds=['U','V']
+;topo=1
+
+
+;winds=['U','V'] & field1='SWDOWN' & topo=1
+;winds=['V','W'] & field1='V' 
+;field1='ICETOT' & topo=1
+;field1='RAVE' & topo=1
+;field1='QH2O_ICE' & topo=1
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O' & field2='W'
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O_ICE' & field2='tk'
+;field1='tk' & topo=1
+;field1='V' & field2='V'
+;field1='W' & winds=['V','W']
+;field1='tk' & winds=['V','W']
+;field1='tk'
+;field1='W' & topo=1
+;field1='TSK' & topo=1
+;field1='U' & winds=['U','V'] & topo=1
+;winds=['V','W'] & field1='V'
+;winds=['V','W'] & field1='W'
+;field1='U' & winds=['U','V'] & topo=1
+;field1='HGT' & field2='HGT' 
+;field1='U' & winds=['U','V'] ;& topo=1
+;field1='PSFC' & winds=['U','V'] & field2='W'
+;field1='W' & winds=['U','V'] & field2='PSFC'
+;field1='TSURF' & topo=1 ;& winds=['U','V']
+;field1='T' & topo=1 & winds=['U','V']
+;field1='PSFC' & winds=['tk','HGT'] & topo=1
+;field1='tk' & topo=1
+;field1='tk' & winds=['U','V'] & topo=1
+;field1='T' & field2='T'
+;field1='T' & winds=['U','V'] 
+;field1='HGT' & winds=['HGT','HGT'] 
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-web_map_model_level_W_HGT.def
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-web_map_model_level_W_HGT.def	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas-web_map_model_level_W_HGT.def	(revision 207)
@@ -0,0 +1,267 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  -or- @report.idl
+;  -or- @movie.idl
+;
+;  this file will be saved !
+;
+;;---------------------------------------
+
+
+;-------------------------------------;
+; DATA LOCATION and PLOT DESTINATION  ;
+; default is ./                       ;
+;-------------------------------------;
+datafolder='/home/aslmd/MERIDIANI_EXOMARS'
+plotfolder=datafolder
+;; for web anim and tex report (default is 'plot')
+textitle='atlasMERIDIANI_MLzeremplace'
+texcomments='sol3'
+
+;;; load/save ARWpost-generated text files ? default is no
+;backup_data='yes'
+;already_data='yes'
+
+;-------------------------------
+;-------------------------------
+; namelist.ARWPOST parameters
+;-------------------------------
+;-------------------------------
+
+nam1=" fields = 'W,HGT' "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE FIELDS TO BE EXTRACTED 
+;; ex: tk,HGT,PSFC,U,V,W,T,tk,ICETOT,RAVE,QH2O_ICE,QH2O,PTOT,TSURF
+
+nam2=" start_date = '2024-03-21_00:00:00' " 
+nam3=" end_date   = '2024-03-21_00:00:00' "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE START/END DATE
+
+nam4=" interval_seconds = 3700 "		
+
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
+;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s, 12h: 44400s	
+
+;nam5=" interp_method = 1 "	
+nam5=" interp_method = 0 "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 		
+;; SET VERT. COORD. 0: eta levels, 1: height (inc) or pressure (dec)
+tabnam=[0.,50.,1.]
+;tabnam=[8., 9., 0.1]
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; SET HEIGHT/PRESSURE LEVELS WITH [first alt, last alt, step]
+
+;nest='d03'  
+;; ^ ^ ^ ^
+;; SET NEST
+
+
+
+;----------------------------------------------------
+;----------------------------------------------------
+; what do you want to plot ?
+; THIS MUST BE SET ACCORDINGLY TO PREVIOUS SECTION
+;   - do not plot a field not extracted
+;   - do not ask for more plot than data available
+;----------------------------------------------------
+;----------------------------------------------------
+
+num=24		   	;; how many plots ?
+
+
+field1='W'		;; FILLED
+;field2='HGT'		;; CONTOURED
+;winds=['U','V']		;; VECTORS
+topo=1
+
+
+;;; VORTICITY
+;field1='HGT' & winds=['U','V'] & topo=1
+
+
+;----------------------------------
+;----------------------------------
+; what kind of plot do you want ? 
+;----------------------------------
+;----------------------------------
+
+;; first is 1
+plot='map' & level=zeremplace	
+;plot='meridional' & nlon=89
+;plot='zonal' & nlat=66
+
+
+;---------;
+; special ;
+;---------;
+;;; SEA-LEVEL PRESSURE
+;field1='PSFC' & winds=['tk','HGT'] & topo=1 & plot='map' & level=7
+;;; HORIZONTAL WIND VELOCITY
+;field1='U' & winds=['U','V'] & topo=1 & plot='map' & level=9
+
+useidlfile='false' ;; if you are just changing what is below...
+;extract='no' ;; SPECIFIC FOR ATLAS
+;extract='yes'
+
+;----------------------------
+;----------------------------
+; change plot settings 
+;----------------------------
+;----------------------------
+
+;; uncomment to modify default plot settings
+;; | | | | | | | | | | | | | | | | | | | | |
+;; v v v v v v v v v v v v v v v v v v v v v
+
+;;;
+;;; PLOT TITLES
+;;;
+;subtitle_user='-- LMD Martian Mesoscale Model --'            ;; grepALL
+;title_user='Vertical Wind (!Nm!N.s!U-1!N)'     ;; grepALL
+;title_axis=['x coord (km)','y coord (km)']     ;; grepALL
+
+;;;
+;;; COLOR TABLES
+;;;
+;flag_cb='false'                ;; grepALL
+;format='(F4.1)'                  ;; grepALL
+;colors=128                      ;; grepALL
+;pal=39                          ;; grepALL
+;; GOOD COLOR TABLES: 4, 18, 22, 16, 37, 33, 39
+
+;;;
+;;; FILL LIMITS
+;;;
+minfield_init= -05.      ;; grepALL
+maxfield_init=  05.  	;; grepALL
+
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max ;; grepALL
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min ;; grepALL
+;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value ;; grepALL
+
+;;;
+;;; WINDS
+;;;
+windex=20.	;; grepALL
+stride=5.	;; grepALL
+
+;;;
+;;; CONTOUR
+;;;
+;overcontour=overcontour-mean(overcontour)	;; grepALL
+lev=-10. + 0.5*findgen(50) ;; grepALL
+
+;;;
+;;; AXIS
+;;;
+;isotropic='false'       ;; grepALL
+intervalx=2.0            ;; grepALL
+intervaly=2.0             ;; grepALL
+
+;;;
+;;; MAP LIMITS 
+;;;
+windowx=[-20.,08.]       ;; grepMAP
+windowy=[-16.,12.]       ;; grepMAP
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-4.		;; grepSEC
+;maxalt=16.		;; grepSEC
+;minspace=-30.   	;; grepSEC
+;maxspace=0.   		;; grepSEC
+
+;;
+;; METRIC UNITS FOR VERTICAL SECTION
+;;
+;factor=20.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;; POUBELLE
+
+
+;; DEFAULT: ARWPOST.EXE ALREADY RUN (i.e. input.ctl and input.dat already there)
+;; UNCOMMENT FOLLOWING LINE TO EXTRACT FILES 
+;extract='yes'   ;;   EXECUTE ARWPOST.EXE
+                ;;   WITH THE FOLLOWING PARAMETERS :
+
+
+;@map_sea_level.idl
+;@map_ertel_vorticity.idl
+;field1='HGT'
+;field2='U'
+;winds=['U','V']
+;topo=1
+
+
+;winds=['U','V'] & field1='SWDOWN' & topo=1
+;winds=['V','W'] & field1='V' 
+;field1='ICETOT' & topo=1
+;field1='RAVE' & topo=1
+;field1='QH2O_ICE' & topo=1
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O' & field2='W'
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O_ICE' & field2='tk'
+;field1='tk' & topo=1
+;field1='V' & field2='V'
+;field1='W' & winds=['V','W']
+;field1='tk' & winds=['V','W']
+;field1='tk'
+;field1='W' & topo=1
+;field1='TSK' & topo=1
+;field1='U' & winds=['U','V'] & topo=1
+;winds=['V','W'] & field1='V'
+;winds=['V','W'] & field1='W'
+;field1='U' & winds=['U','V'] & topo=1
+;field1='HGT' & field2='HGT' 
+;field1='U' & winds=['U','V'] ;& topo=1
+;field1='PSFC' & winds=['U','V'] & field2='W'
+;field1='W' & winds=['U','V'] & field2='PSFC'
+;field1='TSURF' & topo=1 ;& winds=['U','V']
+;field1='T' & topo=1 & winds=['U','V']
+;field1='PSFC' & winds=['tk','HGT'] & topo=1
+;field1='tk' & topo=1
+;field1='tk' & winds=['U','V'] & topo=1
+;field1='T' & field2='T'
+;field1='T' & winds=['U','V'] 
+;field1='HGT' & winds=['HGT','HGT'] 
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas_U_HGT_UV.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas_U_HGT_UV.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/atlas2/atlas_U_HGT_UV.pro	(revision 207)
@@ -0,0 +1,173 @@
+;;
+;; ATLAS EXOMARS STUDY
+;;
+
+zelevel='2'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-web_map_model_level_U_HGT_UV.def'   ;; event. modifier si on ne veut pas recalculer les .idl
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='2'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-closer_web_map_model_level_U_HGT_UV.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='2'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-ellipse_web_map_model_level_U_HGT_UV.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;
+SPAWN, 'mkdir zefolder/idl_save_2 ; mv zefolder/*.idl zefolder/idl_save_2/'
+;
+
+zelevel='4'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-web_map_model_level_U_HGT_UV.def'   ;; event. modifier si on ne veut pas recalculer les .idl
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='4'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-closer_web_map_model_level_U_HGT_UV.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='4'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-ellipse_web_map_model_level_U_HGT_UV.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;
+SPAWN, 'mkdir zefolder/idl_save_4 ; mv zefolder/*.idl zefolder/idl_save_4/'
+;
+
+zelevel='6'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-web_map_model_level_U_HGT_UV.def'   ;; event. modifier si on ne veut pas recalculer les .idl
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='6'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-closer_web_map_model_level_U_HGT_UV.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='6'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-ellipse_web_map_model_level_U_HGT_UV.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;
+SPAWN, 'mkdir zefolder/idl_save_6 ; mv zefolder/*.idl zefolder/idl_save_6/'
+;
+
+zelevel='7'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-web_map_model_level_U_HGT_UV.def'   ;; event. modifier si on ne veut pas recalculer les .idl
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='7'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-closer_web_map_model_level_U_HGT_UV.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='7'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-ellipse_web_map_model_level_U_HGT_UV.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;
+SPAWN, 'mkdir zefolder/idl_save_7 ; mv zefolder/*.idl zefolder/idl_save_7/'
+;
+
+zelevel='8'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-web_map_model_level_U_HGT_UV.def'   ;; event. modifier si on ne veut pas recalculer les .idl
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='8'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-closer_web_map_model_level_U_HGT_UV.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='8'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-ellipse_web_map_model_level_U_HGT_UV.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;
+SPAWN, 'mkdir zefolder/idl_save_8 ; mv zefolder/*.idl zefolder/idl_save_8/'
+;
+
+zelevel='18'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-web_map_model_level_U_HGT_UV.def'   ;; event. modifier si on ne veut pas recalculer les .idl
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='18'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-closer_web_map_model_level_U_HGT_UV.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+zelevel='18'
+zeatlas='/home/aslmd/MERIDIANI_EXOMARS/atlas-ellipse_web_map_model_level_U_HGT_UV.def'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, "ln -sf "+zeatlas+" atlas.def ; \rm gw.def ; sed s:'zeremplace':'"+zelevel+"':g atlas.def > gw.def"
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;
+SPAWN, 'mkdir zefolder/idl_save_18 ; mv zefolder/*.idl zefolder/idl_save_18/'
+;
+
+exit
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/base
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/base	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/base	(revision 207)
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+echo 'type the title'
+read title
+echo 'type the caption'
+read caption
+
+quality=100
+
+
+rm -rf basefig
+mkdir basefig
+cd basefig
+cp ../base.eps fig1.eps
+cp ../base.eps fig2.eps
+cp ../base.eps fig3.eps
+cp ../base.eps fig4.eps
+cp ../base.eps fig5.eps
+cp ../base.eps fig6.eps
+cd ..
+
+convert -density ${quality}x${quality} -crop 0x0 $1 basefig/fig1.eps
+echo 'converted 1'
+
+convert -density ${quality}x${quality} -crop 0x0 $2 basefig/fig2.eps
+echo 'converted 2'
+
+convert -density ${quality}x${quality} -crop 0x0 $3 basefig/fig3.eps
+echo 'converted 3'
+
+convert -density ${quality}x${quality} -crop 0x0 $4 basefig/fig4.eps
+echo 'converted 4'
+
+convert -density ${quality}x${quality} -crop 0x0 $5 basefig/fig5.eps
+echo 'converted 5'
+
+convert -density ${quality}x${quality} -crop 0x0 $6 basefig/fig6.eps
+echo 'converted 6'
+
+echo $7
+
+sed s/thetitle/${title}/g basefig.tex | sed s/thecaption/${caption}/g > basefig_temp.tex 
+sed s/basefig/basefig_temp/g base.tex > base_temp.tex
+latex base_temp.tex > base_temp.tmp 
+
+mv -f base_temp.dvi base.dvi
+
+\rm base_temp*
+\rm basefig_temp.tex
+
+dvips -o base.ps base.dvi 
+
+xdvi base.dvi 
+\rm base.dvi
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/base.tex
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/base.tex	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/base.tex	(revision 207)
@@ -0,0 +1,55 @@
+\documentclass[10pt,twoside,a4paper]{report}
+                                                                            
+% Packages
+\usepackage[french]{babel}   % pour dire que le texte est en français
+\usepackage{a4}              % pour la taille
+\usepackage[T1]{fontenc}     % pour les font postscript
+\usepackage{epsfig}          % pour gérer les images
+\usepackage{psfig}
+\usepackage{graphicx}
+\usepackage{amsmath, amsthm} % très bon mode mathématique
+\usepackage{amsfonts,amssymb}% permet la definition des ensembles
+\usepackage{float}           % pour le placement des figure
+% \usepackage{pslatex}       % évite un affichage laid à l'écran
+% Style bibliographique
+\bibliographystyle{plain}
+% Definitions de nouvelles commandes
+%\newcommand{\N}{\mathbb{N}} % les entiers naturels
+                                                                                                         
+% Titre
+\title{Titre}
+                                                                                
+\author{Aymeric Spiga\footnote{Contact : aymeric.spiga@m4x.org}\\
+\\
+\\
+Resultats\\
+   \\
+    \\
+\\
+Sous la direction de François Forget\\
+\\
+Laboratoire de M\'et\'eorologie Dynamique du CNRS\\
+\\
+\\}
+                                                                                
+                                                                                
+%============================= Corps =================================
+
+\begin{document}
+                                                                                
+%\maketitle            % écrit le titre
+%\thispagestyle{empty}
+                                                                                
+                                                                                
+%\tableofcontents      % écrit la table des matières
+%\thispagestyle{empty}
+
+\input{basefig.tex}
+
+% Bibliographie
+%\section*{Annexe 2}
+%\input{biba.tex}
+
+
+\end{document}
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/basefig.tex
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/basefig.tex	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/basefig.tex	(revision 207)
@@ -0,0 +1,28 @@
+\section*{
+thetitle
+}
+                                                         
+\begin{figure}[!h]
+\centerline{
+\epsfig {file=basefig/fig1.eps,width=9cm}
+\hfill
+\epsfig {file=basefig/fig2.eps,width=9cm}
+}
+\centerline{ 
+\epsfig {file=basefig/fig3.eps,width=9cm}   
+\hfill
+\epsfig {file=basefig/fig4.eps,width=9cm}
+}
+\centerline{
+\epsfig {file=basefig/fig5.eps,width=9cm}
+\hfill
+\epsfig {file=basefig/fig6.eps,width=9cm}
+}
+\caption{
+thecaption
+}
+\end{figure}
+                                                                                
+                                                         
+                                                         
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/bigconvert100
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/bigconvert100	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/bigconvert100	(revision 207)
@@ -0,0 +1,9 @@
+#!/bin/csh
+# f. forget
+foreach i ( $* )
+    echo $1
+    set name = `echo $1 | sed -e 's/\./ /' `
+    echo $name[1].png
+   convert -antialias -density 100x100 -crop 0x0 $1 $name[1].png
+   shift
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/bigconvert200
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/bigconvert200	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/bigconvert200	(revision 207)
@@ -0,0 +1,10 @@
+#!/bin/csh
+# f. forget
+foreach i ( $* )
+    echo $1
+    set name = `echo $1 | sed -e 's/\./ /' `
+    echo $name[1].png
+#   convert -antialias -density 200x200 -crop 0x0 $1 $name[1].png
+gs -sDEVICE=png16m -dTextAlphaBits=4 -sOutputFile=$name[1].png -dNOPAUSE -dBATCH -dEPSCrop -r300x300 $1
+   shift
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/body.html
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/body.html	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/body.html	(revision 207)
@@ -0,0 +1,365 @@
+//**************************************************************************
+ 
+//=== THE CODE STARTS HERE - no need to change anything below ===
+ 
+//=== global variables ====
+theImages = new Array();      //holds the images
+imageNum = new Array();       //keeps track of which images to omit from loop
+normal_delay = 1000;
+delay = normal_delay;         //delay between frames in 1/100 seconds
+delay_step = 50;
+delay_max = 6000;
+delay_min = 50;
+dwell_multipler = 3;
+dwell_step = 1;
+end_dwell_multipler   = dwell_multipler;
+start_dwell_multipler = dwell_multipler;
+current_image = first_image;     //number of the current image
+timeID = null;
+status = 0;                      // 0-stopped, 1-playing
+play_mode = 0;                   // 0-normal, 1-loop, 2-sweep
+size_valid = 0;
+ 
+//===> Make sure the first image number is not bigger than the last image number
+if (first_image > last_image)
+{
+   var help = last_image;
+   last_image = first_image;
+   first_image = help;
+}
+ 
+//===> Preload the first image (while page is downloading)
+   theImages[0] = new Image();
+   theImages[0].src = modImages[0];
+   imageNum[0] = true;
+ 
+//==============================================================
+//== All previous statements are performed as the page loads. ==
+//== The following functions are also defined at this time.   ==
+//==============================================================
+ 
+//===> Stop the animation
+function stop()
+{
+   //== cancel animation (timeID holds the expression which calls the fwd or bkwd function) ==
+   if (status == 1)
+      clearTimeout (timeID);
+   status = 0;
+}
+ 
+ 
+//===> Display animation in fwd direction in either loop or sweep mode
+function animate_fwd()
+{
+   current_image++;                      //increment image number
+ 
+   //== check if current image has exceeded loop bound ==
+   if (current_image > last_image) {
+      if (play_mode == 1) {              //fwd loop mode - skip to first image
+         current_image = first_image;
+      }
+      if (play_mode == 2) {              //sweep mode - change directions (go bkwd)
+         current_image = last_image;
+         animate_rev();
+         return;
+      }
+   }
+ 
+   //== check to ensure that current image has not been deselected from the loop ==
+   //== if it has, then find the next image that hasn't been ==
+   while (imageNum[current_image-first_image] == false) {
+         current_image++;
+         if (current_image > last_image) {
+            if (play_mode == 1)
+               current_image = first_image;
+            if (play_mode == 2) {
+               current_image = last_image;
+               animate_rev();
+               return;
+            }
+         }
+   }
+ 
+   document.animation.src = theImages[current_image-first_image].src;   //display image onto screen
+   document.control_form.frame_nr.value = current_image;                //display image number
+
+   delay_time = delay;
+   if ( current_image == first_image) delay_time = start_dwell_multipler*delay;
+   if (current_image == last_image)   delay_time = end_dwell_multipler*delay;
+ 
+   //== call "animate_fwd()" again after a set time (delay_time) has elapsed ==
+   timeID = setTimeout("animate_fwd()", delay_time);
+}
+ 
+ 
+//===> Display animation in reverse direction
+function animate_rev()
+{
+   current_image--;                      //decrement image number
+ 
+   //== check if image number is before lower loop bound ==
+   if (current_image < first_image) {
+     if (play_mode == 1) {               //rev loop mode - skip to last image
+        current_image = last_image;
+     }
+     if (play_mode == 2) {
+        current_image = first_image;     //sweep mode - change directions (go fwd)
+        animate_fwd();
+        return;
+     }
+   }
+ 
+   //== check to ensure that current image has not been deselected from the loop ==
+   //== if it has, then find the next image that hasn't been ==
+   while (imageNum[current_image-first_image] == false) {
+         current_image--;
+         if (current_image < first_image) {
+            if (play_mode == 1)
+               current_image = last_image;
+            if (play_mode == 2) {
+               current_image = first_image;
+               animate_fwd();
+               return;
+            }
+         }
+   }
+ 
+   document.animation.src = theImages[current_image-first_image].src;   //display image onto screen
+   document.control_form.frame_nr.value = current_image;                //display image number
+
+   delay_time = delay;
+   if ( current_image == first_image) delay_time = start_dwell_multipler*delay;
+   if (current_image == last_image)   delay_time = end_dwell_multipler*delay;
+ 
+   //== call "animate_rev()" again after a set amount of time (delay_time) has elapsed ==
+   timeID = setTimeout("animate_rev()", delay_time);
+}
+ 
+ 
+//===> Changes playing speed by adding to or substracting from the delay between frames
+function change_speed(dv)
+{
+   delay+=dv;
+   //== check to ensure max and min delay constraints have not been crossed ==
+   if(delay > delay_max) delay = delay_max;
+   if(delay < delay_min) delay = delay_min;
+}
+ 
+//===> functions that changed the dwell rates.
+function change_end_dwell(dv) {
+   end_dwell_multipler+=dv;
+   if ( end_dwell_multipler < 1 ) end_dwell_multipler = 0;
+   }
+ 
+function change_start_dwell(dv) {
+   start_dwell_multipler+=dv;
+   if ( start_dwell_multipler < 1 ) start_dwell_multipler = 0;
+   }
+ 
+//===> Increment to next image
+function incrementImage(number)
+{
+   stop();
+ 
+   //== if image is last in loop, increment to first image ==
+   if (number > last_image) number = first_image;
+ 
+   //== check to ensure that image has not been deselected from loop ==
+   while (imageNum[number-first_image] == false) {
+         number++;
+         if (number > last_image) number = first_image;
+   }
+ 
+   current_image = number;
+   document.animation.src = theImages[current_image-first_image].src;   //display image
+   document.control_form.frame_nr.value = current_image;                //display image number
+}
+ 
+//===> Decrement to next image
+function decrementImage(number)
+{
+   stop();
+ 
+   //== if image is first in loop, decrement to last image ==
+   if (number < first_image) number = last_image;
+ 
+   //== check to ensure that image has not been deselected from loop ==
+   while (imageNum[number-first_image] == false) {
+         number--;
+         if (number < first_image) number = last_image;
+   }
+ 
+   current_image = number;
+   document.animation.src = theImages[current_image-first_image].src;   //display image
+   document.control_form.frame_nr.value = current_image;                //display image number
+}
+ 
+//===> "Play forward"
+function fwd()
+{
+   stop();
+   status = 1;
+   play_mode = 1;
+   animate_fwd();
+}
+ 
+//===> "Play reverse"
+function rev()
+{
+   stop();
+   status = 1;
+   play_mode = 1;
+   animate_rev();
+}
+
+//===> "play sweep"
+function sweep() {
+   stop();
+   status = 1;
+   play_mode = 2;
+   animate_fwd();
+   }
+ 
+//===> Change play mode (normal, loop, swing)
+function change_mode(mode)
+{
+   play_mode = mode;
+}
+ 
+//===> Load and initialize everything once page is downloaded (called from 'onLoad' in <BODY>)
+function launch()
+{
+   for (var i = first_image + 1; i <= last_image; i++)
+   {
+      theImages[i-first_image] = new Image();
+      theImages[i-first_image].src = modImages[i-first_image];
+      imageNum[i-first_image] = true;
+      document.animation.src = theImages[i-first_image].src;
+      document.control_form.frame_nr.value = i;
+   }
+ 
+   // this needs to be done to set the right mode when the page is manually reloaded
+   change_mode (1);
+   fwd();
+}
+ 
+//===> Check selection status of image in animation loop
+function checkImage(status,i)
+{
+   if (status == true)
+      imageNum[i] = false;
+   else imageNum[i] = true;
+}
+ 
+//==> Empty function - used to deal with image buttons rather than HTML buttons
+function func()
+{
+}
+ 
+//===> Sets up interface - this is the one function called from the HTML body
+function animation()
+{
+  count = first_image;
+}
+ 
+// -->
+
+function MM_jumpMenu(targ,selObj,restore){ //v3.0
+  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
+  if (restore) selObj.selectedIndex=0;
+}
+//-->
+</SCRIPT>
+
+<link href="animate_styles.css" rel="stylesheet" type="text/css">
+</head>
+
+<body bgcolor="#FFFFFF" onLoad="launch()">
+
+
+
+<table border=1 align=center cellpadding=3 cellspacing=0 id="frame">
+
+<tr>
+
+<td valign="top" id="leftnav">
+    
+<!--
+
+	<h1>Frame Controls</h1>
+     <p>Choose another forecast:</p>
+                   
+		<form name="form1" method="post" action="">
+     <p>
+        <select name="menu1" onChange="MM_jumpMenu('parent',this,1)">
+
+<option value="none.html" selected>  </option>
+<option value="none.html">  </option>
+
+</select>                                           
+</p>
+</form>
+
+--!>
+
+
+<p>Play Mode:<br><br>
+    <a href="JavaScript: func()" onClick="change_mode(1);rev()">
+    <img border=0 hspace=0 vspace=0 width=29 height=24 src="images/button_rev.png" alt="+1"></a>
+    <a href="JavaScript: func()" onClick="stop()">
+    <img border=0 hspace=0 vspace=0 width=29 height=24 src="images/button_stop.png" alt="+1"></a>
+
+    <a href="JavaScript: func()" onClick="change_mode(1);fwd()">
+    <img border=0 hspace=0 vspace=0 width=29 height=24 src="images/button_fwd.png" alt="+1"></a>
+		</p>
+				     					
+		<p>Adjust Speed:<br><br>
+    <a href="JavaScript: func()" onClick="change_speed(delay_step)">
+    <img border=0 hspace=0 vspace=0 width=29 height=24 src="images/button_slow.png" alt="+1"></a>
+	  <a href="JavaScript: func()" onClick="change_speed(-delay_step)">
+		<img border=0 hspace=0 vspace=0 width=29 height=24 src="images/button_fast.png" alt="+1"></a>
+
+    </p>
+
+
+		<p>Advance One Frame:<br><br>
+		<a href="JavaScript: func()" onClick="decrementImage(--current_image)">
+		<img border=0 hspace=0 vspace=0 width=29 height=24 src="images/button_rev1.png" alt="+1"></a>
+		<a href="JavaScript: func()" onClick="incrementImage(++current_image)">
+		<img border=0 hspace=0 vspace=0 width=29 height=24 src="images/button_fwd1.png" alt="+1"></a>
+		</p>
+
+
+		<form method="post" name="control_form">
+
+    <p>Frame No:</p>
+    <p>
+       <input type="text" name="frame_nr" value="9" size="2" onFocus="this.select()" onChange="go2image(this.value)"></input>
+       <br /> &#160; <br />
+    </p>
+
+    </form>   				     
+   <p><A HREF="http://www.lmd.jussieu.fr/~aslmd">Back</A><br /><br />
+      <A HREF="http://dl.dropbox.com/u/11078310/my_papers/spiga_jgr_SF09.pdf">About the LMD Mesoscale Model</A></a><br /><br />
+<!--      <A HREF="http://www-mars.lmd.jussieu.fr/mars/publi/jgr99_gcm.pdf">About the LMD physics parameterizations</A></a><br /><br />	
+      <A HREF="http://www.mmm.ucar.edu/people/skamarock/jcp_2007.pdf">About the WRF dynamical core</A></a><br /><br />--!>
+      <A HREF="http://www-mars.lmd.jussieu.fr">Mars Climate Database</A></a><br /><br />
+   </p>
+</td>
+
+						<td valign="top" id="content">
+<!--
+						<h1>LMD Martian Mesoscale Model</h1>
+--!>
+
+
+             <!--<p><img WIDTH="525" name="animation" border="0" src="images/loading.gif" ALT="model image">--!>
+             <p><img WIDTH="725" name="animation" border="0" src="images/loading.gif" ALT="model image">
+</p>
+</tr>
+</table>
+
+
+</body>
+</html>
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/colorbar__define.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/colorbar__define.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/colorbar__define.pro	(revision 207)
@@ -0,0 +1,666 @@
+;+
+; NAME:
+;       COLORBAR__DEFINE
+;
+; PURPOSE:
+;       The purpose of this routine is to implement a COLORBAR object
+;       class. The ColorBar is rendered in the direct graphics system.
+;
+; AUTHOR:
+;       FANNING SOFTWARE CONSULTING
+;       David Fanning, Ph.D.
+;       1645 Sheely Drive
+;       Fort Collins, CO 80526 USA
+;       Phone: 970-221-0438
+;       E-mail: davidf@dfanning.com
+;       Coyote's Guide to IDL Programming: http://www.dfanning.com
+;
+; CATEGORY:
+;       Graphics.
+;
+; CALLING SEQUENCE:
+;       colorbar = Obj_New("COLORBAR")
+;
+; INPUTS:
+;       All inputs to the program are via keyword parameters.
+;
+; KEYWORD PARAMETERS:
+;
+;   Background: Background color. This is the color with which the colorbar is
+;               erased. The default color is !P.Background.
+;   Bottom: Bottom color index of colors allocated to colorbar.
+;   Charsize: Character size of annotation. Default is 1.0.
+;   Color: Color of annotation and outline. Default is !P.Color.
+;   Font: Font to use for annotation. Default is -1, Hershey fonts.
+;   Format: Format of annotation. Default is "(F8.2)".
+;   Major: The number of major tick intervals. Default is 5.
+;   Minor: The number of minor tick intervals. Default is 2.
+;   MinusOne: Set this keyword to choose MinusOne keyword on the Congrid command
+;               that resizes the colorbar into the window.
+;   NColors: The number of colors allocated to colorbar. Default is (256 <
+;            !D.N_Colors).
+;   Neighbor: Set to indicate Nearest Neighbor sampling for Congrid. Default is
+;             0 (Bilinear).
+;   Position: The position of colorbar in normalized coordinates. Default for a
+;             horizontal colorbar is [0.15, 0.88, 0.85, 0.95]. Default for a
+;             vertical colorbar is [0.88, 0.15, 0.95, 0.85]. These defaults are
+;             designed for a 400 by 400 window.
+;   Range: The data range on colorbar. Default is [0, 255].
+;   TickLen: The length of tick marks. Default is -0.1
+;   TickV:   Locations for the tick marks in data units. This is the same as
+;            the [XY]TickV keyword. Default is to do what IDL would do
+;            normally.
+;   Vertical: Set this keyword if you want a vertical colorbar. Default is
+;             horizontal.
+;   XEraseBox: A five-element vector of X points (normalized) for erasing the
+;              colorbar plot. Normally this keyword will not have to be used.
+;              The program uses the plot REGION for erasing. But larger
+;              character sizes can result in annotation going outside the
+;              region enclosed by the plot. If that is the case, then use this
+;              keyword along with YEraseBox to specify a larger-than-normal
+;              erasure area. The points are sent to the POLYFILL command for
+;              erasing.
+;
+;                 POLYFILL, xEraseBox, yEraseBox, /Normal, Color=background
+;
+;   YEraseBox: A five-element vector of Y points (normalized) for erasing the
+;              colorbar plot.
+;
+; OBJECT METHODS:
+;
+;   Clamp: This procedure method allows the color bar range to be "clamped"
+;          to a particular data range.
+;
+;   Draw: This procedure method draws the colorbar in the display window. The
+;         ERASE keyword to this method will erase the current colorbar (by
+;         calling the ERASE method) before drawing the colorbar in the display
+;         window.
+;
+;               colorbar->Draw
+;
+;   Erase: This procedure method erases the colorbar object in the window. It
+;          accomplishes this by performing a POLYFILL in the background color.
+;          This method is primarily useful for interactive graphics display
+;          devices.
+;               colorbar->Erase
+;
+;   GetProperty: This procedure method allows one to obtain the current state
+;                of the object via the keyword parameters listed above.
+;
+;               colorbar->GetProperty, Range=currentRange, Title=currentTitle
+;               Print, currentRange, currentTitle
+;
+;   SetProperty: This procedure method allows one to set the properties of the
+;                colorbar object via the keywords described above. In addition,
+;                a DRAW and ERASE keyword are provided so that the colorbar can
+;                be immediately drawn when the new property is set.
+;
+;               colorbar->SetProperty, Range=[500, 15000], /Erase, /Draw
+;
+; COMMON BLOCKS:
+;       None.
+;
+; SIDE EFFECTS:
+;       The display window is not erased first.
+;
+; RESTRICTIONS:
+;       None.
+;
+; EXAMPLE:
+;       To create a colorbar, use it, then destroy it, type:
+;
+;       colorbar = Obj_New("COLORBAR", Title='Colorbar Values', Range=[0,1000],$
+;                  Format='(I4)')
+;       Window
+;       LoadCT, 5
+;       colorbar->Draw
+;       colorbar->SetProperty, Range=[0,500], /Erase, /Draw
+;       Obj_Destroy, colorbar
+;
+; MODIFICATION HISTORY:
+;       Written by: David Fanning, Fanning Software Consulting,
+;                   26 November 1998.
+;       Added Horizontal keyword to SetProperty method and fixed problem in
+;       going from Vertical to Horizontal color bars. 29 Nov 1998. DWF.
+;       Added LoadCT method and current color table index to object.
+;             6 December 1998.
+;       Fixed a bug dealing with nearest neighbor resampling. 30 Mar 1999. DWF.
+;       Fixed a bug with how NCOLORS and BOTTOM keywords interacted.
+;             29 Aug 1999. DWF.
+;       10 Oct 99. Modified the program so that current plot and map coordinates
+;                are saved and restored after the colorbar is drawn. DWF.
+;       26 May 2000 Added {XY}TICKV capability to the draw method. This
+;                required adding TickV to the object data structure, and to the
+;                INIT, GetProperty and SetProperty methods.
+;                Changed default tick length to -0.1. DWF (and Jack Saba)
+;       18 Nov 2001. Added Clamp method. DWF.
+;-
+
+PRO ColorBar::Clamp, datarange, Draw=draw
+
+; This method clamps the data to a particular data range.
+
+self->GetProperty, Range=currentRange
+
+thisclamp = Bytscl(datarange, Max=currentRange[1], Min=currentRange[0])
+lowval = thisclamp[0]
+highval = thisclamp[1]
+IF self.vertical THEN bar = BytScl(REPLICATE(1B,10) # BINDGEN(self.ncolors), Min=lowval, Max=highval) ELSE $
+   bar = BytScl(BIndgen(self.ncolors) # Replicate(1B, 20), Min=lowval, Max=highval)
+*self.bar = bar
+IF Keyword_Set(draw) THEN self->Draw, /Erase
+END
+;-------------------------------------------------------------------------
+
+
+PRO Colorbar::GetProperty, $
+
+; The GetProperty method of the COLORBAR object class. All properties are
+; obtained via the following keywords:
+
+   Background=background, $ ; Background color. Default is !P.Background.
+   Bottom=bottom, $         ; Bottom color index of colors allocated to
+                            ; colorbar.
+   Charsize=charsize, $     ; Character size of annotation. Default is 1.0.
+   Color=color, $           ; Color of annotation and outline. Default is
+                            ; !P.Color
+   Font=font, $             ; Font to use for annotation. Default is -1,
+                            ; Hershey fonts.
+   Format=format, $         ; Format of annotation. Default is F8.2.
+   Index=index, $           ; The color table index. Default is to use none.
+   Major=major, $           ; The number of major tick intervals. Default is 5.
+   Minor=minor, $           ; The number of minor tick intervals. Default is 2.
+   MinusOne=minusone, $     ; Set this keyword to choose MinusOne keyword on
+                            ; Congrid command.
+   NColors=ncolors, $       ; The number of colors allocated to colorbar.
+                            ; Default is (256 < !D.N_Colors).
+   Neighbor=neighbor, $     ; Set to indicate Nearest Neighbor sampling for
+                            ; Congrid. Default is 0 (Bilinear).
+   Position=position, $     ; The position of colorbar in normalized
+                            ; coordinates.
+   Range=range, $           ; The data range on colorbar. Default is [0, 255].
+   TickLen=ticklen, $       ; The length of tick marks. Default is -0.1.
+   TickV=tickv, $           ; Locations for tick marks in color index units.
+   Title=title, $           ; The title of the color bar. Default is a null
+                            ; string.
+   Vertical=vertical, $     ; Set this keyword if you want a vertical colorbar.
+                            ; Default is horizontal.
+   XEraseBox=xerasebox, $   ; A five-element vector of X points (normalized)
+                            ; for erasing the colorbar plot.
+   YEraseBox=yerasebox      ; A five-element vector of Y points (normalized)
+                            ; for erasing the colorbar plot.
+
+   ; Error handling.
+
+Catch, error
+IF error NE 0 THEN BEGIN
+   Catch, Cancel=1
+   ok = Dialog_Message('Error in GETPROPERTY method. Returning...')
+   Print, ''
+   Print, 'Colorbar::GetProperty Method: ' + !Error_State.Msg
+   RETURN
+ENDIF
+
+   ; Return value of self object.
+
+bottom = self.bottom
+charsize = self.charsize
+color = self.color
+background = self.background
+font = self.font
+format = self.format
+index = self.index
+range = self.range
+major = self.major
+minor = self.minor
+minusone = self.minusone
+ncolors = self.ncolors
+IF self.neighbor EQ 0 THEN neighbor = 1 ELSE neighbor = 0
+position = self.position
+title = self.title
+ticklen = self.ticklen
+tickv   = *(self.tickv)
+vertical = self.vertical
+xerasebox = self.xerasebox
+yerasebox = self.yerasebox
+
+END
+;-----------------------------------------------------------------
+
+
+
+PRO Colorbar::SetProperty, $
+
+; The SetProperty method of the COLORBAR object class. All properties are
+; set via the following keywords:
+
+   Background=background, $ ; Background color. Default is !P.Background.
+   Bottom=bottom, $         ; Bottom color index of colors allocated to
+                            ; colorbar.
+   Charsize=charsize, $     ; Character size of annotation. Default is 1.0.
+   Color=color, $           ; Color of annotation and outline. Default is
+                            ; !P.Color
+   Draw=draw, $             ; Set this keyword to call DRAW method after
+                            ; setting property.
+   Erase=erase, $           ; Set this keyword to set ERASE keyword on DRAW
+                            ; method call.
+   Font=font, $             ; Font to use for annotation. Default is -1,
+                            ; Hershey fonts.
+   Format=format, $         ; Format of annotation. Default is F8.2.
+   Horizontal=horizontal, $ ; Set this keyword to go from a vertical colorbar
+                            ; to horizontal.
+   Index=index, $           ; The color table index. Default is 0.
+   Major=major, $           ; The number of major tick intervals. Default is 5.
+   Minor=minor, $           ; The number of minor tick intervals. Default is 2.
+   MinusOne=minusone, $     ; Set this keyword to choose MinusOne keyword on
+                            ; Congrid command.
+   NColors=ncolors, $       ; The number of colors allocated to colorbar.
+                            ; Default is (256 < !D.N_Colors).
+   Neighbor=neighbor, $     ; Set to indicate Nearest Neighbor sampling for
+                            ; Congrid. Default is 0 (Bilinear).
+   Position=position, $     ; The position of colorbar in normalized
+                            ; coordinates.
+   Range=range, $           ; The data range on colorbar. Default is [0, 255].
+   TickLen=ticklen, $       ; The length of tick marks. Default is -0.1.
+   TickV=tickv, $           ; Locations for tick marks in color index units.
+   Title=title, $           ; The title of the color bar. Default is a null
+                            ; string.
+   Vertical=vertical, $     ; Set this keyword if you want a vertical colorbar.
+                            ; Default is horizontal.
+   XEraseBox=xerasebox, $   ; A five-element vector of X points (normalized)
+                            ; for erasing the colorbar plot.
+   YEraseBox=yerasebox      ; A five-element vector of Y points (normalized)
+                            ; for erasing the colorbar plot.
+
+   ; Error handling.
+
+Catch, error
+IF error NE 0 THEN BEGIN
+   Catch, Cancel=1
+   ok = Dialog_Message('Error in SETPROPERTY method. Returning...')
+   Print, ''
+   Print, 'Colorbar::SetProperty Method: ' + !Error_State.Msg
+   RETURN
+ENDIF
+
+   ; Set property if requested.
+
+IF N_Elements(bottom) NE 0 THEN  self.bottom = bottom
+IF N_Elements(charsize) NE 0 THEN  self.charsize = charsize
+IF N_Elements(color) NE 0 THEN  self.color = color
+IF N_Elements(background) NE 0 THEN  self.background = background
+IF N_Elements(font) NE 0 THEN  self.font = font
+IF N_Elements(format) NE 0 THEN  self.format = format
+IF N_Elements(range) NE 0 THEN  self.range = range
+IF N_Elements(major) NE 0 THEN  self.major = major
+IF N_Elements(minor) NE 0 THEN  self.minor = minor
+IF N_Elements(minusone) NE 0 THEN  self.minusone = minusone
+IF N_Elements(ncolors) NE 0 THEN  self.ncolors = ncolors
+IF N_Elements(index) NE 0 THEN  BEGIN
+   self.index = index
+   LoadCT, index, NColors=self.ncolors, Bottom=self.bottom
+ENDIF
+IF N_Elements(neighbor) NE 0 THEN  BEGIN
+   self.neighbor = neighbor
+   IF self.neighbor EQ 0 THEN self.neighbor = 1 ELSE self.neighbor = 0
+ENDIF
+IF N_Elements(position) NE 0 THEN  self.position = position
+IF N_Elements(ticklen) NE 0 THEN  self.ticklen = ticklen
+IF N_Elements(tickv) NE 0 THEN  *(self.tickv) = tickv
+IF N_Elements(title) NE 0 THEN  self.title = title
+IF N_Elements(xerasebox) NE 0 THEN  self.xerasebox = xerasebox
+IF N_Elements(yerasebox) NE 0 THEN  self.yerasebox = yerasebox
+IF Keyword_Set(vertical) THEN BEGIN
+   *self.bar = Replicate(1B, 20) # BIndgen(self.ncolors)
+   IF N_Elements(position) EQ 0 THEN self.position = [0.88, 0.15, 0.95, 0.85]
+  self.vertical = 1
+ENDIF
+IF Keyword_Set(horizontal) THEN BEGIN
+   *self.bar =  BIndgen(self.ncolors) # Replicate(1B, 20)
+   IF N_Elements(position) EQ 0 THEN self.position = [0.15, 0.88, 0.85, 0.95]
+   self.vertical = 0
+ENDIF
+
+   ; Scale the color bar.
+
+*self.bar = BytScl(*self.bar, Top=self.ncolors-1) + self.bottom
+
+   ; Draw the bar?
+
+IF Keyword_Set(draw) THEN self->Draw, Erase=Keyword_Set(erase)
+END
+;-----------------------------------------------------------------
+
+
+
+PRO Colorbar::LoadCT, index, Draw=draw, Erase=erase
+
+; The LoadCT method of the COLORBAR object class.
+
+   ; Error handling.
+
+Catch, error
+;error=0
+IF error NE 0 THEN BEGIN
+   Catch, Cancel=1
+   ok = Dialog_Message('Error in LoadCT method. Returning...')
+   Print, ''
+   Print, 'Colorbar::LoadCT Method: ' + !Error_State.Msg
+   RETURN
+ENDIF
+
+IF N_Elements(index) EQ 0 THEN index = 0
+
+LoadCT, index, NColors=self.ncolors, Bottom=self.bottom, /Silent
+self.index = index
+
+IF Keyword_Set(draw) THEN self->Draw, Erase=Keyword_Set(erase)
+END
+;-----------------------------------------------------------------
+
+
+
+
+PRO Colorbar::Erase
+
+; The Erase method of the COLORBAR object class.
+
+   ; Error handling.
+
+Catch, error
+IF error NE 0 THEN BEGIN
+   Catch, Cancel=1
+   ok = Dialog_Message('Error in ERASE method. Returning...')
+   Print, ''
+   Print, 'Colorbar::Erase Method: ' + !Error_State.Msg
+   RETURN
+ENDIF
+
+   ; Valid erase boxes?
+
+IF Total(self.xerasebox) EQ 0 OR Total(self.yerasebox) EQ 0 THEN BEGIN
+   ok = Dialog_Message('No colorbar exists to erase. Returning...')
+   RETURN
+ENDIF
+
+PolyFill, self.xerasebox, self.yerasebox, /Normal, Color=self.background
+
+END
+;-----------------------------------------------------------------
+
+
+
+
+PRO Colorbar::Draw, Erase=erase
+
+; The Draw method of the COLORBAR object class.
+
+   ; Error handling.
+
+Catch, error
+IF error NE 0 THEN BEGIN
+   Catch, Cancel=1
+   ok = Dialog_Message('Error in DRAW method. Returning...')
+   Print, ''
+   Print, 'Colorbar::Draw Method: ' + !Error_State.Msg
+   RETURN
+ENDIF
+
+   ; Save the current plot state.
+
+bang_p = !P
+bang_x = !X
+bang_Y = !Y
+bang_Z = !Z
+bang_Map = !Map
+
+   ; Must turn off decomposed color on devices that support it.
+
+CASE !D.Name OF
+   'MAC': Device, Decomposed=0
+   'WIN': Device, Decomposed=0
+   'X':   Device, Decomposed=0
+   ELSE:
+ENDCASE
+
+   ; Get starting locations.
+
+xstart = self.position(0)
+ystart = self.position(1)
+
+   ; Get the size of the bar.
+
+xsize = (self.position(2) - self.position(0))
+ysize = (self.position(3) - self.position(1))
+
+   ; Need to erase the display first?
+
+IF Keyword_Set(erase) THEN self->Erase
+
+   ; Display the color bar in the window. Sizing is different for
+   ; devices with scalable pixels.
+
+scalablePixels = (!D.Flags AND 1) NE 0
+
+IF scalablePixels THEN BEGIN
+
+   TV, *self.bar, xstart, ystart, XSIZE=xsize, YSIZE=ysize, /Normal
+
+ENDIF ELSE BEGIN
+
+   bar = CONGRID(*self.bar, Ceil(xsize*!D.X_VSize), Ceil(ysize*!D.Y_VSize), $
+       Interp=self.neighbor, Minus_One=self.minusone)
+   TV, bar, xstart, ystart, /Normal
+
+ENDELSE
+
+   ; Annotate the color bar.
+
+IF self.vertical THEN BEGIN
+
+   loadct,0
+   Plot, [self.range[0], self.range[1]], [self.range[0], self.range[1]], $
+      /NoData, XTicks=1, YTitle=self.title, Font=self.font, YMinor=self.minor, $
+      Position=self.position, YTicks=self.major, XStyle=1, YStyle=1, $
+;      Color=self.color, YCharsize=self.charsize, /NoErase, $
+      Color=0, YCharsize=self.charsize, /NoErase, $
+      YTickformat=self.format, XTickformat='(A1)', YTicklen=self.ticklen, $
+      YRange=self.range, YTickV=*(self.tickv)
+
+ENDIF ELSE BEGIN
+
+   loadct,0
+   Plot, [self.range[0], self.range[1]], [self.range[0], self.range[1]], $
+      /NoData, XTicks=self.major, Font=self.font, XMinor=self.minor, $
+      Position=self.position, YTicks=1, XStyle=1, YStyle=1, XTitle=self.title, $
+;      Color=self.color, XCharsize=self.charsize, /NoErase, YTickformat='(A1)', $
+      Color=0, XCharsize=self.charsize, /NoErase, YTickformat='(A1)', $
+      XTickformat=self.format, XTicklen=self.ticklen, XRange=self.range, $
+      XTickV=*(self.tickv)
+
+ENDELSE
+
+   ; Update the erase boxes.
+
+self.xerasebox = [ !X.Region[0], !X.Region[0], !X.Region[1], !X.Region[1], $
+                   !X.Region[0] ]
+self.yerasebox = [ !Y.Region[0], !Y.Region[1], !Y.Region[1], !Y.Region[0], $
+                   !Y.Region[0] ]
+
+   ; Restore the previous plot and map system variables.
+
+!P = bang_p
+!X = bang_x
+!Y = bang_y
+!Z = bang_z
+!Map = bang_map
+
+END
+;-----------------------------------------------------------------
+
+
+
+PRO Colorbar::CleanUp
+
+; The CleanUp method of the COLORBAR object class.
+
+Ptr_Free, self.bar
+Ptr_Free, self.tickv
+END
+;-----------------------------------------------------------------
+
+
+
+FUNCTION Colorbar::Init, $
+
+; The INIT method of the COLORBAR object class.
+
+   Background=background, $ ; Background color. Default is !P.Background.
+   Bottom=bottom, $         ; Bottom color index of colors allocated to
+                            ; colorbar.
+   Charsize=charsize, $     ; Character size of annotation. Default is 1.0.
+   Color=color, $           ; Color of annotation and outline. Default is
+                            ; !P.Color
+   Font=font, $             ; Font to use for annotation. Default is -1,
+                            ; Hershey fonts.
+   Format=format, $         ; Format of annotation. Default is F8.2.
+   Index=index, $           ; The color table index. Default is to use whatever
+                            ; is loaded.
+   Major=major, $           ; The number of major tick intervals. Default is 5.
+   Minor=minor, $           ; The number of minor tick intervals. Default is 2.
+   MinusOne=minusone, $     ; Set this keyword to choose MinusOne keyword on
+                            ; Congrid command.
+   NColors=ncolors, $       ; The number of colors allocated to colorbar.
+                            ; Default is (256 < !D.N_Colors).
+   Neighbor=neighbor, $     ; Set to indicate Nearest Neighbor sampling for
+                            ; Congrid. Default is 0 (Bilinear).
+   Position=position, $     ; The position of colorbar in normalized
+                            ; coordinates.
+   Range=range, $           ; The data range on colorbar. Default is [0, 255].
+   TickLen=ticklen, $       ; The length of tick marks. Default is -0.1.
+   TickV=tickv, $           ; Locations for tick marks in color index units.
+   Title=title, $           ; The title of the color bar. Default is a null
+                            ; string.
+   Vertical=vertical, $     ; Set this keyword if you want a vertical colorbar.
+                            ; Default is horizontal.
+   XEraseBox=xerasebox, $   ; A five-element vector of X points (normalized)
+                            ; for erasing the colorbar plot.
+   YEraseBox=yerasebox      ; A five-element vector of Y points (normalized)
+                            ; for erasing the colorbar plot.
+
+   ; Error handling.
+
+Catch, error
+IF error NE 0 THEN BEGIN
+   Catch, Cancel=1
+   ok = Dialog_Message('Error in INIT method. Returning...')
+   Print, ''
+   Print, 'Colorbar::INIT Method: ' + !Error_State.Msg
+   RETURN, 0
+ENDIF
+
+   ; Check keywords. Define default values if unsupplied.
+
+IF N_Elements(bottom) EQ 0 THEN bottom = 0
+IF N_Elements(ncolors) EQ 0 THEN ncolors = (256-bottom) < (!D.N_Colors - bottom)
+IF N_Elements(charsize) EQ 0 THEN charsize = 1.0
+IF N_Elements(font) EQ 0 THEN font = -1
+IF N_Elements(format) EQ 0 THEN format = '(F8.2)'
+IF N_Elements(color) EQ 0 THEN color = !P.Color
+IF N_Elements(index) EQ 0 THEN index = -1
+IF index GE 0 THEN LoadCT, index, NColors=ncolors, Bottom=bottom, /Silent
+IF N_Elements(background) EQ 0 THEN background = !P.Background
+IF N_Elements(range) EQ 0 THEN range = [0, 255]
+IF N_Elements(major) EQ 0 THEN major = 5
+IF N_Elements(minor) EQ 0 THEN minor = 2
+IF N_Elements(ticklen) EQ 0 THEN ticklen = -0.1
+IF N_Elements(tickv) EQ 0 THEN tickv = 0
+IF N_Elements(title) EQ 0 THEN title = ''
+IF N_Elements(xerasebox) EQ 0 THEN xerasebox = FltArr(5)
+IF N_Elements(yerasebox) EQ 0 THEN yerasebox = FltArr(5)
+vertical = Keyword_Set(vertical)
+neighbor = Keyword_Set(neighbor)
+IF neighbor EQ 0 THEN neighbor = 1 ELSE neighbor = 0
+minusone = Keyword_Set(minusone)
+
+   ; Create the colorbar image and default positions.
+
+IF vertical THEN BEGIN
+   bar = Replicate(1B, 20) # BIndgen(ncolors)
+   IF N_Elements(position) EQ 0 THEN position = [0.88, 0.15, 0.95, 0.85]
+ENDIF ELSE BEGIN
+   bar = BIndgen(ncolors) # Replicate(1B, 20)
+   IF N_Elements(position) EQ 0 THEN position = [0.15, 0.88, 0.85, 0.95]
+ENDELSE
+
+   ; Scale the color bar.
+
+bar = BytScl(bar, Top=ncolors-1) + bottom
+
+   ; Fill out this particular instance of the COLORBAR object.
+
+self.bar = Ptr_New(bar)
+self.position = Float(position)
+self.vertical = vertical
+self.bottom = bottom
+self.ncolors = ncolors
+self.font = font
+self.format = format
+self.index = index
+self.range = range
+self.title = title
+self.ticklen = ticklen
+self.tickv = Ptr_New(tickv)
+self.neighbor = neighbor
+self.major = major
+self.minor = minor
+self.minusone = minusone
+self.charsize = charsize
+self.color = color
+self.background = background
+self.xerasebox = xerasebox
+self.yerasebox = yerasebox
+
+RETURN, 1
+END
+;-----------------------------------------------------------------
+
+
+
+PRO Colorbar__Define
+
+; Structure definition of the COLORBAR object class.
+
+struct = { COLORBAR, $     ; The COLORBAR object class definition.
+   bar:Ptr_New(), $        ; The colorbar image.
+   position:FltArr(4), $   ; Position in the window (normalized coords).
+   vertical:0, $           ; Flag for vertical colorbar. Default is 0.
+   bottom:0, $             ; The bottom color index. Default is 0.
+   ncolors:0, $            ; The number of colors in the colorbar. Default is
+                           ;  (256 < !D.N_Colors).
+   major:0, $              ; The number of major tick intervals. (Same as
+                           ;  XTICKS.) Default is 5.
+   minor:0, $              ; The number of minor tick intervals. Default is 2.
+   font:0, $               ; The font to use. Default is -1, Hershey fonts.
+   format:'', $            ; The format of the annotations. Default is F8.2.
+   index:0, $              ; The current color table index.
+   range:FltArr(2), $      ; The colorbar data range. Default is [0,255].
+   title:'', $             ; The title of the colorbar. Default is null string.
+   ticklen:0.0, $          ; The length of tick marks. Default is -0.1.
+   tickv: Ptr_New(), $     ; Values for the tick marks.
+   neighbor:0, $           ; A flag to indicate nearest neighbor sampling.
+                           ;  Default is 0 (bilinear).
+   minusone:0, $           ; A flag to indicate MinusOne keyword set on
+                           ;  Congrid. Default is 0.
+   charsize:0.0, $         ; The character size of the annotation. Default is
+                           ;  1.0.
+   color:0, $              ; The color of annotation and colorbar outline.
+                           ;  Default is !P.Color.
+   background:0, $         ; The background or "erase" color. Default is
+                           ;  !P.Background.
+   xerasebox:FltArr(5), $  ; A vector of X points for erasing.
+   yerasebox:FltArr(5) $   ; A vector of Y points for erasing.
+   }
+
+END
+;--------------------------------------------------------------------------
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/ertel_vorticity.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/ertel_vorticity.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/ertel_vorticity.idl	(revision 207)
@@ -0,0 +1,80 @@
+
+if ((field1 eq 'T') and (winds(0) eq 'U') and (winds(1) eq 'V')) $
+	or ((field1 eq 'tk') and (winds(0) eq 'U') and (winds(1) eq 'V')) $
+	or ((field1 eq 'HGT') and (winds(0) eq 'U') and (winds(1) eq 'V')) then begin
+
+;print, 'computing Ertel potential vorticity'
+;;---------------------------------------------------
+;;** ERTEL POTENTIAL VORTICITY
+;;---------------------------------------------------
+;; vort scalaire grad_theta / rho
+;;               and rho equal p / gH (because H ~ RT/g)
+;H=10.
+;g=3.72
+;for i=0, west_east-1 do begin
+;for j=0, south_north-1 do begin
+;     theta=220.+var[i,j,*,nt]
+;     dtheta_dz=DERIV(z*1000., theta)
+;     fac=dtheta_dz*H*g/z     ;;fac est EPV/(abs. vort)
+;     what_I_plot(i,j)=fac(theloop)
+;endfor
+;endfor
+;; alternative method : ksi * g * dtheta_dp
+;
+;
+;;--------------------------
+;; coriolis parameter 'f'
+;;--------------------------
+;omeg=7.0721E-5
+;coriolis=2*omeg*sin(lat*!pi/180)
+;ny=n_elements(coriolis)
+;nx=n_elements(what_I_plot(*,1))
+;f=fltarr(nx,ny)
+;for i=0,nx-1 do begin
+;for j=0,ny-1 do begin
+;	f(i,j)=coriolis(j)
+;endfor
+;endfor
+;print, 'coriolis'
+;print, mean(coriolis)
+;
+;;----------------------------------
+;; horizontal coordinates (meters)
+;;----------------------------------
+rad=3397000.
+deg_m=2*rad*!pi/360.
+dlon=deg_m*cos(y*!pi/180)
+dlat=deg_m
+xcal=(x-min(x))*dlon
+ycal=(y-min(y))*dlat
+
+;---------------------------------
+; wind gradients (s-1)
+;---------------------------------
+grad, dv_dx, overvector_y, xcal, ycal, 1
+grad, dv_dy, overvector_y, xcal, ycal, 2
+grad, du_dx, overvector_x, xcal, ycal, 1
+grad, du_dy, overvector_x, xcal, ycal, 2
+
+;;-----------------------------------------
+;; absolute and relative vorticity (s-1)
+;;-----------------------------------------
+;;what_I_plot=(f+dv_dx-du_dy)*what_I_plot*1.e6 
+;what_I_plot=(dv_dx-du_dy)*1.e6
+what_I_plot=(dv_dx-du_dy)*1.e4 
+			;now vort. is in PVU !!
+			;which is 1e-6 K.kg-1.m2.s-1
+;w=where(abs(what_I_plot) gt 1.e10)
+;if (w(0) ne -1) then what_I_plot[w]=1.e38
+
+;overcontour = (dv_dx-du_dy)*1.e4
+
+
+;overcontour = sqrt((overvector_x + overvector_y)^2)
+;overvector_x=0
+;overvector_y=0
+minfield_init=0.
+maxfield_init=0.
+title='Vorticity (1e-4 s!U-1!N)'
+
+endif
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/findxy.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/findxy.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/findxy.pro	(revision 207)
@@ -0,0 +1,70 @@
+pro findxy, 		$
+	x=x, 		$	;;IN
+	y=y, 		$	;;IN
+	point=point,	$	;;IN
+	ind=ind, 	$	;;OUT		
+	flag=flag		;;IN OPT
+
+
+
+pointint=[0,0]
+
+;;;if (point eq 'VL1') then pointint=[-48.22,22.70]
+;;;if (point eq 'VL2') then pointint=[133.74,47.93]
+;;;if (point eq 'PAT') then pointint=[-33.5,19.1]
+
+if (n_elements(point) eq 2) then begin
+	pointint=point
+endif else begin
+;;Si lon=312.050381 et lat=22.269628, alt=-3637.1396
+;;Si lon=134.282101 et lat=47.668093, alt=-4497.0474
+;;Si lon=326.747364 et lat=19.099641, alt=-3681.9993
+if (point eq 'VL1') then pointint=[312.050381-360.,22.269628]
+if (point eq 'VL2') then pointint=[134.282101,47.668093]
+if (point eq 'PAT') then pointint=[326.747364-360.,19.099641]
+endelse
+
+
+
+if (n_elements(x) eq 0) then print, 'set x='
+if (n_elements(y) eq 0) then print, 'set y='
+if (n_elements(flag) eq 0) then flag=1
+
+
+x=reform(x)
+y=reform(y)
+
+ind=intarr(2)
+
+
+
+CASE (flag) OF
+1: begin
+
+	minim=abs(x-pointint(0))
+	w=where(minim eq min(minim))
+	print, 'distance is ', minim(w(0))
+	ind[0]=w(0)
+
+        minim=abs(y-pointint(1))
+        w=where(minim eq min(minim))
+	print, 'distance is ', minim(w(0))
+        ind[1]=w(0)
+
+end
+2: begin
+
+	distance = sqrt((x - pointint(0))^2 + (y - pointint(1))^2)
+	mx = min(distance, location)
+	print, 'distance 2D is ',mx
+	ind = array_indices(distance, location)
+	print, 'on ... ', pointint(0), pointint(1)
+	print, 'found ... ', x[ind(0),ind(1)], y[ind(0),ind(1)]
+
+end
+endcase
+
+end
+
+
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/genanim.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/genanim.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/genanim.pro	(revision 207)
@@ -0,0 +1,20 @@
+pro genanim, num, folder, name
+
+last=num-1
+
+OPENW, 1, 'templist'
+
+FOR i=0,last do begin
+	;; on ne met plus de dossier car on nomme les images
+	;printf, 1, 'modImages['+STRTRIM(STRING(i),2)+'] = "'+folder+'/',$
+	;;	+STRTRIM(STRING(i+1000),2)+'.ps.png";'
+printf, 1, 'modImages['+STRTRIM(STRING(i),2)+'] = "',$
+       +name+STRTRIM(STRING(i+1000),2)+'.png";'
+ENDFOR
+
+printf, 1, 'first_image = '+string(0,'(I0)')+';'
+printf, 1, 'last_image = '+string(last,'(I0)')+';'
+
+CLOSE, 1
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/goodscale.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/goodscale.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/goodscale.pro	(revision 207)
@@ -0,0 +1,54 @@
+;;Fixe l'echelle pour une tab2diable de type (x,y,z,t) ou (x,y,t) ou (z,t)
+	;;Possibilite de restreindre a une zone et des heures donnees
+
+pro goodscale, $
+    tab2d, $
+    mini, $
+    maxi, $
+    coeff=coeff_sigma
+	
+print,'Yeah !'
+
+;
+; input: the 2D array which is ready to be plotted
+;
+
+
+;if (n_elements(coeff_sigma) eq 0) then coeff_sigma=3.3 ;; vincent
+if (n_elements(coeff_sigma) eq 0) then coeff_sigma=2.5 ;; aymeric
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
+	
+;;calcul de la moyenne
+	N=n_elements(tab2d)
+	moy=(1/float(N))*total(tab2d) 	
+
+;;calcul de la tab2diance
+	moyarray = make_array(N, 1, /integer, value = 1)	
+	varia=(1/float(N-1))*total( ( tab2d - (moyarray * moy) )^2 )
+	
+;;calcul de sigma
+	sigma = sqrt( varia )
+	
+;;echelle
+	mini = moy - float(coeff_sigma) * sigma & stratmin = 'sigma'
+	maxi = moy + float(coeff_sigma) * sigma & stratmax = 'sigma'
+
+;;au cas ou 
+if (mini lt min(tab2d)) then begin
+	mini=min(tab2d)
+	stratmin = 'real min'
+endif
+if (maxi gt max(tab2d)) then begin
+	maxi=max(tab2d)
+	stratmax = 'real max'
+endif
+	
+	
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
+;;affichage a l'ecran :
+print,'min :'+STRTRIM(mini,2)+' '+stratmin	
+print,'max :'+STRTRIM(maxi,2)+' '+stratmax
+
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/grad.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/grad.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/grad.pro	(revision 207)
@@ -0,0 +1,35 @@
+pro grad, d_param, param, x, y, flag
+
+; pour calculer le champ de gradient d'un champ 2D
+;	d_param = résultat 2D
+; 	param: tableau 2D
+; 	x: tableau 1D 
+; 	y: tableau 1D
+;	flag: 	1 pour grad_x
+;		2 pour grad_y
+
+
+missing=1.e30
+w=where(abs(param) gt missing)
+if (w(0) ne -1) then param[w]=0.
+
+
+imax = n_elements(param(*,0))
+jmax = n_elements(param(0,*))
+
+d_param=dblarr(imax,jmax) 
+case flag of
+1: begin
+for j = 0, jmax-1 do begin
+		d_param(*,j) = DERIV(x,param(*,j))
+;               d_param(*,j) = DERIV(reform(param(*,j)),x)
+endfor
+end
+2: begin
+for i = 0, imax-1 do begin
+		d_param(i,*) = DERIV(y,param(i,*))
+;               d_param(i,*) = DERIV(reform(param(i,*)),y)
+endfor
+end
+endcase
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/graphwrf.def
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/graphwrf.def	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/graphwrf.def	(revision 207)
@@ -0,0 +1,296 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  -or- @report.idl
+;  -or- @movie.idl
+;
+;  this file will be saved !
+;
+;;---------------------------------------
+
+
+;-------------------------------
+;-------------------------------
+; namelist.ARWPOST parameters
+;-------------------------------
+;-------------------------------
+
+;; DEFAULT: ARWPOST.EXE ALREADY RUN (i.e. input.ctl and input.dat already there)
+;; UNCOMMENT FOLLOWING LINE TO EXTRACT FILES 
+
+extract='yes'	;;   EXECUTE ARWPOST.EXE
+		;;   WITH THE FOLLOWING PARAMETERS :
+
+;-------------------------------
+;-------------------------------
+
+nam1=" fields = 'tk,HGT,PSFC,U,V,W' "		;; CHANGE HERE FIELDS TO BE EXTRACTED 
+nam1=" fields = 'tk,HGT' "
+;nam1=" fields = 'HGT,U,V' "
+nam1=" fields = 'V,W' "
+;nam1=" fields = 'V,W,HGT' "
+;nam1=" fields = 'tk,HGT' "
+;nam1=" fields = 'HGT,ICETOT,RAVE,QH2O_ICE,QH2O' "
+;nam1=" fields = 'U,V,W,QH2O' "
+;nam1=" fields = 'HGT,ICETOT,RAVE,tk,QH2O_ICE' "
+;nam1=" fields = 'HGT,ICETOT,RAVE' "
+;nam1=" fields = 'TSK,HGT' "
+;nam1=" fields = 'U,V,PSFC,tk' "
+nam1=" fields = 'U,V,HGT,SWDOWN' "
+nam1=" fields = 'U,V,HGT' "
+nam1=" fields = 'U,V,W' "
+nam1=" fields = 'TSURF,HGT,U,V,T' "
+nam1=" fields = 'PSFC,tk,HGT' "
+nam1=" fields = 'tk,W' "
+
+;nam2=" start_date = '2024-05-03_06:00:00' "	;; CHANGE HERE START DATE
+;nam3=" end_date   = '2024-05-04_06:00:00' "	;; CHANGE HERE END DATE
+;nam2=" start_date = '2024-06-53_06:00:00' "	;; CHANGE HERE START DATE
+;nam3=" end_date = '2024-06-53_12:00:00' "	;; CHANGE HERE END DATE
+
+nam2=" start_date = '2024-07-17_00:00:00' "	;; CHANGE HERE START DATE
+nam3=" end_date = '2024-07-18_00:00:00' "	;; CHANGE HERE END DATE
+
+
+;nam4=" interval_seconds = 14800 "		;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s	
+;nam4=" interval_seconds = 7400 "               ;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s
+;nam4=" interval_seconds = 3700 "
+;nam4=" interval_seconds = 88800 "
+nam4=" interval_seconds = 22200 "
+;nam4=" interval_seconds = 44400 "
+nam5=" interp_method = 0 "			;; SET VERT. COORD. 0: eta levels, 1: height (inc) or pressure (dec)
+;nam5=" interp_method = 1 "
+tabnam=[0.,6.,0.1]   	;; SET HEIGHT/PRESSURE LEVELS WITH [first alt, last alt, step]
+;tabnam=[-3.,5.,0.1]
+tabnam=[-5.,10.,0.2]
+
+nest='d03'  ;; SET NEST
+nest='d01'  ;; SET NEST
+
+;----------------------------------------------------
+;----------------------------------------------------
+; what do you want to plot ?
+; THIS MUST BE SET ACCORDINGLY TO PREVIOUS SECTION
+;   - do not plot a field not extracted
+;   - do not ask for more plot than data available
+;----------------------------------------------------
+;----------------------------------------------------
+
+num=1		   	;; how many plots ?
+num=6                   ;; how many plots ?
+;num=2                   ;; how many plots ?
+;num=3			;; how many plots ?
+;num=12
+;num=13
+;num=4
+;num=7
+
+;@map_sea_level.idl
+;@map_ertel_vorticity.idl
+;field1='HGT'
+;field2='U'
+;winds=['U','V']
+;topo=1
+
+;winds=['U','V'] & field1='SWDOWN' & topo=1
+;winds=['V','W'] & field1='V' 
+;field1='ICETOT' & topo=1
+;field1='RAVE' & topo=1
+;field1='QH2O_ICE' & topo=1
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O' & field2='W'
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O_ICE' & field2='tk'
+;field1='tk' & topo=1
+;field1='V' & field2='V'
+;field1='W' & winds=['V','W']
+;field1='tk' & winds=['V','W']
+;field1='tk'
+;field1='W' & topo=1
+;field1='TSK' & topo=1
+;field1='U' & winds=['U','V'] & topo=1
+;winds=['V','W'] & field1='V'
+;winds=['V','W'] & field1='W'
+;field1='U' & winds=['U','V'] & topo=1
+;field1='HGT' & field2='HGT' 
+;field1='W' ;& winds=['U','V'] ;& topo=1
+;field1='PSFC' & winds=['U','V'] & field2='W'
+;field1='W' & winds=['U','V'] & field2='PSFC'
+;field1='TSURF' & topo=1 ;& winds=['U','V']
+;field1='T' & topo=1 & winds=['U','V']
+;field1='PSFC' & winds=['tk','HGT'] & topo=1
+;field1='W' & field2='U'
+;field2='tk' & field1='W'
+field1='tk'
+
+;----------------------------------
+;----------------------------------
+; what kind of plot do you want ? 
+;----------------------------------
+;----------------------------------
+
+plot='map' 	
+level=1		; first level is 1
+;level=20
+;;level=41
+;level=10
+;level=11
+;;level=1
+;level=9
+;level=8
+;level=3
+;level=49
+;level=5
+;level=15
+;level=17
+;level=5
+;level=10
+;level=7  ;;SEA LEVEL
+;level=30
+level=7
+
+;plot='meridional'  	
+;nlon=75	; first is 1
+;;;;nlon=87
+;nlon=72
+;nlon=70
+;nlon=69
+;nlon=60  
+;nlon=162
+;nlon=100
+nlon=60
+nlon=150
+nlon=250
+nlon=30
+
+;plot='zonal' 		
+;;;nlat=145	; first is 1
+;;nlat=24
+;;nlat=25
+;nlat=100.
+;nlat=165
+
+;@map_wind_stress.idl
+
+
+;----------------------------
+;----------------------------
+; change plot settings 
+;----------------------------
+;----------------------------
+
+;; uncomment to modify default plot settings
+;; | | | | | | | | | | | | | | | | | | | | |
+;; v v v v v v v v v v v v v v v v v v v v v
+
+minfield_init=200.              ;; grepALL
+maxfield_init=260.              ;; grepALL
+;minfield_init=0.              ;; grepALL
+;maxfield_init=48.               ;; grepALL
+;intervalx=5.                   ;; grepALL
+;intervaly=5.                    ;; grepALL
+;title_user='Vertical Wind (!Nm!N.s!U-1!N), LT 13, 980m ABG'	;; grepALL
+;title_axis=['x coord (km)','y coord (km)']	;; grepALL
+;subtitle_user='LT 13, 980m ABG, Contours: surface pressure anomaly each 0.5 Pa'	;; grepALL
+;colors=64			;; grepALL
+;pal=33				;; grepALL
+;pal=0				;; grepALL
+;pal=22				;; grepALL
+;format='(I0)'			;; grepALL
+;windex=30.			;; grepALL
+;stride=3			;; grepALL
+;flag_cb='false'		;; grepALL
+;what_I_plot=abs(what_I_plot)    ;; grepALL ??! minfield
+;what_I_plot=what_I_plot+220.
+;isotropic='false'		;; grepALL
+;overcontour=overcontour-mean(overcontour)	;; grepALL
+;lev=[-8.,-6.,-4.,-2.,0.,2.,4.,6.,8.]		;; grepALL
+;lev=[-5.,0.,5.,10.,15.,20.,25.] ;; grepALL
+;lev=[-1.,5.,10.,15.,20.,25.] ;; grepALL
+
+
+;minalt=-3.			;; grepSEC
+;maxalt=5.			;; grepSEC
+;;;altitude=altitude*1000.  	;; grepSEC
+;minspace=-18.0			;; grepSEC
+;maxspace=-9.0			;; grepSEC
+;minspace=-11.0                 ;; grepSEC
+;maxspace=-7.0                  ;; grepSEC
+;factor=20.  ;10.			   ;; grepSEC
+;space=space*59. & spacekm='true'   ;; grepSEC
+;minspace=minspace*59./factor       ;; grepSEC
+;maxspace=maxspace*59./factor       ;; grepSEC
+;intervalx=round(intervalx*59./factor)       ;; grepSEC
+
+
+;windowy=[10.,13.]        ;; grepMAP
+;windowx=[14.,17.]	;; grepMAP
+;windowy=[-12.,-2.]        ;; grepMAP
+;windowx=[-78.,-68.]     ;; grepMAP
+;windowy=[45.,55.]        ;; grepMAP
+;windowx=[-45.,-35.]     ;; grepMAP
+;lon=lon*59.-lon(0)*59.		;; grepMAP ;;attention plots successifs 
+;lat=lat*59.-lat(0)*59.		;; grepMAP
+;windowy=[0.,14.]	;; grepMAP
+;windowx=[0.,14.]   ;; grepMAP
+
+
+;lim_max = maxfield_init				;; 1/3 grepALL
+;w=where(what_I_plot ge lim_max) 		;; 2/3 grepALL
+;if (w[0] ne -1) then what_I_plot[w]=lim_max	;; 3/3 grepALL
+
+;lim_min = minfield_init                         ;; 1/3 grepALL
+;w=where(what_I_plot le lim_min)                 ;; 2/3 grepALL
+;if (w[0] ne -1) then what_I_plot[w]=lim_min     ;; 3/3 grepALL
+
+
+;lim_blank = 10 					;; 1/3 grepALL
+;w=where(abs(what_I_plot) le lim_blank)			;; 2/3 grepALL
+;if (w[0] ne -1) then what_I_plot[w]=missing_value	;; 3/3 grepALL
+
+;title_user='Sea-level surface pressure'+title_user	;; grepALL
+subtitle_user='LMD mesoscale model'     		;; grepALL
+
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+;------------------------------
+;------------------------------
+; some last possible settings 
+;------------------------------
+;------------------------------
+
+backup_data='no'   	;; save ARWpost-generated text files ? default is no
+already_data='no'  	;; load ARWpost-generated text files ? default is no
+;datafolder='./WHERE_RESULTS_ARE/'	;; default is ./
+;plotfolder='./WHERE_RESULTS_ARE/'       ;; default is ./
+;plotfolder='./WHERE_PLOTS_ARE/'	        ;; default is ./
+;datafolder='/d5/aslmd/WRF_Mars/EN_COURS/newTH20WC/month5/'
+;datafolder='/d5/aslmd/WRF_Mars/ARTICLE/VM/'
+datafolder='/d5/aslmd/WRF_Mars/DATA/VM/'
+plotfolder=datafolder
+
+textitle='generic'		;; one word.  default is 'plot'
+texcomments='sol'	;; one word.  default is 'plot'
+
+
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/graphwrf.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/graphwrf.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/graphwrf.pro	(revision 207)
@@ -0,0 +1,545 @@
+pro graphwrf, typeplot
+
+
+;-----------------------------------------
+; Read files generated by ARWpost & plot
+;
+; typeplot is s for see		(.ps are not saved, .def saved)
+;	      t for trace	(.ps are saved, .def saved)
+;	      r for report	(same as t + tex report)
+;	      m for movie	(same as t + gif movie)
+;	      w for web page    (same as t + html animation)
+;
+; default is 's'
+;
+; use:
+;  1. set parameters in graphwrf.def
+;  2. @graphwrf.comp
+;  3. graphwrf, 's' (or 't' or 'r' or 'm' or 'w')
+; 
+;-----------------------------------------
+; A. Spiga, Mars 2008
+;-----------------------------------------
+
+
+nomovie='yes'
+
+if (n_elements(typeplot) eq 0) then typeplot='s'
+
+print, '---------------------'
+print, 'init. please wait ...'
+print, '---------------------'
+
+;
+; init.
+;
+field1='' & field2='' & winds=['','']
+backup_data='no' & already_data='no'
+datafolder='./' & plotfolder='./'
+textitle='plot'
+texcomments='plot'
+topo=0
+extract='no'
+
+
+;
+; defining fields, coordinates, type of plot ... etc ...
+;
+@user.idl
+
+
+;
+; extracting/interpolating fields from WRF NETCDF files
+;
+if (extract eq 'yes') then begin
+	print, 'EXTRACT DATA. OK ?'
+	read, dumb, prompt='type 1 to proceed, 0 to keep the same input >>> '
+	if (dumb ne 0) then begin
+        	print, 'WE WILL EXTRACT DATA USING ARWPOST.EXE'
+		if (n_elements(nest) eq 0) then nest='d01'
+        	call_arwpost, nam1, nam2, nam3, nam4, nam5, tabnam, nest, datafolder
+	endif 
+endif
+if (already_data eq 'yes') then begin
+	if (nam5 eq " interp_method = 0 ") then coord='model_level'
+	if ((nam5 eq " interp_method = 1 ") and (tabnam(0) lt tabnam(1))) then coord='height'
+        SPAWN, 'ln -sf  '+datafolder+'/'+coord+'.input.ctl input.ctl'
+        SPAWN, 'ln -sf  '+datafolder+'/'+coord+'.input.dat input.dat'
+endif
+
+				
+;-----------------------------;
+; STARTING TO READ INPUT.CTL  ;
+;-----------------------------;
+
+
+;
+; get the local time
+;
+interv=0.
+openr, 99, 'timefil'
+readf,99,interv
+close, 99
+
+
+;
+; get preliminar info on coordinates
+;
+wnx=1
+wny=1
+wnz=1
+wnt=1
+txt=''
+param=[0.,0.,0.,0.,0.,0.,0.,0.]
+
+openr, 1, 'input.ctl'
+while not eof(1) do begin
+    readf,1,txt
+    match=STRPOS(txt,'linear')
+	if (match ne -1) then begin
+		wnx=(STRPOS(txt,'xdef') eq -1)*wnx  ;0 if linear
+		wny=(STRPOS(txt,'ydef') eq -1)*wny  ;0 if linear
+                wnz=(STRPOS(txt,'zdef') eq -1)*wnz  ;0 if linear 
+                wnt=(STRPOS(txt,'tdef') eq -1)*wnt  ;0 if linear
+                paramstart=STRSPLIT(txt, 'r', LENGTH=paramlength)
+        	paramchar=STRMID(txt,paramstart(1),paramlength(1))
+		READS, paramchar, start, step
+		param=param+[start*(STRPOS(txt,'xdef') ne -1),$
+			step*(STRPOS(txt,'xdef') ne -1),$
+			start*(STRPOS(txt,'ydef') ne -1),$
+			step*(STRPOS(txt,'ydef') ne -1),$
+			start*(STRPOS(txt,'zdef') ne -1),$
+			step*(STRPOS(txt,'zdef') ne -1),$
+			start*(STRPOS(txt,'tdef') ne -1),$
+			step*(STRPOS(txt,'tdef') ne -1)]
+	endif	
+endwhile
+close, 1
+timebegin=param(6)
+	
+
+;---------------------------------
+; READ .CTL FILE INFORMATIONS
+;---------------------------------
+
+info=read_ascii('input.ctl', missing_value=1e37)
+infodat=info.field1
+
+;
+; second column : dimensions
+;
+
+w=where((infodat(0,*) eq 1e37) and (infodat(1,*) lt 1e37))
+dimensions=reform(infodat(1,w))
+
+nx=round(dimensions(0)) 
+ny=round(dimensions(1)) 
+nz=round(dimensions(2)) 
+nt=round(dimensions(3)) 
+fields=round(dimensions(4)) 
+vertical=intarr(fields)
+for i=0,fields-1 do begin
+	vertical(i)=round(dimensions(5+i))
+endfor
+
+
+;
+; first column : coordinates
+;
+
+w=where((infodat(1,*) eq 1e37) and (infodat(0,*) lt 1e37))
+if (w(0) ne -1) then coordinates=reform(infodat(0,w))
+
+
+if (wnx ne 0) then begin
+
+	wnx=nx
+	x=coordinates(0:nx-1)
+
+endif else begin
+
+	xmin=param(0)
+	xmax=param(0)+param(1)*(nx-1) MOD 360
+	;inc=param(0)+param(1)*(nx-1)	;cas mercator
+	;x=start+inc*findgen(nx) 
+	x=xmin+(xmax-xmin)*findgen(nx)/(nx-1)
+	
+;param(1)=param(1)-param(0) ;;bricolo plot GCM
+;xmin=param(0)
+;xmax=param(0)+param(1)*(nx-1)
+;x=xmin+(xmax-xmin)*findgen(nx)/(nx-1)
+;;x = x - (LONG(x)/180)*360.0
+;print, x
+
+	;stop
+
+endelse
+
+
+if (wny ne 0) then begin
+        wny=ny
+	y=coordinates(wnx:wnx+wny-1)
+endif else begin
+        start=param(2)
+        step=param(3)
+        y=start+step*findgen(ny)
+endelse
+if (wnz ne 0) then begin
+        wnz=nz
+	z=coordinates(wnx+wny:wnx+wny+wnz-1)
+endif else begin
+        start=param(4)
+        step=param(5)
+        z=start+step*findgen(nz)
+endelse
+t=interv*findgen(nt)/3700. + timebegin + mean(x)/15.
+lct = round(t+24) MOD 24	
+	
+;
+; get info on fields
+;
+openr, 1, 'input.ctl'
+toto=5+wnx+1+wny+1+wnz+2+fields
+infofields=strarr(toto)
+readf, 1, infofields
+close, 1
+desc_field=transpose(infofields(toto-fields:toto-1))
+
+;
+; vert coord
+;
+if (z(0) lt z(1)) then coord='height'
+if (z(0) gt z(1)) then coord='pressure'
+if ((z(0) eq 1.) and (z(nz-1) eq (z(nz-2)+1.))) then coord='model_level'
+
+
+
+;---------------------------------
+; READ .DAT FILE DATA
+;---------------------------------
+; GrADS views gridded data sets as 5-dimensional arrays 
+; varying in longitude, latitude, vertical level, variable, and time.
+;---------------------------------
+
+;-----------------------------;
+; STARTING TO READ INPUT.DATA ;
+;-----------------------------;
+print, '----------------'
+print, 'reading data ...'
+print, '----------------'
+print, 'longitudes: ', min(x), max(x), nx, ' points'
+print, 'latitudes: ', min(y), max(y), ny, ' points' 
+print, 'altitudes: ', min(z), max(z), nz, ' points'
+print, 'local times: ', min(lct), max(lct), nt, ' points'
+print, fields, ' recorded fields :'
+print, desc_field
+print, '----------------'
+
+; see http://www.dfanning.com/tips/ascii_column_data.html	
+OPENR, lun, 'input.dat', /GET_LUN
+
+
+;
+; titles and plot name
+;
+denom=plot+'_'+coord+'_'+field1
+if ((field2 ne '') and (topo eq 0)) then denom=denom+'_'+field2
+if (topo eq 1) then denom=denom+'_HGT'
+if (winds(0) ne '') then denom=denom+'_'+winds(0)+winds(1)
+        case coord of
+	'height': charlev='Altitude (km)'
+	;'pressure': begin
+	;               H=10.
+	;               p0=6.1
+	;               z=H*alog(p0/z)
+	;               charlev='Log-Pressure altitude (km)'
+	;end
+	'model_level': charlev='Model level'
+	endcase
+																							
+
+;
+; graphics settings
+;
+!p.charthick = 2.0
+!p.thick = 3.0
+!x.thick = 2.0
+!y.thick = 2.0
+
+	; plot with topography
+	if (topo eq 1) then field2='HGT'
+
+save_ps='true'
+if (save_ps ne 'false') then begin
+;	set_plot, 'ps'
+endif else begin
+	set_plot, 'x'
+	!P.MULTI = [0, 2, 3]
+	window, 0, xsize=600, ysize=900
+endelse
+
+no3D='false'	
+print, 'GENERATE PLOTS ',min([nt-1,num-1])+1
+
+for l=0,min([nt-1,num-1]) do begin 						;time loop
+print, 'time loop ...', l+1, ' / ', string(nt,'(I0)')  
+T = SYSTIME(1)
+  for f=0, fields-1 do begin ;fields (whether 2D or 3D)	;variable loop
+  nzf=vertical(f)
+  print, 'scanning field ...', f+1, ' / ', string(fields,'(I0)')
+
+	data = FLTARR(1,nzf*ny*nx)
+	print, 'read data ...'
+	READF, lun, data	;; the IDL way, two times faster than 3 FOR loops
+	print, 'read data done'
+	
+	recognize=STRSPLIT(desc_field(f), /EXTRACT)
+	recognize=recognize[0]
+	
+;	IF (STRPOS(desc_field(f),field1) ne -1) then begin
+;       IF ( ( STRPOS(desc_field(f),field1) eq 0 ) and ( STRLEN(desc_field(f)) eq STRLEN(field1) ) ) then begin
+	IF (recognize eq field1) then begin
+		data_save=data
+		print, 'found field1 ', field1
+		data=REFORM(data,nx,ny,nzf,/OVERWRITE)
+			w=where(data eq -9999.)	; missing values: -9999 (before, was 1e20)
+			if (w(0) ne -1) then data[w]=1e37
+		CASE (plot) OF
+		'map': what_I_plot=reform(data(*,*,-1+min([level,nzf])))
+		'meridional': what_I_plot=reform(data(-1+min([nlon,nx]),*,*))
+		'zonal': what_I_plot=reform(data(*,-1+min([nlat,ny]),*))
+		ENDCASE
+		if (nzf eq 1) then no3D='true'
+		data=0. & data=data_save & data_save=0.
+	ENDIF
+;	IF ((STRPOS(desc_field(f),field2) ne -1) and (field2 ne '')) then begin
+;       IF ((STRPOS(desc_field(f),field2) eq 0) and (field2 ne '')) then begin
+;       IF ( ( STRPOS(desc_field(f),field2) eq 0 ) and ( field2 ne '' ) and ( STRLEN(desc_field(f)) eq STRLEN(field2) ) ) then begin
+        IF (recognize eq field2) then begin
+		data_save=data
+		print, 'found field2 ', field2
+		if (topo eq 1) then begin
+			data=data/100.
+			data=round(data)
+			data=float(data)/10.
+		endif	
+		data=REFORM(data,nx,ny,nzf,/OVERWRITE)
+                        w=where(data eq -9999.)   ; missing values
+			if (w(0) ne -1) then data[w]=1e37
+		CASE (plot) OF
+		'map': overcontour=reform(data(*,*,-1+min([level,nzf])))
+		'meridional': overcontour=reform(data(-1+min([nlon,nx]),*,*))
+		'zonal': overcontour=reform(data(*,-1+min([nlat,ny]),*))
+		ENDCASE
+		data=0. & data=data_save & data_save=0.
+	ENDIF   
+;	IF (STRPOS(desc_field(f),winds(0)) ne -1 and (winds(0) ne '')) then begin
+;       IF (STRPOS(desc_field(f),winds(0)) eq 0 and (winds(0) ne '')) then begin
+	IF (recognize eq winds(0)) then begin
+		data_save=data
+		print, 'found wind1 ', winds(0)
+	        data=REFORM(data,nx,ny,nzf,/OVERWRITE)
+                        w=where(data eq -9999.)   ; missing values
+			if (w(0) ne -1) then data[w]=!Values.F_NAN
+		CASE (plot) OF
+                'map': overvector_x=reform(data(*,*,-1+min([level,nzf])))
+                'meridional': overvector_x=reform(data(-1+min([nlon,nx]),*,*))
+                'zonal': overvector_x=reform(data(*,-1+min([nlat,ny]),*))
+		ENDCASE
+		data=0. & data=data_save & data_save=0.
+	ENDIF 
+;	IF (STRPOS(desc_field(f),winds(1)) ne -1 and (winds(1) ne '')) then begin
+;       IF (STRPOS(desc_field(f),winds(1)) eq 0 and (winds(1) ne '')) then begin
+        IF (recognize eq winds(1)) then begin
+		data_save=data
+		print, 'found wind2 ', winds(1)
+		data=REFORM(data,nx,ny,nzf,/OVERWRITE)
+                        w=where(data eq -9999.)   ; missing values
+	                if (w(0) ne -1) then data[w]=!Values.F_NAN
+                CASE (plot) OF
+                'map': overvector_y=reform(data(*,*,-1+min([level,nzf])))
+                'meridional': overvector_y=reform(data(-1+min([nlon,nx]),*,*))
+                'zonal': overvector_y=reform(data(*,-1+min([nlat,ny]),*))
+                ENDCASE
+		data=0. & data=data_save & data_save=0.
+	ENDIF
+	data=0.		;; free memory
+	data_save=0.         ;; free memory
+	
+  endfor
+
+	if (n_elements(overcontour) eq 0) then overcontour=0.
+	if (n_elements(overvector_x) eq 0) then overvector_x=0.
+	if (n_elements(overvector_y) eq 0) then overvector_y=0.
+	
+	@graphwrf_name.idl
+
+;;--------------------------------------------------------
+;; NB: you can use the winds fields to combine variables
+;;--------------------------------------------------------
+@wind_stress.idl	;** WIND STRESS
+@sea_level.idl		;** HYDROSTATIC REDUCTION TO LEVEL OF REFERENCE
+@ertel_vorticity.idl	;** ERTEL POTENTIAL VORTICITY
+@tau_cloud.idl          ;** CLOUD OPACITY
+@wind_velocity.idl	;** 3D WIND VELOCITY
+@hwind_velocity.idl	;** HORIZONTAL WIND VELOCITY 
+;;--------------------------------------------------------
+;; NB: you can use the winds fields to combine variables
+;;--------------------------------------------------------
+
+	title=title+', LT '+string(lct(l),'(I0)')
+
+	if (save_ps ne 'false') then begin
+	save_ps=denom+string(1000+l,'(I0)')
+;        device, filename=save_ps+'.ps', /color
+PS_Start, filename=save_ps+'.ps'
+	endif
+
+	CASE (plot) OF
+	'map': begin
+        	case coord of
+		   'height': charlev=string(round(z(level-1)*1000.),'(I0)')+' m'
+		   'pressure': charlev=string(round(z(level-1)*100.),'(I0)')+' Pa'
+		   'model_level': charlev=string(round(z(level-1)),'(I0)')
+		endcase
+        	if (no3D ne 'true') then title=title+', at level '+charlev
+		print, title
+	map_latlon, $
+        	what_I_plot, $                          ; 2D field
+        	x, $                                  ; 1D latitude
+        	y, $                                  ; 1D longitude
+        	minfield=0., $               ; minimum value of plotted field (=0: calculate)
+        	maxfield=0., $               ; maximum value of plotted field (=0: calculate)
+        	overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+        	overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+        	overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        	ct=pal, $                               ; color table (33-rainbow is default)
+        	colors=colors, $                        ; number of colors/levels (32 is default)
+        	title=title, $                     ; title of the plot ('' is default)
+        	format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+	end
+	'zonal': begin
+		displaylat=float(round(y(nlat-1)*10))/10.
+		title=title+ ', section at latitude '+string(displaylat,format='(1F6.1)')+ '!Uo!N '
+	        print, title
+	section, $
+                what_I_plot, $                          ; 2D field
+                x, $                                ; horizontal coordinate
+                z, $                             ; altitude coordinate
+                minfield=0., $               ; minimum value of plotted field (=0: calculate)
+                maxfield=0., $               ; maximum value of plotted field (=0: calculate)
+                minspace=0., $                    ; minimum value of space window (=0: calculate)
+                maxspace=0., $                    ; maximum value of space window (=0: calculate)
+                overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+                overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+                overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+                colors=colors, $                        ; number of colors/levels (32 is default)
+                title_plot=title, $                ; title of the plot ('Profile' is default)
+                title_axis=['Longitude',charlev], $             ; title of the [x,y] axis (['Field','Altitude'] is default)
+                ct=pal, $                               ; color table (33-rainbow is default)
+                format=format
+ 	end
+        'meridional': begin
+                displaylon=float(round(x(nlon-1)*10))/10.
+                title=title+', section at longitude '+string(displaylon,format='(1F6.1)')+ '!Uo!N '
+                print, title
+        section, $
+                what_I_plot, $                          ; 2D field
+                y, $                                ; horizontal coordinate
+                z, $                             ; altitude coordinate
+                minfield=0., $               ; minimum value of plotted field (=0: calculate)
+                maxfield=0., $               ; maximum value of plotted field (=0: calculate)
+                minspace=0., $                    ; minimum value of space window (=0: calculate)
+                maxspace=0., $                    ; maximum value of space window (=0: calculate)
+                overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+                overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+                overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+                colors=colors, $                        ; number of colors/levels (32 is default)
+                title_plot=title, $                ; title of the plot ('Profile' is default)
+                title_axis=['Latitude',charlev], $             ; title of the [x,y] axis (['Field','Altitude'] is default)
+                ct=pal, $                               ; color table (33-rainbow is default)
+                format=format
+        end
+ 	endcase	 
+
+	 if (save_ps ne 'false') then device, /close
+	 if (typeplot eq 's') then SPAWN, 'display '+save_ps+'.ps &'
+
+;PRINT, 1000*(SYSTIME(1) - T), ' milliSeconds'
+PRINT, SYSTIME(1) - T, ' seconds to process'
+endfor
+
+
+
+CLOSE, lun
+print, '...done !'
+help, /memory
+print, '---------'
+
+
+CASE (typeplot) OF
+'s': begin
+	;SPAWN, 'find '+denom+'????.ps -exec display {} \;'
+	SPAWN, 'cp -f graphwrf.def '+plotfolder+'/see_'+denom+'.def'
+	;SPAWN, 'mv -f ./'+denom+'????.ps '+plotfolder+'/'
+	SPAWN, '\rm ./'+denom+'????.ps' 
+end
+'t': begin
+	SPAWN, 'mv -f ./'+denom+'????.ps '+plotfolder+'/'
+	SPAWN, 'cp -f graphwrf.def '+plotfolder+'/'+denom+'.def'
+end
+'r': begin
+	SPAWN, 'touch report.comments ; \rm report.comments ; echo '+textitle+' > report.comments ; echo '+texcomments+' >> report.comments'
+	SPAWN, 'rm -f '+denom+'_.ps ; echo executing ... base '+denom+'????.ps < report.comments'
+	SPAWN, 'base '+denom+'????.ps < report.comments ; mv -f base.ps '+denom+'_.ps'
+
+	SPAWN, 'mv -f ./'+denom+'????.ps '+plotfolder+'/'
+	SPAWN, 'mv -f ./'+denom+'_.ps '+plotfolder+'/'
+	SPAWN, 'cp -f graphwrf.def '+plotfolder+'/'+denom+'.def'
+end
+'m': begin
+	print, 'generating movie ...'
+	SPAWN, 'rm -rf temp ; mkdir temp ; mv -f '+denom+'????.ps temp ; cp bigconvert200 temp ; cd temp'
+	SPAWN, 'bigconvert200 *.ps ; convert -delay 60 *.png movie.gif ; cd ..'
+	if (nomovie ne 'yes') then SPAWN, 'animate temp/movie.gif &' 
+	print, 'movie done'
+
+	SPAWN, 'mv -f temp/'+denom+'????.ps '+plotfolder+'/'
+	SPAWN, 'mv -f temp/movie.gif '+plotfolder+'/'+denom+'.gif'
+	SPAWN, 'mv -f temp/'+denom+'????.png '+plotfolder+'/'
+	SPAWN, 'cp -f graphwrf.def '+plotfolder+'/'+denom+'.def'
+end
+'w': begin
+;
+;
+netfolder='/u/aslmd/WWW/ANIMATIONS/'
+;
+; set also textitle
+;
+        print, 'generating frames ...'
+        SPAWN, 'rm -rf temp ; mkdir temp ; mv -f '+denom+'????.ps temp/ ; ls temp/'
+        SPAWN, "find temp/* -exec convert -density 100x100 -crop 0x0 {} '{}.png' \;"
+	SPAWN, 'ls temp/'
+        ;SPAWN, 'mv -f temp/'+denom+'????.ps '+plotfolder+'/'
+        SPAWN, 'cp -f graphwrf.def '+plotfolder+'/web_'+denom+'.def'
+	;; webpage
+	;SPAWN, 'rm -rf '+netfolder+textitle+'_'+denom+' ; mkdir '+netfolder+textitle+'_'+denom
+	SPAWN, 'mkdir '+netfolder+textitle
+	SPAWN, 'mv -f temp/'+denom+'????.ps.png '+netfolder+textitle+'/'
+	SPAWN, 'chmod 777 -R '+netfolder+textitle
+	SPAWN, 'rm -rf '+denom+'.html ; more header.html > '+textitle+'_'+denom+'.html'
+	genanim, num, textitle, denom 
+	SPAWN, 'more templist >> '+textitle+'_'+denom+'.html ; rm -rf templist'
+	SPAWN, 'more body.html >> '+textitle+'_'+denom+'.html'
+	SPAWN, 'mv -f '+textitle+'_'+denom+'.html '+netfolder+'/'
+end	
+ENDCASE
+
+if (backup_data eq 'yes') then SPAWN, 'cp -f namelist.ARWpost '+datafolder+'/'+coord+'.namelist.ARWpost'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.ctl '+datafolder+'/'+coord+'.input.ctl'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.dat '+datafolder+'/'+coord+'.input.dat'
+
+
+
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/header.html
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/header.html	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/header.html	(revision 207)
@@ -0,0 +1,35 @@
+<html>
+<head>
+<meta http-equiv="Pragma" content="no-cache">
+<title>LMD Martian Mesoscale Model</title>
+
+<SCRIPT LANGUAGE="JavaScript">
+<!--
+// <!--
+
+//============================================================
+//                >> jsImagePlayer 1.0 <<
+//            for Netscape3.0+, September 1996
+//============================================================
+//                  by (c)BASTaRT 1996
+//             Praha, Czech Republic, Europe
+//
+// feel free to copy and use as long as the credits are given
+//          by having this header in the code
+//
+//          contact: xholecko@sgi.felk.cvut.cz
+//          http://sgi.felk.cvut.cz/~xholecko
+//
+//============================================================
+// Thanx to Karel & Martin for beta testing and suggestions!
+//============================================================
+//
+//     modified by D. Watson and A. Earnhart (CIRA/CSU), 7/30/97
+//     and Greg Thompson (NCAR/RAP) May 07, 2000
+//	   graphic & php enhancement, Kristin Conrad (NCAR/MMM) Dec 2004
+//
+//============================================================
+ 
+//********* SET UP THESE VARIABLES - MUST BE CORRECT!!!*********************
+modImages = new Array(); 
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/hovmuller.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/hovmuller.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/hovmuller.pro	(revision 207)
@@ -0,0 +1,205 @@
+pro hovmuller, $
+	what_I_plot, $				; 2D field
+	space, $				; space coordinate
+	time, $					; time coordinate
+	minfield=minfield_init, $		; minimum value of plotted field (=0: calculate)
+	maxfield=maxfield_init, $		; maximum value of plotted field (=0: calculate)
+	minspace=minspace, $			; minimum value of space window (=0: calculate)
+	maxspace=maxspace, $			; maximum value of space window (=0: calculate)
+	overcontour=overcontour, $		; another 2D field to overplot with contour lines (=0: no)
+	ct=pal, $				; color table (33-rainbow is default)
+	colors=colors, $			; number of colors/levels (32 is default)
+	title=title				; title of the plot ('' is default)
+
+;--------------------------------------------
+;
+; A general routine to plot hovmuller maps
+;
+; USE:	- hovmuller, what_I_plot 	
+;	- hovmuller, what_I_plot, space, time
+;	- ... and see options above
+;
+;--------------------------------------------
+; A. Spiga, September 2007
+;--------------------------------------------
+
+
+
+
+;---------------------------
+; a few permanent settings
+;---------------------------
+;
+missing_value=1.e30
+@param_plot.idl
+;
+;------------------
+
+
+;------------------
+; user settings
+;------------------
+if (n_elements(space) eq 0) then begin
+	space=findgen(n_elements(what_I_plot(*,0)))
+endif
+if (n_elements(time) eq 0) then begin
+	time=findgen(n_elements(what_I_plot(0,*)))
+endif
+
+if (n_elements(minfield_init) eq 0) then minfield_init=0.
+if (n_elements(maxfield_init) eq 0) then maxfield_init=0.
+if (n_elements(minspace) eq 0) then minspace=0.
+if (n_elements(maxspace) eq 0) then maxspace=0.
+if (n_elements(colors) eq 0) then colors=32
+if (n_elements(title) eq 0) then title=''
+if (n_elements(pal) eq 0) then pal=33
+if (n_elements(overcontour) eq 0) then overcontour=0.
+if (n_elements(titlex) eq 0) then titlex='space'
+if (n_elements(titley) eq 0) then titley='time'
+
+;------------------
+; limits
+;------------------
+if (minfield_init*maxfield_init eq 0) then begin   
+	;---different min/max for each layer
+	w=where(abs(what_I_plot) lt missing_value)
+	if (w(0) ne -1) then begin
+		minfield=min(what_I_plot[w])
+		maxfield=max(what_I_plot[w])
+	endif else begin
+		what_I_plot=0.
+		print, 'no valid values in this field' 
+	endelse
+endif else begin
+	;---user-defined limits	
+	minfield=minfield_init 
+	maxfield=maxfield_init
+	;;w=where(what_I_plot lt minfield) & if (w(0) ne -1) then what_I_plot[w]=minfield
+	;;w=where(what_I_plot gt maxfield) & if (w(0) ne -1) then what_I_plot[w]=maxfield
+endelse
+
+if ((minfield+maxfield eq 0) and (abs(minfield) ne abs(maxfield))) then begin
+	print, 'nothing to plot ... skipping this plot ...'
+endif else begin
+
+
+
+;-----------------------------------------
+; fix the possible longitude ugliness :)
+; ...get rid of the -180/180 limit
+;-----------------------------------------
+
+w=where(space eq min(space))
+if (w(0) ne 0) then begin
+	space[0:w(0)-1]=space[0:w(0)-1]-360
+endif
+
+
+;---------------
+; adapt ticks
+;---------------
+if ((minspace eq 0) and (maxspace eq 0)) then begin
+	minspace=min(space)
+	maxspace=max(space)
+endif
+intervalx=round((maxspace-minspace)/8.)
+intervaly=round((max(time)-min(time))/5.)
+intervalx=60.
+intervaly=4.
+
+
+;------------------
+; plot window
+;------------------
+
+	; to ensure the right limits
+	dumb_what_I_plot=what_I_plot
+	dumb_what_I_plot(*,*)=minfield & print, minfield
+	dumb_what_I_plot(0,0)=maxfield & print, maxfield
+
+
+loadct,0,/silent  
+contour, $
+	/nodata, $ 
+	dumb_what_I_plot, $
+	space, $
+	time, $
+	title=title, $
+	xtitle=titlex, $
+	xrange=[minspace,maxspace], $
+	ytitle=titley, $
+	yrange=[min(time),max(time)], $
+	xtickinterval=intervalx, ytickinterval=intervaly, $
+;	position=[0.15, 0.15, 0.95, 0.75], $
+	color=0
+
+
+
+;------------------
+; plot field
+;------------------
+
+;lim=45.
+;ecart=5.
+;yeah=-lim + ecart*findgen(lim*2./5.)
+
+loadct,pal,/silent
+contour, what_I_plot, $
+	space, $
+	time, $
+	nlevels=colors, $
+;lev=yeah, $
+	/cell_fill, $
+	max_value=maxfield, $
+	min_value=minfield, $	
+	/overplot
+
+
+;------------------
+; colorbar
+;------------------
+
+;;format_colorbar='(F6.2)'
+;;format_colorbar='(F10.3)'
+;;format_colorbar='(F12.2)'
+;format_colorbar='(F4.0)'  ;temperature
+;colorbar, $
+;;	position=[0.15, 0.85, 0.95, 0.90], $
+;	/vertical, $
+;	divisions=8, $
+;	range=[minfield,maxfield], $
+;	format=format_colorbar
+
+;--------------------
+; overplot contour
+;--------------------
+if (n_elements(overcontour) ne 1) then begin
+
+	w=where(abs(overcontour) lt missing_value)
+	if (w(0) ne -1) then begin
+		min_contour=min(overcontour[w])
+		max_contour=max(overcontour[w])
+	endif
+
+loadct,0,/silent
+contour, overcontour, $
+	space,time, $
+	nlevels=colors/2, $
+	max_value=max_contour, $
+	min_value=min_contour, $	
+	c_labels=findgen(colors/2), $
+	color=0, $
+	/noerase, $
+	xtitle='space', $
+	xrange=[min(space),max(space)], $
+	ytitle='time', $
+	yrange=[min(time),max(time)], $
+	xtickinterval=intervalx, ytickinterval=intervaly, $
+	position=[0.15, 0.15, 0.95, 0.75]
+
+endif
+
+
+endelse
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/hwind_velocity.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/hwind_velocity.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/hwind_velocity.idl	(revision 207)
@@ -0,0 +1,34 @@
+
+;
+; field1='U'
+; winds=['U','V']
+;
+
+if ( (field1 eq 'U') $
+	and (winds(0) eq 'U') $
+        and (winds(1) eq 'V')  ) then begin
+
+print, 'computing wind velocity'
+
+title='Horizontal wind velocity (!Nm!N.s!U-1!N)'
+
+u=overvector_x
+v=overvector_y
+
+help, u
+help, v
+
+velocity2=u^2+v^2
+what_I_plot=sqrt(velocity2)
+
+;overcontour=sqrt(velocity2)
+
+;;
+;; comment if you want wind vectors
+;;
+;overvector_x=0
+;overvector_y=0
+
+pal=22
+
+endif
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/map_ertel_vorticity.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/map_ertel_vorticity.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/map_ertel_vorticity.idl	(revision 207)
@@ -0,0 +1,15 @@
+;----------------------------
+; ERTEL POTENTIAL VORTICITY
+;----------------------------
+
+; -- keep --
+plot='map'
+field1='T'
+winds=['U','V']
+; -- keep --
+
+colors=32
+field2=''
+range=0.
+topo=0
+level=-1
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/map_sea_level.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/map_sea_level.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/map_sea_level.idl	(revision 207)
@@ -0,0 +1,16 @@
+;------------------
+;PRESSURE SEA LEVEL
+;------------------
+
+; -- keep --
+IF (coord ne 'model_level') THEN STOP
+plot='map'
+level=1		;;necessary for surface fields
+field1='PSFC'
+winds=['tk','HGT']
+; -- keep --
+
+colors=32
+field2=''
+range=0.
+topo=1
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/map_wind_stress.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/map_wind_stress.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/map_wind_stress.idl	(revision 207)
@@ -0,0 +1,14 @@
+
+; -- keep --
+;;IF (coord ne 'model_level') THEN STOP
+plot='map'
+level=1		;;necessary for surface fields
+field1='U'
+field2='V'
+winds=['PSFC','tk']
+; -- keep --
+
+colors=32
+range=[0.,0.1]
+topo=0.
+format='(F6.3)'
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/model_levels.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/model_levels.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/model_levels.pro	(revision 207)
@@ -0,0 +1,95 @@
+pro model_levels, plotlev
+;; first is one (as in gw.def)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+file = './zefolder/'
+file = file + 'wrfout_d01_2024-03-21_00:00:00'
+
+file = './wrfout_d01_9999-09-09_09:00:00' 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;
+;; ini
+;;
+;if (n_elements(plotlev) eq 0) then plotlev=7
+
+;set_plot, 'ps'
+;device, filename='model_levels.ps'
+
+;
+; constantes
+;
+grav = 3.72
+
+;
+; retrieve model geopotential
+;
+openr,unit,'heights.dat',/get_lun,error=err
+;IF (err ne 0) THEN BEGIN
+	getcdf, $
+	        file=file, $
+	        charvar='PHTOT', $
+	        invar=geop
+        getcdf, $
+                file=file, $
+                charvar='HGT', $
+                invar=hgt
+;	save, geop, filename='heights.dat'
+;ENDIF ELSE BEGIN
+;	restore, filename='heights.dat'
+;ENDELSE
+
+;
+; size
+;
+s = size(geop)
+nx = s[1] ;& print, nx 
+ny = s[2] ;& print, ny
+nz = s[3] ;& print, nz
+nt = s[4] ;& print, nt
+
+if (n_elements(plotlev) eq 0) then plotlev=nz-1
+
+for lev = 1, nz-1 do begin
+
+print, '*************************************************************************'
+print, 'model level ', lev
+ 
+;
+; heights of model levels
+;
+;height = (geop(*,*,lev-1,*) - geop(*,*,0.,*)) / grav
+height = fltarr(nx,ny,nt)
+for i=0,nt-1 do height(*,*,i) = geop(*,*,lev-1,i) / grav - hgt(*,*)
+
+;
+; spatial mean (temporal variations)
+;
+yes = TOTAL(TOTAL(height,1),1) / float(nx) / float(ny)
+print, 'spat. mean (temp. var.) ', mean(yes), max(yes), min(yes);, max(yes) - min(yes)
+
+;
+; temporal mean (spatial variations)
+;
+yet = TOTAL(height,3) / float(nt)  
+print, 'temp. mean (spat. var.) ', mean(yet), max(yet), min(yet);, max(yet) - min(yet)
+
+;
+; complete mean
+;
+ye = TOTAL(TOTAL(TOTAL(height,1),1),1) / float(nx) / float(ny) / float(nt)
+print, '******* mean ', ye 
+
+if (lev eq plotlev) then begin
+	!p.multi=[0,2,1]
+	contour, yet, /cell_fill, nlevels=30, title=string(min(yet))+string(max(yet))
+	plot, yes, yrange=[min(yes),max(yes)]
+	stop
+endif
+
+endfor
+
+;device, /close
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/model_levels.sh
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/model_levels.sh	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/model_levels.sh	(revision 207)
@@ -0,0 +1,4 @@
+#! /bin/bash
+
+\rm model_levels.txt
+echo "model_levels & exit" | /distrib/local/rsi/idl_6.1/bin/idl > model_levels.txt
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/movie.idl_old
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/movie.idl_old	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/movie.idl_old	(revision 207)
@@ -0,0 +1,55 @@
+;;---------------------------------------
+;  MOVIES
+;
+;  check parameters then type:
+;
+;  @movie.idl
+;
+;;---------------------------------------
+
+@user.idl
+
+denom=plot+'_'+coord+'_'+field1
+
+if (already_data eq 'yes') then SPAWN, 'ln -sf  '+folder+'/'+coord+'.input.ctl input.ctl'
+if (already_data eq 'yes') then SPAWN, 'ln -sf  '+folder+'/'+coord+'.input.dat input.dat'
+
+SPAWN, '\rm map_latlon_user'
+SPAWN, 'tail -15 user.idl > map_latlon_user'
+.compile map_latlon
+
+SPAWN, '\rm section_user'
+SPAWN, 'tail -15 user.idl > section_user'
+.compile section
+
+for i=1,num do $
+	out_wrf, $
+	plot=plot, $
+	field1=field1, $
+	field2=field2, $
+	when=i, $
+	winds=winds, $
+	level=level,$
+        save_data=yeah,$
+	topo=topo,$
+	range=range,$
+	colors=colors, $
+	nlon=nlon, $
+	nlat=nlat 
+
+print, 'generating movie ...'
+SPAWN, 'rm -rf temp'
+SPAWN, 'mkdir temp'
+SPAWN, 'mv -f '+denom+'??.ps temp'
+SPAWN, 'cp bigconvert200 temp'
+SPAWN, 'cd temp ; bigconvert200 *.ps ; convert -delay 60 *.png movie.gif ; cd ..'
+if (nomovie ne 'yes') then SPAWN, 'animate temp/movie.gif &' 
+print, 'done'
+SPAWN, 'mv -f temp/'+denom+'??.ps '+folder+'/'
+SPAWN, 'mv -f temp/movie.gif '+folder+'/'+denom+'.gif'
+SPAWN, 'mv -f temp/'+denom+'??.png '+folder+'/'
+if (backup_data eq 'yes') then SPAWN, 'cp -f namelist.ARWpost '+folder+'/'+coord+'.namelist.ARWpost'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.ctl '+folder+'/'+coord+'.input.ctl'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.dat '+folder+'/'+coord+'.input.dat'
+
+SPAWN, 'cp -f user.idl '+folder+'/'+denom+'.idl'
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/movie.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/movie.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/movie.idl	(revision 207)
@@ -0,0 +1,85 @@
+;;---------------------------------------
+;  MOVIE
+;
+;  **** DO NOT MODIFY ****
+;
+;  set parameters in plot.def then type:
+;
+;  @movie.idl
+;
+;;---------------------------------------
+
+field1='' & field2='' & winds=''
+backup_data='no' & already_data='no'  	
+datafolder='./' & plotfolder='./'
+nomovie='yes'
+topo=0
+extract='no'
+
+SPAWN, '\rm user.idl'
+SPAWN, 'grep -v grep plot.def > user.idl'
+
+;; to avoid dumb and useless warnings from IDL
+space=0. & altitude=0. & lon=0. & lat=0.
+what_I_plot=0. & title_user='' & missing_value=0.
+
+@user.idl
+if (nam5 eq " interp_method = 0 ") then coord='height'
+if ((nam5 eq " interp_method = 1 ") and (tabnam(0) lt tabnam(1))) then coord='height'
+
+.compile call_arwpost
+if (extract eq 'yes') then call_arwpost, nam1, nam2, nam3, nam4, nam5, tabnam
+
+denom=plot+'_'+coord+'_'+field1
+if ((field2 ne '') and (topo eq 0)) then denom=denom+'_'+field2
+if (topo eq 1) then denom=denom+'_HGT'
+if (winds(0) ne '') then denom=denom+'_'+winds(0)+winds(1)
+
+if (already_data eq 'yes') then SPAWN, 'ln -sf  '+datafolder+'/'+coord+'.input.ctl input.ctl'
+if (already_data eq 'yes') then SPAWN, 'ln -sf  '+datafolder+'/'+coord+'.input.dat input.dat'
+
+SPAWN, '\rm param_plot.idl'
+SPAWN, 'grep grepALL plot.def > param_plot.idl'
+if ((plot eq 'meridional') or (plot eq 'zonal')) then SPAWN, 'grep grepSEC plot.def >> param_plot.idl'
+if (plot eq 'map') then SPAWN, 'grep grepMAP plot.def >> param_plot.idl'
+.compile map_latlon
+.compile section
+
+!p.charthick = 2.0
+!p.thick = 3.0
+!x.thick = 2.0
+!y.thick = 2.0
+
+for i=1,num do $
+        out_wrf, $
+        plot=plot, $
+        field1=field1, $
+        field2=field2, $
+        when=i, $
+        winds=winds, $
+        level=level,$
+        save_data=yeah,$        ;; data is loaded only once
+        topo=topo,$
+;        range=range,$
+        colors=colors, $
+        nlon=nlon, $
+        nlat=nlat, $
+        save_ps=denom+string(1000+i,'(I0)')
+
+print, 'generating movie ...'
+SPAWN, 'rm -rf temp'
+SPAWN, 'mkdir temp'
+SPAWN, 'mv -f '+denom+'????.ps temp'
+SPAWN, 'cp bigconvert200 temp'
+SPAWN, 'cd temp ; bigconvert200 *.ps ; convert -delay 60 *.png movie.gif ; cd ..'
+if (nomovie ne 'yes') then SPAWN, 'animate temp/movie.gif &' 
+print, 'movie done'
+
+SPAWN, 'mv -f temp/'+denom+'????.ps '+plotfolder+'/'
+SPAWN, 'mv -f temp/movie.gif '+plotfolder+'/'+denom+'.gif'
+SPAWN, 'mv -f temp/'+denom+'????.png '+plotfolder+'/'
+if (backup_data eq 'yes') then SPAWN, 'cp -f namelist.ARWpost '+datafolder+'/'+coord+'.namelist.ARWpost'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.ctl '+datafolder+'/'+coord+'.input.ctl'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.dat '+datafolder+'/'+coord+'.input.dat'
+
+SPAWN, 'cp -f plot.def '+plotfolder+'/'+denom+'.def'
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/out_diagfi.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/out_diagfi.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/out_diagfi.pro	(revision 207)
@@ -0,0 +1,471 @@
+pro out_diagfi,	$
+		plot=plot_user, $		; 'map', 'profile' (default is 'map')
+	;----------------
+	; input fields
+	;----------------
+		field1=field_user, $		; field to contour: 'u', 'v', 'temp', ... etc ...
+		field2=fieldc_user, $		; field to overplot (contour lines, optional)
+	;------------------------------------------------------
+	; 'map' options (no effect when plot is 'profile')
+	;------------------------------------------------------
+		topo=topo, $			; overplot topography contours (!! must load phisinit !! override field2)
+		winds=winds, $			; option to overplot winds (e.g. =['U','V'])
+		level=level, $			; vertical level subscript (starts at 1 ...)(if -1: all levels)
+	;------------------------------------------------------
+	; 'profile' options (no effect when plot is 'map')
+	;------------------------------------------------------
+		inprofile=inprofile, $		; a profile to compare with ... (override field2)
+		incolumn=incolumn, $		; altitudes ... in case /= column
+		;; NB: inprofile and incolumn may be used to output profiles
+		;; ... reset with inprofile=0, incolumn=0
+	;----------------
+	; choose time
+	;----------------
+		when=when, $			; time subscript (starts at 1 ...)(if -1: first time step)
+	;----------------
+	; plot options
+	;----------------
+		range=range_user, $		; range=[min,max]
+		colors=colors, $		; 16, 32, 64, ... etc
+	;-------------------------
+	; no useless data loading
+	;-------------------------
+		save_data=save_data		; to avoid loading data if already done once
+
+
+;---------------------------------------------------------------------------
+;
+; A general routine to plot diagfi.nc GCM outputs
+;
+; USE: see out_wrf
+;
+;---------------------------------------------------------------------------
+; A. Spiga, August 2007, adding plot keyword September 2007
+;---------------------------------------------------------------------------
+
+
+
+;-------------------------------------
+; default settings and user settings
+;-------------------------------------
+charend=''
+diff_scale=0  ;1
+if (n_elements(plot_user) eq 0) then plot_user='map'
+if (n_elements(field_user) eq 0) then field_user='all'
+if (n_elements(level) eq 0) then level=-1
+if (n_elements(when) eq 0) then when=-1
+if (n_elements(colors) eq 0) then colors=32
+if (n_elements(minfield_init)*n_elements(maxfield_init) eq 0) then begin
+	minfield_init = 0.
+	maxfield_init = 0.
+endif
+
+if (n_elements(range_user) eq 2) then begin
+	minfield_init=float(range_user(0))
+	maxfield_init=float(range_user(1))
+	print, 'setting user limits !', minfield_init, maxfield_init 
+	diff_scale=1
+endif
+
+
+
+;******************************************************************************
+;
+; BEGIN: different from out_wrf
+;
+;******************************************************************************
+
+;TEMP TEMP
+vert_coord='sigma'
+;vert_coord='pressure'
+;vert_coord='height'
+;TEMP TEMP
+
+;----------------------
+; set parameters
+;----------------------
+file='input.diagfi'
+if (n_elements(topo) ne 0) then fieldc_user='phisinit'	;case with topography
+
+
+
+;----------------------------------------------------
+; Open diagfi file GCM and get coordinates & field
+;----------------------------------------------------
+cdfid = ncdf_open(file)
+
+print, 'read coord ...'
+varid=ncdf_varid(cdfid,'latitude')
+        ncdf_varget, cdfid, varid, lat_gcm
+varid=ncdf_varid(cdfid,'longitude')
+        ncdf_varget, cdfid, varid, lon_gcm
+varid=ncdf_varid(cdfid,'Time')
+        ncdf_varget, cdfid, varid, hour
+lon=lon_gcm
+west_east=n_elements(lon)
+lat=lat_gcm
+south_north=n_elements(lat)
+print, 'done !'
+;;print, 'time ...', hour*24 MOD 24, ' hours and day number ', ceil(hour)
+
+; field
+if (n_elements(save_data) eq 0) then begin
+	print, 'read data ...'
+	varid=ncdf_varid(cdfid,field_user)
+		ncdf_varget, cdfid, varid, var
+		bottom_top=n_elements(var(0,0,*,0))
+		time=n_elements(var(0,0,0,*))
+;save_array=fltarr(3,west_east,south_north,bottom_top,time)
+;save_array(0,*,*,*,*)=var(*,*,*,*)
+;;**NB: ralentit beaucoup
+	print, 'done !'
+endif else begin	
+	var=reform(save_data(0,*,*,*,*))
+		bottom_top=n_elements(var(0,0,*,0))
+		time=n_elements(var(0,0,0,*))
+endelse
+
+print, 'vertical levels in file ... ', bottom_top
+print, 'time steps in file ...', time
+
+
+
+	;-----------------------------
+	; min/max on the whole field
+	;-----------------------------
+	w=where(abs(var) lt 1e30)
+	if (w(0) ne -1) then begin
+		minfield=min(var[w])
+		maxfield=max(var[w])
+			;;; manage unvalid points
+			;;;w=where(var eq 1e37)
+			;;;if (w(0) ne -1) then var[w]=!Values.F_NAN
+	endif else begin
+		var=0
+		print, 'no valid values in this field', charvar 
+	endelse
+
+
+
+;---------------------
+; Get altitude
+;---------------------
+if (vert_coord ne 'pressure') then begin
+	print, 'read altitude ...'
+	varid=ncdf_varid(cdfid,'aps')
+        	ncdf_varget, cdfid, varid, aps
+	varid=ncdf_varid(cdfid,'bps')
+        	ncdf_varget, cdfid, varid, bps
+	varid=ncdf_varid(cdfid,'ps')
+        	ncdf_varget, cdfid, varid, ps
+	varid=ncdf_varid(cdfid,'altitude')
+        	ncdf_varget, cdfid, varid, z
+	print, 'done !'
+endif else begin
+	print, 'read altitude ...'
+	varid=ncdf_varid(cdfid,'altitude')
+        	ncdf_varget, cdfid, varid, z
+	z=z/100.   ;mbar
+	print, 'done !'
+endelse
+
+
+;-------------
+; Get winds
+;-------------
+if (n_elements(winds) ne 0) then begin
+if (n_elements(save_data) eq 0) then begin
+	print, 'read winds ...'
+	varid=ncdf_varid(cdfid,winds(0))
+		ncdf_varget, cdfid, varid, u
+	varid=ncdf_varid(cdfid,winds(1))
+		ncdf_varget, cdfid, varid, v
+	;save_array(1,*,*,*,*)=u(*,*,*,*)
+	;save_array(2,*,*,*,*)=v(*,*,*,*)
+	print, 'done !'
+endif else begin	
+	u=reform(save_data(1,*,*,*,*))
+	v=reform(save_data(2,*,*,*,*))
+endelse
+endif
+
+;-------------------------------
+; Get another field to contour
+;-------------------------------
+if (n_elements(fieldc_user) ne 0) then begin
+	print, 'get alternate field ...'
+	varid=ncdf_varid(cdfid,fieldc_user)
+		ncdf_varget, cdfid, varid, varcontour
+	print, 'done !'
+endif
+
+
+;;-------------------------------
+;; Save data for further use ...
+;;-------------------------------
+;if (n_elements(save_data) eq 0) then begin
+;	save_data=save_array
+;	save_array=0. ;free 'save_array' array
+;endif
+
+
+;---------------------------------
+; Some stuff for continuity
+;---------------------------------
+;;if (vert_coord ne 'pressure') then surfpres=reform(ps(*,*,nt))
+;;A CORRIGER - A METTRE DANS LA BOUCLE
+if (vert_coord ne 'pressure') then surfpres=reform(ps(*,*,0))
+if (vert_coord eq 'sigma') then begin
+	z=aps/surfpres(0,0)+bps
+	z=z*100.
+	vert_coord='model_level'
+endif
+charend='_diagfi'
+
+case field_user of 
+'temp': charvar='tk'
+'u': charvar='U'
+'v': charvar='V'
+'ps': charvar='PSFC'
+else:
+endcase
+
+;;
+;;
+
+
+;******************************************************************************
+;
+; END: different from out_wrf
+;
+;******************************************************************************
+
+
+
+;----------------------
+; initialize graphics
+;----------------------
+
+!p.charthick = 2.0
+!p.thick = 3.0
+!x.thick = 2.0
+!y.thick = 2.0
+
+if (when ne -1) then charend=charend+string(when, '(I0)')
+
+set_plot, 'ps'
+device, filename=plot_user+'_'+vert_coord+'_'+charvar+charend+'.ps', /color
+
+case charvar of
+'tk': begin
+	title='Temperature (K)'
+	pal=3
+end
+'U': begin
+	title='Zonal wind (!Nm!N.s!U-1!N)'
+	pal=33
+end
+'V': begin
+	title='Zonal wind (!Nm!N.s!U-1!N)'
+	pal=33
+end
+'pressure': begin
+	title='Pressure (hPa)'
+	pal=16
+end
+'height': begin
+	title='Height (km)'
+	pal=16
+end
+'T': title='Potential temperature departure from t0 (K)'
+'W': title='Vertical wind (!Ncm!N.s!U-1!N)'
+else: title=''
+endcase
+title_save=title
+
+
+
+;---------------------------------
+; choose positioning ...
+;---------------------------------
+
+case plot_user of
+'map': begin
+;
+; 1. map: looping on vertical levels
+;
+	if (level eq -1) then begin
+		theloopmin=0
+		theloopmax=bottom_top-1
+	endif else begin
+		theloopmin=level-1 ;!! IDL arrays starts at 0
+		theloopmax=level-1
+	endelse	
+	if (when eq -1) then nt = 0 else nt=when-1
+end
+'profile': begin
+;
+; 2. profile: looping on time
+;
+	;;discrete=4
+	title_axis=strarr(2)
+	title_axis(0)=title_save
+	if (when eq -1) then begin
+		theloopmin=0
+		theloopmax=time-1
+	endif else begin
+		theloopmin=when-1 ;!! IDL arrays starts at 0
+		theloopmax=when-1
+	endelse	
+
+	column=z
+	case vert_coord of
+		'height': title_axis(1)='Altitude (km)'
+		'pressure': begin
+			H=10.
+			p0=6.1
+			column=H*alog(p0/z)
+			title_axis(1)='Log-Pressure altitude (km)'
+		end
+		'model_level': title_axis(1)='Model level'
+	endcase
+
+;****TEMP
+nx=round(west_east/2)
+ny=round(south_north/2)
+;****TEMP
+
+	displaylat=float(round(lat(ny)*100))/100.
+	displaylon=float(round(lon(nx)*100))/100.
+	description='WRF Profile at latitude '+string(displaylat,format='(1F6.2)')+$
+	'!Uo'+'!N and longitude '+string(displaylon,format='(1F7.2)')+'!Uo!N '
+	title=description
+
+end
+else: stop
+endcase
+
+
+;-------------
+; plot loop
+;-------------	
+for theloop=theloopmin,theloopmax do begin
+
+case plot_user of
+'map': begin
+	;
+	; case 1: map
+	;	
+	case vert_coord of
+	'height': charlev=string(round(z(theloop)*1000.),'(I0)')+' m'
+	'pressure': charlev=string(round(z(theloop)*100.),'(I0)')+' Pa'
+	'model_level': charlev=string(round(z(theloop)),'(I0)')
+	endcase
+	title=title_save+' at level '+charlev
+	print, title
+
+	;-------------
+	; draw map
+	;-------------
+
+	what_I_plot=var[*,*,theloop,nt]
+
+	if (diff_scale eq 0) then begin
+		minfield_init=minfield	;-same scale for all levels 
+		maxfield_init=maxfield	;-same scale for all levels
+	endif
+	if (n_elements(fieldc_user) eq 0) then begin
+		overcontour=0.
+	endif else begin
+		if (n_elements(topo) ne 0) then begin
+			overcontour=varcontour[*,*,0,0] ; other levels than 0 are blank !
+		endif else begin
+			overcontour=varcontour[*,*,theloop,nt]
+		endelse
+	endelse
+	if (n_elements(winds) eq 0) then begin
+		overvector_x=0.
+		overvector_y=0.
+	endif else begin
+		overvector_x=u[*,*,theloop,nt]
+		overvector_y=v[*,*,theloop,nt]
+	endelse
+
+
+	map_latlon, $
+		what_I_plot, $
+		lon, $
+		lat, $
+		ct=pal, $
+		minfield=minfield_init, $
+		maxfield=maxfield_init, $
+		overcontour=overcontour, $
+		overvector_x=overvector_x, $
+		overvector_y=overvector_y, $
+		colors=colors, $
+		title=title
+end
+'profile': begin
+	;
+	; case 2: profile
+	;
+	print, title
+
+	what_I_plot=var[nx,ny,*,theloop]
+	if (diff_scale eq 0) then begin
+		minfield_init=minfield	;-same scale for all levels 
+		maxfield_init=maxfield	;-same scale for all levels
+	endif
+	if (n_elements(fieldc_user) eq 0) then begin
+		overcontour=0.
+		overcontourz=0.
+	endif else begin
+		overcontour=varcontour[nx,ny,*,theloop]
+		overcontourz=0.
+	endelse
+	if (n_elements(inprofile) gt 1) then begin
+		overcontour=inprofile
+		overcontourz=0.
+		if (n_elements(incolumn) gt 1) then overcontourz=incolumn
+	endif
+
+	profile, $
+		what_I_plot, $				; 1D vertical profile
+		column, $				; altitudes	
+	;	alt=alt, $				; altitude range [altmin, altmax]
+		minfield=minfield_init, $		; minimum value of plotted field (=0: calculate)
+		maxfield=maxfield_init, $		; maximum value of plotted field (=0: calculate)
+		inprofile=overcontour, $		; another vertical profile to overplot
+		incolumn=overcontourz, $		; altitudes of the other vertical profile (in case /= column)
+		title_plot=title, $			; title of the plot ('Profile' is default)
+		title_axis=title_axis, $		; title of the [x,y] axis (['Field','Altitude'] is default)
+	;	mention=mention, $			; add text precision within the plot window (default is nothing or '')
+		discrete=discrete			; show the profile points (= type of points in !psym)
+end
+else: 
+endcase
+
+
+
+endfor
+device, /close
+
+	; save the profiles for another plot (last of the time loop)
+	if ((n_elements(inprofile) le 1) and (plot_user eq 'profile')) then begin
+		inprofile=what_I_plot
+		incolumn=column
+	endif
+
+
+;******************************************************************************
+;
+; BEGIN: different from out_wrf
+;
+;******************************************************************************
+;;;skip:
+;;;endfor
+
+end
+
+
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/out_diagfi_new.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/out_diagfi_new.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/out_diagfi_new.pro	(revision 207)
@@ -0,0 +1,768 @@
+pro out_diagfi, $
+		plot=plot_user, $		; 'map', 'profile', 'hovmuller', 'meridional', 'zonal' (default is 'map')
+	;----------------
+	; input fields
+	;----------------
+		field1=field_user, $		; field to contour: 'U', 'V', 'tk', ... etc ...
+		field2=fieldc_user, $		; field to overplot (contour lines, optional)
+	;------------------------------------------------------
+	; 'map' options (no effect when plot is 'profile')
+	;------------------------------------------------------
+		topo=topo, $			; overplot topography contours (!! must load HGT !! override field2)
+		winds=winds, $			; option to overplot winds (e.g. =['U','V'])
+		level=level, $			; vertical level subscript (starts at 1 ...)(if -1: all levels)
+	;------------------------------------------------------
+	; 'profile' options (no effect when plot is 'map')
+	;------------------------------------------------------
+		inprofile=inprofile, $		; a profile to compare with ... (override field2)
+		incolumn=incolumn, $		; altitudes ... in case /= column
+		;; NB: inprofile and incolumn may be used to output profiles
+		;; ... reset with inprofile=0, incolumn=0
+	;----------------
+	; choose time
+	;----------------
+		when=when, $			; time subscript (starts at 1 ...)(if -1: first time step)
+	;----------------
+	; choose latitude/longitude
+	;----------------
+		nlat=nlat, $			; latitude subscript (starts at 1 ...)(if -1: all latitudes)(default is middle)
+		nlon=nlon, $			; longitude subscript (starts at 1 ...)(if -1: all longitudes)(default is middle)
+	;----------------
+	; plot options
+	;----------------
+		range=range_user, $		; range=[min,max]
+		colors=colors, $		; 16, 32, 64, ... etc
+	;-------------------------
+	; no useless data loading
+	;-------------------------
+		save_data=save_data		; to avoid loading data if already done once
+
+
+
+;---------------------------------------------------------------------------
+;
+; A general routine to plot ARWpost outputs
+;
+; USE:
+; - out_wrf	(will plot everything !)
+; - out_wrf, field1='tk', range=[160,300]
+;
+; - out_wrf, field1='pressure', field2='tk'
+; - out_wrf, field1=TSK, field2=HGT, winds=['U','V'] 
+;
+; - out_wrf, save_data=field
+;   ... then next calls including 'save_data=field' won't include the data loading 
+;
+; - out_wrf, field1='tk', winds=['umet','vmet'], topo=1, save_data=yeah, level=1, when=2
+;
+; - out_wrf, field1='tk', plot='profile'
+;
+; - out_wrf, plot='profile', field1='tk', when=1, inprofile=inprofile, incolumn=incolumn
+;   out_diagfi, plot='profile', field1='temp', when=112, inprofile=inprofile, incolumn=incolumn 	
+;
+; - out_wrf, plot='meridional',field1='U'
+;
+; - out_wrf, plot='hovmuller',field1='TSK'
+;
+; - out_wrf, plot='zonal',field1='V', nlat=-1
+; 
+;---------------------------------------------------------------------------
+; A. Spiga, August 2007, adding plot keyword September 2007
+;---------------------------------------------------------------------------
+
+
+    
+
+
+;-------------------------------------
+; default settings and user settings
+;-------------------------------------
+diff_scale=0  ;;1
+charend=''
+format=''
+if (n_elements(plot_user) eq 0) then plot_user='map'
+if (n_elements(field_user) eq 0) then field_user='all'
+if (n_elements(level) eq 0) then level=-1
+if (n_elements(when) eq 0) then when=-1
+;;if (n_elements(nlon) eq 0) then nlon=-1
+;;if (n_elements(nlat) eq 0) then nlat=-1
+if (n_elements(colors) eq 0) then colors=32
+if (n_elements(minfield_init)*n_elements(maxfield_init) eq 0) then begin
+	minfield_init = 0.
+	maxfield_init = 0.
+endif
+
+if (n_elements(range_user) eq 2) then begin
+	minfield_init=float(range_user(0))
+	maxfield_init=float(range_user(1))
+	print, 'setting user limits !', minfield_init, maxfield_init 
+	diff_scale=1
+endif
+
+if (n_elements(topo) ne 0) then fieldc_user='HGT'	;case with topography
+
+
+
+;******************************************************************************
+;
+; BEGIN: different from out_wrf
+;
+;******************************************************************************
+
+;TEMP TEMP
+vert_coord='sigma'
+;vert_coord='pressure'
+;vert_coord='height'
+;TEMP TEMP
+
+;----------------------
+; set parameters
+;----------------------
+file='input.diagfi'
+if (n_elements(topo) ne 0) then fieldc_user='phisinit'	;case with topography
+
+
+
+;----------------------------------------------------
+; Open diagfi file GCM and get coordinates & field
+;----------------------------------------------------
+cdfid = ncdf_open(file)
+
+print, 'read coord ...'
+varid=ncdf_varid(cdfid,'latitude')
+        ncdf_varget, cdfid, varid, lat_gcm
+varid=ncdf_varid(cdfid,'longitude')
+        ncdf_varget, cdfid, varid, lon_gcm
+varid=ncdf_varid(cdfid,'Time')
+        ncdf_varget, cdfid, varid, hour
+lon=lon_gcm
+west_east=n_elements(lon)
+lat=lat_gcm
+south_north=n_elements(lat)
+print, 'done !'
+;;print, 'time ...', hour*24 MOD 24, ' hours and day number ', ceil(hour)
+
+; field
+if (n_elements(save_data) eq 0) then begin
+	print, 'read data ...'
+	varid=ncdf_varid(cdfid,field_user)
+		ncdf_varget, cdfid, varid, var
+		bottom_top=n_elements(var(0,0,*,0))
+		time=n_elements(var(0,0,0,*))
+;save_array=fltarr(3,west_east,south_north,bottom_top,time)
+;save_array(0,*,*,*,*)=var(*,*,*,*)
+;;**NB: ralentit beaucoup
+	print, 'done !'
+endif else begin	
+	var=reform(save_data(0,*,*,*,*))
+		bottom_top=n_elements(var(0,0,*,0))
+		time=n_elements(var(0,0,0,*))
+endelse
+
+print, 'vertical levels in file ... ', bottom_top
+print, 'time steps in file ...', time
+
+
+
+	;-----------------------------
+	; min/max on the whole field
+	;-----------------------------
+	w=where(abs(var) lt 1e30)
+	if (w(0) ne -1) then begin
+		minfield=min(var[w])
+		maxfield=max(var[w])
+			;;; manage unvalid points
+			;;;w=where(var eq 1e37)
+			;;;if (w(0) ne -1) then var[w]=!Values.F_NAN
+	endif else begin
+		var=0
+		print, 'no valid values in this field', charvar 
+	endelse
+
+
+
+;---------------------
+; Get altitude
+;---------------------
+if (vert_coord ne 'pressure') then begin
+	print, 'read altitude ...'
+	varid=ncdf_varid(cdfid,'aps')
+        	ncdf_varget, cdfid, varid, aps
+	varid=ncdf_varid(cdfid,'bps')
+        	ncdf_varget, cdfid, varid, bps
+	varid=ncdf_varid(cdfid,'ps')
+        	ncdf_varget, cdfid, varid, ps
+	varid=ncdf_varid(cdfid,'altitude')
+        	ncdf_varget, cdfid, varid, z
+	print, 'done !'
+endif else begin
+	print, 'read altitude ...'
+	varid=ncdf_varid(cdfid,'altitude')
+        	ncdf_varget, cdfid, varid, z
+	z=z/100.   ;mbar
+	print, 'done !'
+endelse
+
+
+;-------------
+; Get winds
+;-------------
+if (n_elements(winds) ne 0) then begin
+if (n_elements(save_data) eq 0) then begin
+	print, 'read winds ...'
+	varid=ncdf_varid(cdfid,winds(0))
+		ncdf_varget, cdfid, varid, u
+	varid=ncdf_varid(cdfid,winds(1))
+		ncdf_varget, cdfid, varid, v
+	;save_array(1,*,*,*,*)=u(*,*,*,*)
+	;save_array(2,*,*,*,*)=v(*,*,*,*)
+	print, 'done !'
+endif else begin	
+	u=reform(save_data(1,*,*,*,*))
+	v=reform(save_data(2,*,*,*,*))
+endelse
+endif
+
+;-------------------------------
+; Get another field to contour
+;-------------------------------
+if (n_elements(fieldc_user) ne 0) then begin
+	print, 'get alternate field ...'
+	varid=ncdf_varid(cdfid,fieldc_user)
+		ncdf_varget, cdfid, varid, varcontour
+	print, 'done !'
+endif
+
+
+;;-------------------------------
+;; Save data for further use ...
+;;-------------------------------
+;if (n_elements(save_data) eq 0) then begin
+;	save_data=save_array
+;	save_array=0. ;free 'save_array' array
+;endif
+
+
+;---------------------------------
+; Some stuff for continuity
+;---------------------------------
+;;if (vert_coord ne 'pressure') then surfpres=reform(ps(*,*,nt))
+;;A CORRIGER - A METTRE DANS LA BOUCLE
+if (vert_coord ne 'pressure') then surfpres=reform(ps(*,*,0))
+if (vert_coord eq 'sigma') then begin
+	z=aps/surfpres(0,0)+bps
+	z=z*100.
+	vert_coord='model_level'
+endif
+charend='_diagfi'
+
+case field_user of 
+'temp': charvar='tk'
+'u': charvar='U'
+'v': charvar='V'
+'ps': charvar='PSFC'
+else:
+endcase
+
+;;
+;;
+
+
+;******************************************************************************
+;
+; END: different from out_wrf
+;
+;******************************************************************************
+
+
+
+;----------------------
+; initialize graphics
+;----------------------
+
+!p.charthick = 2.0
+!p.thick = 3.0
+!x.thick = 2.0
+!y.thick = 2.0
+
+if (when ne -1) then charend=charend+string(when, '(I0)')
+
+set_plot, 'ps'
+device, filename=plot_user+'_'+vert_coord+'_'+charvar+charend+'.ps', /color
+
+case charvar of
+'HGT': begin
+        title='Topography (km)'
+	pal=16
+	level=1
+	format='(F7.0)'
+end
+'tk': begin
+	title='Temperature (K)'
+	pal=3
+	format='(F4.0)'
+end
+'TSK': begin
+	title='Surface Temperature (K)'
+	pal=3
+	level=1
+end
+'U': begin
+	title='Zonal wind (!Nm!N.s!U-1!N)'
+	pal=33
+end
+'V': begin
+	title='Meridional wind (!Nm!N.s!U-1!N)'
+	pal=33
+end
+'pressure': begin
+	title='Pressure (hPa)'
+	pal=16
+end
+'height': begin
+	title='Height (km)'
+	pal=16
+end
+'T': title='Potential temperature departure from t0 (K)'
+'W': begin
+	title='Vertical wind (!Nm!N.s!U-1!N)'
+	pal=16
+	format='(F6.2)'
+end
+else: begin
+	title=''
+	pal=33
+end
+endcase
+title_save=title
+
+
+
+;---------------------------------
+; choose positioning ...
+;---------------------------------
+
+case plot_user of
+'map': begin
+;
+; 1. map: looping on vertical levels
+;
+	if (level eq -1) then begin
+		theloopmin=0
+		theloopmax=bottom_top-1
+	endif else begin
+		theloopmin=level-1 ;!! IDL arrays starts at 0
+		theloopmax=level-1
+	endelse	
+	if (when eq -1) then nt = 0 else nt=when-1
+end
+'profile': begin
+;
+; 2. profile: looping on time
+;
+	;;discrete=4
+	title_axis=strarr(2)
+	title_axis(0)=title_save
+	if (when eq -1) then begin
+		theloopmin=0
+		theloopmax=time-1
+	endif else begin
+		theloopmin=when-1 ;!! IDL arrays starts at 0
+		theloopmax=when-1
+	endelse	
+
+	column=z
+	case vert_coord of
+		'height': title_axis(1)='Altitude (km)'
+		'pressure': begin
+			H=10.
+			p0=6.1
+			column=H*alog(p0/z)
+			title_axis(1)='Log-Pressure altitude (km)'
+		end
+		'model_level': title_axis(1)='Model level'
+	endcase
+
+	displaylat=float(round(lat(nlat)*100))/100.
+	displaylon=float(round(lon(nlon)*100))/100.
+	description='WRF Profile at latitude '+string(displaylat,format='(1F6.2)')+$
+	'!Uo'+'!N and longitude '+string(displaylon,format='(1F7.2)')+'!Uo!N '
+	title=description
+end
+'hovmuller': begin
+;
+; 3. hovmuller: looping on vertical levels
+;
+	if (level eq -1) then begin
+		theloopmin=0
+		theloopmax=bottom_top-1
+	endif else begin
+		theloopmin=level-1 ;!! IDL arrays starts at 0
+		theloopmax=level-1
+	endelse	
+end
+'zonal': begin
+;
+; 4. zonal: looping on latitude
+;
+	if (nlat eq -1) then begin
+		theloopmin=0
+		theloopmax=south_north-1
+	endif else begin
+		theloopmin=nlat-1 ;!! IDL arrays starts at 0
+		theloopmax=nlat-1
+	endelse	
+	if (when eq -1) then nt = 0 else nt=when-1
+	case vert_coord of
+		'height': charlev='Altitude (km)'
+		'pressure': begin
+			H=10.
+			p0=6.1
+			z=H*alog(p0/z)
+			charlev='Log-Pressure altitude (km)'
+		end
+		'model_level': charlev='Model level'
+	endcase
+end
+'meridional': begin
+;
+; 5. meridional: looping on longitude
+;
+	if (nlon eq -1) then begin
+		theloopmin=0
+		theloopmax=west_east-1
+	endif else begin
+		theloopmin=nlon-1 ;!! IDL arrays starts at 0
+		theloopmax=nlon-1
+	endelse	
+	if (when eq -1) then nt = 0 else nt=when-1
+	case vert_coord of
+		'height': charlev='Altitude (km)'
+		'pressure': begin
+			H=10.
+			p0=6.1
+			z=H*alog(p0/z)
+			charlev='Log-Pressure altitude (km)'
+		end
+		'model_level': charlev='Model level'
+	endcase
+end
+else: stop
+endcase
+
+
+;-------------
+; plot loop
+;-------------	
+for theloop=theloopmin,theloopmax do begin
+
+case plot_user of
+'map': begin
+	;
+	; case 1: map
+	;	
+	case vert_coord of
+	'height': charlev=string(round(z(theloop)*1000.),'(I0)')+' m'
+	'pressure': charlev=string(round(z(theloop)*100.),'(I0)')+' Pa'
+	'model_level': charlev=string(round(z(theloop)),'(I0)')
+	endcase
+	title=title_save+' at level '+charlev
+	print, title
+
+	;-------------
+	; draw map
+	;-------------
+
+	what_I_plot=var[*,*,theloop,nt]
+
+	if (diff_scale eq 0) then begin
+		minfield_init=minfield	;-same scale for all levels 
+		maxfield_init=maxfield	;-same scale for all levels
+	endif
+	if (n_elements(fieldc_user) eq 0) then begin
+		overcontour=0.
+	endif else begin
+		if (n_elements(topo) ne 0) then begin
+			overcontour=varcontour[*,*,0,0] ; other levels than 0 are blank !
+		endif else begin
+			overcontour=varcontour[*,*,theloop,nt]
+		endelse
+	endelse
+	if (n_elements(winds) eq 0) then begin
+		overvector_x=0.
+		overvector_y=0.
+	endif else begin
+		overvector_x=u[*,*,theloop,nt]
+		overvector_y=v[*,*,theloop,nt]
+
+
+;--------------------------------------------------------
+; NB: you can use the winds fields to combine variables 
+;--------------------------------------------------------
+if (n_elements(winds) eq 2) then begin
+	;** HYDROSTATIC REDUCTION TO LEVEL OF REFERENCE
+	if ((winds(0) eq 'tk') and (winds(1) eq 'HGT')) then begin
+	overvector_x=reform(u[*,*,6,nt])	;;T 1km
+	overvector_y=reform(v[*,*,0,nt])	;;topo (m)
+	zref=mean(overvector_y)
+	;zref=median(overvector_y)
+	;zref=(max(overvector_y)-min(overvector_y))/2.
+	;zref=3000.
+	print, 'zref', zref
+	H=192.*overvector_x/3.72	;unit is m
+	what_I_plot=what_I_plot*exp((overvector_y-zref)/H)
+	overvector_x=0
+	overvector_y=0
+	endif
+endif
+;--------------------------------------------------------
+; NB: you can use the winds fields to combine variables
+;--------------------------------------------------------
+
+	endelse
+
+;;******************TEMP
+;;pressure anomaly
+;nday=3
+;oneday=reform(var[*,*,theloop,0:nday-1])
+;what_I_plot=what_I_plot-(total(oneday,3)/float(nday))
+;;******************TEMP
+
+	map_latlon, $
+		what_I_plot, $
+		lon, $
+		lat, $
+		ct=pal, $
+		minfield=minfield_init, $
+		maxfield=maxfield_init, $
+		overcontour=overcontour, $
+		overvector_x=overvector_x, $
+		overvector_y=overvector_y, $
+		colors=colors, $
+		title=title, $
+		format=format	
+end
+'profile': begin
+	;
+	; case 2: profile
+	;
+	print, title
+
+	what_I_plot=var[nlon,nlat,*,theloop]
+	if (diff_scale eq 0) then begin
+		minfield_init=minfield	;-same scale for all levels 
+		maxfield_init=maxfield	;-same scale for all levels
+	endif
+	if (n_elements(fieldc_user) eq 0) then begin
+		overcontour=0.
+		overcontourz=0.
+	endif else begin
+		overcontour=varcontour[nlon,nlat,*,theloop]
+		overcontourz=0.
+	endelse
+	if (n_elements(inprofile) gt 1) then begin
+		overcontour=inprofile
+		overcontourz=0.
+		if (n_elements(incolumn) gt 1) then overcontourz=incolumn
+	endif
+
+	profile, $
+		what_I_plot, $				; 1D vertical profile
+		column, $				; altitudes	
+	;	alt=alt, $				; altitude range [altmin, altmax]
+		minfield=minfield_init, $		; minimum value of plotted field (=0: calculate)
+		maxfield=maxfield_init, $		; maximum value of plotted field (=0: calculate)
+		inprofile=overcontour, $		; another vertical profile to overplot
+		incolumn=overcontourz, $		; altitudes of the other vertical profile (in case /= column)
+		title_plot=title, $			; title of the plot ('Profile' is default)
+		title_axis=title_axis, $		; title of the [x,y] axis (['Field','Altitude'] is default)
+	;	mention=mention, $			; add text precision within the plot window (default is nothing or '')
+		discrete=discrete			; show the profile points (= type of points in !psym)
+end
+'hovmuller': begin
+	;
+	; case 3: hovmuller
+	;
+	; NB: lat/lon hovmuller 
+	;
+	what_I_plot=reform(var[*,nlat,theloop,*])
+	space=lon
+	temps=findgen(time)*2
+	if (n_elements(fieldc_user) ne 0) then begin
+		overcontour=reform(varcontour[*,nlat,theloop,*])
+	endif else begin
+		overcontour=0.
+	endelse
+	minspace=0.
+	maxspace=0.
+
+;;******************TEMP
+;	minspace=-90.
+;	maxspace=90.
+
+if (n_elements(winds) ne 0) then begin		;;;winds sert à faire des calculs !!
+overvector_x=reform(u[*,nlat,4,*])	;;T 1km
+overvector_y=reform(v[*,nlat,0,*])	;;topo (m)
+zref=median(overvector_y)
+H=192.*overvector_x/3.72	;unit is m
+;print, (overvector_y-zref)/H
+what_I_plot=what_I_plot*exp((overvector_y-zref)/H)
+
+
+endif 
+;oneday=reform(var[*,nlat,0,0:11])
+;slice=(total(oneday,2)/12.)
+;for i=0, n_elements(var[*,0,0,0])-1 do begin
+;	what_I_plot(i,*)=what_I_plot(i,*)-slice(i)
+;endfor
+;;******************TEMP
+
+
+
+
+
+	hovmuller, $
+		what_I_plot, $				; 2D field
+		space, $				; space coordinate
+		temps, $				; time coordinate
+		minfield=minfield_init, $		; minimum value of plotted field (=0: calculate)
+		maxfield=maxfield_init, $		; maximum value of plotted field (=0: calculate)
+		minspace=minspace, $			; minimum value of space window (=0: calculate)
+		maxspace=maxspace, $			; maximum value of space window (=0: calculate)
+		overcontour=overcontour, $		; another 2D field to overplot with contour lines (=0: no)
+		ct=pal, $				; color table (33-rainbow is default)
+		colors=colors, $			; number of colors/levels (32 is default)
+		title=title				; title of the plot ('' is default)
+end
+'zonal': begin
+	;
+	; case 4: zonal section
+	; 
+	displaylat=float(round(lat(theloop)*100))/100.
+	title=title_save+ $
+		' section at latitude '+string(displaylat,format='(1F6.2)')+ $
+		'!Uo!N '
+	print, title
+
+	what_I_plot=reform(var[*,theloop,*,nt])
+	space=lon
+	altitude=z
+
+	if (n_elements(fieldc_user) ne 0) then begin
+		overcontour=reform(varcontour[*,theloop,*,nt])
+	endif else begin
+		overcontour=0.
+	endelse
+
+	if (n_elements(winds) eq 0) then begin
+		overvector_x=0.
+		overvector_y=0.
+	endif else begin
+		overvector_x=reform(u[*,theloop,*,nt])		;;horizontal component
+		overvector_y=reform(v[*,theloop,*,nt])		;;vertical component
+	endelse
+
+	minspace=0.
+	maxspace=0.
+
+	title_user=title
+	title_axis=['Longitude',charlev]
+
+	section, $
+		what_I_plot, $				; 2D field
+		space, $				; horizontal coordinate
+		altitude, $				; altitude coordinate
+		minfield=minfield_init, $		; minimum value of plotted field (=0: calculate)
+		maxfield=maxfield_init, $		; maximum value of plotted field (=0: calculate)
+		minspace=minspace, $			; minimum value of space window (=0: calculate)
+		maxspace=maxspace, $			; maximum value of space window (=0: calculate)
+		overcontour=overcontour, $		; another 2D field to overplot with contour lines (=0: no)
+		overvector_x=overvector_x, $		; wind vector - x component (=0: no)
+		overvector_y=overvector_y, $		; wind vector - y component (=0: no)
+		colors=colors, $			; number of colors/levels (32 is default)
+		title_plot=title_user, $		; title of the plot ('Profile' is default)
+		title_axis=title_axis, $		; title of the [x,y] axis (['Field','Altitude'] is default)
+		ct=pal, $				; color table (33-rainbow is default)
+		format=format
+end	
+'meridional': begin
+	;
+	; case 5: meridional section
+	; 
+	displaylon=float(round(lon(theloop)*100))/100.
+	title=title_save+ $
+		' section at longitude '+string(displaylon,format='(1F7.2)')+ $
+		'!Uo!N '
+	print, title
+
+	what_I_plot=reform(var[theloop,*,*,nt])
+	space=lat
+	altitude=z
+
+	if (n_elements(fieldc_user) ne 0) then begin
+		overcontour=reform(varcontour[theloop,*,*,nt])
+	endif else begin
+		overcontour=0.
+	endelse
+
+	if (n_elements(winds) eq 0) then begin
+		overvector_x=0.
+		overvector_y=0.
+	endif else begin
+		overvector_x=reform(u[theloop,*,*,nt])		;;horizontal component
+		overvector_y=reform(v[theloop,*,*,nt])		;;vertical component
+	endelse
+
+	minspace=0.
+	maxspace=0.
+
+	title_user=title
+	title_axis=['Latitude',charlev]
+
+	section, $
+		what_I_plot, $				; 2D field
+		space, $				; horizontal coordinate
+		altitude, $				; altitude coordinate
+		minfield=minfield_init, $		; minimum value of plotted field (=0: calculate)
+		maxfield=maxfield_init, $		; maximum value of plotted field (=0: calculate)
+		minspace=minspace, $			; minimum value of space window (=0: calculate)
+		maxspace=maxspace, $			; maximum value of space window (=0: calculate)
+		overcontour=overcontour, $		; another 2D field to overplot with contour lines (=0: no)
+		overvector_x=overvector_x, $		; wind vector - x component (=0: no)
+		overvector_y=overvector_y, $		; wind vector - y component (=0: no)
+		colors=colors, $			; number of colors/levels (32 is default)
+		title_plot=title_user, $		; title of the plot ('Profile' is default)
+		title_axis=title_axis, $		; title of the [x,y] axis (['Field','Altitude'] is default)
+		ct=pal					; color table (33-rainbow is default)
+end	
+
+
+
+
+
+
+
+
+else: 
+endcase
+
+
+
+endfor
+device, /close
+
+	; save the profiles for another plot (last of the time loop)
+	if (n_elements(inprofile) le 1) and (plot_user eq 'profile') then begin
+		inprofile=what_I_plot
+		incolumn=column
+	endif
+
+;******************************************************************************
+;
+; BEGIN: different from out_wrf
+;
+;******************************************************************************
+;;;skip:
+;;;endfor
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/out_wrf.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/out_wrf.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/out_wrf.pro	(revision 207)
@@ -0,0 +1,808 @@
+pro out_wrf, $
+		plot=plot_user, $		; 'map', 'profile', 'hovmuller', 'meridional', 'zonal' (default is 'map')
+	;----------------
+	; input fields
+	;----------------
+		field1=field_user, $		; field to contour: 'U', 'V', 'tk', ... etc ...
+		field2=fieldc_user, $		; field to overplot (contour lines, optional)
+	;------------------------------------------------------
+	; 'map' options (no effect when plot is 'profile')
+	;------------------------------------------------------
+		topo=topo, $			; overplot topography contours (!! must load HGT !! override field2)
+		winds=winds, $			; option to overplot winds (e.g. =['U','V'])
+		level=level, $			; vertical level subscript (starts at 1 ...)(if -1: all levels)
+	;------------------------------------------------------
+	; 'profile' options (no effect when plot is 'map')
+	;------------------------------------------------------
+		inprofile=inprofile, $		; a profile to compare with ... (override field2)
+		incolumn=incolumn, $		; altitudes ... in case /= column
+		;; NB: inprofile and incolumn may be used to output profiles
+		;; ... reset with inprofile=0, incolumn=0
+	;----------------
+	; choose time
+	;----------------
+		when=when, $			; time subscript (starts at 1 ...)(if -1: first time step)
+	;----------------
+	; choose latitude/longitude
+	;----------------
+		nlat=nlat, $			; latitude subscript (starts at 1 ...)(if -1: all latitudes)(default is middle)
+		nlon=nlon, $			; longitude subscript (starts at 1 ...)(if -1: all longitudes)(default is middle)
+	;----------------
+	; plot options
+	;----------------
+;;NB: celles ci sont dorenavant indiquees dans le _user si besoin 
+		range=range_user, $		; range=[min,max]
+		colors=colors, $		; 16, 32, 64, ... etc
+save_ps=file_ps, $
+	;-------------------------
+	; no useless data loading
+	;-------------------------
+		save_data=save_data		; to avoid loading data if already done once
+
+
+
+;---------------------------------------------------------------------------
+;
+; A general routine to plot ARWpost outputs
+;
+; USE:
+; - out_wrf	(will plot everything !)
+; - out_wrf, field1='tk', range=[160,300]
+;
+; - out_wrf, field1='pressure', field2='tk'
+; - out_wrf, field1=TSK, field2=HGT, winds=['U','V'] 
+;
+; - out_wrf, save_data=field
+;   ... then next calls including 'save_data=field' won't include the data loading 
+;
+; - out_wrf, field1='tk', winds=['umet','vmet'], topo=1, save_data=yeah, level=1, when=2
+;
+; - out_wrf, field1='tk', plot='profile'
+;
+; - out_wrf, plot='profile', field1='tk', when=1, inprofile=inprofile, incolumn=incolumn
+;   out_diagfi, plot='profile', field1='temp', when=112, inprofile=inprofile, incolumn=incolumn 	
+;
+; - out_wrf, plot='meridional',field1='U'
+;
+; - out_wrf, plot='hovmuller',field1='TSK'
+;
+; - out_wrf, plot='zonal',field1='V', nlat=-1
+; 
+;---------------------------------------------------------------------------
+; A. Spiga, August 2007, adding plot keyword September 2007
+;---------------------------------------------------------------------------
+
+
+    
+
+
+;-------------------------------------
+; default settings and user settings
+;-------------------------------------
+diff_scale=0  ;;1
+charend=''
+format=''
+if (n_elements(plot_user) eq 0) then plot_user='map'
+if (n_elements(field_user) eq 0) then field_user='all'
+if (n_elements(level) eq 0) then level=-1
+if (n_elements(when) eq 0) then when=-1
+;;if (n_elements(nlon) eq 0) then nlon=-1
+;;if (n_elements(nlat) eq 0) then nlat=-1
+if (n_elements(colors) eq 0) then colors=32
+;if (n_elements(minfield_init)*n_elements(maxfield_init) eq 0) then begin
+if (n_elements(range_user) eq 0) then begin
+	minfield_init = 0.
+	maxfield_init = 0.
+diff_scale=1
+endif
+
+if (n_elements(range_user) eq 2) then begin
+	minfield_init=float(range_user(0))
+	maxfield_init=float(range_user(1))
+	print, 'setting user limits !', minfield_init, maxfield_init 
+	diff_scale=1
+endif
+
+if (n_elements(topo) eq 0) then topo=0
+if (topo eq 1) then fieldc_user='HGT'	;case with topography
+
+if (n_elements(fieldc_user) eq 0) then fieldc_user=''
+
+;goto, squeeze
+;------------------
+; read data
+;------------------
+;
+; read the file generated by ARWpost
+;
+;*********************************************
+if (n_elements(save_data) eq 0) then begin
+	read_dat, field, x, y, z, t, desc_field
+	;save_data=field
+endif else begin
+	read_dat, field, x, y, z, t, desc_field, nodata=1  ; read only the dimensions
+	field=save_data
+	save_data=0.	;;free memory
+endelse
+;;*********************************************
+;; opt: saved IDL files
+;squeeze:
+;restore, filename='OM_nonhydro.idl'
+;field=output
+;;nh=output
+;;restore, filename='OM_hydro.idl'
+;;h=output
+;;field=abs(nh-h)
+;;*********************************************
+
+;
+; dimensions
+;
+lon=x
+west_east=n_elements(x)
+if (n_elements(nlon) eq 0) then begin
+	nlon=round(west_east/2)
+endif 
+if (nlon eq 0) then nlon=round(west_east/2)
+
+lat=y
+south_north=n_elements(y)
+if (n_elements(nlat) eq 0) then begin
+	nlat=round(south_north/2)
+endif
+if (nlat eq 0) then nlat=round(south_north/2)
+	
+bottom_top=n_elements(z)
+
+time=n_elements(t)
+if ((time eq 1) and (plot_user eq 'hovmuller')) then stop
+
+nfields=n_elements(desc_field)
+if (z(0) lt z(1)) then vert_coord='height'
+if (z(0) gt z(1)) then vert_coord='pressure'
+if ((z(0) eq 1.) and (z(bottom_top-1) eq (z(bottom_top-2)+1.))) then vert_coord='model_level'
+;print, 'vert_coord is ... ', vert_coord
+
+;
+; find the field desired by the user
+;
+if (field_user ne 'all') then begin
+	match=-1
+	indice=-1
+	repeat begin
+		indice=indice+1
+		if (indice eq nfields) $
+			then match=9999 $
+			else match=STRPOS(desc_field(indice),field_user)  
+	endrep until match ne -1
+	if (match eq 9999) then begin
+		print, field_user, ' not found !'
+		stop
+	endif
+;print, 'selected for plot:  ',desc_field(indice)
+endif
+
+;
+; prepare loop for graphics
+;
+if (n_elements(indice) ne 0) then begin
+	field_loop_start=indice
+	field_loop_end=indice
+endif else begin
+	field_loop_start=0
+	field_loop_end=nfields-1	
+endelse
+
+;
+; overplot contour of another field ?
+;
+if (fieldc_user ne '') then begin
+	match=-1
+	indice=-1
+	repeat begin
+		indice=indice+1
+		if (indice eq nfields) $
+			then match=9999 $
+			else match=STRPOS(desc_field(indice),fieldc_user)  
+	endrep until match ne -1
+	if (match eq 9999) then begin
+		print, fieldc_user, ' not found !'
+		stop
+	endif
+;print, 'selected for over-contour:  ',desc_field(indice)
+	varcontour=reform(field(indice,*,*,*,*))
+endif
+
+;
+; overplot wind vectors ?
+;
+if (n_elements(winds) ge 2) then begin
+	; zonal wind
+	match=-1
+	indice=-1
+	repeat begin
+		indice=indice+1
+		if (indice eq nfields) $
+			then match=9999 $
+			else match=STRPOS(desc_field(indice),winds(0))  
+	endrep until match ne -1
+	if (match eq 9999) then begin
+		print, 'u not found !'
+		stop
+	endif
+;print, 'selected for vector_x:  ',desc_field(indice)
+	u=reform(field(indice,*,*,*,*))
+	; meridional wind
+	match=-1
+	indice=-1
+	repeat begin
+		indice=indice+1
+		if (indice eq nfields) $
+			then match=9999 $
+			else match=STRPOS(desc_field(indice),winds(1))  
+	endrep until match ne -1
+	if (match eq 9999) then begin
+		print, 'v not found !'
+		stop
+	endif
+;print, 'selected for vector_y:  ',desc_field(indice)
+	v=reform(field(indice,*,*,*,*))
+endif
+
+
+
+;
+; loop for graphics   
+;
+for field_loop=field_loop_start,field_loop_end do begin
+
+	charstart=STRSPLIT(desc_field(field_loop), ' ', LENGTH=charlength)
+	charvar=STRMID(desc_field(field_loop),charstart(0),charlength(0))
+	var=reform(field(field_loop,*,*,*,*))
+
+	; useless field ...
+	if (charvar eq vert_coord) then goto, skip
+
+	;
+	; min/max on the whole field
+	;
+	w=where(var ne 1e37)
+	if (w(0) ne -1) then begin
+		minfield=min(var[w])
+		maxfield=max(var[w])
+			;;; manage unvalid points
+			;;;w=where(var eq 1e37)
+			;;;if (w(0) ne -1) then var[w]=!Values.F_NAN
+	endif else begin
+		var=0
+		print, 'no valid values in this field', charvar 
+	endelse
+
+;----------------------
+; initialize graphics
+;----------------------
+
+;!p.charthick = 2.0
+;!p.thick = 3.0
+;!x.thick = 2.0
+;!y.thick = 2.0
+
+
+lct = round(t[when-1]+24) MOD 24
+
+;;lct = when  ;; on choisit de les numeroter dans l'ordre 
+;;if ((when ne -1) and (lct lt 10)) then charend=charend+'0'+string(lct, '(I0)')
+;;if (lct ge 10) then charend=charend+string(lct, '(I0)') 
+;;lct = round(t[when-1]) MOD 24
+;;denom=plot_user+'_'+vert_coord+'_'+charvar
+;;if (fieldc_user ne '') then denom=denom+'_'+fieldc_user
+;;if (winds(0) ne '') then denom=denom+'_'+winds(0)+winds(1)
+;;denom=denom+charend
+
+
+if (n_elements(file_ps) ne '') then begin
+	set_plot, 'ps'
+	device, filename=file_ps+'.ps', /color
+endif
+
+
+case charvar of
+'HGT': begin
+        title='Topography (km)'
+	level=1
+	pal=16
+	format='(F7.0)'
+end
+'tk': begin
+	title='Temperature (K)'
+	pal=3
+	format='(F4.0)'
+end
+'TSK': begin
+	title='Surface Temperature (K)'
+	pal=3
+	level=1
+end
+'U': begin
+	title='Zonal wind (!Nm!N.s!U-1!N)'
+	pal=33
+	if (winds(0) eq 'U') then title='Wind field (!Nm!N.s!U-1!N)'
+end
+'V': begin
+	title='Meridional wind (!Nm!N.s!U-1!N)'
+	pal=33
+	if (winds(0) eq 'V') then title='Wind field (!Nm!N.s!U-1!N)'
+end
+'pressure': begin
+	title='Pressure (hPa)'
+	pal=16
+end
+'height': begin
+	title='Height (km)'
+	pal=16
+end
+'T': title='Potential temperature departure from t0 (K)'
+'W': begin
+	title='Vertical wind (!Nm!N.s!U-1!N)'
+	pal=16
+	format='(F6.2)'
+end
+else: begin
+	title=''
+	pal=33
+end
+endcase
+
+if (when ne -1) then begin
+	title=title+', LT '+string(lct, '(I0)')
+endif else begin
+	title=title+', time '+string(when, '(I0)')
+endelse
+	
+title_save=title
+
+
+
+;---------------------------------
+; choose positioning ...
+;---------------------------------
+
+case plot_user of
+'map': begin
+;
+; 1. map: looping on vertical levels
+;
+	if (level eq -1) then begin
+		theloopmin=0
+		theloopmax=bottom_top-1
+	endif else begin
+		theloopmin=level-1 ;!! IDL arrays starts at 0
+		theloopmax=level-1
+	endelse	
+	if (when eq -1) then nt = 0 else nt=when-1
+end
+'profile': begin
+;
+; 2. profile: looping on time
+;
+	;;discrete=4
+	title_axis=strarr(2)
+	title_axis(0)=title_save
+	if (when eq -1) then begin
+		theloopmin=0
+		theloopmax=time-1
+	endif else begin
+		theloopmin=when-1 ;!! IDL arrays starts at 0
+		theloopmax=when-1
+	endelse	
+
+	column=z
+	case vert_coord of
+		'height': title_axis(1)='Altitude (km)'
+		'pressure': begin
+			H=10.
+			p0=6.1
+			column=H*alog(p0/z)
+			title_axis(1)='Log-Pressure altitude (km)'
+		end
+		'model_level': title_axis(1)='Model level'
+	endcase
+
+	displaylat=float(round(lat(nlat)*100))/100.
+	displaylon=float(round(lon(nlon)*100))/100.
+	description='WRF Profile at latitude '+string(displaylat,format='(1F6.2)')+$
+	'!Uo'+'!N and longitude '+string(displaylon,format='(1F7.2)')+'!Uo!N '
+	title=description
+end
+'hovmuller': begin
+;
+; 3. hovmuller: looping on vertical levels
+;
+	if (level eq -1) then begin
+		theloopmin=0
+		theloopmax=bottom_top-1
+	endif else begin
+		theloopmin=level-1 ;!! IDL arrays starts at 0
+		theloopmax=level-1
+	endelse	
+end
+'zonal': begin
+;
+; 4. zonal: looping on latitude
+;
+	if (nlat eq -1) then begin
+		theloopmin=0
+		theloopmax=south_north-1
+	endif else begin
+		theloopmin=nlat-1 ;!! IDL arrays starts at 0
+		theloopmax=nlat-1
+	endelse	
+	if (when eq -1) then nt = 0 else nt=when-1
+	case vert_coord of
+		'height': charlev='Altitude (km)'
+		'pressure': begin
+			H=10.
+			p0=6.1
+			z=H*alog(p0/z)
+			charlev='Log-Pressure altitude (km)'
+		end
+		'model_level': charlev='Model level'
+	endcase
+end
+'meridional': begin
+;
+; 5. meridional: looping on longitude
+;
+	if (nlon eq -1) then begin
+		theloopmin=0
+		theloopmax=west_east-1
+	endif else begin
+		theloopmin=nlon-1 ;!! IDL arrays starts at 0
+		theloopmax=nlon-1
+	endelse	
+	if (when eq -1) then nt = 0 else nt=when-1
+	case vert_coord of
+		'height': charlev='Altitude (km)'
+		'pressure': begin
+			H=10.
+			p0=6.1
+			z=H*alog(p0/z)
+			charlev='Log-Pressure altitude (km)'
+		end
+		'model_level': charlev='Model level'
+	endcase
+end
+else: stop
+endcase
+
+
+;-------------
+; plot loop
+;-------------	
+for theloop=theloopmin,theloopmax do begin
+
+case plot_user of
+'map': begin
+	;
+	; case 1: map
+	;	
+	case vert_coord of
+	'height': charlev=string(round(z(theloop)*1000.),'(I0)')+' m'
+	'pressure': charlev=string(round(z(theloop)*100.),'(I0)')+' Pa'
+	'model_level': charlev=string(round(z(theloop)),'(I0)')
+	endcase
+	if (n_elements(var(0,0,*,0) ge 2)) then title=title_save+', at level '+charlev
+	print, title
+
+	;-------------
+	; draw map
+	;-------------
+
+	what_I_plot=var[*,*,theloop,nt]
+
+	if (diff_scale eq 0) then begin
+		minfield_init=minfield	;-same scale for all levels 
+		maxfield_init=maxfield	;-same scale for all levels
+	endif
+	if (fieldc_user eq '') then begin
+		overcontour=0.
+	endif else begin
+		if (topo eq 1) then begin
+			overcontour=varcontour[*,*,0,0]/1000.  ; other levels than 0 are blank !
+		endif else begin
+			overcontour=varcontour[*,*,theloop,nt]
+		endelse
+	endelse
+	if (n_elements(winds) lt 2) then begin
+		overvector_x=0.
+		overvector_y=0.
+	endif else begin
+		overvector_x=u[*,*,theloop,nt]
+		overvector_y=v[*,*,theloop,nt]
+
+
+;--------------------------------------------------------
+; NB: you can use the winds fields to combine variables 
+;--------------------------------------------------------
+if (n_elements(winds) ge 2) then begin
+
+
+;** HYDROSTATIC REDUCTION TO LEVEL OF REFERENCE
+@sea_level.idl
+
+;** WIND STRESS
+@wind_stress.idl
+
+;** ERTEL POTENTIAL VORTICITY
+@ertel_vorticity.idl
+
+
+endif
+;--------------------------------------------------------
+; NB: you can use the winds fields to combine variables
+;--------------------------------------------------------
+
+	endelse
+
+;;******************TEMP
+;;pressure anomaly
+;nday=3
+;oneday=reform(var[*,*,theloop,0:nday-1])
+;what_I_plot=what_I_plot-(total(oneday,3)/float(nday))
+;;******************TEMP
+
+	map_latlon, $
+		what_I_plot, $
+		lon, $
+		lat, $
+		ct=pal, $
+		minfield=minfield_init, $
+		maxfield=maxfield_init, $
+		overcontour=overcontour, $
+		overvector_x=overvector_x, $
+		overvector_y=overvector_y, $
+		colors=colors, $
+		title=title, $
+		format=format	
+end
+'profile': begin
+	;
+	; case 2: profile
+	;
+	print, title
+
+	what_I_plot=var[nlon,nlat,*,theloop]
+	if (diff_scale eq 0) then begin
+		minfield_init=minfield	;-same scale for all levels 
+		maxfield_init=maxfield	;-same scale for all levels
+	endif
+	if (fieldc_user eq '') then begin
+		overcontour=0.
+		overcontourz=0.
+	endif else begin
+		overcontour=varcontour[nlon,nlat,*,theloop]
+		overcontourz=0.
+	endelse
+	if (n_elements(inprofile) gt 1) then begin
+		overcontour=inprofile
+		overcontourz=0.
+		if (n_elements(incolumn) gt 1) then overcontourz=incolumn
+	endif
+
+	profile, $
+		what_I_plot, $				; 1D vertical profile
+		column, $				; altitudes	
+	;	alt=alt, $				; altitude range [altmin, altmax]
+		minfield=minfield_init, $		; minimum value of plotted field (=0: calculate)
+		maxfield=maxfield_init, $		; maximum value of plotted field (=0: calculate)
+		inprofile=overcontour, $		; another vertical profile to overplot
+		incolumn=overcontourz, $		; altitudes of the other vertical profile (in case /= column)
+		title_plot=title, $			; title of the plot ('Profile' is default)
+		title_axis=title_axis, $		; title of the [x,y] axis (['Field','Altitude'] is default)
+	;	mention=mention, $			; add text precision within the plot window (default is nothing or '')
+		discrete=discrete			; show the profile points (= type of points in !psym)
+end
+'hovmuller': begin
+	;
+	; case 3: hovmuller
+	;
+	; NB: lat/lon hovmuller 
+	;
+	what_I_plot=reform(var[*,nlat,theloop,*])
+	space=lon
+	temps=findgen(time)*2
+	if (fieldc_user ne '') then begin
+		overcontour=reform(varcontour[*,nlat,theloop,*])
+	endif else begin
+		overcontour=0.
+	endelse
+	minspace=0.
+	maxspace=0.
+
+;;******************TEMP
+;	minspace=-90.
+;	maxspace=90.
+
+if (n_elements(winds) ge 2) then begin		;;;winds sert à faire des calculs !!
+overvector_x=reform(u[*,nlat,4,*])	;;T 1km
+overvector_y=reform(v[*,nlat,0,*])	;;topo (m)
+zref=median(overvector_y)
+H=192.*overvector_x/3.72	;unit is m
+;print, (overvector_y-zref)/H
+what_I_plot=what_I_plot*exp((overvector_y-zref)/H)
+
+
+endif 
+;oneday=reform(var[*,nlat,0,0:11])
+;slice=(total(oneday,2)/12.)
+;for i=0, n_elements(var[*,0,0,0])-1 do begin
+;	what_I_plot(i,*)=what_I_plot(i,*)-slice(i)
+;endfor
+;;******************TEMP
+
+
+
+
+
+	hovmuller, $
+		what_I_plot, $				; 2D field
+		space, $				; space coordinate
+		temps, $				; time coordinate
+		minfield=minfield_init, $		; minimum value of plotted field (=0: calculate)
+		maxfield=maxfield_init, $		; maximum value of plotted field (=0: calculate)
+		minspace=minspace, $			; minimum value of space window (=0: calculate)
+		maxspace=maxspace, $			; maximum value of space window (=0: calculate)
+		overcontour=overcontour, $		; another 2D field to overplot with contour lines (=0: no)
+		ct=pal, $				; color table (33-rainbow is default)
+		colors=colors, $			; number of colors/levels (32 is default)
+		title=title				; title of the plot ('' is default)
+end
+'zonal': begin
+	;
+	; case 4: zonal section
+	; 
+	displaylat=float(round(lat(theloop)*100))/100.
+	title=title_save+ $
+		' section at latitude '+string(displaylat,format='(1F6.2)')+ $
+		'!Uo!N '
+	print, title
+
+	what_I_plot=reform(var[*,theloop,*,nt])
+	space=lon
+	altitude=z
+
+if (topo eq 1) then begin
+	topography=varcontour[theloop,*,0,0] ; other levels than 0 are blank !
+        fieldc_user=''
+endif else begin
+	topography=0.
+endelse	
+		    
+	
+	if (fieldc_user ne '') then begin
+		overcontour=reform(varcontour[*,theloop,*,nt])
+	endif else begin
+		overcontour=0.
+	endelse
+
+	if (n_elements(winds) lt 2) then begin
+		overvector_x=0.
+		overvector_y=0.
+	endif else begin
+		overvector_x=reform(u[*,theloop,*,nt])		;;horizontal component
+		overvector_y=reform(v[*,theloop,*,nt])		;;vertical component
+	endelse
+
+	minspace=0.
+	maxspace=0.
+
+	title_user=title
+	title_axis=['Longitude',charlev]
+
+	section, $
+		what_I_plot, $				; 2D field
+		space, $				; horizontal coordinate
+		altitude, $				; altitude coordinate
+		minfield=minfield_init, $		; minimum value of plotted field (=0: calculate)
+		maxfield=maxfield_init, $		; maximum value of plotted field (=0: calculate)
+		minspace=minspace, $			; minimum value of space window (=0: calculate)
+		maxspace=maxspace, $			; maximum value of space window (=0: calculate)
+		overcontour=overcontour, $		; another 2D field to overplot with contour lines (=0: no)
+		overvector_x=overvector_x, $		; wind vector - x component (=0: no)
+		overvector_y=overvector_y, $		; wind vector - y component (=0: no)
+		colors=colors, $			; number of colors/levels (32 is default)
+		title_plot=title_user, $		; title of the plot ('Profile' is default)
+		title_axis=title_axis, $		; title of the [x,y] axis (['Field','Altitude'] is default)
+		ct=pal, $				; color table (33-rainbow is default)
+topo=topography, $
+		format=format
+end	
+'meridional': begin
+	;
+	; case 5: meridional section
+	; 
+	displaylon=float(round(lon(theloop)*100))/100.
+	title=title_save+ $
+		' section at longitude '+string(displaylon,format='(1F7.2)')+ $
+		'!Uo!N '
+	print, title
+
+	what_I_plot=reform(var[theloop,*,*,nt])
+	space=lat
+	altitude=z
+
+if (topo eq 1) then begin
+        topography=varcontour[theloop,*,0,0] ; other levels than 0 are blank !
+        fieldc_user=''
+endif else begin
+        topography=0.
+endelse
+			
+	if (fieldc_user ne '') then begin
+		overcontour=reform(varcontour[theloop,*,*,nt])
+	endif else begin
+		overcontour=0.
+	endelse
+
+	if (n_elements(winds) lt 2) then begin
+		overvector_x=0.
+		overvector_y=0.
+	endif else begin
+		overvector_x=reform(u[theloop,*,*,nt])		;;horizontal component
+		overvector_y=reform(v[theloop,*,*,nt])		;;vertical component
+	endelse
+
+	minspace=0.
+	maxspace=0.
+
+	title_user=title
+	title_axis=['Latitude',charlev]
+
+	section, $
+		what_I_plot, $				; 2D field
+		space, $				; horizontal coordinate
+		altitude, $				; altitude coordinate
+		minfield=minfield_init, $		; minimum value of plotted field (=0: calculate)
+		maxfield=maxfield_init, $		; maximum value of plotted field (=0: calculate)
+		minspace=minspace, $			; minimum value of space window (=0: calculate)
+		maxspace=maxspace, $			; maximum value of space window (=0: calculate)
+		overcontour=overcontour, $		; another 2D field to overplot with contour lines (=0: no)
+		overvector_x=overvector_x, $		; wind vector - x component (=0: no)
+		overvector_y=overvector_y, $		; wind vector - y component (=0: no)
+		colors=colors, $			; number of colors/levels (32 is default)
+		title_plot=title_user, $		; title of the plot ('Profile' is default)
+		title_axis=title_axis, $		; title of the [x,y] axis (['Field','Altitude'] is default)
+topo=topography, $
+		ct=pal, $				; color table (33-rainbow is default)
+		format=format
+end	
+
+
+
+
+
+
+
+
+else: 
+endcase
+
+
+print, '...ok'
+endfor
+if (n_elements(file_ps) ne '') then device, /close
+
+	; save the profiles for another plot (last of the time loop)
+	if (n_elements(inprofile) le 1) and (plot_user eq 'profile') then begin
+		inprofile=what_I_plot
+		incolumn=column
+	endif
+
+skip:
+endfor
+
+save_data=field
+field=0.	;; free memory
+
+end
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/plot.def
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/plot.def	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/plot.def	(revision 207)
@@ -0,0 +1,159 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  -or- @report.idl
+;  -or- @movie.idl
+;
+;  this file will be saved !
+;
+;;---------------------------------------
+
+
+;-------------------------------
+;-------------------------------
+; namelist.ARWPOST parameters
+;-------------------------------
+;-------------------------------
+
+;; DEFAULT: ARWPOST.EXE ALREADY RUN (i.e. input.ctl and input.dat already there)
+;; UNCOMMENT FOLLOWING LINE TO EXTRACT FILES 
+
+;extract='yes'	;;   EXECUTE ARWPOST.EXE
+		;;   WITH THE FOLLOWING PARAMETERS :
+
+nam1=" fields = 'tk,HGT,PSFC,U,V,W' "		;; CHANGE HERE FIELDS TO BE EXTRACTED 
+nam1=" fields = 'tk' "
+nam1=" fields = 'HGT,U,V' "
+nam1=" fields = 'V,W' "
+nam1=" fields = 'HGT,ICETOT,RAVE,QH2O_ICE' "
+
+nam2=" start_date = '2024-04-04_06:00:00' "	;; CHANGE HERE START DATE
+nam3=" end_date   = '2024-04-04_08:00:00' "	;; CHANGE HERE END DATE
+nam4=" interval_seconds = 14800 "		;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s	
+nam5=" interp_method = 1 "			;; SET VERT. COORD. 0: eta levels, 1: height (inc) or pressure (dec)
+tabnam=[1,30,0.5]   	;; SET HEIGHT/PRESSURE LEVELS WITH [first alt, last alt, step]
+
+
+
+;----------------------------------------------------
+;----------------------------------------------------
+; what do you want to plot ?
+; THIS MUST BE SET ACCORDINGLY TO PREVIOUS SECTION
+;   - do not plot a field not extracted
+;   - do not ask for more plot than data available
+;----------------------------------------------------
+;----------------------------------------------------
+
+num=1		   	;; how many plots ?
+num=6                   ;; how many plots ?
+;num=2                   ;; how many plots ?
+num=3
+
+;@map_sea_level.idl
+;@map_ertel_vorticity.idl
+;@map_wind_stress.idl
+;field1='HGT'
+;field2='U'
+;winds=['U','V']
+;topo=1
+
+;winds=['U','V'] & field1='U' & topo=1
+;winds=['V','W'] & field1='V' 
+field1='ICETOT' & topo=1
+;field1='QH2O_ICE'
+
+
+
+;----------------------------------
+;----------------------------------
+; what kind of plot do you want ? 
+;----------------------------------
+;----------------------------------
+
+plot='map' & level=-1	
+level=2		; first level is 1
+level=24
+;level=10
+;level=1
+
+;plot='meridional' & nlon=-1 	
+;nlon=75
+
+;plot='zonal' & nlat=-1		
+;nlat=100
+
+
+;----------------------------
+;----------------------------
+; change plot settings 
+;----------------------------
+;----------------------------
+
+;; uncomment to modify default plot settings
+;; | | | | | | | | | | | | | | | | | | | | |
+;; v v v v v v v v v v v v v v v v v v v v v
+
+minfield_init=0.		;; grepALL
+maxfield_init=16.		;; grepALL
+;intervalx=5.	           	;; grepALL
+;intervaly=5.	           	;; grepALL
+;title_user='my own plot'	;; grepALL
+;title_axis=['abs','ord']	;; grepALL
+;colors=30			;; grepALL
+;pal=33				;; grepALL
+;pal=0				;; grepALL
+;pal=22				;; grepALL
+;format='(I0)'			;; grepALL
+;windex=20.			;; grepALL
+;stride=2			;; grepALL
+;flag_cb='false'		;; grepALL
+;what_I_plot=what_I_plot*1e6    ;; grepALL
+
+;minalt=-4.			;; grepSEC
+;maxalt=1.5			;; grepSEC
+;;altitude=altitude*1000.  	;; grepSEC
+;factor=30.			   ;; grepSEC
+;space=space*58. & spacekm='true'   ;; grepSEC
+;minspace=10.4*58./factor             ;; grepSEC
+;maxspace=12.*58./factor            ;; grepSEC
+
+windowx=[-145,-100]	;; grepMAP
+windowy=[-25,25]	;; grepMAP
+;lon=lon*58.		;; grepMAP
+;lat=lat*58.		;; grepMAP
+
+;lim_max = 0.03 				;; 1/3 grepALL
+;w=where(what_I_plot ge lim_max) 		;; 2/3 grepALL
+;if (w[0] ne -1) then what_I_plot[w]=lim_max	;; 3/3 grepALL
+
+;lim_blank = 10 					;; 1/3 grepALL
+;w=where(abs(what_I_plot) le lim_blank)			;; 2/3 grepALL
+;if (w[0] ne -1) then what_I_plot[w]=missing_value	;; 3/3 grepALL
+
+;title_user='Sea-level surface pressure'+title_user	;; grepALL
+
+;what_I_plot=what_I_plot*1000.  				;; grepALL
+;title_user='Water ice column (!7l!3m-pr)'+title_user	;; grepALL
+subtitle_user='LMD mesoscale model'     		;; grepALL
+
+;what_I_plot(*,*)=missing_value		;; grepMAP
+
+
+;------------------------------
+;------------------------------
+; some last possible settings 
+;------------------------------
+;------------------------------
+
+backup_data='no'   	;; save ARWpost-generated text files ? default is no
+already_data='no'  	;; load ARWpost-generated text files ? default is no
+datafolder='./WHERE_RESULTS_ARE/'	;; default is ./
+plotfolder='./WHERE_PLOTS_ARE/'	        ;; default is ./
+
+textitle='TH20_WC'	;; one word.  default is 'plot'
+texcomments='sol4'	;; one word.  default is 'plot'
+
+
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/read_dat.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/read_dat.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/read_dat.pro	(revision 207)
@@ -0,0 +1,220 @@
+pro read_dat, output, x, y, z, t, desc_field, nodata=nodata
+
+
+;---------------------------------------------------------------------------
+;
+; Read the files generated by ARWpost
+;
+; Please create symbolic link 'input.ctl' and 'input.dat'
+; --- or rename files
+;
+; - output contains all fields
+; - x,y,z,t contains coordinates
+; - desc_field contains strings describing fields
+; - if nodata is not blank, do not read the fields
+;
+;---------------------------------------------------------------------------
+; A. Spiga, August 2007
+;---------------------------------------------------------------------------
+
+
+;
+; info for localtime
+;
+interv=0.
+openr, 99, 'timefil'
+readf,99,interv
+close, 99
+
+
+
+; get preliminar info on coordinates
+;
+wnx=1
+wny=1
+wnz=1
+wnt=1
+txt=''
+param=[0.,0.,0.,0.,0.,0.,0.,0.]
+openr, 1, 'input.ctl'
+while not eof(1) do begin
+    readf,1,txt
+    match=STRPOS(txt,'linear')
+	if (match ne -1) then begin
+		wnx=(STRPOS(txt,'xdef') eq -1)*wnx  ;0 if linear
+		wny=(STRPOS(txt,'ydef') eq -1)*wny  ;0 if linear
+                wnz=(STRPOS(txt,'zdef') eq -1)*wnz  ;0 if linear 
+                wnt=(STRPOS(txt,'tdef') eq -1)*wnt  ;0 if linear
+                paramstart=STRSPLIT(txt, 'r', LENGTH=paramlength)
+        	paramchar=STRMID(txt,paramstart(1),paramlength(1))
+		READS, paramchar, start, step
+		param=param+[start*(STRPOS(txt,'xdef') ne -1),$
+			step*(STRPOS(txt,'xdef') ne -1),$
+			start*(STRPOS(txt,'ydef') ne -1),$
+			step*(STRPOS(txt,'ydef') ne -1),$
+			start*(STRPOS(txt,'zdef') ne -1),$
+			step*(STRPOS(txt,'zdef') ne -1),$
+			start*(STRPOS(txt,'tdef') ne -1),$
+			step*(STRPOS(txt,'tdef') ne -1)]
+	endif	
+endwhile
+close, 1
+timebegin=param(6)
+	
+;---------------------------------
+; READ .CTL FILE INFORMATIONS
+;---------------------------------
+
+info=read_ascii('input.ctl', missing_value=1e37)
+infodat=info.field1
+
+;
+; second column : dimensions
+;
+
+w=where((infodat(0,*) eq 1e37) and (infodat(1,*) lt 1e37))
+dimensions=reform(infodat(1,w))
+
+nx=round(dimensions(0)) 
+ny=round(dimensions(1)) 
+nz=round(dimensions(2)) 
+nt=round(dimensions(3)) 
+fields=round(dimensions(4)) 
+vertical=intarr(fields)
+for i=0,fields-1 do begin
+	vertical(i)=round(dimensions(5+i))
+endfor
+
+
+;
+; first column : coordinates
+;
+
+w=where((infodat(1,*) eq 1e37) and (infodat(0,*) lt 1e37))
+if (w(0) ne -1) then coordinates=reform(infodat(0,w))
+
+if (wnx ne 0) then begin
+	wnx=nx
+	x=coordinates(0:nx-1)
+endif else begin
+	xmin=param(0)
+	xmax=param(0)+param(1)*(nx-1) MOD 360
+	;inc=param(0)+param(1)*(nx-1)	;cas mercator
+	;x=start+inc*findgen(nx) 
+	x=xmin+(xmax-xmin)*findgen(nx)/(nx-1)
+	;print, x
+	;stop
+endelse
+if (wny ne 0) then begin
+        wny=ny
+	y=coordinates(wnx:wnx+wny-1)
+endif else begin
+        start=param(2)
+        step=param(3)
+        y=start+step*findgen(ny)
+endelse
+if (wnz ne 0) then begin
+        wnz=nz
+	z=coordinates(wnx+wny:wnx+wny+wnz-1)
+endif else begin
+        start=param(4)
+        step=param(5)
+        z=start+step*findgen(nz)
+endelse
+t=interv*findgen(nt)/3700. + timebegin + mean(x)/15.
+	
+
+;
+; get info on fields
+;
+openr, 1, 'input.ctl'
+toto=5+wnx+1+wny+1+wnz+2+fields
+infofields=strarr(toto)
+readf, 1, infofields
+close, 1
+
+;
+desc_field=transpose(infofields(toto-fields:toto-1))
+
+
+if (n_elements(nodata) eq 0) then begin
+;---------------------------------
+; READ .DAT FILE DATA
+;---------------------------------
+; GrADS views gridded data sets as 5-dimensional arrays 
+; varying in longitude, latitude, vertical level, variable, and time.
+;---------------------------------
+
+print, '----------------'
+print, 'reading data ...'
+print, '----------------'
+print, 'longitudes: ', min(x), max(x), nx, ' points'
+print, 'latitudes: ', min(y), max(y), ny, ' points' 
+print, 'altitudes: ', min(z), max(z), nz, ' points'
+print, 'local times: ', min(t), max(t), nt, ' points'
+print, fields, ' recorded fields :'
+print, desc_field
+print, '----------------'
+
+	;;very slow method
+	;;----------------	
+	;data=read_ascii('input.dat', missing_value=1e37)
+	;datadat=data.field1
+
+; see http://www.dfanning.com/tips/ascii_column_data.html	
+OPENR, lun, 'input.dat', /GET_LUN
+
+;count=0L
+output=fltarr(fields,nx,ny,nz,nt)
+dummy=0.
+
+for l=0,nt-1 do begin 						;time loop
+print, 'time loop ...', l+1, ' / ', string(nt,'(I0)')  	
+	for f=0, fields-1 do begin ;fields (whether 2D or 3D)	;variable loop
+	nzf=vertical(f)
+	print, 'reading field ...', f+1, ' / ', string(fields,'(I0)') 
+		for k=0,nzf-1 do begin  			;vertical loop
+			for j=0,ny-1 do begin			;latitude loop
+			for i=0,nx-1 do begin			;longitude loop
+
+				;;very slow method
+				;output(f,i,j,k,l)=datadat(count)
+                                ;count=count+1
+
+				READF, lun, dummy
+				output(f,i,j,k,l)=dummy
+
+			endfor
+			endfor
+		endfor
+	endfor
+endfor
+
+; missing values
+w=where(output eq 1e20)
+if (w(0) ne -1) then begin
+	print, 'change missing values ...'
+	output[w]=1e37
+endif
+
+
+CLOSE, lun
+;SPAWN, '\rm input.dat_tmp'
+print, '...done !'
+help, /memory
+print, '---------'
+
+;if (count ne n_elements(datadat)) then begin
+;	print, 'some data were not read !'
+;	stop
+;endif
+
+;;
+;; Manage missing data so as IDL recognize them
+;;
+;w=where(output eq 1e37)
+;if (w(0) ne -1) then output[w]=!Values.F_NAN
+
+endif
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/report.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/report.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/report.idl	(revision 207)
@@ -0,0 +1,87 @@
+;;---------------------------------------
+;  REPORT
+;
+;  **** DO NOT MODIFY ****
+;
+;  set parameters in plot.def then type:
+;
+;  @report.idl
+;
+;;---------------------------------------
+
+
+field1='' & field2='' & winds=''
+backup_data='no' & already_data='no'  	
+datafolder='./' & plotfolder='./'
+topo=0
+extract='no'
+
+textitle='plot'
+texcomments='plot'	
+
+SPAWN, '\rm user.idl'
+SPAWN, 'grep -v grep plot.def > user.idl'
+
+;; to avoid dumb and useless warnings from IDL
+space=0. & altitude=0. & lon=0. & lat=0.
+what_I_plot=0. & title_user='' & missing_value=0.
+
+@user.idl
+if (nam5 eq " interp_method = 0 ") then coord='model_level'
+if ((nam5 eq " interp_method = 1 ") and (tabnam(0) lt tabnam(1))) then coord='height'
+
+.compile call_arwpost
+if (extract eq 'yes') then call_arwpost, nam1, nam2, nam3, nam4, nam5, tabnam
+
+denom=plot+'_'+coord+'_'+field1
+if ((field2 ne '') and (topo eq 0)) then denom=denom+'_'+field2
+if (topo eq 1) then denom=denom+'_HGT'
+if (winds(0) ne '') then denom=denom+'_'+winds(0)+winds(1)
+
+if (already_data eq 'yes') then SPAWN, 'ln -sf  '+datafolder+'/'+coord+'.input.ctl input.ctl'
+if (already_data eq 'yes') then SPAWN, 'ln -sf  '+datafolder+'/'+coord+'.input.dat input.dat'
+
+SPAWN, '\rm param_plot.idl'
+SPAWN, 'grep grepALL plot.def > param_plot.idl'
+if ((plot eq 'meridional') or (plot eq 'zonal')) then SPAWN, 'grep grepSEC plot.def >> param_plot.idl'
+if (plot eq 'map') then SPAWN, 'grep grepMAP plot.def >> param_plot.idl'
+.compile map_latlon
+.compile section
+
+!p.charthick = 2.0
+!p.thick = 3.0
+!x.thick = 2.0
+!y.thick = 2.0
+
+for i=1,num do $
+        out_wrf, $
+        plot=plot, $
+        field1=field1, $
+        field2=field2, $
+        when=i, $
+        winds=winds, $
+        level=level,$
+        save_data=yeah,$        ;; data is loaded only once
+        topo=topo,$
+;        range=range,$
+        colors=colors, $
+        nlon=nlon, $
+        nlat=nlat, $
+        save_ps=denom+string(1000+i,'(I0)')
+
+SPAWN, 'touch report.comments'
+SPAWN, '\rm report.comments'
+SPAWN, 'echo '+textitle+' > report.comments'
+SPAWN, 'echo '+texcomments+' >> report.comments'
+SPAWN, 'rm -f '+denom+'_.ps'
+print, 'executing ... ','base '+denom+'????.ps < report.comments'
+SPAWN, 'base '+denom+'????.ps < report.comments'
+SPAWN, 'mv -f base.ps '+denom+'_.ps'
+
+SPAWN, 'mv -f ./'+denom+'????.ps '+plotfolder+'/'
+SPAWN, 'mv -f ./'+denom+'_.ps '+plotfolder+'/'
+if (backup_data eq 'yes') then SPAWN, 'cp -f namelist.ARWpost '+datafolder+'/'+coord+'.namelist.ARWpost'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.ctl '+datafolder+'/'+coord+'.input.ctl'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.dat '+datafolder+'/'+coord+'.input.dat'
+
+SPAWN, 'cp -f plot.def '+plotfolder+'/'+denom+'.def'
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/see.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/see.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/see.idl	(revision 207)
@@ -0,0 +1,76 @@
+;;---------------------------------------
+;  TRACE
+;
+;  **** DO NOT MODIFY ****
+;
+;  set parameters in plot.def then type:
+;
+;  @trace.idl
+;
+;;---------------------------------------
+
+field1='' & field2='' & winds=''
+backup_data='no' & already_data='no'  	
+datafolder='./' & plotfolder='./'
+extract='no'
+
+SPAWN, '\rm user.idl'
+SPAWN, 'grep -v grep plot.def > user.idl'
+
+;; to avoid dumb and useless warnings from IDL
+space=0. & altitude=0. & lon=0. & lat=0.  
+what_I_plot=0. & title_user='' & missing_value=0.
+
+@user.idl
+if (nam5 eq " interp_method = 0 ") then coord='model_level'
+if ((nam5 eq " interp_method = 1 ") and (tabnam(0) lt tabnam(1))) then coord='height'
+
+.compile call_arwpost
+if (extract eq 'yes') then call_arwpost, nam1, nam2, nam3, nam4, nam5, tabnam
+
+denom=plot+'_'+coord+'_'+field1
+if ((field2 ne '') and (topo eq 0)) then denom=denom+'_'+field2
+if (topo eq 1) then denom=denom+'_HGT'
+if (winds(0) ne '') then denom=denom+'_'+winds(0)+winds(1)
+
+if (already_data eq 'yes') then SPAWN, 'ln -sf  '+datafolder+'/'+coord+'.input.ctl input.ctl'
+if (already_data eq 'yes') then SPAWN, 'ln -sf  '+datafolder+'/'+coord+'.input.dat input.dat'
+
+SPAWN, '\rm param_plot.idl'
+SPAWN, 'grep grepALL plot.def > param_plot.idl'
+if ((plot eq 'meridional') or (plot eq 'zonal')) then SPAWN, 'grep grepSEC plot.def >> param_plot.idl'
+if (plot eq 'map') then SPAWN, 'grep grepMAP plot.def >> param_plot.idl'
+.compile map_latlon
+.compile section
+
+
+set_plot, 'x'
+!P.MULTI = [0, 2, 3]
+window, 0, xsize=600, ysize=900
+
+!p.charthick = 2.0
+!p.thick = 3.0
+!x.thick = 2.0
+!y.thick = 2.0
+
+
+
+for i=1,num do $
+	out_wrf, $
+	plot=plot, $
+	field1=field1, $
+	field2=field2, $
+	when=i, $
+	winds=winds, $
+	level=level,$
+        save_data=yeah,$	;; data is loaded only once
+	topo=topo,$
+;	range=range,$
+	colors=colors, $
+	nlon=nlon, $
+	nlat=nlat
+
+if (backup_data eq 'yes') then SPAWN, 'cp -f namelist.ARWpost '+datafolder+'/'+coord+'.namelist.ARWpost'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.ctl '+datafolder+'/'+coord+'.input.ctl'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.dat '+datafolder+'/'+coord+'.input.dat'
+SPAWN, 'cp -f plot.def '+plotfolder+'/'+denom+'.def'
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/trace.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/trace.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/trace.idl	(revision 207)
@@ -0,0 +1,93 @@
+;;---------------------------------------
+;  TRACE
+;
+;  **** DO NOT MODIFY ****
+;
+;  set parameters in plot.def then type:
+;
+;  @trace.idl
+;
+;;---------------------------------------
+
+field1='' & field2='' & winds=''
+backup_data='no' & already_data='no'  	
+datafolder='./' & plotfolder='./'
+topo=0
+extract='no'
+
+SPAWN, '\rm user.idl'
+SPAWN, 'grep -v grep plot.def > user.idl'
+
+;; to avoid dumb and useless warnings from IDL
+space=0. & altitude=0. & lon=0. & lat=0.  
+what_I_plot=0. & title_user='' & missing_value=0.
+
+@user.idl
+if (nam5 eq " interp_method = 0 ") then coord='model_level'
+if ((nam5 eq " interp_method = 1 ") and (tabnam(0) lt tabnam(1))) then coord='height'
+
+.compile call_arwpost
+if (extract eq 'yes') then call_arwpost, nam1, nam2, nam3, nam4, nam5, tabnam
+
+denom=plot+'_'+coord+'_'+field1
+if ((field2 ne '') and (topo eq 0)) then denom=denom+'_'+field2
+if (topo eq 1) then denom=denom+'_HGT'
+if (winds(0) ne '') then denom=denom+'_'+winds(0)+winds(1)
+
+if (already_data eq 'yes') then SPAWN, 'ln -sf  '+datafolder+'/'+coord+'.input.ctl input.ctl'
+if (already_data eq 'yes') then SPAWN, 'ln -sf  '+datafolder+'/'+coord+'.input.dat input.dat'
+
+SPAWN, '\rm param_plot.idl'
+SPAWN, 'grep grepALL plot.def > param_plot.idl'
+if ((plot eq 'meridional') or (plot eq 'zonal')) then SPAWN, 'grep grepSEC plot.def >> param_plot.idl'
+if (plot eq 'map') then SPAWN, 'grep grepMAP plot.def >> param_plot.idl'
+.compile map_latlon
+.compile section
+
+!p.charthick = 2.0
+!p.thick = 3.0
+!x.thick = 2.0
+!y.thick = 2.0
+
+out_wrf, $
+        plot=plot, $
+        field1=field1, $
+        field2=field2, $
+        when=1, $
+        winds=winds, $
+        level=level,$
+        save_data=yeah,$        ;; data is loaded only once
+        topo=topo,$
+;        range=range,$
+        colors=colors, $
+        nlon=nlon, $
+        nlat=nlat, $
+        save_ps=denom+string(1001,'(I0)')
+;
+; display the first one as a sample
+;
+SPAWN, 'display ./'+denom+'1001.ps &'
+
+if (num ge 2) then for i=2,num do $
+	out_wrf, $
+	plot=plot, $
+	field1=field1, $
+	field2=field2, $
+	when=i, $
+	winds=winds, $
+	level=level,$
+        save_data=yeah,$	;; data is loaded only once
+	topo=topo,$
+	range=range,$
+	colors=colors, $
+	nlon=nlon, $
+	nlat=nlat, $
+	save_ps=denom+string(1000+i,'(I0)')
+
+SPAWN, 'mv -f ./'+denom+'????.ps '+plotfolder+'/'
+if (backup_data eq 'yes') then SPAWN, 'cp -f namelist.ARWpost '+datafolder+'/'+coord+'.namelist.ARWpost'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.ctl '+datafolder+'/'+coord+'.input.ctl'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.dat '+datafolder+'/'+coord+'.input.dat'
+
+SPAWN, 'cp -f plot.def '+plotfolder+'/'+denom+'.def'
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/trace.idl_old
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/trace.idl_old	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/trace.idl_old	(revision 207)
@@ -0,0 +1,45 @@
+;;---------------------------------------
+;  TRACE
+;
+;  set parameters in user.idl then type:
+;
+;  @trace.idl
+;
+;;---------------------------------------
+
+@user.idl
+
+denom=plot+'_'+coord+'_'+field1
+
+if (already_data eq 'yes') then SPAWN, 'ln -sf  '+folder+'/'+coord+'.input.ctl input.ctl'
+if (already_data eq 'yes') then SPAWN, 'ln -sf  '+folder+'/'+coord+'.input.dat input.dat'
+
+SPAWN, '\rm map_latlon_user'
+SPAWN, 'tail -15 user.idl > map_latlon_user'
+.compile map_latlon
+
+SPAWN, '\rm section_user'
+SPAWN, 'tail -15 user.idl > section_user'
+.compile section
+
+for i=1,num do $
+	out_wrf, $
+	plot=plot, $
+	field1=field1, $
+	field2=field2, $
+	when=i, $
+	winds=winds, $
+	level=level,$
+        save_data=yeah,$
+	topo=topo,$
+	range=range,$
+	colors=colors, $
+	nlon=nlon, $
+	nlat=nlat 
+
+SPAWN, 'mv -f ./'+denom+'??.ps '+folder+'/'
+if (backup_data eq 'yes') then SPAWN, 'cp -f namelist.ARWpost '+folder+'/'+coord+'.namelist.ARWpost'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.ctl '+folder+'/'+coord+'.input.ctl'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.dat '+folder+'/'+coord+'.input.dat'
+
+SPAWN, 'cp -f user.idl '+folder+'/'+denom+'.idl'
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/user.idl_old
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/user.idl_old	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/obsolete/user.idl_old	(revision 207)
@@ -0,0 +1,126 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  @report.idl
+;  @movie.idl
+;
+;;---------------------------------------
+
+;-----------------
+; initialization
+;-----------------
+winds=0.
+range=0.
+topo=0.
+colors=32
+backup_data='no' ;backup_data='yes'
+already_data='no' ;already_data='yes'
+folder='./WHERE_RESULTS_ARE/'
+
+
+;-----------------
+; check this first
+;-----------------
+num=6
+;
+;coord='height'
+coord='model_level'
+
+;----------------------------
+; general plot settings
+;----------------------------
+plot='map' & level=-1	
+plot='meridional' & nlon=-1 	;bug a corriger: 0
+;plot='zonal' & nlat=-1		;bug a corriger: 0
+
+;-------------------------------------------
+; easy access to already defined plots
+;-------------------------------------------
+;@map_sea_level.idl
+@map_winds_only.idl
+;@map_ertel_vorticity.idl
+;@map_wind_stress.idl
+
+;------------------------
+; user-defined settings
+;------------------------
+; keywords : plot, winds, field1, field2, range, topo, colors
+;------------------------
+
+;field1='tk'
+;nlon=100
+;range=[200,250]
+
+
+
+
+title_user=''     ;to avoid a warning later
+what_I_plot=0.    ;to avoid a warning later
+missing_value=0.  ;to avoid a warning later
+space=0.
+;;***************************************************
+;; below this line do not modify number of lines
+;; because this will be copied ... with command tail
+;; comment a line if you do not need it :)
+;;***************************************************
+;;------------------------
+;; modify plot parameters
+
+;; SECTION: 
+title_user, title_axis (2) 
+        xtitle='Horizontal coordinate'
+        ytitle='Altitude'
+endif else begin
+        xtitle=title_axis(0)
+        ytitle=title_axis(1)
+endelse
+
+if (n_elements(space) eq 0) then begin
+        space=findgen(n_elements(what_I_plot(*,0)))
+endif
+if (n_elements(altitude) eq 0) then begin
+        altitude=findgen(n_elements(what_I_plot(0,*)))
+endif
+
+if (n_elements(minfield_init) eq 0) then minfield_init=0.
+if (n_elements(maxfield_init) eq 0) then maxfield_init=0.
+if (n_elements(minspace) eq 0) then minspace=0.
+if (n_elements(maxspace) eq 0) then maxspace=0.
+if (n_elements(minalt) eq 0) then minalt=min(altitude)
+if (n_elements(maxalt) eq 0) then maxalt=max(altitude)
+if (n_elements(colors) eq 0) then colors=32
+if (n_elements(title) eq 0) then title=''
+if (n_elements(pal) eq 0) then pal=33
+if (n_elements(format) eq 0) then format='(F6.2)'
+if (format eq '') then format='(F6.2)'
+
+if ((n_elements(overvector_x) eq 0) or (n_elements(overvector_y) eq 0)) then begin
+        overvector_x=0.
+        overvector_y=0.
+endif
+
+;
+; dilatation factor for winds
+;
+if (n_elements(overvector_x)*n_elements(overvector_y) ne 1) then space=space/factor
+
+
+
+
+
+
+;;------------------------
+;;
+space=space 
+ ;minspace=158.5 & maxspace=160.
+minalt=-3 & maxalt=7
+ ;factor=15.
+ ;windex=20.
+ ;format='(F6.3)'
+ ;title_user='Sea-level surface pressure'+title_user
+pal=33
+ ;w=where(abs(what_I_plot) ge 0.03)
+ ;if (w[0] ne -1) then what_I_plot[w]=0.03
+;;**** END ****
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/out_geo.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/out_geo.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/out_geo.pro	(revision 207)
@@ -0,0 +1,181 @@
+pro out_geo, $
+	field1=charvar, $
+	field2=charvar2, $
+	domain=domain, $
+	path=path
+
+;---------------------------------------------------------------;
+;                                                               ;
+; Use:                                                          ;
+;       out_geo, 'HGT_M'	(or) out_geo, 'TOPO'		;
+;	out_geo, 'THERMAL_INERTIA' (or) out_geo, 'TI'           ;
+;       out_geo, 'ALBEDO_GCM' (or) out_geo, 'ALBEDO'            ;
+;       out_geo, 'GHT'		                                ;
+;								;
+;	-- nested domain					;
+;	out_geo, 'HGT_M', domain='d02'				;
+;                                                               ;
+; Options:							;
+;		- domain: default is 'd01', 			;
+;			but can be 'd02', 'd03', etc ...	;
+;		- path: where the geo_em files are		; 
+;			'/my_root/my_folder/'			;
+;                                                               ;
+; A. Spiga, April 2007 - July 2007 - September 2007             ;
+;                                                               ;
+;---------------------------------------------------------------;
+
+
+
+
+;----------------------
+; set parameters
+;----------------------
+
+colors=32
+format='(F6.2)'
+minfield_init=0.
+maxfield_init=0.
+
+default_path='./'
+if (n_elements(path) eq 0) then path=default_path
+if (n_elements(domain) eq 0) then domain='d01'
+file=path+'/geo_em.'+domain+'.nc'
+
+
+
+;----------------------
+; equivalent inputs
+;----------------------
+case charvar of
+	'HGT_M':
+	'TOPO': charvar='HGT_M'
+	'THERMAL_INERTIA':
+	'TI': charvar='THERMAL_INERTIA'
+	'ALBEDO_GCM':
+	'ALBEDO': charvar='ALBEDO_GCM'
+	'GHT':
+	else:
+endcase	
+if (n_elements(charvar2) ne 0) then begin
+case charvar2 of
+        'HGT_M':
+        'TOPO': charvar2='HGT_M'
+        'THERMAL_INERTIA':
+        'TI': charvar2='THERMAL_INERTIA'
+        'ALBEDO_GCM':
+        'ALBEDO': charvar2='ALBEDO_GCM'
+        'GHT':
+	else:
+endcase
+endif							
+
+
+;----------------------
+; set graphics
+;----------------------
+
+set_plot, 'ps'
+device, file='geo_em.'+domain+'_'+charvar+'.ps', /color
+;set_plot, 'x'
+
+case charvar of
+        'HGT_M': pal=33 ;16  ;4
+        'THERMAL_INERTIA': pal=3
+        'ALBEDO_GCM': pal=0
+        'GHT': pal=33
+	else:
+endcase
+				
+
+
+!p.charthick = 2.0
+!p.thick = 3.0
+!x.thick = 2.0
+!y.thick = 2.0
+
+case charvar of
+	'HGT_M': title='Altimetry (km)'
+	'THERMAL_INERTIA': title='Thermal inertia (!NJ!N.m!U-2!N.s!U-1/2!N.K!U-1!N)'
+	'ALBEDO_GCM': title='Albedo LW (%)'
+	'GHT': title='Geopotential height (m)'
+	else: title=''
+endcase
+
+
+;-------------------------------
+; open file and read variables
+;-------------------------------
+cdfid = ncdf_open(file)
+
+; field
+print, charvar
+varid=ncdf_varid(cdfid,charvar)
+        ncdf_varget, cdfid, varid, var
+; lon
+varid=ncdf_varid(cdfid,'XLONG_M')
+        ncdf_varget, cdfid, varid, lon
+	lon=reform(lon[*,0])
+; lat
+varid=ncdf_varid(cdfid,'XLAT_M')
+        ncdf_varget, cdfid, varid, lat
+	lat=reform(lat[0,*])
+
+if (n_elements(charvar2) ne 0) then begin
+	print, charvar2
+	varid=ncdf_varid(cdfid,charvar2)
+	ncdf_varget, cdfid, varid, overcontour
+endif else begin
+	overcontour=0.
+endelse	
+	
+
+;-------------------------------
+; calculation on variables
+;-------------------------------
+case charvar of
+        'HGT_M': var=var/1000
+        'THERMAL_INERTIA': 
+        'ALBEDO_GCM': var=var*100
+        'GHT': 
+	else:
+endcase
+				
+	
+	
+;---------
+; plot !
+;---------
+
+minfield=min(var)
+maxfield=max(var)
+print, 'mM', minfield, maxfield
+
+what_I_plot=var
+
+
+map_set, -90, 0, /azimuthal, limit=[-90,-180,-60,180]
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon, $                                  ; 1D latitude
+        lat                                  ; 1D longitude
+ 
+
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon, $                                  ; 1D latitude
+        lat, $                                  ; 1D longitude
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+;        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+;        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+        colors=colors, $                        ; number of colors/levels (32 is default)
+        title=title, $                          ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+												
+
+device, /close
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/out_geo_test.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/out_geo_test.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/out_geo_test.pro	(revision 207)
@@ -0,0 +1,204 @@
+pro out_geo_test, $
+	field1=charvar, $
+	field2=charvar2, $
+	domain=domain, $
+	path=path
+
+;---------------------------------------------------------------;
+;                                                               ;
+; Use:                                                          ;
+;       out_geo, 'HGT_M'	(or) out_geo, 'TOPO'		;
+;	out_geo, 'THERMAL_INERTIA' (or) out_geo, 'TI'           ;
+;       out_geo, 'ALBEDO_GCM' (or) out_geo, 'ALBEDO'            ;
+;       out_geo, 'GHT'		                                ;
+;								;
+;	-- nested domain					;
+;	out_geo, 'HGT_M', domain='d02'				;
+;                                                               ;
+; Options:							;
+;		- domain: default is 'd01', 			;
+;			but can be 'd02', 'd03', etc ...	;
+;		- path: where the geo_em files are		; 
+;			'/my_root/my_folder/'			;
+;                                                               ;
+; A. Spiga, April 2007 - July 2007 - September 2007             ;
+;                                                               ;
+;---------------------------------------------------------------;
+
+
+
+
+;----------------------
+; set parameters
+;----------------------
+
+colors=32
+format='(F6.2)'
+minfield_init=0.
+maxfield_init=0.
+
+default_path='/donnees/aslmd/big_data/WRF/WPS'
+default_path='./'
+
+
+if (n_elements(charvar) eq 0) then charvar='HGT_M'
+if (n_elements(path) eq 0) then path=default_path
+if (n_elements(domain) eq 0) then domain='d01'
+file=path+'/geo_em.'+domain+'.nc'
+
+
+
+;----------------------
+; equivalent inputs
+;----------------------
+case charvar of
+	'HGT_M':
+	'TOPO': charvar='HGT_M'
+	'THERMAL_INERTIA':
+	'TI': charvar='THERMAL_INERTIA'
+	'ALBEDO_GCM':
+	'ALBEDO': charvar='ALBEDO_GCM'
+	'GHT':
+	else:
+endcase	
+if (n_elements(charvar2) ne 0) then begin
+case charvar2 of
+        'HGT_M':
+        'TOPO': charvar2='HGT_M'
+        'THERMAL_INERTIA':
+        'TI': charvar2='THERMAL_INERTIA'
+        'ALBEDO_GCM':
+        'ALBEDO': charvar2='ALBEDO_GCM'
+        'GHT':
+	else:
+endcase
+endif							
+
+
+;----------------------
+; set graphics
+;----------------------
+
+set_plot, 'ps'
+device, file='geo_em.'+domain+'_'+charvar+'.ps', /color
+;set_plot, 'x'
+
+case charvar of
+        'HGT_M': pal=33 ;16  ;4
+        'THERMAL_INERTIA': pal=3
+        'ALBEDO_GCM': pal=0
+        'GHT': pal=33
+	else: pal=33
+endcase
+				
+
+
+!p.charthick = 2.0
+!p.thick = 3.0
+!x.thick = 2.0
+!y.thick = 2.0
+
+case charvar of
+	'HGT_M': title='Altimetry (km)'
+	'THERMAL_INERTIA': title='Thermal inertia (!NJ!N.m!U-2!N.s!U-1/2!N.K!U-1!N)'
+	'ALBEDO_GCM': title='Albedo LW (%)'
+	'GHT': title='Geopotential height (m)'
+	else: title=''
+endcase
+
+
+;-------------------------------
+; open file and read variables
+;-------------------------------
+cdfid = ncdf_open(file)
+
+; field
+print, charvar
+varid=ncdf_varid(cdfid,charvar)
+        ncdf_varget, cdfid, varid, var
+; lon
+varid=ncdf_varid(cdfid,'XLONG_M')
+        ncdf_varget, cdfid, varid, lon
+	lon=reform(lon[*,0])
+; lat
+varid=ncdf_varid(cdfid,'XLAT_M')
+        ncdf_varget, cdfid, varid, lat
+	lat=reform(lat[0,*])
+
+if (n_elements(charvar2) ne 0) then begin
+	print, charvar2
+	varid=ncdf_varid(cdfid,charvar2)
+	ncdf_varget, cdfid, varid, overcontour
+endif else begin
+	overcontour=0.
+endelse	
+	
+
+;-------------------------------
+; calculation on variables
+;-------------------------------
+case charvar of
+        'HGT_M': var=var/1000.
+        'THERMAL_INERTIA': 
+        'ALBEDO_GCM': var=var*100.
+        'GHT': 
+	else:
+endcase
+
+!p.multi=[0,3,3]
+set_ls_tab=[90,270]
+set_lct_tab=[09,12,16]
+set_tau_tab=[0.3,1.5]
+
+for yeahyeahyeah=0,1 do begin
+for yeah=0,1 do begin
+for yeahyeah=0,2 do begin
+set_ls=set_ls_tab(yeah) & print, set_ls
+set_lct=set_lct_tab(yeahyeah) & print, set_lct 
+set_tau=set_tau_tab(yeahyeahyeah) & print, set_tau
+if ((set_ls eq 90) and (set_tau eq 1.5)) then begin
+		goto, beurk
+endif
+@slope.inc	
+
+;---------
+; plot !
+;---------
+
+minfield=min(var)
+maxfield=max(var)
+print, 'mM', minfield, maxfield
+
+yysize=150
+what_I_plot=var
+lon_=lon
+lat_=lat
+;what_I_plot=congrid(reform(var),yysize,yysize,/INTERP)
+;lon_=congrid(lon,yysize)
+;lat_=congrid(lat,yysize)
+
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon_, $                                  ; 1D latitude
+        lat_, $                                  ; 1D longitude
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+;        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+;        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+        colors=colors, $                        ; number of colors/levels (32 is default)
+        title=title, $                          ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+	
+;;;;;;;;;;;;;;;;;
+beurk:
+endfor
+endfor
+endfor
+;;;;;;;;;;;;;;;;;
+
+
+device, /close
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/ps2png
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/ps2png	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/ps2png	(revision 207)
@@ -0,0 +1,52 @@
+#! /bin/bash
+# A. Spiga - October-December 2008
+# use: ps2png 
+# options: -r 200 indicates a resolution of 200
+#          -a indicates the alternate use of ps2epsi 
+
+##########
+resol=150
+##########
+
+while getopts "r:a" options; do
+  case $options in
+   r ) resol=${OPTARG} 
+       echo conversion resolution is ${resol} resolution ;;
+   a ) yeahyeah=1
+  esac
+done
+
+
+if [[ $(ls | grep "\.ps") != "" ]]
+then
+	if [[ "${yeahyeah}" == "1" ]]
+	then
+		echo convert $(ls | grep "\.ps" | wc -l) ps files with ps2epsi
+		find *.ps -exec ps2epsi {} \; 2> /dev/null
+		rename -f 's/.epsi/.eps/' *.epsi
+	else
+		echo convert $(ls | grep "\.ps" | wc -l) ps files with convert		
+		find *.ps -exec convert {} '{}.eps' \;
+		rename -f 's/.ps.eps/.eps/' *.ps.eps
+	fi
+fi
+
+if [[ $(ls | grep "\.eps") != "" ]]
+then
+echo convert $(ls | grep "\.eps" | wc -l) eps files
+find *.eps -exec gs -sDEVICE=png16m -dTextAlphaBits=4 -sOutputFile={}.png -dNOPAUSE -dBATCH -dEPSCrop -r${resol}x${resol} {} > /dev/null 2> /dev/null \;
+rename -f 's/.eps.png/.png/' *.eps.png
+fi
+
+#if [[ $(which pngnq) != "" ]]
+#then
+#echo optimizing ...
+#pngnq -vf -s1 *.png > /dev/null 2> /dev/null
+#rename -f 's/-nq8.png$/.png/' *.png
+#fi
+
+##if [[ $(which optipng) != "" ]]
+##then
+##echo optimizing 2 ...
+##optipng -o7 *.png > /dev/null 2> /dev/null
+##fi
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/report.idl_old
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/report.idl_old	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/report.idl_old	(revision 207)
@@ -0,0 +1,55 @@
+;;---------------------------------------
+;  REPORT
+;
+;  set parameters in user.idl then type:
+;
+;  @report.idl
+;
+;;---------------------------------------
+
+@user.idl
+
+denom=plot+'_'+coord+'_'+field1
+
+if (already_data eq 'yes') then SPAWN, 'ln -sf  '+folder+'/'+coord+'.input.ctl input.ctl'
+if (already_data eq 'yes') then SPAWN, 'ln -sf  '+folder+'/'+coord+'.input.dat input.dat'
+
+SPAWN, '\rm map_latlon_user'
+SPAWN, 'tail -15 user.idl > map_latlon_user'
+.compile map_latlon
+
+SPAWN, '\rm section_user'
+SPAWN, 'tail -15 user.idl > section_user'
+.compile section
+
+for i=1,num do $
+	out_wrf, $
+	plot=plot, $
+	field1=field1, $
+	field2=field2, $
+	when=i, $
+	winds=winds, $
+	level=level,$
+        save_data=yeah,$
+	topo=topo,$
+	range=range,$
+	colors=colors, $
+	nlon=nlon, $
+	nlat=nlat 
+
+
+SPAWN, '\rm report.comments'
+SPAWN, 'echo '+plot+' > report.comments'
+SPAWN, 'echo '+plot+' >> report.comments'
+;SPAWN, 'echo '+coord+' >> report.comments'	;;attention avec le _
+SPAWN, 'rm -f '+denom+'_.ps'
+print, 'executing ... ','base '+denom+'??.ps < report.comments'
+SPAWN, 'base '+denom+'??.ps < report.comments'
+SPAWN, 'mv -f base.ps '+denom+'_.ps'
+SPAWN, 'mv -f ./'+denom+'??.ps '+folder+'/'
+SPAWN, 'mv -f ./'+denom+'_.ps '+folder+'/'
+if (backup_data eq 'yes') then SPAWN, 'cp -f namelist.ARWpost '+folder+'/'+coord+'.namelist.ARWpost'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.ctl '+folder+'/'+coord+'.input.ctl'
+if (backup_data eq 'yes') then SPAWN, 'cp -f input.dat '+folder+'/'+coord+'.input.dat'
+
+SPAWN, 'cp -f user.idl '+folder+'/'+denom+'.idl'
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/sea_level.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/sea_level.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/sea_level.idl	(revision 207)
@@ -0,0 +1,323 @@
+
+if ((winds(0) eq 'tk') and (winds(1) eq 'HGT')) then begin
+
+print, 'computing sea-level pressure'
+title='Reduced surf. pressure (Pa)'
+;title='Equiv. Temperature (K)'
+pression=what_I_plot
+
+
+;what_I_plot = what_I_plot + 30.
+;overvector_x = overvector_x*0. + overvector_x(0,0) 
+
+;;
+;; TGCM
+;;
+;nx=n_elements(overvector_y(*,0))
+;ny=n_elements(overvector_y(0,*))
+;tgcm=(  overvector_x(0,0)+ $
+;        overvector_x(nx-1,0)+ $
+;        overvector_x(0,ny-1)+ $
+;        overvector_x(nx-1,ny-1) ) / 4.
+;print, overvector_x(0,0), overvector_x(nx-1,0), overvector_x(0,ny-1), overvector_x(nx-1,ny-1)
+;print, tgcm
+;;
+;; USUAL SYSTEMATIC BIAS
+;;
+;what_I_plot = what_I_plot + 20.
+;;
+;; ROUGH T EFFECT ON RADIATIVE TRANSFER
+;;
+;print, mean(overvector_x)
+;caca=tgcm - overvector_x
+;;caca=tgcm - mean(overvector_x)
+;what_I_plot = what_I_plot - caca
+;;
+;; TEMP FOR HYPSOMETRIC
+;; - attenue un peu - peu d'effets
+;overvector_x = overvector_x*0. + tgcm 
+;;
+;; NOISE OF 2.2 Pa
+;;
+;what_I_plot = what_I_plot + 2.2*(2.*(RANDOMU(seed,nx,ny)-0.5))
+
+;;; NON
+;;;ecart_t = 222. - overvector_x		;; tgcm - tmeso
+;;;ecart_p = - ecart_t			;; pgcm - pmeso
+;;;yeahyeah = what_I_plot - ecart_p  	;; pmeso + pgcm - pmeso = pgcm
+;;;what_I_plot = yeahyeah
+
+;;;;marche bof
+;;overvector_y=CONGRID(overvector_y,nx*50,ny*50)
+;;overvector_y=shift(overvector_y,1,1)
+;;overvector_y=CONGRID(overvector_y,nx,ny)
+
+
+
+;;augmen=10./100.
+;;augmen=0.
+;;mmm=mean(overvector_y)
+;;overvector_y=overvector_y-mmm
+;;overvector_y=overvector_y*(1.+augmen)
+;;print, max(overvector_y), min(overvector_y)
+;;overvector_y=mmm+overvector_y
+;;print, max(overvector_y), mean(overvector_y), min(overvector_y)
+
+
+;;*******************************BRUIT
+;;;;50m limite ...
+;noise=25.
+;print, max(overvector_y), mean(overvector_y), min(overvector_y)
+;overvector_y=overvector_y + noise*(2.*(RANDOMU(seed,nx,ny)-0.5))
+;print, max(overvector_y), mean(overvector_y), min(overvector_y)
+;;*******************************BRUIT
+
+
+
+
+
+
+
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+H=192.*overvector_x/3.72	;;unit is m
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+zref=mean(overvector_y)         ;;topo (m)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+goto, notest
+;;;****************************************************************************************
+	;;; TEMPERATURE
+	;temp_meso=overvector_x	   ;;save if needed
+	;overvector_x=mean(overvector_x)
+	;H=192.*overvector_x/3.72
+	;tempbias=temp_meso-overvector_x
+
+;; PRESSURE
+;ptopo=610.*exp(-overvector_y/H) & what_I_plot=ptopo    ;; perfect case
+
+		;w1=where((overvector_y - median(overvector_y)) gt 200.) & w2=where((overvector_y - median(overvector_y)) lt -200.)
+		;tempbias=overvector_x*0. & tempbias[w1] = -20. & tempbias[w2] = +20.
+
+;; TEMPBIAS IN SCALE HEIGHT 
+;tempbias=mean(overvector_x)-overvector_x
+;tempbias=-10.
+
+;; ZREF
+;zref=0.	
+
+;; REFPRES
+;refpres=610.
+
+
+;;
+;; perfect case
+;;
+;ptopo=610.*exp(-overvector_y/H) & what_I_plot=ptopo 
+;tempbias=222.-overvector_x
+;zref=0.
+;refpres=610.
+
+;;
+;; comp OMEGA
+;;
+;tcst = 222. ;;230. 226. 206.
+;tempbias=tcst-overvector_x
+zref=-945.43469
+;refpres=0.
+;zref=-200.
+;zref=-400.
+;zref=-95.
+;;;****************************************************************************************
+notest:
+
+;goto, caca
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;                       ;;
+;; HYPSOMETRIC EQUATION  ;;
+;;			 ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; recalculate H with temperature bias
+;
+if (n_elements(tempbias) eq 0) then tempbias=0.	;; verif: donne champ constant quand perfect
+H=192.*(overvector_x+tempbias)/3.72
+print, 'zref', zref, ' meanH', mean(H)
+;
+; hypsometric
+;
+what_I_plot=what_I_plot*exp((overvector_y-zref)/H)
+;
+; anomaly
+;
+if (n_elements(refpres) eq 0) then refpres=median(what_I_plot)
+if (refpres eq -9999) then refpres=median(what_I_plot)
+what_I_plot=what_I_plot-refpres
+refpres=-9999.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+caca:
+
+
+goto, coucou
+
+
+	;;for coco=0,100 do begin
+	;;altchosen = 100. - float(coco*10.)
+	;;print, altchosen
+
+
+;altchosen=-915.93644
+;altchosen=200.
+;altchosen=max(overvector_y)
+;altchosen=min(overvector_y)
+;altchosen=mean(overvector_y)
+;altchosen=0.
+;altchosen=-2000.
+;altchosen=-200.
+;altchosen=200.
+;altchosen=-400.
+;altchosen=1000.
+;altchosen=200.  ;; le meilleur match entre H et RT1km/g ATTENTION, NON !!
+;altchosen=-200.  ;; le meilleur pour 13h
+;altchosen=-400. ;;Tequiv trop hautes
+;altchosen=-90.
+;altchosen=-93.
+;altchosen=-95.
+;altchosen=-400.
+;altchosen=-890.
+
+altchosen=-50.
+;read, altchosen, prompt='alt?'
+
+;;-----------------------;;
+;; find nearest point !  ;;
+;;-----------------------;;
+dis=overvector_y-altchosen & w=where(abs(dis) eq min(abs(dis))) & zref=overvector_y[w(0)] & Pref=pression[w(0)]
+print, zref, Pref
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;
+;hache=192.* overvector_x / 3.72 & what_I_plot2=hache*alog(Pref/what_I_plot) - (overvector_y-altchosen)
+;what_I_plot=what_I_plot2
+;print, min(what_I_plot2), max(what_I_plot2), mean(what_I_plot2)
+;goto, coucou
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;-------------------------;;
+;; POSSIBLE 0/0 PROBLEMS   ;;
+;;-------------------------;;
+w=where(abs(alog(Pref/what_I_plot)) lt 0.02) & if (w(0) ne -1) then what_I_plot[w]=!Values.F_NAN
+w=where(abs(overvector_y-zref) lt 100.) & if (w(0) ne -1) then what_I_plot[w]=!Values.F_NAN 
+
+;;-------------------------;;
+;; EQUIVALENT TEMPERATURE  ;;
+;;-------------------------;;
+;
+; H
+;
+what_I_plot=(overvector_y-zref)/alog(Pref/what_I_plot)/1000.
+;
+; T
+;
+what_I_plot=what_I_plot*3.72*1000./192.			
+;what_I_plot=what_I_plot - overvector_x
+
+
+;;-----------------------;;
+;; MOYENNE OK AVEC NANs  ;;
+;;-----------------------;;
+;
+;w=where(FINITE(what_I_plot) ne 0) & moyen=mean(what_I_plot[w]) & print, moyen
+;what_I_plot=what_I_plot-moyen
+
+coucou:
+
+	;;endfor
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+
+;what_I_plot=what_I_plot-mean(what_I_plot)
+
+
+
+;;M1
+;what_I_plot=what_I_plot-ptopo-mean(what_I_plot-ptopo)
+
+
+;what_I_plot=caca
+;what_I_plot=tempbias
+;what_I_plot=topo_ecart
+
+
+
+;level_1km=6
+;;
+;; mean temperature for the whole period
+;;
+;temptmp=reform(u[*,*,level_1km,*])
+;meantemp=total(temptmp,3)/n_elements(temptmp(0,0,*))
+;Hmean=192.*meantemp/3.72
+;;
+;; mean surface pressure for the whole period
+;;
+;temppres=reform(var[*,*,theloop,*])
+;meanpres=total(temppres,3)/n_elements(temppres(0,0,*))
+;
+;
+;        ;** HYDROSTATIC REDUCTION TO LEVEL OF REFERENCE
+;	
+;	overvector_x=reform(u[*,*,level_1km,nt])        ;;T 1km
+;	H=192.*overvector_x/3.72        ;unit is m
+;
+;        overvector_y=reform(v[*,*,0,nt])        ;;topo (m)
+;        zref=mean(overvector_y)
+;        	;zref=median(overvector_y)
+;        	;zref=(max(overvector_y)-min(overvector_y))/2.
+;        	;zref=3000.
+;        print, 'zref', zref
+;
+;	;
+;	; HYPSOMETRIC EQUATION
+;	;
+;;**********
+;H=Hmean
+;;**********
+;	what_I_plot=what_I_plot*exp((overvector_y-zref)/H)
+;	meanpres=meanpres*exp((overvector_y-zref)/Hmean)
+;
+;
+;;
+;; pressure anomaly
+;;
+;what_I_plot=what_I_plot-meanpres
+;
+;
+;;presoro=610.*exp(overvector_y/10000.)
+;;what_I_plot=what_I_plot-presoro
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+
+overvector_x=0
+overvector_y=0
+
+endif
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/send_esa.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/send_esa.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/send_esa.pro	(revision 207)
@@ -0,0 +1,35 @@
+restore, filename='yeahyeah'
+filename = 'mesoscale_profile'
+tab1 = HEIGHTP
+
+;tab2 = reform(WHAT_I_PLOT(*,0))
+
+tab2 = reform(WHAT_I_PLOT(*,1)+WHAT_I_PLOT(*,2)+WHAT_I_PLOT(*,3)+WHAT_I_PLOT(*,4)+WHAT_I_PLOT(*,5))/5.
+
+make_ascii, filename+'_MEAN', tab1, tab2
+
+plot, tab1, tab2
+
+tab2 = reform(WHAT_I_PLOT(*,1))
+make_ascii, filename+'_LT7', tab1, tab2
+plot, tab1, tab2
+
+tab2 = reform(WHAT_I_PLOT(*,2))
+make_ascii, filename+'_LT8', tab1, tab2
+plot, tab1, tab2
+
+tab2 = reform(WHAT_I_PLOT(*,3))
+make_ascii, filename+'_LT9', tab1, tab2
+plot, tab1, tab2
+
+tab2 = reform(WHAT_I_PLOT(*,4))
+make_ascii, filename+'_LT10', tab1, tab2
+plot, tab1, tab2
+
+tab2 = reform(WHAT_I_PLOT(*,5))
+make_ascii, filename+'_LT11', tab1, tab2
+plot, tab1, tab2, yrange=[0.,40.]
+
+
+
+
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/slope.inc
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/slope.inc	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/slope.inc	(revision 207)
@@ -0,0 +1,124 @@
+;
+; horizontal coordinates (meters)
+;
+rad=3397000.
+deg_m=2*rad*!pi/360.
+dlon=deg_m*cos(lat*!pi/180)
+dlat=deg_m
+x=(lon-min(lon))*dlon
+y=(lat-min(lat))*dlat
+;print, x/1000.
+;print, y/1000.
+
+;;----------------------------
+;; methode directe
+;;----------------------------
+;; var is a 2D field
+;; must be HGT_M
+grad, hx, var*1000., x, y, 1
+grad, hy, var*1000., x, y, 2
+;hx=hx*100. ;pente en %
+
+;;-------------------------------
+;; methode "confiance en geogrid"
+;;-------------------------------
+	;varid=ncdf_varid(cdfid,'MAPFAC_M')
+        ;	ncdf_varget, cdfid, varid, msf
+
+
+varid=ncdf_varid(cdfid,'SLPX')
+	ncdf_varget, cdfid, varid, hxwrf
+varid=ncdf_varid(cdfid,'SLPY')
+	ncdf_varget, cdfid, varid, hywrf
+
+;print, 100.*mean(abs(hx-hxwrf*1000.)/hx)
+;print, 100.*mean(abs(hy-hywrf*1000.)/hy)
+
+hx=hxwrf*1000.
+hy=hywrf*1000.
+
+
+
+;; SLOPE ANGLE vs HORIZONTAL
+;;---------------------------	
+theta=atan(sqrt(hx^2+hy^2))
+theta=180.*theta/!pi
+var=round(theta)
+title='Slope angle (deg)'
+format='(I0)'
+pal=16
+
+;goto, squeeze
+;; SLOPE ORIENTATION
+;;--------------------
+;; cas où hx < 0
+	psi=-!pi/2 - atan(hy/hx)
+;; cas où hx > 0
+	w=where(hx ge 0)
+	psi[w]=psi[w]-!pi
+;; SOUTH 0 & WEST 90
+	psi=2*!pi+psi
+	psi=180.*psi/!pi
+;; NORTH 0 & EAST 90 (as MONTECARLO & PARAM)
+psi=(180.+psi) MOD 360
+
+var=round(psi)
+title='Slope orientation (deg)'
+format='(I0)'
+pal=6
+;;
+squeeze:
+
+
+;
+; latitude
+;
+varid=ncdf_varid(cdfid,'XLAT_M')
+        ncdf_varget, cdfid, varid, latyeah
+
+
+;
+; SCATTERED FLUX RATIO
+;
+
+nx=n_elements(latyeah(*,0))
+ny=n_elements(latyeah(0,*))
+
+ratio_s=dblarr(nx,ny)
+ratio_d=dblarr(nx,ny)
+
+count=0
+
+for i=0,nx-1 do begin
+for j=0,ny-1 do begin
+
+	param_slope, $
+        	ls=set_ls, $            ; < input *
+        	lct=set_lct, $          ; < input *
+        	lat=latyeah(i,j), $     ; < input *
+        	tau=set_tau, $         	; < input *
+        	spz=theta(i,j), $       ; < input *
+        	spa=psi(i,j), $         ; < input *
+        	r_s=tmps, $     ; > output
+        	r_d=tmpd     	; > output
+
+	;count=count+1
+	;print, count, tmps, tmpd
+
+	ratio_s(i,j)=tmps
+	ratio_d(i,j)=tmpd
+
+endfor
+endfor
+
+pal=0	
+format='(I0)'
+var=ratio_s*100. & title='Ratio S/S0 (%)'
+
+;var=ratio_d*100. & title='Ratio Fdir/Fdir0 (%)'
+
+title='Ls='+string(set_ls,'(I0)')+' LT='+string(set_lct,'(I0)')+' tau='+string(set_tau,'(F3.1)')
+minfield_init=30.
+maxfield_init=170.
+
+var=round(var)
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/tau_cloud.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/tau_cloud.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/tau_cloud.idl	(revision 207)
@@ -0,0 +1,68 @@
+
+;
+; winds=['ICETOT','RAVE']
+;
+
+if ( (winds(0) eq 'ICETOT') $
+	and (winds(1) eq 'RAVE') ) then begin
+
+print, 'computing water ice cloud opacity'
+
+title='Water ice cloud opacity'
+
+mc=overvector_x		;; kg/m2
+rc=overvector_y		;; m
+
+;
+; VISIBLE BENSON
+;
+rc_mic=2.
+cext=24.655	;; lambda 1 mic
+pi = 3.14159265
+qext=cext/(pi*rc_mic^2)
+print, 'q ext - benson - 1 mic ', qext
+
+;
+; 12 mic.
+;
+cext=70. ;;Wolff 2003 pour 4 mic.
+rc_mic=4.
+pi = 3.14159265
+qext=cext/(pi*rc_mic^2)
+print, 'q ext - wolff - 12 mic ', qext
+;;;Montmessin 2003
+;qext=1.
+
+;
+; .4 microns (visible)
+;
+rc_mic=2.
+cext=20.613  ;;mike
+pi = 3.14159265
+qext=cext/(pi*rc_mic^2)
+print, 'q ext - wolff - 0.4 mic ', qext
+title=title+' at 0.4 !7l!3m'
+
+;;
+;; visible .4 microns
+;;
+;qext=1.8
+;qext=2.
+
+print, 'final q ext ', qext
+
+
+;
+; CALCUL
+;
+what_I_plot = 3.*qext*mc / (4.*917.*rc)
+what_I_plot[where(FINITE(what_I_plot) eq 0)]=0.
+
+;overcontour=3.*qext*mc / (4.*917.*rc)
+;overcontour[where(FINITE(overcontour) eq 0)]=0.
+
+
+overvector_x=0
+overvector_y=0
+
+endif
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_analysis.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_analysis.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_analysis.pro	(revision 207)
@@ -0,0 +1,90 @@
+pro wind_analysis
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+retrieve='true'
+;retrieve='false'
+file='zefolder/wrfout_d01_2024-03-21_00:00:00'
+start_time=0.
+interv=1.
+landing_site=[353.87-360.,-1.88]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;
+; graphics definition
+;
+PS_Start, filename='wind.ps'
+!P.Charsize = 1.2
+
+;!p.charthick = 2.0
+;!p.thick = 3.0
+;!x.thick = 2.0
+;!y.thick = 2.0
+
+if (retrieve eq 'true') then begin
+
+;
+; load WRF coordinates
+;
+getcdf, file=file, charvar='XLAT', invar=lat
+getcdf, file=file, charvar='XLONG', invar=lon
+getcdf, file=file, charvar='HGT', invar=elevation
+;
+; find simulated lander grid point
+;
+findxy, $
+	x=lon, $
+	y=lat, $
+        point=landing_site, $
+	ind=indp, $
+	flag=2
+;
+; get field
+;
+getcdf, file=file, charvar='U', invar=u
+getcdf, file=file, charvar='V', invar=v
+;;field=sqrt(u^2+v^2) & u=0. & v=0.
+;;what_I_plot=reform(field(indp[0],indp[1],*,*))
+  ;;; BEWARE: arrays not the same size... because staggering... u^2+v^2 is wrong and IDL does not complain...
+field=sqrt( u(indp[0],indp[1],*,*)^2 + v(indp[0],indp[1],*,*)^2 ) & u=0. & v=0.
+what_I_plot=reform(field)
+
+;
+; local time
+;
+localtime = float(start_time) + float(interv)*findgen(n_elements(field(0,0,0,*))) ;+ lon(indp[0],indp[1])/15. 
+;
+; get model height
+;
+getcdf, file=file, charvar='PHTOT', invar=ph
+height=reform(ph(indp[0],indp[1],*,*))
+height=total(height,2)/n_elements(height(0,*))
+height=height/1000./3.72
+heightp=height(0:n_elements(height(*))-2)-elevation(indp[0],indp[1])/1000.
+;
+; save
+;
+save, what_I_plot, localtime, heightp, filename='yeahyeah' 
+
+endif else begin
+
+restore, filename='yeahyeah'	
+	
+endelse	
+
+;yeah=where(localtime lt 0) & if (yeah(0) ne -1) then localtime[yeah]=24+localtime[yeah]
+;;; 24h issue
+;localtime=localtime MOD 24 & yeah=where(localtime eq 0) & if (yeah(0) ne -1) then localtime[yeah]=24
+;localtime=24.+localtime
+
+map_latlon, $
+        transpose(what_I_plot), $      ; 2D field
+        localtime, $                   ; 1D latitude
+        heightp, $                      ; 1D longitude
+	overcontour=0
+;        overcontour=transpose(what_I_plot)     ; another 2D field to overplot with contour lines (=0: no)
+
+PS_End, /PNG
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_esa.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_esa.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_esa.pro	(revision 207)
@@ -0,0 +1,77 @@
+pro wind_esa
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+filename='ok_mesoscale_profile'
+retrieve='true'
+;retrieve='false'
+file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_68.5/jour20/wrfout_d01_2024-03-20_06:00:00'
+start_time=6.
+interv=1.
+landing_site=[353.87-360.,-1.88]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+if (retrieve eq 'true') then begin
+
+;
+; load WRF coordinates
+;
+getcdf, file=file, charvar='XLAT', invar=lat
+getcdf, file=file, charvar='XLONG', invar=lon
+getcdf, file=file, charvar='HGT', invar=elevation
+;
+; find simulated lander grid point
+;
+findxy, $
+	x=lon, $
+	y=lat, $
+        point=landing_site, $
+	ind=indp, $
+	flag=2
+;
+; get field
+;
+getcdf, file=file, charvar='U', invar=u
+getcdf, file=file, charvar='V', invar=v
+  ;;; BEWARE: arrays not the same size... because staggering... u^2+v^2 is wrong and IDL does not complain...
+field=sqrt( u(indp[0],indp[1],*,*)^2 + v(indp[0],indp[1],*,*)^2 ) & u=0. & v=0.
+what_I_plot=reform(field)
+;
+; local time
+;
+localtime = float(start_time) + float(interv)*findgen(n_elements(field(0,0,0,*))) ;+ lon(indp[0],indp[1])/15. 
+;
+; get model height
+;
+getcdf, file=file, charvar='PHTOT', invar=ph
+height=reform(ph(indp[0],indp[1],*,*))
+;height=total(height,2)/n_elements(height(0,*))
+height=height/1000./3.72
+;heightp=height(0:n_elements(height(*))-2)-elevation(indp[0],indp[1])/1000.
+heightp = height - elevation(indp[0],indp[1]) / 1000.
+;
+; save
+;
+save, what_I_plot, localtime, heightp, filename='yeahyeah' 
+
+endif else begin
+
+restore, filename='yeahyeah'	
+	
+endelse	
+
+lctime=[7.,8.,9.,10.,11.]
+for ll=0,n_elements(lctime)-1 do begin
+  w = where(localtime eq lctime(ll))
+  print, localtime[w(0)]
+  tab1 = reform(heightp(*,w(0)))
+  tab2 = reform(what_I_plot(*,w(0)))
+  tab1 = tab1[0:n_elements(tab1)-14]
+  tab2 = tab2[0:n_elements(tab2)-14]
+  make_ascii, filename+'_LT'+string(lctime(ll),'(I0)'), tab1, tab2
+  plot, tab1, tab2
+endfor
+
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_esa_gcm.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_esa_gcm.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_esa_gcm.pro	(revision 207)
@@ -0,0 +1,79 @@
+pro wind_esa_gcm
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+filename='gcm_profile'
+filetruc='/d6/vblmd/MERIDIANI_EXOMARS/etude_GCM/wrfinput_d01_2024-03-20_'
+start_time=7.
+landing_site=[353.87-360.,-1.88]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+for i=1,4 do begin
+
+if (start_time lt 10) then yeye='0' else yeye=''
+file = filetruc + yeye + string(start_time,'(I0)') + ':00:00'
+
+;
+; load WRF coordinates
+;
+getcdf, file=file, charvar='XLAT', invar=lat
+getcdf, file=file, charvar='XLONG', invar=lon
+getcdf, file=file, charvar='HGT', invar=elevation
+;
+; find simulated lander grid point
+;
+findxy, $
+	x=lon, $
+	y=lat, $
+        point=landing_site, $
+	ind=indp, $
+	flag=2
+;
+; get field
+;
+getcdf, file=file, charvar='U', invar=u
+getcdf, file=file, charvar='V', invar=v
+  ;;; BEWARE: arrays not the same size... because staggering... u^2+v^2 is wrong and IDL does not complain...
+  ;;; it is actually possible to do better with staggering... use XLAT_V and XLONG_U
+field=sqrt( u(indp[0],indp[1],*)^2 + v(indp[0],indp[1],*)^2 ) & u=0. & v=0.
+what_I_plot=reform(field)
+;
+; get model height
+;
+getcdf, file=file, charvar='PHTOT', invar=ph
+height=reform(ph(indp[0],indp[1],*))
+height=height/1000./3.72
+heightp = height - elevation(indp[0],indp[1]) / 1000.
+
+        ;getcdf, file=file, charvar='PTOT', invar=p
+        ;getcdf, file=file, charvar='PSFC', invar=psfc
+        ;hh = reform(p(0,0,*,0))
+        ;p0=610. & t0=220. & r_cp=1/4.4 & grav=3.72 & R=192.
+        ;getcdf, file=file, charvar='T', invar=tpot
+        ;tpot = tpot + t0
+        ;t = tpot * ( p / p0 ) ^ r_cp
+       ;hh(0) = - R * t(indp[0],indp[1],0) / grav / 1000. * alog(psfc(indp[0],indp[1]) / p(indp[0],indp[1],0))
+        ;for i=1,n_elements(hh)-1 do hh(i)    = hh(i-1) - R * t(indp[0],indp[1],i) / grav / 1000. * alog(p(indp[0],indp[1],i) / p(indp[0],indp[1],i-1))
+        ;;heightp = hh
+        ;print, heightp-hh  ;; PAREIL ! pb de density global au modele
+
+;
+; ASCII table
+;
+tab1 = heightp
+tab2 = what_I_plot
+tab1 = tab1[0:n_elements(tab1)-14]
+tab2 = tab2[0:n_elements(tab2)-14]
+make_ascii, filename+'_LT'+string(start_time,'(I0)'), tab1, tab2
+plot, tab1, tab2
+;
+;
+;
+start_time = start_time+1
+print, start_time
+
+endfor
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_stress.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_stress.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_stress.idl	(revision 207)
@@ -0,0 +1,45 @@
+
+;
+; field1='U'
+; field2='V'
+; winds=['PSFC','tk']
+;
+
+if ((winds(0) eq 'PSFC') $
+	and (winds(1) eq 'tk') $
+	and (field1 eq 'U') $
+	and (field2 eq 'V')) then begin
+
+
+print, 'computing wind stress'
+
+title='Wind stress (!NN!N.m!U-2!N)'
+
+temp=overvector_y
+press=overvector_x
+gasconst=192.
+rho=press/(gasconst*temp)
+
+vonkar=0.4
+heightlay=5.66  ;; a calculer ??
+roughness=0.01
+cd=vonkar/(alog(heightlay/roughness))
+cd=cd^2
+
+velocity2=what_I_plot^2 + overcontour^2
+
+stress=rho*cd*velocity2
+what_I_plot=stress
+
+;;overcontour=-10.*alog(overvector_x/610.)
+overcontour=overvector_x
+
+overvector_x=0
+overvector_y=0
+
+;;tmpfield=reform(u[*,*,0,*])
+;;press_bg = total(tmpfield,3)/n_elements(tmpfield(0,0,*))
+;;overcontour=press_bg
+
+
+endif
Index: trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_velocity.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_velocity.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/RESERVE/wind_velocity.idl	(revision 207)
@@ -0,0 +1,25 @@
+
+;
+; field1='U'
+; winds=['V','W']
+;
+
+if ( (field1 eq 'U') $
+	and (winds(0) eq 'V') $
+        and (winds(1) eq 'W')  ) then begin
+
+print, 'computing wind velocity'
+
+title='3D wind velocity (!NN!N.m!U-2!N)'
+
+u=what_I_plot
+v=overvector_x
+w=overvector_y
+
+velocity2=u^2+v^2+w^2
+what_I_plot=sqrt(velocity2)
+
+;;overvector_x=0
+;;overvector_y=0
+
+endif
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/getget_gcm.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/getget_gcm.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/getget_gcm.pro	(revision 207)
@@ -0,0 +1,129 @@
+function getget_gcm, name, charvar, count=count, offset=offset, stride=stride, coordmean=coordmean, anomaly=anomaly
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; name: char
+; charvar: char
+; count: 4 elements array   ; The dimensions of the sub-image
+; offset: 4 elements array  ; A variable that contains the offset for the sub-image
+; stride: 4 elements array  ; Create a variable to be used as a value for the STRIDE keyword
+; coordmean: 1 to 4 elements array (dimension 1 is 1)
+; anomaly: a non-null element that would be filled with mean
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;print, charvar
+
+
+nosave = 1  ;; comment to get an IDL data file
+notime = 1  ;; comment to get mention of time taken
+if (n_elements(notime) eq 0) then timetime = SYSTIME(1)
+
+;
+; MINIMAL ARGUMENTS
+;
+if (n_elements(name) eq 0) then stop
+if (n_elements(charvar) eq 0) then stop
+
+;
+; IDL DATA DIRECTORY
+;
+name_idl = charvar+name+'.idl'
+  if (n_elements(coordmean) ne 0) then begin
+    nc = n_elements(coordmean)
+    for i=0,nc-1 do begin
+     name_idl = string(coordmean(i),'(I0)')+name_idl   
+    endfor
+  endif
+name_idl = './idl_dat/'+name_idl
+
+;
+; TEST IF FILE EXISTS
+;
+openr,unit,name_idl,/get_lun,error=err
+
+;
+; IF IDL FILE EXISTS, THAT IS RATHER SIMPLE
+;
+IF (err EQ 0) THEN BEGIN
+
+   print, 'read from file'
+   free_lun,unit
+   restore, filename=name_idl
+
+;
+; IF IDL FILE DOES NOT EXIST, WELL, READ NETCDF
+;
+ENDIF ELSE BEGIN
+
+  ;
+  ; check save directory
+  ;
+  if (n_elements(nosave) eq 0) then SPAWN, 'mkdir -p idl_dat'  
+
+  ;
+  ; open file
+  ;
+  id=ncdf_open(name) 
+
+  ;
+  ; get dimensions
+  ;
+  var = intarr(4)
+  ;NCDF_DIMINQ, id, NCDF_DIMID(id, 'lon'  ), toto, titi & var(0) = titi
+  ;NCDF_DIMINQ, id, NCDF_DIMID(id, 'lat'  ), toto, titi & var(1) = titi 
+  ;NCDF_DIMINQ, id, NCDF_DIMID(id, 'sigma'), toto, titi & var(2) = titi
+  ;NCDF_DIMINQ, id, NCDF_DIMID(id, 'time' ), toto, titi & var(3) = titi 
+  NCDF_DIMINQ, id, NCDF_DIMID(id, 'longitude'  ), toto, titi & var(0) = titi
+  NCDF_DIMINQ, id, NCDF_DIMID(id, 'latitude'  ), toto, titi & var(1) = titi
+  NCDF_DIMINQ, id, NCDF_DIMID(id, 'altitude'), toto, titi & var(2) = titi
+  NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time' ), toto, titi & var(3) = titi
+  ;print, var
+
+  ;
+  ; define default data windows
+  ;
+  if (n_elements(offset) le 3) then offset=[0,0,0,0]
+  if (n_elements(stride) le 3) then stride=[1,1,1,1]
+  if (n_elements(count) le 3) then count=intarr(4)
+  w = where(count eq 0) & if (w(0) ne -1) then count[w] = var[w] / stride[w]
+
+  ;
+  ; read variable
+  ;
+  varid=ncdf_varid(id,charvar) ;& print, 'get '+charvar 
+  if (n_elements(notime) eq 0) then timetime = SYSTIME(1) ;& help, /memory
+  ncdf_varget, id, varid, invar, count=count, offset=offset, stride=stride & if (n_elements(notime) eq 0) then print, SYSTIME(1) - timetime, ' s' ;& help, /memory
+  ncdf_close, id
+
+  ;
+  ; OPTIONAL: ANOMALY (value is returned in the keyword)
+  ; 
+  if (n_elements(anomaly) ne 0) then begin
+    anomaly=TOTAL(TOTAL(invar,1),1)/float(var[0])/float(var[1])
+    for i=0,var[0]-1 do for j=0,var[1]-1 do invar(i,j,*,*) = TEMPORARY(invar(i,j,*,*)) - anomaly  ; coute cher
+  endif
+
+  ;
+  ; OPTIONAL: MEAN 
+  ;
+  if (n_elements(coordmean) ne 0) then begin
+  for i=0,nc-1 do begin
+   print, 'mean over dimension '+string(coordmean(i),'(I0)')+' - '+string(var(coordmean(i)),'(I0)')+' elements'
+   invar=total(TEMPORARY(invar),coordmean(i))/var(coordmean(i))
+  endfor
+  endif
+
+  ;
+  ; SAVE
+  ;
+  if (n_elements(nosave) eq 0) then save, invar, filename=name_idl
+
+ENDELSE
+
+if (n_elements(notime) eq 0) then print, SYSTIME(1) - timetime, ' s'
+
+;
+; RETURN FIELD
+;
+return, invar
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/psurf_param_plot.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/psurf_param_plot.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/psurf_param_plot.idl	(revision 207)
@@ -0,0 +1,88 @@
+;;;;;*************************************** PLOT TITLES
+	subtitle_user	=	''
+	title_axis	=	['East longitude','North latitude']
+	title_user	=	'Surface pressure (Pa)'
+
+;;;;;*************************************** COLOR TABLES
+	flag_cb		=	'true'	
+	format		=	'(I0)'
+	colors		=	64
+	pal		=	16		;; GOOD: 4, 18, 22, 16, 37, 33, 39
+
+;;;;;*************************************** FILL LIMITS
+	minfield_init	=	0.      
+	maxfield_init	=	800. 
+
+;;;;;*************************************** LIMIT TRICKS
+		lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max 
+		lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min 
+;		lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value 
+
+;;;;;*************************************** WINDS
+	windex		=	10.
+	stride		=	2.
+
+;;;;;*************************************** CONTOUR
+	lev		=	130. + 10.*findgen(20) 
+
+;;;;;*************************************** AXIS
+	isotropic	=	'true' 
+	intervalx	=	5.
+	intervaly	=	5.
+
+;;;;;*************************************** MAP LIMITS
+	windowx		=	[-145.,-125.]
+	windowy		=	[5.,30.]
+
+
+
+
+;;;;;*************************************** 
+;;;;;*************************************** 
+;;;;;*************************************** 
+;;;;;*************************************** 
+
+
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.		;; grepSEC
+;maxalt=40.		;; grepSEC
+;minspace=0.0  		;; grepSEC
+;maxspace=35.0 		;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/psurf_plotplot.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/psurf_plotplot.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/psurf_plotplot.pro	(revision 207)
@@ -0,0 +1,60 @@
+pro plotplot
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+file='hi_res_run_swordfish/3830.002/m4/diagfi.nc'
+set_name='psurf'
+it=0
+iz=1
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+SPAWN, 'cp psurf_param_plot.idl param_plot.idl'
+
+	;
+	; graphics definition
+	;
+	if (n_elements(saveps) eq 0) then saveps='true'
+	if (saveps eq 'false') then begin 
+	   ;!p.multi=[0,3,2] 
+	   !P.CHARSIZE=2.
+	   WINDOW, /PIXMAP & WDELETE & DEVICE,BYPASS_TRANSLATION=0,DECOMPOSED=0,RETAIN=2
+	endif else begin
+	   PREF_SET, 'IDL_PATH', '/padata/beta/users/aspiga/Save/SOURCES/IDL/fsc_psconfig:<IDL_DEFAULT>', /COMMIT
+	endelse
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+getcdf, file=file, charvar='ps', invar=ps
+getcdf, file=file, charvar='u'    , invar=u
+getcdf, file=file, charvar='v'    , invar=v
+getcdf, file=file, charvar='lon'  , invar=lon
+getcdf, file=file, charvar='lat'  , invar=lat
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+what_I_plot = reform(ps(*,*,it))
+ox          = reform(u(*,*,iz,it))
+oy          = reform(v(*,*,iz,it))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+	if (saveps eq 'true') then PS_Start, FILENAME=set_name+'.ps'
+	!P.Charsize = 1.2
+map_latlon, what_I_plot, lon, lat, overvector_x=ox, overvector_y=oy
+	if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd='cp plotplot.pro '+set_name+'_plotplot.pro ; cp param_plot.idl '+set_name+'_param_plot.idl'
+SPAWN, cmd
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/tsurf_param_plot.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/tsurf_param_plot.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/tsurf_param_plot.idl	(revision 207)
@@ -0,0 +1,91 @@
+;;;;;*************************************** PLOT TITLES
+	subtitle_user	=	''
+	subtitle_user	=	'' ;'LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 42km [hires GCM]  /  Regular TI'
+	title_axis	=	['East longitude','North latitude']
+	title_user	=	'Wind velocity (m/s) and wind vectors' ;'Surface temperature (K)'
+
+;;;;;*************************************** COLOR TABLES
+	flag_cb		=	'true'	
+	format		=	'(F4.1)' ;'(I0)'
+	colors		=	64
+	pal		=	22		;; GOOD: 4, 18, 22, 16, 37, 33, 39
+
+;;;;;*************************************** FILL LIMITS
+	minfield_init	=	0.     
+	maxfield_init	=	25.  
+        ;minfield_init   =       155.
+        ;maxfield_init   =       175.
+
+;;;;;*************************************** LIMIT TRICKS
+		lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max 
+		lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min 
+;		lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value 
+
+;;;;;*************************************** WINDS
+	windex		=	25.
+	stride		=	1. ;2.
+
+;;;;;*************************************** CONTOUR
+	lev 		= 	50. + 50.*findgen(20)
+
+;;;;;*************************************** AXIS
+	isotropic	=	'true' 
+	intervalx	=	2.
+	intervaly	=	2.
+
+;;;;;*************************************** MAP LIMITS
+	windowx		=	[-144.,-126.] ;[-146.,-126.]
+	windowy		=	[10.,26.] ;[10.,28.]
+
+
+
+
+;;;;;*************************************** 
+;;;;;*************************************** 
+;;;;;*************************************** 
+;;;;;*************************************** 
+
+
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.		;; grepSEC
+;maxalt=40.		;; grepSEC
+;minspace=0.0  		;; grepSEC
+;maxspace=35.0 		;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/tsurf_plotplot.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/tsurf_plotplot.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/tsurf_plotplot.pro	(revision 207)
@@ -0,0 +1,73 @@
+pro tsurf_plotplot
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+file='./diagfi.nc'
+set_name='tsurf'
+it=17
+iz=1
+;iz=0
+iz=3
+;it=4
+it=18 ;; GCM
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+SPAWN, 'cp -f tsurf_param_plot.idl param_plot.idl'
+
+	;
+	; graphics definition
+	;
+	if (n_elements(saveps) eq 0) then saveps='true'
+	if (saveps eq 'false') then begin 
+	   ;!p.multi=[0,3,2] 
+	   !P.CHARSIZE=2.
+	   WINDOW, /PIXMAP & WDELETE & DEVICE,BYPASS_TRANSLATION=0,DECOMPOSED=0,RETAIN=2
+	endif ;else begin
+	   ;PREF_SET, 'IDL_PATH', '/padata/beta/users/aspiga/Save/SOURCES/IDL/fsc_psconfig:<IDL_DEFAULT>', /COMMIT
+	;endelse
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+getcdf, file=file, charvar='tsurf', invar=tsurf
+getcdf, file=file, charvar='ps', invar=ps
+ox = getget_gcm(file, 'u', count=[0,0,1,1], offset=[0,0,iz,it])
+oy = getget_gcm(file, 'v', count=[0,0,1,1], offset=[0,0,iz,it])
+;getcdf, file=file, charvar='u'    , invar=u
+;getcdf, file=file, charvar='v'    , invar=v
+;getcdf, file=file, charvar='lon'  , invar=lon
+;getcdf, file=file, charvar='lat'  , invar=lat
+getcdf, file=file, charvar='longitude'  , invar=lon
+getcdf, file=file, charvar='latitude'  , invar=lat
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;what_I_plot = reform(tsurf(*,*,it))
+oc = reform(ps(*,*,it))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+what_I_plot = sqrt(ox^2 + oy^2)
+;what_I_plot = sqrt(oy^2)
+print, min(what_I_plot)
+print, mean(what_I_plot)
+print, max(what_I_plot)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+	if (saveps eq 'true') then PS_Start, FILENAME=set_name+'.ps'
+	!P.Charsize = 1.2
+map_latlon, what_I_plot, lon, lat, overcontour=oc, overvector_x=ox, overvector_y=oy
+	if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;cmd='cp plotplot.pro '+set_name+'_plotplot.pro ; cp param_plot.idl '+set_name+'_param_plot.idl'
+;SPAWN, cmd
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/tsurf_plotplot.pro.ou
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/tsurf_plotplot.pro.ou	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/tsurf_plotplot.pro.ou	(revision 207)
@@ -0,0 +1,68 @@
+pro tsurf_plotplot
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+file='./diagfi.nc'
+set_name='tsurf'
+it=17
+iz=1
+it=4
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+SPAWN, 'cp tsurf_param_plot.idl param_plot.idl'
+
+	;
+	; graphics definition
+	;
+	if (n_elements(saveps) eq 0) then saveps='true'
+	if (saveps eq 'false') then begin 
+	   ;!p.multi=[0,3,2] 
+	   !P.CHARSIZE=2.
+	   WINDOW, /PIXMAP & WDELETE & DEVICE,BYPASS_TRANSLATION=0,DECOMPOSED=0,RETAIN=2
+	endif else begin
+	   PREF_SET, 'IDL_PATH', '/padata/beta/users/aspiga/Save/SOURCES/IDL/fsc_psconfig:<IDL_DEFAULT>', /COMMIT
+	endelse
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+getcdf, file=file, charvar='tsurf', invar=tsurf
+getcdf, file=file, charvar='ps', invar=ps
+ox = getget(file, 'u', count=[0,0,1,1], offset=[0,0,iz,it])
+oy = getget(file, 'v', count=[0,0,1,1], offset=[0,0,iz,it])
+;getcdf, file=file, charvar='u'    , invar=u
+;getcdf, file=file, charvar='v'    , invar=v
+getcdf, file=file, charvar='lon'  , invar=lon
+getcdf, file=file, charvar='lat'  , invar=lat
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+what_I_plot = reform(tsurf(*,*,it))
+oc = reform(ps(*,*,it))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+what_I_plot = sqrt(ox^2 + oy^2)
+;what_I_plot = sqrt(oy^2)
+print, min(what_I_plot)
+print, mean(what_I_plot)
+print, max(what_I_plot)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+	if (saveps eq 'true') then PS_Start, FILENAME=set_name+'.ps'
+	!P.Charsize = 1.2
+map_latlon, what_I_plot, lon, lat, overcontour=oc, overvector_x=ox, overvector_y=oy
+	if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;cmd='cp plotplot.pro '+set_name+'_plotplot.pro ; cp param_plot.idl '+set_name+'_param_plot.idl'
+;SPAWN, cmd
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/velocity_param_plot.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/velocity_param_plot.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/velocity_param_plot.idl	(revision 207)
@@ -0,0 +1,88 @@
+;;;;;*************************************** PLOT TITLES
+	subtitle_user	=	''
+	title_axis	=	['East longitude','North latitude']
+	title_user	=	'Horizontal velocity (!Nm.s!U-1!N)'
+
+;;;;;*************************************** COLOR TABLES
+	flag_cb		=	'true'	
+	format		=	'(I0)'
+	colors		=	64
+	pal		=	22		;; GOOD: 4, 18, 22, 16, 37, 33, 39
+
+;;;;;*************************************** FILL LIMITS
+	minfield_init	=	0.      
+	maxfield_init	=	20. 
+
+;;;;;*************************************** LIMIT TRICKS
+		lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max 
+		lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min 
+;		lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value 
+
+;;;;;*************************************** WINDS
+	windex		=	10.
+	stride		=	2.
+
+;;;;;*************************************** CONTOUR
+	lev		=	130. + 10.*findgen(20) 
+
+;;;;;*************************************** AXIS
+	isotropic	=	'true' 
+	intervalx	=	5.
+	intervaly	=	5.
+
+;;;;;*************************************** MAP LIMITS
+	windowx		=	[-145.,-125.]
+	windowy		=	[5.,30.]
+
+
+
+
+;;;;;*************************************** 
+;;;;;*************************************** 
+;;;;;*************************************** 
+;;;;;*************************************** 
+
+
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.		;; grepSEC
+;maxalt=40.		;; grepSEC
+;minspace=0.0  		;; grepSEC
+;maxspace=35.0 		;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/velocity_plotplot.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/velocity_plotplot.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/GCM/velocity_plotplot.pro	(revision 207)
@@ -0,0 +1,57 @@
+pro plotplot
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+file='hi_res_run_swordfish/3830.002/m4/diagfi.nc'
+set_name='velocity'
+it=0
+iz=1
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+	;
+	; graphics definition
+	;
+	if (n_elements(saveps) eq 0) then saveps='true'
+	if (saveps eq 'false') then begin 
+	   ;!p.multi=[0,3,2] 
+	   !P.CHARSIZE=2.
+	   WINDOW, /PIXMAP & WDELETE & DEVICE,BYPASS_TRANSLATION=0,DECOMPOSED=0,RETAIN=2
+	endif else begin
+	   PREF_SET, 'IDL_PATH', '/padata/beta/users/aspiga/Save/SOURCES/IDL/fsc_psconfig:<IDL_DEFAULT>', /COMMIT
+	endelse
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+getcdf, file=file, charvar='u'    , invar=u
+getcdf, file=file, charvar='v'    , invar=v
+getcdf, file=file, charvar='lon'  , invar=lon
+getcdf, file=file, charvar='lat'  , invar=lat
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+what_I_plot = sqrt(reform(u(*,*,iz,it))^2 + reform(v(*,*,iz,it))^2)
+ox          = reform(u(*,*,iz,it))
+oy          = reform(v(*,*,iz,it))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+	if (saveps eq 'true') then PS_Start, FILENAME=set_name+'.ps'
+	!P.Charsize = 1.2
+map_latlon, what_I_plot, lon, lat, overvector_x=ox, overvector_y=oy
+	if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd='cp plotplot.pro '+set_name+'_plotplot.pro ; cp param_plot.idl '+set_name+'_param_plot.idl'
+SPAWN, cmd
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwave.pro.obsolete
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwave.pro.obsolete	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwave.pro.obsolete	(revision 207)
@@ -0,0 +1,129 @@
+pro gravitwave
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+file='../EN_COURS/gw/ok_hires_wrfout_d01_9999-09-09_09:00:00_z'
+file='../EN_COURS/gw/_wrfout_d01_9999-09-09_09:00:00_z'
+file='../OUTILS_CONVERSION/wrfout_d01_9999-09-09_09:00:00_z'
+charvar='W' & charvarc='W'
+charvar='tk' & charvarc='W'
+charvar='tk' & charvarc='W' & cond=1
+;charvar='tpot' & charvarc='tpot'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;
+;
+what_I_plot=0. & overcontour=0.
+SPAWN, '\rm param_plot.idl ; cp gravitwave_inc.pro param_plot.idl'
+;
+;
+;
+getcdf, $
+        file=file, $
+        charvar=charvar, $
+        invar=invar
+getcdf, $
+        file=file, $
+        charvar=charvarc, $
+        invar=invarc
+getcdf, $
+        file=file, $
+        charvar='vert', $
+        invar=vert
+getcdf, $
+        file=file, $
+        charvar='PTOT', $
+        invar=columnp
+;
+;
+;
+for nt=1,10 do begin
+zefile='gravitwave_'+charvar+'_'+charvarc+'_'+string(nt+100,'(I0)')
+if (n_elements(cond) ne 0) then zefile = 'cond_' + zefile
+;
+;
+;
+  PS_Start, filename=zefile+'.ps'
+  print, zefile+'.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+;
+;
+;
+what_I_plot = reform(invar(*,1,*,nt))
+
+
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   file='../LMD_MM_MARS/TESTGW/input_sounding' & header='' & nlines_header=1 & ncol = 5
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   nlines = FILE_LINES(file)-nlines_header & data=FLTARR(ncol,nlines)
+   OPENR, lun, file, /GET_LUN & READF, lun, header & READF, lun, data & CLOSE, lun & FREE_LUN, lun
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   mcd_tpot        = reform(data(1,*))
+   mcd_column      = reform(data(0,*)) ;& mcd_column = ( mcd_column - mcd_column(0) ) / 1000.
+
+   overplot = reform(what_I_plot(30,*))
+   overplot_column = vert/1000.
+   what_I_plot = mcd_tpot
+   column = mcd_column/1000.
+   mention = ''
+;   minfield_init = 0.0001
+;   maxfield_init = 2000.
+   minfield_init = 100.
+   maxfield_init = 240.
+   alt = [0.,100.]
+   SPAWN, '\rm param_plot.idl'
+   profile, $
+        what_I_plot, $                          ; 1D vertical profile
+        column, $                               ; altitudes     
+        alt=alt, $                              ; altitude range [altmin, altmax]
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        inprofile=overplot, $                   ; another vertical profile to overplot
+        incolumn=overplot_column, $             ; altitudes of the other vertical profile (in case /= column)
+;        discrete=discrete, $                    ; show the profile points (= type of points in !psym)
+;        title_plot=title_user, $                ; title of the plot ('Profile' is default)
+;        title_axis=title_axis, $                ; title of the [x,y] axis (['Field','Altitude'] is default)
+        mention=mention                         ; add text precision within the plot window (default is nothing or '')
+
+PS_End, /PNG
+endfor
+end
+
+
+   if (charvar eq 'tk') then what_I_plot = what_I_plot - 20.  ;; -20. because seasonal variability
+   if (n_elements(cond) ne 0) then begin
+     column = columnp
+     @tempcond.inc
+     yeye = reform(overplot(*,1,*,nt))
+     w = where(yeye le 0.) & yeye[w] = 0. 
+     what_I_plot = what_I_plot - yeye 
+   endif
+overcontour = reform(invarc(*,1,*,nt))
+xx = findgen(n_elements(what_I_plot(*,0)))
+zz = vert / 1000.
+;
+;
+;
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        xx, $                                   ; 1D latitude
+        zz, $                                   ; 1D longitude
+;        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+;        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+;        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+;        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+;        ct=pal, $                               ; color table (33-rainbow is default)
+;        colors=colors, $                        ; number of colors/levels (32 is default)
+;        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+;
+;
+;
+PS_End, /PNG
+endfor
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwave2.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwave2.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwave2.pro	(revision 207)
@@ -0,0 +1,133 @@
+pro gravitwave2
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+	;;;; KEEP REFERENCES of FIRST PLOTS 
+	;file='../EN_COURS/gw/ok_hires_wrfout_d01_9999-09-09_09:00:00_z'
+	;file='../EN_COURS/gw/_wrfout_d01_9999-09-09_09:00:00_z'
+	;file='../LMD_MM_MARS/TESTGW/_wrfout_d01_9999-09-09_09:00:00_z'
+	;;file='../LMD_MM_MARS/TESTGW/wind15_wrfout_d01_9999-09-09_09:00:00_z'
+	;file='../TESTGW/wind20c_wrfout_d01_9999-09-09_09:00:00_z'
+folder='/d5/aslmd/GRAVITWAVE/GW_MARS_highwind_3D.157077/'
+folder='/d5/aslmd/GRAVITWAVE/GW_MARS_highwind_narrowmountain_2D.156878/'
+;folder='/d5/aslmd/GRAVITWAVE/GW_MARS_highwind_narrowmountain_3D.157025/'
+folder='/d5/aslmd/GRAVITWAVE/GW_MARS_highwind_narrowmountain_2D.morepoints.160818/'
+folder='/d5/aslmd/GRAVITWAVE/GW_MARS_highwind_3D_loweropacity_morepoints_LT15.161544/'
+folder='/home/aslmd/GRAVITWAVE/GW_MARS_highwind_3D_loweropacity_morepoints.161542/'
+;folder='/home/aslmd/GRAVITWAVE/GW_MARS_highwind_3D_loweropacity_morepoints_LTcst.168440/'
+;folder='/home/aslmd/GRAVITWAVE/GW_MARS_highwind_3D_loweropacity_morepoints_widehill.168468/'
+file=folder+'wrfout_d01_9999-09-09_09:00:00_z'
+charvar='W' & charvarc='W'
+charvar='W' & charvarc='tk' & cond=0
+;charvar='tk' & charvarc='W'
+;charvar='tk' & charvarc='W' & cond=1
+;charvar='tk' & charvarc='tk' & cond=1
+;charvar='tk' & charvarc='tk' & cond=0
+;;charvar='tpot' & charvarc='tpot'
+charvar='HR_NLTE' & charvarc='tk' & cond=0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+	;folder='/home/aslmd/GRAVITWAVE/'
+	;file=folder+'GW_MARS_highwind_3D_loweropacity_morepoints_diff.nc'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;
+;
+what_I_plot=0. & overcontour=0.
+SPAWN, '\rm param_plot.idl ; cp gravitwave_inc.pro param_plot.idl'
+;
+;
+;
+getcdf, $
+        file=file, $
+        charvar=charvar, $
+        invar=invar
+getcdf, $
+        file=file, $
+        charvar=charvarc, $
+        invar=invarc
+;getcdf, $
+;        file=file, $
+;        charvar='vert', $
+;        invar=vert
+getcdf, $
+         file='/home/aslmd/GRAVITWAVE/GW_MARS_highwind_3D.157077/wrfout_d01_9999-09-09_09:00:00_z', $
+         charvar='vert', $
+         invar=vert
+getcdf, $
+        file=file, $
+        charvar='PTOT', $
+        invar=columnp
+;
+;
+;
+;for nt=4,10 do begin
+;for nt=27,27 do begin
+for nt=1,40 do begin
+;for nt=9,9 do begin
+;for nt=0,20 do begin
+zefile='gravitwave_'+charvar+'_'+charvarc+'_'+string(nt+100,'(I0)')
+if (n_elements(cond) ne 0) then if (cond ne 0) then zefile = 'cond_' + zefile
+;
+;
+;
+  PS_Start, filename=zefile+'.ps' & print, zefile+'.ps'
+;
+;
+;
+s = size(invar) & middle = floor(s[2]/2) & print, 'PLOT at y subs ', middle
+what_I_plot = reform(invar(*,middle,*,nt)) & print, min(what_I_plot), max(what_I_plot)
+overcontour = reform(invarc(*,middle,*,nt))
+   if (n_elements(cond) ne 0) then begin
+   if (cond ne 0) then begin
+     column = columnp
+     ;column = reform(columnp(*,1,*,1))
+     @tempcond.inc
+     yeye = reform(overplot(*,middle,*,nt))
+     w = where(yeye le 0.) & yeye[w] = 0. 
+     if (charvar eq 'tk') then what_I_plot = what_I_plot - yeye 
+     if (charvarc eq 'tk') then overcontour = overcontour - yeye 
+   endif
+   endif
+xx = findgen(n_elements(what_I_plot(*,0)))
+zz = vert / 1000.
+;
+	;;w = where(what_I_plot lt 2.)
+	;;w = where(what_I_plot lt 0.)
+	;w = where(what_I_plot lt -1.)
+	;;w = where(what_I_plot lt -3.)
+	;if (w(0) ne -1) then begin
+	;for i=0,n_elements(w)-1 do begin
+	; ind = ARRAY_INDICES(what_I_plot, w(i))
+	; print, 'x '+string(ind(0),'(I0)')+' z '+string(zz(ind(1)),'(I0)')+' t '+string(nt*925./3700.,'(F4.1)'), what_I_plot(ind[0],ind[1])
+	;endfor
+	;endif
+;
+;
+;
+if (charvar eq 'HR_NLTE') then begin
+	what_I_plot = what_I_plot * 3700. ;; en K/hour
+	;w = where((zz le 60.) and (zz ge 50.)) ;; pour enlever la ligne d'altitude ou le NLTE est active
+        ;if (w(0) ne -1) then what_I_plot(*,w) = 0.
+endif
+;
+;
+;
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        xx, $                                   ; 1D latitude
+        zz, $                                   ; 1D longitude
+;        minfield_init, $               ; minimum value of plotted field (=0: calculate)
+;        maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+;        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+;        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+;        ct=pal, $                               ; color table (33-rainbow is default)
+;        colors=colors, $                        ; number of colors/levels (32 is default)
+;        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+;
+;
+;
+PS_End, /PNG
+SPAWN, 'mv '+zefile+'.png '+folder+' ; \rm '+zefile+'.*ps*'
+endfor
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwave_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwave_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwave_inc.pro	(revision 207)
@@ -0,0 +1,69 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;; W 
+colors        = 64
+minfield_init = -10.
+maxfield_init = 10. 
+ndiv	      = 10
+format        = '(I0)'
+pal           = 17 ;4 ;16 ;18 ;4
+title_user    = 'Vertical velocity (m s!U-1!N)'
+lev=80.+10.*findgen(30)
+;;;;;;;; tk
+;minfield_init = 110.
+;maxfield_init = 230.
+;ndiv	      = 12
+;format        = '(I0)'
+;pal	      = 33
+;title_user    = 'Temperature (K)'
+;lev = [-10.,-8.,-6.,-4.,-2.,2.,4.,6.,8.,10.]
+;lev=80.+10.*findgen(30)
+;;;;;;;; tk - tsat
+;minfield_init =  -4. ;-8.
+;maxfield_init =  4. ;+8.
+;ndiv	      =  8	
+;format        = '(F4.1)'
+;pal           =  0
+;title_user    = 'T!Datm!N - T!Dsat!N (K)'
+;lev = [-6.,-5.,-4.,-3.,-2.,-1.,0.]
+;;;;;;;;; hr_nlte
+;	minfield_init =  -6.
+;	maxfield_init =  6.
+;	ndiv          =  6
+;	format        = '(F4.1)'
+;	pal           =  33 
+;	title_user    = 'NLTE heating rate (K / hour)'
+lev=[-20.,-18.,-16.,-14.,-12.,-10.,-8.,-6.,-4.,-2.,2.,4.,6.,8.,10.,12.,14.,16.,18.,20.]
+title_user    = 'NLTE cooling rate (K hour!U-1!N)'
+w=where(abs(what_I_plot) le 1e5) & if (w[0] ne -1) then what_I_plot[w] = - what_I_plot[w]
+minfield_init = 0.
+maxfield_init = 20.
+ndiv          = 10
+pal	      = 1 ;4 ;22
+lev=80.+10.*findgen(30)
+format	      = '(I0)'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+flag_cb = 'true'
+windowx = [5.,55.]
+windowy = [0.,100.]
+windowy = [75.,85.]
+windowx = [5., 35.] 
+intervalx = 5.
+intervaly = 5.
+windowy = [0.,130.]
+windowx = [10., 110.] 
+;windowy = [50.,130.]
+intervalx = 10.
+intervaly = 10.
+title_axis = ['horizontal coordinate (x5km)','altitude (km)']
+poscb=0.55
+;isotropic='false'
+;lev = 10.*findgen(100)
+;lev = [-6.,-4.,-2.,2.,4.,6.]
+;;lev = [-8.,-5.,-1.,1.,5.,8.]
+;;lev = [-6.,-5.,-4.,-3.,-2.,-1.,0.]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwaveprof.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwaveprof.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwaveprof.pro	(revision 207)
@@ -0,0 +1,273 @@
+pro gravitwaveprof
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;
+; faire avant api avec kappa 3.9
+;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+	path='../TESTGW/'
+	path='/tmp7/aslmd/'
+path='/home/aslmd/GRAVITWAVE/'
+	experiment='mcd_lt16_rcpcst'
+	;experiment='mcd_lt16'
+	;experiment='short_mcd_lt16_rcpcst'
+	;experiment='short_mcd_lt16'
+	;experiment='short_mcd_lt16_calcprho'
+	;experiment='mcd_lt16_calcprho'
+	;experiment='short_mcd_lt16_calcprho_tot'
+	;experiment='colder_gcm_add_short'
+	;experiment='colder_gcm_add'
+	experiment=''
+	;experiment='wind15'
+	;experiment='wind20c'
+	;experiment='colder_gcm_add_3.9_fine_rad_mountain'
+	experiment='test'
+experiment='GW_MARS_highwind_3D.157077'
+experiment='GW_MARS_highwind_3D_lower_opacity.161436'
+experiment='GW_MARS_highwind_3D_loweropacity_lotspoints.161468'
+experiment='GW_MARS_highwind_3D_loweropacity_morepoints.161542'
+;experiment='GW_MARS_highwind_3D_loweropacity_morepoints_LT15.161544'
+;experiment='GW_MARS_highwind_3D_loweropacity_morepoints_LTcst.168440'
+;experiment='GW_MARS_highwind_3D_loweropacity_morepoints_widehill.168468'
+	file=path+experiment+'_wrfout_d01_9999-09-09_09:00:00_z'
+file=path+experiment+'/wrfout_d01_9999-09-09_09:00:00_z'
+;file=path+experiment+'/wrfout_d01_9999-09-09_10:00:00_z'
+;file=path+experiment+'/wrfout_d01_9999-09-09_11:00:00_z'
+charvar='W' & charvarc='W'
+charvar='tk' & charvarc='W'
+charvar='tk' & charvarc='W' & cond=1
+charvar='tpot' & charvarc='tpot'
+;charvar='PTOT' & charvarc='PTOT'
+charvar='tk' & charvarc='tk'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+nts=1  & nte=15   & nxs=0   & nxe=59
+nts=3  & nte=nts  & nxs=999 & nxe=999 ;; moyenne ;; attention a la montagne !!!
+nts=4  & nte=nts  & nxs=31  & nxe=nxs ;; AU CENTRE ! sinon choisir le point en traçant de 0a 59
+nts=1  & nte=nts  & nxs=0   & nxe=59
+nts=4  & nte=nts  & nxs=0   & nxe=59
+nts=1  & nte=15   & nxs=31  & nxe=31
+nts=1  & nte=15   & nxs=45  & nxe=45
+nts=9  & nte=9    & nxs=0   & nxe=59
+nts=1  & nte=13   & nxs=59  & nxe=59
+nts=8  & nte=8    & nxs=0   & nxe=121
+nts=1  & nte=9    & nxs=59  & nxe=59
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+nts=1  & nte=10  & nxs=50   & nxe=50
+;nts=1  & nte=1  & nxs=6   & nxe=6
+nts=1  & nte=100  & nxs=50   & nxe=50
+nts=1  & nte=100  & nxs=60   & nxe=60
+nts=1  & nte=100  & nxs=20   & nxe=20
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;
+;
+what_I_plot=0. & overcontour=0.
+;SPAWN, '\rm param_plot.idl ; cp gravitwave_inc2.pro param_plot.idl'
+;
+;
+;
+getcdf, $
+        file=file, $
+        charvar=charvar, $
+        invar=invar
+;getcdf, $
+;        file=file, $
+;        charvar=charvarc, $
+;        invar=invarc
+getcdf, $
+        file=file, $
+        charvar='vert', $
+        invar=vert
+getcdf, $
+        file=file, $
+        charvar='PTOT', $
+        invar=columnp
+;;
+;; 
+;;
+	s = size(invar) & middle = floor(s[2]/2) & print, 'PLOT at y subs ', middle
+        nte = min(s[4]-1,nte) & print, 'nte ', nte
+        mean_invar = TOTAL(invar(*,*,*,nts:nte),4) / float(nte-nts+1)
+	;mean_columnp = TOTAL(columnp(*,*,*,nts:nte),4) / float(nte-nts+1)
+        anomal_invar = invar & for i=0,s[4]-1 do anomal_invar(*,*,*,i) = anomal_invar(*,*,*,i) - mean_invar
+;;
+;;
+;;
+;	goto, perturb
+for nt=nts,nte do begin
+for nx=nxs,nxe do begin
+;
+zefile=experiment+'_'+charvar+'_'+string(nt+100,'(I0)')+'_'+string(nx+100,'(I0)')
+;
+;
+;
+  PS_Start, filename=zefile+'.ps'
+  print, zefile+'.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+;
+;
+;
+;;what_I_plot = reform(invar(*,1,*,nt))
+;what_I_plot = reform(invar(*,59,*,nt))
+what_I_plot = reform(invar(*,middle,*,nt))
+
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   file=path+experiment+'/input_sounding' & header='' & nlines_header=1 & ncol = 5
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   nlines = FILE_LINES(file)-nlines_header & data=FLTARR(ncol,nlines)
+   OPENR, lun, file, /GET_LUN & READF, lun, header & READF, lun, data & CLOSE, lun & FREE_LUN, lun
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   mcd_column      = reform(data(0,*)) 
+   calc_tpot       = reform(data(1,*))
+
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   file=path+experiment+'/input_therm' & ncol = 5
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   nlines = FILE_LINES(file) & data=FLTARR(ncol,nlines)
+   OPENR, lun, file, /GET_LUN & READF, lun, data & CLOSE, lun & FREE_LUN, lun
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   pressure        = reform(data(2,*))
+   mcd_tpot        = reform(data(4,*))   
+
+   if (nx lt 999) then begin
+     what_I_plot = reform(what_I_plot(nx,*))
+   endif else begin
+     what_I_plot = TOTAL(what_I_plot,1) / n_elements(reform(what_I_plot(*,0)))
+   endelse
+
+     ;;;;;;;;;;;
+     ;;;;;;;;;;;
+     ;;;;;;;;;;;
+     column = vert/1000.
+     overplot_column = mcd_column/1000.
+     alt = [20.,150.]
+     alt = [40.,100.]
+     alt = [40.,80.]
+     alt = [0.,120.]
+     ;;;;;;;;;;;
+     ;;;;;;;;;;;
+     ;mention = ''
+     SPAWN, '\rm param_plot.idl'
+     minfield_init = 85.  ;100.
+     maxfield_init = 185. ;250.
+     title_axis = ['Temperature (K)','Altitude (km)']
+     overplot = mcd_tpot
+     ;;;;;;;;;;;
+     SPAWN, "echo 'intervaly=10.' >> param_plot.idl"
+     SPAWN, "echo 'intervalx=5.' >> param_plot.idl"
+     ;;;;;;;;;;;
+
+	;overplot = reform(mean_invar(nx,middle,*))
+	;overplot_column = column
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;; PLOT PRESSION mettre profile en log
+;column = reform(columnp(nx,middle,*,nt))
+;overplot_column = pressure
+;	;;overplot = mean_invar
+;	;;overplot_column = mean_columnp
+;alt = [1.e2,1.e-3]
+;title_axis = ['Temperature (K)','Pressure (Pa)']
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PLOT PRESSION
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; calculer la CAPE ? Tsat - Tenv / Tenv
+
+
+			;what_I_plot = pressure
+			;	what_I_plot = calc_tpot
+			;overplot = alog(overplot) / alog(10.)
+			;overplot = overplot[where(overplot lt 35.)] ;; evite les valeurs impossibles
+			;what_I_plot = alog(what_I_plot) / alog(10.)
+			;minfield_init = -5.
+			;maxfield_init = 3.
+			;	;;tpot
+			;	minfield_init = 2.
+			;	maxfield_init = 4.
+			;what_I_plot = 100. * abs(calc_tpot - overplot) / overplot
+			;minfield_init = 0.000001
+			;maxfield_init = 100.
+
+   profile, $
+        what_I_plot, $                          ; 1D vertical profile
+        column, $                               ; altitudes     
+        alt=alt, $                              ; altitude range [altmin, altmax]
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        inprofile=overplot, $                   ; another vertical profile to overplot
+        incolumn=overplot_column, $             ; altitudes of the other vertical profile (in case /= column)
+;        discrete=discrete, $                    ; show the profile points (= type of points in !psym)
+;        title_plot=title_user, $                ; title of the plot ('Profile' is default)
+        title_axis=title_axis, $                ; title of the [x,y] axis (['Field','Altitude'] is default)
+        mention=mention                         ; add text precision within the plot window (default is nothing or '')
+
+	;;; sponge layer
+	;w=where(FINITE(overplot) ne 0)
+	;oplot, [minfield_init,maxfield_init], [max(overplot_column[w])-50.,max(overplot_column[w])-50.], linestyle=1
+
+	;column = columnp
+	;@tempcond.inc
+	;yeye = reform(overplot(nx,1,*,nt)) 
+	;;w = where(yeye le 0.) & yeye[w] = !VALUES.F_NAN
+	;;oplot, yeye, vert/1000., linestyle=1
+
+@tempcond.inc
+overplot = reform(overplot(nx,middle,*,nt))
+oplot, overplot, overplot_column, linestyle=1
+
+	;calc_tk = calc_tpot * (pressure/610.)^(1/4.4)
+	;oplot, calc_tk, column, linestyle=3
+
+PS_End, /PNG
+endfor
+endfor
+
+perturb:
+PS_Start, filename=experiment+'_'+charvar+'_perturb_'+string(nxs+100,'(I0)')+'.ps'
+
+     what_I_plot_loop = reform(anomal_invar(nxs,middle,*,*))
+
+     what_I_plot = reform(what_I_plot_loop(*,nts))
+     column = vert/1000.
+     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+     alt = [0.,120.]
+     minfield_init = -30. 
+     maxfield_init = 30. 
+     title_axis = ['Temperature anomaly (K)','Altitude (km)']
+		;; peut pas changer	
+		;SPAWN, "echo 'intervaly=10.' >> param_plot.idl"
+     		;SPAWN, "echo 'intervalx=5.' >> param_plot.idl"
+     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+     profile, $
+        what_I_plot, $                          ; 1D vertical profile
+        column, $                               ; altitudes     
+        alt=alt, $                              ; altitude range [altmin, altmax]
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        inprofile=overplot, $                   ; another vertical profile to overplot
+        incolumn=overplot_column, $             ; altitudes of the other vertical profile (in case /= column)
+;        discrete=discrete, $                    ; show the profile points (= type of points in !psym)
+;        title_plot=title_user, $                ; title of the plot ('Profile' is default)
+        title_axis=title_axis, $                ; title of the [x,y] axis (['Field','Altitude'] is default)
+        mention=mention                         ; add text precision within the plot window (default is nothing or '')
+
+     for iii=nts+1, nte do begin
+        overplot = reform(what_I_plot_loop(*,iii))
+        overplot_column = column
+        oplot, overplot, overplot_column
+     endfor
+
+	;temppp = reform(mean_invar(nxs,middle,*))
+	;hache = 191.*temppp/3.72/1000.
+	;ok = column / ( 2. * hache )
+	;print, exp(ok)
+	;yeah = exp(ok)
+	;oplot, yeah, column
+
+PS_End, /PNG
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwaveprof.pro.bak
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwaveprof.pro.bak	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/GW/gravitwaveprof.pro.bak	(revision 207)
@@ -0,0 +1,152 @@
+pro gravitwaveprof
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+path='/donnees/aslmd/MODELES/LMD_MM_MARS/TESTGW/'
+experiment='mcd_lt16_rcpcst'
+;experiment='mcd_lt16'
+;experiment='short_mcd_lt16_rcpcst'
+;experiment='short_mcd_lt16'
+;experiment='short_mcd_lt16_calcprho'
+;experiment='mcd_lt16_calcprho'
+;experiment='short_mcd_lt16_calcprho_tot'
+;experiment='colder_gcm_add_short'
+;experiment='colder_gcm_add'
+experiment=''
+;experiment='colder_gcm_add_3.9_fine_rad_mountain'
+file=path+experiment+'_wrfout_d01_9999-09-09_09:00:00_z'
+charvar='W' & charvarc='W'
+charvar='tk' & charvarc='W'
+charvar='tk' & charvarc='W' & cond=1
+charvar='tpot' & charvarc='tpot'
+;charvar='PTOT' & charvarc='PTOT'
+charvar='tk' & charvarc='tk'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;
+;
+what_I_plot=0. & overcontour=0.
+;SPAWN, '\rm param_plot.idl ; cp gravitwave_inc2.pro param_plot.idl'
+;
+;
+;
+getcdf, $
+        file=file, $
+        charvar=charvar, $
+        invar=invar
+getcdf, $
+        file=file, $
+        charvar=charvarc, $
+        invar=invarc
+getcdf, $
+        file=file, $
+        charvar='vert', $
+        invar=vert
+getcdf, $
+        file=file, $
+        charvar='PTOT', $
+        invar=columnp
+;
+;
+;
+for nt=1,10 do begin
+;for nt=3,3 do begin
+;for nt=1,1 do begin
+;for nx=0,59 do begin
+;for nx=1,1 do begin
+;for nx=999,999 do begin  ;; moyenne ;; attention a la montagne !!!
+for nx=30,30 do begin
+zefile=experiment+'_'+charvar+'_'+string(nt+100,'(I0)')+'_'+string(nx+100,'(I0)')
+;
+;
+;
+  PS_Start, filename=zefile+'.ps'
+  print, zefile+'.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+;
+;
+;
+what_I_plot = reform(invar(*,1,*,nt))
+
+   ;logp = -10.*alog(reform(columnp(nx,1,*,nt))/610.)
+   ;vert = logp
+
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   file=path+experiment+'/input_sounding' & header='' & nlines_header=1 & ncol = 5
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   nlines = FILE_LINES(file)-nlines_header & data=FLTARR(ncol,nlines)
+   OPENR, lun, file, /GET_LUN & READF, lun, header & READF, lun, data & CLOSE, lun & FREE_LUN, lun
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   mcd_column      = reform(data(0,*)) 
+   calc_tpot       = reform(data(1,*))
+
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   file=path+experiment+'/input_therm' & ncol = 5
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   nlines = FILE_LINES(file) & data=FLTARR(ncol,nlines)
+   OPENR, lun, file, /GET_LUN & READF, lun, data & CLOSE, lun & FREE_LUN, lun
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   pressure        = reform(data(2,*))
+   mcd_tpot        = reform(data(4,*))   
+
+
+   ;nx = 1;30;59;10
+   if (nx lt 999) then begin
+     overplot = reform(what_I_plot(nx,*))
+   endif else begin
+     overplot = TOTAL(what_I_plot,1) / n_elements(reform(what_I_plot(*,0)))
+   endelse 
+   overplot_column = vert/1000.
+   column = mcd_column/1000.
+   mention = ''
+   alt = [0.,150.]
+   SPAWN, '\rm param_plot.idl'
+
+;what_I_plot = pressure
+;	what_I_plot = calc_tpot
+;overplot = alog(overplot) / alog(10.)
+;overplot = overplot[where(overplot lt 35.)] ;; evite les valeurs impossibles
+;what_I_plot = alog(what_I_plot) / alog(10.)
+;minfield_init = -5.
+;maxfield_init = 3.
+;	;;tpot
+;	minfield_init = 2.
+;	maxfield_init = 4.
+
+what_I_plot = mcd_tpot
+minfield_init = 100.
+maxfield_init = 250.
+
+;what_I_plot = 100. * abs(calc_tpot - overplot) / overplot
+;minfield_init = 0.000001
+;maxfield_init = 100.
+
+   profile, $
+        what_I_plot, $                          ; 1D vertical profile
+        column, $                               ; altitudes     
+        alt=alt, $                              ; altitude range [altmin, altmax]
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        inprofile=overplot, $                   ; another vertical profile to overplot
+        incolumn=overplot_column, $             ; altitudes of the other vertical profile (in case /= column)
+;        discrete=discrete, $                    ; show the profile points (= type of points in !psym)
+;        title_plot=title_user, $                ; title of the plot ('Profile' is default)
+;        title_axis=title_axis, $                ; title of the [x,y] axis (['Field','Altitude'] is default)
+        mention=mention                         ; add text precision within the plot window (default is nothing or '')
+
+;; sponge layer
+w=where(FINITE(overplot) ne 0)
+oplot, [minfield_init,maxfield_init], [max(overplot_column[w])-50.,max(overplot_column[w])-50.], linestyle=1
+
+;calc_tk = calc_tpot * (pressure/610.)^(1/4.4)
+;oplot, calc_tk, column, linestyle=3
+
+PS_End, /PNG
+endfor
+endfor
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/GW/scorerprof.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/GW/scorerprof.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/GW/scorerprof.pro	(revision 207)
@@ -0,0 +1,157 @@
+pro scorerprof
+;;;;;;;;;;;;;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+path='../TESTGW/'
+experiment=''
+	;;path='../TESTGW_save/gw/TESTGW/'
+	;;experiment='mcd_lt16_calcprho'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;
+;
+what_I_plot=0. & overcontour=0.
+zefile=experiment+"_scorer"
+;
+;
+;
+  PS_Start, filename=zefile+'.ps'
+  print, zefile+'.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+;
+;
+;
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   file=path+experiment+'/input_sounding' & header='' & nlines_header=1 & ncol = 5
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   nlines = FILE_LINES(file)-nlines_header & data=FLTARR(ncol,nlines)
+   OPENR, lun, file, /GET_LUN & READF, lun, header & READF, lun, data & CLOSE, lun & FREE_LUN, lun
+   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+   z      = reform(data(0,*))  
+   theta  = reform(data(1,*))
+   windu  = reform(data(3,*))   
+           ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+           file=path+experiment+'/input_therm' & ncol = 5
+           ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+           nlines = FILE_LINES(file) & data=FLTARR(ncol,nlines)
+           OPENR, lun, file, /GET_LUN & READF, lun, data & CLOSE, lun & FREE_LUN, lun
+           ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+           rrr      = reform(data(0,*))
+           press    = reform(data(2,*))
+           rho      = reform(data(3,*))
+           temp     = reform(data(4,*))
+
+nsmooth=1
+;nsmooth=3
+;nsmooth=5
+nsmooth=7  ;; 1 lev each km interp, 1 lev each 7 km GCM
+;nsmooth=10  
+nsmooth=15
+nsmooth=20
+nsmooth=22
+z = smooth(z,nsmooth,/EDGE_TRUNCATE)
+theta = smooth(theta,nsmooth,/EDGE_TRUNCATE) 
+windu  = smooth(windu,nsmooth,/EDGE_TRUNCATE)
+	;windu  = smooth(windu,60,/EDGE_TRUNCATE) ;; juste pour lower shear
+
+;;; altitude above local surface
+z = z - z(0)
+
+;;; brunt vaisala frequency
+g=3.72 & dlnthetadz=DERIV(z,alog(theta)) & n2=g*dlnthetadz
+st2 = n2 / (windu^2) 
+	;;w = where(n2 le 0.) 
+  	;;n = n2 & n[w] = 0. & n = sqrt(TEMPORARY(n)) & n[w] = -1.
+	;;st2[w] = 0. 
+
+;;; shear term
+dudz=DERIV(z,windu)
+d2udz2=DERIV(z,dudz)
+dlnrhodz = DERIV(z,alog(rho))
+sh2 = - d2udz2 / windu + dlnrhodz * dudz / windu
+
+;;;; scale height term
+drhodz = DERIV(z,rho)
+d2rhodz2 = DERIV(z,drhodz)
+hh2 = d2rhodz2 / 2. / rho - 0.75 * dlnrhodz * dlnrhodz
+
+	;for i=0,n_elements(windu)-1 do begin
+	;  ;print, windu(i), n2 / (windu^2), - d2udz2(i) / windu(i), dlnrhodz(i) * dudz(i) / windu(i), d2rhodz2 / 2. / rho, - 0.75 * dlnrhodz * dlnrhodz
+	;  print, 'YO YO ... ', st2(i), sh2(i), hh2(i)
+	;endfor
+	;stop
+
+;;; scorer parameter ;; erreur dans article Tobie, Lott98 OK
+scorer2 = st2 + sh2 + hh2    
+
+;;; relative contributions 
+part_buoy = 100. * abs(st2) / (abs(st2)+abs(sh2)+abs(hh2))
+part_shea = 100. * abs(sh2) / (abs(st2)+abs(sh2)+abs(hh2))
+part_heig = 100. * abs(hh2) / (abs(st2)+abs(sh2)+abs(hh2))
+
+;;; scorer wavelength
+scorer = sqrt(scorer2)
+lscorer = scorer & w = where(FINITE(lscorer) eq 0) & if (w(0) ne -1) then lscorer[w] = !Values.F_NAN 
+lscorer = 2 * !pi / lscorer
+
+        for i=0, n_elements(z)-1, 5 do begin
+         print, 'alt, buoy, shear, sc. height, scorer, scorer wvl'
+         print, z(i), part_buoy(i), part_shea(i), part_heig(i), scorer2(i), lscorer(i)/1000.
+        endfor
+
+     ;;;;;;;;;;;
+     what_I_plot = lscorer / 1000.
+     column = z / 1000.
+     overplot_column = column 
+     alt = [0.,150.]
+     mention = ''
+     minfield_init = 0.001 
+     maxfield_init = 200. 
+     title_axis = ['Scorer wavelength (km)','Altitude above local surface (km)']
+     ;;;;;;;;;;;
+
+!p.multi=[0,2,1]
+
+	;plot, temp, column, $
+	;      xtickinterval=50., $
+	;      ytickinterval=10., $
+	;      xtitle=title_axis(0), $
+	;      ytitle=title_axis(1), $
+	;      xrange=[50.,200.], $
+	;      yrange=alt
+	;oplot, 200.+windu, column, linestyle=1
+
+plot, what_I_plot, column, $
+      xtickinterval=50., $
+      ytickinterval=10., $
+      xtitle=title_axis(0), $
+      ytitle=title_axis(1), $
+      xrange=[minfield_init,maxfield_init], $
+      yrange=alt
+oplot, temp, column, linestyle=2
+oplot, 150.+windu, column, linestyle=1
+xyouts, 40., 20., 'dotted: 150+U(z) [m s!U-1!N]', charsize=0.8
+xyouts, 40., 10., 'dashed: T(z) [K]', charsize=0.8
+
+plot, part_buoy, column, $
+      xtickinterval=20., $
+      ytickinterval=10., $
+      xtitle='Contributions to Scorer parameter (%)', $
+      ytitle=title_axis(1), $
+      xrange=[minfield_init,100.], $
+      yrange=alt, $
+      linestyle=0
+oplot, part_shea, column, linestyle=2
+oplot, part_heig, column, linestyle=1
+xyouts, 30., 140., 'full: buoyancy';, charsize=0.8
+xyouts, 30., 130., 'dashed: shear';, charsize=0.8
+xyouts, 30., 120., 'dotted: sc. height';, charsize=0.8
+
+
+
+PS_End, /PNG
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/article_qjrms.inc
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/article_qjrms.inc	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/article_qjrms.inc	(revision 207)
@@ -0,0 +1,67 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+saveplot        = './COMP_REAL_50m_145_145_201_12km/'
+setting         = 'REAL_50m_145_145_201_12km/'
+;cases          = ['case_A', 'case_B', 'case_C', 'case_I']
+;cases          = ['case_A', 'case_B', 'case_C', 'case_HIGH']
+cases          = ['case_A', 'case_B', 'case_C', 'case_I', 'case_HIGH']
+;cases          = ['case_A', 'case_B', 'case_C', 'case_I']
+paths           = setting + cases
+tttitle         = ['[case a]  T!Ds,max!N=284 K   h= -3.9  km' $
+                  ,'[case b]  T!Ds,max!N=280 K   h= -3.5  km' $
+                  ,'[case c]  T!Ds,max!N=279 K   h=+2.4 km' $
+                  ,'[case i]   T!Ds,max!N=279 K   h= -0.5  km' $
+                  ,'[case z]  T!Ds,max!N=268 K   h=+8.4 km' ]
+tttitles        = ['[a]  T!Ds,m!N=284 K   h= -3.9  km' $
+                  ,'[b]  T!Ds,m!N=280 K   h= -3.5  km' $
+                  ,'[c]  T!Ds,m!N=279 K   h=+2.4 km' $
+                  ,'[i]   T!Ds,m!N=279 K   h= -0.5  km' $
+                  ,'[z]  T!Ds,m!N=268 K   h=+8.4 km' ]
+shorttt         = ['a','b','c','i','z' ]
+
+
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+        ;saveplot        = './COMP_case_C/'
+        ;setting        = [       $
+        ;;                'REAL_100m_145_145_201_15km/', $
+        ;;                'REAL_100m_101_101_201_15km/', $
+        ;;                'REAL_100m_101_101_151_15km/', $
+        ;;                'REAL_100m_73_73_201_15km/', $
+        ;;                'REAL_100m_73_73_151_15km/', $
+        ;;                      'REAL_100m_45_45_71_10km/', $
+        ;;                'REAL_100m_145_145_201_20km/', $
+        ;;                'REAL_100m_45_45_71_10km/', $
+        ;;                'REAL_100m_45_45_71_10km/', $
+        ;;;                'REAL_50m_201_201_201_12km/', $
+        ;;;                'REAL_50m_241_241_201_12km/', $
+        ;;'REAL_50m_181_181_201_12km/', $
+        ;;      'REAL_50m_145_145_251_10km/', $
+        ;;              'REAL_100m_145_145_101_12km/', $
+        ;;              'REAL_100m_241_241_151_15km/', $
+        ;'REAL_100m_181_181_201_15km/', $
+        ;                'REAL_50m_145_145_201_12km/'      $       ;;ref 
+        ;               ]
+        ;cases          = 'case_C'
+        ;paths           = setting + cases
+        ;;paths = [ paths, '/home/spiga/data/current3/']
+        ;tttitle = paths
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; pour les calculs des lois de similitude
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;saveplot        = './'
+;setting         = 'REAL_50m_145_145_201_12km/'
+;cases           = ['case_A', 'case_B', 'case_C', 'case_I']
+;;;cases           = ['case_C', 'case_B']
+;;cases           = ['case_B', 'case_C', 'case_HIGH']
+;cases           = ['case_A', 'case_B', 'case_C', 'case_I','case_HIGH']
+;paths           = setting + cases
+;;;paths = [ paths, './GUSEV/']
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;saveplot        = './'
+;paths = [ 'REAL_50m_145_145_201_12km/case_A', '/home/spiga/data/current3/']
+
+;;tttitle = paths
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/coeffhf
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/coeffhf	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/coeffhf	(revision 207)
@@ -0,0 +1,30 @@
+;
+; @coeffhf
+;
+
+
+ye, r, t
+
+yeyeye = where(t le 0.3) & r0 = r[yeyeye] & t0 = t[yeyeye]
+
+rerr = replicate(1.e-10,n_elements(r0))
+start = [mean(r0), max(r0)-min(r0), (max(t0)-min(t0))*mean(r0)]
+expr = 'FONC1(X, P)'
+result = MPFITEXPR(expr,t0,r0,rerr,start)
+
+;plot, r, t, psym=5, yrange=[0,0.6] & oplot, fonc1(t, result), t
+
+yeyeye = where((t gt 0.3) and (t le 1.0)) & r0 = r[yeyeye] & t0 = t[yeyeye]
+;ye = LINFIT(t0,r0) & oplot, ye(1) * t + ye(0), t
+
+       ;;
+       ;; verif
+       ;;
+       ;lim=0.30 & zelim=(-3.85/alog(lim)+0.07*alog(lim))*exp(-4.61*lim)
+       ;up=1. & & zeup= - 1.55 * up + 1.27
+       ;slope = (zelim - zeup) / (lim - up) & ord = zeup - slope * up
+       ;t1 = findgen(101.)*lim/100. & param1 = (-3.85/alog(t1)+0.07*alog(t1))*exp(-4.61*t1)
+       ;t2 = lim + findgen(101.)*(1.0 - lim)/100. & param2 = slope * t2 + ord
+       ;plot, param1, t1, yrange=[0.,1.], xrange=[-0.5,1.] & oplot, param2, t2 & oplot, r, t, psym=5
+
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/coeffw
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/coeffw	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/coeffw	(revision 207)
@@ -0,0 +1,20 @@
+;;#
+;;# @coeffw
+;;#
+
+ye2, r, t
+
+;;1.2
+yeyeye = where(t le 1.5) & r0 = r[yeyeye] & t0 = t[yeyeye]
+
+;;r0 = r & t0 = t
+
+rerr = replicate(1.e-10,n_elements(r0))
+start = [mean(r0), max(r0)-min(r0), (max(t0)-min(t0))*mean(r0)]
+start = [2.53,0.73,0]
+expr = 'FONC2(X, P)'
+result = MPFITEXPR(expr,t0,r0,rerr,start)
+
+plot, r, t, psym=5, yrange=[0,1.5] & oplot, fonc2(t, result), t
+;oplot, fonc2(t, [2.53,0.73,0.]), t
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/comp_hfx.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/comp_hfx.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/comp_hfx.pro	(revision 207)
@@ -0,0 +1,10 @@
+restore, filename='case_B/addturb.dat'
+caseb=ustarm
+restore, filename='case_C/addturb.dat'
+casec=ustarm
+restore, filename='case_HIGH/addturb.dat'
+casez=ustarm
+plot, localtime, caseb
+oplot, localtime, casec, linestyle=2
+oplot, localtime, casez, linestyle=3
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/comp_ustarmax.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/comp_ustarmax.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/comp_ustarmax.pro	(revision 207)
@@ -0,0 +1,45 @@
+
+PS_Start, FILENAME='ustarmax.ps'
+!P.Charsize = 1.2
+
+
+
+history_interval_s = 400.
+history_interval_s = 100.
+smoothampl=3700/history_interval_s
+smoothampl=0.  ;; no smooth
+;smoothampl=20.
+
+lev=1
+
+
+;restore, filename='REAL_50m_145_145_201_12km/case_A/addturb.dat'
+;ustarmaxye = SMOOTH(TEMPORARY(ustarmax), [smoothampl], /EDGE_TRUNCATE)
+;ustarmye = SMOOTH(TEMPORARY(ustarm), [smoothampl], /EDGE_TRUNCATE)
+;plot, localtime, ustarmaxye, yrange=[0.0,1.0], xtickinterval=1., ytickinterval=0.1, ytitle='m/s', xtitle='Local time (h)'
+;oplot, localtime, ustarmye
+
+restore, filename='REAL_50m_145_145_201_12km/case_B/addturb.dat'
+ustarmaxye = SMOOTH(TEMPORARY(ustarmax), [smoothampl], /EDGE_TRUNCATE)
+ustarmye = SMOOTH(TEMPORARY(ustarm), [smoothampl], /EDGE_TRUNCATE)
+plot, localtime, ustarmaxye, yrange=[0.0,1.2], xtickinterval=1., ytickinterval=0.1, ytitle='m/s', xtitle='Local time (h)'
+oplot, localtime, ustarmye
+
+restore, filename='REAL_50m_145_145_201_12km/case_C/addturb.dat'
+ustarmaxye = SMOOTH(TEMPORARY(ustarmax), [smoothampl], /EDGE_TRUNCATE)
+ustarmye = SMOOTH(TEMPORARY(ustarm), [smoothampl], /EDGE_TRUNCATE)
+oplot, localtime, ustarmaxye, linestyle=2
+oplot, localtime, ustarmye, linestyle=2
+
+;restore, filename='REAL_50m_145_145_201_12km/case_I/addturb.dat'
+;ustarmaxye = SMOOTH(TEMPORARY(ustarmax), [smoothampl], /EDGE_TRUNCATE)
+;oplot, localtime, ustarmaxye, linestyle=3
+
+;restore, filename='REAL_50m_145_145_201_12km/case_HIGH/addturb.dat'
+;ustarmaxye = SMOOTH(TEMPORARY(ustarmax), [smoothampl], /EDGE_TRUNCATE)
+;oplot, localtime, ustarmaxye, linestyle=4
+
+
+
+
+PS_END, /PNG
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/comp_velo.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/comp_velo.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/comp_velo.pro	(revision 207)
@@ -0,0 +1,57 @@
+
+
+PS_Start, FILENAME='velmax.ps'
+!P.Charsize = 1.2
+
+
+history_interval_s = 400.
+history_interval_s = 100.
+smoothampl=3700/history_interval_s
+;smoothampl=0.  ;; no smooth
+;smoothampl=20.
+smoothampl=5.
+
+lev=1
+;lev=0 qu'il faut faire ???
+
+
+@report_tasi.inc
+
+
+
+
+;restore, filename='REAL_50m_145_145_201_12km/case_A/addturb.dat'
+restore, filename=saveplot+cases(0)+'/addturb.dat'
+restore, filename=saveplot+cases(0)+'/getturb.dat'
+print, h(lev)
+velmaxye = reform(velmax(lev,*))
+velmaxye = SMOOTH(TEMPORARY(velmaxye), [smoothampl], /EDGE_TRUNCATE)
+plot, localtime, velmaxye, $
+xrange=[8.,17.], xtickinterval=1., ytickinterval=2.0, $
+yrange=[0.,14.], ytitle='Horizontal velocity (m s!U-1!N)', xtitle='Local time (h)'
+
+;restore, filename='REAL_50m_145_145_201_12km/case_B/addturb.dat'
+restore, filename=saveplot+cases(1)+'/addturb.dat'
+restore, filename=saveplot+cases(1)+'/getturb.dat'
+print, h(lev)
+velmaxye = reform(velmax(lev,*))
+velmaxye = SMOOTH(TEMPORARY(velmaxye), [smoothampl], /EDGE_TRUNCATE)
+oplot, localtime, velmaxye, linestyle=1
+
+;restore, filename='REAL_50m_145_145_201_12km/case_C/addturb.dat'
+restore, filename=saveplot+cases(2)+'/addturb.dat'
+restore, filename=saveplot+cases(2)+'/getturb.dat'
+print, h(lev)
+velmaxye = reform(velmax(lev,*))
+velmaxye = SMOOTH(TEMPORARY(velmaxye), [smoothampl], /EDGE_TRUNCATE)
+oplot, localtime, velmaxye, linestyle=2
+
+;restore, filename='REAL_50m_145_145_201_12km/case_I/addturb.dat'
+restore, filename=saveplot+cases(3)+'/addturb.dat'
+restore, filename=saveplot+cases(3)+'/getturb.dat'
+print, h(lev)
+velmaxye = reform(velmax(lev,*))
+velmaxye = SMOOTH(TEMPORARY(velmaxye), [smoothampl], /EDGE_TRUNCATE)
+oplot, localtime, velmaxye, linestyle=3
+
+PS_END, /PNG
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/compturb.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/compturb.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/compturb.pro	(revision 207)
@@ -0,0 +1,939 @@
+pro compturb
+saveps='true' & p0=610. & t0=220. & r_cp=1/4.4 & grav=3.72 & R=192.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; grep frames_per_outfile */*/namelist.input
+history_interval_s = 100.
+smoothampl=3700/history_interval_s
+;smoothampl=10.
+;smoothampl=20.
+;smoothampl=4.
+smoothampl=0.
+smoothampl=5.
+;;;;;;;
+;
+; ATTENTION IL FAUT CHANGER LES VARIABLES A DEUX ENDROITS
+;
+;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;;
+;;; SET HERE WHAT YOU WANT TO COMPARE
+;;;
+;@article_qjrms.inc
+@report_tasi.inc
+;;;
+;;;
+;;;
+
+
+;;;
+;;; TWEAKS
+;;;
+;SPAWN, 'cp compturb.pro '+saveplot
+;SPAWN, 'gqview '+saveplot+' &'
+;goto, quick
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;; pour article, decommenter ici et commenter l'appel au deuxieme fichier
+;;;com
+;;!p.multi = [0,2,1]
+;
+;        path = paths(0) & print, path 
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        file = path+'/compturb.dat' & restore, filename=file
+;        file = path+'/getturb.dat'  & restore, filename=file
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;
+;;; COEFFICIENT POUR LOIS DE SIMILITUDE
+;;;
+;;@coeffhf
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zefield       =  a_wt_bot 
+;zey           =  a_h
+;set_name      =  saveplot+'comp_A_HFLUX.ps'
+;set_title     =  "Similarity: vert. eddy heat flux on Mars"
+;set_titlex    =  "Dimensionless vertical heat flux <w'T'>/<w'T'>!Dmax!N"
+;set_titley    =  'Dimensionless height z/z!Di!N'
+;set_subtitle  =  ''
+;set_xrange    =  [-0.5,1.]
+;set_yrange    =  [0.,1.5]
+;set_tickx     =  0.25
+;set_ticky     =  0.1
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zesim = 1 - 1.2 * a_h
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;localtimes = localtime[where( (localtime ge 11) and (localtime le 16) )]
+;;;localtimes = localtime[where( (localtime ge 13) and (localtime le 16) )]
+;;;localtimes = localtime[where( (localtime ge 12) and (localtime le 15) )]
+;;localtimes = localtime[where( (localtime ge 13) and (localtime le 15) )]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;!P.Charsize = 1.2
+;user_lt=localtimes[0] & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt)))) & nntt = yeah(0)
+;plot, zefield(*,nntt), zey(*,nntt), xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, psym=3;, /ISOTROPIC;, POS=[0.12, 0.22, 0.42, 1.0] ;color=0, linestyle=altlin
+;for ll = 1, n_elements(localtimes)-1 do begin
+;  user_lt=localtimes[ll] & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt)))) & nntt = yeah(0)
+;  if (nntt ne -1) then oplot, zefield(*,nntt), zey(*,nntt), psym=3 ;linestyle=altlin
+;endfor
+;;wherex = set_xrange(0)
+;;wherey = set_yrange(1)
+;;dddx = (set_xrange(1) - set_xrange(0))/20. & dddy = (set_yrange(1) - set_yrange(0))/20. & xyouts, wherex + dddx, wherey, path
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zecolor = 0. & loadct, 33
+;for i=1, n_elements(paths)-1 do begin
+;;        zecolor = 50. + zecolor
+;zecolor = 0. & loadct, 0
+;        path = paths(i) & print, path
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        file = path+'/compturb.dat' & restore, filename=file
+;        file = path+'/getturb.dat'  & restore, filename=file
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        zefield = a_wt_bot
+;        zey = a_h
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        for ll = 0, n_elements(localtimes)-1 do begin
+;          user_lt=localtimes[ll] & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt)))) & nntt = yeah(0)
+;          if (nntt ne -1) then oplot, zefield(*,nntt), zey(*,nntt), psym=3, color=zecolor
+;        endfor
+;        ;xyouts, wherex + dddx, wherey - float(i)*dddy, path, color=zecolor
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;endfor
+;loadct, 0
+;;oplot, [0.,0.], set_yrange, linestyle=0, color=0
+;	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;	;ye, ryeah, tyeah & oplot, ryeah, tyeah, linestyle=0, color=255, /NOCLIP
+;	;oplot, set_xrange, [0.,0.], linestyle=0, color=0
+;	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_End, /PNG
+;;com
+;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;	path = paths(0) & print, path
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        file = path+'/compturb.dat' & restore, filename=file
+;        file = path+'/getturb.dat'  & restore, filename=file
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;
+;;; COEFFICIENT POUR LOIS DE SIMILITUDE
+;;;
+;;@coeffw
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zefield       =  a_vel_bot 
+;zey           =  a_h  
+;set_name      =  saveplot+'comp_A_VEL.ps'
+;set_title     =  "Similarity: vert. vel. variance on Mars"
+;set_titlex    =  "Dimensionless vert. vel. variance <w'!U2!N>/w!D*!N!U2!N"
+;set_titley    =  'Dimensionless height z/z!Di!N'
+;set_subtitle  =  ''
+;set_xrange    =  [0.,1.2]
+;set_yrange    =  [0.,1.5]
+;set_tickx     =  0.25 ;0.1
+;set_ticky     =  0.1
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zesim = 1.8 * a_h^(2./3.) * ( 1. - 0.8 * a_h )^2
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;localtimes = localtime[where( (localtime ge 11) and (localtime le 16) )]
+;;localtimes = localtime[where( (localtime ge 13) and (localtime le 15) )]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;com
+;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;!P.Charsize = 1.2
+;user_lt=localtimes[0] & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt)))) & nntt = yeah(0)
+;plot, zefield(*,nntt), zey(*,nntt), xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, psym=3;, /ISOTROPIC;, POS=[0.62, 0.22, 0.92, 1.0] ;color=0, linestyle=altlin
+;for ll = 1, n_elements(localtimes)-1 do begin
+;  user_lt=localtimes[ll] & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt)))) & nntt = yeah(0)
+;  if (nntt ne -1) then oplot, zefield(*,nntt), zey(*,nntt), psym=3 ;linestyle=altlin
+;endfor
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zecolor = 0. & loadct, 33
+;for i=1, n_elements(paths)-1 do begin
+;zecolor = 0. & loadct, 0
+;;	zecolor = 50. + zecolor
+;	path = paths(i) & print, path
+;	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;	file = path+'/compturb.dat' & restore, filename=file
+;	file = path+'/getturb.dat'  & restore, filename=file
+;	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;	zefield = a_vel_bot 
+;	zey = a_h
+;	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;	for ll = 0, n_elements(localtimes)-1 do begin
+;	  user_lt=localtimes[ll] & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt)))) & nntt = yeah(0)
+;	  if (nntt ne -1) then oplot, zefield(*,nntt), zey(*,nntt), psym=3, color=zecolor
+;	endfor
+;	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;endfor
+;loadct, 0
+;	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;	;ye2, ryeah, tyeah & oplot, ryeah, tyeah, linestyle=0, color=255, /NOCLIP
+;	;oplot, set_xrange, [0.,0.], linestyle=0, color=0
+;	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_End, /PNG
+;
+;;;com
+;;stop
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;        path = paths(0) & print, path
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        file = path+'/compturb.dat' & restore, filename=file
+;        file = path+'/getturb.dat'  & restore, filename=file
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zefield       =  localtime
+;zey           =  SMOOTH(w_star_bot, [smoothampl], /EDGE_TRUNCATE)
+;set_name      =  saveplot+'comp_W_STAR.ps'
+;set_title     =  '';"Free convection velocity scale W!D*!N (m.s!U-1!N)"
+;set_titlex    =  'Local Time (h)'
+;set_titley    =  'Free convection velocity scale (m s!U-1!N)'
+;set_subtitle  =  ''
+;set_xrange    =  [08.,17.]
+;set_yrange    =  [00.,06.]
+;set_tickx     =  1.0
+;set_ticky     =  0.5
+;wherex	      =  8.5;11.0
+;wherey	      =  5.5;1.75
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;fixfix = where((w_star_bot le 0.) and (localtime ge 15.)) & if (fixfix(0) ne -1) then zey(fixfix(0):n_elements(zey)-1) = !Values.F_NAN
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;!P.Charsize = 1.2
+;altlin=0
+;plot, zefield, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;dddx = (set_xrange(1) - set_xrange(0))/20. & dddy = (set_yrange(1) - set_yrange(0))/20. & xyouts, wherex + 2.*dddx, wherey, tttitle(0);path
+;        plots,  wherex + 2.*dddx/1.1,  wherey
+;        plots,  wherex + 2.*dddx/20.,  wherey, linestyle=altlin, /continue
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zecolor = 0. & loadct, 33
+;for i=1, n_elements(paths)-1 do begin
+;        ;zecolor = float(255)/n_elements(paths) + zecolor
+;	zecolor = 0
+;        path = paths(i) & print, path
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        file = path+'/compturb.dat' & restore, filename=file
+;        file = path+'/getturb.dat'  & restore, filename=file
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        zefield = localtime
+;        zey = SMOOTH(w_star_bot, [smoothampl], /EDGE_TRUNCATE);w_star_bot
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;	fixfix = where((w_star_bot le 0.) and (localtime ge 15.)) & if (fixfix(0) ne -1) then zey(fixfix(0):n_elements(zey)-1) = !Values.F_NAN
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        oplot, zefield, zey, color=zecolor, linestyle=altlin+i
+;        xyouts, wherex + 2.*dddx,      wherey - float(i)*dddy, tttitle(i), color=zecolor
+;        plots,  wherex + 2.*dddx/1.1,  wherey - float(i)*dddy
+;        plots,  wherex + 2.*dddx/20.,  wherey - float(i)*dddy, linestyle=altlin+i, /continue
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;endfor
+;loadct, 0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_End, /PNG
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+        path = paths(0) & print, path
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+        file = path+'/compturb.dat' & restore, filename=file
+        file = path+'/getturb.dat'  & restore, filename=file
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+zefield       =  localtime
+zey           =  SMOOTH(pbl_height, [smoothampl], /EDGE_TRUNCATE)
+set_name      =  saveplot+'comp_HEIGHT.ps'
+set_title     =  '';"Boundary layer height z!Di!N (km)"; [definition : static stability > 1.5 K.m!U-1!N] "
+set_titlex    =  'Local Time (h)'
+set_titley    =  'Boundary layer height (km)'
+set_subtitle  =  ''
+set_xrange    =  [08.,18.]
+set_yrange    =  [00.,08.] ;[00.,07.]
+set_tickx     =  1. 
+set_ticky     =  1.
+wherex        =  09.;13.25 ;12.75
+wherey        =  06.5;2.5 ;2.0
+;	set_xrange    =  [13.5,18.] & set_yrange    =  [06.4,08.0] & set_tickx     =  0.5 & set_ticky     =  0.2 
+;       wherex=15.30
+;       wherey=06.90
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then PS_Start, FILENAME=set_name
+!P.Charsize = 1.2
+altlin=0
+plot, zefield, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+dddx = (set_xrange(1) - set_xrange(0))/20. & dddy = (set_yrange(1) - set_yrange(0))/20. & xyouts, wherex + 2.*dddx, wherey, tttitle(0)
+        plots,  wherex + 2.*dddx/1.1,  wherey
+        plots,  wherex + 2.*dddx/20.,  wherey, linestyle=altlin, /continue
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;w = where((localtime ge 17.) and (localtime le 17.5)) & if (w(0) ne -1) then print, 'BL height 17:00-17:30 : ', mean(pbl_height[w])
+w = where((localtime ge 14.) and (localtime le 14.5)) & if (w(0) ne -1) then print, 'BL height 14:00-14:30 : ', mean(pbl_height[w])
+;print, max(SMOOTH(tke, [0,37], /EDGE_TRUNCATE))
+;print, max(SMOOTH(wmax, [0,37], /EDGE_TRUNCATE))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zecolor = 0. & loadct, 33
+for i=1, n_elements(paths)-1 do begin
+        ;zecolor = float(255)/n_elements(paths) + zecolor
+	zecolor=0
+        path = paths(i) & print, path
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+        file = path+'/compturb.dat' & restore, filename=file
+        file = path+'/getturb.dat'  & restore, filename=file
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+        zefield = localtime
+        zey = SMOOTH(pbl_height, [smoothampl], /EDGE_TRUNCATE);pbl_height 
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+        oplot, zefield, zey, color=zecolor, linestyle=altlin+i
+        xyouts, wherex + 2.*dddx,      wherey - float(i)*dddy, tttitle(i), color=zecolor
+        plots,  wherex + 2.*dddx/1.1,  wherey - float(i)*dddy
+        plots,  wherex + 2.*dddx/20.,  wherey - float(i)*dddy, linestyle=altlin+i, /continue
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+	;w = where((localtime ge 17.) and (localtime le 17.5)) & if (w(0) ne -1) then print, 'BL height 17:00-17:30 : ', mean(pbl_height[w])
+        w = where((localtime ge 14.) and (localtime le 14.5)) & if (w(0) ne -1) then print, 'BL height 14:00-14:30 : ', mean(pbl_height[w])
+	;print, max(SMOOTH(tke, [0,37], /EDGE_TRUNCATE))
+	;print, max(SMOOTH(wmax, [0,37], /EDGE_TRUNCATE))
+endfor
+loadct, 0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then PS_End, /PNG
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;        path = paths(0) & print, path
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;        file = path+'/compturb.dat' & restore, filename=file
+;;        file = path+'/getturb.dat'  & restore, filename=file
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zefield       =  localtime
+;;zey           =  smooth(DERIV(localtime, smooth(pbl_height,smoothampl,/EDGE_TRUNCATE)),smoothampl,/EDGE_TRUNCATE)  
+;;set_name      =  saveplot+'comp_dHEIGHT.ps'
+;;set_title     =  "Boundary layer height growth dz!Di!N/dt (km/hour)"
+;;set_titlex    =  'Local Time (h)'
+;;set_titley    =  'Boundary layer height growth (km/hour)'
+;;set_subtitle  =  ''
+;;set_xrange    =  [9.,18.]
+;;set_yrange    =  [-0.4,1.6] 
+;;set_tickx     =  1.
+;;set_ticky     =  0.2
+;;wherex        =  10.30
+;;wherey        =  0.1
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;;!P.Charsize = 1.2
+;;altlin = 0
+;;plot, zefield, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;;dddx = (set_xrange(1) - set_xrange(0))/20. & dddy = (set_yrange(1) - set_yrange(0))/20. & xyouts, wherex + 2.*dddx, wherey, path
+;;        plots,  wherex + 2.*dddx/1.1,  wherey
+;;        plots,  wherex + 2.*dddx/20.,  wherey, linestyle=altlin, /continue
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;zecolor = 0. & loadct, 33
+;;for i=1, n_elements(paths)-1 do begin
+;;        ;zecolor = float(255)/n_elements(paths) + zecolor
+;;	zecolor = 0
+;;        path = paths(i) & print, path
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;        file = path+'/compturb.dat' & restore, filename=file
+;;        file = path+'/getturb.dat'  & restore, filename=file
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;        zefield = localtime
+;;        zey = smooth(DERIV(localtime, smooth(pbl_height,smoothampl,/EDGE_TRUNCATE)),smoothampl,/EDGE_TRUNCATE) 
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;        oplot, zefield, zey, color=zecolor, linestyle=altlin+i
+;;        xyouts, wherex + 2.*dddx,      wherey - float(i)*dddy, path, color=zecolor
+;;        plots,  wherex + 2.*dddx/1.1,  wherey - float(i)*dddy
+;;        plots,  wherex + 2.*dddx/20.,  wherey - float(i)*dddy, linestyle=altlin+i, /continue
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;endfor
+;;loadct, 0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;if (saveps eq 'true') then PS_End, /PNG
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;        path = paths(0) & print, path
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        file = path+'/compturb.dat' & restore, filename=file
+;        file = path+'/getturb.dat'  & restore, filename=file
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zefield       =  localtime
+;zey           =  SMOOTH(wmaxmax, [smoothampl], /EDGE_TRUNCATE)
+;zey2          =  SMOOTH(wminmin, [smoothampl], /EDGE_TRUNCATE)
+;set_name      =  saveplot+'comp_WMAX.ps'
+;set_title     =  '';"Maximum and minimum vertical velocity (m.s!U-1!N)"
+;set_titlex    =  'Local Time (h)'
+;set_titley    =  'Maximum and minimum vertical velocity (m s!U-1!N)'
+;set_subtitle  =  ''
+;;set_xrange    =  [09.0,18.0]
+;set_yrange    =  [-12.0,18.0];[-15.0,20.0]
+;set_tickx     =  1.
+;set_ticky     =  2.
+;wherex        =  8.5;11.00
+;wherey        =  16.5;5.5
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;!P.Charsize = 1.2
+;altlin = 0
+;plot, zefield, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;oplot, zefield, zey2, color=0, linestyle=altlin
+;dddx = (set_xrange(1) - set_xrange(0))/20. & dddy = (set_yrange(1) - set_yrange(0))/20. & xyouts, wherex + 2.*dddx, wherey, tttitle(0)
+;        plots,  wherex + 2.*dddx/1.1,  wherey
+;        plots,  wherex + 2.*dddx/20.,  wherey, linestyle=altlin, /continue
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zecolor = 0. & loadct, 33
+;for i=1, n_elements(paths)-1 do begin
+;        ;zecolor = float(255)/n_elements(paths) + zecolor
+;        zecolor = 0.
+;        path = paths(i) & print, path
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        file = path+'/compturb.dat' & restore, filename=file
+;        file = path+'/getturb.dat'  & restore, filename=file
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        zefield = localtime
+;        zey = SMOOTH(wmaxmax, [smoothampl], /EDGE_TRUNCATE)
+;	zey2 = SMOOTH(wminmin, [smoothampl], /EDGE_TRUNCATE) 
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        oplot, zefield, zey, color=zecolor, linestyle=altlin+i
+;        oplot, zefield, zey2, color=zecolor, linestyle=altlin+i
+;        xyouts, wherex + 2.*dddx,      wherey - float(i)*dddy, tttitle(i), color=zecolor
+;        plots,  wherex + 2.*dddx/1.1,  wherey - float(i)*dddy
+;        plots,  wherex + 2.*dddx/20.,  wherey - float(i)*dddy, linestyle=altlin+i, /continue
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;endfor
+;loadct, 0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_End, /PNG
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;        path = paths(0) & print, path
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        file = path+'/compturb.dat' & restore, filename=file
+;        file = path+'/getturb.dat'  & restore, filename=file
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zefield       =  localtime
+;zey           =  SMOOTH(tkemax, [smoothampl], /EDGE_TRUNCATE);hfbotmax
+;set_name      =  saveplot+'comp_TKE.ps'
+;set_title     =  '';"Maximum turbulent kinetic energy (m!U2!N.s!U-2!N)" ; 0.5[<u'!U2!N>+<v'!U2!N>+<w'!U2!N>]!Dmax!N (m!U2!N.s!U-2!N)"
+;set_titlex    =  'Local Time (h)'
+;set_titley    =  'Maximum turbulent kinetic energy (m!U2!N s!U-2!N)'
+;set_subtitle  =  ''
+;;set_xrange    =  [09.0,18.0]
+;set_yrange    =  [00.0,18.0];[00.0,26.0]
+;set_tickx     =  1.
+;set_ticky     =  2.
+;wherex        =  8.5;11.70
+;wherey        =  16.;5.4
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;!P.Charsize = 1.2
+;altlin = 0
+;plot, zefield, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;dddx = (set_xrange(1) - set_xrange(0))/20. & dddy = (set_yrange(1) - set_yrange(0))/25. & xyouts, wherex + 2.*dddx, wherey, tttitles(0)
+;        plots,  wherex + 2.*dddx/1.1,  wherey
+;        plots,  wherex + 2.*dddx/20.,  wherey, linestyle=altlin, /continue
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zecolor = 0. & loadct, 33
+;for i=1, n_elements(paths)-1 do begin
+;        ;zecolor = float(255)/n_elements(paths) + zecolor
+;        zecolor = 0.
+;        path = paths(i) & print, path
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        file = path+'/compturb.dat' & restore, filename=file
+;        file = path+'/getturb.dat'  & restore, filename=file
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        zefield = localtime
+;        zey = SMOOTH(tkemax, [smoothampl], /EDGE_TRUNCATE);hfbotmax 
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        oplot, zefield, zey, color=zecolor, linestyle=altlin+i
+;        xyouts, wherex + 2.*dddx,      wherey - float(i)*dddy, tttitles(i), color=zecolor
+;        plots,  wherex + 2.*dddx/1.1,  wherey - float(i)*dddy
+;        plots,  wherex + 2.*dddx/20.,  wherey - float(i)*dddy, linestyle=altlin+i, /continue
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;endfor
+;loadct, 0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_End, /PNG
+;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;        path = paths(0) & print, path
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        file = path+'/compturb.dat' & restore, filename=file
+;        file = path+'/getturb.dat'  & restore, filename=file
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zefield       =  localtime
+;zey           =  SMOOTH(hfbotmax, [smoothampl], /EDGE_TRUNCATE);hfbotmax
+;set_name      =  saveplot+'comp_HFBOT.ps'
+;set_title     =  '';"Maximum heat flux <w'T'>!Dmax!N (K.m.s!U-1!N)"
+;set_titlex    =  'Local Time (h)'
+;set_titley    =  'Maximum vertical eddy heat flux (K m s!U-1!N)'
+;set_subtitle  =  ''
+;;set_xrange    =  [09.0,18.0]
+;set_yrange    =  [00.0,02.0];[00.0,02.8]
+;set_tickx     =  1.
+;set_ticky     =  0.2
+;wherex        =  8.5;10.30
+;wherey        =  1.8;0.7
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_Start, FILENAME=set_name 
+;!P.Charsize = 1.2
+;altlin = 0
+;plot, zefield, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;dddx = (set_xrange(1) - set_xrange(0))/20. & dddy = (set_yrange(1) - set_yrange(0))/20. & xyouts, wherex + 2.*dddx, wherey, tttitle(0)
+;        plots,  wherex + 2.*dddx/1.1,  wherey
+;        plots,  wherex + 2.*dddx/20.,  wherey, linestyle=altlin, /continue
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zecolor = 0. & loadct, 33
+;for i=1, n_elements(paths)-1 do begin
+;        ;zecolor = float(255)/n_elements(paths) + zecolor
+;	zecolor = 0.
+;        path = paths(i) & print, path
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        file = path+'/compturb.dat' & restore, filename=file
+;        file = path+'/getturb.dat'  & restore, filename=file
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        zefield = localtime
+;        zey = SMOOTH(hfbotmax, [smoothampl], /EDGE_TRUNCATE);hfbotmax 
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        oplot, zefield, zey, color=zecolor, linestyle=altlin+i
+;        xyouts, wherex + 2.*dddx,      wherey - float(i)*dddy, tttitle(i), color=zecolor
+;        plots,  wherex + 2.*dddx/1.1,  wherey - float(i)*dddy
+;        plots,  wherex + 2.*dddx/20.,  wherey - float(i)*dddy, linestyle=altlin+i, /continue
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;endfor
+;loadct, 0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_End, /PNG 
+;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;        path = paths(0) & print, path
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;        file = path+'/compturb.dat' & restore, filename=file
+;;        file = path+'/getturb.dat'  & restore, filename=file
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zefield       =  localtime
+;;zey           =  t_bot;SMOOTH(t_bot, [smoothampl], /EDGE_TRUNCATE);tt_top
+;;zey	      =  SMOOTH(DERIV(localtime, SMOOTH(t_bot,smoothampl/2.,/EDGE_TRUNCATE)),smoothampl,/EDGE_TRUNCATE)
+;;;zey           =  SMOOTH(DERIV(localtime, SMOOTH(t_bot/((p0 / p_bot)^r_cp),smoothampl/2.,/EDGE_TRUNCATE)),smoothampl,/EDGE_TRUNCATE)
+;;set_name      =  saveplot+'comp_TdtBOT.ps';saveplot+'comp_TBOT.ps'
+;;set_title     =  "Potential temperature time derivative dT!Db!N/dt (K.hour!U-1!N)"
+;;set_titlex    =  'Local Time (h)'
+;;set_titley    =  'Potential temperature time derivative (K.hour!U-1!N)'
+;;set_subtitle  =  ''
+;;set_xrange    =  [ 09., 18.] 
+;;set_yrange    =  [-01., 06.] 
+;;set_tickx     =  1.
+;;set_ticky     =  1. 
+;;wherex        =  13.25 
+;;wherey        =  5.5
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;;!P.Charsize = 1.2
+;;altlin = 0
+;;plot, zefield, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;;dddx = (set_xrange(1) - set_xrange(0))/20. & dddy = (set_yrange(1) - set_yrange(0))/20. & xyouts, wherex + 2.*dddx, wherey, tttitle(0)
+;;        plots,  wherex + 2.*dddx/1.1,  wherey
+;;        plots,  wherex + 2.*dddx/20.,  wherey, linestyle=altlin, /continue
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;zecolor = 0. & loadct, 33
+;;for i=1, n_elements(paths)-1 do begin
+;;        ;zecolor = float(255)/n_elements(paths) + zecolor
+;;        zecolor = 0.
+;;        path = paths(i) & print, path
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;        file = path+'/compturb.dat' & restore, filename=file
+;;        file = path+'/getturb.dat'  & restore, filename=file
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;        zefield = localtime
+;;        zey = t_bot;SMOOTH(t_bot, [smoothampl], /EDGE_TRUNCATE);tt_top 
+;;		;zey = DERIV(localtime, t_bot)
+;;		zey = SMOOTH(DERIV(localtime, SMOOTH(t_bot,smoothampl/2.,/EDGE_TRUNCATE)),smoothampl,/EDGE_TRUNCATE)
+;;		;zey = SMOOTH(DERIV(localtime, SMOOTH(t_bot/((p0 / p_bot)^r_cp),smoothampl/2.,/EDGE_TRUNCATE)),smoothampl,/EDGE_TRUNCATE)
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;        oplot, zefield, zey, color=zecolor, linestyle=altlin+i
+;;        xyouts, wherex + 2.*dddx,      wherey - float(i)*dddy, tttitle(i), color=zecolor
+;;        plots,  wherex + 2.*dddx/1.1,  wherey - float(i)*dddy
+;;        plots,  wherex + 2.*dddx/20.,  wherey - float(i)*dddy, linestyle=altlin+i, /continue
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;endfor
+;;loadct, 0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;oplot, set_xrange, [0,0], linestyle=2
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;if (saveps eq 'true') then PS_End, /PNG
+;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;        path = paths(0) & print, path
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;        file = path+'/compturb.dat' & restore, filename=file
+;;        file = path+'/getturb.dat'  & restore, filename=file
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zefield       =  localtime
+;;zey           =  SMOOTH(tt_top, [smoothampl], /EDGE_TRUNCATE);tt_top
+;;set_name      =  saveplot+'comp_TTOP.ps'
+;;set_title     =  "Temperature at the top of the boundary layer (K)"
+;;set_titlex    =  'Local Time (h)'
+;;set_titley    =  'Temperature at the top of the boundary layer (K)'
+;;set_subtitle  =  ''
+;;set_xrange    =  [09.,18.]
+;;set_yrange    =  [195.,225.]
+;;set_tickx     =  1.
+;;set_ticky     =  5.
+;;wherex        =  13.00
+;;wherey        =  223.5
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;;!P.Charsize = 1.2
+;;altlin = 0
+;;plot, zefield, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;;dddx = (set_xrange(1) - set_xrange(0))/20. & dddy = (set_yrange(1) - set_yrange(0))/20. & xyouts, wherex + 2.*dddx, wherey, path
+;;        plots,  wherex + 2.*dddx/1.1,  wherey
+;;        plots,  wherex + 2.*dddx/20.,  wherey, linestyle=altlin, /continue
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;zecolor = 0. & loadct, 33
+;;for i=1, n_elements(paths)-1 do begin
+;;        ;zecolor = float(255)/n_elements(paths) + zecolor
+;;	zecolor = 0.
+;;        path = paths(i) & print, path
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;        file = path+'/compturb.dat' & restore, filename=file
+;;        file = path+'/getturb.dat'  & restore, filename=file
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;        zefield = localtime
+;;        zey = SMOOTH(tt_top, [smoothampl], /EDGE_TRUNCATE);tt_top 
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;        oplot, zefield, zey, color=zecolor, linestyle=altlin+i
+;;        xyouts, wherex + 2.*dddx,      wherey - float(i)*dddy, path, color=zecolor
+;;        plots,  wherex + 2.*dddx/1.1,  wherey - float(i)*dddy
+;;        plots,  wherex + 2.*dddx/20.,  wherey - float(i)*dddy, linestyle=altlin+i, /continue
+;;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;endfor
+;;loadct, 0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;if (saveps eq 'true') then PS_End, /PNG
+;
+;
+;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;
+;lev = 4
+;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;
+;
+;        path = paths(0) & print, path
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        file = path+'/compturb.dat' & restore, filename=file
+;        file = path+'/addturb.dat'  & restore, filename=file
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zefield       =  localtime
+;zey 	      =  SMOOTH(reform(velmax(lev,*)), [smoothampl], /EDGE_TRUNCATE)
+;set_name      =  saveplot+'comp_VELMAX.ps'
+;set_title     =  '';"Maximum horizontal velocity "+string(h(lev)*1000.,'(I0)')+"m above ground (m.s!U-1!N)"
+;set_titlex    =  'Local Time (h)'
+;set_titley    =  "Maximum horizontal velocity "+string(h(lev)*1000.,'(I0)')+"m above ground (m s!U-1!N)"
+;set_subtitle  =  ''
+;;set_xrange    =  [09.0,18.0]
+;set_yrange    =  [00.0,14.0]
+;set_tickx     =  1.
+;set_ticky     =  2.
+;wherex        =  8.5;10.30
+;wherey        =  12.;0.7
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;print, h(lev)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_Start, FILENAME=set_name 
+;!P.Charsize = 1.2
+;altlin = 0
+;plot, zefield, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;dddx = (set_xrange(1) - set_xrange(0))/20. & dddy = (set_yrange(1) - set_yrange(0))/20. & xyouts, wherex + 2.*dddx, wherey, tttitle(0)
+;        plots,  wherex + 2.*dddx/1.1,  wherey
+;        plots,  wherex + 2.*dddx/20.,  wherey, linestyle=altlin, /continue
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zecolor = 0. & loadct, 33
+;for i=1, n_elements(paths)-1 do begin
+;        ;zecolor = float(255)/n_elements(paths) + zecolor
+;        zecolor = 0.
+;        path = paths(i) & print, path
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        file = path+'/compturb.dat' & restore, filename=file
+;        file = path+'/addturb.dat'  & restore, filename=file
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        zefield = localtime
+;	zey = SMOOTH(reform(velmax(lev,*)), [smoothampl], /EDGE_TRUNCATE)
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;        oplot, zefield, zey, color=zecolor, linestyle=altlin+i
+;        xyouts, wherex + 2.*dddx,      wherey - float(i)*dddy, tttitle(i), color=zecolor
+;        plots,  wherex + 2.*dddx/1.1,  wherey - float(i)*dddy
+;        plots,  wherex + 2.*dddx/20.,  wherey - float(i)*dddy, linestyle=altlin+i, /continue
+;        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;endfor
+;loadct, 0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_End, /PNG
+
+
+
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+goto, no_therm
+quick:
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cp = R / r_cp
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+x  = fltarr(n_elements(paths)) & y  = fltarr(n_elements(paths))
+x2 = fltarr(n_elements(paths)) & y2 = fltarr(n_elements(paths))
+for i=0, n_elements(paths)-1 do begin
+	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+	path = paths(i) & print, path
+        file = path+'/compturb.dat' & restore, filename=file
+        file = path+'/getturb.dat'  & restore, filename=file
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+	yeye = 17. 
+	;yeye = 15.
+        ;yeye = 13.
+        ;yeye = 09.
+	w = where(localtime eq yeye) ;& print, w
+
+
+        	;yeye = 08. 
+        	;w2 = where(localtime eq yeye) ;& print, w
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+	x(i) = (p0 / p_bot[w])^r_cp
+	y(i) = t_bot[w];-t_bot[w2] & print, y(i)
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+	y2(i) = z_top[w]
+	;y2(i) = pbl_height[w]
+	x2(i) = t_bot[w]
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;w2 = where( abs(h-0.01) eq min(abs(h-0.01)) )
+;w2(0)=0
+;w2 = where( abs(h-0.1) eq min(abs(h-0.1)) )
+;w2 = where( abs(h-1.5) eq min(abs(h-1.5)) )
+;w2 = where( abs(h-1.) eq min(abs(h-1.)) )
+;print, w2(0), w(0)
+;x(i) = (p0 / pt[w2(0),w(0)])^r_cp
+;y(i) = t[w2(0),w(0)]
+;print, h[w2]
+;stop
+
+;ye=smooth(DERIV(localtime, smooth(t_bot,smoothampl,/EDGE_TRUNCATE)),smoothampl,/EDGE_TRUNCATE)
+;ye=DERIV(localtime, t_bot)
+;w3 = where(localtime eq 13.) ;;11. flat!
+;y(i) = ye[w3]
+
+endfor
+print, x2
+print, y2
+fit  = LINFIT(x ,y )
+print, fit
+fit2 = LINFIT(x2,y2)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+file='./data_hinson' & header='' & nlines_header=0 & ncol = 7
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+nlines = FILE_LINES(file)-nlines_header & data=FLTARR(ncol,nlines)
+OPENR, lun, file, /GET_LUN & READF, lun, data & CLOSE, lun & FREE_LUN, lun
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+alt = reform(data(5,*)) - reform(data(3,*))		;; altitude
+xdata = (exp(alt/10.))^r_cp				;; p/p0 with assumed scale height
+ydata = reform(data(6,*))				;; potential temperature
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ydata2 = reform(data(5,*));reform(data(3,*));reform(data(5,*))  				;; altitude of the top of the boundary layer zt
+xdata2 = reform(data(6,*))	                        ;; potential temperature
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+data = 0.
+fitdata  = LINFIT(xdata ,ydata )
+fitdata2 = LINFIT(xdata2,ydata2)
+;fitdata2 = POLY_FIT(xdata2,ydata2,2)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+set_name      =  saveplot+'comp_EXN.ps'
+set_title     =  ""
+set_titlex    =  'Base Exner function P!U-1!N=(p!D0!N/p!Db!N)!UR/cp!N'
+set_titley    =  'Base potential temperature T!Db!N (K)'
+set_subtitle  =  ''
+set_xrange    =  [0.90,1.25]
+set_yrange    =  [210.,265.]
+;set_xrange    =  [0.90,1.10]
+;set_yrange    =  [210.,250.]
+	;set_xrange    =  [0.80,1.20]
+	;set_yrange    =  [2.,5.]
+        ;set_xrange    =  [0.80,1.20]
+        ;set_yrange    =  [180.,230.]
+set_tickx     =  0.05
+set_ticky     =  5.
+wherex	      =  1.00
+wherey        =  220.	
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then PS_Start, FILENAME=set_name
+!P.Charsize = 1.2
+altlin=0
+dddy = (set_yrange(1) - set_yrange(0))/20.
+dddx = (set_xrange(1) - set_xrange(0))/20.
+
+!p.multi=[0,2,1]
+
+set_title='LES results. T!Db!N = '+string(fit(1), '(F5.1)')+' P!U-1!N + '+string(fit(0), '(F5.1)')
+                plot, $
+set_xrange, fit[1]*set_xrange + fit[0], linestyle=0, $
+                xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, $
+                ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, $
+                 title=set_title, subtitle=set_subtitle, color=0
+for i=0, n_elements(paths)-1 do xyouts, x(i), y(i), shorttt(i)
+;		xyouts, $
+;wherex, wherey, 'squares : data. T!Db!N = '+string(fitdata(1), '(F6.2)')+' P!U-1!N + '+string(fitdata(0), '(F6.2)')
+;                xyouts, $
+;wherex, wherey-dddy, 'triangles : LES. T!Db!N = '+string(fit(1), '(F6.2)')+' P!U-1!N + '+string(fit(0), '(F6.2)')
+
+set_title='RO data. T!Db!N = '+string(fitdata(1), '(F5.1)')+' P!U-1!N + '+string(fitdata(0), '(F5.1)')
+                plot, $
+set_xrange, fitdata[1]*set_xrange + fitdata[0], $
+                xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, $
+                ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, $
+                 title=set_title, subtitle=set_subtitle, color=0, linestyle=1
+                oplot, $
+xdata, ydata, psym=6
+;                oplot, $
+;x, y, psym=5
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then PS_End, /PNG
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+fit 	= fit2
+x	= x2
+y	= y2
+fitdata	= fitdata2
+xdata 	= xdata2 
+ydata 	= ydata2  
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+set_name      =  saveplot+'comp_ZTOP.ps'
+set_title     =  "Absolute altitude of the BL top z!Dt!N (km)"
+set_titlex    =  'Base potential temperature T!Db!N (K)'
+set_titley    =  'Absolute altitude of the BL top (km)'
+set_subtitle  =  ''
+set_xrange    =  [150.,280.] ;[200.,265.]
+set_yrange    =  [-8.,25.]   ;[-4.,20.]
+set_tickx     =  10.
+set_ticky     =  2.
+wherex        =  205.
+wherey        =  17.0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then PS_Start, FILENAME=set_name
+!P.Charsize = 1.2
+altlin=0
+dddy = (set_yrange(1) - set_yrange(0))/20.
+dddx = (set_xrange(1) - set_xrange(0))/20.
+;yeye = set_xrange[0] + (set_xrange[1]-set_xrange[0])*findgen(100.)/99.
+                plot, $
+set_xrange, fitdata[1]*set_xrange + fitdata[0], $
+;yeye, fitdata[2]*yeye^2 + fitdata[1]*yeye + fitdata[0], $
+                xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, $
+                ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, $
+                 title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+                oplot, $
+xdata, ydata, psym=6
+                oplot, $
+x, y, psym=5
+                oplot, $
+set_xrange, fit[1]*set_xrange + fit[0], linestyle=1
+                xyouts, $
+wherex, wherey, 'squares : data.  z!Dt!N  =  ('+strtrim(string(fitdata(1)),1)+')  T!Db!N + ('+strtrim(string(fitdata(0)),1)+')'
+                xyouts, $
+wherex, wherey-dddy, 'triangles : model. z!Dt!N  =  ('+strtrim(string(fit(1)),1)+')  T!Db!N + ('+strtrim(string(fit(0)),1)+')'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then PS_End, /PNG
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+no_therm:
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/extract_turb
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/extract_turb	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/extract_turb	(revision 207)
@@ -0,0 +1,24 @@
+#! /bin/bash
+
+
+ycoord=20
+
+
+#echo coord
+#ncrcat -O -v HGT,XLAT,XLONG 	-d Time,0,0,1 		     ../wrfout*   coord.nc
+
+#echo v
+#ncrcat -O -v V     -d south_north_stag,${ycoord},${ycoord},1 ./wrfout*   v${ycoord}.nc
+
+#echo u
+#ncrcat -O -v U     -d south_north,${ycoord},${ycoord},1      ./wrfout*   u${ycoord}.nc
+#echo w
+#ncrcat -O -v W     -d south_north,${ycoord},${ycoord},1      ./wrfout*   w${ycoord}.nc
+#echo p
+#ncrcat -O -v PTOT  -d south_north,${ycoord},${ycoord},1      ./wrfout*   p${ycoord}.nc
+#echo ph
+#ncrcat -O -v PHTOT -d south_north,${ycoord},${ycoord},1      ./wrfout*  ph${ycoord}.nc
+echo t
+ncrcat -O -v T     -d south_north,${ycoord},${ycoord},1      ./wrfout*   t${ycoord}.nc
+
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/extract_turb2
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/extract_turb2	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/extract_turb2	(revision 207)
@@ -0,0 +1,24 @@
+#! /bin/bash
+
+
+#ycoord=20
+#ycoord=30
+
+#echo coord
+#ncrcat -O -v HGT,XLAT,XLONG 	-d Time,0,0,1 		     ../wrfout*   coord.nc
+
+echo v
+#ncrcat -O -v V     ./wrfout*   v${ycoord}.nc
+
+echo u
+#ncrcat -O -v U     ./wrfout*   u${ycoord}.nc
+echo w
+#ncrcat -O -v W     ./wrfout*   w${ycoord}.nc
+echo p
+ncrcat -O -v PTOT  ./wrfout*   p${ycoord}.nc
+echo ph
+ncrcat -O -v PHTOT ./wrfout*  ph${ycoord}.nc
+echo t
+ncrcat -O -v T     ./wrfout*   t${ycoord}.nc
+
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/fonc2.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/fonc2.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/fonc2.pro	(revision 207)
@@ -0,0 +1,11 @@
+function fonc2, x, p
+
+y = p(0) * x^(2./3.) * ( 1. - p(1) * x + p(2) )^2
+ 
+y = p(0) * x^(2./3.) * ( p(2) - p(1) * x )^2
+
+y = p(0) * x^(2./3.) * ( 1. - p(1) * x )^2
+
+
+return, y
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/generate_datafile.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/generate_datafile.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/generate_datafile.pro	(revision 207)
@@ -0,0 +1,85 @@
+;pro try
+
+
+restore, filename='getturb.dat'
+
+;;wt, tke, ztke, h, ht, t, p, pt, stst, localtime, xtke, ytke, wmax, wmin, depressions, psmin, filename='getturb.dat'
+
+
+nz = n_elements(wt(*,0))
+nt = n_elements(wt(0,*))
+
+;
+; nz: colonnes
+; nt: lignes
+;
+
+openw, lun, 'LES_MERIDIANI_vert_levels.txt', /GET_LUN
+printf, lun, h, format='(F12.6)'
+close, lun
+free_lun, lun
+
+openw, lun, 'LES_MERIDIANI_local_times.txt', /GET_LUN
+printf, lun, localtime, format='(F12.6)'
+close, lun
+free_lun, lun
+
+openw, lun, 'LES_MERIDIANI_TKE.txt', /GET_LUN
+printf, lun, tke, format='('+string(nz,'(I0)')+'F12.6)'
+close, lun
+free_lun, lun
+
+openw, lun, 'LES_MERIDIANI_xTKE.txt', /GET_LUN
+printf, lun, xtke, format='('+string(nz,'(I0)')+'F12.6)'
+close, lun
+free_lun, lun
+
+openw, lun, 'LES_MERIDIANI_yTKE.txt', /GET_LUN
+printf, lun, ytke, format='('+string(nz,'(I0)')+'F12.6)'
+close, lun
+free_lun, lun
+
+openw, lun, 'LES_MERIDIANI_zTKE.txt', /GET_LUN
+printf, lun, ztke, format='('+string(nz,'(I0)')+'F12.6)'
+close, lun
+free_lun, lun
+
+openw, lun, 'LES_MERIDIANI_Wmax.txt', /GET_LUN
+printf, lun, wmax, format='('+string(nz,'(I0)')+'F12.6)'
+close, lun
+free_lun, lun
+
+openw, lun, 'LES_MERIDIANI_Wmin.txt', /GET_LUN
+printf, lun, wmin, format='('+string(nz,'(I0)')+'F12.6)'
+close, lun
+free_lun, lun
+
+openw, lun, 'LES_MERIDIANI_Tpot.txt', /GET_LUN
+printf, lun, t, format='('+string(nz,'(I0)')+'F12.6)'
+close, lun
+free_lun, lun
+
+restore, filename='addturb.dat'
+openw, lun, 'LES_MERIDIANI_VELmax.txt', /GET_LUN
+printf, lun, VELMAX, format='('+string(nz,'(I0)')+'F12.6)'
+close, lun
+free_lun, lun
+
+
+
+;yeye = fltarr(nz,nt)
+;openr, lun, 'LES_MERIDIANI_Tpot.txt', /GET_LUN
+;readf, lun, yeye
+;close, lun
+;free_lun, lun
+;contour, transpose(yeye), nlevels=20
+
+yeye2 = fltarr(nz,nt)
+openr, lun, 'LES_MERIDIANI_TKE.txt', /GET_LUN
+readf, lun, yeye2
+close, lun
+free_lun, lun
+contour, transpose(yeye2), nlevels=20
+
+
+;end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/getcdf.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/getcdf.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/getcdf.pro	(revision 207)
@@ -0,0 +1,15 @@
+pro getcdf, $
+	file=file, $
+	charvar=charvar, $
+	invar=invar	
+
+T = SYSTIME(1)
+
+cdfid = ncdf_open(file)
+varid=ncdf_varid(cdfid,charvar)
+ncdf_varget, cdfid, varid, invar
+
+print, 'got '+charvar+' in '+file+' within ', SYSTIME(1) - T, ' seconds'
+
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/getget.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/getget.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/getget.pro	(revision 207)
@@ -0,0 +1,1 @@
+link ../getget.pro
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/getget2d.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/getget2d.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/getget2d.pro	(revision 207)
@@ -0,0 +1,121 @@
+function getget2d, name, charvar, count=count, offset=offset, stride=stride, coordmean=coordmean, anomaly=anomaly
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; name: char
+; charvar: char
+; count: 4 elements array   ; The dimensions of the sub-image
+; offset: 4 elements array  ; A variable that contains the offset for the sub-image
+; stride: 4 elements array  ; Create a variable to be used as a value for the STRIDE keyword
+; coordmean: 1 to 4 elements array (dimension 1 is 1)
+; anomaly: a non-null element that would be filled with mean
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+nosave = 1  ;; comment to get an IDL data file
+notime = 1  ;; comment to get mention of time taken
+if (n_elements(notime) eq 0) then timetime = SYSTIME(1)
+
+;
+; MINIMAL ARGUMENTS
+;
+if (n_elements(name) eq 0) then stop
+if (n_elements(charvar) eq 0) then stop
+
+;
+; IDL DATA DIRECTORY
+;
+name_idl = charvar+name+'.idl'
+  if (n_elements(coordmean) ne 0) then begin
+    nc = n_elements(coordmean)
+    for i=0,nc-1 do begin
+     name_idl = string(coordmean(i),'(I0)')+name_idl   
+    endfor
+  endif
+name_idl = './idl_dat/'+name_idl
+
+;
+; TEST IF FILE EXISTS
+;
+openr,unit,name_idl,/get_lun,error=err
+
+;
+; IF IDL FILE EXISTS, THAT IS RATHER SIMPLE
+;
+IF (err EQ 0) THEN BEGIN
+
+   print, 'read from file'
+   free_lun,unit
+   restore, filename=name_idl
+
+;
+; IF IDL FILE DOES NOT EXIST, WELL, READ NETCDF
+;
+ENDIF ELSE BEGIN
+
+  ;
+  ; check save directory
+  ;
+  if (n_elements(nosave) eq 0) then SPAWN, 'mkdir -p idl_dat'  
+
+  ;
+  ; open file
+  ;
+  id=ncdf_open(name) 
+
+  ;
+  ; get dimensions
+  ;
+  var = intarr(3)
+  NCDF_DIMINQ, id, NCDF_DIMID(id, 'west_east'    ), toto, titi & var(0) = titi
+  NCDF_DIMINQ, id, NCDF_DIMID(id, 'south_north'  ), toto, titi & var(1) = titi 
+  NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time'         ), toto, titi & var(2) = titi 
+  ;print, var
+
+  ;
+  ; define default data windows
+  ;
+  if (n_elements(offset) le 3) then offset=[0,0,0]
+  if (n_elements(stride) le 3) then stride=[1,1,1]
+  if (n_elements(count) le 3) then count=intarr(3)
+  w = where(count eq 0) & if (w(0) ne -1) then count[w] = var[w] / stride[w]
+
+  ;
+  ; read variable
+  ;
+  varid=ncdf_varid(id,charvar) ;& print, 'get '+charvar 
+  if (n_elements(notime) eq 0) then timetime = SYSTIME(1) ;& help, /memory
+  ncdf_varget, id, varid, invar, count=count, offset=offset, stride=stride & if (n_elements(notime) eq 0) then print, SYSTIME(1) - timetime, ' s' ;& help, /memory
+  ncdf_close, id
+
+  ;
+  ; OPTIONAL: ANOMALY (value is returned in the keyword)
+  ; 
+  if (n_elements(anomaly) ne 0) then begin
+    anomaly=TOTAL(TOTAL(invar,1),1)/float(var[0])/float(var[1])
+    for i=0,var[0]-1 do for j=0,var[1]-1 do invar(i,j,*) = TEMPORARY(invar(i,j,*)) - anomaly  ; coute cher
+  endif
+
+  ;
+  ; OPTIONAL: MEAN 
+  ;
+  if (n_elements(coordmean) ne 0) then begin
+  for i=0,nc-1 do begin
+   print, 'mean over dimension '+string(coordmean(i),'(I0)')+' - '+string(var(coordmean(i)),'(I0)')+' elements'
+   invar=total(TEMPORARY(invar),coordmean(i))/var(coordmean(i))
+  endfor
+  endif
+
+  ;
+  ; SAVE
+  ;
+  if (n_elements(nosave) eq 0) then save, invar, filename=name_idl
+
+ENDELSE
+
+if (n_elements(notime) eq 0) then print, SYSTIME(1) - timetime, ' s'
+
+;
+; RETURN FIELD
+;
+return, invar
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/getturb.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/getturb.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/getturb.pro	(revision 207)
@@ -0,0 +1,1001 @@
+pro getturb, saveps=saveps, noplot=noplot
+
+;----------------------------------
+; USE: getturb
+;      getturb, saveps='false'     
+;----------------------------------
+
+history_interval_s = 400.
+history_interval_s = 100.
+smoothampl=3700/history_interval_s
+;smoothampl=0.  ;; no smooth
+;smoothampl=10.
+smoothampl=2.
+;smoothampl=5.
+
+;;
+;; constantes
+;;
+p0=610. & t0=220. & r_cp=1.0/4.4 & grav=3.72 & R=192.
+;p0=610. & t0=220. & r_cp=1.0/3.9 & grav = 3.72 & R=191.
+;print, 'ATTENTION ATTENTION R/cp !!!!', r_cp 
+
+;
+; graphics definition
+;
+if (n_elements(saveps) eq 0) then saveps='true'
+if (n_elements(noplot) eq 0) then noplot='false'
+if (saveps eq 'false') then begin
+   ;!p.multi=[0,3,2] 
+   !P.CHARSIZE=2.
+   WINDOW, /PIXMAP & WDELETE & DEVICE,BYPASS_TRANSLATION=0,DECOMPOSED=0,RETAIN=2
+endif else begin
+   ;PREF_SET, 'IDL_PATH', '/home/spiga/Save/SOURCES/IDL/fsc_psconfig:<IDL_DEFAULT>', /COMMIT
+   PREF_SET, 'IDL_PATH', '/home/spiga/SVN/trunk/mesoscale/PLOT/MINIMAL:<IDL_DEFAULT>', /COMMIT
+endelse
+
+;
+; retrieve fields
+;
+openr,unit,'getturb.dat',/get_lun,error=err
+IF (err ne 0) THEN BEGIN
+
+;
+; input files
+;
+OPENR, 22, 'input_coord' & READF, 22, lonu & READF, 22, latu & READF, 22, lsu & READF, 22, lctu & CLOSE, 22
+OPENR, 23, 'input_more' & READF, 23, hgtu, tsurfu & CLOSE, 23
+
+;
+; get fields
+;
+domain='d01' & filesWRF = FindFile('wrfout_'+domain+'_????-??-??_??:??:??') & nf=n_elements(filesWRF)
+
+
+; get dimensions
+;
+id=ncdf_open(filesWRF(0))
+NCDF_DIMINQ, id, NCDF_DIMID(id, 'west_east'    ), toto, nx & NCDF_DIMINQ, id, NCDF_DIMID(id, 'south_north'  ), toto, ny
+NCDF_DIMINQ, id, NCDF_DIMID(id, 'bottom_top'   ), toto, nz & NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time'         ), toto, nt
+NCDF_CLOSE, id 
+id=ncdf_open(filesWRF(nf-1))  ;; for interrupted runs
+NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time'         ), toto, ntlast
+NCDF_CLOSE, id
+
+;
+; prepare loop
+;
+;nloop1 = nf-1 & nloop2 = nt & yeye = 0 
+yeye = 0 & nttot = (nf-1)*nt + ntlast
+
+localtime = lctu + history_interval_s*findgen(nttot)/3700.
+
+wt  = fltarr(nz,nttot) & tke = fltarr(nz,nttot) & ztke = fltarr(nz,nttot) & t = fltarr(nz,nttot)
+p = fltarr(nz) & ph = fltarr(nz) & pht = fltarr(nz,nttot) & pt = fltarr(nz,nttot) & stst = fltarr(nz,nttot)
+xtke = fltarr(nz,nttot) & ytke = fltarr(nz,nttot) & wmax = fltarr(nz,nttot) & wmin = fltarr(nz,nttot)
+depressions = fltarr(nttot) & psmin = fltarr(nttot)
+
+;
+; loop loop
+;
+for loop  = 0, nf-1 do begin
+                                          timetime = SYSTIME(1)
+  if (loop ne nf-1) then nloop2=nt else nloop2=ntlast
+
+for loop2 = 0, nloop2-1 do begin
+
+   anomalt = 1. & anomalu = 1. & anomalv = 1.
+	;print, loop, loop2
+
+   ; ------------
+   ; t' = t - <t>
+   ; ------------
+ tprime = getget(filesWRF(loop), 'T', anomaly=anomalt, count=[0,0,0,1], offset=[0,0,0,loop2])  ;; t' = t - <t>
+ t(*,yeye) = t0 + TEMPORARY(anomalt)
+   ; ------
+   ; w' = w   
+   ; ------
+ wprime = getget(filesWRF(loop), 'W', count=[0,0,0,1], offset=[0,0,0,loop2])     
+ 	for toto = 0, nz-1 do begin
+ 		wmax(toto,yeye) = max(reform(wprime(*,*,toto,0)),min=tutu) & wmin(toto,yeye) = tutu 
+ 	endfor
+;   ; ------
+;   ; u' = u and v' = v   (car PAS de background wind !)
+;   ; ------
+; uprime = getget(filesWRF(loop), 'U', count=[0,0,0,1], offset=[0,0,0,loop2])
+; vprime = getget(filesWRF(loop), 'V', count=[0,0,0,1], offset=[0,0,0,loop2])
+   ; --------------------------------------------------------
+   ; tke = 0.5 ( <u'^2> + <v'^2> + <w'^2> ) ; u' = u ; v' = v  
+   ; --------------------------------------------------------
+   ; ztke is 0.5 * <w'^2>/2 or 0.5 * sigma_w^2 
+ ztke(*,yeye) = 0.5 * TOTAL(TOTAL(wprime^2,1),1) / float(nx) / float(ny)
+ xtke(*,yeye) = 0.5 * TOTAL(TOTAL(getget(filesWRF(loop), 'U', anomaly=anomalu, count=[0,0,0,1], offset=[0,0,0,loop2])^2,1),1) / float(nx) / float(ny)
+ ytke(*,yeye) = 0.5 * TOTAL(TOTAL(getget(filesWRF(loop), 'V', anomaly=anomalv, count=[0,0,0,1], offset=[0,0,0,loop2])^2,1),1) / float(nx) / float(ny)
+; xtke(*,yeye) = 0.5 * TOTAL(TOTAL(uprime^2,1),1) / float(nx) / float(ny)
+; ytke(*,yeye) = 0.5 * TOTAL(TOTAL(vprime^2,1),1) / float(nx) / float(ny)
+  tke(*,yeye) = xtke(*,yeye) + $
+                ytke(*,yeye) + $
+                ztke(*,yeye)
+   ; ------
+   ; <w't'>
+   ; ------
+ wt(*,yeye)  = TOTAL(TOTAL(TEMPORARY(tprime)  * TEMPORARY(wprime),1),1) / float(nx) / float(ny)  
+   ; ------
+   ; p & ph
+   ; ------
+ ;if (loop + loop2 eq 0) then nloopbeware = nloop2-1 else nloopbeware = nloop2  ; 1ere valeur vaut 0
+ nttotbeware = nttot-1 ; 1ere valeur vaut 0
+ pht(*,yeye) = TOTAL(TOTAL(getget(filesWRF(loop), 'PHTOT',  count=[0,0,0,1], offset=[0,0,0,loop2]),1),1) / float(nx) / float(ny) / 1000. / 3.72
+ pt(*,yeye)  = TOTAL(TOTAL(getget(filesWRF(loop), 'PTOT' ,  count=[0,0,0,1], offset=[0,0,0,loop2]),1),1) / float(nx) / float(ny)
+ ph = TEMPORARY(ph) + pht(*,yeye) / nttotbeware ;/ nloopbeware / nloop1
+ p  = TEMPORARY(p ) + pt(*,yeye) / nttot ;/ nloop2 / nloop1
+   ; ----------------
+   ; static stability
+   ; ----------------
+ stst(*,yeye) = DERIV( reform(pht(*,yeye)) - hgtu/1000. , reform(t(*,yeye)) * ( reform(pt(*,yeye)) /p0 )^r_cp ) + 1000.*grav / (R / r_cp)  ;; 4.9 dans Hinson
+   ; ----------------
+   ; surface pressure
+   ; ----------------
+ !QUIET=1
+ ;psfc = getget(filesWRF(loop), 'PSFC', anomaly=1, count=[0,0,0,1], offset=[0,0,0,loop2])   ;; plus rapide que autre routine! pas grave avertissement
+ psfc = getget(filesWRF(loop), 'PSFC', count=[0,0,0,1], offset=[0,0,0,loop2])
+ !QUIET=0
+; psfc = getget2d(filesWRF(loop), 'PSFC', anomaly=1, count=[0,0,1], offset=[0,0,loop2]) 
+ psmin(yeye) = min(psfc) ;& print, psmin(yeye)
+ w = where(TEMPORARY(psfc) lt -0.5) ;& print, n_elements(w)
+ if (w(0) ne -1) then depressions(yeye) = 1000. * n_elements(w) / float(nx) / float(ny) else depressions(yeye) = 0.
+   ; ----------
+   ; loop count
+   ; ----------
+ yeye = TEMPORARY(yeye) + 1 ;& print, yeye & print, SYSTIME(1) - timetime, ' s'  
+
+endfor
+                                          print, 'file '+string(loop+1,'(I0)'), SYSTIME(1) - timetime, ' s'
+endfor
+h  = TEMPORARY(ph)  - hgtu/1000.  ;; altitude above ground
+ht = TEMPORARY(pht) - hgtu/1000.  
+;
+; save
+;
+save, wt, tke, ztke, h, ht, t, p, pt, stst, localtime, xtke, ytke, wmax, wmin, depressions, psmin, filename='getturb.dat'
+nz = n_elements(h)
+nnn = n_elements(tke(0,*))
+
+ENDIF ELSE BEGIN
+
+print, 'OK, file is here'
+restore, filename='getturb.dat'
+nz = n_elements(h)
+nnn = n_elements(tke(0,*))
+
+OPENR, 23, 'input_more' & READF, 23, hgtu, tsurfu & CLOSE, 23
+
+;@include_ustar.pro
+
+;@include_hfx.pro
+
+;@include_w.pro
+
+;@include_tprime.pro
+
+ENDELSE
+
+;
+; pbl height
+;
+pbl_height = fltarr(nnn) & hfsurf = fltarr(nnn) & w_star = fltarr(nnn) & hfbot = fltarr(nnn) & w_star_bot = fltarr(nnn) & hfbotmax = fltarr(nnn)
+a_vel = fltarr(nz,nnn) & a_h = fltarr(nz,nnn) & a_wt = fltarr(nz,nnn) & a_vel_bot = fltarr(nz,nnn) & a_wt_bot = fltarr(nz,nnn)
+tt_top = fltarr(nnn) & z_top = fltarr(nnn) & t_bot = fltarr(nnn) & p_bot = fltarr(nnn)
+tt_bot = fltarr(nnn)
+wmaxmax = fltarr(nnn)
+wminmin = fltarr(nnn)
+tkemax = fltarr(nnn)
+
+for i=1, nnn-1 do begin    ;; ne pas traiter l'init 
+
+	  ;
+	  ; pbl height
+	  ;
+          z_in = reform(ht(*,i)) 
+          profile_in = reform(stst(*,i))   ;; wt pas suffisamment regulier
+          resol = 1000  ;200 un peu juste
+         	  ;********************************************************************
+	          ; ---- numerical recipes in C - section 3.3 ----
+	          ;
+	          ; Calculate interpolating cubic spline 
+	                yspline = SPL_INIT(z_in,profile_in)
+	          ; Define the X values P at which we desire interpolated Y values
+	                xspline=min(z_in)+findgen(floor(max(z_in))*resol)/resol
+	          ; Calculate the interpolated Y values
+	                result=spl_interp(z_in,profile_in,yspline,xspline)
+	          ;********************************************************************
+	  w = where( (result ge 1.5) and (xspline gt 0.01) ) ;0.3) )   ;0.1 suffit si HR
+	  ;if ( localtime(i) gt 16. ) then w = where( (result ge 1.5) and (xspline gt 2.) )
+
+	if ( localtime(i) gt 15. ) then w = where( (result ge 1.5) and (xspline gt 1.) )  
+
+	;;;; special tau = 5.
+	;if ( localtime(i) ge 13. ) then w = where( (result ge 1.5) and (xspline gt 0.35) )
+	;if ( localtime(i) ge 16.05 ) then w = [0]
+
+	  pbl_height(i) = xspline(w(0)) ;& print, 'PBL height - mean profile', pbl_height(i)
+	  z_top(i) = xspline(w(0)) + hgtu/1000.
+
+          ;
+          ; temperature @ pbl height
+          ;
+          z_in = reform(ht(*,i))
+          profile_in = reform(t(*,i))   
+	  ;profile_in = reform(t(*,i))*(reform(pt(*,i))/p0)^r_cp
+	  profile_in2 = reform(pt(*,i))
+          resol = 1000  ;200 un peu juste
+                  ;********************************************************************
+                  ; ---- numerical recipes in C - section 3.3 ----
+                  ;
+                  ; Calculate interpolating cubic spline 
+                        yspline = SPL_INIT(z_in,profile_in)
+			yspline2 = SPL_INIT(z_in,profile_in2)
+                  ; Define the X values P at which we desire interpolated Y values
+                        xspline=min(z_in)+findgen(floor(max(z_in))*resol)/resol
+                  ; Calculate the interpolated Y values
+                        result=spl_interp(z_in,profile_in,yspline,xspline)
+			result2=spl_interp(z_in,profile_in2,yspline2,xspline)
+                  ;********************************************************************
+          w = where( abs(xspline-pbl_height(i)) eq min(abs(xspline-pbl_height(i))) ) & tt_top(i) = result[w(0)]*(result2[w(0)]/p0)^r_cp ;& print, z_top(i), t_top(i)
+	  hhh = 1000. / 1000. ;100. / 1000.
+	  w = where( abs(xspline-hhh) eq min(abs(xspline-hhh)) ) & t_bot(i) = result[w(0)] & p_bot(i) = result2[w(0)] ;& print, p_bot(i), t_bot(i)
+	  tt_bot(i) = result[w(0)]*(result2[w(0)]/p0)^r_cp
+
+	  ;
+          ; heat flux at the "surface" 
+	  ;
+	  hfsurf(i) = wt(1,i)           ;; attention vaut 0 a la hauteur 0
+
+          ;
+          ; heat flux at the bottom of mixed layer = top of radiative layer
+          ;
+          z_in = reform(ht(*,i)) 
+          profile_in = reform(wt(*,i))   ;; wt pas suffisamment regulier
+          resol = 1000  ;200 un peu juste
+                  ;********************************************************************
+                  ; ---- numerical recipes in C - section 3.3 ----
+                  ;
+                  ; Calculate interpolating cubic spline 
+                        yspline = SPL_INIT(z_in,profile_in)
+                  ; Define the X values P at which we desire interpolated Y values
+                        xspline=min(z_in)+findgen(floor(max(z_in))*resol)/resol
+                  ; Calculate the interpolated Y values
+                        result=spl_interp(z_in,profile_in,yspline,xspline)
+                  ;********************************************************************
+	  hhh = 300./1000. & yeah=where(abs(xspline-hhh) eq (min(abs(xspline-hhh)))) & nnzz=yeah(0) & hfbot(i)=result(nnzz)  ;; 300m semble OK, 500m super
+	  w=where(xspline lt 1.5) & result=result[w] & xspline=xspline[w] & yeah=where(result eq max(result)) & nnzz=yeah(0) & hfbotmax(i)=result(nnzz)  
+	  ;print, 'surf, 300m, max   ', hfsurf(i), hfbot(i), hfbotmax(i) ;& plot, result, xspline
+
+result = reform(wmax(*,i)) & yeah=where(result eq max(result)) & nnzz=yeah(0) & wmaxmax(i)=result(nnzz)
+result = reform(wmin(*,i)) & yeah=where(result eq min(result)) & nnzz=yeah(0) & wminmin(i)=result(nnzz)
+result = reform(tke(*,i))  & yeah=where(result eq max(result)) & nnzz=yeah(0) & tkemax(i )=result(nnzz)
+
+	  ;
+	  ; free convection velocity scale
+	  ;
+;	  w_star_bot(i) = ( 1000.* grav * pbl_height(i) * hfbot(i) / t(0,i) ) ^ (1./3.)   
+          w_star_bot(i) = ( 1000.* grav * pbl_height(i) * hfbotmax(i) / t(0,i) ) ^ (1./3.)
+          w_star(i) 	= ( 1000.* grav * pbl_height(i) * hfsurf(i) / t(0,i) ) ^ (1./3.)     
+
+	  ;
+	  ; dimensional quantities
+   	  ;
+	  a_vel(*,i) 		= reform( 2.*ztke(*,i) / w_star(i)^2 )
+          a_vel_bot(*,i) 	= reform( 2.*ztke(*,i) / w_star_bot(i)^2 )
+	  a_h(*,i) 	= reform( ht(*,i) / pbl_height(i) )
+	  a_wt(*,i) 	= reform( wt(*,i) / hfsurf(i) )		;reform( wt(*,i) / w_star(i) )
+	  a_wt_bot(*,i) = reform( wt(*,i) / hfbotmax(i) )	;reform( wt(*,i) / w_star_bot(i) )
+
+endfor
+	  ;
+	  ; free convection time scale
+	  ;
+	  fcts = 1000. * pbl_height / w_star / 3700.
+	  ;
+	  ; mixed layer temperature scale
+	  ;
+ 	  mlts = hfsurf / w_star 
+
+;pbl_height 	= SMOOTH(TEMPORARY(pbl_height), [smoothampl], /EDGE_TRUNCATE)
+;hfsurf 	= SMOOTH(TEMPORARY(hfsurf), 	[smoothampl], /EDGE_TRUNCATE)
+;w_star 	= SMOOTH(TEMPORARY(w_star), 	[smoothampl], /EDGE_TRUNCATE)
+;hfbot 		= SMOOTH(TEMPORARY(hfbot), 	[smoothampl], /EDGE_TRUNCATE)
+;w_star_bot 	= SMOOTH(TEMPORARY(w_star_bot), [smoothampl], /EDGE_TRUNCATE)
+;hfbotmax 	= SMOOTH(TEMPORARY(hfbotmax), 	[smoothampl], /EDGE_TRUNCATE)
+;a_vel 		= SMOOTH(TEMPORARY(a_vel), 	[0,smoothampl], /EDGE_TRUNCATE)
+;a_h 		= SMOOTH(TEMPORARY(a_h), 	[0,smoothampl], /EDGE_TRUNCATE)
+;a_wt 		= SMOOTH(TEMPORARY(a_wt), 	[0,smoothampl], /EDGE_TRUNCATE)
+;a_vel_bot 	= SMOOTH(TEMPORARY(a_vel_bot), 	[0,smoothampl], /EDGE_TRUNCATE)
+;a_wt_bot 	= SMOOTH(TEMPORARY(a_wt_bot), 	[0,smoothampl], /EDGE_TRUNCATE)
+;tt_top		= SMOOTH(TEMPORARY(tt_top), 	[smoothampl], /EDGE_TRUNCATE)
+;z_top          = SMOOTH(TEMPORARY(z_top),   	[smoothampl], /EDGE_TRUNCATE)
+;t_bot          = SMOOTH(TEMPORARY(t_bot),   	[smoothampl], /EDGE_TRUNCATE)
+;p_bot          = SMOOTH(TEMPORARY(p_bot),   	[smoothampl], /EDGE_TRUNCATE)
+
+;
+; save for comparison sake
+;
+save, pbl_height, hfbot, hfsurf, w_star, w_star_bot, a_vel_bot, a_vel, a_h, a_wt_bot, a_wt, fcts, mlts, hfbotmax, tt_top, z_top, t_bot, p_bot, tt_bot, wmaxmax, wminmin, tkemax, filename='compturb.dat'
+if (noplot ne 'false') then stop
+
+;
+; smooth smooth
+;
+wt  = SMOOTH(TEMPORARY(wt),  [0,smoothampl], /EDGE_TRUNCATE)
+tke = SMOOTH(TEMPORARY(tke), [0,smoothampl], /EDGE_TRUNCATE)
+ztke = SMOOTH(TEMPORARY(ztke), [0,smoothampl], /EDGE_TRUNCATE)
+xtke = SMOOTH(TEMPORARY(xtke), [0,smoothampl], /EDGE_TRUNCATE)
+ytke = SMOOTH(TEMPORARY(ytke), [0,smoothampl], /EDGE_TRUNCATE)
+wmax = SMOOTH(TEMPORARY(wmax), [0,smoothampl], /EDGE_TRUNCATE)
+wmin = SMOOTH(TEMPORARY(wmin), [0,smoothampl], /EDGE_TRUNCATE)
+depressions = SMOOTH(TEMPORARY(depressions), [smoothampl], /EDGE_TRUNCATE)
+psmin = SMOOTH(TEMPORARY(psmin), [smoothampl], /EDGE_TRUNCATE)
+
+
+;*******************;
+;*******************;
+; PLOTS PLOTS PLOTS ;
+;*******************;
+;*******************;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zefield       =  a_vel_bot 
+;;zey           =  a_h  
+;;set_name      =  'A_VEL.ps'
+;;set_title     =  "Scaled vertical velocity variance (m.s!U-1!N)"
+;;set_titlex    =  'Scaled vertical velocity variance (m.s!U-1!N)'
+;;set_titley    =  'Scaled height (km)'
+;;set_subtitle  =  ''
+;;set_xrange    =  [0.,1.2]
+;;set_yrange    =  [0.,1.2]
+;;set_tickx     =  0.1
+;;set_ticky     =  0.1
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zesim = 1.8 * a_h^(2./3.) * ( 1. - 0.8 * a_h )^2
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;localtimes = localtime[where( (localtime ge 11) and (localtime le 16) )]
+;;;localtimes = localtime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;;!P.Charsize = 1.2
+;;altlin=0
+;;user_lt=localtimes[0] & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt)))) & nntt = yeah(0)
+;;plot, zefield(*,nntt), zey(*,nntt), xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin, /ISOTROPIC
+;;for ll = 1, n_elements(localtimes)-1 do begin
+;;  user_lt=localtimes[ll] & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt)))) & nntt = yeah(0)
+;;  if (nntt ne -1) then oplot, zefield(*,nntt), zey(*,nntt), linestyle=altlin
+;;endfor
+;;loadct, 33 & oplot, zesim, zey, psym=5, color=255 & loadct, 0 
+;;if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zefield       =  localtime
+;zey           =  pbl_height
+;set_name      =  'HEIGHT.ps'
+;set_title     =  'Boundary layer height (km)'
+;set_titlex    =  'Local Time (h)'
+;set_titley    =  'Boundary layer height (km)'
+;set_subtitle  =  '' ;'Criterion is : static stability > 1.5 K.m!U-1!N'
+;set_xrange    =  [11.,17.] ;[8.,17.]
+;set_yrange    =  [0.,8.]
+;set_tickx     =  1.
+;set_ticky     =  1.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;!P.Charsize = 1.2
+;plot, zefield, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;;oplot, zefield, zey, psym=5
+;if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zefield       =  localtime
+;;zey           =  w_star_bot
+;;set_name      =  'W_STAR.ps'
+;;set_title     =  "Free convection velocity scale (m.s!U-1!N)"
+;;set_titlex    =  'Local Time (h)'
+;;set_titley    =  'Free convection velocity scale (m.s!U-1!N)'
+;;set_subtitle  =  ''
+;;set_xrange    =  [8.,18.]
+;;set_yrange    =  [0.,6.]
+;;set_tickx     =  1.
+;;set_ticky     =  0.5
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;;!P.Charsize = 1.2
+;;plot, zefield, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;;;oplot, zefield, zey, psym=5
+;;if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zefield       =  localtime
+;;zey           =  hfbot
+;;zey2	      =  hfsurf	
+;;zey3          =  hfbotmax
+;;set_name      =  'HFBOT.ps'
+;;set_title     =  "Heat flux at the top of the radiative layer (K.m.s!U-1!N)"
+;;set_titlex    =  'Local Time (h)'
+;;set_titley    =  'Heat flux at the top of the radiative layer (K.m.s!U-1!N)'
+;;set_subtitle  =  ''
+;;set_xrange    =  [8.,18.]
+;;set_yrange    =  [0.,2.5]
+;;set_tickx     =  1.
+;;set_ticky     =  0.5
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;;!P.Charsize = 1.2
+;;plot, zefield, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;;oplot, zefield, zey2, linestyle=1
+;;oplot, zefield, zey3, linestyle=2
+;;if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zefield       =  transpose(tke) 
+;zex           =  localtime 
+;zey           =  h
+;set_name      =  'TKE.ps'
+;set_title     =  "Turbulent Kinetic Energy (m!U2!N.s!U-2!N)" ;0.5[<u'!U2!N>+<v'!U2!N>+<w'!U2!N>]
+;set_titlex    =  'Local Time (h)'
+;set_titley    =  'Altitude above surface (km)'
+;set_subtitle  =  '' ;'Mean over the simulation domain'
+;set_xrange    =  [11.,17.] ;[8.,17.]
+;set_yrange    =  [0.,8.]  ;; [0.,200.]
+;set_tickx     =  1.
+;set_ticky     =  1. ;; 50.
+;minval        =  0.
+;maxval        =  20.
+;nlev          =  maxval-minval
+;pal           =  22
+;rrr           =  'no'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;!P.Charsize = 1.2
+;;; 0. levels
+;lev = minval + (maxval-minval)*findgen(nlev+1)/float(nlev) & if (minval ne 0.) then lev = lev[where(lev ne 0.)]
+;;;; 1. background
+;loadct, 0 & contour, /NODATA, zefield, zex, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0 
+;  ;; 2. color field
+;  loadct, pal & if (rrr eq 'yes') then TVLCT, r, g, b, /Get & if (rrr eq 'yes') then TVLCT, Reverse(r), Reverse(g), Reverse(b) 
+;              contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /overplot, /cell_fill
+;;; 3. contour field
+;loadct, 0 & contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /noerase, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, C_LINESTYLE = (lev LT 0.0)
+;;; 4. choose output
+;if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zefield       =  2.*transpose(ztke)
+;;set_title     =  "Vertical wind variance (m!U2!N.s!U-2!N)"
+;;minval        =  -6.
+;;maxval        =  12.
+;;pal           =  0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zefield       =  transpose(ztke)
+;zex           =  localtime
+;zey           =  h
+;set_name      =  'zTKE.ps'
+;set_title     =  "Vertical Turbulent Kinetic Energy (m!U2!N.s!U-2!N)" ;0.5[<w'!U2!N>]
+;set_titlex    =  'Local Time (h)'
+;set_titley    =  'Altitude above surface (km)'
+;set_subtitle  =  '' ;'Mean over the simulation domain'
+;set_xrange    =  [8.,17.]
+;set_yrange    =  [0.,7.]
+;set_tickx     =  1.
+;set_ticky     =  1.
+;minval        =  0.
+;maxval        =  8.
+;nlev          =  maxval-minval
+;pal           =  22
+;rrr           =  'no'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;!P.Charsize = 1.2
+;;; 0. levels
+;lev = minval + (maxval-minval)*findgen(nlev+1)/float(nlev) & if (minval ne 0.) then lev = lev[where(lev ne 0.)]
+;;;; 1. background
+;loadct, 0 & contour, /NODATA, zefield, zex, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0
+;;; 2. color field
+;loadct, pal & if (rrr eq 'yes') then TVLCT, r, g, b, /Get & if (rrr eq 'yes') then TVLCT, Reverse(r), Reverse(g), Reverse(b)
+;            contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /overplot, /cell_fill
+;;; 3. contour field
+;loadct, 0 & contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /noerase, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, C_LINESTYLE = (lev LT 0.0)
+;;; 4. choose output
+;if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;restore, filename='addturb.dat'
+;;modvar = SMOOTH(TEMPORARY(modvar),  [0,smoothampl], /EDGE_TRUNCATE)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zefield       =  transpose(modvar)
+;;zex           =  localtime
+;;zey           =  h
+;;set_name      =  'modvar.ps'
+;;set_title     =  "Horizontal wind speed variance (m!U2!N.s!U-2!N)"
+;;set_titlex    =  'Local Time (h)'
+;;set_titley    =  'Altitude above surface (km)'
+;;set_subtitle  =  '' ;'Mean over the simulation domain'
+;;set_xrange    =  [7.,17.]
+;;set_yrange    =  [0.,7.]
+;;set_tickx     =  1.
+;;set_ticky     =  1.
+;;minval        =  0.
+;;maxval        =  10.
+;;nlev          =  maxval-minval
+;;pal           =  22
+;;rrr           =  'no'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;;!P.Charsize = 1.2
+;;;; 0. levels
+;;lev = minval + (maxval-minval)*findgen(nlev+1)/float(nlev) & if (minval ne 0.) then lev = lev[where(lev ne 0.)]
+;;;;; 1. background
+;;loadct, 0 & contour, /NODATA, zefield, zex, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0
+;;;; 2. color field
+;;loadct, pal & if (rrr eq 'yes') then TVLCT, r, g, b, /Get & if (rrr eq 'yes') then TVLCT, Reverse(r), Reverse(g), Reverse(b)
+;;            contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /overplot, /cell_fill
+;;;; 3. contour field
+;;loadct, 0 & contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /noerase, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, C_LINESTYLE = (lev LT 0.0)
+;;;; 4. choose output
+;;if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zefield       =  transpose(wt)
+;zex           =  localtime
+;zey           =  h
+;set_name      =  'HF.ps'
+;set_title     =  "Turbulent Heat Flux (K.m.s!U-1!N)"  ;"Vertical Eddy Heat Flux <w'T'>" ;<w'!7h!3'>
+;set_titlex    =  'Local Time (h)'
+;set_titley    =  'Altitude above surface (km)'
+;set_subtitle  =  '' ;'Mean over the simulation domain'
+;set_xrange    =  [8.,17.]
+;set_yrange    =  [0.,8.]  ;; [0.,200.]
+;set_tickx     =  1.
+;set_ticky     =  1. ;; 50.
+;minval        =  -1.5 ;-2.
+;maxval        =  2.5  ;2.
+;nlev          =  floor(maxval-minval)*10
+;pal           =  33  
+;rrr           =  'no'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;minval        =  -0.8
+;;maxval        =  1.2
+;;pal           =  0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;!P.Charsize = 1.2
+;;; 0. levels
+;lev = minval + (maxval-minval)*findgen(nlev+1)/float(nlev) & if (minval ne 0.) then lev = lev[where(lev ne 0.)]
+;;;; 1. background
+;loadct, 0 & contour, /NODATA, zefield, zex, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0
+;;; 2. color field
+;loadct, pal & if (rrr eq 'yes') then TVLCT, r, g, b, /Get & if (rrr eq 'yes') then TVLCT, Reverse(r), Reverse(g), Reverse(b)
+;            ;;;--------------------------------------------------------------------------------------------------------------------------------
+;            ;;; WHITE ZONE - 1. get location of interval in the CT - 2. change the CT to have a white zone
+;            ulim=0.09 & dlim=-0.09 & w=where(lev le dlim) & n1=w[n_elements(w)-1] & w=where(lev ge ulim) & n2=w[0] & yy=BYTSCL(lev) & nd=yy[n1] & nu=yy[n2]-5
+;            nu = nd + (nu-nd)/2  ;; otherwise the interval is too large (because we removed 0)
+;            TVLCT, r, g, b, /Get & r[nd:nu]=255 & g[nd:nu]=255 & b[nd:nu]=255 & TVLCT, r, g, b
+;            ;;;--------------------------------------------------------------------------------------------------------------------------------
+;            contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /overplot, /cell_fill
+;;; 3. contour field
+;loadct, 0 & contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /noerase, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, C_LINESTYLE = (lev LT 0.0)
+;;; 4. choose output
+;if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;restore, filename='tpot_profB'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zefield       =  t
+;;zey           =  ht 
+;;set_name      =  'T.ps'
+;;set_title     =  "Potential Temperature (K)"
+;;set_titlex    =  'Potential Temperature (K)'
+;;set_titley    =  'Altitude above surface (km)'
+;;set_subtitle  =  '' ;'Mean over the simulation domain'
+;;set_xrange    =  [190.,230.] ;[min(t),max(t)]
+;;set_yrange    =  [0.,7.]
+;;set_tickx     =  5.
+;;set_ticky     =  1.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;localtimes = [9,10,11,12,13,14,15,16,17,18]
+;;localtimes = [7,9,11,13,15,17]
+;;;localtimes = [17.0,17.1,17.2,17.3,17.4,17.5,17.6,17.7,17.8,17.9,18.0]
+;;;localtimes = [15.0]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;;!P.Charsize = 1.2
+;;;altlin=0 & loadct, 0
+;;altlin=1 & loadct, 0
+;;user_lt=localtimes[0] & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt)))) & nntt = yeah(0)
+;;plot, zefield(*,nntt), zey(*,nntt), xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;;;plot, zefield(*,nntt), les_column, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;;for ll = 1, n_elements(localtimes)-1 do begin
+;;  CASE altlin OF
+;;  0: altlin=1
+;;  1: altlin=0
+;;  ENDCASE  
+;;  user_lt=localtimes[ll] & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt)))) & nntt = yeah(0)
+;;  if (nntt ne -1) then oplot, zefield(*,nntt), zey(*,nntt), linestyle=altlin
+;;;  if (nntt ne -1) then oplot, zefield(*,nntt), les_column, linestyle=altlin
+;;endfor
+;;;oplot, ro_tpot, ro_column, psym=7
+;;;xyouts, 192.0, 0.25, '09:00'
+;;;xyouts, 205.5, 0.25, '11:00'
+;;;xyouts, 214.5, 0.25, '13:00'
+;;;xyouts, 219.5, 0.25, '17:00'
+;;;xyouts, 220.5, 2.30, '17:00 [RO]'
+;;if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zefield       =  stst
+;;zey           =  ht 
+;;set_name      =  'STST.ps'
+;;set_title     =  "Static stability (K.m!U-1!N)"
+;;set_titlex    =  'Static stability (K.m!U-1!N)'
+;;set_titley    =  'Altitude above surface (km)'
+;;set_subtitle  =  'Mean over the simulation domain'
+;;set_xrange    =  [-5.,5.]
+;;set_yrange    =  [0.,7.]
+;;set_tickx     =  1.
+;;set_ticky     =  1.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;localtimes = [9,11,13,15,17]
+;;localtimes = [12,13,14,15,16]
+;;;localtimes = [17.0,17.1,17.2,17.3,17.4,17.5,17.6,17.7,17.8,17.9,18.0]
+;;;localtimes = [15.0]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;;!P.Charsize = 1.2
+;;altlin=0 & loadct, 0
+;;user_lt=localtimes[0] & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt)))) & nntt = yeah(0)
+;;plot, zefield(*,nntt), zey(*,nntt), xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;;oplot, zefield(*,nntt), zey(*,nntt), psym=5
+;;for ll = 1, n_elements(localtimes)-1 do begin
+;;  CASE altlin OF
+;;  0: altlin=1 
+;;  1: altlin=0
+;;  ENDCASE
+;;  user_lt=localtimes[ll] & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt)))) & nntt = yeah(0)
+;;  if (nntt ne -1) then oplot, zefield(*,nntt), zey(*,nntt), linestyle=altlin
+;;  if (nntt ne -1) then oplot, zefield(*,nntt), zey(*,nntt), psym=5
+;;endfor
+;;oplot, 0.*zefield(*,nntt) + 1.5, zey(*,nntt), linestyle=2  
+;;if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;
+;
+;if (n_elements(xtke) eq 0) then stop
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;zefield       =  2.*transpose(xtke)
+;;;minval        =  -4
+;;;maxval        =  8. ;12.
+;;;pal           =  0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zex           =  localtime
+;;zey           =  h
+;;set_name      =  'xTKE.ps'
+;;set_title     =  "Horizontal Turbulent Kinetic Energy (m!U2!N.s!U-2!N)" ;0.5[<u'!U2!N>]
+;;set_titlex    =  'Local Time (h)'
+;;set_titley    =  'Altitude above surface (km)'
+;;set_subtitle  =  '';'Mean over the simulation domain'
+;;set_xrange    =  [8.,17.]
+;;set_yrange    =  [0.,7.] 
+;;set_tickx     =  1.
+;;set_ticky     =  1.
+;;minval        =  0.
+;;maxval        =  8. 
+;;nlev          =  maxval-minval
+;;pal           =  22
+;;rrr           =  'no'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;;!P.Charsize = 1.2
+;;;; 0. levels
+;;lev = minval + (maxval-minval)*findgen(nlev+1)/float(nlev) & if (minval ne 0.) then lev = lev[where(lev ne 0.)]
+;;;;; 1. background
+;;loadct, 0 & contour, /NODATA, zefield, zex, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0
+;;;; 2. color field
+;;loadct, pal & if (rrr eq 'yes') then TVLCT, r, g, b, /Get & if (rrr eq 'yes') then TVLCT, Reverse(r), Reverse(g), Reverse(b)
+;;            contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /overplot, /cell_fill
+;;;; 3. contour field
+;;loadct, 0 & contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /noerase, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, C_LINESTYLE = (lev LT 0.0)
+;;;; 4. choose output
+;;if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zefield       =  transpose(ytke) + transpose(xtke)
+;zex           =  localtime
+;zey           =  h
+;set_name      =  'hTKE.ps'
+;set_title     =  "Horizontal Turbulent Kinetic Energy (m!U2!N.s!U-2!N)" ;0.5[<v'!U2!N>]
+;set_titlex    =  'Local Time (h)'
+;set_titley    =  'Altitude above surface (km)'
+;set_subtitle  =  '' ;'Mean over the simulation domain'
+;set_xrange    =  [8.,17.]
+;set_yrange    =  [0.,1.] ;[0.,7.] ;; [0.,200.]
+;set_tickx     =  1.
+;set_ticky     =  0.1 ;1. ;50.
+;minval        =  0.
+;maxval        =  12. ;10.
+;nlev          =  maxval-minval
+;pal           =  22
+;rrr           =  'no'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;!P.Charsize = 1.2
+;;; 0. levels
+;lev = minval + (maxval-minval)*findgen(nlev+1)/float(nlev) & if (minval ne 0.) then lev = lev[where(lev ne 0.)]
+;;;; 1. background
+;loadct, 0 & contour, /NODATA, zefield, zex, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0
+;;; 2. color field
+;loadct, pal & if (rrr eq 'yes') then TVLCT, r, g, b, /Get & if (rrr eq 'yes') then TVLCT, Reverse(r), Reverse(g), Reverse(b)
+;            contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /overplot, /cell_fill
+;;; 3. contour field
+;loadct, 0 & contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /noerase, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, C_LINESTYLE = (lev LT 0.0)
+;;; 4. choose output
+;if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;if (n_elements(wmax) eq 0) then stop
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+zefield       =  transpose(wmax)
+zex           =  localtime
+zey           =  h
+set_name      =  'Wmax.ps'
+set_title     =  "Maximum updraft speed (m.s!U-1!N)"
+set_titlex    =  'Local Time (h)'
+set_titley    =  'Altitude above surface (km)'
+set_subtitle  =  ''
+set_xrange    =  [11.,17.] ;[8.,18.]
+set_yrange    =  [0.,8.] ;[0.,8.]
+set_tickx     =  1.
+set_ticky     =  1.
+minval        =  0.
+maxval        =  18. ;16. ;15.;14.;13.
+nlev          =  maxval-minval
+pal           =  22
+rrr           =  'no'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then PS_Start, FILENAME=set_name
+!P.Charsize = 1.2
+;; 0. levels
+lev = minval + (maxval-minval)*findgen(nlev+1)/float(nlev) & if (minval ne 0.) then lev = lev[where(lev ne 0.)]
+levhalf = minval + (maxval-minval)*findgen((nlev/2)+1)/float(nlev/2) & if (minval ne 0.) then levhalf = levhalf[where(levhalf ne 0.)]
+;;; 1. background
+loadct, 0 & contour, /NODATA, zefield, zex, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0
+  ;; 2. color field
+  loadct, pal & if (rrr eq 'yes') then TVLCT, r, g, b, /Get & if (rrr eq 'yes') then TVLCT, Reverse(r), Reverse(g), Reverse(b)
+              contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /overplot, /cell_fill
+;; 3. contour field
+loadct, 0 & contour, zefield, zex, zey, levels=levhalf, c_labels=findgen(n_elements(levhalf))*0.+1., /noerase, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, C_LINESTYLE = (levhalf LT 0.0)
+;; 4. choose output
+if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+zefield       =  abs(transpose(wmin))
+zex           =  localtime
+zey           =  h
+set_name      =  'Wmin.ps'
+set_title     =  "Maximum downdraft speed (m.s!U-1!N)"
+set_titlex    =  'Local Time (h)'
+set_titley    =  'Altitude above surface (km)'
+set_subtitle  =  ''
+set_xrange    =  [11.,17.] ;[8.,18.]
+set_yrange    =  [0.,8.]
+set_tickx     =  1.
+set_ticky     =  1.
+minval        =  0.
+maxval        =  10.;12.
+nlev          =  maxval-minval
+pal           =  22
+rrr           =  'no' ;'yes'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then PS_Start, FILENAME=set_name
+!P.Charsize = 1.2
+;; 0. levels
+lev = minval + (maxval-minval)*findgen(nlev+1)/float(nlev) & if (minval ne 0.) then lev = lev[where(lev ne 0.)]
+levhalf = minval + (maxval-minval)*findgen((nlev/2)+1)/float(nlev/2) & if (minval ne 0.) then levhalf = levhalf[where(levhalf ne 0.)]
+;;; 1. background
+loadct, 0 & contour, /NODATA, zefield, zex, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0
+;; 2. color field
+loadct, pal & if (rrr eq 'yes') then TVLCT, r, g, b, /Get & if (rrr eq 'yes') then TVLCT, Reverse(r), Reverse(g), Reverse(b)
+            contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /overplot, /cell_fill
+;; 3. contour field
+loadct, 0 & contour, zefield, zex, zey, levels=levhalf, c_labels=findgen(n_elements(levhalf))*0.+1., /noerase, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, C_LINESTYLE = (levhalf LT 0.0)
+;; 4. choose output
+if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;
+;restore, filename='addturb.dat'
+;velmax = SMOOTH(TEMPORARY(velmax),  [0,smoothampl], /EDGE_TRUNCATE)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zefield       =  transpose(velmax)
+;zex           =  localtime
+;zey           =  h
+;set_name      =  'velmax.ps'
+;set_title     =  "Maximum horizontal wind speed (m.s!U-1!N)"
+;set_titlex    =  'Local Time (h)'
+;set_titley    =  'Altitude above surface (km)'
+;set_subtitle  =  '' ;'Mean over the simulation domain'
+;set_xrange    =  [11.,17.] ;[8.,17.]
+;set_yrange    =  [0.,4.]
+;set_tickx     =  1.
+;set_ticky     =  1.
+;minval        =  0.
+;maxval        =  30. ;12.
+;nlev          =  maxval-minval
+;pal           =  22
+;rrr           =  'no'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;!P.Charsize = 1.2
+;;; 0. levels 
+;lev = minval + (maxval-minval)*findgen(nlev+1)/float(nlev) & if (minval ne 0.) then lev = lev[where(lev ne 0.)]
+;;;; 1. background
+;loadct, 0 & contour, /NODATA, zefield, zex, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0
+;;;; 2. color field
+;loadct, pal & if (rrr eq 'yes') then TVLCT, r, g, b, /Get & if (rrr eq 'yes') then TVLCT, Reverse(r), Reverse(g), Reverse(b)
+;            contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /overplot, /cell_fill
+;;; 3. contour field
+;loadct, 0 & contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /noerase, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, C_LINESTYLE = (lev LT 0.0)
+;;; 4. choose output
+;if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;zefield       =  localtime
+;;zey           =  depressions 
+;;set_name      =  'DEPR.ps'
+;;set_title     =  "Percentage of depressions in the domain"
+;;set_titlex    =  'Local Time (h)'
+;;set_titley    =  'Percentage'
+;;set_subtitle  =  ''
+;;set_xrange    =  [8.,18.]
+;;set_yrange    =  [0.,3.]
+;;set_tickx     =  1.
+;;set_ticky     =  1.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;if (saveps eq 'true') then PS_Start, FILENAME=set_name
+;;!P.Charsize = 1.2
+;;plot, zefield, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, linestyle=altlin
+;;oplot, zefield, zey, psym=5
+;;	oplot, localtime, abs(psmin), linestyle=1
+;;if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+stop
+
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+goto, no_staticstab
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then begin
+  device, /close
+  set_plot, 'ps' & device, filename='plot/staticstab.ps'
+endif
+
+user_lt=17. & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+
+   ;;; recompute height @ given local time 
+   caca=heightp+hgtu/1000.
+   height=reform(ph(*,0,*,*))
+   height=total(height,1)/n_elements(height(*,0,0))
+   height=reform(height)
+   height=reform(height(*,yeah(0)))
+   height=height/1000./3.72
+   heightp=height(0:n_elements(height(*))-2) 
+   print, 'new minus old', heightp - caca
+   ;;; recompute height @ given local time 
+
+        press=reform(p(*,0,*,*))
+        press=total(press,1)/n_elements(press(*,0,0))
+        press=reform(press)
+        press=reform(press(*,yeah(0)))
+        press=press(0:n_elements(press(*))-2)
+
+staticstab = DERIV( heightp , reform(what_I_plot5(*,yeah(0))) ) + 1000.*3.72/844.6  ;; 4.9 dans Hinson
+   staticstab = staticstab(0:n_elements(staticstab)-5)
+   heightp = heightp(0:n_elements(heightp)-5)
+
+plot, $
+        staticstab, $
+        heightp,$
+        xtitle='Static stability (K/km)',$
+        xrange=[-1.,5.], $
+        xtickinterval=0.5, $
+        ytitle='Altitude above surface (km)', $
+        yrange=[min(heightp),max(heightp)], $
+        ytickinterval=1., $
+        title="LMD LES Static stability @ LT 17h (K/km)", $
+        subtitle='zonal average at lat. '+latwrite
+oplot, $
+        staticstab, $
+        heightp,$
+        psym=5
+oplot, $
+       findgen(n_elements(heightp))*0. + 1.,$
+       heightp,$
+       linestyle=2
+oplot, $
+       findgen(n_elements(heightp))*0. + 2.,$
+       heightp,$
+       linestyle=2
+
+;;;;;;;;;;
+w = where((staticstab gt 1.5) and ((heightp- hgtu/1000.) gt 1.))
+t_top_plus = what_I_plot5(w(0),yeah(0))
+z_top_plus = heightp(w(0))
+p_top_plus = press(w(0))
+t_top_moins = what_I_plot5(w(0)-1,yeah(0))
+z_top_moins = heightp(w(0)-1)
+p_top_moins = press(w(0)-1)
+pbl_depth = (z_top_plus*alog(p_top_plus) + z_top_moins*alog(p_top_moins))/(alog(p_top_plus) + alog(p_top_moins)) - hgtu/1000.
+xyouts, 3., 1.5 + (max(heightp) + min(heightp)) / 3., 'Ls = '+string(lsu,'(F5.1)')+'!Uo!N', CHARSIZE=1
+xyouts, 3., 1. + (max(heightp) + min(heightp)) / 3., 'Lat = '+string(latu,'(F5.1)')+'!Uo!N', CHARSIZE=1
+xyouts, 3., 0.5 + (max(heightp) + min(heightp)) / 3., 'LonE = '+string(lonu,'(F6.1)')+'!Uo!N', CHARSIZE=1
+xyouts, 3., (max(heightp) + min(heightp)) / 3., 'T!Dt!N = '+string(t_top_plus,'(I0)')+'/'+string(t_top_moins,'(I0)')+' K ', CHARSIZE=1
+xyouts, 3., -0.5 + (max(heightp) + min(heightp)) / 3., 'p!Dt!N = '+string(p_top_plus,'(I0)')+'/'+string(p_top_moins,'(I0)')+' Pa', CHARSIZE=1
+xyouts, 3., -1. + (max(heightp) + min(heightp)) / 3., 'z!Dt!N = '+string(z_top_plus,'(F4.1)')+'/'+string(z_top_moins,'(F4.1)')+' km', CHARSIZE=1
+xyouts, 3., -1.5 + (max(heightp) + min(heightp)) / 3., 'z!Ds!N = '+string(hgtu/1000.,'(F4.1)')+' km', CHARSIZE=1
+xyouts, 3., -2. + (max(heightp) + min(heightp)) / 3., 'D = '+string(pbl_depth,'(F4.1)')+' km', CHARSIZE=1
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+no_staticstab:
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then begin
+  device, /close
+endif
+stop
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+user_lt=13.
+yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+
+user_h=0.1
+walt=where(abs(heightp-user_h) eq (min(abs(heightp-user_h))))
+
+;mapfield=reform(t[*,*,walt(0),w(0)])
+;help, mapfield
+;contour, mapfield
+
+section=reform(w[*,0,*,yeah(0)])
+
+section=reform(w[*,0,*,160])
+
+lev=[-12.,-8.,-4.,4.,8.,12.]
+lev=[-5.,-4.,-3.,-2.,-1.,1.,2.,3.,4.,5.]
+contour, $
+	section, $
+	(lon(*,0)-lon(0,0))*59., $
+	heightp, $
+	levels=lev , $
+	C_LINESTYLE = (lev LT 0.0)
+
+device, /close
+
+end
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/include_hfx.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/include_hfx.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/include_hfx.pro	(revision 207)
@@ -0,0 +1,32 @@
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+        OPENR, 22, 'input_coord' & READF, 22, lonu & READF, 22, latu & READF, 22, lsu & READF, 22, lctu & CLOSE, 22
+        OPENR, 23, 'input_more' & READF, 23, hgtu, tsurfu & CLOSE, 23
+        domain='d01' & filesWRF = FindFile('wrfout_'+domain+'_????-??-??_??:??:??') & nf=n_elements(filesWRF)
+        id=ncdf_open(filesWRF(0))
+                NCDF_DIMINQ, id, NCDF_DIMID(id, 'west_east'    ), toto, nx & NCDF_DIMINQ, id, NCDF_DIMID(id, 'south_north'  ), toto, ny
+                NCDF_DIMINQ, id, NCDF_DIMID(id, 'bottom_top'   ), toto, nz & NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time'         ), toto, nt
+                NCDF_CLOSE, id
+        id=ncdf_open(filesWRF(nf-1))  ;; for interrupted runs
+                NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time'         ), toto, ntlast
+                NCDF_CLOSE, id
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+        yeye = 0 & nttot = (nf-1)*nt + ntlast & localtime = lctu + history_interval_s*findgen(nttot)/3700.
+        velmax = fltarr(nz,nttot) & velmin = fltarr(nz,nttot)
+        ustarm = fltarr(nttot) & ustarmax = fltarr(nttot)
+        for loop  = 0, nf-1 do begin
+                                                  timetime = SYSTIME(1)
+          if (loop ne nf-1) then nloop2=nt else nloop2=ntlast
+        for loop2 = 0, nloop2-1 do begin
+!QUIET=1
+ustar = getget(filesWRF(loop), 'HFX', count=[0,0,0,1], offset=[0,0,0,loop2])
+ustarmax(yeye) = max(reform(ustar(*,*,0,0)))
+ustarm(yeye) = reform(TOTAL(TOTAL(TEMPORARY(ustar),1),1) / float(nx) / float(ny))
+print, ustarm(yeye), ustarmax(yeye)
+!QUIET=0
+        yeye = TEMPORARY(yeye) + 1
+        endfor
+        endfor
+        save, ustarm, localtime, filename='addturb.dat' ;; pour l'instant ecrase systematiquement
+        stop
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/include_tprime.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/include_tprime.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/include_tprime.pro	(revision 207)
@@ -0,0 +1,116 @@
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+        OPENR, 22, 'input_coord' & READF, 22, lonu & READF, 22, latu & READF, 22, lsu & READF, 22, lctu & CLOSE, 22
+        OPENR, 23, 'input_more' & READF, 23, hgtu, tsurfu & CLOSE, 23
+        domain='d01' & filesWRF = FindFile('wrfout_'+domain+'_????-??-??_??:??:??') & nf=n_elements(filesWRF)
+        id=ncdf_open(filesWRF(0))
+                NCDF_DIMINQ, id, NCDF_DIMID(id, 'west_east'    ), toto, nx & NCDF_DIMINQ, id, NCDF_DIMID(id, 'south_north'  ), toto, ny
+                NCDF_DIMINQ, id, NCDF_DIMID(id, 'bottom_top'   ), toto, nz & NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time'         ), toto, nt
+                NCDF_CLOSE, id
+        id=ncdf_open(filesWRF(nf-1))  ;; for interrupted runs
+                NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time'         ), toto, ntlast
+                NCDF_CLOSE, id
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+        yeye = 0 & nttot = (nf-1)*nt + ntlast & localtime = lctu + history_interval_s*findgen(nttot)/3700.
+        std_tprime = fltarr(nz,nttot) 
+        field = fltarr(nz,nttot)
+        anomalt = 1.
+        for loop  = 0, nf-1 do begin
+                                                  timetime = SYSTIME(1)
+          print, loop
+          if (loop ne nf-1) then nloop2=nt else nloop2=ntlast
+        for loop2 = 0, nloop2-1 do begin
+!QUIET=1
+
+ ;;;; TEMPPOT
+ ;tprime = getget(filesWRF(loop), 'T', anomaly=anomalt, count=[0,0,0,1], offset=[0,0,0,loop2])   ;; t' = t - <t>
+ ;;;; TEMP (K)
+ tempk = reform ( ( t0 + getget(filesWRF(loop), 'T', count=[0,0,0,1], offset=[0,0,0,loop2]) ) * ( getget(filesWRF(loop), 'PTOT', count=[0,0,0,1], offset=[0,0,0,loop2]) / p0 )^r_cp )
+ meanmean = reform(TOTAL(TOTAL(tempk,1),1) / float(nx) / float(ny))
+ for i=0,n_elements(tempk(*,0,0,0))-1 do for j=0,n_elements(tempk(0,*,0,0))-1 do tempk(i,j,*) = tempk(i,j,*) - meanmean
+ tprime = TEMPORARY(tempk)^2
+ 
+ std_tprime(*, yeye) = sqrt ( reform(TOTAL(TOTAL(TEMPORARY(tprime),1),1) / float(nx) / float(ny)) )
+ ;print, std_tprime(*, yeye)
+ ;print, yeye
+
+!QUIET=0
+        yeye = TEMPORARY(yeye) + 1
+        endfor
+        endfor
+        ;save, std_tprime, localtime, filename='addturb.dat' ;; pour l'instant ecrase systematiquement
+        ;stop
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+zefield       =  transpose(std_tprime)
+zex           =  localtime
+zey           =  h
+set_name      =  'std_tprime.ps'
+set_title     =  "Temperature standard deviation (K)" ;"Maximum updraft speed (m.s!U-1!N)"
+set_titlex    =  'Local Time (h)'
+set_titley    =  'Altitude above surface (km)'
+set_subtitle  =  ''
+set_xrange    =  [8.,18.]
+set_yrange    =  [0.,7.]
+set_tickx     =  1.
+set_ticky     =  1.
+minval        =  0.
+maxval        =  2. ;15.;14.;13.
+nlev          =  10 ;(maxval-minval)*10.
+pal           =  22
+rrr           =  'no'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then PS_Start, FILENAME=set_name
+!P.Charsize = 1.2
+;; 0. levels
+lev = minval + (maxval-minval)*findgen(nlev+1)/float(nlev) & if (minval ne 0.) then lev = lev[where(lev ne 0.)]
+;;; 1. background
+loadct, 0 & contour, /NODATA, zefield, zex, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0
+  ;; 2. color field
+  loadct, pal & if (rrr eq 'yes') then TVLCT, r, g, b, /Get & if (rrr eq 'yes') then TVLCT, Reverse(r), Reverse(g), Reverse(b)
+              contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /overplot, /cell_fill
+;; 3. contour field
+loadct, 0 & contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /noerase, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, C_LINESTYLE = (lev LT 0.0)
+;; 4. choose output
+if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+zefield       =  transpose(std_tprime)
+zex           =  localtime
+zey           =  h
+set_name      =  'std_tprime_ns.ps'
+set_title     =  "Temperature standard deviation (K)" ;"Maximum updraft speed (m.s!U-1!N)"
+set_titlex    =  'Local Time (h)'
+set_titley    =  'Altitude above surface (km)'
+set_subtitle  =  ''
+set_xrange    =  [8.,18.]
+set_yrange    =  [0.,1.]
+set_tickx     =  1.
+set_ticky     =  1.
+minval        =  0.
+maxval        =  2. ;15.;14.;13.
+nlev          =  10 ;(maxval-minval)*10.
+pal           =  22
+rrr           =  'no'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then PS_Start, FILENAME=set_name
+!P.Charsize = 1.2
+;; 0. levels
+lev = minval + (maxval-minval)*findgen(nlev+1)/float(nlev) & if (minval ne 0.) then lev = lev[where(lev ne 0.)]
+;;; 1. background
+loadct, 0 & contour, /NODATA, zefield, zex, zey, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0
+  ;; 2. color field
+  loadct, pal & if (rrr eq 'yes') then TVLCT, r, g, b, /Get & if (rrr eq 'yes') then TVLCT, Reverse(r), Reverse(g), Reverse(b)
+              contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /overplot, /cell_fill
+;; 3. contour field
+loadct, 0 & contour, zefield, zex, zey, levels=lev, c_labels=findgen(n_elements(lev))*0.+1., /noerase, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle, color=0, C_LINESTYLE = (lev LT 0.0)
+;; 4. choose output
+if (saveps eq 'true') then PS_End, /PNG
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+
+stop
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/include_ustar.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/include_ustar.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/include_ustar.pro	(revision 207)
@@ -0,0 +1,42 @@
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+        OPENR, 22, 'input_coord' & READF, 22, lonu & READF, 22, latu & READF, 22, lsu & READF, 22, lctu & CLOSE, 22
+        OPENR, 23, 'input_more' & READF, 23, hgtu, tsurfu & CLOSE, 23
+        domain='d01' & filesWRF = FindFile('wrfout_'+domain+'_????-??-??_??:??:??') & nf=n_elements(filesWRF)
+        id=ncdf_open(filesWRF(0))
+                NCDF_DIMINQ, id, NCDF_DIMID(id, 'west_east'    ), toto, nx & NCDF_DIMINQ, id, NCDF_DIMID(id, 'south_north'  ), toto, ny
+                NCDF_DIMINQ, id, NCDF_DIMID(id, 'bottom_top'   ), toto, nz & NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time'         ), toto, nt
+                NCDF_CLOSE, id
+        id=ncdf_open(filesWRF(nf-1))  ;; for interrupted runs
+                NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time'         ), toto, ntlast
+                NCDF_CLOSE, id
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+        yeye = 0 & nttot = (nf-1)*nt + ntlast & localtime = lctu + history_interval_s*findgen(nttot)/3700.
+        velmax = fltarr(nz,nttot) & velmin = fltarr(nz,nttot)
+        ustarm = fltarr(nttot) & ustarmax = fltarr(nttot)
+        for loop  = 0, nf-1 do begin
+                                                  timetime = SYSTIME(1)
+          if (loop ne nf-1) then nloop2=nt else nloop2=ntlast
+        for loop2 = 0, nloop2-1 do begin
+                 uprime = getget(filesWRF(loop), 'U', count=[0,0,0,1], offset=[0,0,0,loop2])
+                 vprime = getget(filesWRF(loop), 'V', count=[0,0,0,1], offset=[0,0,0,loop2])
+;
+; autre methode... ustar² = sqrt(<u'w'>s²+<v'w'>s²)
+;
+!QUIET=1
+ustar = getget(filesWRF(loop), 'USTM', count=[0,0,0,1], offset=[0,0,0,loop2])
+ustarmax(yeye) = max(reform(ustar(*,*,0,0)))
+ustarm(yeye) = reform(TOTAL(TOTAL(TEMPORARY(ustar),1),1) / float(nx) / float(ny))
+print, ustarm(yeye), ustarmax(yeye)
+!QUIET=0
+                 veltot = sqrt(uprime^2+vprime^2) ;; attention si background wind
+                        for toto = 0, nz-1 do begin
+                               velmax(toto,yeye) = max(reform(veltot(*,*,toto,0)))
+                               ;print, velmax(toto,yeye)
+                        endfor
+        yeye = TEMPORARY(yeye) + 1
+        endfor
+        endfor
+        save, ustarm, ustarmax, velmax, localtime, filename='addturb.dat' ;; pour l'instant ecrase systematiquement
+        stop
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/include_w.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/include_w.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/include_w.pro	(revision 207)
@@ -0,0 +1,40 @@
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+        OPENR, 22, 'input_coord' & READF, 22, lonu & READF, 22, latu & READF, 22, lsu & READF, 22, lctu & CLOSE, 22
+        OPENR, 23, 'input_more' & READF, 23, hgtu, tsurfu & CLOSE, 23
+        domain='d01' & filesWRF = FindFile('wrfout_'+domain+'_????-??-??_??:??:??') & nf=n_elements(filesWRF)
+        id=ncdf_open(filesWRF(0))
+                NCDF_DIMINQ, id, NCDF_DIMID(id, 'west_east'    ), toto, nx & NCDF_DIMINQ, id, NCDF_DIMID(id, 'south_north'  ), toto, ny
+                NCDF_DIMINQ, id, NCDF_DIMID(id, 'bottom_top'   ), toto, nz & NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time'         ), toto, nt
+                NCDF_CLOSE, id
+        id=ncdf_open(filesWRF(nf-1))  ;; for interrupted runs
+                NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time'         ), toto, ntlast
+                NCDF_CLOSE, id
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+        yeye = 0 & nttot = (nf-1)*nt + ntlast & localtime = lctu + history_interval_s*findgen(nttot)/3700.
+        for loop  = 0, nf-1 do begin
+                                                  timetime = SYSTIME(1)
+          if (loop ne nf-1) then nloop2=nt else nloop2=ntlast
+        for loop2 = 0, nloop2-1 do begin
+                 ;wprime = getget(filesWRF(loop), 'W', count=[0,0,0,1], offset=[0,0,0,loop2])
+
+;if (localtime(yeye) eq 11.) then begin
+if (localtime(yeye) eq 14.) then begin
+wprime = getget(filesWRF(loop), 'W', count=[0,0,0,1], offset=[0,0,0,loop2])
+print, 'save !! ', localtime(yeye)
+save, wprime, h, filename='savew'
+stop
+uprime = getget(filesWRF(loop), 'U', count=[0,0,0,1], offset=[0,0,0,loop2])
+vprime = getget(filesWRF(loop), 'V', count=[0,0,0,1], offset=[0,0,0,loop2])
+help, uprime
+help, vprime
+veltot = sqrt(uprime^2+vprime^2)
+print, 'save !! ', localtime(yeye)
+save, veltot, h, filename='saveu'
+stop
+endif
+
+        yeye = TEMPORARY(yeye) + 1
+        endfor
+        endfor
+        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/pause.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/pause.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/pause.pro	(revision 207)
@@ -0,0 +1,76 @@
+pro pause,up=up,xcrs=xcrs,ycrs=ycrs,on_screen=on_screen
+;+
+; routine:        pause
+;
+; useage:         pause
+;                 pause,up=up,xcrs=xcrs,ycrs=ycrs,on_screen=on_screen
+;
+; input:          none
+;
+; keyword input:  
+;   up
+;     if set, don't return until a upward button transition is
+;     detected.  This is useful when pause is used between plots which
+;     draw quickly.  Setting this keyword ensures that no plots are
+;     skipped but also requires that each new plot be accompanied by a
+;     downward and upward button transition.  The default is to skip
+;     to the next plot as long a mouse button is pressed down.
+;
+;
+; xcrs,ycrs
+;     pixel location to put cursor while waiting
+;
+; on_screen
+;     if set, don't pause if cursor not in plot window
+;
+; output:         none
+;
+; PURPOSE:
+;     Momentarily stop execution until a mouse key is pressed.  While
+;     in the paused state the cursor is changed to what looks like an
+;     arrow pointing down on a button.  When any of the mouse buttons
+;     are pressed the cursor returns to its original form and
+;     execution continues.
+;     
+;     PAUSE will only interrupt execution if the output device is 'X'
+;     and plot system variable !p.multi(0) eq 0.  The first condition
+;     disables PAUSE when output is directed to a postscript file.
+;     The second condition ensures that pauses occur only just before
+;     the screen is erased for a new plot.
+;     
+;     NOTE: After PAUSE returns to the calling program different
+;     actions can be performed depending on whether the left, middle
+;     or right mouse button was pressed.  Just test on the !err system
+;     variable: !err=1 => left !err=2 => middle !err=4 => right.
+;
+; COMMON BLOCKS: pause_blk
+;                       
+; EXAMPLE:        
+;
+;x=findgen(201)/10.-10. 
+;for a=-2.,2.,.1 do begin & plot,x,1/(x^2*10.^a+1),tit=string(a) & pause & end
+;
+;for a=-2.,2.,.1 do begin & plot,x,1/(x^2*10.^a+1),tit=string(a) &$
+;   pause,/u & end
+;
+;  author:  Paul Ricchiazzi                            22sep92
+;           Institute for Computational Earth System Science
+;           University of California, Santa Barbara
+;-
+
+
+if !d.name eq 'X' and !p.multi(0) eq 0 then begin
+  cursor,xw,yw,/nowait,/device
+  
+  if xw eq -1 then begin
+    if keyword_set(on_screen) then return
+    if n_elements(xcrs) eq 0 then xcrs=.9*!d.x_vsize 
+    if n_elements(ycrs) eq 0 then ycrs=.9*!d.y_vsize 
+    tvcrs,xcrs,ycrs
+  endif
+  device,cursor_standard=16
+  cursor,xdum,ydum,/wait,/device
+  if keyword_set(up) then cursor,xdum,ydum,/up,/device
+  device,cursor_standard=30
+endif
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/ps_start.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/ps_start.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/ps_start.pro	(revision 207)
@@ -0,0 +1,254 @@
+;+
+; NAME:
+;   PS_START/PS_END
+;
+; PURPOSE:
+;
+;    The purpose of PS_START and PS_END is to make it easy to set-up
+;    for and close a PostScript file. The programs work in close conjunction
+;    with PSCONFIG, another program from the Coyote Library.
+;
+;    If ImageMagick  (http://www.imagemagick.org/script/index.php) is installed 
+;    on your computer, you can easily convert PostScript output to JPEG, PNG, and TIFF
+;    image output. (See the keywords to PS_END.)
+;
+; AUTHOR:
+;
+;   FANNING SOFTWARE CONSULTING
+;   David Fanning, Ph.D.
+;   1645 Sheely Drive
+;   Fort Collins, CO 80526 USA
+;   Phone: 970-221-0438
+;   E-mail: davidf@dfanning.com
+;   Coyote's Guide to IDL Programming: http://www.dfanning.com/
+;
+; CATEGORY:
+;
+;       Graphics, File Output, PostScript
+;
+; CALLING SEQUENCE:
+;
+;       PS_START
+;       Various graphics commands here...
+;       PS_END
+;
+; KEYWORD PARAMETERS FOR PS_START:
+;
+;       GUI:          The default behavior is to use PSCONFIG to configure the
+;                     PostScript device silently. If you wish to allow the user
+;                     to interatively configure the PostScript device, set this
+;                     keyword.
+;
+;       SCALE_FACTOR: Set this to the PostScript scale factor. By default: 1.
+;
+;       Any keyword supported by PSCONFIG can be used to configure the PostScript device.
+;       Common keywords would include FILENAME, XSIZE, YSIZE, XOFFSET, YOFFSET, etc. See
+;       the PSCONFIG documentation for details.
+;
+; KEYWORD PARAMETERS FOR PS_END:
+;
+;      All keywords for PS_END require that ImageMagick is installed on your computer
+;      and is configured correctly. Image conversion is done by spawning a "convert" 
+;      command to ImageMagick.
+;
+;       JPEG:         Set this keyword to convert the PostScript output file to a JPEG image.
+;       PNG:          Set this keyword to convert the PostScript output file to a PNG image.
+;       TIFF:         Set this keyword to convert the PostScript output file to a TIFF image.
+;
+; COMMON BLOCKS:
+;
+;       _$FSC_PS_START_   Contains the PS_STRUCT structure for communication between
+;                         PS_START and PS_END.
+;
+; SIDE EFFECTS:
+;
+;       When PS_START is called, the current graphics device is set to "PS" (the PostScript 
+;       device). When PS_END is called the current graphics device is returned to the device
+;       in effect when PS_START was called.
+;
+; RESTRICTIONS:
+;
+;       Requires numerous programs from the Coyote Library. To convert PostScript files
+;       to PNG, JPEG, and TIFF files requires ImageMagick be installed on your
+;       computer and configured correctly. You can download Coyote Library programs here:
+;
+;             http://www.dfanning.com/programs/coyoteprograms.zip
+;
+;       ImageMagick can be found here:
+;
+;              http://www.imagemagick.org/script/index.php
+;
+; EXAMPLE:
+;
+;       To create a line plot in a PostScript file named lineplot.ps and
+;       also create a PNG file named lineplot.png for display in a browser,
+;       type these commands.
+;
+;       PS_Start, FILENAME='lineplot.ps'
+;       Plot, Findgen(11), COLOR=FSC_Color('navy'), /NODATA, XTITLE='Time', YTITLE='Signal'
+;       OPlot, Findgen(11), COLOR=FSC_Color('indian red')
+;       OPlot, Findgen(11), COLOR=FSC_Color('olive'), PSYM=2
+;       PS_End, /PNG
+;
+; NOTES:
+;
+;       You can easily configure any modifications you like for your PostScript output
+;       by setting fields in the plot and axis system variables (!P, !X, !Y, and !Z).
+;       The modifications currently made by default in this program are these:
+;
+;          !P.Charsize = 1.5
+;          !P.Thick = 2
+;          !X.Thick = 2
+;          !Y.Thick = 2
+;          !Z.Thick = 2
+;          !P.Symsize = 1.25
+;          !P.Font = 1
+;
+; MODIFICATION HISTORY:
+;
+;       Written by: David W. Fanning, 20 May 2008.
+;-
+;
+;###########################################################################
+;
+; LICENSE
+;
+; This software is OSI Certified Open Source Software.
+; OSI Certified is a certification mark of the Open Source Initiative.
+;
+; Copyright 2008 Fanning Software Consulting.
+;
+; This software is provided "as-is", without any express or
+; implied warranty. In no event will the authors be held liable
+; for any damages arising from the use of this software.
+;
+; Permission is granted to anyone to use this software for any
+; purpose, including commercial applications, and to alter it and
+; redistribute it freely, subject to the following restrictions:
+;
+; 1. The origin of this software must not be misrepresented; you must
+;    not claim you wrote the original software. If you use this software
+;    in a product, an acknowledgment in the product documentation
+;    would be appreciated, but is not required.
+;
+; 2. Altered source versions must be plainly marked as such, and must
+;    not be misrepresented as being the original software.
+;
+; 3. This notice may not be removed or altered from any source distribution.
+;
+; For more information on Open Source Software, visit the Open Source
+; web site: http://www.opensource.org.
+;
+;###########################################################################
+PRO FSC_PS_SETUP__DEFINE
+
+    struct = { FSC_PS_SETUP, $
+               currentDevice: "", $
+               setup: 0, $
+               convert: "", $
+               filename: "", $
+               p: !P, $
+               x: !X, $
+               y: !Y, $
+               z: !Z $
+              }
+            
+END ;---------------------------------------------------------------
+
+
+
+PRO PS_END, JPEG=jpeg, PNG=png, TIFF=tiff
+
+   COMMON _$FSC_PS_START_, ps_struct
+   
+   ON_ERROR, 2 ; Return to caller.
+   
+   ; Close the PostScript file, if this is PostScript device.
+   IF !D.Name EQ 'PS' THEN Device, /CLOSE_FILE
+   
+   ; Need to convert with ImageMagick?
+   IF Keyword_Set(png) THEN ps_struct.convert = 'PNG'
+   IF Keyword_Set(jpeg) THEN ps_struct.convert = 'JPEG'
+   IF Keyword_Set(tiff) THEN ps_struct.convert = 'TIFF'
+   IF ps_struct.convert NE "" THEN BEGIN
+
+        basename = FSC_Base_Filename(ps_struct.filename, DIRECTORY=theDir, EXTENSION=theExtension)
+        CASE 1 OF
+            ps_struct.convert EQ 'PNG':  outfilename = Filepath(ROOT_DIR=theDir, basename + '.png')
+            ps_struct.convert EQ 'JPEG': outfilename = Filepath(ROOT_DIR=theDir, basename + '.jpg')
+            ps_struct.convert EQ 'TIFF': outfilename = Filepath(ROOT_DIR=theDir, basename + '.tif')
+        ENDCASE
+        IF N_Elements(outfilename) NE "" THEN BEGIN
+;            cmd = 'convert -density 300 ' + ps_struct.filename + ' -resize 25% ' + outfilename
+            cmd = 'convert -density 300 +antialias ' + ps_struct.filename + ' -resize 50% ' + outfilename
+cmd = cmd + ' ; convert '+ ps_struct.filename + ' ' + Filepath(ROOT_DIR=theDir, basename + '.eps')
+            SPAWN, cmd
+        ENDIF
+        
+   ENDIF
+   
+   ; Clean up.
+   Set_Plot, ps_struct.currentDevice
+   !P = ps_struct.p
+   !X = ps_struct.x
+   !Y = ps_struct.y
+   !Z = ps_struct.z
+   ps_struct.setup = 0
+   ps_struct.currentDevice = ""
+   ps_struct.filename = ""
+   ps_struct.convert = ""
+
+END ;---------------------------------------------------------------
+
+
+
+PRO PS_START, SCALE_FACTOR=scale_factor, GUI=gui, _EXTRA=extra
+
+   COMMON _$FSC_PS_START_, ps_struct
+   
+   ; Define the PS structure.
+   IF N_Elements(ps_struct) EQ 0 THEN ps_struct = {FSC_PS_SETUP}
+   
+   ; If the setup flag is on, then we have to close the previous
+   ; start command before we can continue.
+   IF ps_struct.setup EQ 1 THEN PS_END
+   
+   ; Save current setup information in the PS_STRUCT structure.
+   ps_struct.setup = 1
+   ps_struct.currentDevice = !D.Name
+   ps_struct.p = !P
+   ps_struct.x = !X
+   ps_struct.y = !Y
+   ps_struct.z = !Z
+   
+   ; Change any parameters you feel like changing.
+   !P.Charsize = 1.75
+   !P.Thick = 2
+   !X.Thick = 2
+   !Y.Thick = 2
+   !Z.Thick = 2
+   !P.Symsize = 1.25
+   !P.Font = 1
+   Device, Set_Font='Helvetica', /TT_FONT
+
+   ; Configure the PostScript Device
+   cancelled = 0
+   sizes = PSWindow(_Extra=extra)
+   keywords = PSConfig(_Extra=extra, INCHES=sizes.inches, XSIZE=sizes.xsize, YSIZE=sizes.ysize, $
+      XOFFSET=sizes.xoffset, YOFFSET=sizes.yoffset, Cancel=cancelled, NOGUI=(1-Keyword_Set(gui)))
+   IF cancelled THEN BEGIN
+        PS_END
+        RETURN
+   ENDIF
+   Set_Plot, 'PS'
+   Device, _EXTRA=keywords
+   
+   ; What about scale factor?
+   IF N_Elements(scale_factor) NE 0 THEN $
+        DEVICE, SCALE_FACTOR=scale_factor ELSE $
+        DEVICE, SCALE_FACTOR=1
+   
+   ; Store filename.
+   ps_struct.filename = keywords.filename
+   
+END
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/report_tasi.inc
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/report_tasi.inc	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/report_tasi.inc	(revision 207)
@@ -0,0 +1,19 @@
+
+saveplot        = './'
+cases          = ['baseline', 'hill', 'little_hill', 'realistic_extreme']
+paths           = cases
+tttitle         = cases
+tttitles        = tttitle
+shorttt         = tttitle
+
+
+;saveplot        = './'
+;cases          = ['MERIDIANI_tau050', 'MERIDIANI_tau100', 'MERIDIANI_tau200', 'MERIDIANI_tau500']
+;paths           = cases
+;tttitle         = ['tau = 0.5' $
+;                  ,'tau = 1.0' $
+;                  ,'tau = 2.0' $
+;                  ,'tau = 5.0' $
+;                  ]
+;tttitles        = tttitle
+;shorttt         = tttitle
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/report_tasi_winds.inc
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/report_tasi_winds.inc	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/report_tasi_winds.inc	(revision 207)
@@ -0,0 +1,20 @@
+saveplot        = './'
+cases           = ['../MERIDIANI_tau100' $
+                  , '../MERIDIANI_tau100_wind10' $
+                  , '../MERIDIANI_tau100_wind20' $
+;                  , '../MERIDIANI_tau500' $
+;                  , '../MERIDIANI_tau500_wind20' $
+                  , '../MERIDIANI_tau050' $
+                  , '../MERIDIANI_tau100_extreme' $
+                  ]
+paths           = cases
+tttitle         = ['tau = 1' $
+                  ,'tau = 1, wind = 10 m s!U-1!N' $
+                  ,'tau = 1, wind = 20 m s!U-1!N' $
+;                  ,'tau = 5, wind = 0 m s!U-1!N' $
+;                  ,'tau = 5, wind = 20 m s!U-1!N' $
+                  ,'tau = 0.5' $
+                  ,'tau = 1, extreme soil' $
+                  ]
+tttitles        = tttitle
+shorttt         = tttitle
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/scr
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/scr	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/scr	(revision 207)
@@ -0,0 +1,32 @@
+#! /bin/bash
+
+## use: scr U V W
+## les fichiers deja crees ne sont pas recrees
+
+## IDL remplit la memoire et devient plus lent...
+
+mean='1'
+mean='[1,2]'
+
+count='[1,1,0,0]'
+offset='[20,20,0,0]'
+
+count='0'
+offset='0'
+
+\rm log 2> /dev/null
+touch log
+
+for fich in $(ls wrfout*) ; do
+ for param in "$@" ; do
+
+  echo $param $fich
+  unset limits 
+#  echo "ye = getget('"${fich}"', '"${param}"',coordmean="$mean") & DELVAR, ye & exit" | /distrib/local/rsi/idl_6.1/bin/idl >> log 2>> log
+  echo "ye = getget('"${fich}"', '"${param}"',count="$count",offset="$offset") & DELVAR, ye & exit" | /distrib/local/rsi/idl_6.1/bin/idl >> log 2>> log
+
+ done 
+done
+
+
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/scridl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/scridl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/scridl	(revision 207)
@@ -0,0 +1,5 @@
+#! /bin/bash
+
+\rm getturb.dat 2> /dev/null
+echo "getturb & exit" | /opt/idl-6.4/idl/bin/idl > logidl 2> logidl_err &
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/similarity.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/similarity.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/similarity.pro	(revision 207)
@@ -0,0 +1,64 @@
+pro similarity
+
+!p.multi = [0,2,1]
+
+
+lim=0.30 & zelim=(-3.85/alog(lim)+0.07*alog(lim))*exp(-4.61*lim)
+up=1. & & zeup= - 1.55 * up + 1.27
+slope = (zelim - zeup) / (lim - up) & ord = zeup - slope * up
+t1 = findgen(1001.)*lim/1000. & param1 = (-3.85/alog(t1)+0.07*alog(t1))*exp(-4.61*t1)
+t2 = lim + findgen(1001.)*(1.0 - lim)/1000. & param2 = slope * t2 + ord
+;;print, slope, ' slope'
+;;print, ord, ' ord'
+;;      -1.51562 slope      1.23562 ord
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+set_title     =  "Similarity functions: vertical eddy heat flux"
+set_titlex    =  "Dimensionless vertical heat flux <w'T'>/<w'T'>!Dmax!N"
+set_titley    =  'Dimensionless height z/z!Di!N'
+set_subtitle  =  ''
+set_xrange    =  [-0.5,1.]
+set_yrange    =  [0.0,1.0]
+set_tickx     =  0.25
+set_ticky     =  0.1
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;zesim = 1 - 1.2 * a_h
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+PS_Start, FILENAME='similarity.ps'
+!P.Charsize = 1.2
+plot, param1, t1, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle;, /ISOTROPIC
+oplot, param2, t2
+oplot, [0.,0.], set_yrange, linestyle=1
+oplot, 1 - 1.2 * t1, t1, linestyle=2
+oplot, 1 - 1.2 * t2, t2, linestyle=2
+xyouts, 0.6, 0.47, 'MARS'
+xyouts, 0.25, 0.3, 'EARTH'
+;PS_End, /PNG
+
+
+t1 = findgen(2001.)*1./2000.
+param1 = 2.05 * t1^(2./3.) * ( 1. - 0.64 * t1 )^2
+param2 = 1.80 * t1^(2./3.) * ( 1. - 0.80 * t1 )^2
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+set_title     =  "Similarity functions: vert. vel. variance"
+set_titlex    =  "Dimensionless vert. vel. variance <w'!U2!N>/w!D*!N!U2!N"
+set_titley    =  'Dimensionless height z/z!Di!N'
+set_subtitle  =  ''
+set_xrange    =  [0.,1.]
+set_yrange    =  [0.0,1.0]
+set_tickx     =  0.25
+set_ticky     =  0.1
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;PS_Start, FILENAME='similarity.ps'
+!P.Charsize = 1.2
+plot, param1, t1, xtitle=set_titlex, xrange=set_xrange, xtickinterval=set_tickx, ytitle=set_titley, yrange=set_yrange, ytickinterval=set_ticky, title=set_title, subtitle=set_subtitle;, /ISOTROPIC
+oplot, param2, t1, linestyle=2
+xyouts, 0.2, 0.3, 'EARTH'
+xyouts, 0.67, 0.4, 'MARS'
+PS_End, /PNG
+
+
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/test.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/test.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/test.pro	(revision 207)
@@ -0,0 +1,123 @@
+pro test
+
+
+getcdf, $
+;        file='./wrfout_d01_9999-01-01_05:08:21', $
+        file='./wrfout_d01_9999-01-01_06:10:00', $
+;        file='./wrfout_d01_9999-01-01_07:11:40', $
+        charvar='W', $
+        invar=w
+w1 = max ( w, DIMENSION=3 )
+wm1 = min ( TEMPORARY(w), DIMENSION=3 )
+
+;getcdf, $
+;        file='./wrfout_d01_9999-01-01_06:10:00', $
+;        charvar='W', $
+;        invar=w
+;w2 = max ( w, DIMENSION=3 )
+;wm2 = min ( TEMPORARY(w), DIMENSION=3 )
+;
+;getcdf, $
+;        file='./wrfout_d01_9999-01-01_07:11:40', $
+;        charvar='W', $
+;        invar=w
+;w3 = max ( w, DIMENSION=3 )
+;wm3 = min ( TEMPORARY(w), DIMENSION=3 )
+;
+;getcdf, $
+;        file='./wrfout_d01_9999-01-01_04:06:40', $
+;        charvar='W', $
+;        invar=w
+;w4 = max ( w, DIMENSION=3 )
+;wm4 = min ( TEMPORARY(w), DIMENSION=3 )
+
+getcdf, $
+        file='./wrfout_d01_9999-01-01_06:10:00', $
+        charvar='PSFC', $
+        invar=psfc
+
+gros=50 ;20;5;10
+;gros=5 ;; pour le cas hill
+var1 = psfc[ where( w1  gt 10.) ]
+var2 = psfc
+var3 = psfc[ where( wm1  lt -5.)  ]
+;var4 = psfc[ where( w1  gt 13.) ] ;; bien mais deja montre avec courbes max
+r1 = ( float(histogram(floor(var1*gros))) ) ;/ n_elements(var1) * 100.
+r2 = ( float(histogram(floor(var2*gros))) ) ;/ n_elements(var2) * 100. 
+r3 = ( float(histogram(floor(var3*gros))) ) ;/ n_elements(var3) * 100.
+r1 = 100. * r1 / max(r1)
+r2 = 100. * r2 / max(r2)
+r3 = 100. * r3 / max(r3)
+t1 = min(var1) + findgen(n_elements(r1))/gros
+t2 = min(var2) + findgen(n_elements(r2))/gros
+t3 = min(var3) + findgen(n_elements(r3))/gros
+PS_START, file='stats_w.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+!p.psym = 10 
+plot, t2, r2, xrange=[min(t2)+(max(t2)-min(t2))/2., max(t2)], xtickinterval=1, xtitle='Surface pressure (Pa)', ytitle='Relative quantity (ratio to max value in %)';, yrange=[0,4]
+oplot, t3, r3, psym=2
+oplot, t1, r1, psym=5
+PS_END, /PNG
+
+getcdf, $
+        file='./wrfout_d01_9999-01-01_00:00:00', $
+        charvar='PSFC', $
+        invar=psfc
+
+xx=findgen(n_elements(psfc(*,0,0)))*50.
+yy=findgen(n_elements(psfc(0,*,0)))*50. 
+
+PS_START, file='psfc.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+levu=[685.,687.,689.,691.,693.,695.,697.,699.,701.,703.,705.,707.,709.,711.,713.,715.,717.,719.]
+
+psfc(0,0,1)=684.
+psfc(0,1,1)=718.
+
+loadct, 4
+contour, reform(psfc(*,*,1)), xx, yy, /cell_fill, nlevels=60, xtitle='x dimension (m)', ytitle='y dimension (m)', /isotropic, max_value=718., min_value=684.
+contour, reform(psfc(*,*,1)), xx, yy, lev=levu, c_labels=findgen(n_elements(levu))*0+1, /overplot
+PS_END, /PNG
+
+stop
+
+
+;m = max(psfc)
+;psfc = -11000. * alog ( psfc / m )
+
+PS_START, file='stats_w.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+plot, psfc, w1, psym=3, title='Maximum of vertical wind amplitude along the vertical (between LT 11 and 15)', xtitle='Surface pressure (Pa)', ytitle='Maximum vertical wind (m s!U-1!N)', yrange=[5.,20.], xrange=[685.,720.]
+oplot, psfc, w2, psym=3
+oplot, psfc, w3, psym=3
+oplot, psfc, w4, psym=3
+PS_END, /PNG
+
+PS_START, file='stats_w2.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+plot, psfc, wm1, psym=3, title='Maximum of vertical wind amplitude along the vertical (between LT 11 and 15)', xtitle='Surface pressure (Pa)', ytitle='Maximum vertical wind (m s!U-1!N)', yrange=[-12.,-4.], xrange=[685.,720.]
+oplot, psfc, wm2, psym=3
+oplot, psfc, wm3, psym=3
+oplot, psfc, wm4, psym=3
+
+PS_END, /PNG
+
+
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/tsurf.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/tsurf.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/tsurf.pro	(revision 207)
@@ -0,0 +1,28 @@
+
+domain='d01' & filesWRF = FindFile('wrfout_'+domain+'_????-??-??_??:??:??') & nf=n_elements(filesWRF)
+id=ncdf_open(filesWRF(0))
+NCDF_DIMINQ, id, NCDF_DIMID(id, 'west_east'    ), toto, nx & NCDF_DIMINQ, id, NCDF_DIMID(id, 'south_north'  ), toto, ny
+NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time'         ), toto, nt
+NCDF_CLOSE, id 
+id=ncdf_open(filesWRF(nf-1))  ;; for interrupted runs
+NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time'         ), toto, ntlast
+NCDF_CLOSE, id
+yeye = 0 & nttot = (nf-1)*nt + ntlast
+
+history_interval_s = 100.
+OPENR, 22, 'input_coord' & READF, 22, lonu & READF, 22, latu & READF, 22, lsu & READF, 22, lctu & CLOSE, 22
+
+localtime = lctu + history_interval_s*findgen(nttot)/3700.
+
+
+cdfid = ncdf_open('surf.nc')
+varid=ncdf_varid(cdfid,'TSURF')
+ncdf_varget, cdfid, varid, tsurf
+
+;print, tsurf(20,20,*)
+
+yeyey = reform(tsurf(20,20,*))
+
+w = where(yeyey eq max(yeyey))
+print, localtime[w]
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_inc.pro	(revision 207)
@@ -0,0 +1,44 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(F4.1)'
+colors        = 128
+;colors	      = 16	
+minfield_init = -8.
+maxfield_init =  12. 
+pal = 33
+	;
+	;minfield_init = -2.
+	;maxfield_init =  2.
+	;
+;minfield_init = 0.;0.1
+;maxfield_init =  1.;1.1
+;;pal           =  22;33  
+;minfield_init =  0.
+;maxfield_init =  10. 
+;pal           =  22  
+;title_user    = ''
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+flag_cb = 'true'
+windowx = [0.,20.] 
+windowy = [0.,20.] 
+intervalx = 2. 
+intervaly = 2. 
+	windowx = [0.,9.]
+	windowy = [0.,9.]
+	intervalx = 1.
+	intervaly = 1.
+;;
+        windowx = [0.,8.]
+        windowy = [6.,14.]
+        intervalx = 1.0
+        intervaly = 1.0
+;;
+title_axis = ['x-axis (km)','y-axis (km)']
+poscb = 0.70
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windex = 20 
+stride = 1
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_inc.pro.new
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_inc.pro.new	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_inc.pro.new	(revision 207)
@@ -0,0 +1,23 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(F6.2)'
+colors        = 64
+pal = 0 ;33 ;22 ;33
+minfield_init = 818.0 ;-1.5
+maxfield_init = 819.5 ;1.5
+ndiv = 6
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+flag_cb = 'true'
+windowx = [0.,3600.] 
+windowy = [0.,3600.] 
+intervalx = 600. 
+intervaly = 600. 
+title_axis = ['x-axis (m)','y-axis (m)']
+poscb = 0.72
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windex = 20 
+stride = 1
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_period.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_period.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_period.pro	(revision 207)
@@ -0,0 +1,142 @@
+pro turb_period
+;
+;
+;
+what_I_plot=0.
+overcontour=0.
+SPAWN, '\rm param_plot.idl ; cp turb_inc.pro param_plot.idl'
+;
+;
+;
+altiuser=0.5
+start_lt = 8
+zefile='turbh_period'
+;
+;
+;
+filefile = "/home/aymeric/Work/submitted/mars_journal/LMD_MM_MARS_ustar_LEScaseC.nc"
+filefile = "/home/aymeric/extract.nc"
+getcdf, file=filefile, charvar="USTM", invar=zevar
+getcdf, file=filefile, charvar="U", invar=zeu
+getcdf, file=filefile, charvar="V", invar=zev
+getcdf, file=filefile, charvar="W", invar=zew
+getcdf, file=filefile, charvar="PSFC", invar=zevar
+
+        nx = n_elements(zevar(*,0))
+        ny = n_elements(zevar(0,*))
+        ;lon = findgen(nx) / 10.
+        ;lat = findgen(ny) / 10.
+	lon = findgen(2*nx+1) / 10.
+	lat = findgen(2*ny+1) / 10.
+
+alpha=1
+nstart=195
+nend=215
+nstride=1
+	;nstart=1
+	;nend=n_elements(zevar(0,0,*))-1
+	;nstride=10
+for nt=nstart,nend,nstride do begin
+print, nt
+;
+;
+;
+  PS_Start, filename=zefile+string(1000+alpha,'(I0)')+'.ps'
+  print, zefile+'.ps'
+  ;!p.multi=[0,3,2]
+  ;!P.Charsize = 0.6
+	!P.Charsize = 1.2
+	!p.charthick = 2.0
+	!p.thick = 2.0
+	!x.thick = 2.0
+	!y.thick = 2.0
+;;
+;;
+;;
+;restore, filename='../LES/MERIDIANI_tau100/savew'
+;;restore, filename='../LES/MERIDIANI_tau100_wind10/savew'
+;;restore, filename='../LES/MERIDIANI_tau100_wind20/savew'
+;;;restore, filename='saveu'
+;indind=where(abs(h - altiuser) eq min(abs(h - altiuser)))
+;print, h(indind)
+;;
+;;
+;;
+;;what_I_plot = reform(wprime(*,*,indind))
+;what_I_plot = wprime(*,*,indind)
+;;what_I_plot = veltot(*,*,indind)
+;;contour, wprime(*,*,indind), nlevels=30
+;lon = findgen(n_elements(wprime(*,0,0))) / 10.
+;lat = findgen(n_elements(wprime(0,*,0))) / 10.
+;nx = n_elements(wprime(*,0,0))
+;ny = n_elements(wprime(0,*,0))
+
+	;;;
+	what_I_plot = reform(zevar(*,*,nt))
+        overvector_x = reform(zeu(0:nx-1,*,0,nt))	
+	overvector_y = reform(zev(*,0:ny-1,0,nt))
+	what_I_plot = reform(zew(*,*,0,nt))
+	;what_I_plot = reform(zevar(*,*,nt)) - mean(reform(zevar(*,*,nt)))
+	;;;
+
+what_I_plot_period = fltarr(2*nx+1,2*ny+1)
+what_I_plot_period(0:nx-1   ,0:ny-1   ) = what_I_plot(0:nx-1,0:ny-1)
+what_I_plot_period(nx:2*nx-1,0:ny-1   ) = what_I_plot(0:nx-1,0:ny-1)
+what_I_plot_period(0:nx-1   ,ny:2*ny-1) = what_I_plot(0:nx-1,0:ny-1)
+what_I_plot_period(nx:2*nx-1,ny:2*ny-1) = what_I_plot(0:nx-1,0:ny-1)
+what_I_plot_period(2*nx,*) = what_I_plot_period(0,*)
+what_I_plot_period(*,2*ny) = what_I_plot_period(*,0)
+what_I_plot = TEMPORARY(what_I_plot_period)
+
+overvector_x_period = fltarr(2*nx+1,2*ny+1)
+overvector_x_period(0:nx-1   ,0:ny-1   ) = overvector_x(0:nx-1,0:ny-1)
+overvector_x_period(nx:2*nx-1,0:ny-1   ) = overvector_x(0:nx-1,0:ny-1)
+overvector_x_period(0:nx-1   ,ny:2*ny-1) = overvector_x(0:nx-1,0:ny-1)
+overvector_x_period(nx:2*nx-1,ny:2*ny-1) = overvector_x(0:nx-1,0:ny-1)
+overvector_x_period(2*nx,*) = overvector_x_period(0,*)
+overvector_x_period(*,2*ny) = overvector_x_period(*,0)
+overvector_x = TEMPORARY(overvector_x_period)
+
+overvector_y_period = fltarr(2*nx+1,2*ny+1)
+overvector_y_period(0:nx-1   ,0:ny-1   ) = overvector_y(0:nx-1,0:ny-1)
+overvector_y_period(nx:2*nx-1,0:ny-1   ) = overvector_y(0:nx-1,0:ny-1)
+overvector_y_period(0:nx-1   ,ny:2*ny-1) = overvector_y(0:nx-1,0:ny-1)
+overvector_y_period(nx:2*nx-1,ny:2*ny-1) = overvector_y(0:nx-1,0:ny-1)
+overvector_y_period(2*nx,*) = overvector_y_period(0,*)
+overvector_y_period(*,2*ny) = overvector_y_period(*,0)
+overvector_y = TEMPORARY(overvector_y_period)
+
+
+print, 'plot !!!!'
+;
+;
+;
+	;localtime_h = start_lt + 100*nt/3700  ;; division euclidienne
+	;localtime_m = float(100*nt mod 3700)/3700.
+	;localtime_m = 60.*localtime_m
+	;title_user=string(localtime_h,'(I0)')+'h'+string(localtime_m,'(I0)')
+title_user='local time = '+string(start_lt + 100.*float(nt)/3700.,'(F5.2)')
+print, title_user
+;
+;
+;
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon, $                                  ; 1D latitude
+        lat, $                                  ; 1D longitude
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+;        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+        colors=colors, $                        ; number of colors/levels (32 is default)
+        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+;
+;
+;
+PS_End, /PNG
+alpha=alpha+1
+endfor
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_period_psfc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_period_psfc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_period_psfc.pro	(revision 207)
@@ -0,0 +1,161 @@
+pro turb_period
+;
+;
+;
+what_I_plot=0.
+overcontour=0.
+SPAWN, '\rm param_plot.idl ; cp turb_inc.pro param_plot.idl'
+;;
+;;
+;;
+;altiuser=0.5
+start_lt = 9. ;8
+zefile='psfc' ;'turbh_period'
+overvector_x = 0
+overvector_y = 0
+freq_out = 50. ;100.
+dx = 10.
+;
+;
+;
+filefile = "/home/aymeric/Work/submitted/mars_journal/LMD_MM_MARS_ustar_LEScaseC.nc"
+filefile = "/home/aymeric/extract.nc"
+filefile = "/home/aslmd/bigLES10m/psfc.nc"
+;getcdf, file=filefile, charvar="USTM", invar=zevar
+;getcdf, file=filefile, charvar="U", invar=zeu
+;getcdf, file=filefile, charvar="V", invar=zev
+;getcdf, file=filefile, charvar="W", invar=zew
+getcdf, file=filefile, charvar="PSFC", invar=zevar
+
+        nx = n_elements(zevar(*,0,0))
+        ny = n_elements(zevar(0,*,0))
+        ntot = n_elements(zevar(0,0,*))
+        ;lon = findgen(nx) / 10.
+        ;lat = findgen(ny) / 10.
+	;;lon = findgen(2*nx+1) / 10.
+	;;lat = findgen(2*ny+1) / 10.
+        lon = findgen(2*nx+1) * dx ;/ 1000.
+        lat = findgen(2*ny+1) * dx ;/ 1000.
+    lon = findgen(nx) * dx ;/ 1000.
+    lat = findgen(ny) * dx ;/ 1000.
+
+
+alpha=1
+;nstart=195
+;nend=198
+;;nend=215
+;nstride=1
+	;nstart=1
+	;nend=n_elements(zevar(0,0,*))-1
+	;nstride=10
+nstart=0
+nend=n_elements(zevar(0,0,*))-1
+nstride=1
+for nt=nstart,nend,nstride do begin
+print, nt
+;
+;
+;
+  PS_Start, filename=zefile+string(1000+alpha,'(I0)')+'.ps'
+  print, zefile+'.ps'
+  ;!p.multi=[0,3,2]
+  ;!P.Charsize = 0.6
+	!P.Charsize = 1.2
+	!p.charthick = 2.0
+	!p.thick = 2.0
+	!x.thick = 2.0
+	!y.thick = 2.0
+;;
+;;
+;;
+;restore, filename='../LES/MERIDIANI_tau100/savew'
+;;restore, filename='../LES/MERIDIANI_tau100_wind10/savew'
+;;restore, filename='../LES/MERIDIANI_tau100_wind20/savew'
+;;;restore, filename='saveu'
+;indind=where(abs(h - altiuser) eq min(abs(h - altiuser)))
+;print, h(indind)
+;;
+;;
+;;
+;;what_I_plot = reform(wprime(*,*,indind))
+;what_I_plot = wprime(*,*,indind)
+;;what_I_plot = veltot(*,*,indind)
+;;contour, wprime(*,*,indind), nlevels=30
+;lon = findgen(n_elements(wprime(*,0,0))) / 10.
+;lat = findgen(n_elements(wprime(0,*,0))) / 10.
+;nx = n_elements(wprime(*,0,0))
+;ny = n_elements(wprime(0,*,0))
+
+	;;;
+	what_I_plot = reform(zevar(*,*,nt))
+        ;overvector_x = reform(zeu(0:nx-1,*,0,nt))	
+	;overvector_y = reform(zev(*,0:ny-1,0,nt))
+	;what_I_plot = reform(zew(*,*,0,nt))
+	;what_I_plot = reform(zevar(*,*,nt)) - mean(reform(zevar(*,*,nt)))
+	;;;
+
+;;;;
+;;;; DUPLIQUER LES DOMAINES
+;;;;
+
+;what_I_plot_period = fltarr(2*nx+1,2*ny+1)
+;what_I_plot_period(0:nx-1   ,0:ny-1   ) = what_I_plot(0:nx-1,0:ny-1)
+;what_I_plot_period(nx:2*nx-1,0:ny-1   ) = what_I_plot(0:nx-1,0:ny-1)
+;what_I_plot_period(0:nx-1   ,ny:2*ny-1) = what_I_plot(0:nx-1,0:ny-1)
+;what_I_plot_period(nx:2*nx-1,ny:2*ny-1) = what_I_plot(0:nx-1,0:ny-1)
+;what_I_plot_period(2*nx,*) = what_I_plot_period(0,*)
+;what_I_plot_period(*,2*ny) = what_I_plot_period(*,0)
+;what_I_plot = TEMPORARY(what_I_plot_period)
+
+;overvector_x_period = fltarr(2*nx+1,2*ny+1)
+;overvector_x_period(0:nx-1   ,0:ny-1   ) = overvector_x(0:nx-1,0:ny-1)
+;overvector_x_period(nx:2*nx-1,0:ny-1   ) = overvector_x(0:nx-1,0:ny-1)
+;overvector_x_period(0:nx-1   ,ny:2*ny-1) = overvector_x(0:nx-1,0:ny-1)
+;overvector_x_period(nx:2*nx-1,ny:2*ny-1) = overvector_x(0:nx-1,0:ny-1)
+;overvector_x_period(2*nx,*) = overvector_x_period(0,*)
+;overvector_x_period(*,2*ny) = overvector_x_period(*,0)
+;overvector_x = TEMPORARY(overvector_x_period)
+
+;overvector_y_period = fltarr(2*nx+1,2*ny+1)
+;overvector_y_period(0:nx-1   ,0:ny-1   ) = overvector_y(0:nx-1,0:ny-1)
+;overvector_y_period(nx:2*nx-1,0:ny-1   ) = overvector_y(0:nx-1,0:ny-1)
+;overvector_y_period(0:nx-1   ,ny:2*ny-1) = overvector_y(0:nx-1,0:ny-1)
+;overvector_y_period(nx:2*nx-1,ny:2*ny-1) = overvector_y(0:nx-1,0:ny-1)
+;overvector_y_period(2*nx,*) = overvector_y_period(0,*)
+;overvector_y_period(*,2*ny) = overvector_y_period(*,0)
+;overvector_y = TEMPORARY(overvector_y_period)
+
+
+print, 'plot !!!!'
+;
+;
+;
+	;localtime_h = start_lt + 100*nt/3700  ;; division euclidienne
+	;localtime_m = float(100*nt mod 3700)/3700.
+	;localtime_m = 60.*localtime_m
+	;title_user=string(localtime_h,'(I0)')+'h'+string(localtime_m,'(I0)')
+title_user='Surface pressure (Pa) / Local time = '+string(start_lt + freq_out*float(nt)/3700.,'(F6.3)')
+print, title_user
+;
+;
+;
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon, $                                  ; 1D latitude
+        lat, $                                  ; 1D longitude
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+;        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+        colors=colors, $                        ; number of colors/levels (32 is default)
+        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+;
+;
+;
+PS_End, /PNG
+alpha=alpha+1
+endfor
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_section_period.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_section_period.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_section_period.pro	(revision 207)
@@ -0,0 +1,53 @@
+pro turb_section_period
+;
+;
+;
+what_I_plot=0.
+overcontour=0.
+SPAWN, '\rm param_plot.idl ; cp turb_section_period_inc.pro param_plot.idl'
+;
+;
+;
+filefile = "./MERIDIANI_tau050_wind10_section_plume.nc"
+getcdf, file=filefile, charvar="W", invar=zew
+getcdf, file=filefile, charvar="PHTOT", invar=zevar
+zew   = reform(zew)
+zevar = reform(zevar)
+
+        nx = n_elements(zevar(*,0))
+        nz = n_elements(zevar(0,*))
+
+        xx = findgen(nx) * 100. / 1000.
+        zz = reform(zevar(0,*)) / 3.72 / 1000. + ( 1473.35 / 1000. )
+
+	zew = zew[*,0:nz-2]
+	zz = zz[0:nz-2]
+
+
+	PS_Start, filename='sectionLES.ps'
+        !P.Charsize = 1.2
+        !p.charthick = 2.0
+        !p.thick = 2.0
+        !x.thick = 2.0
+        !y.thick = 2.0
+
+	what_I_plot = zew
+	lon = xx
+	lat = zz
+
+	map_latlon, $
+	        what_I_plot, $                          ; 2D field
+	        lon, $                                  ; 1D latitude OR 2D
+	        lat, $                                  ; 1D longitude OR 2D
+	        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+	        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+	        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+	        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+	        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+	        ct=pal, $                               ; color table (33-rainbow is default)
+	        colors=colors, $                        ; number of colors/levels (32 is default)
+	        title=title_user, $                     ; title of the plot ('' is default)
+	        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+
+PS_End, /PNG
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_section_period_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_section_period_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turb_section_period_inc.pro	(revision 207)
@@ -0,0 +1,22 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(I0)'
+colors	      = 64 ;32	
+minfield_init = -8.
+maxfield_init = 12. 
+pal = 33 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+flag_cb = 'true'
+windowx = [0.,9.] 
+windowy = [0.,12.] 
+intervalx = 1. 
+intervaly = 1. 
+title_axis = ['Horizontal coordinate (km)','Altitude above surface (km)']
+title_user = 'Vertical wind (m s!U-1!N) in Meridiani LES'
+subtitle_user = 'DOD = 0.5 / BW = 10 m s!U-1!N'
+poscb = 0.55
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turbulence.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turbulence.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turbulence.pro	(revision 207)
@@ -0,0 +1,549 @@
+pro turbulence
+
+;;----------------------------------------------------
+;;----------------------------------------------------
+;;----------------------------------------------------
+
+
+retrieve='true'
+;retrieve='false'
+
+
+
+;; CALCUL DE LA MOYENNE
+;; 18 pas assez 74 trop
+meansmooth=37
+;meansmooth=18
+;meansmooth=74
+
+;; CALCUL DE LA MOYENNE DES FLUX
+;smoothampl=74
+;smoothampl=2
+;smoothampl=10
+;smoothampl=18
+smoothampl=meansmooth
+
+saveps='false'
+;saveps='true'
+
+yu=20
+
+;;----------------------------------------------------
+;;----------------------------------------------------
+;;----------------------------------------------------
+
+
+p0=610. & t0=220. & r_cp=1/4.4 & grav=3.72 & R=192.
+
+;
+; graphics definition
+;
+if (saveps eq 'false') then begin
+   !p.multi=[0,3,2]
+   !P.CHARSIZE=2.
+endif else begin
+   !p.charthick = 2.0
+   !p.thick = 3.0
+   !x.thick = 2.0
+   !y.thick = 2.0
+endelse
+
+;
+; input files
+;
+OPENR, 22, 'input_coord' & READF, 22, lonu & READF, 22, latu & READF, 22, lsu & READF, 22, lctu & CLOSE, 22
+OPENR, 23, 'input_more' & READF, 23, hgtu, tsurfu & CLOSE, 23
+print, lonu, latu, lsu, lctu, hgtu, tsurfu
+
+
+;
+; retrieve
+;
+if (retrieve eq 'true') then begin
+
+
+;
+; get fields
+;
+getcdf, file='u'+string(yu,'(I0)')+'.nc', charvar='U', invar=u
+getcdf, file='v'+string(yu,'(I0)')+'.nc', charvar='V', invar=v
+getcdf, file='t'+string(yu,'(I0)')+'.nc', charvar='T', invar=t
+getcdf, file='w'+string(yu,'(I0)')+'.nc', charvar='W', invar=w
+getcdf, file='p'+string(yu,'(I0)')+'.nc', charvar='PTOT', invar=p
+	;
+	; no vertical staggering for w
+	;
+	wplus=shift(w,0,0,-1,0)
+	w=(w+wplus)/2.
+	w=w(*,*,0:n_elements(w(0,0,*,0))-2,*)
+
+
+ndim=n_elements(t(*,0,0,0))
+lat=fltarr(ndim,ndim)
+lon=fltarr(ndim,ndim)
+  for i=0,ndim-1 do begin
+  for j=0,ndim-1 do begin
+    lat(i,j)=latu+float(j)*100./59000.
+    lon(i,j)=lonu+float(i)*100./59000.
+  endfor
+  endfor
+what_I_plot=0. & what_I_plot2=0. & what_I_plot3=0. & what_I_plot4=0. & what_I_plot5=0. & what_I_plot6=0.
+maxwhat_I_plot=0. & maxwhat_I_plot2=0. & maxwhat_I_plot3=0.
+minwhat_I_plot=0.
+
+
+;
+; loop on west-east coordinate
+;
+nloop=n_elements(t(*,0,0,0))
+for i=0,nloop-1 do begin
+
+	indp=[i,0]	;;indp=[75,0]
+
+	;
+	; 2D field for plot
+	;
+	t2=reform(t(indp[0],indp[1],*,*))
+t2_save=t0+reform(t(indp[0],indp[1],*,*))
+treal2_save=t2_save*(reform(p(indp[0],indp[1],*,*))/p0)^r_cp
+	u2=reform(u(indp[0],indp[1],*,*))
+	v2=reform(v(indp[0],indp[1],*,*))
+	w2=reform(w(indp[0],indp[1],*,*))
+	nz=n_elements(t2(*,0))
+	nt=n_elements(t2(0,*))
+
+nt=nt-2
+t2=t2[*,0:nt-1]
+u2=u2[*,0:nt-1]
+v2=v2[*,0:nt-1]
+w2=w2[*,0:nt-1]
+
+        	;;
+        	;; local time
+        	;;
+        	;localtime=21.+100.*findgen(nt)/3700.+lon(indp[0],indp[1])/15.-24. 
+                localtime=lctu+100.*findgen(nt)/3700.
+		;;print, localtime
+		
+	;
+	; 1. perturbations
+	;
+	for k=0,nz-1 do begin
+		t2(k,*)=t2(k,*)-SMOOTH(reform(t2(k,*)),meansmooth,/EDGE_TRUNCATE)
+		u2(k,*)=u2(k,*)-SMOOTH(reform(u2(k,*)),meansmooth,/EDGE_TRUNCATE)
+		v2(k,*)=v2(k,*)-SMOOTH(reform(v2(k,*)),meansmooth,/EDGE_TRUNCATE)
+		w2(k,*)=w2(k,*);-SMOOTH(reform(w2(k,*)),meansmooth,/EDGE_TRUNCATE)
+		;treal2_save(k,*)=treal2_save(k,*)-SMOOTH(reform(treal2_save(k,*)),meansmooth,/EDGE_TRUNCATE)
+	endfor
+	;
+	; 2. nonlinear products
+	;
+	vertical_eddy_heat_flux=w2*t2
+	uprime2=u2^2
+	vprime2=v2^2
+	wprime2=w2^2
+	;
+	; 3. Reynolds averaging
+	;
+	for k=0,nz-1 do begin
+		vertical_eddy_heat_flux(k,*)=SMOOTH(reform(vertical_eddy_heat_flux(k,*)),smoothampl,/EDGE_TRUNCATE)
+	        uprime2(k,*)=SMOOTH(reform(uprime2(k,*)),smoothampl,/EDGE_TRUNCATE)
+	        vprime2(k,*)=SMOOTH(reform(vprime2(k,*)),smoothampl,/EDGE_TRUNCATE)
+	        wprime2(k,*)=SMOOTH(reform(wprime2(k,*)),smoothampl,/EDGE_TRUNCATE)
+	endfor
+	tke=0.5*(uprime2+vprime2+wprime2)
+
+
+what_I_plot=what_I_plot+vertical_eddy_heat_flux/nloop
+what_I_plot2=what_I_plot2+tke/nloop
+what_I_plot3=what_I_plot3+wprime2/nloop
+what_I_plot4=what_I_plot4+t2_save/nloop
+what_I_plot5=what_I_plot5+treal2_save/nloop
+if (i eq nloop-1) then  what_I_plot6=t2
+
+;;help, t2
+;;help, treal2_save
+;treal2_save=treal2_save(0:n_elements(t2(*,0))-1,0:n_elements(t2(0,*))-1)
+;if (i eq nloop-1) then  what_I_plot6=treal2_save
+
+yeah=max(vertical_eddy_heat_flux)
+yeah2=max(tke)
+yeah3=max(wprime2)
+yeah4=min(vertical_eddy_heat_flux)
+
+if (yeah gt maxwhat_I_plot) then maxwhat_I_plot=yeah
+if (yeah2 gt maxwhat_I_plot2) then maxwhat_I_plot2=yeah2
+if (yeah3 gt maxwhat_I_plot3) then maxwhat_I_plot3=yeah3
+if (yeah4 lt minwhat_I_plot) then minwhat_I_plot=yeah4
+
+endfor
+
+
+
+
+
+;
+; get model height
+;
+getcdf, file='ph'+string(yu,'(I0)')+'.nc', charvar='PHTOT', invar=ph
+height=reform(ph(*,0,*,*))   
+height=total(height,1)/n_elements(height(*,0,0))
+height=reform(height)
+height=total(height(*,1:nt-1),2)/(nt-1)
+height=height/1000./3.72
+heightp=height(0:n_elements(height(*))-2) 
+	;
+	; altitude above ground
+	;	
+        heightp=heightp-hgtu/1000.
+
+
+;
+; save
+;
+save, what_I_plot, $
+	what_I_plot2, $
+	what_I_plot3, $
+	what_I_plot4, $
+	what_I_plot5, $
+	what_I_plot6, $
+	localtime, $
+	heightp, $
+	lat, $
+	lon, $
+	hgtu, $
+	filename='turbulence.dat' 
+
+endif else begin
+	restore, filename='turbulence.dat'	
+endelse	
+
+help, what_I_plot
+help, localtime
+help, heightp
+
+
+latwrite=string(lat(0,yu),'(F5.1)')
+
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then begin
+  set_plot, 'ps' & device, filename='plot/TKE.ps'
+endif
+
+lev=findgen(15)+1.
+contour, $
+        transpose(what_I_plot2), $
+        localtime, $
+        heightp, $
+        xtitle='Local Time (h)', $
+        xrange=[8.,18.], $
+        xtickinterval=1., $
+        ytitle='Altitude above surface (km)', $
+        yrange=[0.,10.], $
+        ytickinterval=1., $
+        title="Turbulent Kinetic Energy 0.5[<u'!U2!N>+<v'!U2!N>+<w'!U2!N>] (m!U2!N.s!U-2!N)", $
+        levels=lev, $
+        c_labels=findgen(n_elements(lev))*0.+1., $
+	subtitle='zonal average at lat. '+latwrite+' (max value is '+string(maxwhat_I_plot2,'(F4.1)')+' m!U2!N.s!U-2!N)'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then begin
+  device, /close
+  set_plot, 'ps' & device, filename='plot/zTKE.ps'
+endif
+
+lev=findgen(15)+1.
+contour, $
+        0.5*transpose(what_I_plot3), $
+        localtime, $
+        heightp, $
+        xtitle='Local Time (h)', $
+        xrange=[8.,18.], $
+        xtickinterval=1., $
+        ytitle='Altitude above surface (km)', $
+        yrange=[0.,10.], $
+        ytickinterval=1., $
+        title="Vertical TKE 0.5<w'!U2!N> (m!U2!N.s!U-2!N)", $
+        levels=lev, $
+        c_labels=findgen(n_elements(lev))*0.+1., $
+        subtitle='zonal average at lat. '+latwrite+' (max value is '+string(0.5*maxwhat_I_plot3,'(F4.1)')+' m!U2!N.s!U-2!N)'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+
+if (saveps eq 'true') then begin
+  device, /close
+  set_plot, 'ps' & device, filename='plot/HF.ps'
+endif
+
+;lev=[-0.15,-0.05,-0.02,0.05,0.15,0.25,0.35,0.45,0.55,0.65,0.75,0.85,0.95]
+lev = -1. + findgen(20)/10.
+contour, $
+        transpose(what_I_plot), $
+        localtime, $
+        heightp, $ 
+	xtitle='Local Time (h)', $
+	xrange=[8.,18.], $
+	xtickinterval=1., $
+	ytitle='Altitude above surface (km)', $
+	yrange=[0.,10.], $
+	ytickinterval=1., $
+	title="Vertical Eddy Heat Flux <w'!7h!3'> (K.m.s!U-1!N)", $
+	levels=lev, $	
+	C_LINESTYLE = (lev LT 0.0), $
+	c_labels=findgen(n_elements(lev))*0.+1., $
+        subtitle='zonal average at lat. '+latwrite+' (min/max values are '+string(minwhat_I_plot,'(F5.1)')+'/'+string(maxwhat_I_plot,'(F3.1)')+' K.m.s!U-1!N)'
+
+
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+goto, no_pert_temp
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then begin
+  device, /close
+  set_plot, 'ps' & device, filename='plot/pert_temp.ps'
+endif
+
+lev=[-4.,-2.,-1.,-0.5,0.5,1.,2.,4.]
+contour, $
+	transpose(what_I_plot6), $
+        localtime, $
+        heightp, $
+        xtitle='Local Time (h)', $
+        xrange=[13.5,14.], $
+        xtickinterval=0.1, $
+        ytitle='Altitude above surface (km)', $
+        yrange=[0.,0.5], $
+        ytickinterval=0.1, $
+        title="Potential Temperature Perturbation !7h!3' (K)", $
+        levels=lev, $
+;nlevels=20, $
+        C_LINESTYLE = (lev LT 0.0), $
+        c_labels=findgen(n_elements(lev))*0.+1., $
+;/cell_fill, $
+        subtitle='latitude '+latwrite+' longitude '+string(lon(nloop-1,0),'(F6.1)')
+;xyouts, 14.007, heightp(0), '1'
+;xyouts, 14.016, heightp(1), '2'
+;xyouts, 14.007, heightp(2), '3'
+;xyouts, 14.007, heightp(3), '4'
+;xyouts, 14.007, heightp(4), '5'
+;xyouts, 14.007, heightp(5), '6'
+;xyouts, 14.007, heightp(6), '7'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+no_pert_temp:
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+
+
+if (saveps eq 'true') then begin
+  device, /close
+  set_plot, 'ps' & device, filename='plot/temp_pot.ps'
+endif
+
+user_lt=10. & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+plot, $
+        what_I_plot4(*,yeah(0)), $
+        heightp,$
+	xtitle='Potential Temperature (K)',$
+;	xrange=[215,240], $
+        xtickinterval=5., $
+        ytitle='Altitude above surface (km)', $
+	yrange=[0.,10.], $
+        ytickinterval=1., $
+	title="Potential Temperature !7h!3 profile (K)", $
+        subtitle='zonal average at lat. '+latwrite
+user_lt=12. & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+        oplot, what_I_plot4(*,yeah(0)), heightp, linestyle=1
+user_lt=14. & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+        oplot, what_I_plot4(*,yeah(0)), heightp
+user_lt=16. & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+        oplot, what_I_plot4(*,yeah(0)), heightp, linestyle=1
+user_lt=18. & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+        oplot, what_I_plot4(*,yeah(0)), heightp
+
+;xyouts, 217.3, 0.5, '10:00'
+;xyouts, 225.8, 1.5, '12:00'
+;xyouts, 231.8, 3.0, '14:00'
+;xyouts, 234.8, 0.7, '16:00'
+;xyouts, 232.3, 2.0, '18:00'
+
+
+if (saveps eq 'true') then begin
+  device, /close
+  set_plot, 'ps' & device, filename='plot/temp.ps'
+endif
+
+user_lt=14.+55./60. & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+plot, $
+        what_I_plot5(*,yeah(0)), $
+        heightp,$
+        xtitle='Temperature (K)',$
+        xrange=[210,250], $
+        xtickinterval=5., $
+        ytitle='Altitude above surface (km)', $
+        yrange=[0.,2.], $
+        ytickinterval=0.2, $
+        title="LMD LES Near-surface T profile (K)", $
+        subtitle='zonal average at lat. '+latwrite, $
+	linestyle=2	
+user_lt=10.+24./60. & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+	oplot, what_I_plot5(*,yeah(0)), heightp
+user_lt=10.+59./60. & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+	oplot, what_I_plot5(*,yeah(0)), heightp, linestyle=2
+user_lt=11.+59./60. & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+	oplot, what_I_plot5(*,yeah(0)), heightp
+user_lt=15.+22./60. & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+	oplot, what_I_plot5(*,yeah(0)), heightp
+user_lt=17.+13./60. & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+        oplot, what_I_plot5(*,yeah(0)), heightp, linestyle=2
+
+;xyouts, 221,   0.2,  '10:24'
+;xyouts, 226.5,   0.4,  '10:59'
+;xyouts, 231.8, 0.2,  '11:59'
+;xyouts, 233,   0.8,  '14:55'
+;xyouts, 241,   0.1,  '15:22'
+;xyouts, 236.5, 0.05, '17:13'
+ 
+
+;;
+;xyouts, 250.05, heightp(0), '1'
+;xyouts, 250.45, heightp(1), '2'
+;xyouts, 251.00, heightp(2), '3'
+;xyouts, 250.45, heightp(3), '4'
+;xyouts, 250.45, heightp(4), '5'
+;xyouts, 250.45, heightp(5), '6'
+;xyouts, 250.45, heightp(6), '7'
+;xyouts, 250.45, heightp(7), '8'
+;xyouts, 250.45, heightp(8), '9'
+;xyouts, 250.25, heightp(9), '10'
+;xyouts, 250.25, heightp(10), '11'
+;xyouts, 250.25, heightp(11), '12'
+;xyouts, 250.25, heightp(12), '13'
+;xyouts, 250.25, heightp(13), '14'
+;xyouts, 250.25, heightp(14), '15'
+;xyouts, 250.25, heightp(15), '16'
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;goto, no_staticstab
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then begin
+  device, /close
+  set_plot, 'ps' & device, filename='plot/staticstab.ps'
+endif
+
+user_lt=17. & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+
+   ;;; recompute height @ given local time 
+   caca=heightp+hgtu/1000.
+   height=reform(ph(*,0,*,*))
+   height=total(height,1)/n_elements(height(*,0,0))
+   height=reform(height)
+   height=reform(height(*,yeah(0)))
+   height=height/1000./3.72
+   heightp=height(0:n_elements(height(*))-2) 
+   print, 'new minus old', heightp - caca
+   ;;; recompute height @ given local time 
+
+        press=reform(p(*,0,*,*))
+        press=total(press,1)/n_elements(press(*,0,0))
+        press=reform(press)
+        press=reform(press(*,yeah(0)))
+        press=press(0:n_elements(press(*))-2)
+
+staticstab = DERIV( heightp , reform(what_I_plot5(*,yeah(0))) ) + 1000.*3.72/844.6  ;; 4.9 dans Hinson
+   staticstab = staticstab(0:n_elements(staticstab)-5)
+   heightp = heightp(0:n_elements(heightp)-5)
+
+plot, $
+        staticstab, $
+        heightp,$
+        xtitle='Static stability (K/km)',$
+        xrange=[-1.,5.], $
+        xtickinterval=0.5, $
+        ytitle='Altitude above surface (km)', $
+        yrange=[min(heightp),max(heightp)], $
+        ytickinterval=1., $
+        title="LMD LES Static stability @ LT 17h (K/km)", $
+        subtitle='zonal average at lat. '+latwrite
+oplot, $
+        staticstab, $
+        heightp,$
+        psym=5
+oplot, $
+       findgen(n_elements(heightp))*0. + 1.,$
+       heightp,$
+       linestyle=2
+oplot, $
+       findgen(n_elements(heightp))*0. + 2.,$
+       heightp,$
+       linestyle=2
+
+;;;;;;;;;;
+w = where((staticstab gt 1.5) and ((heightp- hgtu/1000.) gt 1.))
+t_top_plus = what_I_plot5(w(0),yeah(0))
+z_top_plus = heightp(w(0))
+p_top_plus = press(w(0))
+t_top_moins = what_I_plot5(w(0)-1,yeah(0))
+z_top_moins = heightp(w(0)-1)
+p_top_moins = press(w(0)-1)
+pbl_depth = (z_top_plus*alog(p_top_plus) + z_top_moins*alog(p_top_moins))/(alog(p_top_plus) + alog(p_top_moins)) - hgtu/1000.
+xyouts, 3., 1.5 + (max(heightp) + min(heightp)) / 3., 'Ls = '+string(lsu,'(F5.1)')+'!Uo!N', CHARSIZE=1
+xyouts, 3., 1. + (max(heightp) + min(heightp)) / 3., 'Lat = '+string(latu,'(F5.1)')+'!Uo!N', CHARSIZE=1
+xyouts, 3., 0.5 + (max(heightp) + min(heightp)) / 3., 'LonE = '+string(lonu,'(F6.1)')+'!Uo!N', CHARSIZE=1
+xyouts, 3., (max(heightp) + min(heightp)) / 3., 'T!Dt!N = '+string(t_top_plus,'(I0)')+'/'+string(t_top_moins,'(I0)')+' K ', CHARSIZE=1
+xyouts, 3., -0.5 + (max(heightp) + min(heightp)) / 3., 'p!Dt!N = '+string(p_top_plus,'(I0)')+'/'+string(p_top_moins,'(I0)')+' Pa', CHARSIZE=1
+xyouts, 3., -1. + (max(heightp) + min(heightp)) / 3., 'z!Dt!N = '+string(z_top_plus,'(F4.1)')+'/'+string(z_top_moins,'(F4.1)')+' km', CHARSIZE=1
+xyouts, 3., -1.5 + (max(heightp) + min(heightp)) / 3., 'z!Ds!N = '+string(hgtu/1000.,'(F4.1)')+' km', CHARSIZE=1
+xyouts, 3., -2. + (max(heightp) + min(heightp)) / 3., 'D = '+string(pbl_depth,'(F4.1)')+' km', CHARSIZE=1
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+no_staticstab:
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+if (saveps eq 'true') then begin
+  device, /close
+endif
+stop
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+user_lt=13.
+yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+
+user_h=0.1
+walt=where(abs(heightp-user_h) eq (min(abs(heightp-user_h))))
+
+;mapfield=reform(t[*,*,walt(0),w(0)])
+;help, mapfield
+;contour, mapfield
+
+section=reform(w[*,0,*,yeah(0)])
+
+section=reform(w[*,0,*,160])
+
+lev=[-12.,-8.,-4.,4.,8.,12.]
+lev=[-5.,-4.,-3.,-2.,-1.,1.,2.,3.,4.,5.]
+contour, $
+	section, $
+	(lon(*,0)-lon(0,0))*59., $
+	heightp, $
+	levels=lev , $
+	C_LINESTYLE = (lev LT 0.0)
+
+device, /close
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turbulence2.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turbulence2.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/turbulence2.pro	(revision 207)
@@ -0,0 +1,250 @@
+pro turbulence2
+
+
+retrieve='true'
+
+fast='true'
+;fast='false'
+
+
+p0=610. & t0=220. & r_cp=1/4.4 & grav=3.72 & R=192. & g_cp=1000.*grav/844.6
+;;;;;;;;;;;;;;;;;;;;;;;
+;                     ;
+; HINSON - HINSON !!! ;
+;                     ;
+r_cp = 0.25           ; 
+;g_cp = 4.9           ;
+;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+;
+; input files
+;
+OPENR, 22, 'input_coord' & READF, 22, lonu & READF, 22, latu & READF, 22, lsu & READF, 22, lctu & CLOSE, 22
+OPENR, 23, 'input_more' & READF, 23, hgtu, tsurfu & CLOSE, 23
+print, lonu, latu, lsu, lctu, hgtu, tsurfu
+
+;
+; retrieve
+;
+if (retrieve eq 'true') then begin
+
+;
+; get fields and dimensions
+;
+getcdf, file='t.nc', charvar='T', invar=t
+getcdf, file='p.nc', charvar='PTOT', invar=p
+getcdf, file='ph.nc', charvar='PHTOT', invar=ph
+nx=n_elements(t(*,0,0,0))
+ny=n_elements(t(0,*,0,0))
+nz=n_elements(t(0,0,*,0))
+nt=n_elements(t(0,0,0,*))
+   ;;;; pour eviter de detecter des fluctuations plus basses que PBL top ;;;
+     smooth_gridpoint = 2 & smooth_time = 2 & smooth_vert = 2  
+     ;smooth_gridpoint = 0 & smooth_time = 0 & smooth_vert = 0  
+     t = smooth(t,[smooth_gridpoint,smooth_gridpoint,smooth_vert,smooth_time],/EDGE_TRUNCATE)
+     p = smooth(p,[smooth_gridpoint,smooth_gridpoint,smooth_vert,smooth_time],/EDGE_TRUNCATE)
+     ;ph = smooth(ph,[smooth_gridpoint,smooth_gridpoint,smooth_vert,smooth_time],/EDGE_TRUNCATE)
+   ;;;; pour eviter de detecter des fluctuations plus basses que PBL top ;;;
+
+;
+; localtime loop
+;
+localtime = lctu + 100.*findgen(nt)/3700.
+  ;
+  ; radio-occultations
+  ;
+  user_lt=17.0 & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+  user_lt=17.5 & yeah2=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+  ;;
+  ;; PBL growth
+  ;;
+  ;user_lt=14.5 & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+  ;user_lt=18.0 & yeah2=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+  ;
+
+  user_lt=14.0 & yeah=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+  user_lt=14.5 & yeah2=where(abs(localtime-user_lt) eq (min(abs(localtime-user_lt))))
+
+
+
+deb=yeah(0)
+fin=yeah2(0)
+
+;
+; calculate over domain
+;
+pbl_depth_tab=findgen(nx,ny,fin-deb+1)
+nloop = nx*ny
+
+;
+; LOOOOOOP
+;
+for tt=deb,fin do begin
+
+ tprof_mean = 0.
+ heightp_mean = 0.
+ staticstab_mean = 0.
+ nbad = 0
+
+for i=0,nx-1 do begin
+for j=0,ny-1 do begin
+
+ height=reform( ph( i,j,*,tt ) ) / 1000. / grav
+ heightp=height(0:nz-1) ;no stagger
+
+ thprof = t0 + reform( t( i,j,*,tt ) )
+ pprof = reform( p( i,j,*,tt ) )
+ tprof = thprof * ( pprof/p0 )^r_cp
+
+ staticstab = DERIV( heightp , tprof ) + g_cp  
+
+if (fast eq 'true') then begin
+
+; MOINS BON mais PLUS RAPIDE
+tprof_mean = tprof_mean + tprof/nloop
+heightp_mean = heightp_mean + heightp/nloop
+staticstab_mean = staticstab_mean + staticstab/nloop
+
+endif else begin
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  z_in = heightp
+  profile_in = staticstab
+  resol = 500.  ;200 un peu juste
+  ;********************************************************************
+  ; ---- numerical recipes in C - section 3.3 ----
+  ;
+  ; Calculate interpolating cubic spline 
+        yspline = SPL_INIT(z_in,profile_in)
+  ; Define the X values P at which we desire interpolated Y values
+        xspline=min(z_in)+findgen(floor(max(z_in)-min(z_in))*resol)/resol
+  ; Calculate the interpolated Y values
+        result=spl_interp(z_in,profile_in,yspline,xspline)
+  ;********************************************************************
+  staticstab = result
+  heightp = xspline
+
+  heightp_mean = heightp_mean + heightp/nloop
+  staticstab_mean = staticstab_mean + staticstab/nloop
+    yspline = SPL_INIT(z_in,tprof)
+    tprof = spl_interp(z_in,tprof,yspline,xspline)
+  tprof_mean = tprof_mean + tprof/nloop
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+endelse
+
+lim=3.
+lim=1.5
+w = where( (staticstab ge lim) and (heightp-heightp(0) ge lim) )
+pbl_depth_tab(i,j,tt-deb) = heightp(w(0)) - heightp(0)
+
+   ; garde-fou supplementaire
+   if (heightp(w(0)) - heightp(0) lt 2.) then begin
+     pbl_depth_tab(i,j,tt-deb) = !VALUES.F_NAN
+     ;plot, profile_in, z_in, xrange=[-1.,5.], psym=5, title='bad!' & oplot, staticstab, heightp & oplot, staticstab, findgen(nz)*0. + heightp(w(0)), linestyle=2
+     print, heightp(w) - heightp(0)
+     nbad = nbad+1
+   endif
+
+;plot, profile_in, z_in, xrange=[-1.,5.], psym=5 & oplot, staticstab, heightp & oplot, staticstab, findgen(nz)*0. + heightp(w(0)), linestyle=2 
+;pause
+
+endfor
+;print, i
+endfor
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  print, '-------------------------------------------------------'
+  print, 'Local Time : ', localtime(tt)
+  print, 'nbad ', nbad
+  print, 'PBL height - min ', min(pbl_depth_tab(*,*,tt-deb))
+  print, 'PBL height - max ', max(pbl_depth_tab(*,*,tt-deb))
+  print, 'PBL height - mean ', mean(pbl_depth_tab(*,*,tt-deb))
+    ;; static stability of mean profile
+    staticstab = DERIV( heightp_mean , tprof_mean ) + g_cp
+
+	  ;z_in = heightp_mean
+	  ;profile_in = staticstab
+	  ;resol = 500  ;200 un peu juste
+	  ;;********************************************************************
+	  ;; ---- numerical recipes in C - section 3.3 ----
+	  ;;
+	  ;; Calculate interpolating cubic spline 
+	  ;      yspline = SPL_INIT(z_in,profile_in)
+	  ;; Define the X values P at which we desire interpolated Y values
+	  ;      xspline=min(z_in)+findgen(floor(max(z_in))*resol)/resol
+	  ;; Calculate the interpolated Y values
+	  ;      result=spl_interp(z_in,profile_in,yspline,xspline)
+	  ;;********************************************************************
+	  ;staticstab = result
+	  ;w = where((staticstab ge 1.5) and (xspline-xspline(0) gt 2.))
+	  ;print, 'PBL height - mean profile', xspline(w(0)) - xspline(0)
+
+    w = where((staticstab ge 1.5) and (heightp_mean-heightp_mean(0) gt 1.5))
+    print, 'PBL height - mean profile', heightp_mean(w(0))-heightp_mean(0)
+    ;; mean static stability
+    w = where((staticstab_mean ge 1.5) and (heightp_mean-heightp_mean(0) gt 1.5))
+    print, 'PBL height - mean static stability', heightp_mean(w(0)) - heightp_mean(0)
+
+   ;plot, staticstab, heightp_mean, xrange=[-1.,5.]
+   ;oplot, staticstab, findgen(nz)*0. + heightp_mean(w(0)), linestyle=2
+   ;oplot, staticstab_mean, heightp_mean
+   ;oplot, staticstab_mean, findgen(nz)*0. + heightp_mean(w(0)), linestyle=2
+   ;pause
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+endfor
+endif
+
+  print, '-------------------------------------------------------'
+  print, 'PBL height - min ', min(pbl_depth_tab(*,*,*))
+  print, 'PBL height - max ', max(pbl_depth_tab(*,*,*))
+  print, 'PBL height - mean ', mean(pbl_depth_tab(*,*,*))
+  print, '-------------------------------------------------------'
+
+stop
+
+!p.charthick = 2.0
+!p.thick = 3.0
+!x.thick = 2.0
+!y.thick = 2.0
+set_plot, 'ps' & device, filename='plot/map.ps', /color
+;map_latlon, reform(pbl_depth_tab(*,*,0))
+
+
+what_I_plot = reform(pbl_depth_tab(*,*,0))
+pal=4
+colors=128
+title_user='PBL depth'
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon, $                                  ; 1D latitude
+        lat, $                                  ; 1D longitude
+;        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+;        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+;        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+;        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+;        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+        colors=colors, $                        ; number of colors/levels (32 is default)
+        title=title_user;, $                     ; title of the plot ('' is default)
+;        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+
+
+
+device, /close
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/update
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/update	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/update	(revision 207)
@@ -0,0 +1,107 @@
+#! /bin/bash
+
+cd PLAN_100m_145_145_101_12km/case_I/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd PLAN_100m_45_45_71_10km/case_B/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+cd PLAN_100m_45_45_71_10km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+cd PLAN_100m_45_45_71_10km/case_I/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_100m_145_145_201_15km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_100m_145_145_201_20km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_100m_45_45_71_10km/case_A/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+cd REAL_100m_45_45_71_10km/case_B/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+cd REAL_100m_45_45_71_10km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+cd REAL_100m_45_45_71_10km/case_C_low_ck/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+cd REAL_100m_45_45_71_10km/case_C_start10/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+cd REAL_100m_45_45_71_10km/case_I/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_50m_145_145_201_12km/case_A/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+cd REAL_50m_145_145_201_12km/case_B/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+cd REAL_50m_145_145_201_12km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+cd REAL_50m_145_145_201_12km/case_I/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+cd REAL_50m_145_145_201_12km/case_HIGH/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_50m_201_201_201_12km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_50m_241_241_201_12km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_100m_145_145_101_12km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_100m_73_73_151_15km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_100m_101_101_151_15km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_100m_101_101_201_15km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_100m_73_73_201_15km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_100m_241_241_151_15km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_50m_181_181_201_12km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_50m_145_145_251_10km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_100m_181_181_201_15km/case_C/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
+cd REAL_100m_181_181_201_15km/case_A/
+echo "getturb, noplot='1' & exit" | /opt/idl-6.4/idl/bin/idl #> logidl 2> logidl_err &
+cd ../../
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/ye.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/ye.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/ye.pro	(revision 207)
@@ -0,0 +1,83 @@
+pro ye, r, t
+
+;; paper
+min_lt = 13.
+max_lt = 16.
+
+;min_lt = 12.
+;max_lt = 16.
+
+;min_lt = 13.
+;max_lt = 15.
+
+
+wherefiles='./REAL_50m_145_145_201_12km/'
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+restore, filename=wherefiles+'case_A'+'/compturb.dat'
+restore, filename=wherefiles+'case_A'+'/getturb.dat'
+wspe = where( (localtime ge min_lt) and (localtime le max_lt) )
+nspe = n_elements(wspe)
+r = TOTAL(a_wt_bot[*,wspe],2) 
+t = TOTAL(a_h[*,wspe],2) 
+rtot = [r]
+ttot = [t]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+restore, filename=wherefiles+'case_B'+'/compturb.dat'
+restore, filename=wherefiles+'case_B'+'/getturb.dat'
+r = TOTAL(a_wt_bot[*,wspe],2)
+t = TOTAL(a_h[*,wspe],2) 
+rtot = [rtot,r]
+ttot = [ttot,t]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+restore, filename=wherefiles+'case_C'+'/compturb.dat'
+restore, filename=wherefiles+'case_C'+'/getturb.dat'
+r = TOTAL(a_wt_bot[*,wspe],2)
+t = TOTAL(a_h[*,wspe],2)
+rtot = [rtot,r]
+ttot = [ttot,t]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+restore, filename=wherefiles+'case_I'+'/compturb.dat'
+restore, filename=wherefiles+'case_I'+'/getturb.dat'
+r = TOTAL(a_wt_bot[*,wspe],2)
+t = TOTAL(a_h[*,wspe],2)
+rtot = [rtot,r]
+ttot = [ttot,t]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+restore, filename=wherefiles+'case_HIGH'+'/compturb.dat'
+restore, filename=wherefiles+'case_HIGH'+'/getturb.dat'
+r = TOTAL(a_wt_bot[*,wspe],2)
+t = TOTAL(a_h[*,wspe],2)
+rtot = [rtot,r]
+ttot = [ttot,t]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+r = r / float(nspe)
+t = t / float(nspe)
+
+sssss = sort(t)
+r = r[sssss]
+t = t[sssss]
+
+;;
+;; OK
+;;
+;lim=0.30 & zelim=(-3.85/alog(lim)+0.07*alog(lim))*exp(-4.61*lim)
+;up=1. & & zeup= - 1.55 * up + 1.27
+;slope = (zelim - zeup) / (lim - up) & ord = zeup - slope * up
+;t1 = findgen(1001.)*lim/1000. & param1 = (-3.85/alog(t1)+0.07*alog(t1))*exp(-4.61*t1)
+;t2 = lim + findgen(1001.)*(1.0 - lim)/1000. & param2 = slope * t2 + ord
+;
+;r = [param1, param2]
+;t = [t1, t2]
+
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/LES/ye2.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/LES/ye2.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/LES/ye2.pro	(revision 207)
@@ -0,0 +1,78 @@
+pro ye2, r, t
+
+;;paper
+min_lt = 12.
+max_lt = 14.
+
+;min_lt = 13.
+;max_lt = 16.
+
+;min_lt = 12.
+;max_lt = 16.
+
+;min_lt = 13.
+;max_lt = 15.
+
+
+wherefiles='./REAL_50m_145_145_201_12km/'
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+restore, filename=wherefiles+'case_A'+'/compturb.dat'
+restore, filename=wherefiles+'case_A'+'/getturb.dat'
+wspe = where( (localtime ge min_lt) and (localtime le max_lt) )
+nspe = n_elements(wspe)
+r = TOTAL(a_vel_bot[*,wspe],2)
+t = TOTAL(a_h[*,wspe],2)
+rtot = [r]
+ttot = [t]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+restore, filename=wherefiles+'case_B'+'/compturb.dat'
+restore, filename=wherefiles+'case_B'+'/getturb.dat'
+r = TOTAL(a_vel_bot[*,wspe],2)
+t = TOTAL(a_h[*,wspe],2) 
+rtot = [rtot,r]
+ttot = [ttot,t]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+restore, filename=wherefiles+'case_C'+'/compturb.dat'
+restore, filename=wherefiles+'case_C'+'/getturb.dat'
+r = TOTAL(a_vel_bot[*,wspe],2)
+t = TOTAL(a_h[*,wspe],2)
+rtot = [rtot,r]
+ttot = [ttot,t]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+restore, filename=wherefiles+'case_I'+'/compturb.dat'
+restore, filename=wherefiles+'case_I'+'/getturb.dat'
+r = TOTAL(a_vel_bot[*,wspe],2)
+t = TOTAL(a_h[*,wspe],2)
+rtot = [rtot,r]
+ttot = [ttot,t]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+restore, filename=wherefiles+'case_HIGH'+'/compturb.dat'
+restore, filename=wherefiles+'case_HIGH'+'/getturb.dat'
+r = TOTAL(a_vel_bot[*,wspe],2)
+t = TOTAL(a_h[*,wspe],2)
+rtot = [rtot,r]
+ttot = [ttot,t]
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+r = r / float(nspe)
+t = t / float(nspe)
+
+sssss = sort(t)
+r = r[sssss]
+t = t[sssss]
+
+;t1 = findgen(2001.)*1./2000.
+;param1 = 2.05 * t1^(2./3.) * ( 1. - 0.64 * t1 )^2
+;r = param1
+;t = t1
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/MOLA_topo.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/MOLA_topo.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/MOLA_topo.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,126 @@
+;;;;;*************************************** FOLDER
+        folder  = '/donnees/aslmd/MODELES/MESOSCALE/LMD_MM_MARS/mpi_64/WPS/'
+        ;coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	coord2d = 'polar'       ;; for polar projection with map_set ;; utiliser use_lt=99
+        filename        = folder + 'geo_em.d01.nc'
+        ;filename        = folder + 'paleo/geo_em.d01.nc'
+        ini_utc         = 6           ;; cf. name of file
+        freq            = 1           ;; cf. 1 output per ... hour
+        save_ps         = 'MOLA_topo'
+
+;;;;;*************************************** LVL & FLD & TIME
+        nlevel          = 0
+        use_lt          = 99               ;; cf. what user wants (99 pour tous)
+        field1          = 'HGT_M'            ;; comment to trace horizontal velocity
+        ;field2         = 'PTOT'           ;; contour
+        ;no3d           = 'true'
+        overvector_x    = 0               ;; comment out to get rid of vectors
+        overvector_y    = 0               ;; comment out to get rid of vectors
+        fieldscoord     = ['XLONG_M','XLAT_M','HGT_M']
+
+;;;;;*************************************** TWEAK VAR
+        what_I_plot = what_I_plot / 1000.
+        ;print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user 	= 	'MOLA Topography' 
+        title_axis      =       ['East longitude','North latitude']
+        ;subtitle_user   = 'LMD_MM'
+        ;;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+        ;;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+        ;subtitle_user   = subtitle_user + ' / Ls = 120!Uo!N'
+        ;subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.85
+        format          =       '(F4.1)' 
+        colors          =       64 
+        pal             =       15 ;33             ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       -6.0
+        maxfield_init   =       -2.5
+        ndiv            =       7
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 0.05 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       30.             ;; DEF: 20.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        lev             =       -10. + 0.5*findgen(30)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        intervalx       =       30.0
+        intervaly       =	05.0
+
+;;;;;*************************************** MAP LIMITS
+	windowx 	= 	[-180.,180.]        
+	windowy 	= 	[70.,90.]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+;;;;;*************************************** SETTING TIME (do not modify)
+        if (n_elements(windowx) eq 0) then windowx = 0 
+        utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+        use_utc         = use_lt - utc_to_lt
+        zentime         = floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... 
+        if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+        print, zentime, ntime
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM10_mesopaper_tsurf.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM10_mesopaper_tsurf.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM10_mesopaper_tsurf.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,138 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER
+	folder 	= '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/' 
+        coord2d = 'false'	;; for non-regular projections  
+filename 	= folder + 'OM10_mesopaper/wrfout_d01_2024-06-43_18:00:00_zabg' 
+save_ps 	= 'OM10_mesopaper_tsurf'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+ini_utc		= 18	;; cf. name of file
+freq		= 2  	;; cf. 1 output per ... hour
+utc_to_lt       = -9    ;; cf. longitude -- LT = UTC + utc_to_lt 
+	use_lt	= 2	;; cf. what user wants
+	use_utc	= use_lt - utc_to_lt
+        ntime	= ((24 + use_utc - ini_utc) MOD 24)/freq	;; TRUE IDL SUBSCRIPT ... ajouter un modulo... 
+        print, 'CHECK ... ', filename, ntime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+nlevel          = 0
+field1   	= 'TSURF'  	;; comment to trace horizontal velocity
+no3d 		= 'true'
+overvector_x	= 0		;; comment out to get rid of vectors
+overvector_y	= 0		;; comment out to get rid of vectors
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+	;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+	;;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+	;what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+	;print, max(what_I_plot), min(what_I_plot)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+
+
+;;;;;*************************************** PLOT TITLES
+        ;title_user 	= 	'Surface temperature (K) and Winds 10m ABG (m s!U-1!N)' 
+	;title_user    	= 	'Wind-induced apparent thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+	;title_user 	= 	'Winds 10m ABG (m s!U-1!N)'
+        title_user      =       'Surface temperature (K)'
+        ;subtitle_user   =       'LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        subtitle_user   =       'LT = 02:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        title_axis      =       ['East longitude','North latitude']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.96
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+        ;pal             =       4
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       150.
+        maxfield_init   =       180.
+	;minfield_init	= 	50.
+	;maxfield_init	= 	250.
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.		;; DEF: 20.
+        windex          =       30.             ;; DEF: 20.
+        ;stride          =       1. 		;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.0
+        ;intervaly       =	intervalx
+	intervaly	=	1.0
+
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+	windowx 	= 	[-146.,-126.]        
+	;windowy 	 =	[10.,28.]
+	;windowx 	 = 	[-146.,-128.]
+        ;windowy         =      [12.,26.]
+	windowy 	= 	[11.,27.]
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM10_nocstTI_tsurf.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM10_nocstTI_tsurf.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM10_nocstTI_tsurf.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,138 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER
+	folder 	= '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/' 
+        coord2d = 'false'	;; for non-regular projections  
+filename 	= folder + 'nocst_TI/OM10/wrfout_d01_2024-06-43_18z00z00_zabg' 
+save_ps 	= 'OM10_nocstTI_tsurf'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+ini_utc		= 18	;; cf. name of file
+freq		= 2  	;; cf. 1 output per ... hour
+utc_to_lt       = -9    ;; cf. longitude -- LT = UTC + utc_to_lt 
+	use_lt	= 2	;; cf. what user wants
+	use_utc	= use_lt - utc_to_lt
+        ntime	= ((24 + use_utc - ini_utc) MOD 24)/freq	;; TRUE IDL SUBSCRIPT ... ajouter un modulo... 
+        print, 'CHECK ... ', filename, ntime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+nlevel          = 0
+field1   	= 'TSURF'  	;; comment to trace horizontal velocity
+no3d 		= 'true'
+overvector_x	= 0		;; comment out to get rid of vectors
+overvector_y	= 0		;; comment out to get rid of vectors
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+	;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+	;;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+	;what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+	;print, max(what_I_plot), min(what_I_plot)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+
+
+;;;;;*************************************** PLOT TITLES
+        ;title_user 	= 	'Surface temperature (K) and Winds 10m ABG (m s!U-1!N)' 
+	;title_user    	= 	'Wind-induced apparent thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+	;title_user 	= 	'Winds 10m ABG (m s!U-1!N)'
+        title_user      =       'Surface temperature (K)'
+        ;subtitle_user   =       'LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        subtitle_user   =       'LT = 02:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Remotely-sounded TI'
+        title_axis      =       ['East longitude','North latitude']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.96
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+        ;pal             =       4
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       150.
+        maxfield_init   =       180.
+	;minfield_init	= 	50.
+	;maxfield_init	= 	250.
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.		;; DEF: 20.
+        windex          =       30.             ;; DEF: 20.
+        ;stride          =       1. 		;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.0
+        ;intervaly       =	intervalx
+	intervaly	=	1.0
+
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+	windowx 	= 	[-146.,-126.]        
+	;windowy 	 =	[10.,28.]
+	;windowx 	 = 	[-146.,-128.]
+        ;windowy         =      [12.,26.]
+	windowy 	= 	[11.,27.]
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM20_tsurf.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM20_tsurf.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM20_tsurf.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,138 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER
+	folder 	= '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/' 
+        coord2d = 'false'	;; for non-regular projections  
+filename 	= folder + 'OM20/wrfout_d01_2024-06-43_18z00z00_zabg' 
+save_ps 	= 'OM20_tsurf'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+ini_utc		= 18	;; cf. name of file
+freq		= 2  	;; cf. 1 output per ... hour
+utc_to_lt       = -9    ;; cf. longitude -- LT = UTC + utc_to_lt 
+	use_lt	= 2	;; cf. what user wants
+	use_utc	= use_lt - utc_to_lt
+        ntime	= ((24 + use_utc - ini_utc) MOD 24)/freq	;; TRUE IDL SUBSCRIPT ... ajouter un modulo... 
+        print, 'CHECK ... ', filename, ntime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+nlevel          = 0
+field1   	= 'TSURF'  	;; comment to trace horizontal velocity
+no3d 		= 'true'
+overvector_x	= 0		;; comment out to get rid of vectors
+overvector_y	= 0		;; comment out to get rid of vectors
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+	;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+	;;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+	;what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+	;print, max(what_I_plot), min(what_I_plot)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+
+
+;;;;;*************************************** PLOT TITLES
+        ;title_user 	= 	'Surface temperature (K) and Winds 10m ABG (m s!U-1!N)' 
+	;title_user    	= 	'Wind-induced apparent thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+	;title_user 	= 	'Winds 10m ABG (m s!U-1!N)'
+        title_user      =       'Surface temperature (K)'
+        ;subtitle_user   =       'LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        subtitle_user   =       'LT = 02:00am  /  Ls = 173!Uo!N  /  dx = 20km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        title_axis      =       ['East longitude','North latitude']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.96
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+        ;pal             =       4
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       150.
+        maxfield_init   =       180.
+	;minfield_init	= 	50.
+	;maxfield_init	= 	250.
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.		;; DEF: 20.
+        windex          =       30.             ;; DEF: 20.
+        ;stride          =       1. 		;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.0
+        ;intervaly       =	intervalx
+	intervaly	=	1.0
+
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+	windowx 	= 	[-146.,-126.]        
+	;windowy 	 =	[10.,28.]
+	;windowx 	 = 	[-146.,-128.]
+        ;windowy         =      [12.,26.]
+	windowy 	= 	[11.,27.]
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM40_tsurf.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM40_tsurf.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM40_tsurf.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,138 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER
+	folder 	= '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/' 
+        coord2d = 'false'	;; for non-regular projections  
+filename 	= folder + 'nocst_TI/OM40/wrfout_d01_2024-06-37_06_zabg' 
+save_ps 	= 'OM40_tsurf'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+ini_utc		= 6	;; cf. name of file
+freq		= 1  	;; cf. 1 output per ... hour
+utc_to_lt       = -9    ;; cf. longitude -- LT = UTC + utc_to_lt 
+	use_lt	= 2	;; cf. what user wants
+	use_utc	= use_lt - utc_to_lt
+        ntime	= ((24 + use_utc - ini_utc) MOD 24)/freq	;; TRUE IDL SUBSCRIPT... ajouter un modulo... 
+        print, 'CHECK ... ', filename, ntime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+nlevel          = 0
+field1   	= 'TSURF'  	;; comment to trace horizontal velocity
+no3d 		= 'true'
+overvector_x	= 0		;; comment out to get rid of vectors
+overvector_y	= 0		;; comment out to get rid of vectors
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+	;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+	;;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+	;what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+	;print, max(what_I_plot), min(what_I_plot)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+
+
+;;;;;*************************************** PLOT TITLES
+        ;title_user 	= 	'Surface temperature (K) and Winds 10m ABG (m s!U-1!N)' 
+	;title_user    	= 	'Wind-induced apparent thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+	;title_user 	= 	'Winds 10m ABG (m s!U-1!N)'
+        title_user      =       'Surface temperature (K)'
+        ;subtitle_user   =       'LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        subtitle_user   =       'LT = 02:00am  /  Ls = 170!Uo!N  /  dx = 40km [single]  /  Remotely-sounded TI'
+        title_axis      =       ['East longitude','North latitude']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.96
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+        ;pal             =       4
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       150.
+        maxfield_init   =       180.
+	;minfield_init	= 	50.
+	;maxfield_init	= 	250.
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.		;; DEF: 20.
+        windex          =       30.             ;; DEF: 20.
+        ;stride          =       1. 		;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.0
+        ;intervaly       =	intervalx
+	intervaly	=	1.0
+
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+	windowx 	= 	[-146.,-126.]        
+	;windowy 	 =	[10.,28.]
+	;windowx 	 = 	[-146.,-128.]
+        ;windowy         =      [12.,26.]
+	windowy 	= 	[11.,27.]
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_app_ti.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_app_ti.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_app_ti.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,141 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER
+	folder 	= '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/' 
+        coord2d = 'false'	;; for non-regular projections  
+filename 	= folder + 'OM6_TI85/wrfout_d01_2024-06-43_06:00:00_zabg' 
+save_ps 	= 'OM6_TI85_app_ti'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+ini_utc		= 6	;; cf. name of file
+freq		= 1  	;; cf. 1 output per ... hour
+utc_to_lt       = -9    ;; cf. longitude -- LT = UTC + utc_to_lt 
+	use_lt	= 2	;; cf. what user wants
+	use_utc	= use_lt - utc_to_lt 
+        ntime	= (use_utc - ini_utc)/freq	;; TRUE IDL SUBSCRIPT ... ajouter un modulo... 
+        print, 'CHECK ... ', filename, ntime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+nlevel          = 0
+field1   	= 'TSURF'  	;; comment to trace horizontal velocity
+no3d 		= 'true'
+overvector_x	= 0		;; comment out to get rid of vectors
+overvector_y	= 0		;; comment out to get rid of vectors
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+        a0 = 64.839418 & a1 = 3.1521937 & a2 = 0.0054538848 ;; Ls ~ 173 -- 2AM
+	;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+	;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+	what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+	print, max(what_I_plot), min(what_I_plot)
+	;overvector_x=0
+	;overvector_y=0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+
+
+;;;;;*************************************** PLOT TITLES
+        ;title_user 	= 	'Surface temperature (K) and Winds 10m ABG (m s!U-1!N)' 
+	title_user    	= 	'Wind-induced apparent thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+	;title_user 	= 	'Winds 10m ABG (m s!U-1!N)'
+        ;title_user      =       'Surface temperature (K)'
+        ;subtitle_user   =       'LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        subtitle_user   =       '';'LT = 02:00am  /  Ls = 173!Uo!N  /  dx = 6km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        title_axis      =       ['East longitude','North latitude']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.80 ;0.96
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+	pal		=	4
+
+;;;;;*************************************** FILL LIMITS
+        ;minfield_init   =       150.
+        ;maxfield_init   =       180.
+	minfield_init	= 	50.
+	maxfield_init	= 	250.
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.		;; DEF: 20.
+        windex          =       30.             ;; DEF: 20.
+        ;stride          =       1. 		;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.0
+        ;intervaly       =	intervalx
+	intervaly	=	1.0
+
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+	windowx 	= 	[-146.,-126.]        
+	;windowy 	 =	[10.,28.]
+	;windowx 	 = 	[-146.,-128.]
+        ;windowy         =      [12.,26.]
+	windowy 	= 	[11.,27.]
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_hfx.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_hfx.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_hfx.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,144 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER
+	folder 	= '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/' 
+        coord2d = 'false'	;; for non-regular projections  
+filename 	= folder + 'OM6_TI85/wrfout_d01_2024-06-43_06:00:00_zabg' 
+save_ps 	= 'OM6_TI85_hfx'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+ini_utc		= 6	;; cf. name of file
+freq		= 1  	;; cf. 1 output per ... hour
+utc_to_lt       = -9    ;; cf. longitude -- LT = UTC + utc_to_lt 
+	use_lt	= 2	;; cf. what user wants
+	use_utc	= use_lt - utc_to_lt 
+        ntime	= (use_utc - ini_utc)/freq	;; TRUE IDL SUBSCRIPT ... ajouter un modulo... 
+        print, 'CHECK ... ', filename, ntime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+nlevel          = 0
+;field1   	= 'TSURF'  	;; comment to trace horizontal velocity
+field1         = 'HFX'       ;; comment to trace horizontal velocity
+no3d 		= 'true'
+overvector_x	= 0		;; comment out to get rid of vectors
+overvector_y	= 0		;; comment out to get rid of vectors
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+	;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+	;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+	;what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+	;print, max(what_I_plot), min(what_I_plot)
+	;overvector_x=0
+	;overvector_y=0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+what_I_plot = - what_I_plot
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+
+
+;;;;;*************************************** PLOT TITLES
+        ;title_user 	= 	'Surface temperature (K) and Winds 10m ABG (m s!U-1!N)' 
+	;title_user    	= 	'Wind-induced apparent thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+	;title_user 	= 	'Winds 10m ABG (m s!U-1!N)'
+        ;title_user      =       'Surface temperature (K)'
+	title_user	=	'Downward sensible heat flux at the surface (W m!U-2!N)'
+        ;subtitle_user   =       'LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        subtitle_user   =       'LT = 02:00am  /  Ls = 173!Uo!N  /  dx = 6km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        title_axis      =       ['East longitude','North latitude']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.96
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       0 ;22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        ;minfield_init   =       150.
+        ;maxfield_init   =       180.
+        minfield_init   =       0.
+        maxfield_init   =       30.
+	;minfield_init	= 	50.
+	;maxfield_init	= 	250.
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.		;; DEF: 20.
+        windex          =       30.             ;; DEF: 20.
+        ;stride          =       1. 		;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.0
+        ;intervaly       =	intervalx
+	intervaly	=	1.0
+
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+	windowx 	= 	[-146.,-126.]        
+	;windowy 	 =	[10.,28.]
+	;windowx 	 = 	[-146.,-128.]
+        ;windowy         =      [12.,26.]
+	windowy 	= 	[11.,27.]
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_lwdownz.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_lwdownz.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_lwdownz.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,145 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER
+	folder 	= '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/' 
+        coord2d = 'false'	;; for non-regular projections  
+filename 	= folder + 'OM6_TI85/wrfout_d01_2024-06-43_06:00:00_zabg' 
+save_ps 	= 'OM6_TI85_lwdownz'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+ini_utc		= 6	;; cf. name of file
+freq		= 1  	;; cf. 1 output per ... hour
+utc_to_lt       = -9    ;; cf. longitude -- LT = UTC + utc_to_lt 
+	use_lt	= 2	;; cf. what user wants
+	use_utc	= use_lt - utc_to_lt 
+        ntime	= (use_utc - ini_utc)/freq	;; TRUE IDL SUBSCRIPT ... ajouter un modulo... 
+        print, 'CHECK ... ', filename, ntime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+nlevel          = 0
+;field1   	= 'TSURF'  	;; comment to trace horizontal velocity
+;field1         = 'HFX'       	;; comment to trace horizontal velocity
+field1         = 'LWDOWNZ'      ;; comment to trace horizontal velocity
+no3d 		= 'true'
+overvector_x	= 0		;; comment out to get rid of vectors
+overvector_y	= 0		;; comment out to get rid of vectors
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+	;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+	;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+	;what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+	;print, max(what_I_plot), min(what_I_plot)
+	;overvector_x=0
+	;overvector_y=0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+
+
+;;;;;*************************************** PLOT TITLES
+        ;title_user 	= 	'Surface temperature (K) and Winds 10m ABG (m s!U-1!N)' 
+	;title_user    	= 	'Wind-induced apparent thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+	;title_user 	= 	'Winds 10m ABG (m s!U-1!N)'
+        ;title_user      =       'Surface temperature (K)'
+	;title_user	=	'Upward sensible heat flux at the surface (W m!U-2!N)'
+	title_user	=	'Downward longwave radiative flux at the surface (W m!U-2!N)'
+        ;subtitle_user   =       'LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        subtitle_user   =       'LT = 02:00am  /  Ls = 173!Uo!N  /  dx = 6km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        title_axis      =       ['East longitude','North latitude']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.96
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       0 ;22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        ;minfield_init   =       150.
+        ;maxfield_init   =       180.
+        minfield_init   =       0.
+        maxfield_init   =       30.
+	;minfield_init	= 	50.
+	;maxfield_init	= 	250.
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.		;; DEF: 20.
+        windex          =       30.             ;; DEF: 20.
+        ;stride          =       1. 		;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.0
+        ;intervaly       =	intervalx
+	intervaly	=	1.0
+
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+	windowx 	= 	[-146.,-126.]        
+	;windowy 	 =	[10.,28.]
+	;windowx 	 = 	[-146.,-128.]
+        ;windowy         =      [12.,26.]
+	windowy 	= 	[11.,27.]
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_m5_tsurf.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_m5_tsurf.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_m5_tsurf.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,143 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER
+	folder 	= '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/' 
+        coord2d = 'false'	;; for non-regular projections  
+filename 	= folder + 'OM6_TI85/wrfout_d01_2024-06-43_06:00:00_zabg' 
+save_ps 	= 'OM6_TI85_tsurf'
+filename        = folder + 'OM6_TI85_m5/wrfout_d01_2024-05-03_06:00:00_zabg'
+save_ps         = 'OM6_TI85_m5_tsurf'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+ini_utc		= 6	;; cf. name of file
+freq		= 1  	;; cf. 1 output per ... hour
+utc_to_lt       = -9    ;; cf. longitude -- LT = UTC + utc_to_lt 
+	use_lt	= 2	;; cf. what user wants
+	use_utc	= use_lt - utc_to_lt 
+        ntime	= (use_utc - ini_utc)/freq	;; TRUE IDL SUBSCRIPT ... ajouter un modulo... 
+        print, 'CHECK ... ', filename, ntime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+nlevel          = 0
+field1   	= 'TSURF'  	;; comment to trace horizontal velocity
+no3d 		= 'true'
+overvector_x	= 0		;; comment out to get rid of vectors
+overvector_y	= 0		;; comment out to get rid of vectors
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+	;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+	;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+	;what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+	;print, max(what_I_plot), min(what_I_plot)
+	;overvector_x=0
+	;overvector_y=0
+what_I_plot = what_I_plot + 1.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+
+
+;;;;;*************************************** PLOT TITLES
+        ;title_user 	= 	'Surface temperature (K) and Winds 10m ABG (m s!U-1!N)' 
+	;title_user    	= 	'Wind-induced apparent thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+	;title_user 	= 	'Winds 10m ABG (m s!U-1!N)'
+        title_user      =       'Surface temperature (K)'
+        ;subtitle_user   =       'LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        subtitle_user   =       'LT = 02:00am  /  Ls = 173!Uo!N  /  dx = 6km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+	subtitle_user   =       'LT = 02:00am  /  Ls = 120!Uo!N  /  dx = 6km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        title_axis      =       ['East longitude','North latitude']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.78;0.96
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       150.
+        maxfield_init   =       180.
+	;minfield_init	= 	50.
+	;maxfield_init	= 	250.
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.		;; DEF: 20.
+        windex          =       30.             ;; DEF: 20.
+        ;stride          =       1. 		;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.0
+        ;intervaly       =	intervalx
+	intervaly	=	1.0
+
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+	windowx 	= 	[-146.,-126.]        
+	;windowy 	 =	[10.,28.]
+	;windowx 	 = 	[-146.,-128.]
+        ;windowy         =      [12.,26.]
+	windowy 	= 	[11.,27.]
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_profile.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_profile.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_profile.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,152 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER
+	folder 	= '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/' 
+        coord2d = 'false'	;; for non-regular projections  
+filename 	= folder + 'OM6_TI85/wrfout_d01_2024-06-43_06:00:00_zabg' 
+save_ps 	= 'OM6_TI85_profile'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+ini_utc		= 6	;; cf. name of file
+freq		= 1  	;; cf. 1 output per ... hour
+utc_to_lt       = -9    ;; cf. longitude -- LT = UTC + utc_to_lt 
+	use_lt	= 2	;; cf. what user wants
+	use_utc	= use_lt - utc_to_lt 
+        ntime	= (use_utc - ini_utc)/freq	;; TRUE IDL SUBSCRIPT ... ajouter un modulo... 
+        print, 'CHECK ... ', filename, ntime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+zex  = 85
+zey  = 139
+zex2 = 85
+zey2 = 160
+alt = [0.,1.]
+alt = [5.,5000.]
+alt = [0.01, 1000.]
+alt = [10., 1000.]
+;;;;;;;;;;
+nlevel          = 0
+;field1   	= 'TSURF'  	;; comment to trace horizontal velocity
+field1         = 'HFX'       ;; comment to trace horizontal velocity
+no3d 		= 'true'
+overvector_x	= 0		;; comment out to get rid of vectors
+overvector_y	= 0		;; comment out to get rid of vectors
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+	;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+	;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+	;what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+	;print, max(what_I_plot), min(what_I_plot)
+	;overvector_x=0
+	;overvector_y=0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+
+
+;;;;;*************************************** PLOT TITLES
+	title_user	=	'' ;'Vertical wind speed (z-component) (m s!U-1!N)'
+        subtitle_user   =       'LT = 02:00am  /  Ls = 173!Uo!N  /  dx = 6km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        title_axis      =       ['Vertical wind velocity (m s!U-1!N)', 'Altitude above the surface (m)']
+        if (mention eq 'two') then title_axis      =      ['Horizontal wind speed (m s!U-1!N)', 'Altitude above the surface (m)']
+        if (mention eq 'three') then title_axis      =      ['Atmospheric temperature (K)', 'Altitude above the surface (m)']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.96
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       0 ;22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       -15.
+        maxfield_init   =       2.5
+        if (mention eq 'two') then minfield_init   =       0.001
+        if (mention eq 'two') then maxfield_init   =       40.
+        if (mention eq 'three') then minfield_init   =       160.
+        if (mention eq 'three') then maxfield_init   =       230.
+      
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.		;; DEF: 20.
+        windex          =       30.             ;; DEF: 20.
+        ;stride          =       1. 		;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	;overcontour	=	overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.5
+        ;intervaly       =	intervalx
+	intervaly	=	0.1
+        if (mention eq 'two') then intervalx = 5.
+        if (mention eq 'three') then intervalx = 10.
+        
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+	windowx 	= 	[-146.,-126.]        
+	;windowy 	 =	[10.,28.]
+	;windowx 	 = 	[-146.,-128.]
+        ;windowy         =      [12.,26.]
+	windowy 	= 	[11.,27.]
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_tsurf.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_tsurf.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_tsurf.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,139 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER
+	folder 	= '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/' 
+        coord2d = 'false'	;; for non-regular projections  
+filename 	= folder + 'OM6_TI85/wrfout_d01_2024-06-43_06:00:00_zabg' 
+save_ps 	= 'OM6_TI85_tsurf'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+ini_utc		= 6	;; cf. name of file
+freq		= 1  	;; cf. 1 output per ... hour
+utc_to_lt       = -9    ;; cf. longitude -- LT = UTC + utc_to_lt 
+	use_lt	= 2	;; cf. what user wants
+	use_utc	= use_lt - utc_to_lt 
+        ntime	= (use_utc - ini_utc)/freq	;; TRUE IDL SUBSCRIPT ... ajouter un modulo... 
+        print, 'CHECK ... ', filename, ntime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+nlevel          = 0
+field1   	= 'TSURF'  	;; comment to trace horizontal velocity
+no3d 		= 'true'
+overvector_x	= 0		;; comment out to get rid of vectors
+overvector_y	= 0		;; comment out to get rid of vectors
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+	;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+	;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+	;what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+	;print, max(what_I_plot), min(what_I_plot)
+	;overvector_x=0
+	;overvector_y=0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+
+
+;;;;;*************************************** PLOT TITLES
+        ;title_user 	= 	'Surface temperature (K) and Winds 10m ABG (m s!U-1!N)' 
+	;title_user    	= 	'Wind-induced apparent thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+	;title_user 	= 	'Winds 10m ABG (m s!U-1!N)'
+        title_user      =       'Surface temperature (K)'
+        ;subtitle_user   =       'LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        subtitle_user   =       'LT = 02:00am  /  Ls = 173!Uo!N  /  dx = 6km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        title_axis      =       ['East longitude','North latitude']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.80;0.96
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       150.
+        maxfield_init   =       180.
+	;minfield_init	= 	50.
+	;maxfield_init	= 	250.
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.		;; DEF: 20.
+        windex          =       30.             ;; DEF: 20.
+        ;stride          =       1. 		;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.0
+        ;intervaly       =	intervalx
+	intervaly	=	1.0
+
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+	windowx 	= 	[-146.,-126.]        
+	;windowy 	 =	[10.,28.]
+	;windowx 	 = 	[-146.,-128.]
+        ;windowy         =      [12.,26.]
+	windowy 	= 	[11.,27.]
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_winds.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_winds.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/OM6_TI85_winds.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,143 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER
+	folder 	= '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/' 
+        coord2d = 'false'	;; for non-regular projections  
+filename 	= folder + 'OM6_TI85/wrfout_d01_2024-06-43_06:00:00_zabg' 
+save_ps 	= 'OM6_TI85_winds'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+ini_utc		= 6	;; cf. name of file
+freq		= 1  	;; cf. 1 output per ... hour
+utc_to_lt       = -9    ;; cf. longitude -- LT = UTC + utc_to_lt 
+	use_lt	= 2	;; cf. what user wants
+	use_utc	= use_lt - utc_to_lt 
+        ntime	= (use_utc - ini_utc)/freq	;; TRUE IDL SUBSCRIPT ... ajouter un modulo... 
+        print, 'CHECK ... ', filename, ntime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+nlevel          = 0
+field1   	= 'WAVE'  	;; comment to trace horizontal velocity
+;no3d 		= 'true'
+;overvector_x	= 0		;; comment out to get rid of vectors
+;overvector_y	= 0		;; comment out to get rid of vectors
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+        ;a0 = 64.839418 & a1 = 3.1521937 & a2 = 0.0054538848 ;; Ls ~ 173 -- 2AM
+	;;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+	;;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+	;what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+	;print, max(what_I_plot), min(what_I_plot)
+	;;overvector_x=0
+	;;overvector_y=0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+
+
+;;;;;*************************************** PLOT TITLES
+        ;title_user 	= 	'Surface temperature (K) and Winds 10m ABG (m s!U-1!N)' 
+	;title_user    	= 	'Wind-induced apparent thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+	title_user 	= 	'Winds 10m ABG (m s!U-1!N)'
+        ;title_user      =       'Surface temperature (K)'
+        ;subtitle_user   =       'LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        subtitle_user   =       'LT = 02:00am  /  Ls = 173!Uo!N  /  dx = 6km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        title_axis      =       ['East longitude','North latitude']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.80;0.96
+        format          =       '(I0)'
+        format          =       '(F5.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+	;pal		=	4
+	;pal		=	0
+	pal		=	1 ;19; 10 ;2
+
+;;;;;*************************************** FILL LIMITS
+        ;minfield_init   =       150.
+        ;maxfield_init   =       180.
+	minfield_init	= 	-15.
+	maxfield_init	= 	0.
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.		;; DEF: 20.
+        windex          =       20.             ;; DEF: 20.
+        ;stride          =       1. 		;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       5.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.0
+        ;intervaly       =	intervalx
+	intervaly	=	1.0
+
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+	windowx 	= 	[-146.,-126.]        
+	;windowy 	 =	[10.,28.]
+	;windowx 	 = 	[-146.,-128.]
+        ;windowy         =      [12.,26.]
+	windowy 	= 	[11.,27.]
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_MTOT.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_MTOT.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_MTOT.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,125 @@
+;;;;;*************************************** FOLDER
+        folder  = '/tmp7/aslmd/'
+        coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	coord2d = 'polar'       ;; for polar projection with map_set ;; utiliser use_lt=99
+        filename        = folder + 'wrfout_d01_2024-05-02_01:00:00'
+        ini_utc         = 1           ;; cf. name of file
+        freq            = 1           ;; cf. 1 output per ... hour
+        save_ps         = 'POLAR_newphys_RAC_MTOT'
+
+;;;;;*************************************** LVL & FLD & TIME
+        nlevel          = 0
+        use_lt          = 99            ;; cf. what user wants (99 pour tous)
+        field1          = 'MTOT'        ;; comment to trace horizontal velocity
+        field2         = 'SWDOWNZ'           ;; contour
+        ;no3d            = 'true'
+        ;overvector_x    = 0               ;; comment out to get rid of vectors
+        ;overvector_y    = 0               ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        ;what_I_plot = what_I_plot * 1.e6 / 920.
+        ;print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user 	= 	'Water vapor column (precip. microns)' 
+        title_axis      =       ['East longitude','North latitude']
+        ;subtitle_user   = 'LMD_MM'
+        ;;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+        ;;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+        ;subtitle_user   = subtitle_user + ' / Ls = 120!Uo!N'
+        ;subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.85
+        format          =       '(I0)' 
+        colors          =       32
+        pal             =       33              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       0.
+        maxfield_init   =       40.
+        ndiv            =       8
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 0.05 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       30.             ;; DEF: 20.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	;overcontour	=	overcontour/1000.
+        ;lev             =       -10. + 0.5*findgen(80)
+        lev             =       25. + 25. * findgen(20)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        intervalx       =       30.0
+        intervaly       =	05.0
+
+;;;;;*************************************** MAP LIMITS
+	windowx 	= 	[-180.,180.]        
+	windowy 	= 	[65.,90.]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+;;;;;*************************************** SETTING TIME (do not modify)
+        if (n_elements(windowx) eq 0) then windowx = 0 
+        utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+        use_utc         = use_lt - utc_to_lt
+        zentime         = floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... 
+        if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+        print, zentime, ntime
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_QH2Oatm1.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_QH2Oatm1.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_QH2Oatm1.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,124 @@
+;;;;;*************************************** FOLDER
+        folder  = '/tmp7/aslmd/'
+        coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	coord2d = 'polar'       ;; for polar projection with map_set ;; utiliser use_lt=99
+        filename        = folder + 'wrfout_d01_2024-05-02_01:00:00'
+        ini_utc         = 1           ;; cf. name of file
+        freq            = 1           ;; cf. 1 output per ... hour
+        save_ps         = 'POLAR_newphys_RAC_QH2Oatm1'
+
+;;;;;*************************************** LVL & FLD & TIME
+        nlevel          = 0
+        use_lt          = 99            ;; cf. what user wants (99 pour tous)
+        field1          = 'QH2O'       ;; comment to trace horizontal velocity
+        ;field2         = 'XLAT'           ;; contour
+        ;no3d            = 'true'
+        ;overvector_x    = 0               ;; comment out to get rid of vectors
+        ;overvector_y    = 0               ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        what_I_plot = what_I_plot * 1.e6
+        print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user 	= 	'Near-surface water vapor mass mixing ratio (ppm)' 
+        title_axis      =       ['East longitude','North latitude']
+        ;subtitle_user   = 'LMD_MM'
+        ;;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+        ;;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+        ;subtitle_user   = subtitle_user + ' / Ls = 120!Uo!N'
+        ;subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.85
+        format          =       '(I0)' 
+        colors          =       32
+        pal             =       33              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       0.
+        maxfield_init   =       200.
+        ndiv            =       10
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 0.05 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       30.             ;; DEF: 20.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        lev             =       -10. + 0.5*findgen(80)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        intervalx       =       30.0
+        intervaly       =	05.0
+
+;;;;;*************************************** MAP LIMITS
+	windowx 	= 	[-180.,180.]        
+	windowy 	= 	[65.,90.]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+;;;;;*************************************** SETTING TIME (do not modify)
+        if (n_elements(windowx) eq 0) then windowx = 0 
+        utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+        use_utc         = use_lt - utc_to_lt
+        zentime         = floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... 
+        if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+        print, zentime, ntime
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_QSURFICEneg.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_QSURFICEneg.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_QSURFICEneg.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,125 @@
+;;;;;*************************************** FOLDER
+        folder  = '/tmp7/aslmd/'
+        coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	coord2d = 'polar'       ;; for polar projection with map_set ;; utiliser use_lt=99
+        filename        = folder + 'wrfout_d01_2024-05-02_01:00:00'
+        ini_utc         = 1           ;; cf. name of file
+        freq            = 1           ;; cf. 1 output per ... hour
+        save_ps         = 'POLAR_newphys_RAC_QSURFICEneg'
+
+;;;;;*************************************** LVL & FLD & TIME
+        nlevel          = 0
+        use_lt          = 24;99               ;; cf. what user wants (99 pour tous)
+        field1          = 'QSURFICE'       ;; comment to trace horizontal velocity
+        ;field2         = 'XLAT'           ;; contour
+        no3d            = 'true'
+        ;overvector_x    = 0               ;; comment out to get rid of vectors
+        ;overvector_y    = 0               ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        ;what_I_plot = what_I_plot * 0.
+        what_I_plot = abs(what_I_plot * 1.e6 / 920.)
+        ;print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user 	= 	'Hollowed surface water ice (microns)' 
+        title_axis      =       ['East longitude','North latitude']
+        ;subtitle_user   = 'LMD_MM'
+        ;;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+        ;;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+        ;subtitle_user   = subtitle_user + ' / Ls = 120!Uo!N'
+        ;subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.85
+        format          =       '(I0)' 
+        colors          =       32
+        pal             =       33;22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       0.
+        maxfield_init   =       250.
+        ndiv            =       10
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 0.05 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       30.             ;; DEF: 20.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        lev             =       -10. + 0.5*findgen(80)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        intervalx       =       30.0
+        intervaly       =	05.0
+
+;;;;;*************************************** MAP LIMITS
+	windowx 	= 	[-180.,180.]        
+	windowy 	= 	[65.,90.]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+;;;;;*************************************** SETTING TIME (do not modify)
+        if (n_elements(windowx) eq 0) then windowx = 0 
+        utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+        use_utc         = use_lt - utc_to_lt
+        zentime         = floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... 
+        if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+        print, zentime, ntime
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_QSURFICEpos.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_QSURFICEpos.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_QSURFICEpos.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,125 @@
+;;;;;*************************************** FOLDER
+        folder  = '/tmp7/aslmd/'
+        coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	coord2d = 'polar'       ;; for polar projection with map_set ;; utiliser use_lt=99
+        filename        = folder + 'wrfout_d01_2024-05-02_01:00:00'
+        ini_utc         = 1           ;; cf. name of file
+        freq            = 1           ;; cf. 1 output per ... hour
+        save_ps         = 'POLAR_newphys_RAC_QSURFICEpos'
+
+;;;;;*************************************** LVL & FLD & TIME
+        nlevel          = 0
+        use_lt          = 24;99               ;; cf. what user wants (99 pour tous)
+        field1          = 'QSURFICE'       ;; comment to trace horizontal velocity
+        ;field2         = 'XLAT'           ;; contour
+        no3d            = 'true'
+        ;overvector_x    = 0               ;; comment out to get rid of vectors
+        ;overvector_y    = 0               ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        ;what_I_plot = what_I_plot * 0.
+        what_I_plot =  what_I_plot * 1.e6 / 920.
+        ;print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user 	= 	'Deposited surface water ice (microns)' 
+        title_axis      =       ['East longitude','North latitude']
+        ;subtitle_user   = 'LMD_MM'
+        ;;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+        ;;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+        ;subtitle_user   = subtitle_user + ' / Ls = 120!Uo!N'
+        ;subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.85
+        format          =       '(I0)' 
+        colors          =       32
+        pal             =       33              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       0.
+        maxfield_init   =       6.
+        ndiv            =       6
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 0.05 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       30.             ;; DEF: 20.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        lev             =       -10. + 0.5*findgen(80)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        intervalx       =       30.0
+        intervaly       =	05.0
+
+;;;;;*************************************** MAP LIMITS
+	windowx 	= 	[-180.,180.]        
+	windowy 	= 	[65.,90.]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+;;;;;*************************************** SETTING TIME (do not modify)
+        if (n_elements(windowx) eq 0) then windowx = 0 
+        utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+        use_utc         = use_lt - utc_to_lt
+        zentime         = floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... 
+        if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+        print, zentime, ntime
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_TAUTES.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_TAUTES.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/POLAR_newphys_RAC_TAUTES.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,124 @@
+;;;;;*************************************** FOLDER
+        folder  = '/tmp7/aslmd/'
+        coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	coord2d = 'polar'       ;; for polar projection with map_set ;; utiliser use_lt=99
+        filename        = folder + 'wrfout_d01_2024-05-02_01:00:00'
+        ini_utc         = 1           ;; cf. name of file
+        freq            = 1           ;; cf. 1 output per ... hour
+        save_ps         = 'POLAR_newphys_RAC_TAUTES'
+
+;;;;;*************************************** LVL & FLD & TIME
+        nlevel          = 0
+        use_lt          = 99               ;; cf. what user wants (99 pour tous)
+        field1          = 'TAU_ICE'        ;; comment to trace horizontal velocity
+        ;field2         = 'XLAT'           ;; contour
+        no3d            = 'true'
+        ;overvector_x    = 0               ;; comment out to get rid of vectors
+        ;overvector_y    = 0               ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        ;what_I_plot = what_I_plot * 0.
+        ;print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user 	= 	'Water ice cloud optical depth at 825 cm!U-1!N' 
+        title_axis      =       ['East longitude','North latitude']
+        ;subtitle_user   = 'LMD_MM'
+        ;;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+        ;;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+        ;subtitle_user   = subtitle_user + ' / Ls = 120!Uo!N'
+        ;subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.85
+        format          =       '(F5.2)' 
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       0.
+        maxfield_init   =       0.55
+        ndiv            =       11
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       30.             ;; DEF: 20.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        lev             =       -10. + 0.5*findgen(80)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        intervalx       =       30.0
+        intervaly       =	05.0
+
+;;;;;*************************************** MAP LIMITS
+	windowx 	= 	[-180.,180.]        
+	windowy 	= 	[65.,90.]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+;;;;;*************************************** SETTING TIME (do not modify)
+        if (n_elements(windowx) eq 0) then windowx = 0 
+        utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+        use_utc         = use_lt - utc_to_lt
+        zentime         = floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... 
+        if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+        print, zentime, ntime
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/SHARAD_topo.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/SHARAD_topo.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/SHARAD_topo.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,129 @@
+;;;;;*************************************** FOLDER
+        folder  = '/donnees/aslmd/MODELES/MESOSCALE/LMD_MM_MARS/mpi_64/WPS/'
+        ;coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	coord2d = 'polar'       ;; for polar projection with map_set ;; utiliser use_lt=99
+        filename        = folder + 'geo_em.d01.nc'
+        ini_utc         = 6           ;; cf. name of file
+        freq            = 1           ;; cf. 1 output per ... hour
+        save_ps         = 'MOLA_topo'
+
+;;;;;*************************************** LVL & FLD & TIME
+        nlevel          = 0
+        use_lt          = 99               ;; cf. what user wants (99 pour tous)
+        field1          = 'HGT_M'            ;; comment to trace horizontal velocity
+        ;field2         = 'PTOT'           ;; contour
+        ;no3d           = 'true'
+        overvector_x    = 0               ;; comment out to get rid of vectors
+        overvector_y    = 0               ;; comment out to get rid of vectors
+        fieldscoord     = ['XLONG_M','XLAT_M','HGT_M']
+
+;;;;;*************************************** TWEAK VAR
+        what_I_plot = what_I_plot / 1000.
+        ;print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user 	= 	'MOLA Topography' 
+        title_axis      =       ['East longitude','North latitude']
+        ;subtitle_user   = 'LMD_MM'
+        ;;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+        ;;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+        ;subtitle_user   = subtitle_user + ' / Ls = 120!Uo!N'
+        ;subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+filename        = folder + 'paleo/geo_em.d01.nc'
+save_ps         = 'SHARAD_topo'
+title_user      = 'SHARAD Paleo-Topography'
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.85
+        format          =       '(F4.1)' 
+        colors          =       64 
+        pal             =       15 ;33             ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       -6.0
+        maxfield_init   =       -2.5
+        ndiv            =       7
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 0.05 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       30.             ;; DEF: 20.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        lev             =       -10. + 0.5*findgen(30)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        intervalx       =       30.0
+        intervaly       =	05.0
+
+;;;;;*************************************** MAP LIMITS
+	windowx 	= 	[-180.,180.]        
+	windowy 	= 	[70.,90.]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+;;;;;*************************************** SETTING TIME (do not modify)
+        if (n_elements(windowx) eq 0) then windowx = 0 
+        utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+        use_utc         = use_lt - utc_to_lt
+        zentime         = floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... 
+        if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+        print, zentime, ntime
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/THARSIS_newphys_RAC_TAUTES.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/THARSIS_newphys_RAC_TAUTES.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/THARSIS_newphys_RAC_TAUTES.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,124 @@
+;;;;;*************************************** FOLDER
+        folder  = '/tmp7/aslmd/'
+        coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	;coord2d = 'polar'       ;; for polar projection with map_set ;; utiliser use_lt=99
+        filename        = folder + 'RACmeso_RACgcm/wrfout_d01_2024-05-03_01:00:00'
+        ini_utc         = 1           ;; cf. name of file
+        freq            = 1           ;; cf. 1 output per ... hour
+        save_ps         = 'THARSIS_newphys_RAC_TAUTES'
+
+;;;;;*************************************** LVL & FLD & TIME
+        nlevel          = 0
+        use_lt          = 14               ;; cf. what user wants (99 pour tous)
+        field1          = 'TAU_ICE'        ;; comment to trace horizontal velocity
+        ;field2         = 'XLAT'           ;; contour
+        no3d            = 'true'
+        ;overvector_x    = 0               ;; comment out to get rid of vectors
+        ;overvector_y    = 0               ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        ;what_I_plot = what_I_plot * 0.
+        ;print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user 	= 	'Water ice cloud optical depth at 825 cm!U-1!N' 
+        title_axis      =       ['East longitude','North latitude']
+        ;subtitle_user   = 'LMD_MM'
+        ;;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+        ;;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+        ;subtitle_user   = subtitle_user + ' / Ls = 120!Uo!N'
+        ;subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.70
+        format          =       '(F5.2)' 
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       0.
+        maxfield_init   =       0.25
+        ndiv            =       5
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       30.             ;; DEF: 20.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+        overcontour     =       overcontour/1000.
+        lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        intervalx       =       5.0
+        intervaly       =       intervalx
+
+;;;;;*************************************** MAP LIMITS
+        windowx         =       [-150.,-100.]
+        windowy         =       [-15.,35.]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+;;;;;*************************************** SETTING TIME (do not modify)
+        if (n_elements(windowx) eq 0) then windowx = 0 
+        utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+        use_utc         = use_lt - utc_to_lt
+        zentime         = floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... 
+        if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+        print, zentime, ntime
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/THARSIS_newphys_bugnoRAC_RACgcm_TAUTES.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/THARSIS_newphys_bugnoRAC_RACgcm_TAUTES.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/THARSIS_newphys_bugnoRAC_RACgcm_TAUTES.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,132 @@
+;;;;;*************************************** FOLDER
+        folder  = '/home/aslmd/MESOWATERCYCLE/'
+        ;coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	;coord2d = 'polar'       ;; for polar projection with map_set ;; utiliser use_lt=99
+        filename        = folder + 'THARSIS_noBUG.171021/wrfout_d01_2024-05-03_01:00:00'
+        ini_utc         = 1           ;; cf. name of file
+        freq            = 1           ;; cf. 1 output per ... hour
+        save_ps         = 'THARSIS_newphys_RAC_TAUTES'
+filename        = folder + 'THARSIS_noRAC_noBUG.171041/wrfout_d01_2024-05-03_01:00:00'
+save_ps         = 'THARSIS_newphys_noRAC_TAUTES'
+filename        = folder + 'RACmeso_RACgcm/wrfout_d01_2024-05-03_01:00:00'
+save_ps         = 'THARSIS_newphys_bugRAC_TAUTES'
+filename        = folder + 'noRACmeso_noRACgcm/wrfout_d01_2024-05-03_01:00:00'
+save_ps         = 'THARSIS_newphys_bugnoRAC_TAUTES'
+filename        = folder + 'noRACmeso_RACgcm/wrfout_d01_2024-05-03_01:00:00'
+save_ps         = 'THARSIS_newphys_bugnoRAC_RACgcm_TAUTES'
+
+;;;;;*************************************** LVL & FLD & TIME
+        nlevel          = 0
+        use_lt          = 14               ;; cf. what user wants (99 pour tous)
+        field1          = 'TAU_ICE'        ;; comment to trace horizontal velocity
+        ;field2         = 'XLAT'           ;; contour
+        no3d            = 'true'
+        overvector_x    = 0               ;; comment out to get rid of vectors
+        overvector_y    = 0               ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        ;what_I_plot = what_I_plot * 0.
+        ;print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user 	= 	'Water ice cloud optical depth at 825 cm!U-1!N' 
+        title_axis      =       ['East longitude','North latitude']
+        ;subtitle_user   = 'LMD_MM'
+        ;;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+        ;;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+        ;subtitle_user   = subtitle_user + ' / Ls = 120!Uo!N'
+        ;subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.70
+        format          =       '(F5.2)' 
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       0.
+        maxfield_init   =       0.4
+        ndiv            =       8
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       30.             ;; DEF: 20.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+        overcontour     =       overcontour/1000.
+        lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        intervalx       =       5.0
+        intervaly       =       intervalx
+
+;;;;;*************************************** MAP LIMITS
+        windowx         =       [-150.,-100.]
+        windowy         =       [-15.,35.]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+;;;;;*************************************** SETTING TIME (do not modify)
+        if (n_elements(windowx) eq 0) then windowx = 0 
+        utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+        use_utc         = use_lt - utc_to_lt
+        zentime         = floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... 
+        if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+        print, zentime, ntime
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/THARSIS_newphys_noRAC_TAUTES.map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/THARSIS_newphys_noRAC_TAUTES.map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/THARSIS_newphys_noRAC_TAUTES.map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,124 @@
+;;;;;*************************************** FOLDER
+        folder  = '/tmp7/aslmd/'
+        coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	;coord2d = 'polar'       ;; for polar projection with map_set ;; utiliser use_lt=99
+        filename        = folder + 'noRACmeso_noRACgcm/wrfout_d01_2024-05-03_01:00:00'
+        ini_utc         = 1           ;; cf. name of file
+        freq            = 1           ;; cf. 1 output per ... hour
+        save_ps         = 'THARSIS_newphys_noRAC_TAUTES'
+
+;;;;;*************************************** LVL & FLD & TIME
+        nlevel          = 0
+        use_lt          = 14               ;; cf. what user wants (99 pour tous)
+        field1          = 'TAU_ICE'        ;; comment to trace horizontal velocity
+        ;field2         = 'XLAT'           ;; contour
+        no3d            = 'true'
+        ;overvector_x    = 0               ;; comment out to get rid of vectors
+        ;overvector_y    = 0               ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        ;what_I_plot = what_I_plot * 0.
+        ;print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user 	= 	'Water ice cloud optical depth at 825 cm!U-1!N' 
+        title_axis      =       ['East longitude','North latitude']
+        ;subtitle_user   = 'LMD_MM'
+        ;;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+        ;;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+        ;subtitle_user   = subtitle_user + ' / Ls = 120!Uo!N'
+        ;subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.70
+        format          =       '(F5.2)' 
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       0.10
+        maxfield_init   =       0.65
+        ndiv            =       11
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       30.             ;; DEF: 20.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+        overcontour     =       overcontour/1000.
+        lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        intervalx       =       5.0
+        intervaly       =       intervalx
+
+;;;;;*************************************** MAP LIMITS
+        windowx         =       [-150.,-100.]
+        windowy         =       [-15.,35.]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+;;;;;*************************************** SETTING TIME (do not modify)
+        if (n_elements(windowx) eq 0) then windowx = 0 
+        utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+        use_utc         = use_lt - utc_to_lt
+        zentime         = floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... 
+        if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+        print, zentime, ntime
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_static_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_static_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_static_inc.pro	(revision 207)
@@ -0,0 +1,47 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+filename = '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/OM6_TI85/geo_em.d01.nc'
+save_ps  = 'olympus_slope'
+	field1  = 'THERMAL_INERTIA'  ;; omettre trace pentes
+	save_ps  = 'olympus_ti'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(I0)'
+colors        = 32 ;64 ;128 ;32
+pal           = 6 ;39 ;4 ;33 ;4 ;33 ;4 ;22 ;33 ;39 ;6 ;11 ;0 ;11 ;6 ;0 ;6 ;39 ;19 
+	pal   = 4	
+title_user    = 'Slope angle (deg)'
+	title_user    =  'Apparent nighttime thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+title_axis    = ['East longitude','North latitude']
+poscb=0.80
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+	;what_I_plot = what_I_plot / 1000.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; FILL LIMITS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+minfield_init= 0.      
+maxfield_init= 25.    
+	minfield_init= 50.
+	maxfield_init= 250.
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max 
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; WINDS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windex=20.  	;; default: 20.
+stride=3.       ;; default: 5.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; CONTOUR				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+overcontour=overcontour/1000.
+lev=-10. + 2.*findgen(20) 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; AXIS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+intervalx=2.0            
+intervaly=1.0            
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; MAP LIMITS 				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windowx = [-146.,-126.]
+windowy = [11.,27.]
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_static_inc.pro.2
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_static_inc.pro.2	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_static_inc.pro.2	(revision 207)
@@ -0,0 +1,69 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+filename = '/d5/aslmd/WRF_Mars/EN_COURS/OMG_cstTI/geo_em.d03.nc'
+save_ps  = 'meridiani_ti'
+field1  = 'THERMAL_INERTIA'  ;; omettre trace vitesse horizontale
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(I0)'
+colors        = 32
+pal           =  4 ;33 ;4 ;22 ;33 ;39 ;6 ;11 ;0 ;11 ;6 ;0 ;6 ;39 ;19 
+title_user    = 'Apparent nighttime thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+        title_axis      =       ['East longitude','North latitude']
+poscb=0.96
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; FILL LIMITS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;minfield_init= 10.      
+;maxfield_init= 110.    
+minfield_init= 30. ;50.      
+maxfield_init= 230. ;250.    
+minfield_init= 50.      
+maxfield_init= 250.    
+	;minfield_init=1.4
+	;maxfield_init=2.4
+	;what_I_plot = alog(what_I_plot)/alog(10)
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max 
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; WINDS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windex=20.  	;; default: 20.
+stride=3.       ;; default: 5.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; CONTOUR				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+overcontour=overcontour/1000.
+lev=-10. + 0.2*findgen(100) 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; AXIS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+intervalx=0.5            
+intervaly=0.5            
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; MAP LIMITS 				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windowx=[14.0,16.0]        
+windowy=[10.0,12.0]
+
+
+filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/g95_32_single/WPS/geo_em.d01.nc'
+filename = './geo_em.d01.nc'
+;filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/mpi_64/WPS/geo_em.d01.nc'
+filename = '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/OM6_TI85/geo_em.d01.nc'
+save_ps  = 'OM6_TI85_ti'
+lev = -10. + 2.*findgen(20)
+intervalx = 2.
+intervaly = 1.
+windowx = [-146.,-126.]
+windowy = [10.,28.]
+windowx = [-146.,-128.]
+windowy = [12.,26.]
+windowx         =       [-146.,-126.]        
+windowy         =       [11.,27.]
+
+
+title='Slope angle (deg)'
+format='(I0)'
+pal=16
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc.pro	(revision 207)
@@ -0,0 +1,124 @@
+;;;;;*************************************** FOLDER
+        folder  = '/tmp7/aslmd/'
+        coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	coord2d = 'polar'       ;; for polar projection with map_set ;; utiliser use_lt=99
+        filename        = folder + 'wrfout_d01_2024-05-02_01:00:00'
+        ini_utc         = 1           ;; cf. name of file
+        freq            = 1           ;; cf. 1 output per ... hour
+        save_ps         = 'POLAR_newphys_RAC_TAUTES'
+
+;;;;;*************************************** LVL & FLD & TIME
+        nlevel          = 0
+        use_lt          = 99               ;; cf. what user wants (99 pour tous)
+        field1          = 'TAU_ICE'        ;; comment to trace horizontal velocity
+        ;field2         = 'XLAT'           ;; contour
+        no3d            = 'true'
+        ;overvector_x    = 0               ;; comment out to get rid of vectors
+        ;overvector_y    = 0               ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        ;what_I_plot = what_I_plot * 0.
+        ;print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user 	= 	'Water ice cloud optical depth at 825 cm!U-1!N' 
+        title_axis      =       ['East longitude','North latitude']
+        ;subtitle_user   = 'LMD_MM'
+        ;;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+        ;;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+        ;subtitle_user   = subtitle_user + ' / Ls = 120!Uo!N'
+        ;subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.85
+        format          =       '(F5.2)' 
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       0.
+        maxfield_init   =       0.55
+        ndiv            =       11
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       30.             ;; DEF: 20.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        lev             =       -10. + 0.5*findgen(80)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        intervalx       =       30.0
+        intervaly       =	05.0
+
+;;;;;*************************************** MAP LIMITS
+	windowx 	= 	[-180.,180.]        
+	windowy 	= 	[65.,90.]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+;;;;;*************************************** SETTING TIME (do not modify)
+        if (n_elements(windowx) eq 0) then windowx = 0 
+        utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+        use_utc         = use_lt - utc_to_lt
+        zentime         = floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... 
+        if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+        print, zentime, ntime
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc.pro.map
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc.pro.map	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc.pro.map	(revision 207)
@@ -0,0 +1,142 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER
+	folder 	= '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/' 
+        coord2d = 'false'	;; for non-regular projections  
+filename 	= folder + 'OM6_TI85/wrfout_d01_2024-06-43_06:00:00_zabg' 
+save_ps 	= 'OM6_TI85_winds'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+ini_utc		= 6	;; cf. name of file
+freq		= 1  	;; cf. 1 output per ... hour
+utc_to_lt       = -9    ;; cf. longitude -- LT = UTC + utc_to_lt 
+	use_lt	= 2	;; cf. what user wants
+	use_utc	= use_lt - utc_to_lt 
+        ntime	= (use_utc - ini_utc)/freq	;; TRUE IDL SUBSCRIPT ... ajouter un modulo... 
+        print, 'CHECK ... ', filename, ntime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+nlevel          = 0
+field1   	= 'WAVE'  	;; comment to trace horizontal velocity
+;no3d 		= 'true'
+;overvector_x	= 0		;; comment out to get rid of vectors
+;overvector_y	= 0		;; comment out to get rid of vectors
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+        ;a0 = 64.839418 & a1 = 3.1521937 & a2 = 0.0054538848 ;; Ls ~ 173 -- 2AM
+	;;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+	;;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+	;what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+	;print, max(what_I_plot), min(what_I_plot)
+	;;overvector_x=0
+	;;overvector_y=0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+
+
+;;;;;*************************************** PLOT TITLES
+        ;title_user 	= 	'Surface temperature (K) and Winds 10m ABG (m s!U-1!N)' 
+	;title_user    	= 	'Wind-induced apparent thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+	title_user 	= 	'Winds 10m ABG (m s!U-1!N)'
+        ;title_user      =       'Surface temperature (K)'
+        ;subtitle_user   =       'LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        subtitle_user   =       'LT = 02:00am  /  Ls = 173!Uo!N  /  dx = 6km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        title_axis      =       ['East longitude','North latitude']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.96
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+	pal		=	4
+	pal		=	0
+
+;;;;;*************************************** FILL LIMITS
+        ;minfield_init   =       150.
+        ;maxfield_init   =       180.
+	minfield_init	= 	-10.
+	maxfield_init	= 	0.
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.		;; DEF: 20.
+        windex          =       20.             ;; DEF: 20.
+        ;stride          =       1. 		;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       5.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.0
+        ;intervaly       =	intervalx
+	intervaly	=	1.0
+
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+	windowx 	= 	[-146.,-126.]        
+	;windowy 	 =	[10.,28.]
+	;windowx 	 = 	[-146.,-128.]
+        ;windowy         =      [12.,26.]
+	windowy 	= 	[11.,27.]
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc.pro.oldref
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc.pro.oldref	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc.pro.oldref	(revision 207)
@@ -0,0 +1,139 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER
+	folder 	= '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/' 
+        coord2d = 'false'	;; for non-regular projections  
+filename 	= folder + 'OM6_TI85/wrfout_d01_2024-06-43_06:00:00_zabg' 
+save_ps 	= 'OM6_TI85_tsurf'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+ini_utc		= 6	;; cf. name of file
+freq		= 1  	;; cf. 1 output per ... hour
+utc_to_lt       = -9    ;; cf. longitude -- LT = UTC + utc_to_lt 
+	use_lt	= 2	;; cf. what user wants
+	use_utc	= use_lt - utc_to_lt 
+        ntime	= (use_utc - ini_utc)/freq	;; TRUE IDL SUBSCRIPT ... ajouter un modulo... 
+        print, 'CHECK ... ', filename, ntime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+nlevel          = 0
+field1   	= 'TSURF'  	;; comment to trace horizontal velocity
+no3d 		= 'true'
+overvector_x	= 0		;; comment out to get rid of vectors
+overvector_y	= 0		;; comment out to get rid of vectors
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+	;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+	;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+	;what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+	;print, max(what_I_plot), min(what_I_plot)
+	;overvector_x=0
+	;overvector_y=0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+
+
+;;;;;*************************************** PLOT TITLES
+        ;title_user 	= 	'Surface temperature (K) and Winds 10m ABG (m s!U-1!N)' 
+	;title_user    	= 	'Wind-induced apparent thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+	;title_user 	= 	'Winds 10m ABG (m s!U-1!N)'
+        title_user      =       'Surface temperature (K)'
+        ;subtitle_user   =       'LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        subtitle_user   =       'LT = 02:00am  /  Ls = 173!Uo!N  /  dx = 6km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        title_axis      =       ['East longitude','North latitude']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.80;0.96
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       150.
+        maxfield_init   =       180.
+	;minfield_init	= 	50.
+	;maxfield_init	= 	250.
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.		;; DEF: 20.
+        windex          =       30.             ;; DEF: 20.
+        ;stride          =       1. 		;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.0
+        ;intervaly       =	intervalx
+	intervaly	=	1.0
+
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+	windowx 	= 	[-146.,-126.]        
+	;windowy 	 =	[10.,28.]
+	;windowx 	 = 	[-146.,-128.]
+        ;windowy         =      [12.,26.]
+	windowy 	= 	[11.,27.]
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc.pro.profile
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc.pro.profile	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc.pro.profile	(revision 207)
@@ -0,0 +1,152 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FOLDER
+	folder 	= '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/' 
+        coord2d = 'false'	;; for non-regular projections  
+filename 	= folder + 'OM6_TI85/wrfout_d01_2024-06-43_06:00:00_zabg' 
+save_ps 	= 'OM6_TI85_profile'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIME
+ini_utc		= 6	;; cf. name of file
+freq		= 1  	;; cf. 1 output per ... hour
+utc_to_lt       = -9    ;; cf. longitude -- LT = UTC + utc_to_lt 
+	use_lt	= 2	;; cf. what user wants
+	use_utc	= use_lt - utc_to_lt 
+        ntime	= (use_utc - ini_utc)/freq	;; TRUE IDL SUBSCRIPT ... ajouter un modulo... 
+        print, 'CHECK ... ', filename, ntime
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LVL & FLD
+zex  = 85
+zey  = 139
+zex2 = 85
+zey2 = 160
+alt = [0.,1.]
+alt = [5.,5000.]
+alt = [0.01, 1000.]
+alt = [10., 1000.]
+;;;;;;;;;;
+nlevel          = 0
+;field1   	= 'TSURF'  	;; comment to trace horizontal velocity
+field1         = 'HFX'       ;; comment to trace horizontal velocity
+no3d 		= 'true'
+overvector_x	= 0		;; comment out to get rid of vectors
+overvector_y	= 0		;; comment out to get rid of vectors
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TWEAK VAR
+	;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+	;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+	;what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+	;print, max(what_I_plot), min(what_I_plot)
+	;overvector_x=0
+	;overvector_y=0
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
+
+
+;;;;;*************************************** PLOT TITLES
+	title_user	=	'' ;'Vertical wind speed (z-component) (m s!U-1!N)'
+        subtitle_user   =       'LT = 02:00am  /  Ls = 173!Uo!N  /  dx = 6km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+        title_axis      =       ['Vertical wind velocity (m s!U-1!N)', 'Altitude above the surface (m)']
+        if (mention eq 'two') then title_axis      =      ['Horizontal wind speed (m s!U-1!N)', 'Altitude above the surface (m)']
+        if (mention eq 'three') then title_axis      =      ['Atmospheric temperature (K)', 'Altitude above the surface (m)']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.96
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       0 ;22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       -15.
+        maxfield_init   =       2.5
+        if (mention eq 'two') then minfield_init   =       0.001
+        if (mention eq 'two') then maxfield_init   =       40.
+        if (mention eq 'three') then minfield_init   =       160.
+        if (mention eq 'three') then maxfield_init   =       230.
+      
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.		;; DEF: 20.
+        windex          =       30.             ;; DEF: 20.
+        ;stride          =       1. 		;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+	;overcontour	=	overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.5
+        ;intervaly       =	intervalx
+	intervaly	=	0.1
+        if (mention eq 'two') then intervalx = 5.
+        if (mention eq 'three') then intervalx = 10.
+        
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+	windowx 	= 	[-146.,-126.]        
+	;windowy 	 =	[10.,28.]
+	;windowx 	 = 	[-146.,-128.]
+        ;windowy         =      [12.,26.]
+	windowy 	= 	[11.,27.]
+
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+;;;;;***************************************
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc_gen.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc_gen.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/defs/map_uvt_inc_gen.pro	(revision 207)
@@ -0,0 +1,114 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ntime    = 19  ;; le vrai indice IDL 
+nlevel   = 0 ;1 
+filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d03_2024-01-51_06z00z00_zabg' ;;UTC+1h
+save_ps  = 'meridiani'
+;coord2d  = 'true'
+;field1   = 'TSURF'  ;; omettre trace vitesse horizontale
+no3d = 'true'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(I0)'
+colors        = 128
+pal           =  22 ;33 ;39 ;6 ;11 ;0 ;11 ;6 ;0 ;6 ;39 ;19 
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; PLOT TITLES                                ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+title_user = 'Surface temperature (K) and Winds 10m ABG (m s!U-1!N)'
+subtitle_user='LT = 02:00am  /  Ls = 25!Uo!N  /  dx = 2.25km [nest 3]  /  Uniform TI = 65 J m!U-2!N s!U-0.5!N K!U-1!N'        
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; FILL LIMITS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+minfield_init= 150.      
+maxfield_init= 180.    
+;minfield_init= 155.
+;maxfield_init= 175.
+missing_value=1.e30
+;lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max 
+;lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; WINDS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windex=15.  	;; default: 20.
+stride=2.       ;; default: 5.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; CONTOUR				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+overcontour=overcontour/1000.
+lev=-10. + 0.2*findgen(100) 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; AXIS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+intervalx=0.5            
+intervaly=0.5            
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; MAP LIMITS 				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windowx=[14.0,16.0]        
+windowy=[10.0,12.0]
+
+
+;
+; OLYMPUS
+;
+ntime = 8
+filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d01_2024-06-42_18z00z00_zabg' ;;UTC-9h ;;sorties tt 2h
+save_ps = 'olympus'
+subtitle_user='LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 20km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+windex = 30.
+stride = 2.
+lev = -10. + 2.*findgen(20)
+intervalx = 2.            
+intervaly = 2.            
+windowx = [-146.,-126.]        
+windowy = [10.,28.]
+
+filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d01_2024-06-43_18:00:00_zabg' ;;mm chose a 10 km
+save_ps = 'olympus10'
+subtitle_user='LT = 03:00am  /  Ls = 173!Uo!N  /  dx = 10km [single]  /  Uniform TI = 85 J m!U-2!N s!U-0.5!N K!U-1!N'
+stride = 3.
+
+;pal           =  4 ;33 ;4 ;22 ;33 ;39 ;6 ;11 ;0 ;11 ;6 ;0 ;6 ;39 ;19 
+;title_user    = 'Wind-induced apparent thermal inertia (J m!U-2!N s!U-0.5!N K!U-1!N)'
+;minfield_init= 30. ;50.
+;maxfield_init= 230. ;250.
+;a0 = 65.052165 & a1 = 3.1228993 & a2 = 0.0053787417 ;; Ls ~ 173
+;;a0 = 64.039300 & a1 = 3.1378104 & a2 = 0.0055369148 ;; Ls ~ 120
+;what_I_plot = - ( alog ( a1 - what_I_plot / a0 ) ) /  a2
+;print, max(what_I_plot), min(what_I_plot)
+;overvector_x=0
+;overvector_y=0
+
+;minfield_init= 0.
+;maxfield_init= 30.
+
+
+;;
+;; % of error due to winds
+;;
+;pal=4;18;0;22
+;minfield_init=-100.
+;maxfield_init=150.
+;;what_I_plot = 100. * (what_I_plot / 60. - 1.)
+;;what_I_plot = 100. * (what_I_plot / 70. - 1.)
+;;what_I_plot = 100. * (what_I_plot / 85. - 1.)
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max 
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min 
+;;;commenter au dessus
+
+ntime    = 6
+;;filename = '/tmp7/aslmd/results60/wrfout_d01_2024-05-03_06:00:00_zabg'
+;;filename = '/tmp7/aslmd/results70/wrfout_d01_2024-05-03_06:00:00_zabg'
+;;filename = '/tmp7/aslmd/lowres/wrfout_d01_2024-05-01_06:00:00_zabg'
+;filename = '/tmp7/aslmd/wrfout_d01_2024-05-03_06:00:00_zabg'
+;filename = '/tmp7/aslmd/OM6/wrfout_d01_2024-06-43_06:00:00_zabg'
+
+
+windowx = [-146.,-128.]
+windowy = [12.,26.]
+
+;windowx=[-115.,-111.]       ;; grepMAP
+;windowy=[-1.,3.]       ;; grepMAP
+
+title_user = 'Winds 10m ABG (m s!U-1!N)' 
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/map_static.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/map_static.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/map_static.pro	(revision 207)
@@ -0,0 +1,84 @@
+pro map_static
+;
+;
+;
+what_I_plot=0.
+overcontour=0.
+@map_static_inc.pro
+SPAWN, '\rm param_plot.idl ; cp map_static_inc.pro param_plot.idl'
+if (n_elements(coord2d) eq 0) then coord2d='false'
+;
+;
+;
+  zefile=save_ps
+  PS_Start, filename=zefile+'.ps'
+  print, zefile+'.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+;
+;
+;
+if (n_elements(field1) ne 0) then getcdf, file=filename, charvar=field1, invar=cfield1
+getcdf, file=filename, charvar='XLONG_M', invar=longi
+getcdf, file=filename, charvar='XLAT_M', invar=lati
+getcdf, file=filename, charvar='HGT_M', invar=hgt
+getcdf, file=filename, charvar='SLPX', invar=hxwrf
+getcdf, file=filename, charvar='SLPY', invar=hywrf
+
+	hx=hxwrf*1000. & hy=hywrf*1000.
+	;; SLOPE ANGLE vs HORIZONTAL
+	theta=atan(sqrt(hx^2+hy^2)) & theta=180.*theta/!pi ;& theta=round(theta)
+;
+;
+;
+        hgt = smooth(hgt, [2,2], /EDGE_TRUNCATE) ;;; truc
+;
+;
+;
+sp = 5 ;; relaxation width
+nx = n_elements(longi(0,*))
+ny = n_elements(longi(*,0))
+if (n_elements(field1) ne 0) then begin
+	cfield1	= cfield1	(sp:nx-sp-1,sp:ny-sp-1,*,*)
+endif else begin
+	cfield1 = theta         (sp:nx-sp-1,sp:ny-sp-1,*,*)
+endelse
+longi		= longi		(sp:nx-sp-1,sp:ny-sp-1,*)
+lati           	= lati 	        (sp:nx-sp-1,sp:ny-sp-1,*)
+hgt		= hgt		(sp:nx-sp-1,sp:ny-sp-1,*)
+nx = n_elements(longi(0,*))
+ny = n_elements(longi(*,0))
+;
+;
+;
+overcontour = reform(hgt(*,*))
+lon = reform(longi(*,*))
+lat = reform(lati(*,*))
+overvector_x = 0
+overvector_y = 0
+what_I_plot = reform(cfield1(*,*))
+help, what_I_plot, lon, lat
+;
+;
+;
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon, $                                  ; 1D latitude
+        lat, $                                  ; 1D longitude
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+        colors=colors, $                        ; number of colors/levels (32 is default)
+        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+;
+;
+;
+PS_End, /PNG
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/map_uvt.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/map_uvt.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/MAP/map_uvt.pro	(revision 207)
@@ -0,0 +1,202 @@
+pro map_uvt
+;
+;
+;
+what_I_plot=0.
+overcontour=0
+no3d='true'
+@map_uvt_inc.pro
+SPAWN, '\rm param_plot.idl ; cp map_uvt_inc.pro param_plot.idl ; cp -f map_uvt_inc.pro '+save_ps+'.map_uvt_inc.pro'
+if (n_elements(coord2d) eq 0) then coord2d='false'
+if (n_elements(overvector_x) eq 0) then overvector_x = 1  ;; initialisation (!! map_uvt_inc.pro utilise dans map_uvt et map_latlon) 
+;
+;
+;
+if (n_elements(field1) ne 0) then getcdf, file=filename, charvar=field1, invar=cfield1
+if (n_elements(field2) ne 0) then getcdf, file=filename, charvar=field2, invar=cfield2
+if ( ( overvector_x ne 0 ) or ( n_elements(field1) eq 0 ) ) then begin
+   u = getget(filename, 'Um', count=[0,0,1,0], offset=[0,0,nlevel,0])
+   v = getget(filename, 'Vm', count=[0,0,1,0], offset=[0,0,nlevel,0])
+   help, u
+endif
+if (n_elements(fieldscoord) eq 0) then begin
+ getcdf, file=filename, charvar='XLONG', invar=longi
+ getcdf, file=filename, charvar='XLAT', invar=lati
+ getcdf, file=filename, charvar='HGT', invar=hgt
+endif else begin
+ print, 'coordinates are ', fieldscoord
+ getcdf, file=filename, charvar=fieldscoord(0), invar=longi
+ getcdf, file=filename, charvar=fieldscoord(1), invar=lati
+ getcdf, file=filename, charvar=fieldscoord(2), invar=hgt
+endelse
+
+;
+;
+;
+sp = 5 ;; relaxation width
+nx = n_elements(longi(0,*))
+ny = n_elements(longi(*,0))
+if (n_elements(field1) ne 0) then begin
+	if (no3d ne 'true') then cfield1 = cfield1 (sp:nx-sp-1,sp:ny-sp-1,*,*) else cfield1 = cfield1 (sp:nx-sp-1,sp:ny-sp-1,*)
+endif
+if (n_elements(field2) ne 0) then begin
+        if (no3d ne 'true') then cfield2 = cfield2 (sp:nx-sp-1,sp:ny-sp-1,*,*) else cfield2 = cfield2 (sp:nx-sp-1,sp:ny-sp-1,*)
+endif
+if ( ( overvector_x ne 0 ) or ( n_elements(field1) eq 0 ) ) then begin
+  u 		= reform (u		(sp:nx-sp-1,sp:ny-sp-1,0,*) )
+  v       	= reform (v       	(sp:nx-sp-1,sp:ny-sp-1,0,*) )
+endif
+longi		= longi		(sp:nx-sp-1,sp:ny-sp-1,*)
+lati          	= lati 	        (sp:nx-sp-1,sp:ny-sp-1,*)
+hgt		= hgt		(sp:nx-sp-1,sp:ny-sp-1,*)
+nx = n_elements(longi(*,0,0))
+ny = n_elements(longi(0,*,0))
+nt = n_elements(longi(0,0,*))
+if ( overvector_x ne 0 ) then begin  
+  overvector_x = u
+  overvector_y = v
+endif
+;
+;
+;
+                if (ntime eq 99) then begin
+                        PRINT, '-- ALL TIME STEPS', nt-1 
+                        ntstart = 0  & ntend = nt-1 
+                endif else begin
+                        PRINT, '-- ONLY TIME STEP ', string(ntime,'(I0)')
+                        ntstart = ntime & ntend = ntime
+                endelse
+                for ntime = ntstart,ntend do begin
+help, u
+;
+;
+;
+  zefile=save_ps+string(100+ntime,'(I0)')
+  PS_Start, filename=zefile+'.ps'
+  print, zefile+'.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+;
+;
+;
+lon = reform(longi(*,*,ntime))
+lat = reform(lati(*,*,ntime))
+if (n_elements(field1) eq 0) then begin
+        print, 'field1: horizontal velocity'
+		;;;attention attention overvector_x et overvector_y sont vides
+		;zevel = overvector_x^2 + overvector_y^2  ;; attention il faut que les tableaux soient de la meme taille, OK si uvmet
+        zevel = (reform(u(*,*,ntime)))^2 + (reform(v(*,*,ntime)))^2 ;; attention il faut que les tableaux soient de la meme taille, OK si uvmet
+	what_I_plot = sqrt(zevel)
+endif else begin
+	if (no3d ne 'true') then what_I_plot = reform(cfield1(*,*,nlevel,ntime)) else what_I_plot = reform(cfield1(*,*,ntime))
+        if (n_elements(u) ne 0) then overvector_x = reform(u(*,*,ntime))   ;; ne pas utiliser test overvector_x a cause de la boucle temps
+        if (n_elements(v) ne 0) then overvector_y = reform(v(*,*,ntime))   ;; ne pas utiliser test overvector_y a cause de la boucle temps
+endelse
+if (n_elements(field2) eq 0) then begin
+        print, 'field2: topography'
+        overcontour = reform(hgt(*,*,ntime))
+endif else begin
+        if (no3d ne 'true') then overcontour = reform(cfield2(*,*,nlevel,ntime)) else overcontour = reform(cfield2(*,*,ntime))
+endelse
+;
+;
+;
+if ( coord2d eq 'polar' ) then begin
+   print, 'OK YOU USE MAP_SET with POLAR PROJECTION. VECTORS ARE NOT SUPPORTED. USE polar_uv OR ADAPT THIS SCRIPT.'
+   overvector_x = 0 
+   overvector_y = 0
+   if (n_elements(windowx) ne 0) then begin
+       latmin = windowy(0) & latmax = windowy(1) & lonmin = windowx(0) & lonmax = windowx(1)
+   endif else begin
+       latmin = 65. & latmax = 90. & lonmin = -180. & lonmax = 180.
+   endelse
+   print, 'latmin,lonmin,latmax,lonmax', latmin,lonmin,latmax,lonmax
+   map_set, latmax, 0., /isotropic, /azimuthal, /noborder, limit=[latmin,lonmin,latmax,lonmax], title=title_user, /advance
+endif else begin
+  minlat=min(lat) & maxlat=max(lat) & minlon=min(lon) & maxlon=max(lon)
+  if (coord2d eq 'true') then begin
+        ;;;; CECI EST DESORMAIS FAIT DANS MAP_LATLON  
+	;;npoints=n_elements(lon(*,0)) + n_elements(lon(0,*))  ;; trop de points, mais au moins on ne perd rien 
+	;;TRIANGULATE, lon, lat, tr 
+	;;what_I_plot  = GRIDDATA( lon, lat, what_I_plot,  /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN )
+        ;;if ( overvector_x ne 0 ) then begin
+	;;  overvector_x = GRIDDATA( lon, lat, overvector_x, /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN )
+	;;  overvector_y = GRIDDATA( lon, lat, overvector_y, /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN )
+        ;;endif
+        ;;overcontour  = GRIDDATA( lon, lat, overcontour,  /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN )
+        ;;                if ( overvector_x ne 0 ) then begin
+	;;		  ; sale sale sale
+	;;		  if (minlat lt min(lat(*,0))) then overvector_y=-overvector_y
+	;;		  if (minlon lt min(lon(0,*))) then overvector_x=-overvector_x
+        ;;                endif
+        ;;lon =  minlon + (maxlon - minlon)*findgen(npoints)/float(npoints-1)
+        ;;lat =  minlat + (maxlat - minlat)*findgen(npoints)/float(npoints-1)
+  endif else begin
+	lon = reform(lon(*,0))
+	lat = reform(lat(0,*))
+	;;npoints=n_elements(lon(*,0)) + n_elements(lon(0,*))
+        ;;what_I_plot = REBIN( what_I_plot, npoints, npoints )
+        ;;overvector_x = REBIN( overvector_x, npoints, npoints )
+	;;overvector_y = REBIN( overvector_y, npoints, npoints )
+	;;overcontour = REBIN( overcontour, npoints, npoints )
+        ;;lon =  minlon + (maxlon - minlon)*findgen(npoints)/float(npoints-1)
+        ;;lat =  minlat + (maxlat - minlat)*findgen(npoints)/float(npoints-1)
+		;lon = findgen( n_elements(what_I_plot(*,0)) )
+		;lat = findgen( n_elements(what_I_plot(0,*)) )
+		;print, 'ATTENTION!!!! NOUS SOMMES BIEN D ACCORD QUE VOUS NE CHARGEZ PAS UMET et VMET ??'
+  endelse
+                        ;;;;; trouve dans polar_uv.pro
+			;;if (coord2d eq 'regular') then begin ;; carte avec mercator
+			;;	lon = reform(lon(*,0))
+			;;	lat = reform(lat(0,*))
+			;;endif
+endelse
+help, what_I_plot, lon, lat
+print, 'COLOR PLOT min/max ', min(what_I_plot), max(what_I_plot)
+print, 'CONTOUR PLOT min/max ', min(overcontour), max(overcontour)
+print, 'VECTOR PLOT min/max ', min(overvector_x), min(overvector_y)
+;
+;
+;
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon, $                                  ; 1D latitude
+        lat, $                                  ; 1D longitude
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+        colors=colors, $                        ; number of colors/levels (32 is default)
+        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+;
+;
+;
+if ( coord2d eq 'polar' ) then begin    ;;; pourrait aller dans map_latlon
+  loadct, 0
+  MAP_GRID, $
+          CHARSIZE = 1., $
+          COLOR    = 0,   $
+          ;lats=-60, $
+          LABEL    = 1,   $   ;; /LABEL or LABEL=2 (one label any 2 grid lines)
+          LATDEL   = intervaly, $   ;;5 10
+          LONDEL   = intervalx, $   ;;15
+          ;LONLAB   = latmin + intervaly/2., $ ;5. + (latmin+latmax)/2., $ ;0.
+          LONLAB   = (latmin+latmax)/2., $
+          LATLAB   = -0.001, $
+          GLINESTYLE = 2, $
+          GLINETHICK = 0.3
+          ;LONALIGN = 0., $
+          ;LATALIGN = 1.
+endif
+;
+;
+;
+PS_End, /PNG
+		endfor
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/OM6_TI85_tsurf_polar_inc_uv.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/OM6_TI85_tsurf_polar_inc_uv.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/OM6_TI85_tsurf_polar_inc_uv.pro	(revision 207)
@@ -0,0 +1,136 @@
+;;;;;*************************************** FOLDER
+	folder  = '/d5/aslmd/LMD_MM_MARS_SIMUS/OM/'
+        coord2d = 'regular'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	filename        = folder + 'OM6_TI85/wrfout_d01_2024-06-43_06:00:00_zabg'
+	ini_utc         = 6           ;; cf. name of file
+	freq            = 1           ;; cf. 1 output per ... hour
+	save_ps         = 'OM6_TI85_tsurf'
+
+;;;;;*************************************** LVL & FLD & TIME
+	nlevel          = 0 
+	use_lt          = 99 ;12           ;; cf. what user wants (99 pour tous)
+	field1          = 'TSURF'       ;; comment to trace horizontal velocity
+	;field2  	= 'XLAT' 	;; contour
+	no3d            = 'true'
+	;overvector_x    = 0             ;; comment out to get rid of vectors
+	;overvector_y    = 0             ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        ;what_I_plot = what_I_plot * 0.
+        ;print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user    = 'Horizontal wind (m s!U-1!N) 10m AGL'
+	title_user    = 'Horizontal wind vectors 20m AGL'
+	;title_user    = 'Horizontal wind (m s!U-1!N) 20km AMR'
+	title_user	= 'Surface temperature (K)'
+	subtitle_user   = 'LMD_MM'
+	;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+	subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+	subtitle_user   = subtitle_user + ' / Ls = 173!Uo!N'
+	subtitle_user   = subtitle_user + ' / dx = 6km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        ;flag_cb         =       'false'
+        poscb           =       0.96
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11, 19, 0
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =      0;150.
+        maxfield_init   =      0;180.
+
+        ;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+                ;missing_value=1.e30
+                ;lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+                ;lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+                ;;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       30.            ;; DEF: 20.
+        ;windex          =       20.             ;; DEF: 20.
+        ;stride          =       1.             ;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       5.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+        overcontour     =       overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+	;lev		=	-10. + 0.5*findgen(50)
+
+;;;;;*************************************** AXIS
+        ;isotropic       =       'true'		;; DEF: 'true'
+        ;intervalx       =       0.5
+        intervalx       =        2.0
+        ;intervaly       =      intervalx
+        intervaly       =       1.0
+
+;;;;;*************************************** MAP LIMITS
+        windowx         =       [-146.,-126.] 
+        windowy         =       [11.,27.] 
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;;;*************************************** SETTING TIME (do not modify)
+	utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+	use_utc 	= use_lt - utc_to_lt
+	zentime   	= floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... ajouter un modulo...
+	if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/hellas_polar_inc_uv.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/hellas_polar_inc_uv.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/hellas_polar_inc_uv.pro	(revision 207)
@@ -0,0 +1,136 @@
+;;;;;*************************************** FOLDER
+	folder  = '/home/aslmd/ALTIERI/ALTIERI_1HELLAS/'
+        coord2d = 'true'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	filename        = folder + 'wrfout_d01_2024-07-02_06:00:00_zabg'
+	ini_utc         = 6           ;; cf. name of file
+	freq            = 1           ;; cf. 1 output per ... hour
+	save_ps         = 'hellas'
+
+;;;;;*************************************** LVL & FLD & TIME
+	nlevel          = 0 
+	use_lt          = 02. ;-3 ;12 ;14 ;99 ;12           ;; cf. what user wants (99 pour tous, negatif pour indice)
+	;field1          = 'UTSM'        ;; comment to trace horizontal velocity
+	;field2  	= 'XLAT' 	;; contour
+	no3d            = 'true'
+	;overvector_x    = 0             ;; comment out to get rid of vectors
+	;overvector_y    = 0             ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        ;what_I_plot = - what_I_plot 
+        ;print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user    = 'Horizontal wind (m s!U-1!N) 10m AGL'
+	;title_user    = 'Horizontal wind vectors 20m AGL'
+	;title_user    = 'Horizontal wind (m s!U-1!N) 20km AMR'
+	;title_user	= 'Surface temperature (K)'
+	;title_user	= 'Downward sensible heat flux at the surface (W m!U-2!N)'
+	subtitle_user   = 'LMD_MM'
+	subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+	;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+	subtitle_user   = subtitle_user + ' / Ls = 180!Uo!N'
+	subtitle_user   = subtitle_user + ' / dx = 30km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        ;flag_cb         =       'false'
+        poscb           =       0.80
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11, 19, 0
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =      0.
+        maxfield_init   =      20.
+
+        ;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+                missing_value=1.e30
+                lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+                lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+                ;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       20.            ;; DEF: 20.
+        ;windex          =       20.             ;; DEF: 20.
+        ;stride          =       1.             ;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+        overcontour     =       overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 0.5*findgen(50)
+        ;lev             =       -10. + 1.*findgen(40)
+	;lev		=	-10. + 0.5*findgen(50)
+
+;;;;;*************************************** AXIS
+        ;;isotropic       =       'true'		;; DEF: 'true'
+        intervalx       =        5.0
+        intervaly       =      intervalx
+
+;;;;;*************************************** MAP LIMITS
+        windowx         =       [ 40., 90.] 
+        windowy         =       [-65.,-25.] 
+
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;;;*************************************** SETTING TIME (do not modify)
+	utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+	use_utc 	= use_lt - utc_to_lt
+	zentime   	= floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... ajouter un modulo...
+	if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+	if (use_lt lt 0) then ntime = -use_lt 
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/lmd_winds_polar_inc_uv.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/lmd_winds_polar_inc_uv.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/lmd_winds_polar_inc_uv.pro	(revision 207)
@@ -0,0 +1,139 @@
+;;;;;*************************************** FOLDER
+	folder  = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/'
+        coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	filename        = folder + 'wrfout_d01_2024-04-27_06:00:00_zabg'
+	ini_utc         = 6           ;; cf. name of file
+	freq            = 1           ;; cf. 1 output per ... hour
+	save_ps         = 'lmd_winds'
+
+;;;;;*************************************** LVL & FLD & TIME
+	nlevel          = 0 
+	use_lt          = 99 ;12           ;; cf. what user wants (99 pour tous)
+	field1          = 'HGT'       ;; comment to trace horizontal velocity
+	;field2  	= 'XLAT' 	;; contour
+	no3d            = 'true'
+	;overvector_x    = 0             ;; comment out to get rid of vectors
+	;overvector_y    = 0             ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        ;what_I_plot = what_I_plot * 0.
+        ;print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user    = 'Horizontal wind (m s!U-1!N) 10m AGL'
+	title_user    = 'Horizontal wind vectors 20m AGL'
+	;title_user    = 'Horizontal wind (m s!U-1!N) 20km AMR'
+	subtitle_user   = 'LMD_MM'
+	;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+	subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+	subtitle_user   = subtitle_user + ' / Ls = 102!Uo!N'
+	subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'false'
+        poscb           =       0.75 ;0.95
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11, 19, 0
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =      -5000.
+        maxfield_init   =      -2000.
+
+        ;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+                missing_value=1.e30
+                lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+                lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+                ;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       10.            ;; DEF: 20.
+        ;windex          =       20.             ;; DEF: 20.
+        ;stride          =       1.             ;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       5.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+        overcontour     =       overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        ;lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+	lev		=	-10. + 0.5*findgen(50)
+
+;;;;;*************************************** AXIS
+        ;isotropic       =       'true'		;; DEF: 'true'
+        ;intervalx       =       0.5
+        intervalx       =        20.
+        intervaly       =      intervalx
+        ;intervaly       =       1.0
+
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+        ;windowx         =       [-42.,-26.]
+        ;windowy         =      	[-34.,-20.]
+	windowx         =       [40.,200.]
+        windowy         =       [40.,200.]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;;;*************************************** SETTING TIME (do not modify)
+	utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+	use_utc 	= use_lt - utc_to_lt
+	zentime   	= floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... ajouter un modulo...
+	if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_hfx_polar_inc_uv.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_hfx_polar_inc_uv.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_hfx_polar_inc_uv.pro	(revision 207)
@@ -0,0 +1,144 @@
+;;;;;*************************************** FOLDER
+	folder  = '/home/aslmd/POLAR/POLAR_APPERE_highres/'
+        coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	filename        = folder + 'wrfout_d01_2024-03-04_06:00:00_zabg'
+	ini_utc         = 6           ;; cf. name of file
+	freq            = 1           ;; cf. 1 output per ... hour
+	save_ps         = 'polar_hfx'
+
+;;;;;*************************************** LVL & FLD & TIME
+	nlevel          = 0 
+	use_lt          = -3 ;12 ;14 ;99 ;12           ;; cf. what user wants (99 pour tous, negatif pour indice)
+	field1          = 'HFX'       ;; comment to trace horizontal velocity
+	;field2  	= 'XLAT' 	;; contour
+	no3d            = 'true'
+	;overvector_x    = 0             ;; comment out to get rid of vectors
+	;overvector_y    = 0             ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        what_I_plot = - what_I_plot 
+        print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user    = 'Horizontal wind (m s!U-1!N) 10m AGL'
+	title_user    = 'Horizontal wind vectors 20m AGL'
+	;title_user    = 'Horizontal wind (m s!U-1!N) 20km AMR'
+	;title_user	= 'Surface temperature (K)'
+	title_user	= 'Downward sensible heat flux at the surface (W m!U-2!N)'
+	subtitle_user   = 'LMD_MM'
+	;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+	;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+	subtitle_user   = subtitle_user + ' / Ls = 61!Uo!N'
+	subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        ;flag_cb         =       'false'
+        poscb           =       0.68 ;0.80
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       0              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11, 19, 0
+	pal=33
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =      -5.
+        maxfield_init   =      15.
+
+        ;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+                missing_value=1.e30
+                lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+                lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+                ;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       20.            ;; DEF: 20.
+        ;windex          =       20.             ;; DEF: 20.
+        ;stride          =       1.             ;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+;stride          = 1.
+stride=3.
+
+;;;;;*************************************** CONTOUR
+        overcontour     =       overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+       ;lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+	lev		=	-10. + 0.5*findgen(50)
+
+;;;;;*************************************** AXIS
+        ;isotropic       =       'true'		;; DEF: 'true'
+        intervalx       =     10.0
+        intervaly       =     intervalx
+	title_axis      = ['x grid point', 'y grid point']
+
+;;;;;*************************************** MAP LIMITS
+        windowx         =       [50,190] 
+        windowy         =       [40,160] 
+windowx         =       [60,180]
+     ;windowx         =       [060,110]
+     ;windowy         =       [100,150]
+     ;windowx         =       [090,120]
+     ;windowy         =       [050,080]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;;;*************************************** SETTING TIME (do not modify)
+	utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+	use_utc 	= use_lt - utc_to_lt
+	zentime   	= floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... ajouter un modulo...
+	if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+	if (use_lt lt 0) then ntime = -use_lt 
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc.pro	(revision 207)
@@ -0,0 +1,28 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ntime    = 10
+nlevel   = 0
+filename = './wrfout_d01_2024-07-03_06:00:00_z'
+save_ps  = 'polar'
+cfield1  = 'W'
+cfield2  = 'HGT'
+cfield3 = 'SWDOWNZ'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(F4.1)'
+colors        = 32 ;128
+minfield_init = -2.50
+maxfield_init = 2.50
+pal           =  33 ;39 ;6 ;11 ;0 ;11 ;6 ;0 ;6 ;39 ;19 
+title_user    = ''
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+lim_blank = 0.5 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+overcontour = overcontour / 1000.
+lev = -16. + 2.*findgen(40)
+;lev = [1, 100, 200, 300, 400, 500]
+flag_cb = 'false'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_topo.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_topo.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_topo.pro	(revision 207)
@@ -0,0 +1,45 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ntime    = 0
+nlevel   = 0
+latmin = -90 & latmax = 20 & lonmin = -180 & lonmax = 180
+filename = '/donnees/aslmd/MODELES//LMD_MM_MARS/mpi_64/WPS/geo_em.d01.nc' & save_ps  = 'polar1'
+filename = '/donnees/aslmd/MODELES//LMD_MM_MARS/mpi_64/WPS/geo_em.d02.nc' & save_ps  = 'polar2'
+filename = '/donnees/aslmd/MODELES//LMD_MM_MARS/mpi_64/WPS/geo_em.d03.nc' & save_ps  = 'polar3'
+filename = '/donnees/aslmd/MODELES//LMD_MM_MARS/mpi_64/WPS/geo_em.d04.nc' & save_ps  = 'polar4'
+latmin = -40 & latmax = -10 & lonmin = -45 & lonmax = -15
+filename = '/donnees/aslmd/MODELES//LMD_MM_MARS/mpi_64/WPS/geo_em.d04.nc' & save_ps  = 'polarz4'
+filename = '/donnees/aslmd/MODELES//LMD_MM_MARS/mpi_64/WPS/geo_em.d03.nc' & save_ps  = 'polarz3'
+filename = '/donnees/aslmd/MODELES//LMD_MM_MARS/mpi_64/WPS/geo_em.d02.nc' & save_ps  = 'polarz2'
+filename = '/donnees/aslmd/MODELES//LMD_MM_MARS/mpi_64/WPS/geo_em.d01.nc' & save_ps  = 'polarz1'
+latmin = -30 & latmax = -24 & lonmin = -38 & lonmax = -32
+filename = '/donnees/aslmd/MODELES//LMD_MM_MARS/mpi_64/WPS/geo_em.d04.nc' & save_ps  = 'polarzzz4'
+cfield1  = 'HGT_M'
+;cfield1  = 'THERMAL_INERTIA'
+cfield2  = 'HGT_M'
+cfield3  = 'HGT_M'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(I0)'
+colors        = 128
+minfield_init = -8000 
+maxfield_init = +12000
+pal           =  33 ;39 ;6 ;11 ;0 ;11 ;6 ;0 ;6 ;39 ;19 
+;minfield_init = 150.
+;maxfield_init = 550.
+;pal           =  3
+minfield_init = -2500
+maxfield_init = +1500
+pal           =  33  
+title_user    = ''
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+;lim_blank = 0.5 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+overcontour = overcontour / 1000.
+lev = -10. + 1.*findgen(40)
+lev = -10. + 0.5*findgen(80)
+flag_cb = 'false'
+flag_cb = 'true'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_topo.pro.intercomp
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_topo.pro.intercomp	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_topo.pro.intercomp	(revision 207)
@@ -0,0 +1,46 @@
+        model = 'LMD_MMM' & interptype = '_zabg' & numnest = '1' & nlevel = 0 & cfield1  = 'HGT' & lonfield = 'XLONG' & latfield = 'XLAT'
+        ;model = 'LMD_MMM' & interptype = '_zabg' & numnest = '2' & nlevel = 0 & cfield1  = 'HGT' & lonfield = 'XLONG' & latfield = 'XLAT'
+        ;model = 'LMD_MMM' & interptype = '_zabg' & numnest = '3' & nlevel = 0 & cfield1  = 'HGT' & lonfield = 'XLONG' & latfield = 'XLAT'
+        ;model = 'LMD_MMM' & interptype = '_zabg' & numnest = '4' & nlevel = 0 & cfield1  = 'HGT' & lonfield = 'XLONG' & latfield = 'XLAT'
+        ;model = 'MRAMS'   & interptype = '_zabg' & numnest = '1' & nlevel = 0 & cfield1  = 'topo' & lonfield = 'glon' & latfield = 'glat'
+        ;model = 'MRAMS'   & interptype = '_zabg' & numnest = '2' & nlevel = 0 & cfield1  = 'topo' & lonfield = 'glon' & latfield = 'glat'
+        ;model = 'MRAMS'   & interptype = '_zabg' & numnest = '3' & nlevel = 0 & cfield1  = 'topo' & lonfield = 'glon' & latfield = 'glat'
+        ;model = 'MRAMS'   & interptype = '_zabg' & numnest = '4' & nlevel = 0 & cfield1  = 'topo' & lonfield = 'glon' & latfield = 'glat'
+
+;;;;;*************************************** FOLDER etc...
+        folder  = '../INTERCOMP/' + model + '/'
+        filename        = folder + model + '_d0'+numnest+'_2024-05-57_06:00:00'
+        filename        = filename + interptype
+        save_ps         = model + numnest + interptype + string(nlevel,'(I0)') + '_HGT';___'
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+latmin = -90 & latmax = 40 & lonmin = -180 & lonmax = 180  ;; vue complete nest 1
+;latmin = -90 & latmax = 20 & lonmin = -90 & lonmax = 30 ;-0.0001  ;; vue d'un quartier nest2
+;latmin = -40 & latmax = -10 & lonmin = -60 & lonmax = -15  ;; vue quartier un peu plus zoom
+;latmin = -30 & latmax = -24 & lonmin = -38 & lonmax = -32  ;; vue centree nest 4
+;latmin = -30 & latmax = -20 & lonmin = -45 & lonmax = -30  ;; vue centree nest 4
+;
+cfield2  = cfield1
+cfield3  = cfield1
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(I0)'
+colors        = 128
+minfield_init = -8000. 
+maxfield_init = +12000.
+pal           =  33 ;39 ;6 ;11 ;0 ;11 ;6 ;0 ;6 ;39 ;19 
+	minfield_init = -2500.
+	maxfield_init = +1500.
+title_user    = ''
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+;lim_blank = 0.5 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+overcontour = overcontour / 1000.
+lev = -10. + 1.*findgen(40)
+lev = -10. + 0.5*findgen(80)
+flag_cb = 'false'
+;flag_cb = 'true'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro	(revision 207)
@@ -0,0 +1,143 @@
+;;;;;*************************************** FOLDER
+	folder  = '../INTERCOMP/lmd/'
+        ;coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	filename        = folder + 'wrfout_d03_2024-05-59_06:00:00_zabg'
+	ini_utc         = 6           ;; cf. name of file
+	freq            = 1           ;; cf. 1 output per ... hour
+	save_ps         = 'lmd_winds'
+
+;;;;;*************************************** LVL & FLD & TIME
+	nlevel          = 0 ;1 ;0
+	use_lt          = 12           ;; cf. what user wants
+	;field1          = 'TSURF'       ;; comment to trace horizontal velocity
+	;field2  	= 'XLAT' 	;; contour
+	no3d            = 'true'
+	;overvector_x    = 0             ;; comment out to get rid of vectors
+	;overvector_y    = 0             ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        ;what_I_plot = what_I_plot * 100.
+        ;print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user    = 'Horizontal wind (m s!U-1!N) 20m AGL'
+	;title_user    = 'Horizontal wind (m s!U-1!N) 6km AMR'
+	;title_user    = 'Horizontal wind (m s!U-1!N) 20km AMR'
+	subtitle_user   = 'LMD_MM'
+filename = '../INTERCOMP/mrams/holden_ls150-S-g3_day316.nc_zabg'
+save_ps = 'mrams_winds'
+model = 'mrams'
+subtitle_user   = 'MRAMS'
+	subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+	;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+	subtitle_user   = subtitle_user + ' / Ls = 149!Uo!N'
+	subtitle_user   = subtitle_user + ' / dx = 27km [N3]'
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+        poscb           =       0.75 ;0.95
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       22              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11, 19, 0
+        ;pal             =       4
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       00.
+        maxfield_init   =       30.
+
+        ;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+                missing_value=1.e30
+                lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+                lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+                ;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        ;windex          =       10.            ;; DEF: 20.
+        windex          =       20.             ;; DEF: 20.
+        ;stride          =       1.             ;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+        overcontour     =       overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        ;lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+	lev		=	-10. + 0.5*findgen(50)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'		;; DEF: 'true'
+        ;intervalx       =       0.5
+        intervalx       =       2.0
+        intervaly       =      intervalx
+        ;intervaly       =       1.0
+
+;;;;;*************************************** MAP LIMITS
+        ;windowx         =       [-144.,-126.] 
+        ;windowy         =       [10.,26.] 
+        windowx         =       [-42.,-26.]
+        windowy         =      	[-34.,-20.]
+
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;;;*************************************** SETTING TIME (do not modify)
+	utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+	use_utc 	= use_lt - utc_to_lt
+	zentime   	= floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... ajouter un modulo...
+	;ntime = zentime  ;; A COMMENTER SI ON VEUT TOUS LES TEMPS
+
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.appere
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.appere	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.appere	(revision 207)
@@ -0,0 +1,65 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ntime    = 7  ;; le vrai indice IDL 
+nlevel   = 2 
+filename = '/tmp15/aslmd/polar_61pts/wrfout_d01_2024-03-04_06:00:00_zabg'
+;filename = '/tmp15/aslmd/polar_61pts/wrfout_d01_2024-03-02_06:00:00_zabg'
+save_ps  = 'mesoscale_polar_winds_friction'
+;coord2d  = 'true' 
+field1   = 'USTM'  ;; omettre trace vitesse horizontale
+	;field1  = 'HGT'  ;; shaded
+	;field2  = 'XLAT' ;; contour 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(F5.2)'
+colors        =  32
+pal           =  22 ;33 ;39 ;6 ;11 ;0 ;11 ;6 ;0 ;6 ;39 ;19 
+title_user    = ''
+title_axis    = ['grid points','grid points']
+title_user      = 'Friction velocity 50m ABG (m s!U-1!N) + Horizontal wind vectors'
+	;title_user      = 'Topography (m) + Horizontal wind vectors 50m ABG'
+subtitle_user   = 'LMD Mars Mesoscale / UTC = 01:00pm / Ls = 61.5!Uo!N / dx = 25km / single domain'
+poscb=0.85
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; FILL LIMITS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+minfield_init= +00.1      
+maxfield_init= +00.6 
+	;format        = '(I0)'   
+	;minfield_init= -6500.
+	;maxfield_init= -1500.
+	;pal = 19
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max 
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min 
+;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; WINDS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windex=12.  	;; default: 20.
+stride=2.       ;; default: 5.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; CONTOUR				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;overcontour=overcontour-mean(overcontour)      
+overcontour=overcontour/1000.
+lev=-10. + 0.2*findgen(100) 
+lev=-10. + 0.5*findgen(50) 
+;lev=-10. + 0.1*findgen(200)
+;lev=0
+	overcontour=-overcontour
+	lev=0.2*findgen(200)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; AXIS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;isotropic='false'       ;; default: true
+;intervalx=0.5            
+;intervaly=0.5            
+intervalx=5.
+intervaly=5.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; MAP LIMITS 				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;windowx=[-51.0,-41.0]        
+;windowy=[78.0,88.0]
+windowx=[5.,55.]
+windowy=[5.,55.]
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.appere.2
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.appere.2	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.appere.2	(revision 207)
@@ -0,0 +1,144 @@
+;;;;;*************************************** FOLDER
+	folder  = '/home/aslmd/POLAR/POLAR_APPERE_highres/'
+        coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	filename        = folder + 'wrfout_d01_2024-03-04_06:00:00_zabg'
+	ini_utc         = 6           ;; cf. name of file
+	freq            = 1           ;; cf. 1 output per ... hour
+	save_ps         = 'polar_hfx'
+
+;;;;;*************************************** LVL & FLD & TIME
+	nlevel          = 0 
+	use_lt          = -3 ;12 ;14 ;99 ;12           ;; cf. what user wants (99 pour tous, negatif pour indice)
+	field1          = 'HFX'       ;; comment to trace horizontal velocity
+	;field2  	= 'XLAT' 	;; contour
+	no3d            = 'true'
+	;overvector_x    = 0             ;; comment out to get rid of vectors
+	;overvector_y    = 0             ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        what_I_plot = - what_I_plot 
+        print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user    = 'Horizontal wind (m s!U-1!N) 10m AGL'
+	title_user    = 'Horizontal wind vectors 20m AGL'
+	;title_user    = 'Horizontal wind (m s!U-1!N) 20km AMR'
+	;title_user	= 'Surface temperature (K)'
+	title_user	= 'Downward sensible heat flux at the surface (W m!U-2!N)'
+	subtitle_user   = 'LMD_MM'
+	;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+	;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+	subtitle_user   = subtitle_user + ' / Ls = 61!Uo!N'
+	subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        ;flag_cb         =       'false'
+        poscb           =       0.68 ;0.80
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       0              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11, 19, 0
+	pal=33
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =      -5.
+        maxfield_init   =      15.
+
+        ;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+                missing_value=1.e30
+                lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+                lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+                ;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       20.            ;; DEF: 20.
+        ;windex          =       20.             ;; DEF: 20.
+        ;stride          =       1.             ;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+;stride          = 1.
+stride=3.
+
+;;;;;*************************************** CONTOUR
+        overcontour     =       overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+       ;lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+	lev		=	-10. + 0.5*findgen(50)
+
+;;;;;*************************************** AXIS
+        ;isotropic       =       'true'		;; DEF: 'true'
+        intervalx       =     10.0
+        intervaly       =     intervalx
+	title_axis      = ['x grid point', 'y grid point']
+
+;;;;;*************************************** MAP LIMITS
+        windowx         =       [50,190] 
+        windowy         =       [40,160] 
+windowx         =       [60,180]
+     ;windowx         =       [060,110]
+     ;windowy         =       [100,150]
+     ;windowx         =       [090,120]
+     ;windowy         =       [050,080]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;;;*************************************** SETTING TIME (do not modify)
+	utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+	use_utc 	= use_lt - utc_to_lt
+	zentime   	= floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... ajouter un modulo...
+	if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+	if (use_lt lt 0) then ntime = -use_lt 
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.bak
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.bak	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.bak	(revision 207)
@@ -0,0 +1,61 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;ntime    = 7  ;; le vrai indice IDL 
+nlevel   = 0 
+filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d03_2024-06-20_06:00:00_zabg'
+filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d03_2024-06-20_06:00:00_z'
+filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d03_2024-06-20_06:00:00_z' & nlevel=1
+save_ps  = 'nest_polar_winds'
+;filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d01_2024-06-20_06:00:00_z'
+;save_ps  = 'single_polar_winds'
+;filename = '/tmp7/aslmd/one_more_nest/test/wrfout_d02_2024-06-19_06:00:00_zabg'
+;save_ps  = '2nest_polar_winds'
+
+;coord2d  = 'false'  ;; si on veut grid point coordinates ;;CHANGER windowx and windowy
+;field1   = 'HGT'  ;; omettre trace vitesse horizontale
+;field2  = 'XLAT' ;; contour 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(I0)' ;'(F4.1)' ;'(I0)' 
+colors        =  32
+pal           =  22 ;19 ;22 ;33 ;39 ;6 ;11 ;0 ;11 ;6 ;0 ;6 ;39 ;19 
+title_user    = 'Horizontal wind (m s!U-1!N) 20m AGL'
+title_user    = 'Horizontal wind (m s!U-1!N) 6km AMR'
+title_user    = 'Horizontal wind (m s!U-1!N) 20km AMR'
+subtitle_user   = 'LMD Mars Mesoscale'
+subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am'
+subtitle_user   = subtitle_user + ' / Ls = 160!Uo!N'
+subtitle_user   = subtitle_user + ' / dx = 12km' 
+subtitle_user   = subtitle_user + ' / nest 3'
+poscb=0.95
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; FILL LIMITS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+minfield_init= 30. ;0.
+maxfield_init= 60. ;30.
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max 
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min 
+;;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; WINDS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windex=50. ;25.  	;; default: 20.
+stride=5.       ;; default: 5.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; CONTOUR				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;overcontour=overcontour-mean(overcontour)      
+overcontour=overcontour/1000.
+lev=-10. + 0.5*findgen(50) 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; AXIS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;isotropic='false'       ;; default: true
+intervalx=2.
+intervaly=2.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; MAP LIMITS                                 ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windowx=[-42.,-26.]
+windowy=[-34.,-20.]
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.masse
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.masse	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.masse	(revision 207)
@@ -0,0 +1,65 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ntime    = 7  ;; le vrai indice IDL 
+nlevel   = 2 
+filename = '/tmp15/aslmd/polar_61pts/wrfout_d01_2024-03-04_06:00:00_zabg'
+;filename = '/tmp15/aslmd/polar_61pts/wrfout_d01_2024-03-02_06:00:00_zabg'
+save_ps  = 'mesoscale_polar_winds'
+;coord2d  = 'true' 
+field1   = 'USTM'  ;; omettre trace vitesse horizontale
+	field1  = 'HGT'  ;; shaded
+	;field2  = 'XLAT' ;; contour 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(F5.2)'
+colors        =  32
+pal           =  22 ;33 ;39 ;6 ;11 ;0 ;11 ;6 ;0 ;6 ;39 ;19 
+title_user    = ''
+title_axis    = ['grid points','grid points']
+title_user      = 'Friction velocity 50m ABG (m s!U-1!N) + Horizontal wind vectors'
+	title_user      = 'Topography (m) + Horizontal wind vectors 50m ABG'
+subtitle_user   = 'LMD Mars Mesoscale / UTC = 01:00pm / Ls = 61.5!Uo!N / dx = 25km / single domain'
+poscb=0.85
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; FILL LIMITS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+minfield_init= +00.1      
+maxfield_init= +00.6 
+	format        = '(I0)'   
+	minfield_init= -6500.
+	maxfield_init= -1500.
+	pal = 19
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max 
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min 
+;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; WINDS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windex=12.  	;; default: 20.
+stride=2.       ;; default: 5.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; CONTOUR				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;overcontour=overcontour-mean(overcontour)      
+overcontour=overcontour/1000.
+lev=-10. + 0.2*findgen(100) 
+lev=-10. + 0.5*findgen(50) 
+;lev=-10. + 0.1*findgen(200)
+lev=0
+	;overcontour=-overcontour
+	;lev=0.2*findgen(200)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; AXIS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;isotropic='false'       ;; default: true
+;intervalx=0.5            
+;intervaly=0.5            
+intervalx=5.
+intervaly=5.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; MAP LIMITS 				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;windowx=[-51.0,-41.0]        
+;windowy=[78.0,88.0]
+windowx=[5.,55.]
+windowy=[5.,55.]
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.masse.2
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.masse.2	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro.masse.2	(revision 207)
@@ -0,0 +1,84 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ntime    = 7  ;; le vrai indice IDL 
+ntime    = 1
+ntime    = 20
+nlevel   = 2 
+filename = '/d5/aslmd/LMD_MM_MARS_SIMUS/polar_61pts/wrfout_d01_2024-03-04_06:00:00_zabg'
+;filename = '/tmp15/aslmd/polar_61pts/wrfout_d01_2024-03-02_06:00:00_zabg'
+save_ps  = 'mesoscale_polar_winds_friction'
+	filename = '/tmp15/aslmd/polar_61pts/wrfout_d01_2024-03-04_06:00:00_zabg'
+	save_ps  = 'mesoscale_polar_winds_friction_hires'
+;coord2d  = 'true' 
+field1   = 'USTM'  ;; omettre trace vitesse horizontale
+		;field1  = 'HGT'  ;; shaded
+			;field2  = 'XLAT' ;; contour 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(F5.2)'
+colors        =  32
+pal           =  22 ;33 ;39 ;6 ;11 ;0 ;11 ;6 ;0 ;6 ;39 ;19 
+title_user    = ''
+title_axis    = ['grid points','grid points']
+title_user      = 'Friction velocity (m s!U-1!N) + Horizontal wind vectors 50m ABG'
+		;title_user      = 'Topography (m) + Horizontal wind vectors 50m ABG'
+subtitle_user   = 'LMD Mars Mesoscale'
+;subtitle_user   = subtitle_user + ' / UTC = 01:00pm'
+subtitle_user   = subtitle_user + ' / Ls = 61.5!Uo!N'
+subtitle_user   = subtitle_user + ' / dx = 10km' ;25km'
+subtitle_user   = subtitle_user + ' / single domain'
+poscb=0.85
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; FILL LIMITS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+minfield_init= +00.1      
+maxfield_init= +00.6 
+		;format        = '(I0)'   
+		;minfield_init= -6500.
+		;maxfield_init= -1500.
+		;pal = 19
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max 
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min 
+;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; WINDS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windex=12.  	;; default: 20.
+stride=2.       ;; default: 5.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; CONTOUR				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;overcontour=overcontour-mean(overcontour)      
+overcontour=overcontour/1000.
+lev=-10. + 0.2*findgen(100) 
+lev=-10. + 0.5*findgen(50) 
+;lev=-10. + 0.1*findgen(200)
+lev=0
+		overcontour=-overcontour
+		lev=0.2*findgen(200)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; AXIS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;isotropic='false'       ;; default: true
+;intervalx=0.5            
+;intervaly=0.5            
+intervalx=5.
+intervaly=5.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; MAP LIMITS 				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;windowx=[-51.0,-41.0]        
+;windowy=[78.0,88.0]
+windowx=[5.,55.]
+windowy=[5.,55.]
+
+windex=12.
+stride=4.
+windowx=[40.,200.]
+windowy=[20.,180.]
+intervalx=10.
+intervaly=10.
+                ;windex=25.
+                ;stride=1.
+		;windowx=[130.,160.]
+		;windowy=[130.,160.]
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro_polar
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro_polar	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro_polar	(revision 207)
@@ -0,0 +1,136 @@
+;;;;;*************************************** FOLDER
+	folder  = '/home/aslmd/polar_61pts/'
+        coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy
+	filename        = folder + 'wrfout_d01_2024-03-04_06:00:00_zabg'
+	ini_utc         = 6           ;; cf. name of file
+	freq            = 1           ;; cf. 1 output per ... hour
+	save_ps         = 'polar_hfx'
+
+;;;;;*************************************** LVL & FLD & TIME
+	nlevel          = 0 
+	use_lt          = -3 ;12 ;14 ;99 ;12           ;; cf. what user wants (99 pour tous, negatif pour indice)
+	field1          = 'HFX'       ;; comment to trace horizontal velocity
+	;field2  	= 'XLAT' 	;; contour
+	no3d            = 'true'
+	;overvector_x    = 0             ;; comment out to get rid of vectors
+	;overvector_y    = 0             ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        what_I_plot = - what_I_plot 
+        print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user    = 'Horizontal wind (m s!U-1!N) 10m AGL'
+	title_user    = 'Horizontal wind vectors 20m AGL'
+	;title_user    = 'Horizontal wind (m s!U-1!N) 20km AMR'
+	;title_user	= 'Surface temperature (K)'
+	title_user	= 'Downward sensible heat flux at the surface (W m!U-2!N)'
+	subtitle_user   = 'LMD_MM'
+	;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+	subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+	subtitle_user   = subtitle_user + ' / Ls = 61!Uo!N'
+	subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        ;flag_cb         =       'false'
+        poscb           =       0.80
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       0              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11, 19, 0
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =      -5.
+        maxfield_init   =      15.
+
+        ;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+                missing_value=1.e30
+                lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+                lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+                ;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       20.            ;; DEF: 20.
+        ;windex          =       20.             ;; DEF: 20.
+        ;stride          =       1.             ;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       5.              ;; DEF: 5.
+
+;;;;;*************************************** CONTOUR
+        overcontour     =       overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+        lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+	;lev		=	-10. + 0.5*findgen(50)
+
+;;;;;*************************************** AXIS
+        ;isotropic       =       'true'		;; DEF: 'true'
+        intervalx       =        10.0
+        intervaly       =      intervalx
+
+;;;;;*************************************** MAP LIMITS
+        windowx         =       [50,190] 
+        windowy         =       [40,160] 
+
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;;;*************************************** SETTING TIME (do not modify)
+	utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+	use_utc 	= use_lt - utc_to_lt
+	zentime   	= floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... ajouter un modulo...
+	if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+	if (use_lt lt 0) then ntime = -use_lt 
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro_ref
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro_ref	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro_ref	(revision 207)
@@ -0,0 +1,144 @@
+;;;;;*************************************** FOLDER
+	folder  = '/home/aslmd/POLAR/POLAR_APPERE_highres/'
+        coord2d = 'false'       ;; for non-regular projections  ;;CHANGER windowx and windowy  ;; egalement 'regular'
+	filename        = folder + 'wrfout_d01_2024-03-04_06:00:00_zabg'
+	ini_utc         = 6           ;; cf. name of file
+	freq            = 1           ;; cf. 1 output per ... hour
+	save_ps         = 'polar_hfx'
+
+;;;;;*************************************** LVL & FLD & TIME
+	nlevel          = 0 
+	use_lt          = -3 ;12 ;14 ;99 ;12           ;; cf. what user wants (99 pour tous, negatif pour indice)
+	field1          = 'HFX'       ;; comment to trace horizontal velocity
+	;field2  	= 'XLAT' 	;; contour
+	no3d            = 'true'
+	;overvector_x    = 0             ;; comment out to get rid of vectors
+	;overvector_y    = 0             ;; comment out to get rid of vectors
+
+;;;;;*************************************** TWEAK VAR
+        what_I_plot = - what_I_plot 
+        print, max(what_I_plot), min(what_I_plot)
+
+;;;;;*************************************** PLOT TITLES
+        title_user    = 'Horizontal wind (m s!U-1!N) 10m AGL'
+	title_user    = 'Horizontal wind vectors 20m AGL'
+	;title_user    = 'Horizontal wind (m s!U-1!N) 20km AMR'
+	;title_user	= 'Surface temperature (K)'
+	title_user	= 'Downward sensible heat flux at the surface (W m!U-2!N)'
+	subtitle_user   = 'LMD_MM'
+	;subtitle_user   = subtitle_user + ' / LT = '+string(use_lt,'(I0)')+'h'
+	;subtitle_user   = subtitle_user + ' / UTC!D0!N = 06:00am' ;; pour les series
+	subtitle_user   = subtitle_user + ' / Ls = 61!Uo!N'
+	subtitle_user   = subtitle_user + ' / dx = 10km [S]'
+
+;;;;;*************************************** COLOR TABLES
+        ;flag_cb         =       'false'
+        poscb           =       0.68 ;0.80
+        format          =       '(I0)'
+        ;format          =       '(F4.1)' 
+        ;colors          =       128
+        colors          =       32
+        pal             =       0              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11, 19, 0
+	pal=33
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =      -5.
+        maxfield_init   =      15.
+
+        ;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+                missing_value=1.e30
+                lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+                lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+                ;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** WINDS
+        windex          =       20.            ;; DEF: 20.
+        ;windex          =       20.             ;; DEF: 20.
+        ;stride          =       1.             ;; DEF: 5.
+        ;stride          =       2.              ;; DEF: 5.
+        stride          =       3.              ;; DEF: 5.
+;stride          = 1.
+stride=3.
+
+;;;;;*************************************** CONTOUR
+        overcontour     =       overcontour/1000.
+        ;lev             =       50. + 50.*findgen(20)
+        ;lev             =       -10. + 0.2*findgen(20)
+       ;lev             =       -10. + 2.*findgen(20)
+        ;lev             =       -10. + 1.*findgen(40)
+	lev		=	-10. + 0.5*findgen(50)
+
+;;;;;*************************************** AXIS
+        ;isotropic       =       'true'		;; DEF: 'true'
+        intervalx       =     10.0
+        intervaly       =     intervalx
+	title_axis      = ['x grid point', 'y grid point']
+
+;;;;;*************************************** MAP LIMITS
+        windowx         =       [50,190] 
+        windowy         =       [40,160] 
+windowx         =       [60,180]
+     ;windowx         =       [060,110]
+     ;windowy         =       [100,150]
+     ;windowx         =       [090,120]
+     ;windowy         =       [050,080]
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;;;*************************************** SETTING TIME (do not modify)
+	utc_to_lt       = mean(windowx) / 15.    ;; cf. longitude -- LT = UTC + utc_to_lt
+	use_utc 	= use_lt - utc_to_lt
+	zentime   	= floor(((24 + use_utc - ini_utc) MOD 24)/freq)        ;; TRUE IDL SUBSCRIPT... ajouter un modulo...
+	if (use_lt ne 99) then ntime = zentime else ntime = 99    ;; ou commenter pour avoir tous les pas de temps
+	if (use_lt lt 0) then ntime = -use_lt 
+
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+;;;;;***************************************;;;;;
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.             ;; grepSEC
+;maxalt=40.             ;; grepSEC
+;minspace=0.0           ;; grepSEC
+;maxspace=35.0          ;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.        ;; grepSEC
+;space=space*60. & spacekm='true'       ;; grepSEC
+;minspace=minspace*60./factor           ;; grepSEC
+;maxspace=maxspace*60./factor           ;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0                                          ;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2       ;; 2/4 grepMAP
+;what_I_plot(0,0)=0.                            ;; 3/4 grepMAP
+;flag_cb='false'                                        ;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value)     ;; 2/9 grepALL
+;what_I_plot[w]=0.                              ;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value)     ;; 4/9 grepALL
+;what_I_plot[w]=0.75                            ;; 5/9 grepALL
+;w=where(what_I_plot eq 0.)                     ;; 6/9 grepALL
+;what_I_plot[w]=missing_value                           ;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.      ;; 8/9 grepALL
+;flag_cb='false'                                ;; 9/9 grepALL
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro_sav
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro_sav	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro_sav	(revision 207)
@@ -0,0 +1,80 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ntime    = 8  ;; le vrai indice IDL 
+nlevel   = 0 
+filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d04_2024-06-20_06:00:00_zabg' 
+filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d01_2024-06-20_06:00:00_zabg'
+save_ps  = 'uvsingle_utc14'
+;filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d03_2024-06-20_06:00:00_zabg'
+;coord2d  = 'true' & save_ps  = 'uvnest3_utc14'
+;field1  = 'WAVE'  ;; omettre trace vitesse horizontale
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(F4.1)'
+colors        = 128
+pal           =  22 ;33 ;39 ;6 ;11 ;0 ;11 ;6 ;0 ;6 ;39 ;19 
+title_user    = ''
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; FILL LIMITS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+minfield_init= +00.      
+maxfield_init= +20.    
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max 
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min 
+;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; WINDS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windex=20.  	;; default: 20.
+stride=3.       ;; default: 5.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; CONTOUR				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;overcontour=overcontour-mean(overcontour)      
+overcontour=overcontour/1000.
+lev=-10. + 0.2*findgen(100) 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; AXIS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;isotropic='false'       ;; default: true
+intervalx=0.5            
+intervaly=0.5            
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; MAP LIMITS 				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windowx=[-36.0,-32.0]        
+windowy=[-28.0,-24.5]
+
+intervalx=1.0
+intervaly=1.0
+windowx=[-41.0,-31.0]
+windowy=[-32.0,-22.0]
+stride=2.
+minfield_init= +00.
+maxfield_init= +15.
+windex=15.
+
+
+
+;filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d01_2024-06-20_06:00:00_z'
+;save_ps  = 'uvsingle_utc14_10km'
+;;filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d03_2024-06-20_06:00:00_z'
+;;coord2d  = 'true' & save_ps  = 'uvsingle_utc14_10km'
+;intervalx=1.0
+;intervaly=1.0
+;windowx=[-50.0,-30.0]
+;windowy=[-40.0,-20.0]
+;stride=5.
+;minfield_init= +00.
+;maxfield_init= +40.
+;windex=30.
+
+filename='/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d01_2024-07-03_06:00:00_z'     
+save_ps  = 'windgw'
+intervalx=1.0 & intervaly=1.0
+windowx=[ 0., 180.] & windowy=[-90.,-40.]
+stride=5. & windex=60.
+minfield_init= +00. & maxfield_init= +40.
+lev=-10. + 0.1*findgen(200)
+
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro_winds
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro_winds	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_uv.pro_winds	(revision 207)
@@ -0,0 +1,61 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;ntime    = 7  ;; le vrai indice IDL 
+nlevel   = 0 
+filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d03_2024-06-20_06:00:00_z'
+save_ps  = 'nest_polar_winds'
+filename = '/donnees/aslmd/MODELES/LMD_MM_MARS/OUTILS_CONVERSION/wrfout_d01_2024-06-20_06:00:00_z'
+save_ps  = 'single_polar_winds'
+;filename = '/tmp7/aslmd/one_more_nest/test/wrfout_d02_2024-06-19_06:00:00_zabg'
+;save_ps  = '2nest_polar_winds'
+
+;coord2d  = 'true' 
+field1   = 'HGT'  ;; omettre trace vitesse horizontale
+;field2  = 'XLAT' ;; contour 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(I0)' ;'(F5.2)'
+colors        =  32
+pal           =  19 ;22 ;33 ;39 ;6 ;11 ;0 ;11 ;6 ;0 ;6 ;39 ;19 
+title_user    = 'Topography (m) + Horizontal wind vectors 6km ABG'
+title_axis    = ['grid points','grid points']
+subtitle_user   = 'LMD Mars Mesoscale'
+;subtitle_user   = subtitle_user + ' / UTC = 01:00pm'
+;subtitle_user   = subtitle_user + ' / Ls = 61.5!Uo!N'
+;subtitle_user   = subtitle_user + ' / dx = 10km' ;25km'
+;subtitle_user   = subtitle_user + ' / single domain'
+poscb=0.85
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; FILL LIMITS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+minfield_init= -3000.
+maxfield_init= +3000.
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max 
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min 
+;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; WINDS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windex=25.  	;; default: 20.
+stride=5.       ;; default: 5.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; CONTOUR				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;overcontour=overcontour-mean(overcontour)      
+overcontour=overcontour/1000.
+lev=-10. + 0.2*findgen(100) 
+lev=-10. + 0.5*findgen(50) 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; AXIS				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;isotropic='false'       ;; default: true
+intervalx=20.
+intervaly=20.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; MAP LIMITS 				       ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+windowx=[0.,120.]
+windowy=[0.,120.]
+windowx=[40.,140.]
+windowy=[40.,140.]
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_w.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_w.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polar_inc_w.pro	(revision 207)
@@ -0,0 +1,57 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ntime    = 2 
+nlevel   = 1 
+latmin = -90 & latmax = 20 & lonmin = -180 & lonmax = 180 & hem = -1.
+latmin = -40 & latmax = -10 & lonmin = -45 & lonmax = -15 & hem = -1.
+filename = '/tmp1/aslmd/wrfout_d01_2024-06-17_06:00:00' & save_ps  = 'wpolarz1'
+;filename = '/tmp1/aslmd/wrfout_d02_2024-06-17_06:00:00' & save_ps  = 'wpolarz2'
+;filename = '/tmp1/aslmd/wrfout_d03_2024-06-17_06:00:00' & save_ps  = 'wpolarz3'
+;filename = '/tmp1/aslmd/wrfout_d04_2024-06-17_06:00:00' & save_ps  = 'wpolarz4'
+latmin = -30 & latmax = -24 & lonmin = -38 & lonmax = -32
+filename = '/tmp1/aslmd/wrfout_d04_2024-06-17_06:00:00' & save_ps  = 'wpolarzz4'
+cfield1  = 'WAVE'
+cfield2  = 'HGT'
+;cfield3  = 'HGT_M'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(F4.1)'
+colors        = 128
+minfield_init = -8. 
+maxfield_init = +2.
+pal           =  22 ;33 ;39 ;6 ;11 ;0 ;11 ;6 ;0 ;6 ;39 ;19 
+title_user    = ''
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+;lim_blank = 0.5 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+overcontour = overcontour / 1000.
+lev = -10. + 1.*findgen(40)
+;flag_cb = 'false'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;
+;; T. Appere paper
+;;
+latmin = 76 & latmax = 90. & lonmin = -180 & lonmax = 180 & hem = 1.
+ntime    = 0  ;; le vrai indice IDL 
+nlevel   = 0
+filename = '/tmp15/aslmd/polar_61pts/wrfout_d01_2024-03-04_06:00:00_zabg'
+save_ps  = 'appere'
+cfield1  = 'USTM'
+minfield_init = 0.1
+maxfield_init = 0.6
+pal           =  22
+format        = '(F5.2)'
+colors        = 32
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+lev = -10. + 0.2*findgen(50)
+;lev = -10. + 0.5*findgen(20)
+overcontour = - overcontour
+lev = 0.5*findgen(20)
+lev = 0.2*findgen(50)
+
+
+
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polaract_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polaract_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/defs/polaract_inc.pro	(revision 207)
@@ -0,0 +1,36 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+filename = 'wrfout_d01_2024-07-03_06:00:00_z'
+;filename = 'wrfout_d01_2024-07-02_06:00:00_z'
+;filename = 'wrfout_d01_2024-07-04_06:00:00_z'
+;filename = 'wrfout_d01_2024-07-99_06:00:00_z' ;;1234
+filename = 'wrfout_d01_2024-07-234_06:00:00_z' ;;234
+;filename = 'wrfout_d01_2024-07-34_06:00:00_z'
+;filename = 'wrfout_d01_2024-07-23_06:00:00_z'
+save_ps  = 'polar'
+cfield1  = 'W'
+cfield2  = 'HGT'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+format        = '(F4.1)'
+colors        = 32 ;128
+minfield_init = -5000.
+maxfield_init = 5000.
+pal           =  0 ;4;16;22 ;33 ;39 ;11 ;0 39 19 ;NON: 6,11
+title_user    = ''
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+missing_value=1.e30
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+;lim_blank = 1.5 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+;overcontour = overcontour / 1000.
+;lev = -16. + 2.*findgen(40)
+lev = [0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6.]
+;lev = [0.5, 0.8,1.2,1.6,2.0] 
+;lev = [0.75, 1.,2.,3.]
+lev = [0.2, 0.3, 0.5, 1., 2., 3., 5., 10.]
+;lev = [0.3, 0.5, 1., 2., 3., 5., 10.]
+;lev = [0.25, 0.5, 0.75, 1.]
+flag_cb = 'false'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar.README
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar.README	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar.README	(revision 207)
@@ -0,0 +1,12 @@
+polar_topo : vieux (trace des cartes 2D en projection polaire)
+polar_w : trace avec map-set
+polar_uv : trace sans map-set et avec winds possible // avec map-set commente
+
+profile_uvt pour un profil
+
+map_uvt est un vieux truc, non OK pour tracer hors des poles
+
+
+GW studies with Francesca
+polaract
+polar
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar.pro	(revision 207)
@@ -0,0 +1,123 @@
+pro polar
+;
+;
+;
+what_I_plot=0.
+overcontour=0.
+@polar_inc.pro
+SPAWN, '\rm param_plot.idl ; cp polar_inc.pro param_plot.idl'
+;
+;
+;
+  ;zefile=save_ps
+  ;PS_Start, filename=zefile+'.ps'
+  ;print, zefile+'.ps'
+  ;;!p.multi=[0,3,2]
+  ;;!p.multi=[0,3,1] 
+  ;!p.multi=[0,2,2]
+  ;!P.Charsize = 0.6
+;
+;
+;
+        jojo = ['gw','gwsmooth']
+        ;jojo = ['gwhires','gw']
+        jojo = ['gw/30km']
+filename_sav = filename
+for i=0,n_elements(jojo)-1 do begin
+;
+filename = '/donnees/aslmd/MODELES//LMD_MM_MARS//OUTILS_CONVERSION/'+jojo(i)+'/'+filename_sav
+print, filename
+;
+getcdf, file=filename, charvar=cfield1, invar=field1
+getcdf, file=filename, charvar=cfield2, invar=field2
+getcdf, file=filename, charvar=cfield3, invar=field3
+getcdf, file=filename, charvar='XLONG', invar=longi
+getcdf, file=filename, charvar='XLAT', invar=lati
+;
+;
+;
+
+for ntime = 0, n_elements(field1(0,0,0,*))-1 do begin
+;  for ntime = 11, n_elements(field1(0,0,0,*))-1, 5 do begin
+;for ntime = 16, n_elements(field1(0,0,0,*))-1, 5 do begin
+
+;for ntime = 06, n_elements(field1(0,0,0,*))-1, 5 do begin
+
+	;;; MOVIE MOVIE MOVIE
+	zefile=save_ps+string(100+ntime,'(I0)')
+	PS_Start, filename=zefile+'.ps'
+	;!P.Charsize = 1.2
+	;!p.charthick = 2.0
+	;!p.thick = 2.0
+	;!x.thick = 2.0
+	;!y.thick = 2.0
+;
+;
+;
+latmin = -90. & latmax = -50.01 & lonmin = -180. & lonmax = 180.
+map_set, -90., 0., /isotropic, /azimuthal, /noborder, limit=[latmin,lonmin,latmax,lonmax],title=title_user,/advance ;, position=[0.10, 0.12, 0.90, 0.92]
+;
+;
+;
+what_I_plot = reform(field1(*,*,nlevel,ntime))
+overcontour = reform(field2(*,*,ntime))
+lon = reform(longi(*,*,ntime))
+lat = reform(lati (*,*,ntime))
+overvector_x=0.
+overvector_y=0.
+;
+;
+;
+	;loadct, 0
+	;w=where(overcontour lt -5000.) & overcontour[w]=-5000.
+	;contour, overcontour, lon, lat, /cell_fill, nlevels=32, /overplot ;& overcontour=0
+;
+;
+;
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon, $                                  ; 1D latitude
+        lat, $                                  ; 1D longitude
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+        colors=colors, $                        ; number of colors/levels (32 is default)
+        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+;
+;
+;
+loadct, 0
+contour, reform(field3(*,*,ntime)), $
+	lon,lat, $
+        /overplot, $ 
+	levels=[1,100,200,300], $
+	c_labels=[0,1,0,1], $
+        c_thick=1.5, $ 
+	;c_linestyle=2,$
+	color=0;255
+;
+;
+;
+loadct, 0
+MAP_GRID, CHARSIZE = 0.6, $
+          COLOR    = 0,   $
+          LABEL    = 1,   $   ;(one label any 1 grid lines)
+          LATDEL   = 05., $   
+          LONDEL   = 45., $   
+          lats=-60, $
+          GLINESTYLE = 1, $
+          GLINETHICK = 0.1, $
+          LONLAB   = -70., $ 
+          LATLAB   = (lonmin+lonmax)/2.
+;
+;
+;
+PS_End, /PNG
+ endfor
+  endfor
+;PS_End, /PNG
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_topo.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_topo.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_topo.pro	(revision 207)
@@ -0,0 +1,104 @@
+pro polar_topo
+;
+;
+;
+what_I_plot=0.
+overcontour=0.
+@polar_inc_topo.pro
+SPAWN, '\rm param_plot.idl ; cp polar_inc_topo.pro param_plot.idl'
+;
+;
+;
+  zefile=save_ps
+  PS_Start, filename=zefile+'.ps'
+  print, zefile+'.ps'
+  ;!p.multi=[0,2,2]
+  ;!P.Charsize = 0.6
+;
+;
+;
+getcdf, file=filename, charvar=cfield1, invar=field1
+getcdf, file=filename, charvar=cfield2, invar=field2
+getcdf, file=filename, charvar=cfield3, invar=field3
+getcdf, file=filename, charvar='XLONG_M', invar=longi
+getcdf, file=filename, charvar='XLAT_M', invar=lati
+;
+;
+;
+
+;zefile=save_ps+string(100+ntime,'(I0)')
+;PS_Start, filename=zefile+'.ps'
+;!P.Charsize = 1.2
+;!p.charthick = 2.0
+;!p.thick = 2.0
+;!x.thick = 2.0
+;!y.thick = 2.0
+;
+;
+;
+	;latmin = -90. & latmax = 10.0 & lonmin = -180. & lonmax = 180.
+map_set, -90., 0., /isotropic, /azimuthal, /noborder, limit=[latmin,lonmin,latmax,lonmax],title=title_user,/advance ;, position=[0.10, 0.12, 0.90, 0.92]
+;
+;
+;
+what_I_plot = field1
+overcontour = field2
+lon = longi
+lat = lati
+overvector_x=0.
+overvector_y=0.
+;
+;
+;
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon, $                                  ; 1D latitude
+        lat, $                                  ; 1D longitude
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+        colors=colors, $                        ; number of colors/levels (32 is default)
+        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+;;
+;;
+;;
+;loadct, 0
+;contour, reform(field3(*,*,ntime)), $
+;	lon,lat, $
+;        /overplot, $ 
+;	levels=[1,100,200], $
+;	c_labels=[0,0,0], $
+;        c_thick=1.5, $
+;	color=255
+
+;
+;
+;
+loadct, 0
+MAP_GRID, $
+          CHARSIZE = 1., $
+          COLOR    = 0,   $
+        ;  LABEL    = 2,   $   ;; /LABEL or LABEL=2 (one label any 2 grid lines)
+	;          LATDEL   = 10., $   ;;5
+	;          LONDEL   = 30., $   ;;15
+	;lats=-60, $
+	;          LONLAB   = -70., $ ;(latmin+latmax)/2., $
+	;          LATLAB   = (lonmin+lonmax)/2., $
+          LABEL    = 1,   $   ;; /LABEL or LABEL=2 (one label any 2 grid lines)
+          LATDEL   = 10., $   ;;5
+          LONDEL   = 15., $   ;;15
+          LONLAB   = -0., $ ;(latmin+latmax)/2., $
+          LATLAB   = -0.001, $
+          GLINESTYLE = 2, $
+          GLINETHICK = 0.3
+	  ;LONALIGN = 0., $
+	  ;LATALIGN = 1.
+
+;;
+;;
+PS_End, /PNG
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_topo.pro.intercomp
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_topo.pro.intercomp	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_topo.pro.intercomp	(revision 207)
@@ -0,0 +1,112 @@
+pro polar_topo
+;
+;
+;
+what_I_plot=0.
+overcontour=0.
+@polar_inc_topo.pro
+SPAWN, '\rm param_plot.idl ; cp polar_inc_topo.pro param_plot.idl'
+;
+;
+;
+  zefile=save_ps
+  PS_Start, filename=zefile+'.ps'
+  print, zefile+'.ps'
+  ;!p.multi=[0,2,2]
+  ;!P.Charsize = 0.6
+;
+;
+;
+getcdf, file=filename, charvar=cfield1, invar=field1
+getcdf, file=filename, charvar=cfield2, invar=field2
+getcdf, file=filename, charvar=cfield3, invar=field3
+getcdf, file=filename, charvar=lonfield, invar=longi
+getcdf, file=filename, charvar=latfield, invar=lati
+;
+;
+;
+
+;zefile=save_ps+string(100+ntime,'(I0)')
+;PS_Start, filename=zefile+'.ps'
+;!P.Charsize = 1.2
+;!p.charthick = 2.0
+;!p.thick = 2.0
+;!x.thick = 2.0
+;!y.thick = 2.0
+;
+;
+;
+	;latmin = -90. & latmax = 10.0 & lonmin = -180. & lonmax = 180.
+map_set, -90., 0., /isotropic, /azimuthal, /noborder, limit=[latmin,lonmin,latmax,lonmax],title=title_user,/advance ;, position=[0.10, 0.12, 0.90, 0.92]
+;
+;
+;
+what_I_plot = reform(field1(*,*,0))
+overcontour = reform(field2(*,*,0))
+lon = reform(longi(*,*,0))
+lat = reform(lati(*,*,0))
+overvector_x=0.
+overvector_y=0.
+
+;contour, what_I_plot, lon, lat
+;PS_End, /PNG
+;stop
+
+;
+;
+;
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon, $                                  ; 1D latitude
+        lat, $                                  ; 1D longitude
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+        colors=colors, $                        ; number of colors/levels (32 is default)
+        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+;;
+;;
+;;
+;loadct, 0
+;contour, reform(field3(*,*,ntime)), $
+;	lon,lat, $
+;        /overplot, $ 
+;	levels=[1,100,200], $
+;	c_labels=[0,0,0], $
+;        c_thick=1.5, $
+;	color=255
+					;PS_End, /PNG
+					;end
+;
+;
+;
+loadct, 0
+MAP_GRID, $
+          CHARSIZE = 1., $
+          COLOR    = 0,   $
+        ;  LABEL    = 2,   $   ;; /LABEL or LABEL=2 (one label any 2 grid lines)
+	;          LATDEL   = 10., $   ;;5
+	;          LONDEL   = 30., $   ;;15
+	;lats=-60, $
+	;          LONLAB   = -70., $ ;(latmin+latmax)/2., $
+	;          LATLAB   = (lonmin+lonmax)/2., $
+;LATLAB   = lonmax, $
+;LABEL    = 1,   $   
+	LABEL    = 2,   $   
+	LATDEL   = 10., $   
+	LONDEL   = 15., $   
+	LONLAB   = latmax, $ 
+	LATLAB   = -0.001, $
+          GLINESTYLE = 2, $
+          GLINETHICK = 0.3
+	  ;LONALIGN = 0., $
+	  ;LATALIGN = 1.
+
+;;
+;;
+PS_End, /PNG
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_uv.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_uv.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_uv.pro	(revision 207)
@@ -0,0 +1,178 @@
+pro polar_uv
+;
+;
+;
+what_I_plot=0.
+overcontour=0.
+@polar_inc_uv.pro
+SPAWN, '\rm param_plot.idl ; cp polar_inc_uv.pro param_plot.idl ; cp -f polar_inc_uv.pro '+save_ps+'_polar_inc_uv.pro'
+if (n_elements(coord2d) eq 0) then coord2d='true'
+if (n_elements(model) eq 0) then model='LMD_MMM'
+;
+;
+;
+if (n_elements(field1) ne 0) then getcdf, file=filename, charvar=field1, invar=cfield1
+getcdf, file=filename, charvar='Um', invar=u
+getcdf, file=filename, charvar='Vm', invar=v
+case model of
+'LMD_MMM': begin
+  getcdf, file=filename, charvar='XLONG', invar=longi
+  getcdf, file=filename, charvar='XLAT', invar=lati
+  getcdf, file=filename, charvar='HGT', invar=hgt
+end
+'MRAMS': begin
+  getcdf, file=filename, charvar='topo', invar=hgt
+  getcdf, file=filename, charvar='glat', invar=lati
+  getcdf, file=filename, charvar='glon', invar=longi
+end
+endcase
+if (n_elements(field2) ne 0) then getcdf, file=filename, charvar=field2, invar=cfield2
+;
+;
+;
+	;sp = 5 ;; relaxation width
+	;nx = n_elements(longi(0,*))
+	;ny = n_elements(longi(*,0))
+	;if (n_elements(field1) ne 0) then begin
+	;	cfield1	= cfield1	(sp:nx-sp-1,sp:ny-sp-1,*,*)
+	;endif
+	;if (n_elements(field2) ne 0) then begin
+	;        cfield2 = cfield2       (sp:nx-sp-1,sp:ny-sp-1,*,*)
+	;endif
+	;u 		= u		(sp:nx-sp-1,sp:ny-sp-1,*,*) 
+	;v       	= v       	(sp:nx-sp-1,sp:ny-sp-1,*,*)
+	;longi		= longi		(sp:nx-sp-1,sp:ny-sp-1,*)
+	;lati          	= lati 	        (sp:nx-sp-1,sp:ny-sp-1,*)
+	;hgt		= hgt		(sp:nx-sp-1,sp:ny-sp-1,*)
+	;nx = n_elements(longi(0,*))
+	;ny = n_elements(longi(*,0))
+;
+;
+;
+;latmin = -90. & latmax = -50.0 & lonmin = -180. & lonmax = 180.
+;map_set, -90., 0., /isotropic, /azimuthal, /noborder, limit=[latmin,lonmin,latmax,lonmax],title=title_user,/advance 
+;latmin = 75. & latmax = 90.0 & lonmin = -180. & lonmax = 180.
+;map_set, 90., 0., /isotropic, /azimuthal, /noborder, limit=[latmin,lonmin,latmax,lonmax],title=title_user,/advance 
+;
+;
+;
+		;if (n_elements(ntime) eq 0 or ntime eq 99) then begin
+		if (ntime eq 99) then begin
+			PRINT, '-- ALL TIME STEPS'
+			ntstart = 0
+			ntend = n_elements(reform(u(0,0,0,*)))-1 & print, ntend 
+		endif else begin
+			PRINT, '-- ONLY TIME STEP ', string(ntime,'(I0)')
+			ntstart = ntime
+			ntend = ntime
+		endelse
+                for ntime = ntstart,ntend do begin
+
+  zefile=save_ps+string(100+ntime,'(I0)')
+  PS_Start, filename=zefile+'.ps'
+  print, zefile+'.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+;
+;
+;
+lon = reform(longi(*,*,ntime))
+lat = reform(lati(*,*,ntime))
+overvector_x = reform(u(*,*,nlevel,ntime))
+overvector_y = reform(v(*,*,nlevel,ntime))
+if (n_elements(field1) eq 0) then begin
+        print, 'field1: horizontal velocity'
+	zevel = overvector_x^2 + overvector_y^2  ;; attention il faut que les tableaux soient de la meme taille
+	what_I_plot = sqrt(zevel)
+endif else begin
+	if (no3d eq 'true') then what_I_plot = reform(cfield1(*,*,ntime)) else what_I_plot = reform(cfield1(*,*,nlevel,ntime))
+endelse
+if (n_elements(field2) eq 0) then overcontour = reform(hgt(*,*,ntime)) else overcontour = reform(cfield2(*,*,ntime))
+;
+;
+;
+if (coord2d eq 'false') then begin ;; SI PAS UMET et VMET
+	;npoints=n_elements(lon(*,0)) + n_elements(lon(0,*))
+        ;what_I_plot = REBIN( what_I_plot, npoints, npoints )
+        ;overvector_x = REBIN( overvector_x, npoints, npoints )
+	;overvector_y = REBIN( overvector_y, npoints, npoints )
+	;overcontour = REBIN( overcontour, npoints, npoints )
+        ;lon =  minlon + (maxlon - minlon)*findgen(npoints)/float(npoints-1)
+        ;lat =  minlat + (maxlat - minlat)*findgen(npoints)/float(npoints-1)
+lon = findgen( n_elements(what_I_plot(*,0)) )
+lat = findgen( n_elements(what_I_plot(0,*)) )
+print, 'ATTENTION!!!! NOUS SOMMES BIEN D ACCORD QUE VOUS NE CHARGEZ PAS UMET et VMET ??'
+endif
+if (coord2d eq 'regular') then begin ;; carte avec mercator
+lon = reform(lon(*,0))
+lat = reform(lat(0,*))
+endif
+;
+;
+;
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon, $                                  ; 1D latitude
+        lat, $                                  ; 1D longitude
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+        colors=colors, $                        ; number of colors/levels (32 is default)
+        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+;;
+;;
+;;
+;loadct, 0
+;contour, reform(field3(*,*,ntime)), $
+;	lon,lat, $
+;        /overplot, $ 
+;	levels=[1,100,200], $
+;	c_labels=[0,0,0], $
+;        c_thick=1.5, $
+;	color=255
+;
+
+
+PS_End, /PNG
+		endfor
+end
+
+
+
+;
+; SI MAP_SET EST REGLE....
+;
+;; marche pas avec les vecteurs
+
+
+loadct, 0
+MAP_GRID, $
+          CHARSIZE = 1., $
+          COLOR    = 0,   $
+        ;  LABEL    = 2,   $   ;; /LABEL or LABEL=2 (one label any 2 grid lines)
+	;          LATDEL   = 10., $   ;;5
+	;          LONDEL   = 30., $   ;;15
+	;lats=-60, $
+	;          LONLAB   = -70., $ ;(latmin+latmax)/2., $
+	;          LATLAB   = (lonmin+lonmax)/2., $
+          LABEL    = 1,   $   ;; /LABEL or LABEL=2 (one label any 2 grid lines)
+          LATDEL   = 10., $   ;;5
+          LONDEL   = 15., $   ;;15
+          LONLAB   = -0., $ ;(latmin+latmax)/2., $
+          LATLAB   = -0.001, $
+          GLINESTYLE = 2, $
+          GLINETHICK = 0.3
+	  ;LONALIGN = 0., $
+	  ;LATALIGN = 1.
+
+;;
+;;
+PS_End, /PNG
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_uvt_passur.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_uvt_passur.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_uvt_passur.pro	(revision 207)
@@ -0,0 +1,112 @@
+pro map_uvt
+;
+;
+;
+what_I_plot=0.
+overcontour=0.
+@map_uvt_inc.pro
+SPAWN, '\rm param_plot.idl ; cp map_uvt_inc.pro param_plot.idl'
+if (n_elements(coord2d) eq 0) then coord2d='false'
+;
+;
+;
+  zefile=save_ps
+  PS_Start, filename=zefile+'.ps'
+  print, zefile+'.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+;
+;
+;
+if (n_elements(field1) ne 0) then getcdf, file=filename, charvar=field1, invar=cfield1
+getcdf, file=filename, charvar='Um', invar=u
+getcdf, file=filename, charvar='Vm', invar=v
+getcdf, file=filename, charvar='XLONG_M', invar=longi
+getcdf, file=filename, charvar='XLAT_M', invar=lati
+getcdf, file=filename, charvar='HGT_M', invar=hgt
+;
+;
+;
+sp = 5 ;; relaxation width
+nx = n_elements(longi(0,*))
+ny = n_elements(longi(*,0))
+if (n_elements(field1) ne 0) then begin
+	cfield1	= cfield1	(sp:nx-sp-1,sp:ny-sp-1,*,*)
+endif
+u 		= u		(sp:nx-sp-1,sp:ny-sp-1,*,*) 
+v       	= v       	(sp:nx-sp-1,sp:ny-sp-1,*,*)
+longi		= longi		(sp:nx-sp-1,sp:ny-sp-1,*)
+lati           	= lati 	        (sp:nx-sp-1,sp:ny-sp-1,*)
+hgt		= hgt		(sp:nx-sp-1,sp:ny-sp-1,*)
+nx = n_elements(longi(0,*))
+ny = n_elements(longi(*,0))
+;
+;
+;
+overcontour = reform(hgt(*,*,ntime))
+lon = reform(longi(*,*,ntime))
+lat = reform(lati(*,*,ntime))
+overvector_x = reform(u(*,*,nlevel,ntime))
+overvector_y = reform(v(*,*,nlevel,ntime))
+if (n_elements(field1) eq 0) then begin
+        print, 'field1: horizontal velocity'
+	zevel = overvector_x^2 + overvector_y^2  ;; attention il faut que les tableaux soient de la meme taille
+	what_I_plot = sqrt(zevel)
+endif else begin
+;	what_I_plot = reform(cfield1(*,*,nlevel,ntime))
+what_I_plot = reform(cfield1(*,*))
+endelse
+;
+;
+;
+minlat=min(lat) & maxlat=max(lat) & minlon=min(lon) & maxlon=max(lon)
+if (coord2d eq 'true') then begin
+	npoints=n_elements(lon(*,0)) + n_elements(lon(0,*))  ;; trop de points, mais au moins on ne perd rien 
+	TRIANGULATE, lon, lat, tr 
+	what_I_plot  = GRIDDATA( lon, lat, what_I_plot,  /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN )
+	overvector_x = GRIDDATA( lon, lat, overvector_x, /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN )
+	overvector_y = GRIDDATA( lon, lat, overvector_y, /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN )
+        overcontour  = GRIDDATA( lon, lat, overcontour,  /LINEAR, triangles=tr, dimension=npoints, MISSING=!VALUES.F_NAN )
+			; sale sale sale
+			if (minlat lt min(lat(*,0))) then overvector_y=-overvector_y
+			if (minlon lt min(lon(0,*))) then overvector_x=-overvector_x
+        lon =  minlon + (maxlon - minlon)*findgen(npoints)/float(npoints-1)
+        lat =  minlat + (maxlat - minlat)*findgen(npoints)/float(npoints-1)
+endif else begin
+	;npoints=n_elements(lon(*,0)) + n_elements(lon(0,*))
+        ;what_I_plot = REBIN( what_I_plot, npoints, npoints )
+        ;overvector_x = REBIN( overvector_x, npoints, npoints )
+	;overvector_y = REBIN( overvector_y, npoints, npoints )
+	;overcontour = REBIN( overcontour, npoints, npoints )
+        ;lon =  minlon + (maxlon - minlon)*findgen(npoints)/float(npoints-1)
+        ;lat =  minlat + (maxlat - minlat)*findgen(npoints)/float(npoints-1)
+endelse
+
+;lon = reform(lon(*,0))
+;lat = reform(lat(0,*))
+
+help, what_I_plot, lon, lat
+;
+;
+;
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon, $                                  ; 1D latitude
+        lat, $                                  ; 1D longitude
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+        colors=colors, $                        ; number of colors/levels (32 is default)
+        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+;
+;
+;
+PS_End, /PNG
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_w.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_w.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polar_w.pro	(revision 207)
@@ -0,0 +1,97 @@
+pro polar_w
+;
+;
+;
+what_I_plot=0.
+overcontour=0.
+hem = -1.
+@polar_inc_w.pro
+SPAWN, '\rm param_plot.idl ; cp polar_inc_w.pro param_plot.idl'
+;
+;
+;
+  zefile=save_ps
+  PS_Start, filename=zefile+'.ps'
+  print, zefile+'.ps'
+  ;!p.multi=[0,2,2]
+  ;!P.Charsize = 0.6
+;
+;
+;
+getcdf, file=filename, charvar=cfield1, invar=field1
+getcdf, file=filename, charvar=cfield2, invar=field2
+;getcdf, file=filename, charvar=cfield3, invar=field3
+getcdf, file=filename, charvar='XLONG', invar=longi
+getcdf, file=filename, charvar='XLAT', invar=lati
+;
+;
+;
+
+;zefile=save_ps+string(100+ntime,'(I0)')
+;PS_Start, filename=zefile+'.ps'
+;!P.Charsize = 1.2
+;!p.charthick = 2.0
+;!p.thick = 2.0
+;!x.thick = 2.0
+;!y.thick = 2.0
+;
+;
+;
+	;latmin = -90. & latmax = 10.0 & lonmin = -180. & lonmax = 180.
+map_set, hem*90., 0., /isotropic, /azimuthal, /noborder, limit=[latmin,lonmin,latmax,lonmax],title=title_user,/advance ;, position=[0.10, 0.12, 0.90, 0.92]
+;
+;
+;
+what_I_plot = reform(field1(*,*,nlevel,ntime))
+overcontour = reform(field2(*,*,ntime))
+;overcontour = 0.
+lon = reform(longi(*,*,ntime))
+lat = reform(lati(*,*,ntime))
+overvector_x=0.
+overvector_y=0.
+;
+;
+;
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon, $                                  ; 1D latitude
+        lat, $                                  ; 1D longitude
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+        colors=colors, $                        ; number of colors/levels (32 is default)
+        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+;;
+;;
+;;
+;loadct, 0
+;contour, reform(field3(*,*,ntime)), $
+;	lon,lat, $
+;        /overplot, $ 
+;	levels=[1,100,200], $
+;	c_labels=[0,0,0], $
+;        c_thick=1.5, $
+;	color=255
+
+;
+;
+;
+loadct, 0
+MAP_GRID, CHARSIZE = 0.8, $
+          COLOR    = 0,   $
+          LABEL    = 1,   $   ;(one label any 1 grid lines)
+          LATDEL   = 02., $
+          LONDEL   = 45., $
+          ;lats=-60, $
+          GLINESTYLE = 1, $
+          GLINETHICK = 0.1, $
+          LONLAB   = -77., $
+          LATLAB   = 180.
+;;
+;;
+PS_End, /PNG
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polaract.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polaract.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/POLAR/polaract.pro	(revision 207)
@@ -0,0 +1,108 @@
+pro polaract
+;
+;
+;
+what_I_plot=0.
+overcontour=0.
+@polaract_inc.pro
+SPAWN, '\rm param_plot.idl ; cp polar_inc.pro param_plot.idl'
+;
+;
+;
+  zefile=save_ps
+  PS_Start, filename=zefile+'.ps'
+  print, zefile+'.ps'
+  !P.Charsize = 0.6
+  !P.multi=[0,2,1]
+	;!p.charthick = 2.0
+	;!p.thick = 2.0
+	;!x.thick = 2.0
+	;!y.thick = 2.0
+;
+;
+;
+jojo = ['gw','gwsmooth']
+	;jojo = ['gwplus','gwsmooth']
+	;jojo = ['gwhires','gw']
+filename_sav = filename
+for i=0,n_elements(jojo)-1 do begin
+;
+filename = '/donnees/aslmd/MODELES//LMD_MM_MARS//OUTILS_CONVERSION/'+jojo(i)+'/'+filename_sav
+print, filename
+;
+getcdf, file=filename, charvar=cfield1, invar=field1
+getcdf, file=filename, charvar=cfield2, invar=field2
+getcdf, file=filename, charvar='XLONG', invar=longi
+getcdf, file=filename, charvar='XLAT', invar=lati
+;
+;
+;
+if (jojo(i) eq 'gwhires') then begin
+	sp = 6;5 ;; relaxation width
+	nx = n_elements(longi(0,*))
+	ny = n_elements(longi(*,0))
+	field1 		= field1        (sp:nx-sp-1,sp:ny-sp-1,*,*)
+	field2          = field2        (sp:nx-sp-1,sp:ny-sp-1,*)
+	longi           = longi         (sp:nx-sp-1,sp:ny-sp-1,*)
+	lati            = lati          (sp:nx-sp-1,sp:ny-sp-1,*)
+endif
+;
+;
+;
+latmin = -90. & latmax = -50.0 & lonmin = -180. & lonmax = 180.
+	;lonmin = 0. & lonmax = 90. ;; pour des tranches
+map_set, -90., 0., /isotropic, /azimuthal, /noborder, limit=[latmin,lonmin,latmax,lonmax],title=title_user,/advance ;, position=[0.10, 0.12, 0.90, 0.92]
+;
+;
+;
+  ;; average on time and height
+dbl_integral = TOTAL(TOTAL(field1*field1,3),3) 
+dbl_integral = TEMPORARY(dbl_integral) / n_elements(field1(0,0,*,0)) / n_elements(field1(0,0,0,*))
+print, n_elements(field1(0,0,*,0)), n_elements(field1(0,0,0,*))
+  ;; smooth a little bit
+smoothampl=2 ;0;3
+overcontour = smooth(TEMPORARY(dbl_integral),[smoothampl,smoothampl],/EDGE_TRUNCATE)
+  ;; plot topography
+what_I_plot = reform(field2(*,*,0))
+  ;; coordinates
+lon = reform(longi(*,*,0))
+lat = reform(lati (*,*,0))
+overvector_x=0.
+overvector_y=0.
+;
+;
+;
+SPAWN, '\rm param_plot.idl ; cp polaract_inc.pro param_plot.idl'
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        lon, $                                  ; 1D latitude
+        lat, $                                  ; 1D longitude
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+        colors=colors, $                        ; number of colors/levels (32 is default)
+        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+;
+;
+;
+loadct, 0
+MAP_GRID, CHARSIZE = 0.6, $
+          COLOR    = 0,   $
+          LABEL    = 1,   $   (one label any 1 grid lines)
+          LATDEL   = 05., $   
+          LONDEL   = 45., $   
+	  lats=-60, $
+          GLINESTYLE = 1, $ 
+          GLINETHICK = 0.1, $ 
+          LONLAB   = -70., $ 
+          LATLAB   = (lonmin+lonmax)/2.
+;
+;
+;
+endfor
+PS_End, /PNG
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/PROFILE/profile_uvt.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/PROFILE/profile_uvt.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/PROFILE/profile_uvt.pro	(revision 207)
@@ -0,0 +1,152 @@
+pro profile_uvt
+;
+;
+;
+what_I_plot=0.
+overcontour=0
+mention=''
+@map_uvt_inc.pro
+SPAWN, '\rm param_plot.idl ; cp map_uvt_inc.pro param_plot.idl ; cp -f map_uvt_inc.pro '+save_ps+'.map_uvt_inc.pro'
+if (n_elements(coord2d) eq 0) then coord2d='false'
+;
+;
+;
+  zefile=save_ps
+  PS_Start, filename=zefile+'.ps'
+  print, zefile+'.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+!p.multi=[0,2,2]
+!P.Charsize = 1.0
+;
+;
+;
+if (n_elements(field1) ne 0) then getcdf, file=filename, charvar=field1, invar=cfield1
+u  = getget(filename, 'Um',   count=[1,1,0,1], offset=[zex, zey, 0,ntime])
+v  = getget(filename, 'Vm',   count=[1,1,0,1], offset=[zex, zey, 0,ntime])
+w  = getget(filename, 'WAVE', count=[1,1,0,1], offset=[zex, zey, 0,ntime]) 
+u2 = getget(filename, 'Um',   count=[1,1,0,1], offset=[zex2,zey2,0,ntime])
+v2 = getget(filename, 'Vm',   count=[1,1,0,1], offset=[zex2,zey2,0,ntime])
+w2 = getget(filename, 'WAVE', count=[1,1,0,1], offset=[zex2,zey2,0,ntime])
+tk = getget(filename, 'tk',   count=[1,1,0,1], offset=[zex, zey, 0,ntime])
+tk2 = getget(filename, 'tk',   count=[1,1,0,1], offset=[zex2, zey2, 0,ntime])
+tpot = getget(filename, 'tpot',   count=[1,1,0,1], offset=[zex, zey, 0,ntime])
+tpot2 = getget(filename, 'tpot',   count=[1,1,0,1], offset=[zex2, zey2, 0,ntime])
+getcdf, file=filename, charvar='XLONG', invar=longi
+getcdf, file=filename, charvar='XLAT', invar=lati
+getcdf, file=filename, charvar='HGT', invar=hgt
+getcdf, file=filename, charvar='vert', invar=vert
+getcdf, file=filename, charvar='TSURF', invar=tsurf
+getcdf, file=filename, charvar='USTM', invar=ustar
+print, longi(zex ,zey ,0), lati(zex ,zey ,0)
+print, longi(zex2,zey2,0), lati(zex2,zey2,0)
+;
+;
+;
+loadct, 0
+contour, reform(hgt(*,*,ntime)), $
+reform(longi(*,*,ntime)), $
+reform(lati(*,*,ntime)), $
+nlevels=20, $
+xtitle='Longitude', $
+ytitle='Latitude', $
+;xrange=[-146.,-126.], $
+;yrange=[11.,27.], $
+xrange=[-141.,-133.], $
+yrange=[18.,26.], $
+xtickinterval=1., $
+ytickinterval=1., $
+max_value=22000., $
+min_value=-4000., $
+/cell_fill
+xyouts, longi(zex ,zey ,0), lati(zex ,zey ,0), '+ full', color=255, charsize=1.5
+xyouts, longi(zex2 ,zey2 ,0), lati(zex2 ,zey2 ,0), '+ dashed', color=255, charsize=1.5
+;
+;
+;
+	;plot, tsurf(zex ,zey ,*), yrange=[150, 300]
+	;oplot, tsurf(zex2 ,zey2 ,*), linestyle=1
+;
+;
+;
+what_I_plot = tk & column = vert
+;yeye = tsurf(zex,zey,ntime) & what_I_plot = [yeye,reform(what_I_plot)] & column = [0.01, vert]
+overplot = tk2 & overplot_column = vert
+;yeye = tsurf(zex2,zey2,ntime) & overplot = [yeye,reform(overplot)] & overplot_column = [0.01, vert]
+print, min(what_I_plot), max(what_I_plot)
+print, min(overplot), max(overplot)
+mention='three'
+;
+;
+;
+profile, $
+        what_I_plot, $                          ; 1D vertical profile
+        column, $                               ; altitudes     
+        alt=alt, $                              ; altitude range [altmin, altmax]
+        minfield=minfield_init2, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init2, $               ; maximum value of plotted field (=0: calculate)
+        inprofile=overplot, $                   ; another vertical profile to overplot
+        incolumn=overplot_column, $             ; altitudes of the other vertical profile (in case /= column)
+        discrete=discrete, $                    ; show the profile points (= type of points in !psym)
+        title_plot=title_user, $                ; title of the plot ('Profile' is default)
+        title_axis=title_axis2, $                ; title of the [x,y] axis (['Field','Altitude'] is default)
+        mention=mention                         ; add text precision within the plot window (default is nothing or '')
+xyouts, 210.,20.,'T!Ds!N = '+string(tsurf(zex,zey,ntime),'(I0)')+' K'
+xyouts, 163.,20.,'T!Ds!N = '+string(tsurf(zex2,zey2,ntime),'(I0)')+' K'
+;
+;
+;
+what_I_plot = w & column = vert
+overplot = w2 & overplot_column = vert
+;
+;
+;
+profile, $
+        what_I_plot, $                          ; 1D vertical profile
+        column, $                               ; altitudes     
+        alt=alt, $                              ; altitude range [altmin, altmax]
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        inprofile=overplot, $                   ; another vertical profile to overplot
+        incolumn=overplot_column, $             ; altitudes of the other vertical profile (in case /= column)
+        discrete=discrete, $                    ; show the profile points (= type of points in !psym)
+        title_plot=title_user, $                ; title of the plot ('Profile' is default)
+        title_axis=title_axis, $                ; title of the [x,y] axis (['Field','Altitude'] is default)
+        mention=mention                         ; add text precision within the plot window (default is nothing or '')
+;
+;
+;
+	;plot, tpot, vert
+	;oplot, tpot2, vert, linestyle=2
+	;PS_End, /PNG
+	;stop
+what_I_plot = u*u + v*v & what_I_plot = sqrt(what_I_plot) & column = vert
+overplot = u2*u2 + v2*v2 & overplot = sqrt(overplot) & overplot_column = vert
+print, min(what_I_plot), max(what_I_plot)
+print, min(overplot), max(overplot)
+mention='two'
+;
+;
+;
+profile, $
+        what_I_plot, $                          ; 1D vertical profile
+        column, $                               ; altitudes     
+        alt=alt, $                              ; altitude range [altmin, altmax]
+        minfield=minfield_init2, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init2, $               ; maximum value of plotted field (=0: calculate)
+        inprofile=overplot, $                   ; another vertical profile to overplot
+        incolumn=overplot_column, $             ; altitudes of the other vertical profile (in case /= column)
+        discrete=discrete, $                    ; show the profile points (= type of points in !psym)
+        title_plot=title_user, $                ; title of the plot ('Profile' is default)
+        title_axis=title_axis2, $                ; title of the [x,y] axis (['Field','Altitude'] is default)
+        mention=mention                         ; add text precision within the plot window (default is nothing or '')
+xyouts, 23.5,20.,'u!D*!N = '+string(ustar(zex,zey,ntime),'(F4.1)')+' m s!U-1!N'
+xyouts, 5.,20.,'u!D*!N = '+string(ustar(zex2,zey2,ntime),'(F4.1)')+' m s!U-1!N'
+;
+;
+;
+PS_End, /PNG
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/hodo.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/hodo.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/hodo.pro	(revision 207)
@@ -0,0 +1,146 @@
+pro hodo
+
+;;Procedure pour tracer des hodographes des vents ou des vents effectifs
+	;;On trace en un point donne les vecteurs vents au cours du temps
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;Choix du fichier
+	;file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_68.5/jour20/wrfout_d01_2024-03-20_06:00:00'
+	;file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_244_tau2/wrfout_d01_2024-09-08_00:00:00'
+	;file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_244_tau05/wrfout_d01_2024-09-08_00:00:00'
+	file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_244_tau5/wrfout_d01_2024-09-08_00:00:00'
+	;file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_244_tau1/wrfout_d01_2024-09-08_00:00:00'
+	
+;;Choix de la methode
+	effective='true'
+	;effective='false'
+	
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;Reglages
+
+;;Nom du fichier
+	nomfich='Hodo_landingsite_tau5'
+	
+;;Choix des heures (0 = 1ere heure du ncdf)
+	start_hour=0.
+	end_hour=23.	
+	
+	
+;;Choix de l'eta-level (premier a 1)
+	level=2
+	
+;;Choix de la position (en indices)
+	pos=[72.,72.]
+	
+;;Choix de l'affichage des heures
+	debut=0	;;heure reelle (a adapter a start_hour)
+	pas=2	;;commenter si on ne veut rien
+	
+;;Sous titre (commentable)	
+	subtitre='Tau = 5'	
+	
+;;Echelle (commenter pour echelle automatique)
+	hrange=[-20.,15.]
+	xdiv=7
+	vrange=[-30.,5.]
+	ydiv=7
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+getcdf, file=file, charvar='XLAT', invar=lat
+getcdf, file=file, charvar='XLONG', invar=lon
+	lon=reform(lon(*,0,0))		;;pour un [i,j] donne l'abscisse de lon donne la longitude
+	lat=reform(lat(0,*,0))
+
+if (effective eq 'false') then begin
+
+	getcdf, file=file, charvar='U', invar=u
+	getcdf, file=file, charvar='V', invar=v
+
+	u=reform(u(*,*,level-1,start_hour:end_hour))
+	v=reform(v(*,*,level-1,start_hour:end_hour))
+	
+	var=''
+	lev='_lev'+STRTRIM(level,2)
+
+
+endif else begin
+
+	;;Vent effectif obtenu par integration sur l'altitude
+	effwind, $
+		'U', $	
+		file, $		
+		u, $	
+		start_time=start_hour, $	
+		end_time=end_hour		
+
+	effwind, $
+		'V', $	
+		file, $		
+		v, $
+		start_time=start_hour, $
+		end_time=end_hour
+
+	var='Effective'
+	lev=''
+	
+endelse
+	
+	u=reform(u(pos[0],pos[1],*))
+	v=reform(v(pos[0],pos[1],*))
+	
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+PS_Start,filename=nomfich+var+'_pos'+STRTRIM(pos[0],2)+'-'+STRTRIM(pos[1],2)+lev+'.ps',xsize=8,ysize=8
+	!P.Charsize = 1.2
+
+;;Reglages graphiques
+
+if (n_elements(hrange) eq 0.) then begin	
+	if ( abs( max(u)-min(u)) ge  abs( max(v)-min(v))) then range=abs( max(u)-min(u)) else range=abs( max(v)-min(v))
+	hrange=[min(u)-1,min(u)-1+ range +2] 
+	vrange=[min(v)-1,min(v)-1 + range +2]
+endif
+	
+	valon=lon(pos[0])
+	valat=lat(pos[1])
+	
+;;Trace	
+	plot, $
+		u, $
+		v, $
+		xtitle=var+' U Wind Velocity (m/s)', $
+		ytitle=var+' V Wind Velocity (m/s)', $
+		title='Hodograph : lon '+string(valon, FORMAT='(F7.2)')+' | lat '+string(valat, FORMAT='(F7.2)'), $
+		subtitle=subtitre, $
+		PSYM=-4, $
+		Xrange=hrange, $
+		Xticks=xdiv, $
+		Yrange=vrange, $
+		Yticks=ydiv, $
+		XTicklen=1.0, $
+	 	YTicklen=1.0, $
+		XGridStyle=1, $
+		YGridStyle=1
+
+	;;affichage de l'origine	
+	oplot,[0],[0],PSYM=5,symsize=1.5
+
+;;Reperage des heures 
+if n_elements(pas) ne 0 then begin
+
+	for t=0,end_hour-start_hour,pas do begin
+	
+	XYOUTS, u(t),v(t),debut+t,CHARSIZE=0.9
+	
+	endfor
+	 
+endif
+	
+;;Conversion en .png
+	PS_End, /PNG
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/mawd.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/mawd.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/mawd.pro	(revision 207)
@@ -0,0 +1,98 @@
+pro mawd
+
+;;;;;;;
+experiment='a035'
+;experiment='a040'
+;experiment='a045'
+;;f_user='/donnees/aslmd/SVN/trunk/mesoscale/TMPDIR/GCMINI/mawd.nc'
+;;f_user='/tmp7/aslmd/mawd.nc'
+f_user='/d5/aslmd/WATERCYCLE/mawd_'+experiment+'.nc'
+v_user = 'mtot'
+x_user = 'Time'
+y_user = 'latitude'
+transp = 'yes'
+tes = 'no'
+;;;;;;;
+;f_user='/donnees/aslmd/TES/TES.SeasonalClimatology.nc'
+;v_user = 'water'
+;x_user = 'time'
+;y_user = 'latitude'
+;transp = 'yes'
+;tes = 'yes'
+;;;;;;;
+
+
+what_I_plot=0.
+overcontour=0
+@mawd_inc.pro
+print, lev
+SPAWN, '\rm param_plot.idl ; cp mawd_inc.pro param_plot.idl'
+
+PS_START, file='mawd_'+experiment+'.ps'
+;  !P.Charsize = 1.2
+;  !p.charthick = 2.0
+;  !p.thick = 2.0
+;  !x.thick = 2.0
+;  !y.thick = 2.0
+
+cdfid = ncdf_open(f_user)
+
+varid=ncdf_varid(cdfid,v_user)
+ncdf_varget, cdfid, varid, champ
+
+varid=ncdf_varid(cdfid,y_user)
+ncdf_varget, cdfid, varid, yy
+
+varid=ncdf_varid(cdfid,x_user)
+ncdf_varget, cdfid, varid, xx
+
+if (tes eq 'no') then begin
+  ;;; en precip-microns
+  champ = champ * 1.e6 / 917.
+  ;;;; entre 0 et 360
+  ;xx = xx MOD 360
+  xx = xx - 360.*3.
+endif else begin
+  xx = xx - 360.*2.
+endelse
+
+help, champ
+if (tes eq 'no') then begin
+  what_I_plot = champ
+endif else begin
+  what_I_plot = float(reform(champ(0,*,*)))
+endelse
+help, what_I_plot
+overcontour = what_I_plot
+
+if (tes eq 'yes') then begin
+  w=where(what_I_plot eq -1.)
+  what_I_plot[w] = !VALUES.F_NAN
+  overcontour[w] = !VALUES.F_NAN
+endif
+
+if (transp eq 'yes') then begin
+	what_I_plot = transpose(what_I_plot)
+	overcontour = transpose(overcontour)
+endif
+
+what_I_plot = smooth(what_I_plot,[10,1])
+
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        xx, $                                  ; 1D latitude OR 2D
+        yy, $                                  ; 1D longitude OR 2D
+;        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+;        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+;        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+;        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+;        colors=colors, $                        ; number of colors/levels (32 is default)
+;        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+
+
+PS_END, /PNG
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/mawd_inc.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/mawd_inc.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/mawd_inc.pro	(revision 207)
@@ -0,0 +1,44 @@
+;;;;;*************************************** PLOT TITLES
+        title_user 	= 	'Water vapor column [precip. microns]' 
+        title_axis      =       ['L!DS!N','North Latitude']
+
+;;;;;*************************************** COLOR TABLES
+        flag_cb         =       'true'
+	poscb		=	0.75
+        format          =       '(I0)' 
+        colors          =       32
+        pal             =       33;22;4;33              ;; GOOD: 4, 18, 22, 16, 37, 33, 39, 6, 11
+
+;;;;;*************************************** FILL LIMITS
+        minfield_init   =       0.
+        maxfield_init   =       100. ;120. ;65.
+        ndiv            =       10 ;12 ;13
+
+	;;;;;*************************************** LIMIT TRICKS
+        ;;;;;********************* must always follow FILL LIMITS
+        	missing_value=1.e30
+        	lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+        	lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+        	lim_blank = 1.0 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value
+
+;;;;;*************************************** CONTOUR
+	overcontour	=	overcontour
+        lev             =       minfield_init + (maxfield_init - minfield_init)*findgen(ndiv+1)/float(ndiv)
+
+;;;;;*************************************** AXIS
+        isotropic       =       'true'
+        intervalx       =       15.0
+        intervaly       =	15.0
+
+;;;;;*************************************** MAP LIMITS
+	windowx 	= 	[30.,150.]
+        windowx         =       [30.,1500.]
+	windowy 	= 	[-15.,90.]
+
+;;;;; MULTIYEAR
+	isotropic       =       'false'
+        windowx         =       [0.,2880.] ;[0.,3600.] ;[1500.,4000.]
+        intervalx       =       360.0
+        windowy         =       [-90.,90.]
+        intervaly       =       30.0
+        lev		=       [600.] ;[100.]
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/windautom.idl
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/windautom.idl	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/windautom.idl	(revision 207)
@@ -0,0 +1,56 @@
+; cf gw.def apres 'change plot settings'
+;
+
+;title_user='Evolution of mean wind speed (m/s) with height ABG and LT'
+        ;;'Evolution of mean temperature (K) with height ABG and LT'
+        ;;'Evolution of mean wind speed (m/s) with height ABG and LT'
+
+
+title_user='Evolution of horizontal wind speed (m/s) with height AGL and LT'
+;  title_user='Evolution of vertical wind speed (m/s) with height ABG and LT'
+;title_user='Evolution of temperature (K) with height AGL and LT'
+
+;subtitle_user='Tau dust 5 minus Tau dust 2'
+
+windowx=[6.,29.]
+windowx=[0.,23.]
+windowy=[0.,45.]
+intervalx=1.
+intervaly=5.
+
+pal=33
+numdiv=14
+
+pal=22
+format='(I0)'
+
+minfield_init=0.
+maxfield_init=80.
+numdiv=10
+
+	;windowx=[0.,23.]
+	;windowy=[0.,12.]
+	;intervalx=1.
+	;intervaly=2.
+	;minfield_init=0.
+	;maxfield_init=30.
+
+;minfield_init=120.
+;maxfield_init=220.
+
+
+  ;numdiv=10
+  ;minfield_init=-2.
+  ;maxfield_init=2.
+  ;minfield_init=-0.5
+  ;maxfield_init=0.5
+  ;pal=33
+
+
+isotropic='false'
+
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min
+
+;;pour tracer les vents en fonction du temps mettre :
+title_axis=['Martian hour (h)','Height above ground (km)']
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/windmeso.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/windmeso.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/SERIES/windmeso.pro	(revision 207)
@@ -0,0 +1,243 @@
+pro windmeso
+
+;;Procedure de trace de valeurs issues du Mesoscale en temps-altitude
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;Choix des champs a tracer, 3 cas :
+;;Un champ de deux variables, dont on trace le module, entrer [X,Y]
+;;Une variable X seule, dont on trace la valeur entrer  [X,X]
+;;tk, entrer [T,PTOT]
+
+;champ1='U' & champ2='V' & champlat = 'XLAT' & champlon = 'XLONG' & champhgt = 'HGT' & file='/home/aymeric/Science/INTERCOMP/LMD_MMM/LMD_MMM_d04_2024-05-57_06:00:00' & nomfich='nest4_MSL' & charphtot = 'PHTOT'
+
+champ1='u_avg' & champ2='v_avg' & champlat = 'glat' & champlon = 'glon' & champhgt = 'topo' & file='/home/aymeric/Science/INTERCOMP/MRAMS/MRAMS_d04_2024-05-57_06:00:00' & nomfich='nest4_MSL_mrams' & charphtot = 'z_lyrmid_agl'
+
+;nomfich=nomfich+'proch'
+
+;champ1='T' & champ2='PTOT' & champlat = 'XLAT' & champlon = 'XLONG' & champhgt = 'HGT' & file='/home/aymeric/Science/INTERCOMP/LMD_MMM/LMD_MMM_d04_2024-05-57_06:00:00' & nomfich='nest4_MSLtemp' & charphtot = 'PHTOT'
+
+;champ1='tempk' & champ2='tempk' & champlat = 'glat' & champlon = 'glon' & champhgt = 'topo' & file='/home/aymeric/Science/INTERCOMP/MRAMS/MRAMS_d04_2024-05-57_06:00:00' & nomfich='nest4_MSL_mramstemp' & charphtot = 'z_lyrmid_agl'
+
+
+;;Decommenter pour un fichier d'API
+;api='on'	;;a tester, voir REF si ca ne marche pas
+
+;;Choix du fichier de simulation
+;file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_68.5/jour20/wrfout_d01_2024-03-20_06:00:00'
+;file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_244_tau2/wrfout_d01_2024-09-08_00:00:00'
+;file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_244_tau05/wrfout_d01_2024-09-08_00:00:00'
+;file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_244_tau5/wrfout_d01_2024-09-08_00:00:00'
+;file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_244_tau1/wrfout_d01_2024-09-08_00:00:00'
+;file='/tmp7/aslmd/wrfout_d01_2024-09-10_06:00:00'
+;file='/tmp7/aslmd/MERIDIANI_FLUSH/wrfout_d01_2024-09-07_06:00:00'
+;file='/tmp7/aslmd/MERIDIANI_FLUSH/wrfout_d01_2024-09-13_06:00:00'
+;file='/tmp7/aslmd/MERIDIANI_FLUSH2/wrfout_d01_2024-09-07_06:00:00'
+;file='/tmp7/aslmd/MERIDIANI_FLUSH2/wrfout_d01_2024-09-13_06:00:00'
+;file='/tmp7/aslmd/MERIDIANI_BOMB/wrfout_d01_2024-09-07_06:00:00'
+;file='/home/aymeric/Science/INTERCOMP/LMD_MMM/LMD_MMM_d04_2024-05-57_06:00:00'
+
+;;Nom du fichier de sortie
+	;nomfich='flush'
+        ;nomfich='nest4_MSL'
+	;nomfich='flush_late'
+	;nomfich='flush2'
+	;nomfich='flush2_late'
+	;nomfich='bomb'
+        nomfich= nomfich+'_vert'
+        ;nomfich='LS244_tau1_vent_bas'
+	;nomfich='test'
+	
+;; Choix des options :
+;;Heure de depart du trace sur les abscisses (ne fait que decaler le trace : le mettre a l'heure de debut de la simu)
+	start_time=0. ;6. ;0.
+;;Intervalle horaire (ne fait qu'elargir le trace, en placant une heure de simu tous les interv)
+	interv=1. 
+	
+;;Gestion des sites
+n = 1 ;;nombre de sites
+sites = make_array(n,/STRING)
+coord = make_array(2,n,/FLOAT)
+	sites[0] ='landing_site'
+	;sites[0] = 'landing_site'
+	;sites[1] = 'crater'
+	;sites[2] = 'crater_rim'
+	;sites[3] = 'high_area'
+	;sites[4] = 'low_area'
+	;sites[5] = 'plain'
+	;sites[] = ''
+	;; si on ne veut pas de nom avec les coordonnes rajouter une case avec rien dedans
+        coord[0,0] =325.149-360.        & coord[1,0] =-26.372
+	;coord[0,0] =353.87-360.	& coord[1,0] =-1.88
+	;coord[0,1] =-9.93 		& coord[1,1] =5.45
+	;coord[0,2] =-9.78		& coord[1,2] =6.63
+	;coord[0,3] =5.77		& coord[1,3] =-6.84
+	;coord[0,4] =-11.78		& coord[1,4] =7.80
+	;coord[0,5] =-2.67		& coord[1,5] =-1.8
+	;coord[0,] =-2.67		& coord[1,] =-1.8
+	
+;;sites de reference:
+;'landing_site'	coord[0,] =353.87-360.		& coord[1,] =-1.88
+;'crater'		coord[0,] =-9.93 		& coord[1,] =5.45
+;'crater_rim'		coord[0,] =-9.78		& coord[1,] =6.63
+;'high_area'		coord[0,] =5.77			& coord[1,] =-6.84
+;'low_area'		coord[0,] =-11.78		& coord[1,] =7.80
+;'plain'		coord[0,] =-2.67		& coord[1,] =-1.8
+;'crater_slope'	coord[0,] =-9.59		& coord[1,] =5.96
+;'crater_LS'		coord[0,] =-3.68		& coord[1,] =-3.65
+;'crater_LS_rim'	coord[0,] =-4.70		& coord[1,] =-3.65
+;'holden' 		coord[0,] =-34.851		& coord[1,] =-26.372
+
+	
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
+
+;;Pour regler les parametres de trace dans autre chose que param_plot qui risaue de mal finir un jour
+SPAWN, '\rm param_plot.idl ; cp -f windautom.idl param_plot.idl'	
+	
+	
+;;Recuperation de la latitude, longitude, topographie et pression (pour le calcul de la heuteur)
+
+       	getcdf, file=file, charvar=champlat, invar=lat
+	getcdf, file=file, charvar=champlon, invar=lon
+	getcdf, file=file, charvar=champhgt, invar=elevation	
+
+
+	;;Recuperation des variables
+	if champ1 eq champ2 then begin
+		getcdf, file=file, charvar=champ1, invar=c
+	endif  else begin
+		getcdf, file=file, charvar=champ1, invar=c1
+		getcdf, file=file, charvar=champ2, invar=c2
+	endelse
+	
+	
+for i = 0,n-1 do begin
+
+;;Site du trace
+	name_site = sites[i]
+	landing_site=[ coord[0,i] , coord[1,i] ]
+	
+;;Recuperation de [i,j] a partir de [lon,lat]
+	findxy, $
+		x=lon, $
+		y=lat, $
+       	 	point=landing_site, $
+		ind=indp, $
+		flag=2
+
+	
+if (n_elements(api) eq 0) then begin
+	print,'----------- Standard output'
+		
+;;Recuperation de la hauteur
+	getcdf, file=file, charvar=charphtot, invar=ph
+        height=reform(ph(indp[0],indp[1],*,*))
+                ;;on se debarasse de la position
+        height=total(height,2)/n_elements(height(0,*))
+                ;;on somme sur le temps et on moyenne: on obtient un tableau de valeurs d'altitudes moyennes
+if (charphtot eq 'z_lyrmid_agl') then begin
+	heightp=height/1000.
+	print, heightp
+endif else begin
+	height=height/1000./3.72
+	heightp=height(0:n_elements(height(*))-2)-elevation(indp[0],indp[1])/1000.
+		;;on soustrait la topographie et on obtient une colonne des hauteurs finales
+        print, heightp
+endelse
+;if (champ1 eq 'W') then heightp=height(0:n_elements(height(*))-1)-elevation(indp[0],indp[1])/1000.
+
+		
+	;;Utiliser la boucle ci dessous pour imprimer les hauteurs à entrer dans la création d'un API
+	;print='on'
+	if (n_elements(print) ne 0) then begin
+		for i=0,n_elements(heightp)-1 do begin
+			print, STRTRIM(heightp(i),2)+','
+		endfor
+	endif
+	
+endif else begin
+	print,'----------- API output'
+	
+	;;créer avec API un fichier contenant Um, Vm (ou autres) et vert, dans namelist.api mettre les interp_levels voulus (par ex avec la boucle print ci dessus)
+	getcdf, file=file, charvar='vert', invar=height
+	heightp=height/1000.		
+endelse	
+		
+		
+;;Creation du champ a tracer
+
+if champ1 eq champ2 then begin
+	print,'Vous tracez les valeurs de '+champ1
+	champi = reform(c(indp[0],indp[1],*,*)) 
+	what_I_plot = champi
+
+if (champ1 eq 'W') then what_I_plot =  what_I_plot[0:n_elements(what_I_plot(*,0))-2,*]
+	
+endif  else begin
+
+if (champ1 eq 'T') and (champ2 eq 'PTOT') then begin 
+	print,'Vous tracez la temperature normale'
+	T = reform( c1(indp[0],indp[1],*,*) )  
+	PTOT = reform( c2(indp[0],indp[1],*,*) ) 
+	what_I_plot =(T+220.)*(PTOT/610.)^(192./844.)
+	 
+endif else begin
+	print,'Vous tracez le module de '+champ1+' et '+champ2
+	champi1 = reform(c1(indp[0],indp[1],*,*)) 
+	champi2 = reform(c2(indp[0],indp[1],*,*)) 
+	what_I_plot = sqrt(champi1^2 + champi2^2)
+
+endelse
+endelse
+
+
+;print, 'mean(what_I_plot) ', mean(what_I_plot) 
+;print, what_I_plot
+
+;;Gestion du temps
+;;definition des abscisses : il va tracer toutes les valeurs du fichier de simu, mais en les decalant a start time
+	localtime = float(start_time) + float(interv)*findgen(n_elements(what_I_plot(0,*))) 	
+	
+;;Nom du fichier de sortie
+
+PS_Start,filename=nomfich+'_'+name_site+'_lon'+string(coord[0,i],'(I0)')+'_lat'+string(coord[1,i],'(I0)')+'.ps'
+!P.Charsize = 1.2
+
+help, transpose(what_I_plot), localtime, heightp
+	
+map_latlon, $
+        transpose(what_I_plot), $      ; 2D field
+        localtime, $                   ; 1D latitude
+        heightp, $                      ; 1D longitude
+	overcontour=0		
+	
+
+;;Conversion en .png
+PS_End, /PNG
+
+endfor
+
+
+end	
+	
+	
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;yeah=where(localtime lt 0) & if (yeah(0) ne -1) then localtime[yeah]=24+localtime[yeah]
+;;; 24h issue
+;localtime=localtime MOD 24 & yeah=where(localtime eq 0) & if (yeah(0) ne -1) then localtime[yeah]=24
+;localtime=24.+localtime
+
+;!p.charthick = 2.0
+;!p.thick = 3.0
+;!x.thick = 1.0
+;!y.thick = 2.0
+
+;overcontour=transpose(what_I_plot)     ; another 2D field to overplot with contour lines (=0: no)
+
+;;ATTENTION : a ne JAMAIS, JAMAIS, JAMAIS faire	
+	;field=sqrt(c1^2+c2^2) & c1=0. & c2=0.
+	;what_I_plot=reform(field(indp[0],indp[1],*,*))
+	;what_I_plot = field
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/getget.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/getget.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/getget.pro	(revision 207)
@@ -0,0 +1,125 @@
+function getget, name, charvar, count=count, offset=offset, stride=stride, coordmean=coordmean, anomaly=anomaly
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; name: char
+; charvar: char
+; count: 4 elements array   ; The dimensions of the sub-image
+; offset: 4 elements array  ; A variable that contains the offset for the sub-image
+; stride: 4 elements array  ; Create a variable to be used as a value for the STRIDE keyword
+; coordmean: 1 to 4 elements array (dimension 1 is 1)
+; anomaly: a non-null element that would be filled with mean
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;print, charvar
+
+
+nosave = 1  ;; comment to get an IDL data file
+notime = 1  ;; comment to get mention of time taken
+if (n_elements(notime) eq 0) then timetime = SYSTIME(1)
+
+;
+; MINIMAL ARGUMENTS
+;
+if (n_elements(name) eq 0) then stop
+if (n_elements(charvar) eq 0) then stop
+
+;
+; IDL DATA DIRECTORY
+;
+name_idl = charvar+name+'.idl'
+  if (n_elements(coordmean) ne 0) then begin
+    nc = n_elements(coordmean)
+    for i=0,nc-1 do begin
+     name_idl = string(coordmean(i),'(I0)')+name_idl   
+    endfor
+  endif
+name_idl = './idl_dat/'+name_idl
+
+;
+; TEST IF FILE EXISTS
+;
+openr,unit,name_idl,/get_lun,error=err
+
+;
+; IF IDL FILE EXISTS, THAT IS RATHER SIMPLE
+;
+IF (err EQ 0) THEN BEGIN
+
+   print, 'read from file'
+   free_lun,unit
+   restore, filename=name_idl
+
+;
+; IF IDL FILE DOES NOT EXIST, WELL, READ NETCDF
+;
+ENDIF ELSE BEGIN
+
+  ;
+  ; check save directory
+  ;
+  if (n_elements(nosave) eq 0) then SPAWN, 'mkdir -p idl_dat'  
+
+  ;
+  ; open file
+  ;
+  id=ncdf_open(name) 
+
+  ;
+  ; get dimensions
+  ;
+  var = intarr(4)
+  NCDF_DIMINQ, id, NCDF_DIMID(id, 'west_east'    ), toto, titi & var(0) = titi
+  NCDF_DIMINQ, id, NCDF_DIMID(id, 'south_north'  ), toto, titi & var(1) = titi 
+  NCDF_DIMINQ, id, NCDF_DIMID(id, 'bottom_top'   ), toto, titi & var(2) = titi
+  NCDF_DIMINQ, id, NCDF_DIMID(id, 'Time'         ), toto, titi & var(3) = titi 
+  ;print, var
+
+  ;
+  ; define default data windows
+  ;
+  if (n_elements(offset) le 3) then offset=[0,0,0,0]
+  if (n_elements(stride) le 3) then stride=[1,1,1,1]
+  if (n_elements(count) le 3) then count=intarr(4)
+  w = where(count eq 0) & if (w(0) ne -1) then count[w] = var[w] / stride[w]
+
+  ;
+  ; read variable
+  ;
+  varid=ncdf_varid(id,charvar) ;& print, 'get '+charvar 
+  if (n_elements(notime) eq 0) then timetime = SYSTIME(1) ;& help, /memory
+  ncdf_varget, id, varid, invar, count=count, offset=offset, stride=stride & if (n_elements(notime) eq 0) then print, SYSTIME(1) - timetime, ' s' ;& help, /memory
+  ncdf_close, id
+
+  ;
+  ; OPTIONAL: ANOMALY (value is returned in the keyword)
+  ; 
+  if (n_elements(anomaly) ne 0) then begin
+    anomaly=TOTAL(TOTAL(invar,1),1)/float(var[0])/float(var[1])
+    for i=0,var[0]-1 do for j=0,var[1]-1 do invar(i,j,*,*) = TEMPORARY(invar(i,j,*,*)) - anomaly  ; coute cher ; pas tant
+  endif
+
+  ;
+  ; OPTIONAL: MEAN 
+  ;
+  if (n_elements(coordmean) ne 0) then begin
+  for i=0,nc-1 do begin
+   print, 'mean over dimension '+string(coordmean(i),'(I0)')+' - '+string(var(coordmean(i)),'(I0)')+' elements'
+   invar=total(TEMPORARY(invar),coordmean(i))/var(coordmean(i))
+  endfor
+  endif
+
+  ;
+  ; SAVE
+  ;
+  if (n_elements(nosave) eq 0) then save, invar, filename=name_idl
+
+ENDELSE
+
+if (n_elements(notime) eq 0) then print, SYSTIME(1) - timetime, ' s'
+
+;
+; RETURN FIELD
+;
+return, invar
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/quick_plot.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/quick_plot.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/quick_plot.pro	(revision 207)
@@ -0,0 +1,76 @@
+
+
+SPAWN, '\rm param_plot.idl'
+SPAWN, "echo 'intervaly=5.' > param_plot.idl"
+SPAWN, "echo 'intervalx=5.' >> param_plot.idl"
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+file='gcm' & header='' & nlines_header=4 & ncol = 2
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+nlines = FILE_LINES(file)-nlines_header & data=FLTARR(ncol,nlines)
+OPENR, lun, file, /GET_LUN & READF, lun, header & READF, lun, header & READF, lun, header & READF, lun, header 
+READF, lun, data & CLOSE, lun & FREE_LUN, lun
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+altitude        = reform(data(0,*))
+temp            = reform(data(1,*)) 
+data = 0.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+file='meso' & header='' & nlines_header=4 & ncol = 2
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+nlines = FILE_LINES(file)-nlines_header & data=FLTARR(ncol,nlines)
+OPENR, lun, file, /GET_LUN & READF, lun, header & READF, lun, header & READF, lun, header & READF, lun, header
+READF, lun, data & CLOSE, lun & FREE_LUN, lun
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+altitude2       = reform(data(0,*))         
+temp2           = reform(data(1,*)) 
+data = 0.
+
+
+;
+; extremes
+;
+temp = temp - 12.
+temp2 = temp2 - 12.
+print, 'ATTENTION CACA CACA CACA'
+
+what_I_plot = temp ;- temp2
+column = altitude
+alt = [20.,60.]
+minfield_init = 100. ;-20 ;100.
+maxfield_init = 200. ;20. ;200.
+overplot = temp2
+overplot_column = altitude2
+discrete = 0
+title_user = 'GCM vs. mesoscale simulations'
+title_axis = ['Temperature (K)','Altitude above MOLA (km)']
+mention = ''
+
+profile, $
+        what_I_plot, $                          ; 1D vertical profile
+        column, $                               ; altitudes     
+        alt=alt, $                              ; altitude range [altmin, altmax]
+        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        inprofile=overplot, $                   ; another vertical profile to overplot
+        incolumn=overplot_column, $             ; altitudes of the other vertical profile (in case /= column)
+        discrete=discrete, $                    ; show the profile points (= type of points in !psym)
+        title_plot=title_user, $                ; title of the plot ('Profile' is default)
+        title_axis=title_axis, $                ; title of the [x,y] axis (['Field','Altitude'] is default)
+        mention=mention                         ; add text precision within the plot window (default is nothing or '')
+
+
+
+;
+; condensation
+;
+latcond=5.9e5
+tcond1mb=136.27
+r=192.
+bcond=1./tcond1mb
+acond=r/latcond
+press=610.*exp(-altitude/10.)
+overplot=1./(bcond-acond*alog(.0095*press))
+overplot_column=altitude
+oplot, overplot, overplot_column, psym=5
+
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/quick_plot2.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/quick_plot2.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/quick_plot2.pro	(revision 207)
@@ -0,0 +1,67 @@
+pro script_con
+
+;;;;;;;
+file_user='/home/aslmd/EXOMARS/LMD_MM_MARS_Meridiani_S114_Ls247_LT0-23.nc'
+var_user = 'TSURF'
+var_user2 = 'HGT'
+nt = 5
+format = '(I0)'
+pal=33
+;;;;;;;
+
+PS_START, file='toto.ps'
+
+
+cdfid = ncdf_open(file_user)
+varid=ncdf_varid(cdfid,var_user)
+ncdf_varget, cdfid, varid, champ
+
+cdfid = ncdf_open(file_user)
+varid=ncdf_varid(cdfid,var_user2)
+ncdf_varget, cdfid, varid, champ2
+
+cdfid = ncdf_open(file_user)
+varid=ncdf_varid(cdfid,'XLONG')
+ncdf_varget, cdfid, varid, lon
+
+cdfid = ncdf_open(file_user)
+varid=ncdf_varid(cdfid,'XLAT')
+ncdf_varget, cdfid, varid, lat
+
+
+
+nx = 25
+ny = 25
+what_I_plot = reform(champ(nx,ny,*))
+
+plot, what_I_plot
+
+PS_END, /PNG
+
+end
+
+
+
+what_I_plot = reform(champ(*,*,nt))
+overcontour = reform(champ2(*,*,nt))
+longi = reform(lon(*,0))
+lati = reform(lat(0,*))
+
+map_latlon, $
+        what_I_plot, $                          ; 2D field
+        longi, $                                  ; 1D latitude OR 2D
+        lati, $                                  ; 1D longitude OR 2D
+;        minfield=minfield_init, $               ; minimum value of plotted field (=0: calculate)
+;        maxfield=maxfield_init, $               ; maximum value of plotted field (=0: calculate)
+        overcontour=overcontour, $              ; another 2D field to overplot with contour lines (=0: no)
+;        overvector_x=overvector_x, $            ; wind vector - x component (=0: no)
+;        overvector_y=overvector_y, $            ; wind vector - y component (=0: no)
+        ct=pal, $                               ; color table (33-rainbow is default)
+;        colors=colors, $                        ; number of colors/levels (32 is default)
+;        title=title_user, $                     ; title of the plot ('' is default)
+        format=format                           ; format of colorbar annotations ('(F6.2)' is default)
+
+
+PS_END, /PNG
+
+end
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/tempcond.inc
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/tempcond.inc	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/tempcond.inc	(revision 207)
@@ -0,0 +1,16 @@
+;
+; input: log-pressure altitude
+;
+
+latcond=5.9e5
+tcond1mb=136.27
+r=192.
+
+bcond=1./tcond1mb
+acond=r/latcond
+
+;press=610.*exp(-column/10.)
+press=columnp
+
+overplot=1./(bcond-acond*alog(.0095*press))
+overplot_column=column
Index: trunk/MESOSCALE_DEV/PLOT/SPEC/ti_vs_tsurf.pro
===================================================================
--- trunk/MESOSCALE_DEV/PLOT/SPEC/ti_vs_tsurf.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/PLOT/SPEC/ti_vs_tsurf.pro	(revision 207)
@@ -0,0 +1,42 @@
+pro ti_vs_tsurf
+
+getcdf, $
+        file='/d6/vblmd/MERIDIANI_EXOMARS/saves_simu_LS_244_tau05/wrfout_d01_2024-09-08_00:00:00', $
+        charvar='TSURF', $
+        invar=tsurf
+tsurf = max ( tsurf, DIMENSION=3 )
+
+getcdf, $
+        file='./geo_em.d01.nc', $
+        charvar='THERMAL_INERTIA', $
+        invar=ti
+
+getcdf, $
+        file='./geo_em.d01.nc', $
+        charvar='ALBEDO_GCM', $
+        invar=alb
+
+PS_START, file='ti.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+plot, ti, tsurf, psym=3, title='Daily maximum of surface temperature at ExoMars landing season and region', xtitle='Thermal Inertia (tiu)', ytitle='Surface temperature (K)', xrange=[0,500], yrange=[270,320]
+oplot, ti[where(tsurf eq max(tsurf))], tsurf[where(tsurf eq max(tsurf))], psym=4
+xyouts, 380, 310, 'TI = '+string(ti[where(tsurf eq max(tsurf))],'(I0)')+' tiu'
+PS_END, /PNG
+
+PS_START, file='alb.ps'
+  !P.Charsize = 1.2
+  !p.charthick = 2.0
+  !p.thick = 2.0
+  !x.thick = 2.0
+  !y.thick = 2.0
+plot, alb, tsurf, psym=3, title='Daily maximum of surface temperature at ExoMars landing season and region', xtitle='Albedo', ytitle='Surface temperature (K)', xrange=[0.1,0.3], yrange=[270,320]
+oplot, alb[where(tsurf eq max(tsurf))], tsurf[where(tsurf eq max(tsurf))], psym=4
+xyouts, 0.25, 310, 'ALB = '+string(alb[where(tsurf eq max(tsurf))],'(F4.2)')
+PS_END, /PNG
+
+
+end
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/README
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/README	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/README	(revision 207)
@@ -0,0 +1,164 @@
+ARWpost 
+June 2007
+	Add cloud fractions
+	Remove memory leaks
+November 2006
+
+The program read any wrf dataset in NETCDF/GRIB1 format and can produce either
+GrADS input data format or Vis5D input format.
+
+WRFV2 MUST be compiled and avaliable. If WRFV2 is not on the same level as 
+ARWpost, then configure.arwp needs to be edited to correct path.
+
+
+COMPILE
+	./configure  --- to get a list of compile options for your computer
+		         If your computer is not listed, you will need to add it under
+			 arch/configure.defaults
+	./compile    --- compile the code
+
+	./clean -a   --- clean 
+
+
+
+namelist.ARWpost
+
+datetime
+	start_date		:: In format YYYY-MM-DD_HH:MM:SS
+				:: Or specify 
+					start_year
+					start_month
+					start_day
+					start_hour
+	end_date		:: In format YYYY-MM-DD_HH:MM:SS
+				:: Or specify 
+					end_year   
+					end_month   
+					end_day   
+					end_hour
+        interval_seconds	:: Interval in seconds between plots required
+
+io
+	io_form_input		:: NETCDF=2, GRIB1=5
+	input_root_name		:: root name or full name of input file(s) to process
+				   Include path to file location
+				   './wrfout' will read all files with root name "wrfout"
+				   in the current directory
+	output_root_name	:: root name of output files
+				   for grads output 2 files will be created
+					output_root_name.ctl and output_root_name.dat
+				   for v5d output the one file will be craeted
+					output_root_name.v5d
+	output_title		:: Only used for GrADS output files.
+				   Will be added to the top of the output_root_name.ctl
+				   file. If not specified, the TITLE from input_root_name
+				   will be used.
+	mercator_defs		:: For very large domains on mercator projection, GrADS 
+				   may destort plots. In this case, setting mercator_defs
+				   to TRUE will fix the problem.
+	keep_moist_arrays	:: By default some moist and wind arrays are carried for
+	keep_wind_arrays	   for use in diagnostics. For very large domains, and if
+				   these arrays are not needed for diagnostics, they 
+				   can be removed.
+	plot			:: Fields to be plotted. Options are:
+				   	all, basic, file, list, 
+					all_file, all_list, 
+					basic_file, basic_list, list_file, 
+					all_list_file, basic_list_file
+				   'all', get all the fields in the 'input_root_name' file
+				   	cannot use 'all' for Vis5D data
+				   'basic', get the fields (if available):
+					HGT (HGT_M), LANDMASK, LU_INDEX, MU, MUB, P, PB,
+					PBLH, PH, PHB, PSFC, Q2, RAINC, RAINNC, SST,
+					T (TT), T2, TH2, TMN, TSK, U (UU), U10, V (VV), V10,
+					VEGFRA, W, XLAND, XLAT (XLAT_M), XLONG (XLONG_M)
+					This list can be customize in the routine: 
+						gridinfo_module.F90
+				   'list', get all the fields listed in "fields"
+					fields are separated by ","
+				   'file', get all the fields in a file you created. The 
+					created filename must be supplied in "fields_file"
+				    Any conbination of 'all', 'basic', 'list', 'file' is valid.
+	fields			:: Used if you specifed 'list' in "plot"
+				   Fields are separated with ","
+	fields_file		:: Used if you specified 'file' in "plot"
+				   Fields are listed one below each other in your file
+				   "fields_file" is the name of your file
+	output_type		:: 'grads' (default) or 'v5d'
+
+interp
+	interp_method		::  0 = model levels
+				   -1 = calculated height levels
+				    1 = user specified pressure/height levels
+					For 1, must specify levels in 'interp_levels'
+	interp_levels		:: Only used if 'interp_method = 1'
+				   Height (km) or Pressure (hPa)
+				   No need to be equally spaced, must be bottom to top
+
+
+
+
+Diagnostics:
+	Currently the following diagnostics are available
+	   - module_calc_cape.f90
+		cape (3D CAPE) and cin (3D CIN)
+		mcape (2D CAPE), mcin (2D CIN)
+		lfc (LFC), lcl (LCL)
+	   - module_calc_dbz.f90
+		dbz (3D Reflectivity)
+		maz_dbz (Max Reflectivity)
+	   - module_calc_height.f90
+		height (Height above sea level)
+	   - module_calc_pressure.f90
+		pressure (Pressure)
+	   - module_calc_rh.f90
+		rh (Relative Humidity)
+	   - module_calc_slp.f90
+		slp (Sea Level Pressure)
+	   - module_calc_tc.f90
+		tc (Temperature in C)
+	   - module_calc_td.f90
+		td (Dew Point Temperature)
+	   - module_calc_theta.f90
+		theta (Potential Temperature)
+	   - module_calc_tk.f90
+		tk (Temperature in K)
+	   - module_calc_uvmet.f90
+		umet, vmet, u10m, v10m (U and V rotated to earth coordiantes)
+	   - module_calc_wdir.f90
+		wdir, wdir10 (Wind Direction)
+	   - module_calc_wspd.f90
+		wspd, wspd10 (Wind Speed)
+	   - module_calc_clfr.f90
+		clfr (low,mid and high clouds)
+		
+
+	TO ADD DIAGNOSTICS
+		First make sure that all the arrays needed for the calculations are 
+		available. The following are carried NOW.
+		XLAT, XLONG, HGT, PSFC, P, PB, PH, PHB, QV, T(theta-300), TT(temp in K from metdata)
+		U10, V10, UUU, VVV (if keep_wind_arrays = TRUE)
+		QR, QS, QG (if keep_moist_arrays = TRUE)
+
+		Logical variables have_* indicate if arrays are present.
+
+		See src/module_model_basics.f90, and src/module_arrays.f90
+
+		Create a new module (module_calc_*.f90) which will calculate the new
+		diagnostic variable. Look at one of the existing ones for an example.
+
+		Add CALL to src/module_diagmostics.f90
+			Must call the following 3 routines
+				CALL calc_* (new diagnostics)
+				CALL interp (to interpolate to output grid)
+				CALL write_dat (to write output)
+
+		Make appropriate changes to the Makefile
+
+		If a new 3D diagnostical field had been created, AND Vis5D output are
+		going to be generated, this new field must also be added to "known_3d_fields"
+		in src/v5d_module.f90
+
+		
+Special NOTES:
+Vis5D output, cannot have 'plot = "all"'
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/arch/Config.pl
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/arch/Config.pl	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/arch/Config.pl	(revision 207)
@@ -0,0 +1,169 @@
+#!/usr/bin/perl
+#
+# Configuration script for ARWpost code
+# 
+# Be sure to run as ./configure (to avoid getting a system configure command by mistake)
+#
+
+$sw_perl_path = perl ;
+$sw_netcdf_path = "" ;
+$sw_ldflags=""; 
+$sw_compileflags=""; 
+$sw_os = "ARCH" ;           # ARCH will match any
+$sw_mach = "ARCH" ;         # ARCH will match any
+
+while ( substr( $ARGV[0], 0, 1 ) eq "-" )
+ {
+  if ( substr( $ARGV[0], 1, 5 ) eq "perl=" )
+  {
+    $sw_perl_path = substr( $ARGV[0], 6 ) ;
+  }
+  if ( substr( $ARGV[0], 1, 7 ) eq "netcdf=" )
+  {
+    $sw_netcdf_path = substr( $ARGV[0], 8 ) ;
+  }
+  if ( substr( $ARGV[0], 1, 3 ) eq "os=" )
+  {
+    $sw_os = substr( $ARGV[0], 4 ) ;
+  }
+  if ( substr( $ARGV[0], 1, 5 ) eq "mach=" )
+  {
+    $sw_mach = substr( $ARGV[0], 6 ) ;
+  }
+  if ( substr( $ARGV[0], 1, 8 ) eq "ldflags=" )
+  {
+    $sw_ldflags = substr( $ARGV[0], 9 ) ;
+# multiple options separated by spaces are passed in from sh script
+# separated by ! instead. Replace with spaces here.
+    $sw_ldflags =~ s/!/ /g ;
+  }
+  if ( substr( $ARGV[0], 1, 13 ) eq "compileflags=" )
+  {
+    $sw_compileflags = substr( $ARGV[0], 14 ) ;
+    $sw_compileflags =~ s/!/ /g ;
+  }
+  shift @ARGV ;
+ }
+
+
+# parse the configure.wps file
+
+$validresponse = 0 ;
+
+# Display the choices to the user and get selection
+until ( $validresponse ) {
+  printf "------------------------------------------------------------------------\n" ;
+  printf "Please select from among the following supported platforms.\n\n" ;
+
+  $opt = 1 ;
+  open CONFIGURE_DEFAULTS, "< ./arch/configure.defaults" 
+      or die "Cannot open ./arch/configure.defaults for reading" ;
+  while ( <CONFIGURE_DEFAULTS> )
+  {
+    if ( substr( $_, 0, 5 ) eq "#ARCH" && ( index( $_, $sw_os ) >= 0 ) && ( index( $_, $sw_mach ) >= 0 ) )
+    {
+      $optstr[$opt] = substr($_,6) ;
+      $optstr[$opt] =~ s/^[ 	]*// ;
+      if ( substr( $optstr[$opt], 0,4 ) ne "NULL" )
+      {
+        printf "  %2d.  %s",$opt,$optstr[$opt] ;
+        $opt++ ;
+      }
+    }
+  }
+  close CONFIGURE_DEFAULTS ;
+
+  $opt -- ;
+
+  printf "\nEnter selection [%d-%d] : ",1,$opt ;
+  $response = <STDIN> ;
+
+  if ( $response == -1 ) { exit ; }
+
+  if ( $response >= 1 && $response <= $opt ) 
+  { $validresponse = 1 ; }
+  else
+  { printf("\nInvalid response (%d)\n",$response);}
+}
+printf "------------------------------------------------------------------------\n" ;
+
+$optchoice = $response ;
+
+open CONFIGURE_DEFAULTS, "< ./arch/configure.defaults" 
+      or die "Cannot open ./arch/configure.defaults for reading" ;
+$latchon = 0 ;
+while ( <CONFIGURE_DEFAULTS> )
+{
+  if ( substr( $_, 0, 5 ) eq "#ARCH" && $latchon == 1 )
+  {
+    $latchon = 0 ;
+  }
+  if ( $latchon == 1 )
+  {
+    $_ =~ s/CONFIGURE_PERL_PATH/$sw_perl_path/g ;
+    $_ =~ s/CONFIGURE_NETCDF_PATH/$sw_netcdf_path/g ;
+    $_ =~ s/CONFIGURE_LDFLAGS/$sw_ldflags/g ;
+    $_ =~ s/CONFIGURE_COMPILEFLAGS/$sw_compileflags/g ;
+    if ( $sw_netcdf_path ) 
+      { $_ =~ s/CONFIGURE_WRFIO_NF/wrfio_nf/g ;
+	$_ =~ s:CONFIGURE_NETCDF_FLAG:-DNETCDF: ;
+	$_ =~ s:CONFIGURE_NETCDF_LIB_PATH:-L../external/io_netcdf -lwrfio_nf -L$sw_netcdf_path/lib -lnetcdf: ;
+	 }
+    else                   
+      { $_ =~ s/CONFIGURE_WRFIO_NF//g ;
+	$_ =~ s:CONFIGURE_NETCDF_FLAG::g ;
+	$_ =~ s:CONFIGURE_NETCDF_LIB_PATH::g ;
+	 }
+
+
+    @machopts = ( @machopts, $_ ) ;
+  }
+  if ( substr( $_, 0, 5 ) eq "#ARCH" && $latchon == 0 )
+  {
+    $x=substr($_,6) ;
+    $x=~s/^[     ]*// ;
+    if ( $x eq $optstr[$optchoice] )
+    {
+      $latchon = 1 ;
+    }
+  }
+}
+close CONFIGURE_DEFAULTS ;
+
+#printf "------------------------------------------------------------------------\n" ;
+#foreach $f ( @machopts )
+#{
+#  if ( substr( $f , 0 , 8 ) eq "external" ) { last ; }
+#  print $f ;
+#}
+#printf "------------------------------------------------------------------------\n" ;
+#printf "\nYou have chosen: %s",$optstr[$optchoice] ;
+#printf "Listed above are the default options for this platform.\n" ;
+#printf "Settings are written to the file configure.wps here in the top-level\n" ;
+#printf "directory.  If you wish to change settings, please edit that file.\n" ;
+#printf "If you wish to change the default options, edit the file:\n\n" ;
+#printf "     arch/configure.defaults\n" ;
+#printf "\n" ;
+
+open CONFIGURE_WRF, "> configure.arwp" or die "cannot append configure.arwp" ;
+open ARCH_PREAMBLE, "< arch/preamble" or die "cannot open arch/preamble" ;
+my @preamble;
+# apply substitutions to the preamble...
+while ( <ARCH_PREAMBLE> )
+  {
+  @preamble = ( @preamble, $_ ) ;
+  }
+close ARCH_PREAMBLE ;
+print CONFIGURE_WRF @preamble  ;
+close ARCH_PREAMBLE ;
+printf CONFIGURE_WRF "# Settings for %s", $optstr[$optchoice] ;
+print CONFIGURE_WRF @machopts  ;
+open ARCH_POSTAMBLE, "< arch/postamble" or die "cannot open arch/postamble" ;
+while ( <ARCH_POSTAMBLE> ) { print CONFIGURE_WRF } ;
+close ARCH_POSTAMBLE ;
+close CONFIGURE_WRF ;
+
+printf "Configuration successful. To build the WPS, type: compile \n" ;
+printf "------------------------------------------------------------------------\n" ;
+
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/arch/configure.defaults
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/arch/configure.defaults	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/arch/configure.defaults	(revision 207)
@@ -0,0 +1,320 @@
+###########################################################
+#ARCH	AIX	(no vis5d) 
+#
+FC		=	xlf90_r
+FFLAGS		=	-qfree=f90
+F77FLAGS	=	-qfixed
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	cc
+CFLAGS		=	
+CPP		=	/usr/lib/cpp -C -P
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 
+
+###########################################################
+#ARCH	AIX	(vis5d)
+#
+FC		=	xlf90_r
+FFLAGS		=	-qfree=f90
+F77FLAGS	=	-qfixed
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	cc
+CFLAGS		=	
+CPP		=	/usr/lib/cpp -C -P
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -DV5D
+LIBVIS5D	=	/usr/local/vis5d/src/binio.o /usr/local/vis5d/src/v5d.o
+
+###########################################################
+#ARCH	Compaq OSF1 alpha	(no vis5d)
+#
+FC		=	f90
+FFLAGS		=	-free -convert big_endian
+F77FLAGS	=	-convert big_endian
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	cc
+CFLAGS		=	
+CPP		=	/usr/bin/cpp -C -P -traditional
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw
+
+###########################################################
+#ARCH	Compaq OSF1 alpha	(vis5d)
+#
+FC		=	f90
+FFLAGS		=	-free -convert big_endian
+F77FLAGS	=	-convert big_endian
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	cc
+CFLAGS		=	
+CPP		=	/usr/bin/cpp -C -P -traditional
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw -DV5D
+LIBVIS5D	=	/usr/local/vis5d/src/binio.o /usr/local/vis5d/src/v5d.o
+
+###########################################################
+#ARCH	PC Linux i486 i586 i686 x86_64, PGI compiler	(no vis5d)
+#
+FC		=	pgf90
+FFLAGS		=	-Mfree -byteswapio -O
+F77FLAGS	=	-byteswapio -O
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	gcc
+CFLAGS		=	-O
+CPP		=	/lib/cpp -C -P -traditional
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw 
+
+###########################################################
+#ARCH	PC Linux i486 i586 i686 x86_64, PGI compiler	(vis5d)
+#
+FC		=	pgf90
+FFLAGS		=	-Mfree -byteswapio -O
+F77FLAGS	=	-byteswapio -O
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	gcc
+CFLAGS		=	-O
+CPP		=	/lib/cpp -C -P -traditional
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw -DV5D
+LIBVIS5D	=	/usr/local/vis5d/src/binio.o /usr/local/vis5d/src/v5d.o
+
+###########################################################
+#ARCH	PC Linux ia64, PGI compiler	(no vis5d)
+#
+FC		=	pgf90
+FFLAGS		=	-Mfree -byteswapio -O
+F77FLAGS	=	-byteswapio -O
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	gcc
+CFLAGS		=	-O
+CPP		=	/lib/cpp -C -P -traditional
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -Dbytesw 
+
+###########################################################
+#ARCH	PC Linux ia64, PGI compiler	(vis5d)
+#
+FC		=	pgf90
+FFLAGS		=	-Mfree -byteswapio -O
+F77FLAGS	=	-byteswapio -O
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	gcc
+CFLAGS		=	-O
+CPP		=	/lib/cpp -C -P -traditional
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -Dbytesw -DV5D
+LIBVIS5D	=	/usr/local/vis5d/src/binio.o /usr/local/vis5d/src/v5d.o
+
+###########################################################
+#ARCH	PC Linux i486 i586 i686 x86_64, Intel compiler	(no vis5d)
+#
+FC		=	ifort
+FFLAGS		=	-FR -convert big_endian
+F77FLAGS	=	-convert big_endian
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	gcc
+CFLAGS		=	-w
+CPP		=	/lib/cpp -C -P -traditional
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw 
+
+###########################################################
+#ARCH	PC Linux i486 i586 i686 x86_64, Intel compiler	(vis5d)
+#
+FC		=	ifort
+FFLAGS		=	-FR -convert big_endian
+F77FLAGS	=	-convert big_endian
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	gcc
+CFLAGS		=	-w
+CPP		=	/lib/cpp -C -P -traditional
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw -DV5D
+LIBVIS5D	=	/usr/local/vis5d/src/binio.o /usr/local/vis5d/src/v5d.o
+
+###########################################################
+#ARCH	PC Linux ia64, Intel compiler	(no vis5d)
+#
+FC		=	ifort
+FFLAGS		=	-FR -convert big_endian
+F77FLAGS	=	-convert big_endian
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	gcc
+CFLAGS		=	-w
+CPP		=	/lib/cpp -C -P -traditional
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -Dbytesw 
+
+###########################################################
+#ARCH	PC Linux ia64, Intel compiler	(vis5d)
+#
+FC		=	ifort
+FFLAGS		=	-FR -convert big_endian
+F77FLAGS	=	-convert big_endian
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	gcc
+CFLAGS		=	-w
+CPP		=	/lib/cpp -C -P -traditional
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -Dbytesw -DV5D
+LIBVIS5D	=	/usr/local/vis5d/src/binio.o /usr/local/vis5d/src/v5d.o
+
+###########################################################
+#ARCH	SGI 64 bit IRIX64	(no vis5d)
+#
+FC		=	f90
+FFLAGS		=	-freeform -64
+F77FLAGS	=	-64
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	cc
+CFLAGS		=	-64
+CPP		=	/lib/cpp -C -P
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw
+
+###########################################################
+#ARCH	SGI 64 bit IRIX64	(vis5d)
+#
+FC		=	f90
+FFLAGS		=	-freeform -64
+F77FLAGS	=	-64
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	cc
+CFLAGS		=	-64
+CPP		=	/lib/cpp -C -P
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw -DV5D
+LIBVIS5D	=	/usr/local/vis5d/src/binio.o /usr/local/vis5d/src/v5d.o
+
+###########################################################
+#ARCH	Sun SunOS	(no vis5d)
+#
+FC		=	f90
+FFLAGS		=	-free
+F77FLAGS	=	
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	cc
+CFLAGS		=	-O
+CPP		=	/usr/ccs/lib/cpp -C -P
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw
+
+###########################################################
+#ARCH	Sun SunOS	(vis5d)
+#
+FC		=	f90
+FFLAGS		=	-free
+F77FLAGS	=	
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	cc
+CFLAGS		=	-O
+CPP		=	/usr/ccs/lib/cpp -C -P
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw -DV5D
+LIBVIS5D	=	/usr/local/vis5d/src/binio.o /usr/local/vis5d/src/v5d.o
+
+###########################################################
+#ARCH	Darwin	(no vis5d)
+#
+FC		=	xlf90_r
+FFLAGS		=	-qfree
+F77FLAGS	=	-qfixed
+FNGFLAGS	=	$(FFLAGS) -qextname
+LDFLAGS		=	-Wl,-stack_size,10000000,-stack_addr,0xc0000000
+CC		=	cc
+CFLAGS		=	-O
+CPP		=	/usr/bin/cpp -C -P
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw 
+RANLIB		=	ranlib
+
+###########################################################
+#ARCH	Darwin	(vis5d)
+#
+FC		=	xlf90_r
+FFLAGS		=	-qfree
+F77FLAGS	=	-qfixed
+FNGFLAGS	=	$(FFLAGS) -qextname
+LDFLAGS		=	-Wl,-stack_size,10000000,-stack_addr,0xc0000000
+CC		=	cc
+CFLAGS		=	-O
+CPP		=	/usr/bin/cpp -C -P
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw -DV5D
+LIBVIS5D	=	/usr/local/vis5d/src/binio.o /usr/local/vis5d/src/v5d.o
+RANLIB		=	ranlib
+
+###########################################################
+#ARCH	Darwin - with SystemStuds	(no vis5d)
+#
+FC		=	xlf90_r
+FFLAGS		=	-qfree
+F77FLAGS	=	-qfixed
+FNGFLAGS	=	$(FFLAGS) -qextname
+LDFLAGS		=	-Wl,-stack_size,10000000,-stack_addr,0xc0000000 -L/usr/lib -lSystemStubs
+CC		=	gcc-3.3
+CFLAGS		=	-O
+CPP		=	/usr/bin/cpp -C -P
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw 
+RANLIB		=	ranlib
+
+###########################################################
+#ARCH	Darwin - with SystemStuds	(vis5d)
+#
+FC		=	xlf90_r
+FFLAGS		=	-qfree
+F77FLAGS	=	-qfixed
+FNGFLAGS	=	$(FFLAGS) -qextname
+LDFLAGS		=	-Wl,-stack_size,10000000,-stack_addr,0xc0000000 -L/usr/lib -lSystemStubs
+CC		=	gcc-3.3
+CFLAGS		=	-O
+CPP		=	/usr/bin/cpp -C -P
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw -DV5D
+LIBVIS5D	=	/usr/local/vis5d/src/binio.o /usr/local/vis5d/src/v5d.o
+RANLIB		=	ranlib
+
+###########################################################
+#ARCH	Darwin - with g95 compiler	(no vis5d)
+#
+FC		=	g95
+FFLAGS		=	-ffree-form -fendian=big
+F77FLAGS	=	-ffixed-form -fendian=big
+FNGFLAGS	=	$(FFLAGS) 
+LDFLAGS		=	-Wl,-stack_size,10000000,-stack_addr,0xc0000000
+CC		=	gcc
+CFLAGS		=	
+CPP		=	/usr/bin/cpp -C -P -traditional
+CPPFLAGS	=	-DIO_NETCDF -DRECL4 -Dbytesw 
+RANLIB		=	
+
+###########################################################
+#ARCH	Darwin - with g95 compiler	(vis5d)
+#
+FC		=	g95
+FFLAGS		=	-ffree-form -fendian=big
+F77FLAGS	=	-ffixed-form -fendian=big
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	-Wl,-stack_size,10000000,-stack_addr,0xc0000000
+CC		=	gcc
+CFLAGS		=	
+CPP		=	/usr/bin/cpp -C -P -traditional
+CPPFLAGS	=	-DIO_NETCDF -DRECL4 -Dbytesw -DV5D
+LIBVIS5D	=	/usr/local/vis5d/src/binio.o /usr/local/vis5d/src/v5d.o
+RANLIB		=	
+
+##################################################################
+#ARCH	NULL
+###########################################################
+#ARCH PC Linux i486 i586 i686 x86_64, g95 compiler (vis5d)
+#
+FC = g95
+FFLAGS = -ffree-form -fendian=big -fno-second-underscore
+F77FLAGS = -ffixed-form -fendian=big -fno-second-underscore
+FNGFLAGS = $(FFLAGS)
+LDFLAGS =
+CC = gcc
+CFLAGS = -DpgiFortran
+CPP = /usr/bin/cpp -C -P -traditional
+CPPFLAGS = -DIO_NETCDF -DRECL4 -Dbytesw #-DV5D
+#LIBVIS5D = /usr/local/vis5d/src/binio.o /usr/local/vis5d/src/v5d.o
+
+###########################################################
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/arch/postamble
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/arch/postamble	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/arch/postamble	(revision 207)
@@ -0,0 +1,35 @@
+#
+#	Macros, these should be generic for all machines
+
+LN		=	ln -sf
+MAKE		=	make -i -r
+RM		= 	/bin/rm -f
+CP		= 	/bin/cp
+AR		=	ar ru
+
+WRF_INCLUDE	=	-I${WRF_DIR_PRE}$(WRF_DIR)/external/io_netcdf \
+			-I${WRF_DIR_PRE}$(WRF_DIR)/external/io_grib_share \
+			-I${WRF_DIR_PRE}$(WRF_DIR)/external/io_grib1 \
+			-I${WRF_DIR_PRE}$(WRF_DIR)/external/io_int \
+			-I${WRF_DIR_PRE}$(WRF_DIR)/inc
+
+.IGNORE:
+.SUFFIXES: .c .f90 .F90 .f .F .o
+
+#	There is probably no reason to modify these rules
+
+.c.o:
+	$(RM) $@
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<	
+
+.f90.o:
+	$(RM) $@ $*.mod
+	$(CP) $< $*.f
+	$(FC) $(FFLAGS) -c $*.f $(WRF_INCLUDE)
+	$(RM) $*.f
+
+.F90.o:
+	$(RM) $@ $*.mod
+	$(CPP) $(CPPFLAGS) $(FDEFS) $(WRF_INCLUDE) $< > $*.f
+	$(FC) $(FFLAGS) -c $*.f $(WRF_INCLUDE)
+	$(RM) $*.f
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/arch/preamble
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/arch/preamble	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/arch/preamble	(revision 207)
@@ -0,0 +1,30 @@
+# configure.arwp
+#
+# This file was automatically generated by the configure script in the
+# top level directory. You may make changes to the settings in this
+# file but be aware they will be overwritten each time you run configure.
+# Ordinarily, it is necessary to run configure once, when the code is
+# first installed.
+#
+# To permanently change options, change the settings for your platform
+# in the file arch/configure.defaults, the preamble, and the postamble -
+# then rerun configure.
+#
+
+.SUFFIXES: .F90 .f90 .F .f .c .o
+
+SHELL           	=       /bin/sh
+
+# Listing of options that are usually independent of machine type.
+# When necessary, these are over-ridden by each architecture.
+
+ARFLAGS			=	
+
+PERL			=	perl
+
+RANLIB			=	echo
+
+WRF_DIR			=	../WRFV2
+
+#### Architecture specific settings ####
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/atlas.gw.def
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/atlas.gw.def	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/atlas.gw.def	(revision 207)
@@ -0,0 +1,276 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  -or- @report.idl
+;  -or- @movie.idl
+;
+;  this file will be saved !
+;
+;;---------------------------------------
+
+
+;-------------------------------------;
+; DATA LOCATION and PLOT DESTINATION  ;
+; default is ./                       ;
+;-------------------------------------;
+datafolder='/tmp7/aslmd/MERIDIANI_FLUSH'
+plotfolder=datafolder
+;; for web anim and tex report (default is 'plot')
+textitle='atlas_2_1416_FLUSH'
+texcomments='sol'
+
+;;; load/save ARWpost-generated text files ? default is no
+;backup_data='yes'
+;already_data='yes'
+
+;-------------------------------
+;-------------------------------
+; namelist.ARWPOST parameters
+;-------------------------------
+;-------------------------------
+
+nam1=" fields = 'HGT,U,V,TSURF' "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE FIELDS TO BE EXTRACTED 
+;; ex: tk,HGT,PSFC,U,V,W,T,tk,ICETOT,RAVE,QH2O_ICE,QH2O,PTOT,TSURF
+
+nam2=" start_date = '2024-09-07_12:00:00'
+nam3=" end_date = '2024-09-08_18:00:00'
+;nam2=" start_date = '2024-09-13_12:00:00'
+;nam3=" end_date = '2024-09-13_18:00:00'
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE START/END DATE
+
+;nam4=" interval_seconds = 3700 "
+nam4=" interval_seconds = 7400 "
+;nam4=" interval_seconds = 88800 "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
+;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s, 12h: 44400s	
+
+nam5=" interp_method = 1 "	
+nam5=" interp_method = 0 "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 		
+;; SET VERT. COORD. 0: eta levels, 1: height (inc) or pressure (dec)
+
+tabnam=[0.0, 5.0, 1.0]
+tabnam=[999.,0.,1.,4.,6.,10.,20.]
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; SET HEIGHT/PRESSURE LEVELS WITH [first alt, last alt, step]
+
+;nest='d03'  
+;; ^ ^ ^ ^
+;; SET NEST
+
+
+
+;----------------------------------------------------
+;----------------------------------------------------
+; what do you want to plot ?
+; THIS MUST BE SET ACCORDINGLY TO PREVIOUS SECTION
+;   - do not plot a field not extracted
+;   - do not ask for more plot than data available
+;----------------------------------------------------
+;----------------------------------------------------
+
+num=23		   	;; how many plots ?
+;num=7
+;num=1
+
+field1='U'		;; FILLED
+;field2='TSURF'		;; CONTOURED
+winds=['U','V']		;; VECTORS
+topo=1
+
+;;; VORTICITY
+;field1='HGT' & winds=['U','V'] & topo=1
+
+;----------------------------------
+;----------------------------------
+; what kind of plot do you want ? 
+;----------------------------------
+;----------------------------------
+
+;; first is 1
+plot='map' & level=2 ;1	
+;plot='meridional' & nlon=50
+;plot='zonal' & nlat=66
+
+;---------;
+; special ;
+;---------;
+;;; SEA-LEVEL PRESSURE
+;field1='PSFC' & winds=['tk','HGT'] & topo=1 & plot='map' & level=2 ;6 ;2 ;7
+;;; HORIZONTAL WIND VELOCITY
+;field1='U' & winds=['U','V'] & topo=1 & plot='map' & level=2 ;6 ;2 ;9
+
+
+;;;useidlfile='true' ;; if you are just changing what is below...
+
+
+;----------------------------
+;----------------------------
+; change plot settings 
+;----------------------------
+;----------------------------
+
+;; uncomment to modify default plot settings
+;; | | | | | | | | | | | | | | | | | | | | |
+;; v v v v v v v v v v v v v v v v v v v v v
+
+;;;
+;;; PLOT TITLES
+;;;
+;subtitle_user='-- LMD Martian Mesoscale Model --'            ;; grepALL
+;title_user='Vertical Wind (!Nm!N.s!U-1!N)'     ;; grepALL
+;title_user='Dust opacity' ;; grepALL
+;title_axis=['x coord (km)','y coord (km)']     ;; grepALL
+
+;;;
+;;; COLOR TABLES
+;;;
+;flag_cb='false'                 ;; grepALL
+format='(F5.1)'                  ;; grepALL
+;format='(I0)'                   ;; grepALL
+;colors=128                      ;; grepALL
+pal=22                           ;; grepALL
+;pal=33                           ;; grepALL
+poscb=0.85			 ;; grepALL
+poscb=0.68                       ;; grepALL
+;; GOOD COLOR TABLES: 4, 18, 22, 16, 37, 33, 39
+
+;;;
+;;; FILL LIMITS
+;;;
+minfield_init= 0.    ;; grepALL
+maxfield_init= 25.    ;; grepALL
+
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max ;; grepALL
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min ;; grepALL
+;;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value ;; grepALL
+
+;;;
+;;; WINDS
+;;;
+windex=25.	;; grepALL
+stride=3.	;; grepALL
+
+;;;
+;;; CONTOUR
+;;;
+;overcontour=overcontour-mean(overcontour)	;; grepALL
+lev=-10. + 0.5*findgen(100) ;; grepALL
+;lev=120.+5.*findgen(50) ;; grepALL
+
+;;;
+;;; AXIS
+;;;
+;isotropic='false'       ;; grepALL
+intervalx=2.            ;; grepALL
+intervaly=2.            ;; grepALL
+
+;;;
+;;; MAP LIMITS 
+;;;
+windowx=[-20.,08.]       ;; grepMAP
+windowy=[-16.,12.]       ;; grepMAP
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-4.		;; grepSEC
+;maxalt=16.		;; grepSEC
+;minspace=-30.   	;; grepSEC
+;maxspace=0.   		;; grepSEC
+
+;;
+;; METRIC UNITS FOR VERTICAL SECTION
+;;
+;factor=20.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;; POUBELLE
+
+
+;; DEFAULT: ARWPOST.EXE ALREADY RUN (i.e. input.ctl and input.dat already there)
+;; UNCOMMENT FOLLOWING LINE TO EXTRACT FILES 
+;extract='yes'   ;;   EXECUTE ARWPOST.EXE
+                ;;   WITH THE FOLLOWING PARAMETERS :
+
+
+;@map_sea_level.idl
+;@map_ertel_vorticity.idl
+;field1='HGT'
+;field2='U'
+;winds=['U','V']
+;topo=1
+
+
+;winds=['U','V'] & field1='SWDOWN' & topo=1
+;winds=['V','W'] & field1='V' 
+;field1='ICETOT' & topo=1
+;field1='RAVE' & topo=1
+;field1='QH2O_ICE' & topo=1
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O' & field2='W'
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O_ICE' & field2='tk'
+;field1='tk' & topo=1
+;field1='V' & field2='V'
+;field1='W' & winds=['V','W']
+;field1='tk' & winds=['V','W']
+;field1='tk'
+;field1='W' & topo=1
+;field1='TSK' & topo=1
+;field1='U' & winds=['U','V'] & topo=1
+;winds=['V','W'] & field1='V'
+;winds=['V','W'] & field1='W'
+;field1='U' & winds=['U','V'] & topo=1
+;field1='HGT' & field2='HGT' 
+;field1='U' & winds=['U','V'] ;& topo=1
+;field1='PSFC' & winds=['U','V'] & field2='W'
+;field1='W' & winds=['U','V'] & field2='PSFC'
+;field1='TSURF' & topo=1 ;& winds=['U','V']
+;field1='T' & topo=1 & winds=['U','V']
+;field1='PSFC' & winds=['tk','HGT'] & topo=1
+;field1='tk' & topo=1
+;field1='tk' & winds=['U','V'] & topo=1
+;field1='T' & field2='T'
+;field1='T' & winds=['U','V'] 
+;field1='HGT' & winds=['HGT','HGT'] 
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/atlas.gw.def.ref
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/atlas.gw.def.ref	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/atlas.gw.def.ref	(revision 207)
@@ -0,0 +1,276 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  -or- @report.idl
+;  -or- @movie.idl
+;
+;  this file will be saved !
+;
+;;---------------------------------------
+
+
+;-------------------------------------;
+; DATA LOCATION and PLOT DESTINATION  ;
+; default is ./                       ;
+;-------------------------------------;
+datafolder='/tmp7/aslmd/MERIDIANI_FLUSH'
+plotfolder=datafolder
+;; for web anim and tex report (default is 'plot')
+textitle='atlas_2_1416_FLUSH'
+texcomments='sol'
+
+;;; load/save ARWpost-generated text files ? default is no
+;backup_data='yes'
+;already_data='yes'
+
+;-------------------------------
+;-------------------------------
+; namelist.ARWPOST parameters
+;-------------------------------
+;-------------------------------
+
+nam1=" fields = 'HGT,U,V,TSURF' "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE FIELDS TO BE EXTRACTED 
+;; ex: tk,HGT,PSFC,U,V,W,T,tk,ICETOT,RAVE,QH2O_ICE,QH2O,PTOT,TSURF
+
+nam2=" start_date = '2024-09-07_12:00:00'
+nam3=" end_date = '2024-09-08_18:00:00'
+;nam2=" start_date = '2024-09-13_12:00:00'
+;nam3=" end_date = '2024-09-13_18:00:00'
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE START/END DATE
+
+;nam4=" interval_seconds = 3700 "
+nam4=" interval_seconds = 7400 "
+;nam4=" interval_seconds = 88800 "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
+;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s, 12h: 44400s	
+
+nam5=" interp_method = 1 "	
+nam5=" interp_method = 0 "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 		
+;; SET VERT. COORD. 0: eta levels, 1: height (inc) or pressure (dec)
+
+tabnam=[0.0, 5.0, 1.0]
+tabnam=[999.,0.,1.,4.,6.,10.,20.]
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; SET HEIGHT/PRESSURE LEVELS WITH [first alt, last alt, step]
+
+;nest='d03'  
+;; ^ ^ ^ ^
+;; SET NEST
+
+
+
+;----------------------------------------------------
+;----------------------------------------------------
+; what do you want to plot ?
+; THIS MUST BE SET ACCORDINGLY TO PREVIOUS SECTION
+;   - do not plot a field not extracted
+;   - do not ask for more plot than data available
+;----------------------------------------------------
+;----------------------------------------------------
+
+num=23		   	;; how many plots ?
+;num=7
+;num=1
+
+field1='U'		;; FILLED
+;field2='TSURF'		;; CONTOURED
+winds=['U','V']		;; VECTORS
+topo=1
+
+;;; VORTICITY
+;field1='HGT' & winds=['U','V'] & topo=1
+
+;----------------------------------
+;----------------------------------
+; what kind of plot do you want ? 
+;----------------------------------
+;----------------------------------
+
+;; first is 1
+plot='map' & level=2 ;1	
+;plot='meridional' & nlon=50
+;plot='zonal' & nlat=66
+
+;---------;
+; special ;
+;---------;
+;;; SEA-LEVEL PRESSURE
+;field1='PSFC' & winds=['tk','HGT'] & topo=1 & plot='map' & level=2 ;6 ;2 ;7
+;;; HORIZONTAL WIND VELOCITY
+;field1='U' & winds=['U','V'] & topo=1 & plot='map' & level=2 ;6 ;2 ;9
+
+
+;;;useidlfile='true' ;; if you are just changing what is below...
+
+
+;----------------------------
+;----------------------------
+; change plot settings 
+;----------------------------
+;----------------------------
+
+;; uncomment to modify default plot settings
+;; | | | | | | | | | | | | | | | | | | | | |
+;; v v v v v v v v v v v v v v v v v v v v v
+
+;;;
+;;; PLOT TITLES
+;;;
+;subtitle_user='-- LMD Martian Mesoscale Model --'            ;; grepALL
+;title_user='Vertical Wind (!Nm!N.s!U-1!N)'     ;; grepALL
+;title_user='Dust opacity' ;; grepALL
+;title_axis=['x coord (km)','y coord (km)']     ;; grepALL
+
+;;;
+;;; COLOR TABLES
+;;;
+;flag_cb='false'                 ;; grepALL
+format='(F5.1)'                  ;; grepALL
+;format='(I0)'                   ;; grepALL
+;colors=128                      ;; grepALL
+pal=22                           ;; grepALL
+;pal=33                           ;; grepALL
+poscb=0.85			 ;; grepALL
+poscb=0.68                       ;; grepALL
+;; GOOD COLOR TABLES: 4, 18, 22, 16, 37, 33, 39
+
+;;;
+;;; FILL LIMITS
+;;;
+minfield_init= 0.    ;; grepALL
+maxfield_init= 25.    ;; grepALL
+
+lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max ;; grepALL
+lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min ;; grepALL
+;;lim_blank = 0.2 & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value ;; grepALL
+
+;;;
+;;; WINDS
+;;;
+windex=25.	;; grepALL
+stride=3.	;; grepALL
+
+;;;
+;;; CONTOUR
+;;;
+;overcontour=overcontour-mean(overcontour)	;; grepALL
+lev=-10. + 0.5*findgen(100) ;; grepALL
+;lev=120.+5.*findgen(50) ;; grepALL
+
+;;;
+;;; AXIS
+;;;
+;isotropic='false'       ;; grepALL
+intervalx=2.            ;; grepALL
+intervaly=2.            ;; grepALL
+
+;;;
+;;; MAP LIMITS 
+;;;
+windowx=[-20.,08.]       ;; grepMAP
+windowy=[-16.,12.]       ;; grepMAP
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-4.		;; grepSEC
+;maxalt=16.		;; grepSEC
+;minspace=-30.   	;; grepSEC
+;maxspace=0.   		;; grepSEC
+
+;;
+;; METRIC UNITS FOR VERTICAL SECTION
+;;
+;factor=20.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;; POUBELLE
+
+
+;; DEFAULT: ARWPOST.EXE ALREADY RUN (i.e. input.ctl and input.dat already there)
+;; UNCOMMENT FOLLOWING LINE TO EXTRACT FILES 
+;extract='yes'   ;;   EXECUTE ARWPOST.EXE
+                ;;   WITH THE FOLLOWING PARAMETERS :
+
+
+;@map_sea_level.idl
+;@map_ertel_vorticity.idl
+;field1='HGT'
+;field2='U'
+;winds=['U','V']
+;topo=1
+
+
+;winds=['U','V'] & field1='SWDOWN' & topo=1
+;winds=['V','W'] & field1='V' 
+;field1='ICETOT' & topo=1
+;field1='RAVE' & topo=1
+;field1='QH2O_ICE' & topo=1
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O' & field2='W'
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O_ICE' & field2='tk'
+;field1='tk' & topo=1
+;field1='V' & field2='V'
+;field1='W' & winds=['V','W']
+;field1='tk' & winds=['V','W']
+;field1='tk'
+;field1='W' & topo=1
+;field1='TSK' & topo=1
+;field1='U' & winds=['U','V'] & topo=1
+;winds=['V','W'] & field1='V'
+;winds=['V','W'] & field1='W'
+;field1='U' & winds=['U','V'] & topo=1
+;field1='HGT' & field2='HGT' 
+;field1='U' & winds=['U','V'] ;& topo=1
+;field1='PSFC' & winds=['U','V'] & field2='W'
+;field1='W' & winds=['U','V'] & field2='PSFC'
+;field1='TSURF' & topo=1 ;& winds=['U','V']
+;field1='T' & topo=1 & winds=['U','V']
+;field1='PSFC' & winds=['tk','HGT'] & topo=1
+;field1='tk' & topo=1
+;field1='tk' & winds=['U','V'] & topo=1
+;field1='T' & field2='T'
+;field1='T' & winds=['U','V'] 
+;field1='HGT' & winds=['HGT','HGT'] 
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/atlas2.pro
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/atlas2.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/atlas2.pro	(revision 207)
@@ -0,0 +1,54 @@
+;;
+;; ATLAS EXOMARS STUDY
+;;
+
+;;;;
+;;;; @atlas2
+;;;;
+
+;; 1. modify gw.def and try at one level to extract, tweak everything, etc..
+;; 2. change the name of plot in gw.def and make it start with atlas
+;; 3. copy gw.def in atlas.gw.def once it is done
+;; 4. modify below
+;; 5. test by commenting the @atlas_exec.pro
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+	zelevel = 1
+	@atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=999' >> gw.def" & PRINT, cmd  ;; end + extract
+;cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+        zelevel = 2
+        @atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+        zelevel = 3
+        @atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+        zelevel = 4
+        @atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+        zelevel = 5
+        @atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+        zelevel = 6
+        @atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/atlas2_height.pro
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/atlas2_height.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/atlas2_height.pro	(revision 207)
@@ -0,0 +1,66 @@
+;;
+;; ATLAS EXOMARS STUDY
+;;
+
+;;;;
+;;;; @atlas2
+;;;;
+
+;; 1. modify gw.def and try at one level to extract, tweak everything, etc..
+;; 2. change the name of plot in gw.def and make it start with atlas
+;; 3. copy gw.def in atlas.gw.def once it is done
+;; 4. modify below
+;; 5. test by commenting the @atlas_exec.pro
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+	zelevel = 1
+	@atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=999' >> gw.def" & PRINT, cmd  ;; end + extract
+;cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+        zelevel = 2
+        @atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+        zelevel = 3
+        @atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+        zelevel = 4
+        @atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+        zelevel = 5
+        @atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+        zelevel = 6
+        @atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;cmd = "\rm gw.def ; sed"
+;        zelevel = 7
+;        @atlas_changelevel.pro
+;cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+;@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;cmd = "\rm gw.def ; sed"
+;        zelevel = 8
+;        @atlas_changelevel.pro
+;cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+;@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/atlas2_modellevel.pro
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/atlas2_modellevel.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/atlas2_modellevel.pro	(revision 207)
@@ -0,0 +1,48 @@
+;;
+;; ATLAS EXOMARS STUDY
+;;
+
+;;;;
+;;;; @atlas2
+;;;;
+
+;; 1. modify gw.def and try at one level to extract, tweak everything, etc..
+;; 2. change the name of plot in gw.def and make it start with atlas
+;; 3. copy gw.def in atlas.gw.def once it is done
+;; 4. modify below
+;; 5. test by commenting the @atlas_exec.pro
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+	zelevel = 1
+	@atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=999' >> gw.def" & PRINT, cmd  ;; end + extract
+;cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;cmd = "\rm gw.def ; sed"
+;        zelevel = 2
+;        @atlas_changelevel.pro
+;cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+;@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+        zelevel = 4
+        @atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+cmd = "\rm gw.def ; sed"
+        zelevel = 6
+        @atlas_changelevel.pro
+cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;cmd = "\rm gw.def ; sed"
+;        zelevel = 8
+;        @atlas_changelevel.pro
+;cmd = cmd + " atlas.gw.def > gw.def ; echo 'dumb=000' >> gw.def" & PRINT, cmd  ;; end + don't extract
+;@atlas_exec.pro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/atlas_changelevel.pro
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/atlas_changelevel.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/atlas_changelevel.pro	(revision 207)
@@ -0,0 +1,19 @@
+;;;
+;;; modify atlas.gw.def to change level (given zelevel)
+;;; save that in gw.def
+;;;
+;;; INPUT : cmd
+;;; OUTPUT : cmd modified
+
+print, '-----------------------------------------------------'
+print, '----------------LEVEL  '+string(zelevel,'(I0)')+'-----------------------------'
+print, '-----------------------------------------------------'
+
+                ;; change name
+        cmd = cmd + " -e 's/atlas/atlas_"+string(zelevel,'(I0)')+"/g'"
+                ;; change level 
+        cmd = cmd + " -e 's/level=/level="+string(zelevel,'(I0)')+" ;/g'"
+		;; do that otherwise level will not be changed actually
+	cmd = cmd + " -e 's/useidlfile/;useidlfile/g'"
+
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/atlas_exec.pro
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/atlas_exec.pro	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/atlas_exec.pro	(revision 207)
@@ -0,0 +1,7 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+SPAWN, cmd
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+@gwc
+gw, 'w'
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/base
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/base	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/base	(revision 207)
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+echo 'type the title'
+read title
+echo 'type the caption'
+read caption
+
+quality=100
+
+
+rm -rf basefig
+mkdir basefig
+cd basefig
+cp ../base.eps fig1.eps
+cp ../base.eps fig2.eps
+cp ../base.eps fig3.eps
+cp ../base.eps fig4.eps
+cp ../base.eps fig5.eps
+cp ../base.eps fig6.eps
+cd ..
+
+convert -density ${quality}x${quality} -crop 0x0 $1 basefig/fig1.eps
+echo 'converted 1'
+
+convert -density ${quality}x${quality} -crop 0x0 $2 basefig/fig2.eps
+echo 'converted 2'
+
+convert -density ${quality}x${quality} -crop 0x0 $3 basefig/fig3.eps
+echo 'converted 3'
+
+convert -density ${quality}x${quality} -crop 0x0 $4 basefig/fig4.eps
+echo 'converted 4'
+
+convert -density ${quality}x${quality} -crop 0x0 $5 basefig/fig5.eps
+echo 'converted 5'
+
+convert -density ${quality}x${quality} -crop 0x0 $6 basefig/fig6.eps
+echo 'converted 6'
+
+echo $7
+
+sed s/thetitle/${title}/g basefig.tex | sed s/thecaption/${caption}/g > basefig_temp.tex 
+sed s/basefig/basefig_temp/g base.tex > base_temp.tex
+latex base_temp.tex > base_temp.tmp 
+
+mv -f base_temp.dvi base.dvi
+xdvi base.dvi &
+
+\rm base_temp*
+\rm basefig_temp.tex
+
+dvips -o base.ps base.dvi 
+\rm base.dvi
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/base.tex
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/base.tex	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/base.tex	(revision 207)
@@ -0,0 +1,55 @@
+\documentclass[10pt,twoside,a4paper]{report}
+                                                                            
+% Packages
+\usepackage[french]{babel}   % pour dire que le texte est en français
+\usepackage{a4}              % pour la taille
+\usepackage[T1]{fontenc}     % pour les font postscript
+\usepackage{epsfig}          % pour gérer les images
+\usepackage{psfig}
+\usepackage{graphicx}
+\usepackage{amsmath, amsthm} % très bon mode mathématique
+\usepackage{amsfonts,amssymb}% permet la definition des ensembles
+\usepackage{float}           % pour le placement des figure
+% \usepackage{pslatex}       % évite un affichage laid à l'écran
+% Style bibliographique
+\bibliographystyle{plain}
+% Definitions de nouvelles commandes
+%\newcommand{\N}{\mathbb{N}} % les entiers naturels
+                                                                                                         
+% Titre
+\title{Titre}
+                                                                                
+\author{Aymeric Spiga\footnote{Contact : aymeric.spiga@m4x.org}\\
+\\
+\\
+Resultats\\
+   \\
+    \\
+\\
+Sous la direction de François Forget\\
+\\
+Laboratoire de M\'et\'eorologie Dynamique du CNRS\\
+\\
+\\}
+                                                                                
+                                                                                
+%============================= Corps =================================
+
+\begin{document}
+                                                                                
+%\maketitle            % écrit le titre
+%\thispagestyle{empty}
+                                                                                
+                                                                                
+%\tableofcontents      % écrit la table des matières
+%\thispagestyle{empty}
+
+\input{basefig.tex}
+
+% Bibliographie
+%\section*{Annexe 2}
+%\input{biba.tex}
+
+
+\end{document}
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/basefig.tex
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/basefig.tex	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/basefig.tex	(revision 207)
@@ -0,0 +1,28 @@
+\section*{
+thetitle
+}
+                                                         
+\begin{figure}[!h]
+\centerline{
+\epsfig {file=basefig/fig1.eps,width=9cm}
+\hfill
+\epsfig {file=basefig/fig2.eps,width=9cm}
+}
+\centerline{ 
+\epsfig {file=basefig/fig3.eps,width=9cm}   
+\hfill
+\epsfig {file=basefig/fig4.eps,width=9cm}
+}
+\centerline{
+\epsfig {file=basefig/fig5.eps,width=9cm}
+\hfill
+\epsfig {file=basefig/fig6.eps,width=9cm}
+}
+\caption{\textit{
+thecaption
+}}
+\end{figure}
+                                                                                
+                                                         
+                                                         
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/bigconvert100
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/bigconvert100	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/bigconvert100	(revision 207)
@@ -0,0 +1,9 @@
+#!/bin/csh
+# f. forget
+foreach i ( $* )
+    echo $1
+    set name = `echo $1 | sed -e 's/\./ /' `
+    echo $name[1].png
+   convert -density 100x100 -crop 0x0 $1 $name[1].png
+   shift
+end
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/bigconvert200
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/bigconvert200	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/bigconvert200	(revision 207)
@@ -0,0 +1,9 @@
+#!/bin/csh
+# f.forget
+foreach i ( $* )
+    echo $1
+    set name = `echo $1 | sed -e 's/\./ /' `
+    echo $name[1].png
+   convert -density 200x200 -crop 0x0 $1 $name[1].png
+   shift
+end
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/change_bottom_top_dim
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/change_bottom_top_dim	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/change_bottom_top_dim	(revision 207)
@@ -0,0 +1,9 @@
+!!
+!! please recompile if modified (before: touch src/input_module.F90)
+!!
+!! -- indicate new bottom_top_stag dimension
+
+!bottom_top_dim=10
+!bottom_top_dim=8
+!bottom_top_dim=4
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/clean
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/clean	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/clean	(revision 207)
@@ -0,0 +1,47 @@
+#!/bin/csh -f
+
+set DEV_TOP = `pwd`
+
+set TOUCH = ORIG
+if ( ! -e configure.arwp ) then
+	touch configure.arwp
+	set TOUCH = TOUCH
+endif
+
+set nonomatch
+
+set DIRS = ( src )
+set EXES = ( ARWpost )
+
+set i = 1
+foreach dir ( $DIRS )
+	if ( -d $dir ) then 
+		( cd $dir ; make -i DEV_TOP="${DEV_TOP}" TARGET="$EXES[$i].exe" clean )
+	endif
+	/bin/rm -f $EXES[$i].exe
+	@ i ++
+end
+
+#	The nuclear option
+
+find . -name \*.exe -exec \rm {} \; 
+find . -name \*.o -exec \rm {} \; 
+find . -name \*.a -exec \rm {} \; 
+
+
+if ( "$1" == '-a' ) then
+	/bin/rm -rf ./netcdf_links
+	foreach dir ( $DIRS )
+		if ( -d $dir ) then 
+			( cd $dir ; make -i DEV_TOP="${DEV_TOP}" TARGET="${dir}.exe" clobber >& /dev/null )
+		endif
+	end
+	if ( -e configure.arwp ) then
+		/bin/cp configure.arwp configure.arwp.backup
+		/bin/rm -f configure.arwp
+	endif
+endif
+
+if ( ( $TOUCH == TOUCH ) && ( -e configure.arwp ) ) then
+	/bin/rm -f configure.arwp
+endif
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/compile
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/compile	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/compile	(revision 207)
@@ -0,0 +1,40 @@
+#!/bin/csh -f
+
+if ( ! -e configure.arwp ) then
+	echo "Do 'configure' first"
+	exit ( 1 ) 
+endif
+
+if  ( ( ! $?NETCDF ) && ( -d netcdf_links ) ) then
+	setenv NETCDF `pwd`/netcdf_links
+	setenv temp_netcdf 1
+else
+	setenv temp_netcdf 0
+endif
+
+set DEV_TOP = `pwd`
+set first_char = `grep ^WRF_DIR configure.arwp | awk '{print $3}' | cut -c -1`
+
+if ( "$first_char" == "/" ) then
+        set WRF_DIR_PRE =
+else
+        set WRF_DIR_PRE =       ${DEV_TOP}/
+endif
+
+
+echo " "
+echo "**** Compiling ARWpost ****"
+echo " "
+
+echo ${WRF_DIR_PRE}
+( cd src ; make -i -r WRF_DIR_PRE="${WRF_DIR_PRE}" all )
+     if ( -e src/ARWpost.exe ) then
+             ln -sf src/ARWpost.exe .
+     endif
+
+
+if ( $temp_netcdf == 1 ) then
+	unsetenv NETCDF
+endif
+
+exit(0)
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/configure
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/configure	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/configure	(revision 207)
@@ -0,0 +1,144 @@
+#!/bin/sh
+
+arg1=$1
+
+# Look for netcdf
+if test -z "$NETCDF" ; then
+  for p in /usr/local/netcdf
+  do
+    if test -d $p ; then
+      NETCDF=$p
+      break
+    fi
+  done
+fi
+
+if  test -z "$NETCDF"  ; then
+ 
+  if [ `hostname | cut -c 1-2` = "bs" -o \
+       `hostname | cut -c 1-2` = "bv" -o \
+       `hostname` = "tempest" -o `hostname` = "lightning" ] ; then
+    echo 'Compiling on an NCAR system with weird paths to NetCDF'
+    echo 'Setting up a local NetCDF directory with symlinks'
+    if ( test -d ./netcdf_links ) ; then
+      echo 'A directory ./netcdf_links already exists. Continuing.'
+    else
+      mkdir ./netcdf_links
+      if [ -z "$OBJECT_MODE" ] ; then
+         OBJECT_MODE=32 
+         export OBJECT_MODE
+      fi
+      if [ $OBJECT_MODE -ne 64 -a \( `hostname | cut -c 1-2` = "bs" \) ] ; then
+        ( cd ./netcdf_links ; ln -s /usr/local/lib32/r4i4 ./lib ; \
+                              ln -s /usr/local/include ./include )
+      else
+        ( cd ./netcdf_links ; ln -s /usr/local/lib64/r4i4 ./lib ; \
+                              ln -s /usr/local/include ./include )
+      fi
+    fi
+    NETCDF=`pwd`/netcdf_links
+    export NETCDF
+
+
+  else
+    bedone=""
+    if [ -d ./netcdf_links ] ; then
+      echo '** There is an existing ./netcdf_links file. Should I use? [y]'
+      read resp
+      if [ "$resp" = "y" ] ; then
+        NETCDF=`pwd`/netcdf_links
+        bedone="yes"
+      else
+        echo 'Removing existing ./netcdf_links directory'
+        /bin/rm -fr ./netcdf_links
+      fi
+    else
+      echo '** WARNING: No path to NETCDF and environment variable NETCDF not set.'
+      echo '** would you like me to try to fix? [y]'
+    fi
+    netcdfipath=""
+    netcdflpath=""
+    while [ -z "$bedone" ] ; do 
+      read resp
+      if [ "$resp" = "y" -o -z "$resp" ]  ; then
+        if [ -d ./netcdf_links ] ; then
+          echo 'There is already a ./netcdf_links directory. Okay to use links'
+          echo 'in this directory for NetCDF include and lib dirs? [y]'
+          read resp
+          if [ "$resp" = "y" ] ; then
+            NETCDF=`pwd`/netcdf_links
+            export NETCDF
+            bedone="yes"
+            continue
+          fi
+        fi
+        if [ -z "$netcdfipath" ] ; then
+          echo 'Enter full path to NetCDF include directory on your system'
+          read resp
+          if [ ! -d "$resp" ] ; then
+            echo "invalid path: $resp. Try again? [y]" ; continue
+          fi
+          netcdfipath=$resp
+        fi
+        if  [ -z "$netcdflpath" ] ; then
+          echo 'Enter full path to NetCDF library directory on your system'
+          read resp
+          if [ ! -d "$resp" ] ; then
+            echo "invalid path: $resp. Try again? [y]" ; continue
+          fi
+          netcdflpath=$resp
+        fi
+
+        if [ -n "$netcdflpath" -a -n "$netcdfipath" ] ; then
+          if [ -d ./netcdf_links ] ; then
+            echo 'Existing ./netcdf_links directory. Okay to remove. [y]'
+            read resp
+            if [ "$resp" = "y" ]  ; then
+              /bin/rm -fr ./netcdf_links
+            fi
+          fi
+          mkdir ./netcdf_links
+          cd ./netcdf_links 
+            ln -s "$netcdfipath" include
+            ln -s "$netcdflpath" lib
+          cd ..
+          echo created new ./netcdf_links directory
+          /bin/ls -lF ./netcdf_links
+          NETCDF=`pwd`/netcdf_links
+          export NETCDF
+          bedone="yes"
+        fi
+      else
+        bedone="yes"
+      fi
+    done
+  fi
+fi
+
+if [ -n "$NETCDF" ] ; then
+  echo "Will use NETCDF in dir: $NETCDF"
+else
+  echo "Will configure for use without NetCDF"
+fi
+
+  # if the uname command exists, give it a shot and see if
+  # we can narrow the choices; otherwise, spam 'em
+  os="ARCH"
+  mach="ARCH"
+  type uname > /dev/null
+if [ $? -eq 0 ] ; then
+    os=`uname`
+    if [ "$os" = "AIX" -o "$os" = "IRIX" -o "$os" = "IRIX64" -o "$os" = "SunOS" -o "$os" = "HP-UX"  -o "$os" = "Darwin" ] ; then
+      mach="ARCH"
+    else
+      if [ "$os" = "OSF1" -o "$os" = "Linux" -o "$os" = "UNICOS/mp" -o "$os" = "UNIX_System_V" ] ; then
+        mach=`uname -m`
+      else
+        os="ARCH"
+        mach="ARCH"
+      fi
+    fi
+fi
+
+# Found perl, so proceed with configuration
+perl arch/Config.pl -perl=$PERL -netcdf=$NETCDF -os=$os -mach=$mach 
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/configure.arwp
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/configure.arwp	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/configure.arwp	(revision 207)
@@ -0,0 +1,78 @@
+# configure.arwp
+#
+# This file was automatically generated by the configure script in the
+# top level directory. You may make changes to the settings in this
+# file but be aware they will be overwritten each time you run configure.
+# Ordinarily, it is necessary to run configure once, when the code is
+# first installed.
+#
+# To permanently change options, change the settings for your platform
+# in the file arch/configure.defaults, the preamble, and the postamble -
+# then rerun configure.
+#
+
+.SUFFIXES: .F90 .f90 .F .f .c .o
+
+SHELL           	=       /bin/sh
+
+# Listing of options that are usually independent of machine type.
+# When necessary, these are over-ridden by each architecture.
+
+ARFLAGS			=	
+
+PERL			=	perl
+
+RANLIB			=	echo
+
+WRF_DIR			=	../WRFV2
+
+#### Architecture specific settings ####
+
+# Settings for PC Linux i486 i586 i686 x86_64, PGI compiler	(no vis5d)
+#
+FC		=	pgf90
+FFLAGS		=	-Mfree -byteswapio -O
+F77FLAGS	=	-byteswapio -O
+FNGFLAGS	=	$(FFLAGS)
+LDFLAGS		=	
+CC		=	gcc
+CFLAGS		=	-O
+CPP		=	/lib/cpp -C -P -traditional
+CPPFLAGS	=	-DIO_NETCDF -DIO_GRIB1 -DIO_BINARY -DRECL4 -Dbytesw 
+
+###########################################################
+#
+#	Macros, these should be generic for all machines
+
+LN		=	ln -sf
+MAKE		=	make -i -r
+RM		= 	/bin/rm -f
+CP		= 	/bin/cp
+AR		=	ar ru
+
+WRF_INCLUDE	=	-I${WRF_DIR_PRE}$(WRF_DIR)/external/io_netcdf \
+			-I${WRF_DIR_PRE}$(WRF_DIR)/external/io_grib_share \
+			-I${WRF_DIR_PRE}$(WRF_DIR)/external/io_grib1 \
+			-I${WRF_DIR_PRE}$(WRF_DIR)/external/io_int \
+			-I${WRF_DIR_PRE}$(WRF_DIR)/inc
+
+.IGNORE:
+.SUFFIXES: .c .f90 .F90 .f .F .o
+
+#	There is probably no reason to modify these rules
+
+.c.o:
+	$(RM) $@
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<	
+
+.f90.o:
+	$(RM) $@ $*.mod
+	$(CP) $< $*.f
+	$(FC) $(FFLAGS) -c $*.f $(WRF_INCLUDE)
+	$(RM) $*.f
+
+.F90.o:
+	$(RM) $@ $*.mod
+	$(CPP) $(CPPFLAGS) $(FDEFS) $(WRF_INCLUDE) $< > $*.f
+	$(FC) $(FFLAGS) -c $*.f $(WRF_INCLUDE)
+	$(RM) $*.f
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/convert_missing
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/convert_missing	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/convert_missing	(revision 207)
@@ -0,0 +1,6 @@
+#! /bin/bash
+
+        echo 'converting ...'
+        \rm input.dat_tmp
+        sed s/'*'/'9'/g input.dat > input.dat_tmp
+	echo "done"
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/P_500_to_50_10lev.def
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/P_500_to_50_10lev.def	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/P_500_to_50_10lev.def	(revision 207)
@@ -0,0 +1,25 @@
+input_diagfi.nc
+temp
+u
+v
+
+1
+50
+500
+10
+/d5/aslmd/BIG_DATA/WRF/ARWpost/input.diagfi
+
+
+
+
+*** PARAMETERS
+*input file
+*fields
+*fields
+*fields
+*end of field list
+*1 for pressure levels
+*top level (Pa)
+*lower pressure level (Pa)
+*nb levels
+*output file
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/P_500_to_50_20lev.def
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/P_500_to_50_20lev.def	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/P_500_to_50_20lev.def	(revision 207)
@@ -0,0 +1,28 @@
+input_diagfi.nc
+temp
+u
+v
+
+1
+50
+610
+20
+input.diagfi
+
+
+/d5/aslmd/BIG_DATA/WRF/ARWpost/input.diagfi
+
+
+
+
+*** PARAMETERS
+*input file
+*fields
+*fields
+*fields
+*end of field list
+*1 for pressure levels
+*top level (Pa)
+*lower pressure level (Pa)
+*nb levels
+*output file
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/compile
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/compile	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/compile	(revision 207)
@@ -0,0 +1,5 @@
+pgf90 zrecast.F90 \
+-L$NETCDF/lib -lnetcdf \
+-I$NETCDF/include \
+-o zrecast.exe
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/input_diagfi.nc
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/input_diagfi.nc	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/input_diagfi.nc	(revision 207)
@@ -0,0 +1,1 @@
+create symbolic link
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/zrecast.F90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/zrecast.F90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/diagfi/zrecast.F90	(revision 207)
@@ -0,0 +1,1397 @@
+program zrecast
+
+! This program reads 4D (lon-lat-alt-time) fields from GCM output files
+! (ie: diagfi.nc time series or concat.nc or stats.nc files) and, by
+! integrating the hydrostatic equation, recasts data along the vertical
+! direction.
+! The vertical coordinate can be either "above areoid altitudes" or
+! "pressure". Some interpolation along the vertical direction is also
+! done, following instructions given by user.
+! For "above areoid altitudes" output, Atmospheric pressure is added to
+! output dataset; for "pressure coordinate" outputs, the above areoid
+! altitude of pressure is added to output dataset.
+!
+! Minimal requirements and dependencies:
+! The dataset must include the following data:
+! - surface pressure
+! - atmospheric temperature
+! - hybrid coordinates aps() and bps(), or sigma levels() (see section 1.3.2)
+! - ground geopotential (in input file; if not found, it is sought
+!   in a 'diagfi.nc' file. If not found there, it is then sought in
+!   a 'phisinit.nc' file  (see section 1.3.3 of program)
+!
+! - When integration the hydrostatic equation, we assume that R, the molecular
+!   Gas Constant, may not be constant, so it is computed as
+!      R=P/(rho*T) (P=Pressure, rho=density, T=temperature)
+!   If 'rho' is not available, then we use a constant R (see section 2.2)
+!
+! WARNING: Asking for many points along the vertical direction quickly
+!          leads to HUGE output files.
+!
+! EM 09/2006
+! EM 10/2006 : Modified program so that it can now process 'stats.nc'
+!              files obtained from British GCM (ie: vertical coordinate
+!              given as sigma levels and geopotential read from file
+!              'phisinit.nc')
+! EM 01/2006 : Corrected a bug in vertical (log) interpolation for pressure
+!              and density
+
+implicit none
+
+include "netcdf.inc" ! NetCDF definitions
+
+character (len=128) :: infile ! input file name (diagfi.nc or stats.nc format)
+character (len=128) :: infile2 ! second input file (may be needed for 'phisini')
+character (len=128) :: outfile ! output file name
+
+character (len=64) :: text ! to store some text
+character (len=64) :: tmpvarname ! temporarily store a variable name
+integer tmpvarid ! temporarily store a variable ID
+integer tmpdimid ! temporarily store a dimension ID
+integer tmpndims ! temporarily store # of dimensions of a variable
+integer infid ! NetCDF input file ID (of diagfi.nc or stats.nc format)
+integer infid2 ! NetCDF input file which contains 'phisini' dataset (diagfi.nc)
+integer nbvarinfile ! # of variables in input file
+integer nbattr ! # of attributes of a given variable in input file
+integer nbvar4dinfile ! # of 4D (lon,lat,alt,time) variables in input file
+integer outfid ! NetCDF output file ID
+integer lon_dimid,lat_dimid,alt_dimid,time_dimid ! NetCDF dimension IDs
+integer lon_varid,lat_varid,alt_varid,time_varid
+integer za_varid,p_varid ! above areoid and pressure data IDs
+integer,dimension(4) :: datashape
+
+real :: miss_val=-9.99e+33 ! special "missing value" to specify missing data
+real,parameter :: miss_val_def=-9.99e+33 ! default value for "missing value"
+character (len=64), dimension(:), allocatable :: var
+! var(): names of variables that will be processed
+integer nbvar ! # of variables to process
+integer,dimension(:),allocatable :: var_id ! IDs of variables var() (in outfile)
+real,dimension(:),allocatable :: lon ! longitude
+integer lonlength ! # of grid points along longitude
+real,dimension(:),allocatable :: lat ! latitude
+integer latlength ! # of grid points along latitude
+integer altlength ! # of grid point along altitude (of input datasets)
+real,dimension(:),allocatable :: time ! time
+integer timelength ! # of points along time
+real,dimension(:),allocatable :: aps,bps ! hybrid vertical coordinates
+real,dimension(:),allocatable :: sigma ! sigma levels
+real,dimension(:,:),allocatable :: phisinit ! Ground geopotential
+real,dimension(:,:,:),allocatable :: ps ! GCM surface pressure
+real,dimension(:,:,:,:),allocatable :: press ! GCM atmospheric pressure 
+real,dimension(:,:,:,:),allocatable :: temp ! GCM atmospheric temperature
+real,dimension(:,:,:,:),allocatable :: rho ! GCM atmospheric density
+real,dimension(:,:,:,:),allocatable :: za_gcm ! GCM above areoid levels
+real,dimension(:,:,:,:),allocatable :: indata ! to store a GCM 4D dataset
+real,dimension(:,:,:,:),allocatable :: outdata ! to store a 4D dataset
+integer ierr ! NetCDF routines return code
+integer i,j,ilon,ilat,ilev,itim ! for loops
+
+integer ztype ! Flag for vertical coordinate of output
+! ztype=1: pressure  ztype=2: above areoid
+integer nblev ! # of levels (along vertical coordinate) for output data
+real pmin,pmax ! min and max values for output pressure coordinate
+real,dimension(:),allocatable :: plevel ! Pressure levels for output data
+real zamin,zamax ! min and max values for output above areoid coordinate
+real,dimension(:),allocatable :: zareoid ! Above areoid heights for output data
+logical :: have_rho ! Flag: true if density 'rho' is available
+logical :: have_sigma ! Flag: true if sigma levels are known (false if hybrid
+                      !       coordinates are used)
+!===============================================================================
+! 1. Input parameters
+!===============================================================================
+
+!===============================================================================
+! 1.1 Input file
+!===============================================================================
+
+write(*,*) ""
+write(*,*) " Program valid for diagfi.nc, concatnc.nc and stats.nc files"
+write(*,*) "Enter input file name:"
+
+read(*,'(a128)') infile
+write(*,*) ""
+
+! open input file
+
+ierr = NF_OPEN(infile,NF_NOWRITE,infid)
+if (ierr.ne.NF_NOERR) then
+   write(*,*) 'ERROR: Pb opening file ',trim(infile)
+   stop ""
+endif
+
+!===============================================================================
+! 1.2 Get # and names of variables in input file
+!===============================================================================
+
+ierr=NF_INQ_NVARS(infid,nbvarinfile)
+if (ierr.ne.NF_NOERR) then
+  write(*,*) 'ERROR: Failed geting number of variables from file'
+  stop
+endif
+
+write(*,*)" The following variables have been found:"
+nbvar4dinfile=0
+do i=1,nbvarinfile
+  ! get name of variable # i
+  ierr=NF_INQ_VARNAME(infid,i,tmpvarname)
+  ! check if it is a 4D variable
+  ierr=NF_INQ_VARNDIMS(infid,i,tmpndims)
+  if (tmpndims.eq.4) then
+    nbvar4dinfile=nbvar4dinfile+1
+    write(*,*) trim(tmpvarname)
+  endif
+enddo
+
+allocate(var(nbvar4dinfile))
+
+write(*,*) ""
+write(*,*) "Which variable do you want to keep?"
+write(*,*) "all or list of <variables> (separated by <Return>s)"
+write(*,*) "(an empty line , i.e: just <Return>, implies end of list)"
+nbvar=0
+read(*,'(a64)') tmpvarname
+do while ((tmpvarname.ne.' ').and.(trim(tmpvarname).ne.'all'))
+  ! check if tmpvarname is valid
+  ierr=NF_INQ_VARID(infid,tmpvarname,tmpvarid)
+  if (ierr.eq.NF_NOERR) then ! valid name
+    nbvar=nbvar+1
+    var(nbvar)=tmpvarname
+  else ! invalid name
+    write(*,*) 'Error: ',trim(tmpvarname),' is not a valid name'
+    write(*,*) '       (we''ll skip that one)'
+  endif
+  read(*,'(a64)') tmpvarname
+enddo
+
+! handle "all" case
+if (tmpvarname.eq.'all') then
+  nbvar=0
+  do i=1,nbvarinfile
+    ! look for 4D variables
+    ierr=NF_INQ_VARNDIMS(infid,i,tmpndims)
+    if (tmpndims.eq.4) then
+      nbvar=nbvar+1
+      ! get the corresponding name
+      ierr=NF_INQ_VARNAME(infid,i,tmpvarname)
+      var(nbvar)=tmpvarname
+    endif
+  enddo
+endif
+
+! Check that there is at least 1 variable to process
+if (nbvar.eq.0) then
+  write(*,*) 'No variables to process !?'
+  write(*,*) 'Might as well stop here'
+  stop ""
+else
+  write(*,*) ""
+  write(*,*) 'OK, the following variables will be processed:'
+  do i=1,nbvar
+    write(*,*) var(i)
+  enddo
+endif
+
+!===============================================================================
+! 1.3 Get grids in lon,lat,alt,time,
+!     as well as hybrid coordinates aps() and bps() (or sigma levels sigma())
+!     and phisinit() from input file
+!===============================================================================
+
+! 1.3.1 longitude, latitude, altitude and time
+
+! latitude
+ierr=NF_INQ_DIMID(infid,"latitude",tmpdimid)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Failed to get latitude dimension ID"
+else
+  ierr=NF_INQ_VARID(infid,"latitude",tmpvarid)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Failed to get latitude ID"
+  else
+    ierr=NF_INQ_DIMLEN(infid,tmpdimid,latlength)
+    if (ierr.ne.NF_NOERR) then
+      stop "Error: Failed to get latitude length"
+    else
+      allocate(lat(latlength))
+      ierr=NF_GET_VAR_REAL(infid,tmpvarid,lat)
+      if (ierr.ne.NF_NOERR) then
+        stop "Error: Failed reading latitude"
+      endif
+    endif
+  endif
+endif
+
+! longitude
+ierr=NF_INQ_DIMID(infid,"longitude",tmpdimid)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Failed to get longitude dimension ID"
+else
+  ierr=NF_INQ_VARID(infid,"longitude",tmpvarid)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Failed to get longitude ID"
+  else
+    ierr=NF_INQ_DIMLEN(infid,tmpdimid,lonlength)
+    if (ierr.ne.NF_NOERR) then
+      stop "Error: Failed to get longitude length"
+    else
+      allocate(lon(lonlength))
+      ierr=NF_GET_VAR_REAL(infid,tmpvarid,lon)
+      if (ierr.ne.NF_NOERR) then
+        stop "Error: Failed reading longitude"
+      endif
+    endif
+  endif
+endif
+
+! time
+ierr=NF_INQ_DIMID(infid,"Time",tmpdimid)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Failed to get Time dimension ID"
+else
+  ierr=NF_INQ_VARID(infid,"Time",tmpvarid)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Failed to get Time ID"
+  else
+    ierr=NF_INQ_DIMLEN(infid,tmpdimid,timelength)
+    if (ierr.ne.NF_NOERR) then
+      stop "Error: Failed to get Time length"
+    else
+      allocate(time(timelength))
+      ierr=NF_GET_VAR_REAL(infid,tmpvarid,time)
+      if (ierr.ne.NF_NOERR) then
+        stop "Error: Failed reading Time"
+      endif
+    endif
+  endif
+endif
+
+! altlength
+ierr=NF_INQ_DIMID(infid,"altitude",tmpdimid)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Failed to get altitude dimension ID"
+else
+  ierr=NF_INQ_DIMLEN(infid,tmpdimid,altlength)
+  if (ierr.ne.NF_NOERR) then
+      stop "Error: Failed to get altitude length"
+  endif
+endif
+
+! 1.3.2 Get hybrid coordinates (or sigma levels)
+
+! start by looking for sigma levels
+ierr=NF_INQ_VARID(infid,"sigma",tmpvarid)
+if (ierr.ne.NF_NOERR) then
+  have_sigma=.false.
+  write(*,*) "Could not find sigma levels... will look for hybrid coordinates"
+else
+  have_sigma=.true.
+  allocate(sigma(altlength))
+  ierr=NF_GET_VAR_REAL(infid,tmpvarid,sigma)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Failed reading sigma"
+  endif
+endif
+
+! if no sigma levels, look for hybrid coordinates
+if (.not.have_sigma) then
+  ! hybrid coordinate aps
+  ierr=NF_INQ_VARID(infid,"aps",tmpvarid)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Failed to get aps ID"
+  else
+    allocate(aps(altlength))
+    ierr=NF_GET_VAR_REAL(infid,tmpvarid,aps)
+    if (ierr.ne.NF_NOERR) then
+      stop "Error: Failed reading aps"
+    endif
+  endif
+
+  ! hybrid coordinate bps
+  ierr=NF_INQ_VARID(infid,"bps",tmpvarid)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Failed to get bps ID"
+  else
+    allocate(bps(altlength))
+    ierr=NF_GET_VAR_REAL(infid,tmpvarid,bps)
+    if (ierr.ne.NF_NOERR) then
+      stop "Error: Failed reading bps"
+    endif
+  endif
+endif !of if (.not.have_sigma)
+
+! 1.3.3 ground geopotential phisinit
+
+allocate(phisinit(lonlength,latlength))
+! look for 'phisinit' in current file
+ierr=NF_INQ_VARID(infid,"phisinit",tmpvarid) 
+if (ierr.ne.NF_NOERR) then
+  write(*,*) "Warning: Failed to get phisinit ID from file ",trim(infile)
+  infile2="diagfi.nc"
+  write(*,*) "         Trying file ",trim(infile2)
+  ierr=NF_OPEN(infile2,NF_NOWRITE,infid2)
+  if (ierr.ne.NF_NOERR) then
+    write(*,*) "Problem: Could not find/open that file"
+    infile2="phisinit.nc"
+    write(*,*) "         Trying file ",trim(infile2)
+    ierr=NF_OPEN(infile2,NF_NOWRITE,infid2)
+    if (ierr.ne.NF_NOERR) then
+      write(*,*) "Error: Could not open that file either"
+      stop "Might as well stop here"
+    endif
+  endif
+
+  ! Get ID for phisinit
+  ierr=NF_INQ_VARID(infid2,"phisinit",tmpvarid)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Failed to get phisinit ID"
+  endif
+  ! Get physinit
+  ierr=NF_GET_VAR_REAL(infid2,tmpvarid,phisinit)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Failed reading phisinit"
+  endif
+  ! Close file
+  write(*,*) 'OK, got phisinit'
+  ierr=NF_CLOSE(infid2)
+else
+  ierr=NF_GET_VAR_REAL(infid,tmpvarid,phisinit)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Failed reading phisinit"
+  endif
+endif
+
+!===============================================================================
+! 1.4 Choose and build the new vertical coordinate
+!===============================================================================
+
+write(*,*) ""
+write(*,*) "Which vertical coordinate should the output be in?"
+ztype=0
+do while ((ztype.ne.1).and.(ztype.ne.2))
+  write(*,*) "(1: pressure, 2: above areoid altitude)"
+  read(*,*)ztype
+enddo
+
+! ask for # of points and end values
+write(*,*) ""
+write(*,*) "Enter min and max of vertical coordinate (Pa or m)"
+if (ztype.eq.1) then ! pressure coordinate
+  read(*,*) pmin,pmax
+else  ! above areoid coordinate
+  read(*,*) zamin,zamax
+endif
+write(*,*) "Number of levels along vertical coordinate?"
+read(*,*) nblev
+
+! Build corresponding vertical coordinates
+if (ztype.eq.1) then ! pressure coordinate
+  allocate(plevel(nblev))
+  if (nblev.eq.1) then ! in case only one level is asked for
+    plevel(nblev)=pmin
+  else
+    do i=1,nblev
+      !    build exponentially spread layers
+      plevel(i)=exp(log(pmax)+(log(pmin)-log(pmax))* &
+                    ((real(i)-1.0)/(real(nblev)-1.0)))
+    enddo
+  endif
+else ! above areoid heights
+  allocate(zareoid(nblev))
+  if (nblev.eq.1) then ! in case only one level is asked for
+    zareoid(nblev)=zamin
+  else
+    do i=1,nblev
+      zareoid(i)=zamin+(real(i)-1.0)*((zamax-zamin)/(real(nblev)-1.0))
+    enddo
+  endif
+endif
+
+!===============================================================================
+! 1.5 Get output file name
+!===============================================================================
+write(*,*) ""
+write(*,*) "Enter output file name"
+read(*,*) outfile
+! Francois:
+!if (ztype.eq.1) then ! pressure coordinate
+!  outfile=infile(1:len_trim(infile)-3)//"_P.nc"
+!else  ! above areoid coordinate
+!  outfile=infile(1:len_trim(infile)-3)//"_A.nc"
+!endif
+
+
+!===============================================================================
+! 2.1 Build/store GCM fields which will be used later
+!===============================================================================
+
+!===============================================================================
+! 2.1.1 Surface pressure
+!===============================================================================
+ierr=NF_INQ_VARID(infid,"ps",tmpvarid)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Failed to get ps ID"
+else
+  allocate(ps(lonlength,latlength,timelength))
+  ierr=NF_GET_VAR_REAL(infid,tmpvarid,ps)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Failed reading surface pressure"
+  endif
+endif
+
+!===============================================================================
+! 2.1.2 Atmospheric pressure
+!===============================================================================
+allocate(press(lonlength,latlength,altlength,timelength))
+
+if (have_sigma) then ! sigma coordinate
+  do itim=1,timelength
+    do ilev=1,altlength
+      do ilat=1,latlength
+        do ilon=1,lonlength
+          press(ilon,ilat,ilev,itim)=sigma(ilev)*ps(ilon,ilat,itim)
+        enddo
+      enddo
+    enddo
+  enddo
+else ! hybrid coordinates
+  do itim=1,timelength
+    do ilev=1,altlength
+      do ilat=1,latlength
+        do ilon=1,lonlength
+          press(ilon,ilat,ilev,itim)=aps(ilev)+bps(ilev)*ps(ilon,ilat,itim)
+        enddo
+      enddo
+    enddo
+  enddo
+endif
+
+!===============================================================================
+! 2.1.3 Atmospheric temperature
+!===============================================================================
+allocate(temp(lonlength,latlength,altlength,timelength))
+
+ierr=NF_INQ_VARID(infid,"temp",tmpvarid)
+if (ierr.ne.NF_NOERR) then
+  ! stop "Error: Failed to get temp ID"
+  ! try "t" for temperature
+  ierr=NF_INQ_VARID(infid,"t",tmpvarid)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Failed to get t ID"
+  else
+    ierr=NF_GET_VAR_REAL(infid,tmpvarid,temp)
+    if (ierr.ne.NF_NOERR) then
+      stop "Error: Failed reading atmospheric temperature"
+    endif
+  endif
+else
+  ierr=NF_GET_VAR_REAL(infid,tmpvarid,temp)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Failed reading atmospheric temperature"
+  endif
+endif
+
+!===============================================================================
+! 2.1.4 Atmospheric density
+!===============================================================================
+
+ierr=NF_INQ_VARID(infid,"rho",tmpvarid)
+if (ierr.ne.NF_NOERR) then
+  write(*,*) "Warning: Failed to get rho ID"
+  have_rho=.false.
+else
+  have_rho=.true.
+  allocate(rho(lonlength,latlength,altlength,timelength))
+  ierr=NF_GET_VAR_REAL(infid,tmpvarid,rho)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Failed reading atmospheric density"
+  endif
+endif
+
+!===============================================================================
+! 2.2 Build GCM Above areoid altitudes of GCM nodes
+!===============================================================================
+allocate(za_gcm(lonlength,latlength,altlength,timelength))
+
+if (have_rho) then
+  call build_gcm_alt(lonlength,latlength,altlength,timelength, &
+                     phisinit,ps,press,temp,rho,za_gcm)
+else
+  write(*,*)"Warning: Using constant R to integrate hydrostatic equation"
+  call crude_gcm_alt(lonlength,latlength,altlength,timelength, &
+                     phisinit,ps,press,temp,za_gcm)
+endif
+
+!===============================================================================
+! 3. Create output file and initialize definitions of variables and dimensions
+!===============================================================================
+
+!===============================================================================
+! 3.1. Output file
+!===============================================================================
+
+! Create output file
+ierr=NF_CREATE(outfile,NF_CLOBBER,outfid)
+if (ierr.ne.NF_NOERR) then
+  write(*,*)"Error: could not create file ",outfile
+  stop
+endif
+
+!===============================================================================
+! 3.2. Define dimensions
+!===============================================================================
+! longitude
+ierr=NF_DEF_DIM(outfid,"longitude",lonlength,lon_dimid)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Could not define longitude dimension"
+endif
+
+! latitude
+ierr=NF_DEF_DIM(outfid,"latitude",latlength,lat_dimid)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Could not define latitude dimension"
+endif
+
+! altitude
+ierr=NF_DEF_DIM(outfid,"altitude",nblev,alt_dimid)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Could not define altitude dimension"
+endif
+
+! time
+ierr=NF_DEF_DIM(outfid,"Time",timelength,time_dimid)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Could not define latitude dimension"
+endif
+
+!===============================================================================
+! 3.3. Define variables and their attributes
+!===============================================================================
+! longitude 
+datashape(1)=lon_dimid
+ierr=NF_DEF_VAR(outfid,"longitude",NF_REAL,1,datashape(1),lon_varid)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Could not define longitude variable"
+endif
+
+! longitude attributes
+text='east longitude'
+ierr=NF_PUT_ATT_TEXT(outfid,lon_varid,'long_name',len_trim(text),text)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Problem writing long_name for longitude"
+endif
+text='degrees_east'
+ierr=NF_PUT_ATT_TEXT(outfid,lon_varid,'units',len_trim(text),text)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Problem writing units for longitude"
+endif
+
+! latitude
+datashape(2)=lat_dimid
+ierr=NF_DEF_VAR(outfid,"latitude",NF_REAL,1,datashape(2),lat_varid)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Could not define latitude variable"
+endif
+
+! latitude attributes
+text='north latitude'
+ierr=NF_PUT_ATT_TEXT(outfid,lat_varid,'long_name',len_trim(text),text)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Problem writing long_name for latitude"
+endif
+text='degrees_north'
+ierr=NF_PUT_ATT_TEXT(outfid,lat_varid,'units',len_trim(text),text)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Problem writing units for latitude"
+endif
+
+! altitude
+datashape(3)=alt_dimid
+ierr=NF_DEF_VAR(outfid,"altitude",NF_REAL,1,datashape(3),alt_varid)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Could not define altitude variable"
+endif
+
+!altitude attributes
+if (ztype.eq.1) then ! pressure vertical coordinate
+  text='Pressure levels'
+  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'long_name',len_trim(text),text)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Problem writing long_name for altitude"
+  endif
+  text='Pa'
+  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'units',len_trim(text),text)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Problem writing units for altitude"
+  endif
+  text='down'
+  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'positive',len_trim(text),text)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Problem writing positive for altitude"
+  endif
+else ! above areoid vertical coordinate
+  text='Altitude above areoid'
+  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'long_name',len_trim(text),text)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Problem writing long_name for altitude"
+  endif
+  text='m'
+  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'units',len_trim(text),text)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Problem writing units for altitude"
+  endif
+  text='up'
+  ierr=NF_PUT_ATT_TEXT(outfid,alt_varid,'positive',len_trim(text),text)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Problem writing positive for altitude"
+  endif
+endif
+
+! time
+datashape(4)=time_dimid
+ierr=NF_DEF_VAR(outfid,"Time",NF_REAL,1,datashape(4),time_varid)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Could not define Time variable"
+endif
+
+! time attributes
+text='Time'
+ierr=NF_PUT_ATT_TEXT(outfid,time_varid,'long_name',len_trim(text),text)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Problem writing long_name for Time"
+endif
+text='days since 0000-01-1 00:00:00'
+ierr=NF_PUT_ATT_TEXT(outfid,time_varid,'units',len_trim(text),text)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Problem writing units for Time"
+endif
+
+! add pressure or zareoid
+if (ztype.eq.1) then ! pressure vertical coordinate
+  ! zareoid dataset
+  ierr=NF_DEF_VAR(outfid,"zareoid",NF_REAL,4,datashape,za_varid)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Could not define zareoid variable"
+  endif
+  ! zareoid attributes
+  text='altitude above areoid'
+  ierr=NF_PUT_ATT_TEXT(outfid,za_varid,'long_name',len_trim(text),text)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Problem writing long_name for zareoid"
+  endif
+  text='m'
+  ierr=NF_PUT_ATT_TEXT(outfid,za_varid,'units',len_trim(text),text)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Problem writing units for zareoid"
+  endif
+  ! zareoid missing value
+  ierr=NF_PUT_ATT_REAL(outfid,za_varid,'missing_value',NF_REAL,1,miss_val)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Problem writing missing_value for zareoid"
+  endif
+else ! above areoid vertical coordinate
+  ! pressure dataset
+  ierr=NF_DEF_VAR(outfid,"pressure",NF_REAL,4,datashape,p_varid)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Could not define pressure variable"
+  endif
+  ! pressure attributes
+  text='Atmospheric pressure'
+  ierr=NF_PUT_ATT_TEXT(outfid,p_varid,'long_name',len_trim(text),text)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Problem writing long_name for pressure"
+  endif
+  text='Pa'
+  ierr=NF_PUT_ATT_TEXT(outfid,p_varid,'units',len_trim(text),text)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Problem writing units for pressure"
+  endif
+  ! pressure missing value
+  ierr=NF_PUT_ATT_REAL(outfid,p_varid,'missing_value',NF_REAL,1,miss_val)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Problem writing missing_value for pressure"
+  endif
+endif
+
+! Handle 4D variables
+allocate(var_id(nbvar))
+do i=1,nbvar
+  write(*,*) ""
+  write(*,*) "Processing ",trim(var(i))
+  ! define the variable
+  ierr=NF_DEF_VAR(outfid,var(i),NF_REAL,4,datashape,var_id(i))
+  if (ierr.ne.NF_NOERR) then
+    write(*,*) 'Error, could not define variable ',trim(var(i))
+    stop ""
+  endif
+
+  ! Get the (input file) ID for the variable and
+  ! the # of attributes associated to that variable
+  ierr=NF_INQ_VARID(infid,var(i),tmpvarid)
+  if (ierr.ne.NF_NOERR) then
+    write(*,*) 'Error, failed to get ID for variable ',trim(var(i))
+    stop ""
+  endif
+  ierr=NF_INQ_VARNATTS(infid,tmpvarid,nbattr)
+  if (ierr.ne.NF_NOERR) then
+    write(*,*) 'Error, could not get number of attributes for variable ',&
+               trim(var(i))
+    stop ""
+  endif
+  ! inititialize j == number of attributes written to output
+  j=0
+
+  ! look for a "long_name" attribute
+  text='   '
+  ierr=NF_GET_ATT_TEXT(infid,tmpvarid,'long_name',text)
+  if (ierr.ne.NF_NOERR) then ! no long_name attribute
+    ! try to find an equivalent 'title' attribute
+    text='   '
+    ierr=NF_GET_ATT_TEXT(infid,tmpvarid,'title',text)
+    if (ierr.eq.NF_NOERR) then ! found 'title' attribute
+      write(*,*) "Found title ",trim(text)
+      j=j+1
+      ! write it as a 'long_name' attribute
+      ierr=NF_PUT_ATT_TEXT(outfid,var_id(i),'long_name',len_trim(text),text)
+      if (ierr.ne.NF_NOERR) then
+        write(*,*) "Error failed to copy title attribute:",trim(text)
+      stop ""
+      endif
+    endif
+  else ! found long_name; write it to outfile
+    write(*,*) "Found long_name ",trim(text)
+    j=j+1
+    ierr=NF_PUT_ATT_TEXT(outfid,var_id(i),'long_name',len_trim(text),text)
+    if (ierr.ne.NF_NOERR) then
+      write(*,*) "Error failed to copy long_name attribute:",trim(text)
+      stop""
+    endif
+  endif
+  
+  ! look for a "units" attribute
+  text='   '
+  ierr=NF_GET_ATT_TEXT(infid,tmpvarid,'units',text)
+  if (ierr.eq.NF_NOERR) then ! found 'units' attribute
+    write(*,*) "Found units ",trim(text)
+    j=j+1
+    ! write it to output
+    ierr=NF_PUT_ATT_TEXT(outfid,var_id(i),'units',len_trim(text),text)
+    if (ierr.ne.NF_NOERR) then
+      write(*,*) "Error failed to copy units attribute:",trim(text)
+      stop""
+    endif
+  endif
+  
+  ! look for a "missing_value" attribute
+  ierr=NF_GET_ATT_REAL(infid,tmpvarid,"missing_value",miss_val)
+  if (ierr.eq.NF_NOERR) then ! found 'missing_value' attribute
+    write(*,*) "Found missing_value ",miss_val
+    j=j+1
+  else ! no 'missing_value' attribute, set miss_val to default
+    miss_val=miss_val_def
+  endif
+  
+  ! write the missing_value attribute to output
+  ierr=NF_PUT_ATT_REAL(outfid,var_id(i),'missing_value',NF_REAL,1,miss_val)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error, failed to write missing_value attribute"
+  endif
+
+  ! warn if some attributes were missed
+  if (j.ne.nbattr) then
+    write(*,*)'Warning, it seems some attributes of variable ',trim(var(i))
+    write(*,*)"were not transfered to the new file"
+    write(*,*)'nbattr:',nbattr,' j:',j
+  endif
+    
+enddo ! of do=1,nbvar
+
+
+!===============================================================================
+! 3.4. Write dimensions
+!===============================================================================
+! Switch out of NetCDF define mode
+ierr=NF_ENDDEF(outfid)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Could not switch out of define mode"
+endif
+
+! Write longitude
+ierr=NF_PUT_VAR_REAL(outfid,lon_varid,lon)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Could not write longitude data to output file"
+endif
+
+! Write latitude
+ierr=NF_PUT_VAR_REAL(outfid,lat_varid,lat)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Could not write latitude data to output file"
+endif
+
+! Write altitude
+if (ztype.eq.1) then ! pressure vertical coordinate
+  ierr=NF_PUT_VAR_REAL(outfid,alt_varid,plevel)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Could not write altitude data to output file"
+  endif
+else ! above areoid altitude
+  ierr=NF_PUT_VAR_REAL(outfid,alt_varid,zareoid)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error: Could not write altitude data to output file"
+  endif
+endif
+
+! Write time
+ierr=NF_PUT_VAR_REAL(outfid,time_varid,time)
+if (ierr.ne.NF_NOERR) then
+  stop "Error: Could not write Time data to output file"
+endif
+
+!===============================================================================
+! 4. Interpolate and write variables
+!===============================================================================
+
+! 4.0 Allocations
+!indata() to store input (on GCM grid) data
+allocate(indata(lonlength,latlength,altlength,timelength))
+! outdata() to store output (on new vertical grid) data
+allocate(outdata(lonlength,latlength,nblev,timelength))
+
+! 4.1 If output is in pressure coordinate
+if (ztype.eq.1) then
+  do i=1,nbvar ! loop on 4D variable to process
+  ! identify and read a dataset
+  ierr=NF_INQ_VARID(infid,var(i),tmpvarid)
+  if (ierr.ne.NF_NOERR) then
+    write(*,*) 'Error, failed to get ID for variable ',var(i)
+    stop
+  endif
+  ierr=NF_GET_VAR_REAL(infid,tmpvarid,indata)
+  if (ierr.ne.NF_NOERR) then
+    write(*,*) 'Error, failed to load variable ',var(i)
+    stop
+  endif
+  
+  ! interpolate dataset onto new grid
+  call p_coord_interp(lonlength,latlength,altlength,timelength,nblev, &
+                      miss_val,ps,press,indata,plevel,outdata)
+  
+  ! write new dataset to output file
+  ierr=NF_PUT_VAR_REAL(outfid,var_id(i),outdata)
+  if (ierr.ne.NF_NOERR) then
+    write(*,*)'Error, Failed to write variable ',var(i)
+    stop
+  endif
+  
+  enddo ! of do i=1,nbvar
+  
+  ! interpolate zareoid onto new grid
+  call p_coord_interp(lonlength,latlength,altlength,timelength,nblev, &
+                      miss_val,ps,press,za_gcm,plevel,outdata)
+  ! write result to output file
+  ierr=NF_PUT_VAR_REAL(outfid,za_varid,outdata)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error, Failed to write zareoid to output file"
+  endif
+endif ! of if (ztype.eq.1)
+
+! 4.2 If output is in above areoid altitude
+if (ztype.eq.2) then
+  do i=1,nbvar ! loop on 4D variable to process
+  ! identify and read a dataset
+  ierr=NF_INQ_VARID(infid,var(i),tmpvarid)
+  if (ierr.ne.NF_NOERR) then
+    write(*,*) 'Error, failed to get ID for variable ',var(i)
+    stop
+  endif
+  ierr=NF_GET_VAR_REAL(infid,tmpvarid,indata)
+  if (ierr.ne.NF_NOERR) then
+    write(*,*) 'Error, failed to load variable ',var(i)
+    stop
+  endif
+  
+  ! interpolate dataset onto new grid
+  ! check if variable is "rho" (to set flag for interpolation below)
+  if (var(i).eq.'rho') then
+    j=1
+  else
+    j=0
+  endif
+  
+  call za_coord_interp(lonlength,latlength,altlength,timelength,nblev, &
+                      miss_val,za_gcm,indata,j,zareoid,outdata)
+
+  ! write new dataset to output file
+  ierr=NF_PUT_VAR_REAL(outfid,var_id(i),outdata)
+  if (ierr.ne.NF_NOERR) then
+    write(*,*)'Error, Failed to write variable ',var(i)
+    stop
+  endif
+
+  enddo ! of do i=1,nbvar
+  
+  ! interpolate pressure onto new grid
+  call za_coord_interp(lonlength,latlength,altlength,timelength,nblev, &
+                      miss_val,za_gcm,press,1,zareoid,outdata)
+
+  ! write result to output file
+  ierr=NF_PUT_VAR_REAL(outfid,p_varid,outdata)
+  if (ierr.ne.NF_NOERR) then
+    stop "Error, Failed to write pressure to output file"
+  endif
+endif ! of if (ztype.eq.2)
+
+! 4.3 Close output file
+ierr=NF_CLOSE(outfid)
+if (ierr.ne.NF_NOERR) then
+  write(*,*) 'Error, failed to close output file ',outfile
+endif
+
+end program
+
+!===============================================================================
+
+subroutine build_gcm_alt(lonlength,latlength,altlength,timelength, &
+                         phis,ps,press,temp,rho,za_gcm)
+!==============================================================================
+! Purpose: Integrate hydrostatic equation in order to build the "above areoid
+!          altitudes" corresponding to GCM atmospheric levels
+!==============================================================================
+implicit none
+!==============================================================================
+! Arguments:
+!==============================================================================
+integer,intent(in) :: lonlength ! # of points along longitude
+integer,intent(in) :: latlength ! # of points along latitude
+integer,intent(in) :: altlength ! # of points along altitude
+integer,intent(in) :: timelength ! # of stored time steps
+real,dimension(lonlength,latlength),intent(in) :: phis
+! phis(:,:) is the ground geopotential
+real,dimension(lonlength,latlength,timelength),intent(in) :: ps
+! ps(:,:) is the surface pressure
+real,dimension(lonlength,latlength,altlength,timelength),intent(in) :: press
+! press(:,:,:,:) is atmospheric pressure
+real,dimension(lonlength,latlength,altlength,timelength),intent(in) :: temp
+! temp(:,:,:,:) is atmospheric temperature
+real,dimension(lonlength,latlength,altlength,timelength),intent(in) :: rho
+! rho(:,:,:,:) is atmospheric density
+
+real,dimension(lonlength,latlength,altlength,timelength),intent(out) :: za_gcm
+! za_gcm(:,:,:,:) are the above aroid heights of GCM levels
+
+!===============================================================================
+! Local variables:
+!===============================================================================
+real,dimension(:),allocatable :: sigma ! GCM sigma levels
+real,dimension(:,:,:,:),allocatable :: R ! molecular gas constant
+real,dimension(:,:,:,:),allocatable :: zlocal ! local above surface altitude
+real :: Rmean ! mean value of R for a given level
+real :: Tmean ! "mean" value of temperature for a given level
+integer iloop,jloop,kloop,tloop
+
+! Parameters needed to integrate hydrostatic equation:
+real :: g0 ! exact mean gravity at radius=3396.km (Lemoine et al. 2001)
+data    g0 /3.7257964/
+real :: a0  
+data    a0 /3396.E3/  ! radius=3396.km
+real :: gz 
+! gz: gravitational acceleration at a given (zareoid) altitude
+
+!===============================================================================
+! 1. Various initialisations
+!===============================================================================
+allocate(sigma(altlength))
+allocate(R(lonlength,latlength,altlength,timelength))
+allocate(zlocal(lonlength,latlength,altlength,timelength))
+
+!==============================================================================
+! 2. Compute Molecular Gas Constant (J kg-1 K-1) at every grid point 
+!   --later used to integrate the hydrostatic equation--
+!==============================================================================
+do tloop=1,timelength
+  do kloop=1,altlength
+    do jloop=1,latlength
+      do iloop=1,lonlength
+        R(iloop,jloop,kloop,tloop)=press(iloop,jloop,kloop,tloop)/ &
+                                            (rho(iloop,jloop,kloop,tloop)* &
+                                             temp(iloop,jloop,kloop,tloop))
+      enddo
+    enddo
+  enddo
+enddo
+
+!===============================================================================
+! 3. Integrate hydrostatic equation to compute zlocal and za_gcm
+!===============================================================================
+do tloop=1,timelength
+  do jloop=1,latlength
+    do iloop=1,lonlength
+      ! handle case of first altitude level
+      sigma(1)=press(iloop,jloop,1,tloop)/ps(iloop,jloop,tloop)
+      zlocal(iloop,jloop,1,tloop)=-log(sigma(1))*R(iloop,jloop,1,tloop)* &
+                                                 temp(iloop,jloop,1,tloop)/g0
+      za_gcm(iloop,jloop,1,tloop)=zlocal(iloop,jloop,1,tloop)+ &
+                                  phis(iloop,jloop)/g0
+      do kloop=2,altlength
+        ! compute sigma level of layer
+        sigma(kloop)=press(iloop,jloop,kloop,tloop)/ps(iloop,jloop,tloop)
+        
+        ! compute "mean" temperature of the layer
+        if(temp(iloop,jloop,kloop,tloop).eq.  &
+           temp(iloop,jloop,kloop-1,tloop)) then
+          Tmean=temp(iloop,jloop,kloop,tloop)
+        else
+          Tmean=(temp(iloop,jloop,kloop,tloop)-      &
+                 temp(iloop,jloop,kloop-1,tloop))/   &
+                 log(temp(iloop,jloop,kloop,tloop)/  &
+                     temp(iloop,jloop,kloop-1,tloop))
+        endif
+        
+        ! compute mean value of R of the layer
+        Rmean=0.5*(R(iloop,jloop,kloop,tloop)+R(iloop,jloop,kloop-1,tloop))
+        
+        ! compute gravitational acceleration (at altitude zaeroid(kloop-1))
+        gz=g0*(a0**2)/(a0+za_gcm(iloop,jloop,kloop-1,tloop))**2
+        
+        ! compute zlocal(kloop)
+        zlocal(iloop,jloop,kloop,tloop)=zlocal(iloop,jloop,kloop-1,tloop)- &
+                log(sigma(kloop)/sigma(kloop-1))*Rmean*Tmean/gz
+        
+        ! compute za_gcm(kloop)
+        za_gcm(iloop,jloop,kloop,tloop)=zlocal(iloop,jloop,kloop,tloop)+ &
+                                        phis(iloop,jloop)/g0
+      enddo ! kloop
+    enddo ! iloop
+  enddo ! jloop
+enddo ! tloop
+
+! Cleanup
+deallocate(sigma)
+deallocate(R)
+deallocate(zlocal)
+
+end subroutine build_gcm_alt
+
+!===============================================================================
+
+subroutine crude_gcm_alt(lonlength,latlength,altlength,timelength, &
+                         phis,ps,press,temp,za_gcm)
+!==============================================================================
+! Purpose: Integrate hydrostatic equation in order to build the "above areoid
+!          altitudes" corresponding to GCM atmospheric levels
+!==============================================================================
+implicit none
+!==============================================================================
+! Arguments:
+!==============================================================================
+integer,intent(in) :: lonlength ! # of points along longitude
+integer,intent(in) :: latlength ! # of points along latitude
+integer,intent(in) :: altlength ! # of points along altitude
+integer,intent(in) :: timelength ! # of stored time steps
+real,dimension(lonlength,latlength),intent(in) :: phis
+! phis(:,:) is the ground geopotential
+real,dimension(lonlength,latlength,timelength),intent(in) :: ps
+! ps(:,:) is the surface pressure
+real,dimension(lonlength,latlength,altlength,timelength),intent(in) :: press
+! press(:,:,:,:) is atmospheric pressure
+real,dimension(lonlength,latlength,altlength,timelength),intent(in) :: temp
+! temp(:,:,:,:) is atmospheric temperature
+
+real,dimension(lonlength,latlength,altlength,timelength),intent(out) :: za_gcm
+! za_gcm(:,:,:,:) are the above aroid heights of GCM levels
+
+!===============================================================================
+! Local variables:
+!===============================================================================
+real,dimension(:),allocatable :: sigma ! GCM sigma levels
+real,parameter :: R=190 ! molecular gas constant
+real,dimension(:,:,:,:),allocatable :: zlocal ! local above surface altitude
+real :: Tmean ! "mean" value of temperature for a given level
+integer iloop,jloop,kloop,tloop
+
+! Parameters needed to integrate hydrostatic equation:
+real :: g0 ! exact mean gravity at radius=3396.km (Lemoine et al. 2001)
+data    g0 /3.7257964/
+real :: a0  
+data    a0 /3396.E3/  ! radius=3396.km
+real :: gz 
+! gz: gravitational acceleration at a given (zareoid) altitude
+
+!===============================================================================
+! 1. Various initialisations
+!===============================================================================
+allocate(sigma(altlength))
+allocate(zlocal(lonlength,latlength,altlength,timelength))
+
+!===============================================================================
+! 2. Integrate hydrostatic equation to compute zlocal and za_gcm
+!===============================================================================
+do tloop=1,timelength
+  do jloop=1,latlength
+    do iloop=1,lonlength
+      ! handle case of first altitude level
+      sigma(1)=press(iloop,jloop,1,tloop)/ps(iloop,jloop,tloop)
+      zlocal(iloop,jloop,1,tloop)=-log(sigma(1))* &
+                                               R*temp(iloop,jloop,1,tloop)/g0
+      za_gcm(iloop,jloop,1,tloop)=zlocal(iloop,jloop,1,tloop)+ &
+                                  phis(iloop,jloop)/g0
+      do kloop=2,altlength
+        ! compute sigma level of layer
+        sigma(kloop)=press(iloop,jloop,kloop,tloop)/ps(iloop,jloop,tloop)
+        
+        ! compute "mean" temperature of the layer
+        if(temp(iloop,jloop,kloop,tloop).eq.  &
+           temp(iloop,jloop,kloop-1,tloop)) then
+          Tmean=temp(iloop,jloop,kloop,tloop)
+        else
+          Tmean=(temp(iloop,jloop,kloop,tloop)-      &
+                 temp(iloop,jloop,kloop-1,tloop))/   &
+                 log(temp(iloop,jloop,kloop,tloop)/  &
+                     temp(iloop,jloop,kloop-1,tloop))
+        endif
+                
+        ! compute gravitational acceleration (at altitude zaeroid(kloop-1))
+        gz=g0*(a0**2)/(a0+za_gcm(iloop,jloop,kloop-1,tloop))**2
+        
+        ! compute zlocal(kloop)
+        zlocal(iloop,jloop,kloop,tloop)=zlocal(iloop,jloop,kloop-1,tloop)- &
+                log(sigma(kloop)/sigma(kloop-1))*R*Tmean/gz
+        
+        ! compute za_gcm(kloop)
+        za_gcm(iloop,jloop,kloop,tloop)=zlocal(iloop,jloop,kloop,tloop)+ &
+                                        phis(iloop,jloop)/g0
+      enddo ! kloop
+    enddo ! iloop
+  enddo ! jloop
+enddo ! tloop
+
+! Cleanup
+deallocate(sigma)
+deallocate(zlocal)
+
+end subroutine crude_gcm_alt
+
+!===============================================================================
+
+subroutine p_coord_interp(lonlen,latlen,altlen,tlen,newaltlen, &
+                          missing,ps,press,gcmdata,plevels,newdata)
+!==============================================================================
+! Purpose:
+! Recast a 4D (spatio-temporal) GCM dataset, which has a vertical coordinate
+! in pseudo-altitude, into a dataset which has a vertical coordinate at given
+! pressure levels
+!==============================================================================
+implicit none
+!==============================================================================
+! Arguments:
+!==============================================================================
+integer,intent(in) :: lonlen ! # of points along longitude (GCM dataset)
+integer,intent(in) :: latlen ! # of points along latitude (GCM dataset)
+integer,intent(in) :: altlen ! # of points along altitude (GCM dataset)
+integer,intent(in) :: tlen   ! # of stored time steps (GCM dataset)
+integer,intent(in) :: newaltlen ! # of points along altitude
+real,intent(in) :: missing ! missing value
+real,dimension(lonlen,latlen,tlen),intent(in) :: ps ! GCM surface pressure
+real,dimension(lonlen,latlen,altlen,tlen),intent(in) :: press ! GCM pressure
+real,dimension(lonlen,latlen,altlen,tlen),intent(in) :: gcmdata ! GCM dataset
+real,dimension(newaltlen),intent(in) :: plevels
+! plevels(:) pressure levels at which gcmdata is to be interpolated
+
+real,dimension(lonlen,latlen,newaltlen,tlen),intent(out) :: newdata
+! newdata(:,:,:,:) gcmdata recasted along vertical coordinate
+!==============================================================================
+! Local variables:
+!==============================================================================
+real,dimension(:),allocatable :: lnp
+! lnp(:): used to store log(pressure) values
+real,dimension(:),allocatable :: q
+! q(:): used to store values along vertical direction
+real :: x,y
+! x,y: temporary variables
+integer :: iloop,jloop,kloop,tloop
+
+allocate(lnp(altlen))
+allocate(q(altlen))
+
+do tloop=1,tlen
+  do jloop=1,latlen
+    do iloop=1,lonlen
+      ! build lnp() and q() along vertical coordinate
+      do kloop=1,altlen
+        lnp(kloop)=-log(press(iloop,jloop,kloop,tloop))
+        q(kloop)=gcmdata(iloop,jloop,kloop,tloop)
+      enddo
+      
+      ! Interpolation  
+      do kloop=1,newaltlen
+        ! compute, by interpolation, value at pressure level plevels(kloop)
+        if ((plevels(kloop).le.ps(iloop,jloop,tloop)).and. &
+            (plevels(kloop).ge.press(iloop,jloop,altlen,tloop))) then
+          x=-log(plevels(kloop))
+          call interpolf(x,y,missing,lnp,q,altlen)
+          newdata(iloop,jloop,kloop,tloop) = y
+        else ! if plevels(kloop) is out of range,
+          ! assign a "missing_value" at this node
+          newdata(iloop,jloop,kloop,tloop) = missing
+        endif
+      enddo
+      
+    enddo !iloop
+  enddo !jloop
+enddo !tloop
+
+! Cleanup
+deallocate(lnp)
+deallocate(q)
+
+end subroutine p_coord_interp
+
+!===============================================================================
+
+subroutine za_coord_interp(lonlen,latlen,altlen,tlen,newaltlen, &
+                          missing,za_gcm,gcmdata,flag,zareoid,newdata)
+!==============================================================================
+! Purpose:
+! Recast a 4D (spatio-temporal) GCM dataset, for which corresponding grid
+! values of above areoid altitude are known, along chosen above areoid
+! altitude
+!==============================================================================
+implicit none
+!==============================================================================
+! Arguments:
+!==============================================================================
+integer,intent(in) :: lonlen ! # of points along longitude (GCM dataset)
+integer,intent(in) :: latlen ! # of points along latitude (GCM dataset)
+integer,intent(in) :: altlen ! # of points along altitude (GCM dataset)
+integer,intent(in) :: tlen   ! # of stored time steps (GCM dataset)
+integer,intent(in) :: newaltlen ! # of points along altitude
+real,intent(in) :: missing ! missing value
+real,dimension(lonlen,latlen,altlen,tlen),intent(in) :: za_gcm
+!za_gcm(:,:,:,) above areoid altitude of GCM grid points
+real,dimension(lonlen,latlen,altlen,tlen),intent(in) :: gcmdata ! GCM dataset
+integer,intent(in) :: flag ! flag (==1 for 'log' interpolation)
+! flag==0 (standard linear interpolation)
+real,dimension(newaltlen),intent(in) :: zareoid
+! zareoid(:) above areoid altitudes at which data must be recast
+
+real,dimension(lonlen,latlen,newaltlen,tlen),intent(out) :: newdata
+! newdata(:,:,:,:) gcmdata recasted along vertical coordinate
+
+!==============================================================================
+! Local variables:
+!==============================================================================
+real,dimension(:),allocatable :: za,q
+real,dimension(:),allocatable :: logq
+! za(:): used to store za_gcm at a given location
+! q(:): used to store field values along the vertical direction
+real :: x,y ! temporary variables
+integer :: iloop,jloop,kloop,tloop
+
+allocate(za(altlen))
+allocate(q(altlen))
+allocate(logq(altlen))
+
+if (flag.eq.0) then
+ do tloop=1,tlen
+  do jloop=1,latlen
+    do iloop=1,lonlen
+      do kloop=1,altlen
+        ! extract the vertical coordinates zaij(), or build p_za()
+        za(kloop)=za_gcm(iloop,jloop,kloop,tloop)
+        ! store values along altitude
+        q(kloop)=gcmdata(iloop,jloop,kloop,tloop)
+      enddo !kloop
+      ! Interpolation
+      do kloop=1,newaltlen
+      ! Check if zareoid(kloop) is within range
+      if ((zareoid(kloop).ge.za_gcm(iloop,jloop,1,tloop)).and. &
+          (zareoid(kloop).le.za_gcm(iloop,jloop,altlen,tloop))) then
+        ! zareoid(kloop) is within range
+        x=zareoid(kloop)
+        call interpolf(x,y,missing,za,q,altlen)
+        newdata(iloop,jloop,kloop,tloop)=y
+      else ! zareoid(kloop) is out of range
+        newdata(iloop,jloop,kloop,tloop)=missing
+      endif 
+      enddo !kloop
+    enddo !iloop
+  enddo !jloop
+ enddo !tloop 
+else ! case when flag=1 (i.e.: rho)
+ do tloop=1,tlen
+  do jloop=1,latlen
+    do iloop=1,lonlen
+      do kloop=1,altlen
+        ! extract the vertical coordinates zaij(), or build p_za()
+        za(kloop)=za_gcm(iloop,jloop,kloop,tloop)
+        ! extract the vertical coordinates zaij(), or build p_za()
+        za(kloop)=za_gcm(iloop,jloop,kloop,tloop)
+        ! store log values along altitude
+        logq(kloop)=log(gcmdata(iloop,jloop,kloop,tloop))
+      enddo !kloop
+
+      ! Interpolation
+      do kloop=1,newaltlen
+      ! Check if zareoid(kloop) is within range
+      if ((zareoid(kloop).ge.za_gcm(iloop,jloop,1,tloop)).and. &
+          (zareoid(kloop).le.za_gcm(iloop,jloop,altlen,tloop))) then
+        ! zareoid(kloop) is within range
+        x=zareoid(kloop)
+        call interpolf(x,y,missing,za,logq,altlen)
+        newdata(iloop,jloop,kloop,tloop)=exp(y)
+      else  ! zareoid(kloop) is out of range
+        newdata(iloop,jloop,kloop,tloop)=missing
+      endif
+      enddo !kloop
+    enddo !iloop
+  enddo !jloop
+ enddo !tloop 
+endif
+
+! Cleanup
+deallocate(za)
+deallocate(q)
+deallocate(logq)
+
+end subroutine za_coord_interp
+
+!===============================================================================
+
+subroutine interpolf(x,y,missing,xd,yd,nd)
+!==============================================================================
+! Purpose:
+! Yield y=f(x), where xd() end yd() are arrays of known values,
+! using linear interpolation
+! If x is not included in the interval spaned by xd(), then y is set
+! to a default value 'missing'
+! Note:
+! Array xd() should contain ordered (either increasing or decreasing) abscissas
+!==============================================================================
+implicit none
+!==============================================================================
+! Arguments:
+!==============================================================================
+real,intent(in) :: x ! abscissa at which interpolation is to be done
+real,intent(in) :: missing ! missing value (if no interpolation is performed)
+integer :: nd ! size of arrays
+real,dimension(nd),intent(in) :: xd ! array of known absissas
+real,dimension(nd),intent(in) :: yd ! array of correponding values
+
+real,intent(out) :: y ! interpolated value
+!==============================================================================
+! Local variables:
+!==============================================================================
+integer :: i
+
+! default: set y to 'missing'
+y=missing
+
+   do i=1,nd-1
+     if (((x.ge.xd(i)).and.(x.le.xd(i+1))).or.&
+          ((x.le.xd(i)).and.(x.ge.xd(i+1)))) then
+        y=yd(i)+(x-xd(i))*(yd(i+1)-yd(i))/(xd(i+1)-xd(i))
+        exit
+     endif
+   enddo
+
+
+end subroutine interpolf
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/fields.plt
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/fields.plt	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/fields.plt	(revision 207)
@@ -0,0 +1,2 @@
+ALBEDO
+RAIN
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/gribinfo.txt
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/gribinfo.txt	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/gribinfo.txt	(revision 207)
@@ -0,0 +1,176 @@
+104     ij     -     LU_INDEX     LAND USE CATEGORY                                 
+104     ij     -     LU_MASK      0 land 1 water                                    
+104     igj    X     UU           x-wind component                                  m s-1
+104     igj    Y     VV           y-wind component                                  m s-1
+104     igj    -     TT           temperature                                       K
+104     igj    -     RH           relative humidity                                 %
+104     igj    -     GHT          geopotential height                               m
+104     igj    -     PRES         pressure                                          Pa
+104     ij     -     XLAT_M       latitude, positive north                          degrees
+104     ij     -     XLONG_M      longitude, positive east                          degrees
+104     ij     -     HGT_M        topography elevation                              m
+104     ij     -     SKINTEMP     skin temperature                                  K
+104     ij     -     TAVGSFC      daily mean of surface air temperature             K
+104     ij     -     SOILTEMP     annual mean deep soil temperature                 K
+104     ij     -     PMSL         sea level pressure                                Pa
+104     imj    -     GREENFRAC    monthly greenness fraction                        0 - 1 fraction
+104     imj    -     ALBEDO12M    background albedo                                 0 - 1 fraction
+104     igj    -     PD           dry pressure                                      Pa
+104     igj    -     QV           mixing ratio                                      kg kg-1
+104     ikj    X     U            x-wind component                                  m s-1
+104     ikj    Y     V            y-wind component                                  m s-1
+104     ikj    Z     W            z-wind component                                  m s-1
+104     ikj    Z     PH           perturbation geopotential                         m2 s-2
+104     ikj    Z     PHP          geopotential                                      m2 s-2
+104     ikj    Z     PH0          initial geopotential                              m2 s-2
+104     ikj    Z     PHB          base-state geopotential                           m2 s-2
+104     ikj    -     T            perturbation potential temperature (theta-t0)     K
+104     ij     -     MUB          base state dry air mass in column                 Pa
+104     ij     -     MU           perturbation dry air mass in column               Pa
+104     ij     -     MU0          initial dry mass in column                        Pa
+104     ikj    -     TKE          TURBULENCE KINETIC ENERGY                         m2 s-2
+104     ikj    -     P            perturbation pressure                             Pa
+104     ikj    -     PB           BASE STATE PRESSURE                               Pa
+104     k      -     FNM          upper weight for vertical stretching              
+104     k      -     FNP          lower weight for vertical stretching              
+104     k      -     RDNW         inverse d(eta) values between full (w) levels     
+104     k      -     RDN          inverse d(eta) values between half (mass) levels  
+104     k      -     DNW          d(eta) values between full (w) levels             
+104     k      -     DN           d(eta) values between half (mass) levels          
+104     k      -     ZNU          eta values on half (mass) levels                  
+104     k      Z     ZNW          eta values on full (w) levels                     
+104     ij     -     Q2           QV at 2 M                                         kg kg-1
+104     ij     -     T2           TEMP at 2 M                                       K
+104     ij     -     TH2          POT TEMP at 2 M                                   K
+104     ij     -     PSFC         SFC PRESSURE                                      Pa
+104     ij     -     U10          U at 10 M                                         m s-1
+104     ij     -     V10          V at 10 M                                         m s-1
+104     ikj    -     QVAPOR       Water vapor mixing ratio                          kg kg-1
+104     ikj    -     QCLOUD       Cloud water mixing ratio                          kg kg-1
+104     ikj    -     QRAIN        Rain water mixing ratio                           kg kg-1
+104     ikj    -     QICE         Ice mixing ratio                                  kg kg-1
+104     ikj    -     QSNOW        Snow mixing ratio                                 kg kg-1
+104     ikj    -     QGRAUP       Graupel mixing ratio                              kg kg-1
+104     ikj    -     QNICE        Ice Number concentration                          # kg(-1)
+104     ij     -     SM000007     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SM000010     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SM007028     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SM028100     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SM100255     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     ST000007     LAYER SOIL TEMPERATURE                            K
+104     ij     -     ST000010     LAYER SOIL TEMPERATURE                            K
+104     ij     -     ST007028     LAYER SOIL TEMPERATURE                            K
+104     ij     -     ST028100     LAYER SOIL TEMPERATURE                            K
+104     ij     -     ST100255     LAYER SOIL TEMPERATURE                            K
+104     ij     -     SM000010     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SM010040     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SM040100     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SM100200     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SM010200     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SOILM000     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SOILM005     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SOILM020     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SOILM040     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SOILM160     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SOILM300     LAYER SOIL MOISTURE                               m3 m-3
+104     ij     -     SW000010     LAYER SOIL LIQUID                                 m3 m-3
+104     ij     -     SW010040     LAYER SOIL LIQUID                                 m3 m-3
+104     ij     -     SW040100     LAYER SOIL LIQUID                                 m3 m-3
+104     ij     -     SW100200     LAYER SOIL LIQUID                                 m3 m-3
+104     ij     -     SW010200     LAYER SOIL LIQUID                                 m3 m-3
+104     ij     -     SOILW000     LAYER SOIL LIQUID                                 m3 m-3
+104     ij     -     SOILW005     LAYER SOIL LIQUID                                 m3 m-3
+104     ij     -     SOILW020     LAYER SOIL LIQUID                                 m3 m-3
+104     ij     -     SOILW040     LAYER SOIL LIQUID                                 m3 m-3
+104     ij     -     SOILW160     LAYER SOIL LIQUID                                 m3 m-3
+104     ij     -     SOILW300     LAYER SOIL LIQUID                                 m3 m-3
+104     ij     -     ST000010     LAYER SOIL TEMPERATURE                            K
+104     ij     -     ST010040     LAYER SOIL TEMPERATURE                            K
+104     ij     -     ST040100     LAYER SOIL TEMPERATURE                            K
+104     ij     -     ST100200     LAYER SOIL TEMPERATURE                            K
+104     ij     -     ST010200     LAYER SOIL TEMPERATURE                            K
+104     ij     -     SOILT000     LAYER SOIL TEMPERATURE                            K
+104     ij     -     SOILT005     LAYER SOIL TEMPERATURE                            K
+104     ij     -     SOILT020     LAYER SOIL TEMPERATURE                            K
+104     ij     -     SOILT040     LAYER SOIL TEMPERATURE                            K
+104     ij     -     SOILT160     LAYER SOIL TEMPERATURE                            K
+104     ij     -     SOILT300     LAYER SOIL TEMPERATURE                            K
+104     ij     -     LANDMASK     LAND MASK (1 FOR LAND, 0 FOR WATER)               
+104     ij     -     TOPOSTDV     ELEVATION STD DEV                                 m
+104     ij     -     TOPOSLPX     ELEVATION X SLOPE                                 
+104     ij     -     TOPOSLPY     ELEVATION Y SLOPE                                 
+104     ij     -     SHDMAX       ANNUAL MAX VEG FRACTION                           
+104     ij     -     SHDMIN       ANNUAL MIN VEG FRACTION                           
+104     ij     -     SNOALB       ANNUAL MAX SNOW ALBEDO IN FRACTION                
+104     ij     -     SLOPECAT     SLOPE CATEGORY                                    
+104     ij     -     SOILHGT      ELEVATION OF LSM DATA                             m
+104     iuj    -     LANDUSEF     LANDUSE FRACTION BY CATEGORY                      
+104     ij     -     SOILCAT      SOIL CAT DOMINANT TYPE                            
+104     ij     -     VEGCAT       VEGETATION CAT DOMINANT TYPE                      
+104     ij     -     XICE         SEA ICE FLAG                                      
+104     ij     -     SMSTAV       MOISTURE AVAILABILITY                             
+104     ij     -     SMSTOT       TOTAL SOIL MOISTURE                               m3 m-3
+104     ij     -     SFROFF       SURFACE RUNOFF                                    mm
+104     ij     -     UDROFF       UNDERGROUND RUNOFF                                mm
+106     ij     -     ISLTYP       DOMINANT SOIL CATEGORY                            
+106     ij     -     IVGTYP       DOMINANT VEGETATION CATEGORY                      
+104     ij     -     VEGFRA       VEGETATION FRACTION                               
+104     ij     -     SFCEVP       SURFACE EVAPORATION                               kg m-2
+104     ij     -     GRDFLX       GROUND HEAT FLUX                                  W m-2
+104     ij     -     SFCEXC       SURFACE EXCHANGE COEFFICIENT                      m s-1  
+104     ij     -     ACSNOW       ACCUMULATED SNOW                                  kg m-2
+104     ij     -     ACSNOM       ACCUMULATED MELTED SNOW                           kg m-2
+104     ij     -     SNOW         SNOW WATER EQUIVALENT                             kg m-2
+104     ij     -     SNOWH        PHYSICAL SNOW DEPTH                               m
+104     ij     -     CANWAT       CANOPY WATER                                      kg m-2
+104     ij     -     SST          SEA SURFACE TEMPERATURE                           K
+104     ikj    -     TKE_MYJ      TKE FROM MELLOR-YAMADA-JANJIC                      m2 s-2
+104     ij     -     Z0           Background ROUGHNESS LENGTH                       m
+104     ij     -     AKHS         SFC EXCH COEFF FOR HEAT                           m s-1    
+104     ij     -     AKMS         SFC EXCH COEFF FOR MOMENTUM                       m s-1    
+106     ij     -     KPBL         LEVEL OF PBL TOP                                  
+104     ij     -     TH10         10-M THETA FROM MYJ                               K
+104     ij           Q10          10-M SPECIFIC HUMIDITY FROM MYJ                   kg kg-1
+104     ij     -     SINALPHA     Local sine of map rotation                        
+104     ij     -     COSALPHA     Local cosine of map rotation                      
+104     ij     -     HGT          Terrain Height                                    m
+104     ij     -     TSK          SURFACE SKIN TEMPERATURE                          K
+104     ij     -     RAINC        ACCUMULATED TOTAL CUMULUS PRECIPITATION           mm      
+104     ij     -     RAINNC       ACCUMULATED TOTAL GRID SCALE PRECIPITATION        mm      
+104     ij     -     RAINCV       TIME-STEP CUMULUS PRECIPITATION                   mm      
+104     ij     -     RAINNCV      TIME-STEP NONCONVECTIVE PRECIPITATION             mm
+104     ij     -     RAINBL       PBL TIME-STEP TOTAL PRECIPITATION                 mm      
+104     ij     -     SNOWNC       ACCUMULATED TOTAL GRID SCALE SNOW AND ICE         mm
+104     ij     -     GRAUPELNC    ACCUMULATED TOTAL GRID SCALE GRAUPEL              mm
+104     ij     -     SNOWNCV      TIME-STEP NONCONVECTIVE SNOW AND ICE              mm
+104     ij     -     GRAUPELNCV   TIME-STEP NONCONVECTIVE GRAUPEL                   mm
+104     ij     -     MASS_FLUX    DOWNDRAFT MASS FLUX FOR IN GRELL CUMULUS SCHEME   mb hour-1
+104     ikj    -     CLDFRA       CLOUD FRACTION                                    
+104     ij     -     SWDOWN       DOWNWARD SHORT WAVE FLUX AT GROUND SURFACE        W m-2      
+104     ij     -     GSW          NET SHORT WAVE FLUX AT GROUND SURFACE             W m-2      
+104     ij     -     GLW          DOWNWARD LONG WAVE FLUX AT GROUND SURFACE         W m-2      
+104     ij     -     SWCF         SHORT CLOUD FORCING AT TOA                        W m-2
+104     ij     -     LWCF         LONG WAVE CLOUD FORCING AT TOA                    W m-2
+104     ij     -     OLR          TOA OUTGOING LONG WAVE                            W m-2
+104     ij     -     XLAT         LATITUDE, SOUTH IS NEGATIVE                       degree_north
+104     ij     -     XLONG        LONGITUDE, WEST IS NEGATIVE                       degree_east
+104     ij     -     ALBEDO       ALBEDO                                            
+104     ij     -     ALBBCK       BACKGROUND ALBEDO                                 
+104     ij     -     EMISS        SURFACE EMISSIVITY                                 
+104     ij     -     TMN          SOIL TEMPERATURE AT LOWER BOUNDARY                K
+104     ij     -     XLAND        LAND MASK (1 FOR LAND, 2 FOR WATER)                     
+104     ij     -     ZNT          TIME-VARYING ROUGHNESS LENGTH                     m      
+104     ij     -     UST          U* IN SIMILARITY THEORY                           m s-1      
+104     ij     -     PBLH         PBL HEIGHT                                        m      
+104     ij     -     HFX          UPWARD HEAT FLUX AT THE SURFACE                   W m-2      
+104     ij     -     QFX          UPWARD MOISTURE FLUX AT THE SURFACE               kg m-2 s-1      
+104     ij     -     LH           LATENT HEAT FLUX AT THE SURFACE                   W m-2
+104     ij     -     FLHC         SURFACE EXCHANGE COEFFICIENT FOR HEAT             
+104     ij     -     FLQC         SURFACE EXCHANGE COEFFICIENT FOR MOISTURE         
+104     ij     -     SOILT1       TEMPERATURE INSIDE SNOW                           K
+104     ij     -     SNOWC        FLAG INDICATING SNOW COVERAGE (1 FOR SNOW COVER)  
+104     ij     -     MAVAIL       SURFACE MOISTURE AVAILABILITY                     
+104     ikj    -     DIV          DIVERGENCE                                        s-1
+104     ij     -     MAPFAC_M     Map scale factor on mass grid                     
+104     ij     -     F            Coriolis sine latitude term                       s-1
+104     ij     -     E            Coriolis cosine latitude term                     s-1
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/gribmap.txt
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/gribmap.txt	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/gribmap.txt	(revision 207)
@@ -0,0 +1,1542 @@
+-1:255:255:2
+0:var0:undefined::
+1:PRES:Pressure [Pa]:P,PSFC:2
+2:PRMSL:Pressure reduced to MSL [Pa]:PMSL:2
+3:PTEND:Pressure tendency [Pa/s]::
+4:PVORT:Pot. vorticity [km^2/kg/s]::
+5:ICAHT:ICAO Standard Atmosphere Reference Height [M]::
+6:GP:Geopotential [m^2/s^2]:PHP:3
+7:HGT:Geopotential height [gpm]:SOILHGT:2
+8:DIST:Geometric height [m]:HGT:4
+9:HSTDV:Std dev of height [m]::
+10:TOZNE:Total ozone [Dobson]::
+11:TMP:Temp. [K]:T2,TSK:2
+12:VTMP:Virtual temp. [K]::
+13:POT:Potential temp. [K]:TH2,THZ0,T:4
+14:EPOT:Pseudo-adiabatic pot. temp. [K]::
+15:TMAX:Max. temp. [K]::
+16:TMIN:Min. temp. [K]::
+17:DPT:Dew point temp. [K]::
+18:DEPR:Dew point depression [K]::
+19:LAPR:Lapse rate [K/m]::
+20:VIS:Visibility [m]::
+21:RDSP1:Radar spectra (1) [non-dim]::
+22:RDSP2:Radar spectra (2) [non-dim]::
+23:RDSP3:Radar spectra (3) [non-dim]::
+24:PLI:Parcel lifted index (to 500 hPa) [K]::
+25:TMPA:Temp. anomaly [K]::
+26:PRESA:Pressure anomaly [Pa]::
+27:GPA:Geopotential height anomaly [gpm]::
+28:WVSP1:Wave spectra (1) [non-dim]::
+29:WVSP2:Wave spectra (2) [non-dim]::
+30:WVSP3:Wave spectra (3) [non-dim]::
+31:WDIR:Wind direction [deg]::
+32:WIND:Wind speed [m/s]::
+33:UGRD:u wind [m/s]:U,U10,UZ0:3
+34:VGRD:v wind [m/s]:V,V10,VZ0:3
+35:STRM:Stream function [m^2/s]::
+36:VPOT:Velocity potential [m^2/s]::
+37:MNTSF:Montgomery stream function [m^2/s^2]::
+38:SGCVV:Sigma coord. vertical velocity [/s]:WW:5
+39:VVEL:Pressure vertical velocity [Pa/s]::
+40:DZDT:Geometric vertical velocity [m/s]:W:5
+41:ABSV:Absolute vorticity [/s]::
+42:ABSD:Absolute divergence [/s]::
+43:RELV:Relative vorticity [/s]::
+44:RELD:Relative divergence [/s]::
+45:VUCSH:Vertical u shear [/s]::
+46:VVCSH:Vertical v shear [/s]::
+47:DIRC:Direction of current [deg]::
+48:SPC:Speed of current [m/s]::
+49:UOGRD:u of current [m/s]::
+50:VOGRD:v of current [m/s]::
+51:SPFH:Specific humidity [kg/kg]:QSFC:5
+52:RH:Relative humidity [%]::
+53:MIXR:Humidity mixing ratio [kg/kg]:QVAPOR,Q2,QVG:6
+54:PWAT:Precipitable water [kg/m^2]::
+55:VAPP:Vapor pressure [Pa]::
+56:SATD:Saturation deficit [Pa]::
+57:EVP:Evaporation [kg/m^2]:SFCEVP:3
+58:CICE:Cloud Ice [kg/m^2]::
+59:PRATE:Precipitation rate [kg/m^2/s]::
+60:TSTM:Thunderstorm probability [%]::
+61:APCP:Total precipitation [kg/m^2]::
+62:NCPCP:Large scale precipitation [kg/m^2]:NCPCP:2
+63:ACPCP:Convective precipitation [kg/m^2]:ACPCP:2
+64:SRWEQ:Snowfall rate water equiv. [kg/m^2/s]::
+65:WEASD:Accum. snow [kg/m^2]:WEASD:2
+66:SNOD:Snow depth [m]:SNOWH:4
+67:MIXHT:Mixed layer depth [m]::
+68:TTHDP:Transient thermocline depth [m]::
+69:MTHD:Main thermocline depth [m]::
+70:MTHA:Main thermocline anomaly [m]::
+71:TCDC:Total cloud cover [%]:CLDFRA:2
+72:CDCON:Convective cloud cover [%]::
+73:LCDC:Low level cloud cover [%]::
+74:MCDC:Mid level cloud cover [%]::
+75:HCDC:High level cloud cover [%]::
+76:CWAT:Cloud water [kg/m^2]::
+77:BLI:Best lifted index (to 500 hPa) [K]::
+78:SNOC:Convective snow [kg/m^2]::
+79:SNOL:Large scale snow [kg/m^2]::
+80:WTMP:Water temp. [K]:SST:2
+81:LAND:Land cover (land=1;sea=0) [fraction]:LANDMASK:1
+82:DSLM:Deviation of sea level from mean [m]::
+83:SFCR:Surface roughness [m]:ZNT:6
+84:ALBDO:Albedo [%]:ALBEDO:2
+85:TSOIL:Soil temp. [K]:TSLB:2
+86:SOILM:Soil moisture content [kg/m^2]:SMSTOT:2
+87:VEG:Vegetation [%]:VEGFRA:2
+88:SALTY:Salinity [kg/kg]::
+89:DEN:Density [kg/m^3]::
+90:WATR:Water runoff [kg/m^2]::
+91:ICEC:Ice concentration (ice=1;no ice=0) [fraction]:XICE:1
+92:ICETK:Ice thickness [m]::
+93:DICED:Direction of ice drift [deg]::
+94:SICED:Speed of ice drift [m/s]::
+95:UICE:u of ice drift [m/s]::
+96:VICE:v of ice drift [m/s]::
+97:ICEG:Ice growth rate [m/s]::
+98:ICED:Ice divergence [/s]::
+99:SNOM:Snow melt [kg/m^2]::
+100:HTSGW:Sig height of wind waves and swell [m]::
+101:WVDIR:Direction of wind waves [deg]::
+102:WVHGT:Sig height of wind waves [m]::
+103:WVPER:Mean period of wind waves [s]::
+104:SWDIR:Direction of swell waves [deg]::
+105:SWELL:Sig height of swell waves [m]::
+106:SWPER:Mean period of swell waves [s]::
+107:DIRPW:Primary wave direction [deg]::
+108:PERPW:Primary wave mean period [s]::
+109:DIRSW:Secondary wave direction [deg]::
+110:PERSW:Secondary wave mean period [s]::
+111:NSWRS:Net short wave (surface) [W/m^2]::
+112:NLWRS:Net long wave (surface) [W/m^2]::
+113:NSWRT:Net short wave (top) [W/m^2]::
+114:NLWRT:Net long wave (top) [W/m^2]::
+115:LWAVR:Long wave [W/m^2]::
+116:SWAVR:Short wave [W/m^2]::
+117:GRAD:Global radiation [W/m^2]::
+118:BRTMP:Brightness temperature [K]::
+119:LWRAD:Radiance with respect to wave no. [W/m/sr]::
+120:SWRAD:Radiance with respect ot wave len. [W/m^3/sr]::
+121:LHTFL:Latent heat flux [W/m^2]:LH:4
+122:SHTFL:Sensible heat flux [W/m^2]::
+123:BLYDP:Boundary layer dissipation [W/m^2]::
+124:UFLX:Zonal momentum flux [N/m^2]::
+125:VFLX:Meridional momentum flux [N/m^2]::
+126:WMIXE:Wind mixing energy [J]::
+127:IMGD:Image data []::
+128:MSLSA:Mean sea level pressure (Std Atm) [Pa]::
+129:MSLMA:Mean sea level pressure (MAPS) [Pa]::
+130:LU_INDEX:Land Use Category:LU_INDEX:1
+131:DN:DNW values [dimensionless]:DNW:4
+132:SOILW:Volumetric soil moisture [fraction]:SMOIS:4
+133:XLAND:Land cover (land=1;sea=0) [fraction]:XLAND:1
+134:ZNW:Eta values [dimensionless]:ZNW:4
+135:GP_BASE:Base-state geopotential [m^2/s^2]:PHB:3
+136:GP_PERT:Perturbation geopotential [m^2/s^2]:PH:4
+137:CFN:CFN from WRF [?]:CFN:3
+138:CFN:CFN1 from WRF [?]:CFN1:3
+139:MU_BASE:Base-state dry air mass in column [Pa]:MUB:2
+140:MU_PERT:Perturbation dry air mass in column [Pa]:MU:2
+141:MU_INIT:Initial dry air mass in column [Pa]:MU0:2
+142:P_BASE:Base-state pressure [Pa]:PB:2
+143:DN:DN values [dimensionless]:DN:4
+144:SOILW:Volumetric soil moisture [fraction]:SMOIS:4
+145:RDNW:Inverse DNW values [dimensionless]:RDNW:3
+146:RDN:Inverse DN values [dimensionless]:RDN:3
+147:FNP:Lower weight for vertical stretching [dimensionless]:FNP:3
+148:FNM:Upper weight for vertical stretching [dimensionless]:FNM:3
+149:ZNU:Eta values [dimensionless]:ZNU:4
+150:ZETATOP:ZETA at model top [dimensionless]:ZETATOP:3
+151:PTOP:Pressure at model top [Pa]:P_TOP:3
+152:TIMESTEP:Timestep number:ITIMESTEP:3
+153:CLWMR:Cloud water [kg/kg]:QCLOUD,QCG:8
+154:var154:undefined::
+155:GFLUX:Ground heat flux [W/m^2]:HFX:4
+156:RAINBL:Acc. precip. over Boundary Layer time step [kg/m^2]:RAINBL:2
+157:var157:undefined::
+158:TKE:Turbulent kinetic energy [J/kg]:TKE:3
+159:TKE_MYJ:MYJ Turbulent kinetic energy [J/kg]:TKE_MYJ:3
+160:SOILL:Liquid volumetric soil moisture (non-frozen) [fraction]:SH2O:6
+161:var157:undefined::
+162:var157:undefined::
+163:var157:undefined::
+164:var157:undefined::
+165:var157:undefined::
+166:var157:undefined::
+167:var157:undefined::
+168:var157:undefined::
+169:var157:undefined::
+170:RWMR:Rain water mixing ratio [kg/kg]:QRAIN:5
+171:SNMR:Snow mixing ratio [kg/kg]:QSNOW:5
+172:RESM:Time weight constant for small steps:RESM:3
+173:RDX:Inverse X Grid Length [1/km]:RDX:9
+174:RDY:Inverse Y Grid Length [1/km]:RDY:9
+175:MLYNO:Model layer number (from bottom up) [non-dim]:NEST_POS:
+176:NLAT:Latitude (-90 to +90) [deg]:XLAT:4
+177:ELON:East longitude (0-360) [deg]:XLONG:4
+178:ICMR:Ice mixing ratio [kg/kg]:QICE:5
+179:GRMR:Graupel mixing ratio:QGRAUP:5
+180:QNI:Ice Crystal Number Concentration:QNI:0
+181:ZS:Depth of soil layer (midpoint) [m]:ZS:3
+182:DZS:Thickness of soil layer [m]:DZS:3
+183:SINALPHA:Local sine of map rotation:SINALPHA:4
+184:COSALPHA:Local cosine of map rotation:COSALPHA:4
+185:TURB:Turbulence SIGMET/AIRMET [non-dim]::
+186:EPSTS:EPSTS in WRF [?]:EPSTS:3
+187:var187:undefined::
+188:AKMS:Surface Exchange for Momentum [m/s]:AKMS:3
+189:MAPFAC_M:Map Scale Factor [dimensionless]:MAPFAC_M:7
+190:MAPFAC_U:Map Scale Factor [dimensionless]:MAPFAC_U:7
+191:MAPFAC_V:Map Scale Factor [dimensionless]:MAPFAC_V:7
+192:GRDFLX:Ground Heat Flux [W m-2]:GRDFLX:3
+193:RMOL:Reciprical of Monin-Ohukhov length:RMOL:4
+194:var194:undefined::
+195:var195:undefined::
+196:var196:undefined::
+197:var197:undefined::
+198:var198:undefined::
+199:var199:undefined::
+200:var200:undefined::
+201:var201:undefined::
+202:SNOWCU:Cumulative Snow [cm]:SNOWCU,ACSNOW:2
+203:ACSNOM:Accumulated Melted Snow [cm]:ACSNOM:2
+204:DSWRF:Downward short wave flux [W/m^2]:SWDOWN:3
+205:DLWRF:Downward long wave flux [W/m^2]:GLW:3
+206:GSW:Net short wave flux [w/m^2]:GSW:3
+207:MSTAV:Moisture availability [%]:SMSTAV:4
+208:SFEXC:Exchange coefficient [m/s]:SFCEXC:5
+209:AKHS:Exchange coefficient for heat [m/s]:AKHS:5
+210:SOILCAT:Soil Category:SOILCAT:1
+211:VEGCAT:Vegetation Categore:VEGCAT:1
+212:TOPOSTDV:Standard Deviation of Topography:TOPOSTDV:3
+213:TOPOSLPX:Sub-gridscale mean topographic slope in x-direction:TOPOSLPX:6
+214:TOPOSLPY:Sub-gridscale mean topographic slope in y-direction:TOPOSLPY:6
+215:SLOPECAT:Topographical Categorical Slope:SLOPECAT:1
+216:LANDUSEF:Land use categorical fraction on mass grid:LANDUSEF:3
+217:SOILCTOP:Top layer soil type as a categorical fraction:SOILCTOP:3
+218:SOILCBOT:Top layer soil type as a categorical fraction:SOILCBOT:3
+219:var219:undefined::
+220:var220:undefined::
+221:HPBL:Planetary boundary layer height [m]:PBLH:2
+222:var222:undefined::
+223:CNWAT:Plant canopy surface water [kg/m^2]:CANWAT:8
+224:SOTYP:Soil type (Zobler) [0..9]:ISLTYP:1
+225:VGTYP:Vegetation type (as in SiB) [0..13]:IVGTYP:1
+226:var226:undefined::
+227:CSLAT:Coriolis sine latitude term:F:6
+228:CCLAT:Coriolis cosine latitude term:E:6
+229:CF1:Second-order extrapolation constant 1:CF1:5
+230:CF2:Second-order extrapolation constant 2:CF2:5
+231:CF3:Second-order extrapolation constant 3:CF3:5
+232:var232:undefined::
+233:var233:undefined::
+234:BGRUN:Baseflow-groundwater runoff [kg/m^2]:UDROFF:4
+235:SSRUN:Storm surface runoff [kg/m^2]:SFROFF:4
+236:SNOW:Snow Water Equivalent [kg/m^2]:SNOW:2
+237:var237:undefined::
+238:SNOWC:Snow cover [%]:SNOWC:1
+239:var239:undefined::
+240:QFX:Upward moisture flux [kg/(m^s)]:QFX:8
+241:var241:undefined::
+242:var242:undefined::
+243:var243:undefined::
+244:var244:undefined::
+245:var245:undefined::
+246:var246:undefined::
+247:NPRATE:Non-convective Precip Rate[kg/m^2/s]:RAINNCV:7
+248:CPRATE:Convective Precip Rate[kg/m^2/s]:RAINCV:7 
+249:TMN:Ground Reservoir Temperature [K]:TMN:3
+250:var250:undefined::
+251:var251:undefined::
+252:var252:undefined::
+253:TNCPCP:Cumulative Large scale precipitation [kg/m^2]:RAINNC:3
+254:TACPCP:Cumulative Convective precipitation [kg/m^2]:RAINC:3
+255:var255:undefined::
+-1:255:255:3
+0:var0:undefined::
+1:PRES:Pressure [Pa]::
+2:PRMSL:Pressure reduced to MSL [Pa]::
+3:PTEND:Pressure tendency [Pa/s]::
+4:PVORT:Pot. vorticity [km^2/kg/s]::
+5:ICAHT:ICAO Standard Atmosphere Reference Height [M]::
+6:GP:Geopotential [m^2/s^2]::
+7:HGT:Geopotential height [gpm]::
+8:DIST:Geometric height [m]::
+9:HSTDV:Std dev of height [m]::
+10:TOZNE:Total ozone [Dobson]::
+11:TMP:Temp. [K]::
+12:VTMP:Virtual temp. [K]::
+13:POT:Potential temp. [K]::
+14:EPOT:Pseudo-adiabatic pot. temp. [K]::
+15:TMAX:Max. temp. [K]::
+16:TMIN:Min. temp. [K]::
+17:DPT:Dew point temp. [K]::
+18:DEPR:Dew point depression [K]::
+19:LAPR:Lapse rate [K/m]::
+20:VIS:Visibility [m]::
+21:RDSP1:Radar spectra (1) [non-dim]::
+22:RDSP2:Radar spectra (2) [non-dim]::
+23:RDSP3:Radar spectra (3) [non-dim]::
+24:PLI:Parcel lifted index (to 500 hPa) [K]::
+25:TMPA:Temp. anomaly [K]::
+26:PRESA:Pressure anomaly [Pa]::
+27:GPA:Geopotential height anomaly [gpm]::
+28:WVSP1:Wave spectra (1) [non-dim]::
+29:WVSP2:Wave spectra (2) [non-dim]::
+30:WVSP3:Wave spectra (3) [non-dim]::
+31:WDIR:Wind direction [deg]::
+32:WIND:Wind speed [m/s]::
+33:UGRD:u wind [m/s]::
+34:VGRD:v wind [m/s]::
+35:STRM:Stream function [m^2/s]::
+36:VPOT:Velocity potential [m^2/s]::
+37:MNTSF:Montgomery stream function [m^2/s^2]::
+38:SGCVV:Sigma coord. vertical velocity [/s]::
+39:VVEL:Pressure vertical velocity [Pa/s]::
+40:DZDT:Geometric vertical velocity [m/s]::
+41:ABSV:Absolute vorticity [/s]::
+42:ABSD:Absolute divergence [/s]::
+43:RELV:Relative vorticity [/s]::
+44:RELD:Relative divergence [/s]::
+45:VUCSH:Vertical u shear [/s]::
+46:VVCSH:Vertical v shear [/s]::
+47:DIRC:Direction of current [deg]::
+48:SPC:Speed of current [m/s]::
+49:UOGRD:u of current [m/s]::
+50:VOGRD:v of current [m/s]::
+51:SPFH:Specific humidity [kg/kg]::
+52:RH:Relative humidity [%]::
+53:MIXR:Humidity mixing ratio [kg/kg]::
+54:PWAT:Precipitable water [kg/m^2]::
+55:VAPP:Vapor pressure [Pa]::
+56:SATD:Saturation deficit [Pa]::
+57:EVP:Evaporation [kg/m^2]::
+58:CICE:Cloud Ice [kg/m^2]::
+59:PRATE:Precipitation rate [kg/m^2/s]::
+60:TSTM:Thunderstorm probability [%]::
+61:APCP:Total precipitation [kg/m^2]::
+62:NCPCP:Large scale precipitation [kg/m^2]::
+63:ACPCP:Convective precipitation [kg/m^2]::
+64:SRWEQ:Snowfall rate water equiv. [kg/m^2/s]::
+65:WEASD:Accum. snow [kg/m^2]::
+66:SNOD:Snow depth [m]::
+67:MIXHT:Mixed layer depth [m]::
+68:TTHDP:Transient thermocline depth [m]::
+69:MTHD:Main thermocline depth [m]::
+70:MTHA:Main thermocline anomaly [m]::
+71:TCDC:Total cloud cover [%]::
+72:CDCON:Convective cloud cover [%]::
+73:LCDC:Low level cloud cover [%]::
+74:MCDC:Mid level cloud cover [%]::
+75:HCDC:High level cloud cover [%]::
+76:CWAT:Cloud water [kg/m^2]::
+77:BLI:Best lifted index (to 500 hPa) [K]::
+78:SNOC:Convective snow [kg/m^2]::
+79:SNOL:Large scale snow [kg/m^2]::
+80:WTMP:Water temp. [K]::
+81:LAND:Land cover (land=1;sea=0) [fraction]::
+82:DSLM:Deviation of sea level from mean [m]::
+83:SFCR:Surface roughness [m]::
+84:ALBDO:Albedo [%]::
+85:TSOIL:Soil temp. [K]::
+86:SOILM:Soil moisture content [kg/m^2]::
+87:VEG:Vegetation [%]::
+88:SALTY:Salinity [kg/kg]::
+89:DEN:Density [kg/m^3]::
+90:WATR:Water runoff [kg/m^2]::
+91:ICEC:Ice concentration (ice=1;no ice=0) [fraction]::
+92:ICETK:Ice thickness [m]::
+93:DICED:Direction of ice drift [deg]::
+94:SICED:Speed of ice drift [m/s]::
+95:UICE:u of ice drift [m/s]::
+96:VICE:v of ice drift [m/s]::
+97:ICEG:Ice growth rate [m/s]::
+98:ICED:Ice divergence [/s]::
+99:SNOM:Snow melt [kg/m^2]::
+100:HTSGW:Sig height of wind waves and swell [m]::
+101:WVDIR:Direction of wind waves [deg]::
+102:WVHGT:Sig height of wind waves [m]::
+103:WVPER:Mean period of wind waves [s]::
+104:SWDIR:Direction of swell waves [deg]::
+105:SWELL:Sig height of swell waves [m]::
+106:SWPER:Mean period of swell waves [s]::
+107:DIRPW:Primary wave direction [deg]::
+108:PERPW:Primary wave mean period [s]::
+109:DIRSW:Secondary wave direction [deg]::
+110:PERSW:Secondary wave mean period [s]::
+111:NSWRS:Net short wave (surface) [W/m^2]::
+112:NLWRS:Net long wave (surface) [W/m^2]::
+113:NSWRT:Net short wave (top) [W/m^2]::
+114:NLWRT:Net long wave (top) [W/m^2]::
+115:LWAVR:Long wave [W/m^2]::
+116:SWAVR:Short wave [W/m^2]::
+117:GRAD:Global radiation [W/m^2]::
+118:BRTMP:Brightness temperature [K]::
+119:LWRAD:Radiance with respect to wave no. [W/m/sr]::
+120:SWRAD:Radiance with respect ot wave len. [W/m^3/sr]::
+121:LHTFL:Latent heat flux [W/m^2]::
+122:SHTFL:Sensible heat flux [W/m^2]::
+123:BLYDP:Boundary layer dissipation [W/m^2]::
+124:UFLX:Zonal momentum flux [N/m^2]::
+125:VFLX:Meridional momentum flux [N/m^2]::
+126:WMIXE:Wind mixing energy [J]::
+127:IMGD:Image data []::
+128:STEP_NUMBER::STEP_NUMBER:1
+129:DTS:Small Timestep:DTS:1
+130:DTSEPS:Time Weight Constant for Small Steps:DTSEPS:1
+131:FCX:Relaxation Term for Boundary Zone:FCX:5
+132:GCX:Second relaxation term for boundary Zone:GCX:5
+133:DTBC:Time since boundary read:DTBC:1
+134:SHDMAX:Annual MAX veg fraction:SHDMAX:4
+135:SHDMIN:Annual MIN veg fraction:SHDMIN:4
+136:SNOALB:Annual MAX snow albedor in fraction:SNOALB:4
+137:FNDSNOWH::FNDSNOWH:1
+138:TOTSWDN:Radiation State Variable:TOTSWDN:4
+139:TOTLWDN:Radiation State Variable:TOTLWDN:4
+140:RSWTOA:Radiation State Variable:RSWTOA:4
+141:RLWTOA:Radiation State Variable:RLWTOA:4
+142:CZMEAN:Radiation State Variable:CZMEAN:4
+143:CFRACL:Radiation State Variable:CFRACL:4
+144:CFRACM:Radiation State Variable:CFRACM:4
+145:CFRACH:Radiation State Variable:CFRACH:4
+146:ACFRST:Radiation State Variable:ACFRST:4
+147:NCFRST:Radiation State Variable:NCFRST:4
+148:ACFRCV:Radiation State Variable:ACFRCV:4
+149:NCFRCV:Radiation State Variable:NCFRCV:4
+150:FNDSOILW::FNDSOILW:1
+151:U_FRAME:FRAME X WIND [m/s]:U_FRAME:4
+152:V_FRAME:FRAME Y WIND [m/s]:V_FRAME:4
+153:ALBBCK:Background Albedo:ALBBCK:4
+154:U_BASE:Base State X Wind in Idealized Cases:U_BASE:3
+155:V_BASE:Base State Y Wind in Idealized Cases:V_BASE:3
+156:QV_BASE:Base State QV in Idealized Cases:QV_BASE:5
+157:Z_BASE:Base State Height in Idealized Cases:Z_BASE:5
+158:T_BASE:Base State T in Idealized Cases:T_BASE:2
+159:var159:undefined::
+160:TSOIL1:Soil temp. 0-10 cm [K]:ST000010:2
+161:TSOIL2:Soil temp. 10-40 cm [K]:ST010040:2
+162:TSOIL3:Soil temp. 40-100 cm [K]:ST040100:2
+163:TSOIL4:Soil temp. 100-200 cm [K]:ST100200:2
+164:SOILM1:Soil moisture content 0-10 cm [kg/m^2]:SM000010:2
+165:SOILM2:Soil moisture content 10-40 cm [kg/m^2]:SM010040:2
+166:SOILM3:Soil moisture content 40-100 cm [kg/m^2]:SM040100:2
+167:SOILM4:Soil moisture content 100-200 cm [kg/m^2]:SM100200:2
+168:var168:undefined::
+169:var169:undefined::
+170:var170:undefined::
+171:var171:undefined::
+172:var172:undefined::
+173:var173:undefined::
+174:var174:undefined::
+175:var175:undefined::
+176:var176:undefined::
+177:var177:undefined::
+178:var178:undefined::
+179:var179:undefined::
+180:var180:undefined::
+181:var181:undefined::
+182:var182:undefined::
+183:var183:undefined::
+184:var184:undefined::
+185:var185:undefined::
+186:var186:undefined::
+187:var187:undefined::
+188:var188:undefined::
+189:var189:undefined::
+190:var190:undefined::
+191:var191:undefined::
+192:var192:undefined::
+193:var193:undefined::
+194:var194:undefined::
+195:var195:undefined::
+196:var196:undefined::
+197:var197:undefined::
+198:var198:undefined::
+199:var199:undefined::
+200:var200:undefined::
+201:var201:undefined::
+202:var202:undefined::
+203:var203:undefined::
+204:var204:undefined::
+205:var205:undefined::
+206:var206:undefined::
+207:var207:undefined::
+208:var208:undefined::
+209:var209:undefined::
+210:var210:undefined::
+211:var211:undefined::
+212:var212:undefined::
+213:var213:undefined::
+214:var214:undefined::
+215:var215:undefined::
+216:var216:undefined::
+217:var217:undefined::
+218:var218:undefined::
+219:var219:undefined::
+220:var220:undefined::
+221:var221:undefined::
+222:var222:undefined::
+223:LAT_LL_T:Lower Left Latitude of temp point [deg]:LAT_LL_T:4
+224:LAT_UL_T:Lower Left Latitude of temp point [deg]:LAT_UL_T:4
+225:LAT_UR_T:Lower Left Latitude of temp point [deg]:LAT_UR_T:4
+226:LAT_LR_T:Lower Left Latitude of temp point [deg]:LAT_LR_T:4
+227:LAT_LL_U:Lower Left Latitude of u point [deg]:LAT_LL_U:4
+228:LAT_UL_U:Lower Left Latitude of u point [deg]:LAT_UL_U:4
+229:LAT_UR_U:Lower Left Latitude of u point [deg]:LAT_UR_U:4
+230:LAT_LR_U:Lower Left Latitude of u point [deg]:LAT_LR_U:4
+231:LAT_LL_V:Lower Left Latitude of v point [deg]:LAT_LL_V:4
+232:LAT_UL_V:Lower Left Latitude of v point [deg]:LAT_UL_V:4
+233:LAT_UR_V:Lower Left Latitude of v point [deg]:LAT_UR_V:4
+234:LAT_LR_V:Lower Left Latitude of v point [deg]:LAT_LR_V:4
+235:LAT_LL_D:Lower Left Latitude of massless point [deg]:LAT_LL_D:4
+236:LAT_UL_D:Lower Left Latitude of massless point [deg]:LAT_UL_D:4
+237:LAT_UR_D:Lower Left Latitude of massless point [deg]:LAT_UR_D:4
+238:LAT_LR_D:Lower Left Latitude of massless point [deg]:LAT_LR_D:4
+239:LON_LL_T:Lower Left Longitude of temp point [deg]:LON_LL_T:4
+240:LON_UL_T:Lower Left Longitude of temp point [deg]:LON_UL_T:4
+241:LON_UR_T:Lower Left Longitude of temp point [deg]:LON_UR_T:4
+242:LON_LR_T:Lower Left Longitude of temp point [deg]:LON_LR_T:4
+243:LON_LL_U:Lower Left Longitude of u point [deg]:LON_LL_U:4
+244:LON_UL_U:Lower Left Longitude of u point [deg]:LON_UL_U:4
+245:LON_UR_U:Lower Left Longitude of u point [deg]:LON_UR_U:4
+246:LON_LR_U:Lower Left Longitude of u point [deg]:LON_LR_U:4
+247:LON_LL_V:Lower Left Longitude of v point [deg]:LON_LL_V:4
+248:LON_UL_V:Lower Left Longitude of v point [deg]:LON_UL_V:4
+249:LON_UR_V:Lower Left Longitude of v point [deg]:LON_UR_V:4
+250:LON_LR_V:Lower Left Longitude of v point [deg]:LON_LR_V:4
+251:LON_LL_D:Lower Left Longitude of massless point [deg]:LON_LL_D:4
+252:LON_UL_D:Lower Left Longitude of massless point [deg]:LON_UL_D:4
+253:LON_UR_D:Lower Left Longitude of massless point [deg]:LON_UR_D:4
+254:LON_LR_D:Lower Left Longitude of massless point [deg]:LON_LR_D:4
+255:var255:undefined::
+-1:255:255:4
+0:var0:undefined::
+1:PRES:Pressure [Pa]::
+2:PRMSL:Pressure reduced to MSL [Pa]::
+3:PTEND:Pressure tendency [Pa/s]::
+4:PVORT:Pot. vorticity [km^2/kg/s]::
+5:ICAHT:ICAO Standard Atmosphere Reference Height [M]::
+6:GP:Geopotential [m^2/s^2]::
+7:HGT:Geopotential height [gpm]::
+8:DIST:Geometric height [m]::
+9:HSTDV:Std dev of height [m]::
+10:TOZNE:Total ozone [Dobson]::
+11:TMP:Temp. [K]::
+12:VTMP:Virtual temp. [K]::
+13:POT:Potential temp. [K]::
+14:EPOT:Pseudo-adiabatic pot. temp. [K]::
+15:TMAX:Max. temp. [K]::
+16:TMIN:Min. temp. [K]::
+17:DPT:Dew point temp. [K]::
+18:DEPR:Dew point depression [K]::
+19:LAPR:Lapse rate [K/m]::
+20:VIS:Visibility [m]::
+21:RDSP1:Radar spectra (1) [non-dim]::
+22:RDSP2:Radar spectra (2) [non-dim]::
+23:RDSP3:Radar spectra (3) [non-dim]::
+24:PLI:Parcel lifted index (to 500 hPa) [K]::
+25:TMPA:Temp. anomaly [K]::
+26:PRESA:Pressure anomaly [Pa]::
+27:GPA:Geopotential height anomaly [gpm]::
+28:WVSP1:Wave spectra (1) [non-dim]::
+29:WVSP2:Wave spectra (2) [non-dim]::
+30:WVSP3:Wave spectra (3) [non-dim]::
+31:WDIR:Wind direction [deg]::
+32:WIND:Wind speed [m/s]::
+33:UGRD:u wind [m/s]::
+34:VGRD:v wind [m/s]::
+35:STRM:Stream function [m^2/s]::
+36:VPOT:Velocity potential [m^2/s]::
+37:MNTSF:Montgomery stream function [m^2/s^2]::
+38:SGCVV:Sigma coord. vertical velocity [/s]::
+39:VVEL:Pressure vertical velocity [Pa/s]::
+40:DZDT:Geometric vertical velocity [m/s]::
+41:ABSV:Absolute vorticity [/s]::
+42:ABSD:Absolute divergence [/s]::
+43:RELV:Relative vorticity [/s]::
+44:RELD:Relative divergence [/s]::
+45:VUCSH:Vertical u shear [/s]::
+46:VVCSH:Vertical v shear [/s]::
+47:DIRC:Direction of current [deg]::
+48:SPC:Speed of current [m/s]::
+49:UOGRD:u of current [m/s]::
+50:VOGRD:v of current [m/s]::
+51:SPFH:Specific humidity [kg/kg]::
+52:RH:Relative humidity [%]::
+53:MIXR:Humidity mixing ratio [kg/kg]::
+54:PWAT:Precipitable water [kg/m^2]::
+55:VAPP:Vapor pressure [Pa]::
+56:SATD:Saturation deficit [Pa]::
+57:EVP:Evaporation [kg/m^2]::
+58:CICE:Cloud Ice [kg/m^2]::
+59:PRATE:Precipitation rate [kg/m^2/s]::
+60:TSTM:Thunderstorm probability [%]::
+61:APCP:Total precipitation [kg/m^2]::
+62:NCPCP:Large scale precipitation [kg/m^2]::
+63:ACPCP:Convective precipitation [kg/m^2]::
+64:SRWEQ:Snowfall rate water equiv. [kg/m^2/s]::
+65:WEASD:Accum. snow [kg/m^2]::
+66:SNOD:Snow depth [m]::
+67:MIXHT:Mixed layer depth [m]::
+68:TTHDP:Transient thermocline depth [m]::
+69:MTHD:Main thermocline depth [m]::
+70:MTHA:Main thermocline anomaly [m]::
+71:TCDC:Total cloud cover [%]::
+72:CDCON:Convective cloud cover [%]::
+73:LCDC:Low level cloud cover [%]::
+74:MCDC:Mid level cloud cover [%]::
+75:HCDC:High level cloud cover [%]::
+76:CWAT:Cloud water [kg/m^2]::
+77:BLI:Best lifted index (to 500 hPa) [K]::
+78:SNOC:Convective snow [kg/m^2]::
+79:SNOL:Large scale snow [kg/m^2]::
+80:WTMP:Water temp. [K]::
+81:LAND:Land cover (land=1;sea=0) [fraction]::
+82:DSLM:Deviation of sea level from mean [m]::
+83:SFCR:Surface roughness [m]::
+84:ALBDO:Albedo [%]::
+85:TSOIL:Soil temp. [K]::
+86:SOILM:Soil moisture content [kg/m^2]::
+87:VEG:Vegetation [%]::
+88:SALTY:Salinity [kg/kg]::
+89:DEN:Density [kg/m^3]::
+90:WATR:Water runoff [kg/m^2]::
+91:ICEC:Ice concentration (ice=1;no ice=0) [fraction]::
+92:ICETK:Ice thickness [m]::
+93:DICED:Direction of ice drift [deg]::
+94:SICED:Speed of ice drift [m/s]::
+95:UICE:u of ice drift [m/s]::
+96:VICE:v of ice drift [m/s]::
+97:ICEG:Ice growth rate [m/s]::
+98:ICED:Ice divergence [/s]::
+99:SNOM:Snow melt [kg/m^2]::
+100:HTSGW:Sig height of wind waves and swell [m]::
+101:WVDIR:Direction of wind waves [deg]::
+102:WVHGT:Sig height of wind waves [m]::
+103:WVPER:Mean period of wind waves [s]::
+104:SWDIR:Direction of swell waves [deg]::
+105:SWELL:Sig height of swell waves [m]::
+106:SWPER:Mean period of swell waves [s]::
+107:DIRPW:Primary wave direction [deg]::
+108:PERPW:Primary wave mean period [s]::
+109:DIRSW:Secondary wave direction [deg]::
+110:PERSW:Secondary wave mean period [s]::
+111:NSWRS:Net short wave (surface) [W/m^2]::
+112:NLWRS:Net long wave (surface) [W/m^2]::
+113:NSWRT:Net short wave (top) [W/m^2]::
+114:NLWRT:Net long wave (top) [W/m^2]::
+115:LWAVR:Long wave [W/m^2]::
+116:SWAVR:Short wave [W/m^2]::
+117:GRAD:Global radiation [W/m^2]::
+118:BRTMP:Brightness temperature [K]::
+119:LWRAD:Radiance with respect to wave no. [W/m/sr]::
+120:SWRAD:Radiance with respect ot wave len. [W/m^3/sr]::
+121:LHTFL:Latent heat flux [W/m^2]::
+122:SHTFL:Sensible heat flux [W/m^2]::
+123:BLYDP:Boundary layer dissipation [W/m^2]::
+124:UFLX:Zonal momentum flux [N/m^2]::
+125:VFLX:Meridional momentum flux [N/m^2]::
+126:WMIXE:Wind mixing energy [J]::
+127:IMGD:Image data []::
+128:RU_BXS::RU_BXS:1
+129:RU_BXE::RU_BXE:1
+130:RU_BYS::RU_BYS:1
+131:RU_BYE::RU_BYE:1
+132:RU_BTXS::RU_BTXS:6
+133:RU_BTXE::RU_BTXE:6
+134:RU_BTYS::RU_BTYS:6
+135:RU_BTYE::RU_BTYE:6
+136:RV_BXS::RV_BXS:1
+137:RV_BXE::RV_BXE:1
+138:RV_BYS::RV_BYS:1
+139:RV_BYE::RV_BYE:1
+140:RV_BTXS::RV_BTXS:6
+141:RV_BTXE::RV_BTXE:6
+142:RV_BTYS::RV_BTYS:6
+143:RV_BTYE::RV_BTYE:6
+144:RW_BXS::RW_BXS:1
+145:RW_BXE::RW_BXE:1
+146:RW_BYS::RW_BYS:1
+147:RW_BYE::RW_BYE:1
+148:RW_BTXS::RW_BTXS:6
+149:RW_BTXE::RW_BTXE:6
+150:RW_BTYS::RW_BTYS:6
+151:RW_BTYE::RW_BTYE:6
+152:PH_BXS::PH_BXS:-1
+153:PH_BXE::PH_BXE:-1
+154:PH_BYS::PH_BYS:-1
+155:PH_BYE::PH_BYE:-1
+156:PH_BTXS::PH_BTXS:4
+157:PH_BTXE::PH_BTXE:4
+158:PH_BTYS::PH_BTYS:4
+159:PH_BTYE::PH_BTYE:4
+160:T_BXS::T_BXS:1
+161:T_BXE::T_BXE:1
+162:T_BYS::T_BYS:1
+163:T_BYE::T_BYE:1
+164:T_BTXS::T_BTXS:6
+165:T_BTXE::T_BTXE:6
+166:T_BTYS::T_BTYS:6
+167:T_BTYE::T_BTYE:6
+168:MU_BXS::MU_BXS:4
+169:MU_BXE::MU_BXE:4
+170:MU_BYS::MU_BYS:4
+171:MU_BYE::MU_BYE:4
+172:MU_BTXS::MU_BTXS:9
+173:MU_BTXE::MU_BTXE:9
+174:MU_BTYS::MU_BTYS:9
+175:MU_BTYE::MU_BTYE:9
+176:RQV_BXS::RQV_BXS:4
+177:RQV_BXE::RQV_BXE:4
+178:RQV_BYS::RQV_BYS:4
+179:RQV_BYE::RQV_BYE:4
+180:RQV_BTXS::RQV_BTXS:10
+181:RQV_BTXE::RQV_BTXE:10
+182:RQV_BTYS::RQV_BTYS:10
+183:RQV_BTYE::RQV_BTYE:10
+184:RQC_BXS::RQC_BXS:4
+185:RQC_BXE::RQC_BXE:4
+186:RQC_BYS::RQC_BYS:4
+187:RQC_BYE::RQC_BYE:4
+188:RQC_BTXS::RQC_BTXS:10
+189:RQC_BTXE::RQC_BTXE:10
+190:RQC_BTYS::RQC_BTYS:10
+191:RQC_BTYE::RQC_BTYE:10
+192:RQR_BXS::RQR_BXS:4
+193:RQR_BXE::RQR_BXE:4
+194:RQR_BYS::RQR_BYS:4
+195:RQR_BYE::RQR_BYE:4
+196:RQR_BTXS::RQR_BTXS:10
+197:RQR_BTXE::RQR_BTXE:10
+198:RQR_BTYS::RQR_BTYS:10
+199:RQR_BTYE::RQR_BTYE:10
+200:RQI_BXS::RQI_BXS:4
+201:RQI_BXE::RQI_BXE:4
+202:RQI_BYS::RQI_BYS:4
+203:RQI_BYE::RQI_BYE:4
+204:RQI_BTXS::RQI_BTXS:10
+205:RQI_BTXE::RQI_BTXE:10
+206:RQI_BTYS::RQI_BTYS:10
+207:RQI_BTYE::RQI_BTYE:10
+208:RQS_BXS::RQS_BXS:4
+209:RQS_BXE::RQS_BXE:4
+210:RQS_BYS::RQS_BYS:4
+211:RQS_BYE::RQS_BYE:4
+212:RQS_BTXS::RQS_BTXS:10
+213:RQS_BTXE::RQS_BTXE:10
+214:RQS_BTYS::RQS_BTYS:10
+215:RQS_BTYE::RQS_BTYE:10
+216:RQG_BXS::RQG_BXS:4
+217:RQG_BXE::RQG_BXE:4
+218:RQG_BYS::RQG_BYS:4
+219:RQG_BYE::RQG_BYE:4
+220:RQG_BTXS::RQG_BTXS:10
+221:RQG_BTXE::RQG_BTXE:10
+222:RQG_BTYS::RQG_BTYS:10
+223:RQG_BTYE::RQG_BTYE:10
+224:var224:undefined::
+225:var225:undefined::
+226:var226:undefined::
+227:var227:undefined::
+228:var228:undefined::
+229:var229:undefined::
+230:var230:undefined::
+231:var231:undefined::
+232:var232:undefined::
+233:var233:undefined::
+234:var234:undefined::
+235:var235:undefined::
+236:var236:undefined::
+237:var237:undefined::
+238:var238:undefined::
+239:var239:undefined::
+240:var240:undefined::
+241:var241:undefined::
+242:var242:undefined::
+243:var243:undefined::
+244:var244:undefined::
+245:var245:undefined::
+246:var246:undefined::
+247:var247:undefined::
+248:var248:undefined::
+249:var249:undefined::
+250:var250:undefined::
+251:var251:undefined::
+252:var252:undefined::
+253:var253:undefined::
+254:var254:undefined::
+255:var255:undefined
+-1:255:255:5
+0:var0:undefined::
+1:PRES:Pressure [Pa]::
+2:PRMSL:Pressure reduced to MSL [Pa]::
+3:PTEND:Pressure tendency [Pa/s]::
+4:PVORT:Pot. vorticity [km^2/kg/s]::
+5:ICAHT:ICAO Standard Atmosphere Reference Height [M]::
+6:GP:Geopotential [m^2/s^2]::
+7:HGT:Geopotential height [gpm]::
+8:DIST:Geometric height [m]::
+9:HSTDV:Std dev of height [m]::
+10:TOZNE:Total ozone [Dobson]::
+11:TMP:Temp. [K]::
+12:VTMP:Virtual temp. [K]::
+13:POT:Potential temp. [K]::
+14:EPOT:Pseudo-adiabatic pot. temp. [K]::
+15:TMAX:Max. temp. [K]::
+16:TMIN:Min. temp. [K]::
+17:DPT:Dew point temp. [K]::
+18:DEPR:Dew point depression [K]::
+19:LAPR:Lapse rate [K/m]::
+20:VIS:Visibility [m]::
+21:RDSP1:Radar spectra (1) [non-dim]::
+22:RDSP2:Radar spectra (2) [non-dim]::
+23:RDSP3:Radar spectra (3) [non-dim]::
+24:PLI:Parcel lifted index (to 500 hPa) [K]::
+25:TMPA:Temp. anomaly [K]::
+26:PRESA:Pressure anomaly [Pa]::
+27:GPA:Geopotential height anomaly [gpm]::
+28:WVSP1:Wave spectra (1) [non-dim]::
+29:WVSP2:Wave spectra (2) [non-dim]::
+30:WVSP3:Wave spectra (3) [non-dim]::
+31:WDIR:Wind direction [deg]::
+32:WIND:Wind speed [m/s]::
+33:UGRD:u wind [m/s]::
+34:VGRD:v wind [m/s]::
+35:STRM:Stream function [m^2/s]::
+36:VPOT:Velocity potential [m^2/s]::
+37:MNTSF:Montgomery stream function [m^2/s^2]::
+38:SGCVV:Sigma coord. vertical velocity [/s]::
+39:VVEL:Pressure vertical velocity [Pa/s]::
+40:DZDT:Geometric vertical velocity [m/s]::
+41:ABSV:Absolute vorticity [/s]::
+42:ABSD:Absolute divergence [/s]::
+43:RELV:Relative vorticity [/s]::
+44:RELD:Relative divergence [/s]::
+45:VUCSH:Vertical u shear [/s]::
+46:VVCSH:Vertical v shear [/s]::
+47:DIRC:Direction of current [deg]::
+48:SPC:Speed of current [m/s]::
+49:UOGRD:u of current [m/s]::
+50:VOGRD:v of current [m/s]::
+51:SPFH:Specific humidity [kg/kg]::
+52:RH:Relative humidity [%]::
+53:MIXR:Humidity mixing ratio [kg/kg]::
+54:PWAT:Precipitable water [kg/m^2]::
+55:VAPP:Vapor pressure [Pa]::
+56:SATD:Saturation deficit [Pa]::
+57:EVP:Evaporation [kg/m^2]::
+58:CICE:Cloud Ice [kg/m^2]::
+59:PRATE:Precipitation rate [kg/m^2/s]::
+60:TSTM:Thunderstorm probability [%]::
+61:APCP:Total precipitation [kg/m^2]::
+62:NCPCP:Large scale precipitation [kg/m^2]::
+63:ACPCP:Convective precipitation [kg/m^2]::
+64:SRWEQ:Snowfall rate water equiv. [kg/m^2/s]::
+65:WEASD:Accum. snow [kg/m^2]::
+66:SNOD:Snow depth [m]::
+67:MIXHT:Mixed layer depth [m]::
+68:TTHDP:Transient thermocline depth [m]::
+69:MTHD:Main thermocline depth [m]::
+70:MTHA:Main thermocline anomaly [m]::
+71:TCDC:Total cloud cover [%]::
+72:CDCON:Convective cloud cover [%]::
+73:LCDC:Low level cloud cover [%]::
+74:MCDC:Mid level cloud cover [%]::
+75:HCDC:High level cloud cover [%]::
+76:CWAT:Cloud water [kg/m^2]::
+77:BLI:Best lifted index (to 500 hPa) [K]::
+78:SNOC:Convective snow [kg/m^2]::
+79:SNOL:Large scale snow [kg/m^2]::
+80:WTMP:Water temp. [K]::
+81:LAND:Land cover (land=1;sea=0) [fraction]::
+82:DSLM:Deviation of sea level from mean [m]::
+83:SFCR:Surface roughness [m]::
+84:ALBDO:Albedo [%]::
+85:TSOIL:Soil temp. [K]::
+86:SOILM:Soil moisture content [kg/m^2]::
+87:VEG:Vegetation [%]::
+88:SALTY:Salinity [kg/kg]::
+89:DEN:Density [kg/m^3]::
+90:WATR:Water runoff [kg/m^2]::
+91:ICEC:Ice concentration (ice=1;no ice=0) [fraction]::
+92:ICETK:Ice thickness [m]::
+93:DICED:Direction of ice drift [deg]::
+94:SICED:Speed of ice drift [m/s]::
+95:UICE:u of ice drift [m/s]::
+96:VICE:v of ice drift [m/s]::
+97:ICEG:Ice growth rate [m/s]::
+98:ICED:Ice divergence [/s]::
+99:SNOM:Snow melt [kg/m^2]::
+100:HTSGW:Sig height of wind waves and swell [m]::
+101:WVDIR:Direction of wind waves [deg]::
+102:WVHGT:Sig height of wind waves [m]::
+103:WVPER:Mean period of wind waves [s]::
+104:SWDIR:Direction of swell waves [deg]::
+105:SWELL:Sig height of swell waves [m]::
+106:SWPER:Mean period of swell waves [s]::
+107:DIRPW:Primary wave direction [deg]::
+108:PERPW:Primary wave mean period [s]::
+109:DIRSW:Secondary wave direction [deg]::
+110:PERSW:Secondary wave mean period [s]::
+111:NSWRS:Net short wave (surface) [W/m^2]::
+112:NLWRS:Net long wave (surface) [W/m^2]::
+113:NSWRT:Net short wave (top) [W/m^2]::
+114:NLWRT:Net long wave (top) [W/m^2]::
+115:LWAVR:Long wave [W/m^2]::
+116:SWAVR:Short wave [W/m^2]::
+117:GRAD:Global radiation [W/m^2]::
+118:BRTMP:Brightness temperature [K]::
+119:LWRAD:Radiance with respect to wave no. [W/m/sr]::
+120:SWRAD:Radiance with respect ot wave len. [W/m^3/sr]::
+121:LHTFL:Latent heat flux [W/m^2]::
+122:SHTFL:Sensible heat flux [W/m^2]::
+123:BLYDP:Boundary layer dissipation [W/m^2]::
+124:UFLX:Zonal momentum flux [N/m^2]::
+125:VFLX:Meridional momentum flux [N/m^2]::
+126:WMIXE:Wind mixing energy [J]::
+127:IMGD:Image data []::
+128:var128:undefined::
+129:PH0:Initial geopotential:PH0:1
+130:T_INIT:initial potential temperature:T_INIT:2
+131:AL:inverse perturbation density [m3 kg-1]:AL:4
+132:ALT:inverse density [m3 kg-1]:ALT:4
+133:SMFR3D:soil ice:SMFR3D:2
+134:KEEPFR3DFLAG:Flag - 1. Frozen Soil Yes, 0 - NO:KEEPFR3DFLAG:1
+135:CT:COUNTERGRADIENT TERM [K]:CT:2
+136:Z0:Background Roughness Length [m]:Z0:6
+137:KPBL:Level of PBL TOP:KPBL:1
+138:HTOP:Top of convection level:HTOP:1
+139:HBOT:Bottom of Convection Level:HBOT:1
+140:CUPPT:Accmulated Convective Rain Since Last Call to the Radiation:CUPPT:4
+141:F_ICE_PHY:Fraction of Ice:F_ICE_PHY:2
+142:F_RAIN_PHY:Fraction of Rain:F_RAIN_PHY:2
+143:F_RIMEF_PHY:Mass Ratio of Rimed Ice:F_RIMEF_PHY:2
+144:H_DIABATIC:Previous Timestep Condensational Heating:H_DIABATIC:9
+145:RTHCUTEN:COUPLED THETA TENDENCY DUE TO CUMULUS SCHEME [Pa K s-1]:RTHCUTEN:4
+146:RQVCUTEN:COUPLED Q_V TEND DUE TO CUMULUS SCHEME [Pa kg kg-1 s-1]:RQVCUTEN:4
+147:RQRCUTEN:COUPLED Q_R TEND DUE TO CUMULUS SCHEME [Pa kg kg-1 s-1]:RQRCUTEN:4
+148:RQCCUTEN:COUPLED Q_C TEND DUE TO CUMULUS SCHEME [Pa kg kg-1 s-1]:RQCCUTEN:4
+149:RQSCUTEN:COUPLED Q_S TEND DUE TO CUMULUS SCHEME [Pa kg kg-1 s-1]:RQSCUTEN:4
+150:RQICUTEN:COUPLED Q_I TEND DUE TO CUMULUS SCHEME [Pa kg kg-1 s-1]:RQICUTEN:4
+151:W0AVG:AVERAGE VERTICAL VELOCITY FOR KF CUMULUS SCHEME [m s-1]:W0AVG:6
+152:NCA:COUNTER OF THE CLOUD RELAXATION TIME IN KF CUMULUS SCHEME:NCA:0
+153:MASS_FLUX:DOWNDRAFT MASS FLUX FOR IN GRELL CUMULUS SCHEME [mb/hr]:MASS_FLUX:4
+154:APR_GR:PRECIP FROM CLOSURE OLD_GRELL [mm/hr]:APR_GR:4
+155:APR_W:PRECIP FROM CLOSURE W:APR_W:4
+156:APR_MC:PRECIP FROM CLOSURE KRISH MV [mm/hr]:APR_MC:4
+157:APR_ST:PRECIP FROM CLOSURE STABILITY [mm/hr]:APR_ST:4
+158:APR_AS:PRECIP FROM CLOSURE AS-TYPE [mm/hr]:APR_AS:4
+159:var159:undefined::
+160:APR_CAPMA:PRECIP FROM MAX CAP [mm/hr]:APR_CAPMA:4
+161:APR_CAPME:PRECIP FROM MEAN CAP [mm/hr]:APR_CAPME:4
+162:APR_CAPMI:PRECIP FROM MIN CAP [mm/hr]:APR_CAPMI:4
+163:XF_ENS:MASS FLUX PDF IN GRELL CUMULUS SCHEME[mb/hr]:XF_ENS:4
+164:PR_ENS:PRECIP RATE PDF IN GRELL CUMULUS SCHEME [mb/hr]:PR_ENS:4
+165:STEPCU:NUMBER OF FUNDAMENTAL TIMESTEPS BETWEEN CONVECTION CALLS:STEPCU:1
+166:RTHRATEN:COUPLED THETA TENDENCY DUE TO RADIATION [Pa K s-1]:RTHRATEN:4
+167:RTHRATLW:COUPLED THETA TENDENCY DUE TO LONG WAVE RADIATION [Pa K s-1]:RTHRATLW:7
+168:RTHRATSW:COUPLED THETA TENDENCY DUE TO SHORT WAVE RADIATION [Pa K s-1]:RTHRATSW:7
+169:CLDFRA:CLOUD FRACTION:CLDFRA:2
+170:RUBLTEN:COUPLED X WIND TENDENCY DUE TO PBL PARAMETERIZATION [Pa m s-2]:RUBLTEN:4
+171:RVBLTEN:COUPLED Y WIND TENDENCY DUE TO PBL PARAMETERIZATION [Pa m s-2]:RVBLTEN:4
+172:RTHBLTEN:COUPLED THETA TENDENCY DUE TO PBL PARAMETERIZATION [Pa K s-1]:RTHBLTEN:4
+173:RQVBLTEN:COUPLED Q_V TENDENCY DUE TO PBL PARAMETERIZATION [Pa kg kg-1 s-1]:RQVBLTEN:6
+174:RQCBLTEN:COUPLED Q_C TENDENCY DUE TO PBL PARAMETERIZATION [Pa kg kg-1 s-1]:RQCBLTEN:6
+175:RQIBLTEN:COUPLED Q_I TENDENCY DUE TO PBL PARAMETERIZATION [Pa kg kg-1 s-1]:RQIBLTEN:6
+176:UST:U* IN SIMILARITY THEORY [m s-1]:UST:4
+177:CAPG:HEAT CAPACITY FOR SOIL [j K-1 m-3]:CAPG:3
+178:THC:THERMAL INERTIA [Cal cm-1 K-1 s-0.5]:THC:3
+179:FLHC:SURFACE EXCHANGE COEFFICIENT FOR HEAT:FLHC:3
+180:FLQC:SURFACE EXCHANGE COEFFICIENT FOR MOISTURE:FLQC:6
+181:QSG:SURFACE SATURATION WATER VAPOR MIXING RATIO [kg kg-1]:QSG:6
+182:SOILT1:TEMPERATURE INSIDE SNOW [K]:SOILT1:2
+183:TSNAV:AVERAGE SNOW TEMPERATURE [C]:TSNAV:2
+184:MAVAIL:SURFACE MOISTURE AVAILABLITY:MAVAIL:4
+185:TKESFCF:TKE AT THE SURFACE [m2/s2]:TKESFCF:3
+186:STEPBL:NUMBER OF FUNDAMENTAL TIMESTEPS BETWEEN PBL CALLS:STEPBL:1
+187:TAUCLDI:CLOUD OPTICAL THICKNESS FOR ICE:TAUCLDI:2
+188:TAUCLDC:CLOUD OPTICAL THICKNESS FOR WATER:TAUCLDC:2
+189:RTHFTEN:TEMPERATURE TENDENCY USED IN GRELL CUMULUS SCHEME [K/s]:RTHFTEN:6
+190:RQVFTEN:MOISTURE TENDENCY USED IN GRELL CUMULUS SCHEME [kg/s]:RQVFTEN:6
+191:EMISS:SURFACE EMISSIVITY:EMISS:4
+192:CLDEFI:Precipitation efficiency in BMJ Scheme:CLDEFI:4
+193:STEPRA:NUMBER OF FUNDAMENTAL TIMESTEPS BETWEEN RADIATION CALLS:STEPRA:1
+194:MOL:T* in Similarity Theory [K]:MOL:3
+195:ALB:??:ALB:4
+196:U_1:Restart Parm:U_1:3
+197:U_2:Restart Parm:U_2:3
+198:V_1:Restart Parm:V_1:3
+199:V_2:Restart Parm:V_2:3
+200:W_1:Restart Parm:W_1:5
+201:W_2:Restart Parm:W_2:5
+202:PH_1:Restart Parm:PH_1:4
+203:PH_2:Restart Parm:PH_2:4
+204:T_1:Restart Parm:T_1:3
+205:T_2:Restart Parm:T_2:3
+206:MU_1:Restart Parm:MU_1:2
+207:MU_2:Restart Parm:MU_2:2
+208:TKE_1:Restart Parm:TKE_1:3
+209:TKE_2:Restart Parm:TKE_2:3
+210:QVAPOR_1:Restart Parm:QVAPOR_1:6
+211:QVAPOR_2:Restart Parm:QVAPOR_2:6
+212:QCLOUD_1:Restart Parm:QCLOUD_1:6
+213:QCLOUD_2:Restart Parm:QCLOUD_2:6
+214:QRAIN_1:Restart Parm:QRAIN_1:6
+215:QRAIN_2:Restart Parm:QRAIN_2:6
+216:QICE_1:Restart Parm:QICE_1:6
+217:QICE_2:Restart Parm:QICE_2:6
+218:QSNOW_1:Restart Parm:QSNOW_1:6
+219:QSNOW_2:Restart Parm:QSNOW_2:6
+220:QGRAUP_1:Restart Parm:QGRAUP_1:6
+221:QGRAUP_2:Restart Parm:QGRAUP_2:6
+222:QZ0:Specific humidity at roughness length [kg/kg]:QZ0:5
+223:TBPVS_STATE:STATE FOR ETAMPNEW MICROPHYSICS:TBPVS_STATE:3
+224:TBPVS0_STATE:STATE FOR ETAMPNEW MICROPHYSICS:TBPVS0_STATE:3
+225:MP_RESTART_STATE:STATE VECTOR FOR MICROPHYSICS RESTARTS:MP_RESTART_STATE:3
+226:IMICROGRAM:flag 0/1 0=mixratio, 1=mcrograms/m3":IMICROGRAM:1
+227:MASS_AER_WATER:aerosol liquid water content:MASS_AER_WATER:6
+228:MASS_AER_DRY:dry aerosol mass:MASS_AER_DRY:6
+229:EXCH_H:EXCHANGE COEFFICIENTS:EXCH_H:3
+230:var230:undefined::
+231:var231:undefined::
+232:var232:undefined::
+233:var233:undefined::
+234:var234:undefined::
+235:var235:undefined::
+236:var236:undefined::
+237:var237:undefined::
+238:var238:undefined::
+239:var239:undefined::
+240:var240:undefined::
+241:var241:undefined::
+242:var242:undefined::
+243:var243:undefined::
+244:var244:undefined::
+245:var245:undefined::
+246:var246:undefined::
+247:var247:undefined::
+248:var248:undefined::
+249:var249:undefined::
+250:var250:undefined::
+251:var251:undefined::
+252:var252:undefined::
+253:var253:undefined::
+254:var254:undefined::
+255:var255:undefined::
+-1:7:-1:129
+0:var0:undefined
+1:PRES:Pressure [Pa]
+2:PRMSL:Pressure reduced to MSL [Pa]
+3:PTEND:Pressure tendency [Pa/s]
+4:PVORT:Pot. vorticity [km^2/kg/s]
+5:ICAHT:ICAO Standard Atmosphere Reference Height [M]
+6:GP:Geopotential [m^2/s^2]
+7:HGT:Geopotential height [gpm]
+8:DIST:Geometric height [m]
+9:HSTDV:Std dev of height [m]
+10:TOZNE:Total ozone [Dobson]
+11:TMP:Temp. [K]
+12:VTMP:Virtual temp. [K]
+13:POT:Potential temp. [K]
+14:EPOT:Pseudo-adiabatic pot. temp. [K]
+15:TMAX:Max. temp. [K]
+16:TMIN:Min. temp. [K]
+17:DPT:Dew point temp. [K]
+18:DEPR:Dew point depression [K]
+19:LAPR:Lapse rate [K/m]
+20:VIS:Visibility [m]
+21:RDSP1:Radar spectra (1) [non-dim]
+22:RDSP2:Radar spectra (2) [non-dim]
+23:RDSP3:Radar spectra (3) [non-dim]
+24:PLI:Parcel lifted index (to 500 hPa) [K]
+25:TMPA:Temp. anomaly [K]
+26:PRESA:Pressure anomaly [Pa]
+27:GPA:Geopotential height anomaly [gpm]
+28:WVSP1:Wave spectra (1) [non-dim]
+29:WVSP2:Wave spectra (2) [non-dim]
+30:WVSP3:Wave spectra (3) [non-dim]
+31:WDIR:Wind direction [deg]
+32:WIND:Wind speed [m/s]
+33:UGRD:u wind [m/s]
+34:VGRD:v wind [m/s]
+35:STRM:Stream function [m^2/s]
+36:VPOT:Velocity potential [m^2/s]
+37:MNTSF:Montgomery stream function [m^2/s^2]
+38:SGCVV:Sigma coord. vertical velocity [/s]
+39:VVEL:Pressure vertical velocity [Pa/s]
+40:DZDT:Geometric vertical velocity [m/s]
+41:ABSV:Absolute vorticity [/s]
+42:ABSD:Absolute divergence [/s]
+43:RELV:Relative vorticity [/s]
+44:RELD:Relative divergence [/s]
+45:VUCSH:Vertical u shear [/s]
+46:VVCSH:Vertical v shear [/s]
+47:DIRC:Direction of current [deg]
+48:SPC:Speed of current [m/s]
+49:UOGRD:u of current [m/s]
+50:VOGRD:v of current [m/s]
+51:SPFH:Specific humidity [kg/kg]
+52:RH:Relative humidity [%]
+53:MIXR:Humidity mixing ratio [kg/kg]
+54:PWAT:Precipitable water [kg/m^2]
+55:VAPP:Vapor pressure [Pa]
+56:SATD:Saturation deficit [Pa]
+57:EVP:Evaporation [kg/m^2]
+58:CICE:Cloud Ice [kg/m^2]
+59:PRATE:Precipitation rate [kg/m^2/s]
+60:TSTM:Thunderstorm probability [%]
+61:APCP:Total precipitation [kg/m^2]
+62:NCPCP:Large scale precipitation [kg/m^2]
+63:ACPCP:Convective precipitation [kg/m^2]
+64:SRWEQ:Snowfall rate water equiv. [kg/m^2/s]
+65:WEASD:Accum. snow [kg/m^2]
+66:SNOD:Snow depth [m]
+67:MIXHT:Mixed layer depth [m]
+68:TTHDP:Transient thermocline depth [m]
+69:MTHD:Main thermocline depth [m]
+70:MTHA:Main thermocline anomaly [m]
+71:TCDC:Total cloud cover [%]
+72:CDCON:Convective cloud cover [%]
+73:LCDC:Low level cloud cover [%]
+74:MCDC:Mid level cloud cover [%]
+75:HCDC:High level cloud cover [%]
+76:CWAT:Cloud water [kg/m^2]
+77:BLI:Best lifted index (to 500 hPa) [K]
+78:SNOC:Convective snow [kg/m^2]
+79:SNOL:Large scale snow [kg/m^2]
+80:WTMP:Water temp. [K]
+81:LAND:Land cover (land=1;sea=0) [fraction]
+82:DSLM:Deviation of sea level from mean [m]
+83:SFCR:Surface roughness [m]
+84:ALBDO:Albedo [%]
+85:TSOIL:Soil temp. [K]
+86:SOILM:Soil moisture content [kg/m^2]
+87:VEG:Vegetation [%]
+88:SALTY:Salinity [kg/kg]
+89:DEN:Density [kg/m^3]
+90:WATR:Water runoff [kg/m^2]
+91:ICEC:Ice concentration (ice=1;no ice=0) [fraction]
+92:ICETK:Ice thickness [m]
+93:DICED:Direction of ice drift [deg]
+94:SICED:Speed of ice drift [m/s]
+95:UICE:u of ice drift [m/s]
+96:VICE:v of ice drift [m/s]
+97:ICEG:Ice growth rate [m/s]
+98:ICED:Ice divergence [/s]
+99:SNOM:Snow melt [kg/m^2]
+100:HTSGW:Sig height of wind waves and swell [m]
+101:WVDIR:Direction of wind waves [deg]
+102:WVHGT:Sig height of wind waves [m]
+103:WVPER:Mean period of wind waves [s]
+104:SWDIR:Direction of swell waves [deg]
+105:SWELL:Sig height of swell waves [m]
+106:SWPER:Mean period of swell waves [s]
+107:DIRPW:Primary wave direction [deg]
+108:PERPW:Primary wave mean period [s]
+109:DIRSW:Secondary wave direction [deg]
+110:PERSW:Secondary wave mean period [s]
+111:NSWRS:Net short wave (surface) [W/m^2]
+112:NLWRS:Net long wave (surface) [W/m^2]
+113:NSWRT:Net short wave (top) [W/m^2]
+114:NLWRT:Net long wave (top) [W/m^2]
+115:LWAVR:Long wave [W/m^2]
+116:SWAVR:Short wave [W/m^2]
+117:GRAD:Global radiation [W/m^2]
+118:BRTMP:Brightness temperature [K]
+119:LWRAD:Radiance with respect to wave no. [W/m/sr]
+120:SWRAD:Radiance with respect ot wave len. [W/m^3/sr]
+121:LHTFL:Latent heat flux [W/m^2]
+122:SHTFL:Sensible heat flux [W/m^2]
+123:BLYDP:Boundary layer dissipation [W/m^2]
+124:UFLX:Zonal momentum flux [N/m^2]
+125:VFLX:Meridional momentum flux [N/m^2]
+126:WMIXE:Wind mixing energy [J]
+127:IMGD:Image data []
+128:PAOT:Probability anomaly of temp [%]
+129:PAOP:Probability anomaly of precip [%]
+130:var130:undefined
+131:FRAIN:Rain fraction of total liquid water []
+132:FICE:Ice fraction of total condensate []
+133:FRIME:Rime factor []
+134:CUEFI:Convective cloud efficiency []
+135:TCOND:Total condensate [kg/kg]
+136:TCOLW:Total column cloud water [kg/m/m]
+137:TCOLI:Total column cloud ice [kg/m/m]
+138:TCOLR:Total column rain [kg/m/m]
+139:TCOLS:Total column snow [kg/m/m]
+140:TCOLC:Total column condensate [kg/m/m]
+141:PLPL:Pressure of level from which parcel was lifted [Pa]
+142:HLPL:Height of level from which parcel was lifted [Pa]
+143:var143:undefined
+144:var144:undefined
+145:var145:undefined
+146:var146:undefined
+147:var147:undefined
+148:var148:undefined
+149:var149:undefined
+150:var150:undefined
+151:var151:undefined
+152:var152:undefined
+153:var153:undefined
+154:var154:undefined
+155:var155:undefined
+156:var156:undefined
+157:var157:undefined
+158:var158:undefined
+159:var159:undefined
+160:var160:undefined
+161:var161:undefined
+162:var162:undefined
+163:var163:undefined
+164:var164:undefined
+165:var165:undefined
+166:var166:undefined
+167:var167:undefined
+168:var168:undefined
+169:var169:undefined
+170:ELRDI:Ellrod Index
+171:TSEC:Seconds prior to initial reference time [sec]
+172:var172:undefined
+173:var173:undefined
+174:var174:undefined
+175:var175:undefined
+176:var176:undefined
+177:var177:undefined
+178:var178:undefined
+179:var179:undefined
+180:OZCON:Ozone concentration [ppb]
+181:OZCAT:Categorical ozone concentration [?]
+182:KH:vertical heat eddy diffusivity [m^2/s]
+183:var183:undefined
+184:var184:undefined
+185:var185:undefined
+186:var186:undefined
+187:var187:undefined
+188:var188:undefined
+189:var189:undefined
+190:var190:undefined
+191:var191:undefined
+192:var192:undefined
+193:var193:undefined
+194:var194:undefined
+195:var195:undefined
+196:var196:undefined
+197:var197:undefined
+198:var198:undefined
+199:var199:undefined
+200:var200:undefined
+201:var201:undefined
+202:var202:undefined
+203:var203:undefined
+204:var204:undefined
+205:var205:undefined
+206:var206:undefined
+207:var207:undefined
+208:var208:undefined
+209:var209:undefined
+210:var210:undefined
+211:var211:undefined
+212:var212:undefined
+213:var213:undefined
+214:var214:undefined
+215:var215:undefined
+216:var216:undefined
+217:var217:undefined
+218:var218:undefined
+219:var219:undefined
+220:var220:undefined
+221:var221:undefined
+222:var222:undefined
+223:var223:undefined
+224:var224:undefined
+225:var225:undefined
+226:var226:undefined
+227:var227:undefined
+228:var228:undefined
+229:var229:undefined
+230:var230:undefined
+231:var231:undefined
+232:var232:undefined
+233:var233:undefined
+234:var234:undefined
+235:var235:undefined
+236:var236:undefined
+237:var237:undefined
+238:var238:undefined
+239:var239:undefined
+240:var240:undefined
+241:var241:undefined
+242:var242:undefined
+243:var243:undefined
+244:var244:undefined
+245:var245:undefined
+246:var246:undefined
+247:var247:undefined
+248:var248:undefined
+249:var249:undefined
+250:var250:undefined
+251:var251:undefined
+252:var252:undefined
+253:var253:undefined
+254:var254:undefined
+255:var255:undefined
+-1:7:-1:130
+0:var0:undefined
+1:PRES:Pressure [Pa]
+2:PRMSL:Pressure reduced to MSL [Pa]
+3:PTEND:Pressure tendency [Pa/s]
+4:PVORT:Pot. vorticity [km^2/kg/s]
+5:ICAHT:ICAO Standard Atmosphere Reference Height [M]
+6:GP:Geopotential [m^2/s^2]
+7:HGT:Geopotential height [gpm]
+8:DIST:Geometric height [m]
+9:HSTDV:Std dev of height [m]
+10:TOZNE:Total ozone [Dobson]
+11:TMP:Temp. [K]
+12:VTMP:Virtual temp. [K]
+13:POT:Potential temp. [K]
+14:EPOT:Pseudo-adiabatic pot. temp. [K]
+15:TMAX:Max. temp. [K]
+16:TMIN:Min. temp. [K]
+17:DPT:Dew point temp. [K]
+18:DEPR:Dew point depression [K]
+19:LAPR:Lapse rate [K/m]
+20:VIS:Visibility [m]
+21:RDSP1:Radar spectra (1) [non-dim]
+22:RDSP2:Radar spectra (2) [non-dim]
+23:RDSP3:Radar spectra (3) [non-dim]
+24:PLI:Parcel lifted index (to 500 hPa) [K]
+25:TMPA:Temp. anomaly [K]
+26:PRESA:Pressure anomaly [Pa]
+27:GPA:Geopotential height anomaly [gpm]
+28:WVSP1:Wave spectra (1) [non-dim]
+29:WVSP2:Wave spectra (2) [non-dim]
+30:WVSP3:Wave spectra (3) [non-dim]
+31:WDIR:Wind direction [deg]
+32:WIND:Wind speed [m/s]
+33:UGRD:u wind [m/s]
+34:VGRD:v wind [m/s]
+35:STRM:Stream function [m^2/s]
+36:VPOT:Velocity potential [m^2/s]
+37:MNTSF:Montgomery stream function [m^2/s^2]
+38:SGCVV:Sigma coord. vertical velocity [/s]
+39:VVEL:Pressure vertical velocity [Pa/s]
+40:DZDT:Geometric vertical velocity [m/s]
+41:ABSV:Absolute vorticity [/s]
+42:ABSD:Absolute divergence [/s]
+43:RELV:Relative vorticity [/s]
+44:RELD:Relative divergence [/s]
+45:VUCSH:Vertical u shear [/s]
+46:VVCSH:Vertical v shear [/s]
+47:DIRC:Direction of current [deg]
+48:SPC:Speed of current [m/s]
+49:UOGRD:u of current [m/s]
+50:VOGRD:v of current [m/s]
+51:SPFH:Specific humidity [kg/kg]
+52:RH:Relative humidity [%]
+53:MIXR:Humidity mixing ratio [kg/kg]
+54:PWAT:Precipitable water [kg/m^2]
+55:VAPP:Vapor pressure [Pa]
+56:SATD:Saturation deficit [Pa]
+57:EVP:Evaporation [kg/m^2]
+58:CICE:Cloud Ice [kg/m^2]
+59:PRATE:Precipitation rate [kg/m^2/s]
+60:TSTM:Thunderstorm probability [%]
+61:APCP:Total precipitation [kg/m^2]
+62:NCPCP:Large scale precipitation [kg/m^2]
+63:ACPCP:Convective precipitation [kg/m^2]
+64:SRWEQ:Snowfall rate water equiv. [kg/m^2/s]
+65:WEASD:Accum. snow [kg/m^2]
+66:SNOD:Snow depth [m]
+67:MIXHT:Mixed layer depth [m]
+68:TTHDP:Transient thermocline depth [m]
+69:MTHD:Main thermocline depth [m]
+70:MTHA:Main thermocline anomaly [m]
+71:TCDC:Total cloud cover [%]
+72:CDCON:Convective cloud cover [%]
+73:LCDC:Low level cloud cover [%]
+74:MCDC:Mid level cloud cover [%]
+75:HCDC:High level cloud cover [%]
+76:CWAT:Cloud water [kg/m^2]
+77:BLI:Best lifted index (to 500 hPa) [K]
+78:SNOC:Convective snow [kg/m^2]
+79:SNOL:Large scale snow [kg/m^2]
+80:WTMP:Water temp. [K]
+81:LAND:Land cover (land=1;sea=0) [fraction]
+82:DSLM:Deviation of sea level from mean [m]
+83:SFCR:Surface roughness [m]
+84:ALBDO:Albedo [%]
+85:TSOIL:Soil temp. [K]
+86:SOILM:Soil moisture content [kg/m^2]
+87:VEG:Vegetation [%]
+88:SALTY:Salinity [kg/kg]
+89:DEN:Density [kg/m^3]
+90:WATR:Water runoff [kg/m^2]
+91:ICEC:Ice concentration (ice=1;no ice=0) [fraction]
+92:ICETK:Ice thickness [m]
+93:DICED:Direction of ice drift [deg]
+94:SICED:Speed of ice drift [m/s]
+95:UICE:u of ice drift [m/s]
+96:VICE:v of ice drift [m/s]
+97:ICEG:Ice growth rate [m/s]
+98:ICED:Ice divergence [/s]
+99:SNOM:Snow melt [kg/m^2]
+100:HTSGW:Sig height of wind waves and swell [m]
+101:WVDIR:Direction of wind waves [deg]
+102:WVHGT:Sig height of wind waves [m]
+103:WVPER:Mean period of wind waves [s]
+104:SWDIR:Direction of swell waves [deg]
+105:SWELL:Sig height of swell waves [m]
+106:SWPER:Mean period of swell waves [s]
+107:DIRPW:Primary wave direction [deg]
+108:PERPW:Primary wave mean period [s]
+109:DIRSW:Secondary wave direction [deg]
+110:PERSW:Secondary wave mean period [s]
+111:NSWRS:Net short wave (surface) [W/m^2]
+112:NLWRS:Net long wave (surface) [W/m^2]
+113:NSWRT:Net short wave (top) [W/m^2]
+114:NLWRT:Net long wave (top) [W/m^2]
+115:LWAVR:Long wave [W/m^2]
+116:SWAVR:Short wave [W/m^2]
+117:GRAD:Global radiation [W/m^2]
+118:BRTMP:Brightness temperature [K]
+119:LWRAD:Radiance with respect to wave no. [W/m/sr]
+120:SWRAD:Radiance with respect ot wave len. [W/m^3/sr]
+121:LHTFL:Latent heat flux [W/m^2]
+122:SHTFL:Sensible heat flux [W/m^2]
+123:BLYDP:Boundary layer dissipation [W/m^2]
+124:UFLX:Zonal momentum flux [N/m^2]
+125:VFLX:Meridional momentum flux [N/m^2]
+126:WMIXE:Wind mixing energy [J]
+127:IMGD:Image data []
+128:var128:undefined
+129:var129:undefined
+130:var130:undefined
+131:var131:undefined
+132:var132:undefined
+133:var133:undefined
+134:var134:undefined
+135:var135:undefined
+136:var136:undefined
+137:var137:undefined
+138:var138:undefined
+139:var139:undefined
+140:var140:undefined
+141:var141:undefined
+142:var142:undefined
+143:CSNOW:Categorical snow [yes=1;no=0]
+144:SOILW:Volumetric soil moisture (frozen + liquid) [fraction]
+145:PEVPR:Potential evaporation rate [W/m^2]
+146:VEGT:Vegetation canopy temperature [K]
+147:BARET:Bare soil surface skin temperature [K]
+148:AVSFT:Average surface skin temperature [K]
+149:RADT:Effective radiative skin temperature [K]
+150:SSTOR:Surface water storage [Kg/m^2]
+151:LSOIL:Liquid soil moisture content (non-frozen) [Kg/m^2]
+152:EWATR:Open water evaporation (standing water) [W/m^2]
+153:var153:undefined
+154:var154:undefined
+155:GFLUX:Ground Heat Flux [W/m^2]
+156:CIN:Convective inhibition [J/Kg]
+157:CAPE:Convective available potential energy [J/Kg]
+158:TKE:Turbulent Kinetic Energy [J/Kg]
+159:MXSALB:Maximum snow albedo [%]
+160:SOILL:Liquid volumetric soil moisture (non-frozen) [fraction]
+161:ASNOW:Frozen precipitation (e.g. snowfall) [Kg/m^2]
+162:ARAIN:Liquid precipitation (rainfall) [Kg/m^2]
+163:GWREC:Groundwater recharge [Kg/m^2]
+164:QREC:Flood plain recharge [Kg/m^2]
+165:SNOWT:Snow temperature, depth-avg [K]
+166:VBDSF:Visible beam downward solar flux [W/m^2]
+167:VDDSF:Visible diffuse downward solar flux [W/m^2]
+168:NBDSF:Near IR beam downward solar flux [W/m^2]
+169:NDDSF:Near IR diffuse downward solar flux [W/m^2]
+170:SNFALB:Snow-free albedo [%]
+171:RLYRS:Number of soil layers in root zone [non-dim]
+172:MFLX:Momentum flux [N/m^2]
+173:var173:undefined
+174:var174:undefined
+175:var175:undefined
+176:NLAT:Latitude (-90 to +90) [deg]
+177:ELON:East longitude (0-360) [deg]
+178:var178:undefined
+179:ACOND:Aerodynamic conductance [m/s]
+180:SNOAG:Snow age [s]
+181:CCOND:Canopy conductance [m/s]
+182:LAI:Leaf area index (0-9) [non-dim]
+183:SFCRH:Roughness length for heat [m]
+184:SALBD:Snow albedo (over snow cover area only) [%]
+185:var185:undefined
+186:var186:undefined
+187:NDVI:Normalized Difference Vegetation Index []
+188:DRIP:Canopy drip [Kg/m^2]
+189:var189:undefined
+190:var190:undefined
+191:var191:undefined
+192:var192:undefined
+193:var193:undefined
+194:var194:undefined
+195:var195:undefined
+196:var196:undefined
+197:var197:undefined
+198:SBSNO:Sublimation (evaporation from snow) [W/m^2]
+199:EVBS:Direct evaporation from bare soil [W/m^2]
+200:EVCW:Canopy water evaporation [W/m^2]
+201:var201:undefined
+202:var202:undefined
+203:RSMIN:Minimal stomatal resistance [s/m]
+204:DSWRF:Downward shortwave radiation flux [W/m^2]
+205:DLWRF:Downward longwave radiation flux [W/m^2]
+206:var206:undefined
+207:MSTAV:Moisture availability [%]
+208:SFEXC:Exchange coefficient [(Kg/m^3)(m/s)]
+209:var209:undefined
+210:TRANS:Transpiration [W/m^2]
+211:USWRF:Upward short wave radiation flux [W/m^2]
+212:ULWRF:Upward long wave radiation flux [W/m^2]
+213:var213:undefined
+214:var214:undefined
+215:var215:undefined
+216:var216:undefined
+217:var217:undefined
+218:var218:undefined
+219:WILT:Wilting point [fraction]
+220:FLDCP:Field Capacity [fraction]
+221:var221:undefined
+222:SLTYP:Surface slope type [Index]
+223:CNWAT:Plant canopy surface water [Kg/m^2]
+224:SOTYP:Soil type [Index]
+225:VGTYP:Vegetation type [Index]
+226:BMIXL:Blackadars mixing length scale [m]
+227:AMIXL:Asymptotic mixing length scale [m]
+228:PEVAP:Potential evaporation [Kg/m^2]
+229:SNOHF:Snow phase-change heat flux [W/m^2]
+230:SMREF:Transpiration stress-onset (soil moisture) [fraction]
+231:SMDRY:Direct evaporation cease (soil moisture) [fraction]
+232:var232:undefined
+233:var233:undefined
+234:BGRUN:Subsurface runoff (baseflow) [Kg/m^2]
+235:SSRUN:Surface runoff (non-infiltrating) [Kg/m^2]
+236:var236:undefined
+237:var237:undefined
+238:SNOWC:Snow cover [%]
+239:SNOT:Snow temperature [K]
+240:POROS:Soil porosity [fraction]
+241:var241:undefined
+242:var242:undefined
+243:var243:undefined
+244:var244:undefined
+245:var245:undefined
+246:RCS:Solar parameter in canopy conductance [fraction]
+247:RCT:Temperature parameter in canopy conductance [fraction]
+248:RCQ:Humidity parameter in canopy conductance [fraction]
+249:RCSOL:Soil moisture parameter in canopy conductance [fraction]
+250:var250:undefined
+251:var251:undefined
+252:CD:Surface drag coefficient [non-dim]
+253:FRICV:Surface friction velocity [m/s]
+254:RI:Richardson number [non-dim]
+255:var255:undefined
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/gw.def
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/gw.def	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/gw.def	(revision 207)
@@ -0,0 +1,266 @@
+;;---------------------------------------
+;
+;  fill here plot parameters then type:
+;
+;  @trace.idl
+;  -or- @report.idl
+;  -or- @movie.idl
+;
+;  this file will be saved !
+;
+;;---------------------------------------
+
+
+;-------------------------------------;
+; DATA LOCATION and PLOT DESTINATION  ;
+; default is ./                       ;
+;-------------------------------------;
+;datafolder='../../TESTCASE/'   
+datafolder='/home/aymeric/Science/LMD_MM_MARS_2008_11_07/DATA/'
+plotfolder=datafolder
+;; for web anim and tex report (default is 'plot')
+textitle='ARSIA'
+texcomments='sol1'
+
+;;; load/save ARWpost-generated text files ? default is no
+;backup_data='yes'
+;already_data='yes'
+
+;-------------------------------
+;-------------------------------
+; namelist.ARWPOST parameters
+;-------------------------------
+;-------------------------------
+
+nam1=" fields = 'U,V,tk,HGT' "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE FIELDS TO BE EXTRACTED 
+;; ex: tk,HGT,PSFC,U,V,W,T,tk,ICETOT,RAVE,QH2O_ICE,QH2O,PTOT,TSURF
+
+nam2=" start_date = '2024-07-01_07:00:00' " 
+nam3=" end_date   = '2024-07-01_07:00:00' "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; CHANGE HERE START/END DATE
+
+nam4=" interval_seconds = 7400 "		
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 
+;; SET INTERVAL   2h: 7400s, 4h: 14800s, 6h: 22200s, 12h: 44400s	
+
+nam5=" interp_method = 1 "	
+nam5=" interp_method = 0 "
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 		
+;; SET VERT. COORD. 0: eta levels, 1: height (inc) or pressure (dec)
+
+tabnam=[-5.,40.,0.5]   ;[2.,30.,0.3]   	
+;; ^ ^ ^ ^ ^ ^ ^ ^ ^
+;; SET HEIGHT/PRESSURE LEVELS WITH [first alt, last alt, step]
+
+;nest='d03'  
+;; ^ ^ ^ ^
+;; SET NEST
+
+
+
+;----------------------------------------------------
+;----------------------------------------------------
+; what do you want to plot ?
+; THIS MUST BE SET ACCORDINGLY TO PREVIOUS SECTION
+;   - do not plot a field not extracted
+;   - do not ask for more plot than data available
+;----------------------------------------------------
+;----------------------------------------------------
+
+num=6		   	;; how many plots ?
+
+
+field1='U'		;; FILLED
+;field2='tk'		;; CONTOURED
+winds=['U','V']		;; VECTORS
+topo=1
+
+
+;;; VORTICITY
+;field1='HGT' & winds=['U','V'] & topo=1
+
+
+;----------------------------------
+;----------------------------------
+; what kind of plot do you want ? 
+;----------------------------------
+;----------------------------------
+
+;; first is 1
+plot='map' & level=2  	
+;plot='meridional' & nlon=30
+;plot='zonal' & nlat=66
+
+
+;---------;
+; special ;
+;---------;
+;;; SEA-LEVEL PRESSURE
+;field1='PSFC' & winds=['tk','HGT'] & topo=1 & plot='map' & level=7
+;;; HORIZONTAL WIND VELOCITY
+;field1='U' & winds=['U','V'] & topo=1 & plot='map' & level=9
+
+
+;----------------------------
+;----------------------------
+; change plot settings 
+;----------------------------
+;----------------------------
+
+;; uncomment to modify default plot settings
+;; | | | | | | | | | | | | | | | | | | | | |
+;; v v v v v v v v v v v v v v v v v v v v v
+
+;;;
+;;; PLOT TITLES
+;;;
+;subtitle_user='-- LMD Martian Mesoscale Model --'     ;; grepALL
+;title_user='Vertical Wind (!Nm!N.s!U-1!N)'            ;; grepALL
+;title_axis=['x coord (km)','y coord (km)']            ;; grepALL
+
+;;;
+;;; COLOR TABLES
+;;;
+;flag_cb='false'       ;; grepALL
+format='(I0)'          ;; grepALL
+colors=64              ;; grepALL
+pal=39                 ;; grepALL
+;; GOOD COLOR TABLES: 4, 18, 22, 16, 37, 33, 39
+
+;;;
+;;; FILL LIMITS
+;;;
+minfield_init=0.      ;; grepALL
+maxfield_init=30.     ;; grepALL
+
+;lim_max = maxfield_init & w=where((what_I_plot ge lim_max) and (what_I_plot le 1e9)) & if (w[0] ne -1) then what_I_plot[w]=lim_max ;; grepALL
+;lim_min = minfield_init & w=where(what_I_plot le lim_min) & if (w[0] ne -1) then what_I_plot[w]=lim_min ;; grepALL
+;lim_blank = 2. & w=where(abs(what_I_plot) le lim_blank) & if (w[0] ne -1) then what_I_plot[w]=missing_value ;; grepALL
+
+;;;
+;;; WINDS
+;;;
+windex=15.	;; grepALL
+stride=2.	;; grepALL
+
+;;;
+;;; CONTOUR
+;;;
+;overcontour=overcontour-mean(overcontour)	;; grepALL
+lev=-10. + 1.*findgen(30) ;; grepALL
+
+;;;
+;;; AXIS
+;;;
+;isotropic='false'       ;; grepALL
+intervalx=2.            ;; grepALL
+intervaly=2.             ;; grepALL
+
+;;;
+;;; MAP LIMITS 
+;;;
+windowx=[-128.,-114.]        ;; grepMAP
+windowy=[-16.,-2.]             ;; grepMAP
+
+
+;;;
+;;; VERTICAL SECTION LIMITS
+;;;
+;minalt=-5.		;; grepSEC
+;maxalt=40.		;; grepSEC
+;minspace=0.0  		;; grepSEC
+;maxspace=35.0  	;; grepSEC
+
+;;;
+;;; METRIC UNITS FOR VERTICAL SECTION
+;;;
+;factor=10.	   ;; grepSEC
+;space=space*60. & spacekm='true'   	;; grepSEC
+;minspace=minspace*60./factor       	;; grepSEC
+;maxspace=maxspace*60./factor       	;; grepSEC
+;intervalx=round(intervalx*60./factor)   ;; grepSEC
+
+
+;;;
+;;; TRICKS
+;;;
+
+;; pour tracer juste les vecteurs sur un fond uni ou vide
+;pal=0						;; 1/4 grepMAP
+;what_I_plot(*,*)=what_I_plot(*,*)*0.+0.2	;; 2/4 grepMAP
+;what_I_plot(0,0)=0.				;; 3/4 grepMAP
+;flag_cb='false'					;; 4/4 grepMAP
+
+;;; truc pour tracer juste les contours et une zone grisee de topo 
+;pal=0                                           ;; 1/9 grepALL
+;w=where(abs(what_I_plot) lt missing_value) 	;; 2/9 grepALL
+;what_I_plot[w]=0.   				;; 3/9 grepALL
+;w=where(abs(what_I_plot) gt missing_value) 	;; 4/9 grepALL
+;what_I_plot[w]=0.75 				;; 5/9 grepALL
+;w=where(what_I_plot eq 0.) 			;; 6/9 grepALL
+;what_I_plot[w]=missing_value   			;; 7/9 grepALL
+;what_I_plot(0,0)=1. & what_I_plot(1,0)=0.	;; 8/9 grepALL
+;flag_cb='false'                         	;; 9/9 grepALL
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;; POUBELLE
+
+
+;; DEFAULT: ARWPOST.EXE ALREADY RUN (i.e. input.ctl and input.dat already there)
+;; UNCOMMENT FOLLOWING LINE TO EXTRACT FILES 
+;extract='yes'   ;;   EXECUTE ARWPOST.EXE
+                ;;   WITH THE FOLLOWING PARAMETERS :
+
+
+;@map_sea_level.idl
+;@map_ertel_vorticity.idl
+;field1='HGT'
+;field2='U'
+;winds=['U','V']
+;topo=1
+
+
+;winds=['U','V'] & field1='SWDOWN' & topo=1
+;winds=['V','W'] & field1='V' 
+;field1='ICETOT' & topo=1
+;field1='RAVE' & topo=1
+;field1='QH2O_ICE' & topo=1
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O' & field2='W'
+;field1='QH2O' & winds=['U','W']
+;field1='QH2O_ICE' & field2='tk'
+;field1='tk' & topo=1
+;field1='V' & field2='V'
+;field1='W' & winds=['V','W']
+;field1='tk' & winds=['V','W']
+;field1='tk'
+;field1='W' & topo=1
+;field1='TSK' & topo=1
+;field1='U' & winds=['U','V'] & topo=1
+;winds=['V','W'] & field1='V'
+;winds=['V','W'] & field1='W'
+;field1='U' & winds=['U','V'] & topo=1
+;field1='HGT' & field2='HGT' 
+;field1='U' & winds=['U','V'] ;& topo=1
+;field1='PSFC' & winds=['U','V'] & field2='W'
+;field1='W' & winds=['U','V'] & field2='PSFC'
+;field1='TSURF' & topo=1 ;& winds=['U','V']
+;field1='T' & topo=1 & winds=['U','V']
+;field1='PSFC' & winds=['tk','HGT'] & topo=1
+;field1='tk' & topo=1
+;field1='tk' & winds=['U','V'] & topo=1
+;field1='T' & field2='T'
+;field1='T' & winds=['U','V'] 
+;field1='HGT' & winds=['HGT','HGT'] 
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/myLIST
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/myLIST	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/myLIST	(revision 207)
@@ -0,0 +1,2 @@
+GREENFRAC
+TESTING2
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/namelist.ARWpost
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/namelist.ARWpost	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/namelist.ARWpost	(revision 207)
@@ -0,0 +1,108 @@
+&io
+!------------------------------------------------------------------------------------
+! do not modify
+!------------------------------------------------------------------------------------
+ io_form_input  = 2,
+ output_root_name = './input'
+ plot = 'list'
+ output_type = 'grads'          !**** the 'grads' option was modified for IDL
+ mercator_defs = .false.        !**** IDL: no need ??
+!------------------------------------------------------------------------------------
+! end do not modify
+!------------------------------------------------------------------------------------
+
+
+input_root_name = '../DATA/wrfout'
+fields = 'tk,HGT,PSFC,U,V,W,T'
+/
+
+&datetime
+ start_date = '2024-06-54_06:00:00',
+ end_date   = '2024-06-54_08:00:00',
+
+ interval_seconds = 7400,       !**** 2 Martian hours
+! interval_seconds = 14800,     !**** 4 Martian hours
+! interval_seconds = 22200,     !**** 6 Martian hours 
+! interval_seconds = 100        !**** LES :)
+/
+
+
+&interp
+ interp_method = 0
+/
+ interp_method = 1      !****Mars: if specified user levels are decreasing, these are pressure levels
+ interp_levels =
+!-4.5, 
+!-4.25,
+-4.,
+-3.75,
+-3.5, 
+-3.25,
+-3.,
+-2.75,
+-2.5, 
+-2.25,
+-2.,
+-1.75,
+-1.5, 
+-1.25,
+-1.,
+-0.75,
+-0.5,
+-0.25,
+0.,
+0.25,
+0.5,
+0.75,
+1., 
+1.25,
+1.5,
+1.75,
+2., 
+2.25,
+2.5,
+2.75,
+3., 3.5,
+4., 4.5,
+5., 5.5,
+!6., 6.5,
+!7., 7.5,
+!8., 8.5,
+!9., 9.5
+!10., 10.5,
+!11., 11.5,
+!12., 12.5,
+!13., 13.5,
+!14., 14.5,
+!15., 15.5,
+!16., 16.5,
+!17., 17.5,
+!18., 18.5,
+!19., 19.5,
+!20., 20.5,
+!21., 21.5,
+!22., 22.5,
+!23., 23.5,
+!24., 24.5,
+!25., 25.5,
+!26., 26.5,
+!27., 27.5,
+!28., 28.5
+/
+ interp_method = 1      !****Mars: if specified user levels are decreasing, these are pressure levels
+ interp_levels =  6.10, 5.35, 4.69, 4.11, 3.60, 3.16, 2.77,
+                 2.43, 2.13, 1.87, 1.64, 1.43, 1.26, 1.10,
+                 0.97, 0.85, 0.74, 0.65, 0.57, 0.50
+/
+ interp_method = 1      !****Mars: if specified user levels are decreasing, these are pressure levels
+ interp_levels = 
+		 10.0, 9.9, 9.8, 9.7, 9.6, 9.5, 9.4, 9.3, 9.2, 9.1,
+		 9.0, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1
+		 8.0, 7.9, 7.8, 7.7, 7.6, 7.5, 7.4, 7.3, 7.2, 7.1 
+		 7.0, 6.9, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1 
+		 6.0, 5.9, 5.8, 5.7, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1
+		 5.0, 4.9, 4.8, 4.7, 4.6, 4.5, 4.4, 4.3, 4.2, 4.1 
+		 4.0, 3.9, 3.8, 3.7, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1
+		 3.0, 2.9, 2.8, 2.7, 2.6, 2.5, 2.4, 2.3, 2.2, 2.1
+		 2.0, 1.9, 1.8, 1.7, 1.6, 1.5, 1.4, 1.3, 1.2, 1.1
+		 1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2 
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/namelist.ARWpost_all
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/namelist.ARWpost_all	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/namelist.ARWpost_all	(revision 207)
@@ -0,0 +1,180 @@
+&datetime
+! start_date = '2024-12-52_18:00:00',
+! end_date   = '2024-12-54_00:00:00',
+ start_date = '2024-07-18_18:00:00',
+ end_date   = '2024-07-20_00:00:00',
+! start_date = '2024-07-23_00:00:00',
+! end_date   = '2024-07-24_00:00:00',
+ start_date = '2025-01-50_06:00:00',
+ end_date   = '2025-01-50_18:00:00',
+! start_date = '2023-01-49_06:00:00',
+! end_date   = '2023-01-49_18:00:00',
+! start_date = '2024-07-15_00:30:00',
+! end_date   = '2024-07-15_00:36:00',
+! start_date = '2024-07-19_00:00:00',
+! end_date   = '2024-07-20_00:00:00',
+! start_date = '2025-01-50_00:00:00',
+! end_date   = '2025-01-51_00:00:00',
+ start_date = '2024-09-22_18:00:00',
+ end_date = '2024-09-23_06:00:00',
+ start_date = '2025-07-09_00:00:00',
+ end_date   = '2025-07-09_22:00:00',
+
+
+ interval_seconds = 14800,     !**** 6 Martian hours is 22200 seconds, 2 MH is 7400 seconds
+ interval_seconds = 7400,
+! interval_seconds = 22200,     !**** 6 Martian hours is 22200 seconds, 2 MH is 7400 seconds
+! interval_seconds = 14800,     !**** 6 Martian hours is 22200 seconds, 2 MH is 7400 seconds
+! interval_seconds = 100	!**** LES :)
+/
+
+&io
+ io_form_input  = 2,
+!------------------------------------------------------------------------------------
+! input_root_name = '/d5/aslmd/WRF_Mars/Valles_Marineris/wrfout'
+! input_root_name = '/d5/aslmd/WRF_Mars/Olympus_Mons/radt74_NH/wrfout'
+! input_root_name = '/d5/aslmd/WRF_Mars/GCM_43x33/wrfout'
+! input_root_name = '/d5/aslmd/WRF_Mars/Tharsis/wrfout'
+! input_root_name = '/d5/aslmd/WRF_Mars/Olympus_Mons/radt74_H/wrfout'
+! input_root_name = '/d5/aslmd/WRF_Mars/Elyseum_Mons2/wrfout'
+! input_root_name = '/d5/aslmd/WRF_Mars/Elyseum_Mons/wrfout'
+! input_root_name = '/d5/aslmd/WRF_Mars/Elyseum_Mons/NH/wrfout'
+! input_root_name = '/d5/aslmd/WRF_Mars/Olympus_Mons_wide/wrfout'
+! input_root_name = '/d5/aslmd/WRF_Mars/OMEGA/1_7_wrfout'
+! input_root_name = '/d5/aslmd/WRF_Mars/Valles_Marineris/phy2/1_7_wrfout'
+! input_root_name = '/d5/aslmd/WRF_Mars/Olympus_Mons/1_3_wrfout'
+!!!!!en fait il suffit de régler l'include pour se passer de niveaux et allr plsu vite 
+! input_root_name = '/d5/aslmd/WRF_Mars/LES/*day*/wrfout'
+! input_root_name = '/d5/aslmd/WRF_Mars/Elyseum_Mons/wrfout'
+! input_root_name = '/d5/aslmd/WRF_Mars/OMEGA/better_resolution/1_7_wrfout'
+ input_root_name = '/d5/aslmd/WRF_Mars/OMEGA/better_resolution_less_physics/1_7_wrfout'
+! input_root_name = '/d5/aslmd/WRF_Mars/OMEGA/lowdust/1_7_wrfout'
+input_root_name = '/d5/lmlmd/Aymeric/Hellas_coarse/wrfout'
+!------------------------------------------------------------------------------------
+! output_root_name = '/d5/aslmd/BIG_DATA/WRF/ARWpost/arwpost'	!**** symbolic links here too :)
+ output_root_name = './input'
+ plot = 'list'
+ fields = 'tk,HGT,PSFC'
+ fields = 'tk,HGT,PSFC,U,V,W'
+! fields = 'U,V,T,HGT'
+! fields = 'U,V,tk,HGT'
+! fields = 'U,V'
+! fields = 'tk,W'
+! fields = 'tk,HGT,PSFC'
+ output_type = 'grads'		!**** the 'grads' option was modified for IDL
+ mercator_defs = .false. 	!**** IDL: no need ??	
+/
+ fields = 'U,V,W,tk,HGT'
+ fields = 'tk, U, V, HGT, TSK, PSFC'
+ fields = 'HGT, PSFC, tk, pressure'
+ fields = 'U,V, HGT, tk'
+ fields = 'height,pressure,tk,umet,vmet, HGT' 
+ output_type = 'grads'
+ output_type = 'v5d'
+ fields = 'height,pressure,tk,tc'
+ fields = 'height,theta,tc,tk,td,rh,umet,vmet,pressure,dbz,max_dbz,u10m,v10m,wdir,wspd,wd10,ws10,slp,mcape,mcin,lcl,lfc,cape,cin,clfr'
+ plot = 'all'
+ plot = 'basic'       ! see gridinfo_module.F90 for a list
+ plot = 'file'        ! give a filename in "field_file"
+ plot = 'list'        ! give a list of fields in "fields", seperated with commas
+ plot = 'basic_file'
+ plot = 'basic_list'
+ plot = 'list_file'
+ plot = 'all_file'
+ plot = 'all_list'
+ fields_file = 'myLIST'
+ plot = 'basic_list_file'
+ plot = 'all_list_file'
+ 
+
+&interp
+! interp_method = 0
+!/
+! interp_method = 1      !****Mars: if specified user levels are decreasing, these are pressure levels
+! interp_levels =
+! 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.,
+! 16., 17., 18., 19., 20., 21., 22., 23., 24. 25., 26., 27., 28., 
+!! 29., 30.,
+!! 31., 32., 33., 34., 35.
+!/
+ interp_method = 1      !****Mars: if specified user levels are decreasing, these are pressure levels
+ interp_levels =
+!-4.5, 4.,
+-3.5, -3.,
+-2.5, -2.,
+-1.5, -1.,
+-0.5,
+0.,0.5,
+1., 1.5,
+2., 2.5,
+3., 3.5,
+4., 4.5,
+5., 5.5,
+6., 6.5,
+7., 7.5,
+8., 8.5,
+9., 9.5
+10., 10.5,
+11., 11.5,
+12., 12.5,
+13., 13.5,
+14., 14.5,
+15., 15.5,
+16., 16.5,
+17., 17.5,
+18., 18.5,
+!19., 19.5,
+!20., 20.5,
+!21., 21.5,
+!22., 22.5,
+!23., 23.5,
+!24., 24.5,
+!25., 25.5,
+!26., 26.5,
+!27., 27.5,
+!28., 28.5
+/
+ interp_method = 1      !****Mars: if specified user levels are decreasing, these are pressure levels
+ interp_levels =  6.10, 5.35, 4.69, 4.11, 3.60, 3.16, 2.77,
+                 2.43, 2.13, 1.87, 1.64, 1.43, 1.26, 1.10,
+                 0.97, 0.85, 0.74, 0.65, 0.57, 0.50
+/
+ interp_method = 0
+/
+ interp_method = 1      !****Mars: if specified user levels are decreasing, these are pressure levels
+ interp_levels =  6.10, 5.35, 4.69, 4.11, 3.60, 3.16, 2.77,
+    		 2.43, 2.13, 1.87, 1.64, 1.43, 1.26, 1.10,
+    		 0.97, 0.85, 0.74, 0.65, 0.57, 0.50 
+/
+ interp_method = 1      !****Mars: if specified user levels are decreasing, these are pressure levels
+ interp_levels = 
+		 10.0, 9.9, 9.8, 9.7, 9.6, 9.5, 9.4, 9.3, 9.2, 9.1,
+		 9.0, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1
+		 8.0, 7.9, 7.8, 7.7, 7.6, 7.5, 7.4, 7.3, 7.2, 7.1 
+		 7.0, 6.9, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1 
+/
+		 6.0, 5.9, 5.8, 5.7, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1
+		 5.0, 4.9, 4.8, 4.7, 4.6, 4.5, 4.4, 4.3, 4.2, 4.1 
+/
+		 4.0, 3.9, 3.8, 3.7, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1
+		 3.0, 2.9, 2.8, 2.7, 2.6, 2.5, 2.4, 2.3, 2.2, 2.1
+		 2.0, 1.9, 1.8, 1.7, 1.6, 1.5, 1.4, 1.3, 1.2, 1.1
+		 1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2 
+/
+ interp_method = -1      
+/
+ interp_method = 0
+/
+ interp_method = 1	!****Mars: if specified user levels are decreasing, these are pressure levels
+ interp_levels = 5., 3.87, 3., 2.32, 1.80, 1.39, 1.08, 0.83, 0.65, 0.50 
+/
+ interp_method = 0
+/
+ interp_method = -1,
+ interp_levels = 1000.,950.,900.,850.,800.,750.,700.,650.,600.,550.,500.,450.,400.,350.,300.,250.,200.,150.,100.,
+/
+ interp_method = 0,     ! 0 is model levels, -1 is nice height levels, 1 is user specified pressure/height
+ interp_levels = 1000.,950.,900.,850.,800.,750.,700.,650.,600.,550.,500.,450.,400.,350.,300.,250.,200.,150.,100.,
+ interp_levels = 0.25, 0.50, 0.75, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00, 8.00, 9.00, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0,
+ interp_levels = 0.994, 1.00, 1.02, 1.03, 1.058, 1.099, 1.141, 1.183, 1.208, 1.233, 1.258, 1.283, 1.308, 1.333, 1.383, 1.433, 1.483, 1.533, 1.583, 1.633, 1.683, 1.733, 1.783, 1.833, 1.883, 1.933, 1.983, 2.0, 2.5, 3.00, 3.5, 4.00, 4.5, 5.0, 7.5, 10.0, 12.5, 15.0, 20.0,
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/namelist.ARWpost_example
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/namelist.ARWpost_example	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/namelist.ARWpost_example	(revision 207)
@@ -0,0 +1,98 @@
+&io
+!------------------------------------------------------------------------------------
+! do not modify
+!------------------------------------------------------------------------------------
+ io_form_input  = 2,
+ input_root_name = './WHERE_RESULTS_ARE/wrfout'
+ output_root_name = './input'
+ plot = 'list'
+ output_type = 'grads'          !**** the 'grads' option was modified for IDL
+ mercator_defs = .false.        !**** IDL: no need ??
+!------------------------------------------------------------------------------------
+! end do not modify
+!------------------------------------------------------------------------------------
+
+
+!fields = 'tk,HGT,PSFC,U,V,W'
+!fields = 'tk,HGT,PSFC'
+!fields = 'tk,HGT,PSFC,U,V'
+!fields = 'U,V,HGT,W,tk'
+!fields = 'tk,W,HGT,PSFC'
+!fields = 'T,tk,HGT'
+!fields='QH2O,QH2O_ICE'
+!fields='QH2O,QH2O_ICE,HGT'
+fields = 'U,V,W'
+/
+
+&datetime
+ start_date = '2024-04-03_06:00:00'
+ end_date   = '2024-04-04_06:00:00',
+
+ interval_seconds = 7400,       !**** 2 Martian hours
+ interval_seconds = 14800,      !**** 4 Martian hours
+! interval_seconds = 22200,     !**** 6 Martian hours 
+! interval_seconds = 100        !**** LES :)
+/
+
+
+&interp
+! interp_method = 0
+!/
+ interp_method = 1      !****Mars: if specified user levels are decreasing, these are pressure levels
+ interp_levels =
+!-4.5, -4.,
+!-3.5, -3.,
+!-2.5, -2.,
+!-1.5, -1.,
+!-0.5,
+0., 0.5,
+1., 1.5,
+2., 2.5,
+3., 3.5,
+4., 4.5,
+5., 5.5,
+6., 6.5,
+7., 7.5,
+8., 8.5,
+9., 9.5
+10., 10.5,
+11., 11.5,
+12., 12.5,
+13., 13.5,
+14., 14.5,
+15., 15.5,
+16., 16.5,
+17., 17.5,
+18., 18.5,
+19., 19.5,
+20., 20.5,
+21., 21.5,
+22., 22.5,
+23., 23.5,
+24., 24.5,
+25., 25.5,
+26., 26.5,
+27., 27.5,
+28., 28.5,
+29., 29.5,
+30., 30.5,
+31., 31.5,
+32.
+/
+ interp_method = 1      !****Mars: if specified user levels are decreasing, these are pressure levels
+ interp_levels =  6.10, 5.35, 4.69, 4.11, 3.60, 3.16, 2.77,
+                 2.43, 2.13, 1.87, 1.64, 1.43, 1.26, 1.10,
+                 0.97, 0.85, 0.74, 0.65, 0.57, 0.50
+/
+ interp_method = 1      !****Mars: if specified user levels are decreasing, these are pressure levels
+ interp_levels = 
+		 10.0, 9.9, 9.8, 9.7, 9.6, 9.5, 9.4, 9.3, 9.2, 9.1,
+		 9.0, 8.9, 8.8, 8.7, 8.6, 8.5, 8.4, 8.3, 8.2, 8.1
+		 8.0, 7.9, 7.8, 7.7, 7.6, 7.5, 7.4, 7.3, 7.2, 7.1 
+		 7.0, 6.9, 6.8, 6.7, 6.6, 6.5, 6.4, 6.3, 6.2, 6.1 
+		 6.0, 5.9, 5.8, 5.7, 5.6, 5.5, 5.4, 5.3, 5.2, 5.1
+		 5.0, 4.9, 4.8, 4.7, 4.6, 4.5, 4.4, 4.3, 4.2, 4.1 
+		 4.0, 3.9, 3.8, 3.7, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1
+		 3.0, 2.9, 2.8, 2.7, 2.6, 2.5, 2.4, 2.3, 2.2, 2.1
+		 2.0, 1.9, 1.8, 1.7, 1.6, 1.5, 1.4, 1.3, 1.2, 1.1
+		 1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2 
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/report.comments
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/report.comments	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/report.comments	(revision 207)
@@ -0,0 +1,2 @@
+map
+map
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/bwave.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/bwave.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/bwave.gs	(revision 207)
@@ -0,0 +1,137 @@
+'reinit'
+'open bwave.ctl'
+** 
+** script needs height level input data
+** will look for .25 and 2 km data to plot
+
+'set display color white'
+'run rgbset.gs'
+
+say 'Create gif images as well (1=yes ; 0=no)'
+pull ans
+frame = 1
+
+'q file'
+rec=sublin(result,5)
+_endtime=subwrd(rec,12)
+_endlev=subwrd(rec,9)
+
+runscript = 1
+dis_t = 11
+
+'set xlab off'
+'set ylab off'
+
+while(runscript)
+dis_z = 1
+'set t ' dis_t
+'q dims'
+rec=sublin(result,5)
+_analysis=subwrd(rec,6)
+say 'Time is ' _analysis
+
+runlevel = 1
+while(runlevel)
+'set z ' dis_z
+'q dims'
+rec=sublin(result,4)
+newz=subwrd(rec,6)
+say 'Level is ' newz
+
+** Looking for 0.25 km data
+if (newz=0.25)
+say 'Plotting'
+'c'
+'set grads off'
+'set gxout shaded'
+'d theta'
+'set gxout contour'
+'d p'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.0 8.35   Pressure (mb,lines), Theta (color)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 4.0 8.0 ' newz '  km '
+'run cbar.gs'
+if(ans)
+'printim bwave'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+'c'
+'set grads off'
+'set gxout shaded'
+'set clevs   -6 -5 -4 -3 -2 -1  0  1  2  3  4  5  6  7  8  9 10 '
+'set ccols 0 54 55 56 58 59 4  49 39 37 35 21 22 23 24 67 68 69 '
+'d w*100.'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 5.0.7 8.35   W (cm/s)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 4.0 8.0 ' newz '  km '
+'run cbar.gs'
+if(ans)
+'printim bwave'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+endif
+** Looking for 2 km data
+if (newz=2.0)
+say 'Plotting'
+'c'
+'set grads off'
+'set gxout shaded'
+'d theta'
+'set gxout contour'
+'d p'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.0 8.35   Pressure (mb,lines), Theta (color)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 4.0 8.0 ' newz '  km '
+'run cbar.gs'
+if(ans)
+'printim bwave'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+'c'
+'set grads off'
+'set gxout shaded'
+'set clevs   -6 -5 -4 -3 -2 -1  0  1  2  3  4  5  6  7  8  9 10 '
+'set ccols 0 54 55 56 58 59 4  49 39 37 35 21 22 23 24 67 68 69 '
+'d w*100.'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 5.0 8.35   W (cm/s)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 4.0 8.0 ' newz '  km '
+'run cbar.gs'
+if(ans)
+'printim bwave'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+endif
+
+if ( dis_z=_endlev )
+ runlevel=0
+endif
+dis_z = dis_z + 1
+endwhile
+
+if ( dis_t=_endtime )
+ runscript=0
+endif 
+dis_t = dis_t + 1
+endwhile
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/cbar.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/cbar.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/cbar.gs	(revision 207)
@@ -0,0 +1,242 @@
+*
+*  Script to plot a colorbar
+*
+*  The script will assume a colorbar is wanted even if there is
+*  not room -- it will plot on the side or the bottom if there is
+*  room in either place, otherwise it will plot along the bottom and
+*  overlay labels there if any.  This can be dealt with via
+*  the 'set parea' command.  In version 2 the default parea will
+*  be changed, but we want to guarantee upward compatibility in
+*  sub-releases.
+*
+*
+*       modifications by mike fiorino 940614
+*
+*       - the extreme colors are plotted as triangles
+*       - the colors are boxed in white
+*       - input arguments in during a run execution:
+*
+*       run cbarn sf vert xmid ymid
+*
+*       sf   - scale the whole bar 1.0 = original 0.5 half the size, etc.
+*       vert - 0 FORCES a horizontal bar = 1 a vertical bar
+*       xmid - the x position on the virtual page the center the bar
+*       ymid - the x position on the virtual page the center the bar
+*
+*       if vert,xmid,ymid are not specified, they are selected
+*       as in the original algorithm
+*
+
+function colorbar (args)
+
+sf=subwrd(args,1)
+vert=subwrd(args,2)
+xmid=subwrd(args,3)
+ymid=subwrd(args,4)
+
+if(sf='');sf=1.0;endif
+
+*
+*  Check shading information
+*
+  'query shades'
+  shdinfo = result
+  if (subwrd(shdinfo,1)='None')
+    say 'Cannot plot color bar: No shading information'
+    return
+  endif
+
+*
+*  Get plot size info
+*
+  'query gxinfo'
+  rec2 = sublin(result,2)
+  rec3 = sublin(result,3)
+  rec4 = sublin(result,4)
+  xsiz = subwrd(rec2,4)
+  ysiz = subwrd(rec2,6)
+  ylo = subwrd(rec4,4)
+  xhi = subwrd(rec3,6)
+  xd = xsiz - xhi
+
+  ylolim=0.6*sf
+  xdlim1=1.0*sf
+  xdlim2=1.5*sf
+  barsf=0.8*sf
+  yoffset=0.2*sf
+  stroff=0.05*sf
+  strxsiz=0.08*sf
+  strysiz=0.10*sf
+*
+*  Decide if horizontal or vertical color bar
+*  and set up constants.
+*
+  if (ylo<ylolim & xd<xdlim1)
+    say "Not enough room in plot for a colorbar"
+    return
+  endif
+  cnum = subwrd(shdinfo,5)
+*
+*       logic for setting the bar orientation with user overides
+*
+  if (ylo<ylolim | xd>xdlim1)
+    vchk = 1
+    if(vert = 0) ; vchk = 0 ; endif
+  else
+    vchk = 0
+    if(vert = 1) ; vchk = 1 ; endif
+  endif
+*
+*       vertical bar
+*
+
+  if (vchk = 1 )
+
+    if(xmid = '') ; xmid = xhi+xd/2 ; endif
+    xwid = 0.2*sf
+    ywid = 0.5*sf
+
+    xl = xmid-xwid/2
+    xr = xl + xwid
+    if (ywid*cnum > ysiz*barsf)
+      ywid = ysiz*barsf/cnum
+    endif
+    if(ymid = '') ; ymid = ysiz/2 ; endif
+    yb = ymid - ywid*cnum/2
+    'set string 1 l 3'
+    vert = 1
+
+  else
+
+*
+*       horizontal bar
+*
+
+    ywid = 0.4
+    xwid = 0.8
+
+    if(ymid = '') ; ymid = ylo/2-ywid/2 ; endif
+    yt = ymid + yoffset
+    yb = ymid
+    if(xmid = '') ; xmid = xsiz/2 ; endif
+    if (xwid*cnum > xsiz*barsf)
+      xwid = xsiz*barsf/cnum
+    endif
+    xl = xmid - xwid*cnum/2
+    'set string 1 tc 3'
+    vert = 0
+  endif
+
+
+*
+*  Plot colorbar
+*
+
+
+  'set strsiz 'strxsiz' 'strysiz
+  num = 0
+  while (num<cnum)
+    rec = sublin(shdinfo,num+2)
+    col = subwrd(rec,1)
+    hi = subwrd(rec,3)
+    if (vert)
+      yt = yb + ywid
+    else
+      xr = xl + xwid
+    endif
+
+    if(num!=0 & num!= cnum-1)
+    'set line 1 1 10'
+    'draw rec 'xl' 'yb' 'xr' 'yt
+    'set line 'col
+    'draw recf 'xl' 'yb' 'xr' 'yt
+    if (num<cnum-1)
+      if (vert)
+        xp=xr+stroff
+        'draw string 'xp' 'yt' 'hi
+      else
+        yp=yb-stroff
+        'draw string 'xr' 'yp' 'hi
+      endif
+    endif
+    endif
+
+    if(num = 0 )
+
+      if(vert = 1)
+
+        xm=(xl+xr)*0.5
+        'set line 1 1 10'
+        'draw line 'xl' 'yt' 'xm' 'yb
+        'draw line 'xm' 'yb' 'xr' 'yt
+        'draw line 'xr' 'yt' 'xl' 'yt
+
+        'set line 'col
+        'draw polyf 'xl' 'yt' 'xm' 'yb' 'xr' 'yt' 'xl' 'yt
+
+      else
+
+        ym=(yb+yt)*0.5
+        'set line 1 1 10'
+        'draw line 'xl' 'ym' 'xr' 'yb
+        'draw line 'xr' 'yb' 'xr' 'yt
+        'draw line 'xr' 'yt' 'xl' 'ym
+
+        'set line 'col
+       'draw polyf 'xl' 'ym' 'xr' 'yb' 'xr' 'yt' 'xl' 'ym
+
+      endif
+
+    endif
+
+    if (num<cnum-1)
+      if (vert)
+         xp=xr+stroff
+        'draw string 'xp' 'yt' 'hi
+      else
+         yp=yb-stroff
+        'draw string 'xr' 'yp' 'hi
+      endif
+    endif
+
+    if(num = cnum-1 )
+
+      if( vert = 1)
+        'set line 1 1 10'
+        'draw line 'xl' 'yb' 'xm' 'yt
+        'draw line 'xm' 'yt' 'xr' 'yb
+        'draw line 'xr' 'yb' 'xl' 'yb
+
+        'set line 'col
+        'draw polyf 'xl' 'yb' 'xm' 'yt' 'xr' 'yb' 'xl' 'yb
+      else
+
+        'set line 1 1 10'
+        'draw line 'xr' 'ym' 'xl' 'yb
+        'draw line 'xl' 'yb' 'xl' 'yt
+        'draw line 'xl' 'yt' 'xr' 'ym
+
+        'set line 'col
+        'draw polyf 'xr' 'ym' 'xl' 'yb' 'xl' 'yt' 'xr' 'ym
+
+
+      endif
+
+    endif
+
+    if (num<cnum-1)
+      if (vert)
+        xp=xr+stroff
+        'draw string 'xp' 'yt' 'hi
+      else
+        yp=yb-stroff
+       'draw string 'xr' 'yp' 'hi
+      endif
+    endif
+
+    num = num + 1
+    if (vert); yb = yt;
+    else; xl = xr; endif;
+  endwhile
+return
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/cross_z.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/cross_z.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/cross_z.gs	(revision 207)
@@ -0,0 +1,117 @@
+'reinit'
+'open real_z.ctl'
+
+** script needs z level data as input
+** will create cross sections NS ; EW, in middle of domain
+
+'set mpdset hires'
+'set display color white'
+'run rgbset.gs'
+
+say 'Create gif images as well (1=yes ; 0=no)'
+pull ans
+frame = 1
+
+'q file'
+rec=sublin(result,5)
+_endtime=subwrd(rec,12)
+num_x=subwrd(rec,3)
+num_y=subwrd(rec,6)
+num_z=subwrd(rec,9)
+
+dis_x=num_x/2
+dis_y=num_y/2
+
+runscript = 1
+dis_t = 1
+'set z 1 ' num_z
+'set y ' dis_y
+
+** DO EW cross section
+while(runscript)
+say 'Plotting EW cross section'
+'set t ' dis_t
+'q dims'
+rec=sublin(result,5)
+_analysis=subwrd(rec,6)
+say 'Time is ' _analysis
+
+'c'
+'set grads off'
+'set gxout shaded'
+'set clevs 10 20 30 40 50 60 70 80 90 100'        
+'set ccols 0 0 0  0 33 34 35 36 37 38  39'
+'d rh'
+'set gxout contour'
+'set ccolor 1'
+'set cthick 2'
+'set cint 5'
+'d tc'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 2.7 8.35   E-W  Relative Humidity and T(C)'          
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 8.4 8.2 ' _analysis
+'draw string 1.5 8.2 y=' dis_y
+'run cbar.gs'
+if(ans)
+'printim crossEW'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+
+if ( dis_t=_endtime )
+ runscript=0
+endif 
+dis_t = dis_t + 1
+endwhile
+
+'reset'
+
+runscript = 1
+dis_t = 1
+'set z 1 ' num_z
+'set x ' dis_x
+
+
+** DO NS cross section
+say 'Plotting NS cross section'
+while(runscript)
+'set t ' dis_t
+'q dims'
+rec=sublin(result,5)
+_analysis=subwrd(rec,6)
+say 'Time is ' _analysis
+
+'c'
+'set grads off'
+'set gxout shaded'
+'set clevs 10 20 30 40 50 60 70 80 90 100'        
+'set ccols 0 0 0  0 33 34 35 36 37 38  39'
+'d rh'
+'set gxout contour'
+'set ccolor 1'
+'set cthick 2'
+'set cint 5'
+'d tc'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 2.7 8.35   N-S  Relative Humidity and T(C)'          
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 8.4 8.2 ' _analysis
+'draw string 1.5 8.2 x=' dis_x
+'run cbar.gs'
+if(ans)
+'printim crossNS'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+
+if ( dis_t=_endtime )
+ runscript=0
+endif 
+dis_t = dis_t + 1
+endwhile
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/grav2d.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/grav2d.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/grav2d.gs	(revision 207)
@@ -0,0 +1,74 @@
+'reinit'
+'open grav2d.ctl'
+
+** need normal model level data
+
+'set display color white'
+'run rgbset.gs'
+
+say 'Create gif images as well (1=yes ; 0=no)'
+pull ans
+frame = 1
+
+'q file'
+rec=sublin(result,5)
+_endtime=subwrd(rec,12)
+
+runscript = 1
+dis_t = 1
+
+'set xlab off'
+'set ylab off'
+'set z 1 35 '
+
+while(runscript)
+
+'set t ' dis_t
+'q dims'
+rec=sublin(result,5)
+_analysis=subwrd(rec,6)
+
+say 'Time is ' _analysis
+'c'
+'set grads off'
+'set gxout shaded'
+'d theta'
+'set gxout contour'
+'d u'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.0 8.35   Theta (color), u(m/s)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 8.5 8.1 ' _analysis
+'run cbar.gs'
+if(ans)
+'printim grav2d'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+'c'
+'set grads off'
+'set gxout shaded'
+'d theta'
+'set gxout contour'
+'d w'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.0.7 8.35   Theta (color), w (m/s)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 8.5 8.1 ' _analysis
+'run cbar.gs'
+if(ans)
+'printim grav2d'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+if ( dis_t=_endtime )
+ runscript=0
+endif 
+dis_t = dis_t + 1
+
+endwhile
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/hill2d.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/hill2d.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/hill2d.gs	(revision 207)
@@ -0,0 +1,74 @@
+'reinit'
+'open hill2d.ctl'
+
+** need normal model level data
+
+'set display color white'
+'run rgbset.gs'
+
+say 'Create gif images as well (1=yes ; 0=no)'
+pull ans
+frame = 1
+
+'q file'
+rec=sublin(result,5)
+_endtime=subwrd(rec,12)
+
+runscript = 1
+dis_t = 19
+
+'set xlab off'
+'set ylab off'
+'set z 1 35 '
+
+while(runscript)
+
+'set t ' dis_t
+'q dims'
+rec=sublin(result,5)
+_analysis=subwrd(rec,6)
+
+say 'Time is ' _analysis
+'c'
+'set grads off'
+'set gxout shaded'
+'d theta'
+'set gxout contour'
+'d u'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.0 8.35   Theta (color), u(m/s)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 8.5 8.1 ' _analysis
+'run cbar.gs'
+if(ans)
+'printim hill2d'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+'c'
+'set grads off'
+'set gxout shaded'
+'d theta'
+'set gxout contour'
+'d w'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.0.7 8.35   Theta (color), w (m/s)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 8.5 8.1 ' _analysis
+'run cbar.gs'
+if(ans)
+'printim hill2d'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+dis_t = dis_t + 6
+if ( dis_t>_endtime )
+ runscript=0
+endif 
+
+endwhile
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/input.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/input.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/input.gs	(revision 207)
@@ -0,0 +1,181 @@
+'reinit'
+'open input.ctl'
+
+** need input data on height levels
+
+'set mpdset hires'
+'set display color white'
+'run rgbset.gs'
+
+say 'Create gif images as well (1=yes ; 0=no)'
+pull ans
+frame = 1
+
+'q file'
+rec=sublin(result,5)
+_endtime=subwrd(rec,12)
+
+runscript = 1
+dis_t = 1
+
+while(runscript)
+'set t ' dis_t
+'q dims'
+rec=sublin(result,5)
+_analysis=subwrd(rec,6)
+say 'Time is ' _analysis
+
+** Do 2D fields first
+'c'
+'set grads off'
+'set gxout contour'
+'set ccolor 1'
+'set cint 5'
+'d (mu+mub)/100.'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.9 8.35  MU'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 1.5 8.0 WRF MASS INPUT'
+if(ans)
+'printim input'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+
+'c'
+'set grads off'
+'set gxout shaded'
+'d tsk'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 3.7 8.35  Surface Theta (K,color)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 1.5 8.0 WRF MASS INPUT'
+'run cbar.gs'
+if(ans)
+'printim input'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+
+'c'
+'set grads off'
+'set gxout contour'
+'set ccolor 1'
+'set cint 50'
+'d hgt'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.2 8.35  TERRAIN (m)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 1.5 8.0 WRF MASS INPUT'
+if(ans)
+'printim input'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+
+'c'
+'set grads off'
+'set gxout grfill'
+'set clevs       1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17'
+'set ccols   0  56 57 58 59 49 47 45 39 37 36 34 22 23 24 29 25 27 27'
+'d lu_index'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 3.7 8.35  LANDUSE (category)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 1.5 8.0 WRF MASS INPUT'
+'run cbar.gs'
+if(ans)
+'printim input'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+
+'c'
+'set grads off'
+'set gxout grfill'
+'set clevs       1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17'
+'set ccols   0  56 57 58 59 49 47 45 39 37 36 34 22 23 24 29 25 27 27'
+'d isltyp'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 3.7 8.35  SOIL (category)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 1.5 8.0 WRF MASS INPUT'
+'run cbar.gs'
+if(ans)
+'printim input'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+
+'c'
+'set grads off'
+'set gxout grfill'
+'set clevs       0 10 20 30 40 50 60 70 80 90 '
+'set ccols   0  59 49 45 39 22 29 27 62 62 '
+'d vegfra'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 3.7 8.35  Vegatation Fraction '
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 1.5 8.0 WRF MASS INPUT'
+'run cbar.gs'
+if(ans)
+'printim input'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+
+** Plot soil temperature
+runlevel = 1
+dis_z = 1
+while(runlevel)
+'set z ' dis_z
+
+'c'
+'set grads off'
+'set gxout contour'
+'set ccolor 1'
+'set cint 1'
+'d tslb'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 3.2 8.35  Soil Temperature at soil level ' dis_z
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 1.5 8.0 WRF MASS INPUT'
+if(ans)
+'printim input'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+
+if ( dis_z=5 )
+ runlevel=0
+endif
+dis_z = dis_z + 1
+endwhile
+
+if ( dis_t=_endtime )
+ runscript=0
+endif 
+dis_t = dis_t + 1
+endwhile
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/plevels.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/plevels.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/plevels.gs	(revision 207)
@@ -0,0 +1,157 @@
+'reinit'
+'open real_p.ctl'
+
+** Need input data on p levels
+
+'set mpdset hires'
+'set display color white'
+'run rgbset.gs'
+
+say 'Create gif images as well (1=yes ; 0=no)'
+pull ans
+frame = 1
+
+'q file'
+rec=sublin(result,5)
+_endtime=subwrd(rec,12)
+_endlev=subwrd(rec,9)
+
+runscript = 1
+dis_t = 1
+
+while(runscript)
+dis_z = 1
+'set t ' dis_t
+'q dims'
+rec=sublin(result,5)
+_analysis=subwrd(rec,6)
+say 'Time is ' _analysis
+
+runlevel = 1
+while(runlevel)
+'set z ' dis_z
+'q dims'
+rec=sublin(result,4)
+newz=subwrd(rec,6)
+say 'Level is ' newz
+
+** Looking for 850 mb  data
+if (newz=850)
+say 'Plotting'
+'c'
+'set grads off'
+'set gxout shaded'
+'set clevs 10 20 30 40 50 60 70 80 90 100'        
+'set ccols 0 0 0  0 33 34 35 36 37 38  39'
+'d rh'
+'set gxout contour'
+'set ccolor 4'
+'set cthick 6'
+'set cint 20'
+'d z'
+'set ccolor 2'
+'set cthick 6'
+'set cint 5'
+'d tc'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 1.7 8.35 ' newz ' mb Height (m,blue), T(C,red), RH(color)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'run cbar.gs'
+if(ans)
+'printim realp'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+endif
+
+** Looking for 700 mb  data
+if (newz=700)
+say 'Plotting'
+'c'
+'set ccolor 4'
+'set cthick 6'
+'set cint 20'
+'d z'
+'set ccolor 2'
+'set cthick 6'
+'set cint 5'
+'d tc'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 2.7 8.35 ' newz ' mb Height (m,blue), T(C,red)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+if(ans)
+'printim realp'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+endif
+
+** Looking for 500 mb  data
+if (newz=500)
+'c'
+'set z 11'
+'set ccolor 4'
+'set cthick 6'
+'set cint 40'
+'d z'
+'set ccolor 2'
+'set cthick 6'
+'set cint 5'
+'d tc'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 2.7 8.35 ' newz ' mb Height (m,blue), T(C,red)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+if(ans)
+'printim realp'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+endif
+
+** Looking for 300 mb  data
+if (newz=300)
+'c'
+'set z 15'
+'define wspd=(sqrt(u*u + v*v))'
+'set ccolor 4'
+'set cthick 6'
+'set cint 40'
+'d z'
+'set ccolor 3'
+'set cthick 6'
+'set cint 10'
+'d wspd'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 1.7 8.35 ' newz ' mb Height (m,blue), Wind Speed(m/sec,green)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+if(ans)
+'printim realp'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+endif
+
+if ( dis_z=_endlev )
+ runlevel=0
+endif
+dis_z = dis_z + 1
+endwhile
+
+if ( dis_t=_endtime )
+ runscript=0
+endif 
+dis_t = dis_t + 1
+endwhile
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/plot_all.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/plot_all.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/plot_all.gs	(revision 207)
@@ -0,0 +1,70 @@
+'reinit'
+'open ofs.ctl'
+
+print_gif = 0 
+
+'set display color white'
+'set grads off'
+'clear'
+'set mpdset hires'
+'set gxout shaded'
+
+'q file'
+rec=sublin(result,6)
+_endfieldnr=subwrd(rec,5) + 6
+
+'q ctlinfo'
+rec=sublin(result,11)
+_t=subwrd(rec,2)
+
+
+***** Loop through time staring from t
+t = 0
+while ( t < _t )
+  t = t + 1
+  'set t 't
+  fieldnr = 7
+  
+***** PLOT ALL THE FIELDS    
+  while ( fieldnr < _endfieldnr )
+    'clear'
+    'q file'
+    rec=sublin(result,fieldnr)
+    say rec
+    field=subwrd(rec,1)
+    _levs=subwrd(rec,2)
+  
+    current_lev = 0
+    if ( _levs = 0 ) 
+      'clear'
+      'd ' field
+      'run cbar'
+      'draw title ' rec 
+
+      if (print_gif = 1) 
+        'printim 'field'.gif gif'
+      else
+        pull dummy
+      endif
+    else
+    while ( current_lev < _levs )
+      'clear'
+      current_lev = current_lev + 1
+      'set z 'current_lev
+      'd ' field
+      'run cbar'
+      'draw title ' rec ' - lev ' current_lev
+
+      if (print_gif = 1) 
+        'printim 'field'_'current_lev'.gif gif'
+      else
+        pull dummy
+      endif
+    endwhile
+    endif
+
+  
+    fieldnr = fieldnr + 1
+  endwhile
+
+endwhile
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/qss.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/qss.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/qss.gs	(revision 207)
@@ -0,0 +1,159 @@
+'reinit'
+'open qss.ctl'
+
+** script needs height level input data
+** will look for .75 , 1.5. 4 and 8 km data to plot
+
+'set display color white'
+'set xlab off'
+'set ylab off'
+'run rgbset.gs'
+
+
+say 'Create gif images as well (1=yes ; 0=no)'
+pull ans
+frame = 1
+
+'q file'
+rec=sublin(result,5)
+_endtime=subwrd(rec,12)
+_endlev=subwrd(rec,9)
+
+runscript = 1
+dis_t = 2
+
+while(runscript)
+dis_z = 1
+'set t ' dis_t
+'q dims'
+rec=sublin(result,5)
+_analysis=subwrd(rec,6)
+say 'Time is ' _analysis
+
+runlevel = 1
+while(runlevel)
+'set z ' dis_z
+'q dims'
+rec=sublin(result,4)
+newz=subwrd(rec,6)
+say 'Level is ' newz
+
+found_level = 0
+** Looking for right level to plot
+if (newz=0.75)
+ found_level=1
+endif
+if (newz=1.5)
+ found_level=1
+endif
+if (newz=4.0)
+ found_level=1
+endif
+if (newz=8.0)
+ found_level=1
+endif
+if (found_level)
+say 'Plotting'
+'c'
+'set grads off'
+'set gxout shaded'
+'d theta'
+'set gxout contour'
+'d p'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 2.7 8.35   pressure (mb,lines), Theta (color)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 6.5 8.0 ' _analysis
+'draw string 2.5 8.0 ' newz ' km'
+'run cbar.gs'
+if(ans)
+'printim qss'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+'c'
+'set grads off'
+'set gxout shaded'
+'d w'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.7 8.35   W (color)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 6.5 8.0 ' _analysis
+'draw string 2.5 8.0 ' newz ' km'
+'run cbar.gs'
+if(ans)
+'printim qss'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+'c'
+'set grads off'
+'set gxout shaded'
+'d qvapor*1000.0'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.2 8.35   QVAPOR (color)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 6.5 8.0 ' _analysis
+'draw string 2.5 8.0 ' newz ' km'
+'run cbar.gs'
+if(ans)
+'printim qss'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+'c'
+'set grads off'
+'set gxout shaded'
+'d qcloud*1000.0'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.2.7 8.35   QCLOUD (color)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 6.5 8.0 ' _analysis
+'draw string 2.5 8.0 ' newz ' km'
+'run cbar.gs'
+if(ans)
+'printim qss'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+'c'
+'set grads off'
+'set gxout shaded'
+'d qrain*1000.0'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.2.7 8.35   QRAIN (color)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 6.5 8.0 ' _analysis
+'draw string 2.5 8.0 ' newz ' km'
+'run cbar.gs'
+pull dummy
+if(ans)
+'printim qss'frame'.gif gif '
+frame=frame+1
+endif
+endif
+
+if ( dis_z=_endlev )
+ runlevel=0
+endif
+dis_z = dis_z + 1
+endwhile
+
+
+dis_t = dis_t + 2
+if ( dis_t>_endtime )
+ runscript=0
+endif 
+
+endwhile
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/rain.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/rain.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/rain.gs	(revision 207)
@@ -0,0 +1,55 @@
+'reinit'
+'open real_p.ctl'
+
+** Need a real dataset that contain rainc and rainnc
+
+'set mpdset hires'
+'set display color white'
+'run rgbset.gs'
+
+
+say 'Create gif images as well (1=yes ; 0=no)'
+pull ans
+frame = 1
+
+'q file'
+rec=sublin(result,5)
+_endtime=subwrd(rec,12)
+
+runscript = 1
+dis_t = 1
+
+while(runscript)
+
+'set t ' dis_t
+'q dims'
+rec=sublin(result,5)
+_analysis=subwrd(rec,6)
+say 'Time is ' _analysis
+
+'c'
+'set grads off'
+'set gxout shaded'
+'set clevs .1 .2 .4 .8 1.6 3.2 6.4 12.8 25.6 51.6 '
+'set ccols 0  33 34 35 36 37 38 39 7 8 2'
+'d rainc+rainnc'
+*'draw title Total Precip (color,mm)'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 3.2 8.35 Total Precip (color,mm)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'run cbar.gs'
+if(ans)
+'printim raintotal'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+
+if ( dis_t=_endtime )
+ runscript=0
+endif 
+dis_t = dis_t + 1
+endwhile
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/real_surf.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/real_surf.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/real_surf.gs	(revision 207)
@@ -0,0 +1,60 @@
+'reinit'
+'open real_cart.ctl'
+
+** need input data on model levels
+
+'set mpdset hires'
+'set display color white'
+'run rgbset.gs'
+
+say 'Create gif images as well (1=yes ; 0=no)'
+pull ans
+frame = 1
+
+'q file'
+rec=sublin(result,5)
+_endtime=subwrd(rec,12)
+
+runscript = 1
+dis_t = 1
+
+while(runscript)
+'set t ' dis_t
+'q dims'
+rec=sublin(result,5)
+_analysis=subwrd(rec,6)
+say 'Time is ' _analysis
+
+'define tf=(40+tc)*9/5-40'   
+
+'c'
+'set grads off'
+'set gxout shaded'
+'set clevs -20 -15 -10 -5  0  5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80'
+'set ccols   0  51  53 55 57 58 59 49 47 45 39 37 36 34 22 23 24 25 27 29 29'
+'set z 1'
+'d tf'
+'set gxout contour'
+'set ccolor 1'
+'set cthick 7'
+'set cint 4'
+'d slvl'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 2.7 8.35 Surfcae T (F, color), SLP (mb)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'run cbar.gs'
+if(ans)
+'printim surface'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+
+if ( dis_t=_endtime )
+ runscript=0
+endif 
+dis_t = dis_t + 1
+endwhile
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/rgbset.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/rgbset.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/rgbset.gs	(revision 207)
@@ -0,0 +1,67 @@
+*light yellow to dark red
+'set rgb 21 255 250 170'
+'set rgb 22 255 232 120'
+'set rgb 23 255 192  60'
+'set rgb 24 255 160   0'
+'set rgb 25 255  96   0'
+'set rgb 26 255  50   0'
+'set rgb 27 225  20   0'
+'set rgb 28 192   0   0'
+'set rgb 29 165   0   0'
+*
+*light green to dark green
+'set rgb 31 230 255 225'
+'set rgb 32 200 255 190'
+'set rgb 33 180 250 170'
+'set rgb 34 150 245 140'
+'set rgb 35 120 245 115'
+'set rgb 36  80 240  80'
+'set rgb 37  55 210  60'
+'set rgb 38  30 180  30'
+'set rgb 39  15 160  15'
+*set rgb 39   5 150   5
+*
+*light blue to dark blue
+'set rgb 41 225 255 255'
+'set rgb 42 180 240 250'
+'set rgb 43 150 210 250'
+'set rgb 44 120 185 250'
+'set rgb 45  80 165 245'
+'set rgb 46  60 150 245'
+'set rgb 47  40 130 240'
+'set rgb 48  30 110 235'
+'set rgb 49  20 100 210'
+*
+*light purple to dark purple
+'set rgb 51 220 220 255'
+'set rgb 52 192 180 255'
+'set rgb 53 160 140 255'
+'set rgb 54 128 112 235'
+'set rgb 55 112  96 220'   
+'set rgb 56  72  60 200'   
+'set rgb 57  60  40 180'
+'set rgb 58  45  30 165'
+'set rgb 59  40   0 160'
+*
+*light pink to dark rose  
+'set rgb 61 255 230 230'
+'set rgb 62 255 200 200'
+'set rgb 63 248 160 160'
+'set rgb 64 230 140 140'
+'set rgb 65 230 112 112'
+'set rgb 66 230  80  80'   
+'set rgb 67 200  60  60'   
+'set rgb 68 180  40  40'
+'set rgb 69 164  32  32'
+*
+*light beige to dark brown   
+'set rgb 71 250 240 230'
+'set rgb 72 240 220 210'
+'set rgb 73 225 190 180'
+'set rgb 74 200 160 150'
+'set rgb 75 180 140 130'   
+'set rgb 76 160 120 110'  
+'set rgb 77 140 100  90'
+'set rgb 78 120  80  70'
+'set rgb 79 100  60  50'
+*
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/skew.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/skew.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/skew.gs	(revision 207)
@@ -0,0 +1,2593 @@
+'reinit'
+'open foo.ctl'
+
+'set t 1'
+'q dims'
+rec=sublin(result,5)
+_analysis=subwrd(rec,6)
+say 'Initial Time is ' _analysis
+
+say 'Create gif images as well (1=yes ; 0=no)'
+pull ans
+frame = 1
+
+'q file'
+rec=sublin(result,5)
+_endtime=subwrd(rec,12)
+'q dims'
+rec=sublin(result,2)
+_alon1=subwrd(rec,6)
+_alon2=subwrd(rec,8)
+rec=sublin(result,3)
+_alat1=subwrd(rec,6)
+_alat2=subwrd(rec,8)
+
+BigRun = 1
+while (BigRun)
+
+  irun = 1
+
+* loc ( 38.58, -77.0 )
+  say 'Please enter coordinated for sounding'         
+  say ' '
+
+  say 'Latitude values between: ' _alat1 ' and ' _alat2
+  say 'Enter Latitude'
+  pull lat1
+  say ' '
+  say 'Longitude values between: ' _alon1 ' and ' _alon2
+  say 'Enter Longitude'
+  pull lon1
+
+  say ' '
+  say 'Overlay two time periods 1=yes ; 0=no'
+  pull olans
+  overlay = 1
+
+  while(irun)
+    say ' '
+    say 'Please enter time to plot'             
+    say 'Available times: 1 to ' _endtime              
+    pull ans
+    'set t 'ans
+    'set lon 'lon1 
+    'set lat 'lat1
+    'set lev 1000 100'
+    'define wspd=(sqrt(u*u + v*v))*1.89'
+    'define dir=(atan2(u,v))*57.2957795+180.0'
+    if (overlay = 1)
+      SCol = 1
+      HCol = 5
+      BCol = -1
+    endif
+    if (overlay = 2)
+      SCol = 3
+      HCol = 11
+      BCol = 1
+    endif
+
+    rc=plotskew(tc,td,wspd,dir,0,SCol,SCol,SCol,HCol,overlay,BCol)
+
+    if (olans)
+      overlay = 2
+      olans = 0
+    else
+      irun = 0
+    endif
+
+  endwhile
+
+  if(ans)
+  'printim skew'frame'.gif gif'
+  frame=frame+1
+  endif
+
+  say '  '
+  say 'Continue with another sounding 1=yes ; 0=no'
+  pull BigRun
+
+  'reset'
+
+endwhile
+
+
+*************************************************************************
+function plotskew(sndtemp,snddewp,sndspd,snddir,ClrScrn,TSndCol,DSndCol,PrclCol,RHCol,OL,BarbCol)
+*************************************************************************
+*
+* GrADS Script to Plot a SkewT/LogP Diagram      
+*
+* Bob Hart 
+* Penn State University / Dept of Meteorology
+* Last Update:  November 10, 1999
+*
+* Recent Changes:
+*
+* 11/10/99 - Change in calculation method for CAPE/CIN.  Trapezoid 
+*            integration method is now used.  Speeds up execution
+*            by 25%, and increases accuracy by 5-10%.
+*
+* 10/18/99 - Minor glitch fixed that occasionally caused crash.
+*
+*  8/26/99 - Datasets with missing data can now be used.
+*
+* Features:
+*   - All features of standard skewt/logp plot
+*   - RH sounding 
+*   - LCL location
+*   - Parcel trajectory for both sfc based convection and elevated from
+*     most unstable level (highest theta-e level reported)
+*   - Stability indices and precipitable water calculations
+*   - CAPE & CIN Calculations
+*   - Wind Profile
+*   - Hodograph / Hodograph scaling
+*   - Helicity and SR Helicity Calculations and Display
+*   - Color aspects of output
+*   - Line Thickness, style aspects of output
+*   - Can be run in either PORTRAIT or LANDSCAPE mode.
+*
+* There are numerous tunable parameters below to change the structure
+* and output for the diagram.
+*
+* Function Arguments:
+*    sndtemp - temperature data (Celsius) as a function of pressure
+*    snddewp - dewpoint data (Celsius) as a function of pressure      
+*    sndspd  - wind speed data (knots) as a function of pressure
+*    snddir  - wind direction data as a function of pressure
+*
+* Use '-1' for any of the above 4 arguments to indicate that you
+* are not passing that variable.  The appropriate options will 
+* be ignored based on your specifying '-1' for that variable.
+*
+* NOTE:  Make sure to set the vertical range of the plot before running.
+*        I.e., "SET LEV 1050 150", for example.   This does not have to 
+*        be limited to the pressure range of your data.
+*
+* Labelling:  Pressure/Height is labelled along left side.  Temperature is 
+*             labelled along bottom.  Mixing ratio is labelled along right
+*             side/top.
+*
+* 
+* PROBLEMS:  First check out the web page for the script (which also
+*            has a link to a FAQ with answers to many common questions
+*            about using the script):
+*            http://www.ems.psu.edu/~hart/skew.html
+*
+* Please send any further problems, comments, or suggestions to 
+* <hart@ems.psu.edu>
+*
+* ACKNOWLEDGMENTS:  Thanks go to the innumerable users who have helped
+* fine tune the script from the horrible mess from which it began.
+* In particular, thanks go out to Steve Lord (NCEP), Mike Fiorino (ECMWF),
+* George Bryan (PSU), Davide Sacchetti (CMIRL), and Enrico Minguzzi (CMIRL).
+*
+**************************************************************************
+*           !!!!!   BEGINNING OF USER-SPECIFIED OPTIONS  !!!!!!
+**************************************************************************
+*
+* --------------------- Initialization options  ----------------------
+*
+* ClrScrn = Whether to clear the screen before drawing diagram
+*           [1 = yes, 0 = no]
+
+*ClrScrn = 1
+
+*
+* ------------------- Define Skew-T Diagram Shape/Slope-----------------
+*
+* (P1,T1) = Pres, Temp of some point on left-most side
+* (P2,T2) = Pres, Temp of some point on right-most side
+* (P3,T3) = Pres, Temp of some point in diagram which is mid-point 
+*           in the horizontal between 1 and 2.
+*
+* P1, P2, P3 are in mb ; T1, T2, T3 are in Celsius
+*
+* These define the SLOPE and WIDTH of the diagram as you see it but DO NOT
+* DEFINE THE HEIGHT of the diagram as you see it.  In other words,
+* 1 and 2 do NOT necessarily need to be at the bottom of the diagram and
+* 3 does NOT necessarily need to be at the top.  THE VERTICAL PRESSURE 
+* RANGE OF THE SKEWT AS YOU SEE IT IS DETERMINED BY YOUR 'SET Z ...'  
+* COMMAND OR THE 'SET LEV ...' COMMAND BEFORE RUNNING THIS SCRIPT.
+*
+*    _______________________
+*   |                       |
+*   |                       |
+*   |           3           |
+*   |                       |
+*   |                       |
+*   |                       |
+*   |                       |
+*   |                       |
+*   |                       |
+*   |                       |
+*   |                       |
+*   |1                     2|
+*   |                       |
+*   |_______________________|
+*   
+*
+* A good set of defining points are given below.   Feel free
+* to experiment with variations.
+
+
+P1 = 1000
+T1 = -40
+
+P2 = 1000
+T2 = 40
+
+P3 = 200
+T3 = -50
+
+* Another good set of defining points suggested by George Bryan (PSU)
+* are:
+*
+* P1 = 1000
+* T1 = -30
+*
+* P2 = 1000
+* T2 = 40
+*
+* P3 = 500
+* T3 = -18
+
+* ------------------- Contour Intervals / Levels --------------------------
+*
+* All variables below are contour intervals/levels for diagram
+*
+* Thetaint = interval for potential temperature lines
+* Thetwint = interval for moist pseudo adiabats
+* tempint  = interval for temperature lines
+* wsclevs  = contour LEVELS for mixing ratio lines
+*
+*
+thetaint= 10
+thetwint= 5
+tempint = 10
+wsclevs = "1 2 3 4 6 8 10 15 20 25 30 35 40"
+*
+*
+* ------------------------ Output Options --------------------------------
+*
+* All variables below are logical .. 1=yes, 0=no, unless otherwise
+* specified.
+*
+* DrawBarb = Draw wind barbs along right side of plot
+* DrawThet = Draw dry adiabats
+* DrawThtw = Draw moist pseudo-adiabats
+* DrawTemp = Draw temperature lines 
+* DrawMix  = Draw mixing ratio lines
+* DrawTSnd = Draw temperature sounding
+* DrawDSnd = Draw dewpoint sounding
+* DrawRH   = Draw relative humidity sounding
+* DrawPrcl = Draw parcel path from surface upward
+* DrawPMax = Draw parcel path from most unstable level upward
+* DrawIndx = Display stability indices & CAPE
+* DrawHeli = Calculate and display absolute and storm-relative helicity
+* DrawHodo = Draw hodograph
+* DrawPLev = Draw Pressure Levels 
+* DrawZLev = Draw height levels and lines 
+*            0 = no lines
+*            1 = above ground level (AGL)
+*            2 = above sea level (ASL)
+* DrawZSTD = Draw Height levels using standard atm lapse rate           
+* LblAxes  = Label the x,y axes (temperature, pressure,mixing ratio)
+*
+* ThtwStop = Pressure level at which to stop drawing Theta-w lines
+* MixStop  = Pressure level at which to stop drawing Mixratio lines
+
+DrawBarb= 1
+DrawThet= 1
+DrawThtw= 0
+DrawTemp= 1
+DrawMix = 1
+DrawTSnd= 1
+DrawDSnd= 1
+DrawRH  = 1
+DrawPrcl= 1
+DrawPMax= 0
+DrawIndx= 1
+DrawHeli= 1
+DrawHodo= 1
+DrawPLev= 1
+DrawZLev= 0
+DrawZSTD= 0
+LblAxes = 1
+
+ThtwStop = 200
+MixStop  = 600
+
+
+* 
+* -----------------  Sounding Geography options ------------------------
+*
+* SfcElev = Elevation above sea-level (meters) of lowest level reported
+*           in sounding.  Used only if DrawZLev = 2
+
+SfcElev = 0
+
+
+*
+* ------------------ Thermodynamic Index Options --------------------
+* 
+* All variables here are in inches.  Use -1 for the default values.
+*
+*  Text1XC = X-location of midpoint of K,TT,PW output box
+*  Text1YC = Y-location of midpoint of K,TT,PW output box
+*  Text2XC = X-Location of midpoint of surface indices output box
+*  Text2YC = Y-location of midpoint of surface indices output box
+*  Text3XC = X-Location of midpoint of most unstable level-based indices
+*            output box
+*  Text3YC = Y-location of midpoint of most unstable level-based indices
+*            output box
+
+Text1XC = -1
+Text1YC = -1
+Text2XC = -1
+Text2YC = -1
+Text3XC = -1
+Text3YC = -1
+
+*
+* ----------------- Wind Barb Profile Options ----------------------------
+*
+* All variables here are in units of inches, unless otherwise specified
+*
+*  barbint = Interval for plotting barbs (in units of levels)
+*  poleloc = X-Location of profile.  Choose -1 for the default.
+*  polelen = Length of wind-barb pole
+*  Len05   = Length of each 5-knot barb 
+*  Len10   = Length of each 10-knot barb
+*  Len50   = Length of each 50-knot flag
+*  Wid50   = Width of base of 50-knot flag 
+*  Spac50  = Spacing between 50-knot flag and next barb/flag 
+*  Spac10  = Spacing between 10-knot flag and next flag
+*  Spac05  = Spacing between 5-knot flag and next flag
+*  Flagbase= Draw flagbase (filled circle) for each windbarb [1=yes, 0 =no] 
+*  Fill50  = Solid-fill 50-knot flag [1=yes, 0=no]
+*  barbline= Draw a vertical line connecting all the wind barbs [1=yes, 0=no]
+*
+barbint = 1
+poleloc = -1
+polelen = 0.35
+len05   = 0.07
+len10   = 0.15
+len50   = 0.15
+wid50   = 0.06
+spac50  = 0.07
+spac10  = 0.05
+spac05  = 0.05
+Fill50  = 1
+flagbase= 1
+barbline= 1
+
+*
+*
+*---------------- Hodograph Options -------------------------------------
+*
+* All variables here are in units of inches, unless otherwise specified
+*
+* HodXcent= x-location of hodograph center.  Use -1 for default location.
+* HodYcent= y-location of hodograph center.  Use -1 for default location.
+* HodSize = Size of hodograph in inches 
+* NumRing = Number of rings to place in hodograph (must be at least 1)
+* HodRing = Wind speed increment of each hodograph ring
+* HodoDep = Depth (above lowest level in mb) of end of hodograph trace
+* TickInt = Interval (in kts) at which tick marks are drawn along the axes
+*           Use 0 for no tick marks.
+* TickSize= Size of tick mark in inches
+* Text4XC = X-location of midpoint of hodograph text output. Use -1 for default.
+* Text4YC = Y-location of midpoint of hodograph text output. Use -1 for default.
+
+HodXcent= -1
+HodYcent= -1
+HodSize = 2
+NumRing = 4
+HodRing = 10
+HodoDep = 300
+TickInt = 5
+TickSize= 0.05
+Text4XC = -1
+Text4YC = -1
+
+*--------------- Helicity Options ---------------------------------------
+*
+* MeanVTop = Top pressure level (mb) of mean-wind calculation
+* MeanVBot = Bottom pressure level (mb) of mean-wind calculation
+* HelicDep = Depth in mb (above ground) of helicity integration
+* StormMot = Type of storm motion estimation scheme.  Use following:  
+*            0 = No departure from mean wind.
+*            1 = Davies-Jones (1990) approach
+* FillArrw = Whether to fill the arrowhead of the storm motion vector
+*            [1 = yes, 0 = no]
+
+MeanVTop= 300 
+MeanVBot= 850
+HelicDep= 300
+StormMot= 1
+FillArrw= 1
+
+*
+*---------------- Color Options ------------------------------------------
+*
+* ThetCol = Color of dry adiabats
+* TempCol = Color of temperature lines
+* MixCol  = Color of mixing ratio lines
+* ThtwCol = Color of moist adiabats
+* TSndCol = Color of Temperature Sounding 
+* DSndCol = Color of Dewpoint Sounding
+* RHCol   = Color of RH Sounding
+* PrclCol = Color of parcel trace
+* BarbCol = Color of wind barbs (choose -1 for color according to speed)
+* HodoCol = Color of hodograph trace
+
+ThetCol = 2
+TempCol = 4
+MixCol  = 7
+ThtwCol = 3
+*TSndCol = 1 
+*DSndCol = 1
+*RHCol   = 10
+*PrclCol = 5
+*BarbCol = -1
+HodoCol = 1
+
+*
+*-------------------- Line Style Options ------------------------------------
+*
+* GrADS Styles: 1=solid;2=long dash;3=short dash;4=long,short dashed;
+*               5=dotted;6=dot dash;7=dot dot dash
+*
+* ThetLine = Line Style of dry adiabats
+* TempLine = Line Style of temperature lines
+* MixLine  = Line Style of mixing ratio lines
+* ThtwLine = Line Style of moist adiabats
+* TSndLine = Line Style of Temperature Sounding
+* DSndLine = Line Style of Dewpoint Sounding
+* RHLine   = Line Style of RH sounding
+* PrclLine = Line Style of parcel trace
+* HodoLine = Line Style of hodograph trace
+*
+
+ThetLine = 1
+TempLine = 1
+MixLine  = 5
+ThtwLine = 3
+TSndLine = 1
+DSndLine = 1
+RHLine   = 1
+PrclLine = 3
+HodoLine = 1
+
+*
+*------------------- Line Thickness Options---------------------------------
+* GrADS Line Thickness: increases with increasing number. Influences 
+*                       hardcopy output more strongly than screen output.
+*
+*
+* ThetThk = Line Thickness of dry adiabats
+* TempThk = Line Thickness of temperature lines
+* MixThk  = Line Thickness of mixing ratio lines
+* ThtwThk = Line Thickness of moist adiabats
+* TSndThk = Line Thickness of temperature sounding
+* DSndThk = Line thickness of dewpoint sounding
+* RHThk   = Line thickness of RH sounding
+* PrclThk = Line thickness of parcel trace
+* HodoThk = Line thickness of hodograph trace
+* BarbThk = Line thickness of wind barbs
+
+ThetThk = 3
+TempThk = 3
+MixThk  = 3
+ThtwThk = 3
+TSndThk = 8 
+DSndThk = 8
+RHThk   = 8
+PrclThk = 6 
+HodoThk = 3 
+BarbThk = 2
+
+*
+*------------------- Data Point Marker Options -----------------------------
+* GrADS Marker Types: 0 = none ; 1 = cross ; 2 = open circle ; 
+*                     3 = closed circle ; 4 = open square ; 5 = closed square
+*                     6 = X ; 7 = diamond ; 8 = triangle ; 9 = none
+*                    10 = open circle with vertical line ; 11 = open oval
+*
+* TSndMrk = Mark type of data point marker for temperature sounding
+* DSndMrk = Mark type of data point marker for dewpoint sounding
+* RHMrk   = Mark type of data point marker for relative humidity sounding
+* MrkSize = Mark size (inches) of each data marker
+
+TSndMrk = 0
+DSndMrk = 0
+RHMrk   = 0
+MrkSize = 0.1
+
+
+* !!!!! YOU SHOULD NOT NEED TO CHANGE ANYTHING BELOW HERE !!!!!
+****************************************************************************
+
+*-------------------------------------------
+* grab user-specified environment dimensions
+*-------------------------------------------
+
+"q dims"
+rec=sublin(result,2)
+_xtype=subwrd(rec,3)
+_xlon=subwrd(rec,6)
+_xval=subwrd(rec,9)
+rec=sublin(result,3)
+_yval=subwrd(rec,9)
+_ylat=subwrd(rec,6)
+_ytype=subwrd(rec,3)
+rec=sublin(result,4)
+_ptype=subwrd(rec,3)
+_pmax=subwrd(rec,6)
+_pmin=subwrd(rec,8)
+_zmin=subwrd(rec,11)
+_zmax=subwrd(rec,13)
+rec=sublin(result,5)
+_ttype=subwrd(rec,3)
+_ttime=subwrd(rec,6)
+_tval=subwrd(rec,9)
+
+"q file"
+rec=sublin(result,5)
+_zmaxfile=subwrd(rec,9)
+
+*-------------------------------------------------------------
+* Check to ensure that dimensions are valid.  Warn & exit if not.
+*--------------------------------------------------------------
+
+dimrc=0
+If (_xtype != "fixed")
+  say "X-Dims Error:  Not fixed.  Use 'set lon' or 'set x' to specify a value."
+  dimrc=-1
+Endif
+
+If (_ytype != "fixed")
+  say "Y-Dims Error:  Not fixed.  Use 'set lat' or 'set y' to specify a value"
+  dimrc=-1
+Endif
+
+If (_ptype != "varying")
+   say "Z-Dims Error:  Not varying.  Use 'set lev' or 'set z' to specify a range."
+   dimrc=-1
+Endif
+
+If (_ttype != "fixed")
+  say "Time Error:     Not fixed.  Use 'set time' or 'set t' to specify a value"
+  dimrc=-1
+Endif
+
+
+If (dimrc < 0)
+  Return(-1)
+Endif
+
+
+*
+* A few global variables used in units conversion
+*
+
+_pi=3.14159265
+_dtr=_pi/180
+_rtd=1/_dtr 
+_ktm=0.514444
+_mtk=1/_ktm
+
+* A few global constants used in thermo calcs
+
+_C0=0.99999683 
+_C1=-0.90826951/100
+_C2= 0.78736169/10000
+_C3=-0.61117958/1000000
+_C4= 0.43884187/pow(10,8) 
+_C5=-0.29883885/pow(10,10)
+_C6= 0.21874425/pow(10,12)
+_C7=-0.17892321/pow(10,14)
+_C8= 0.11112018/pow(10,16)          
+_C9=-0.30994571/pow(10,19)
+
+* A pressure array of power calculations which should be performed
+* only once to reduce execution time.
+
+zz=1100
+while (zz > 10)
+    subscr=zz/10
+    _powpres.subscr=pow(zz,0.286)
+    zz=zz-10
+endwhile
+
+*
+* Turn off options not available due to user data limitations
+*
+
+If (ClrScrn = 1) 
+  "clear"
+Endif
+
+If (sndspd = -1 | snddir = -1) 
+  DrawBarb = 0
+  DrawHodo = 0
+  DrawHeli = 0
+Endif
+
+If (snddewp = -1) 
+  DrawDSnd = 0
+  DrawRH   = 0
+  DrawPrcl = 0
+  DrawPMax = 0
+  DrawIndx = 0
+Endif
+
+If (sndtemp = -1)
+  DrawTSnd = 0
+  DrawRH   = 0
+  DrawPrcl = 0
+  DrawPMax = 0
+  DrawIndx = 0
+  DrawZLev = 0
+Endif
+
+If (NumRing < 1) 
+  DrawHodo = 0
+Endif 
+  
+"q gxinfo"
+rec=sublin(result,2)
+xsize=subwrd(rec,4)
+
+If (xsize = 11) 
+   PageType = "Landscape"
+Else
+   PageType = "Portrait"
+Endif
+  
+*------------------------------------------------------
+* calculate constants determining slope/shape of diagram
+* based on temp/pressure values given by user
+*-------------------------------------------------------
+
+"set x 1"
+"set y 1"
+"set z 1"
+"set t 1"
+_m1=(T1+T2-2*T3)/(2*log10(P2/P3))
+_m2=(T2-T3-_m1*log10(P2/P3))/50
+_m3=(T1-_m1*log10(P1))
+
+"set z "_zmin" "_zmax           
+"set zlog on"
+"set xlab off"
+
+*-------------------------------------------------
+* perform coordinate transformation to Skew-T/LogP
+*-------------------------------------------------
+
+"set gxout stat"
+"set x "_xval
+"set y "_yval
+"set t "_tval
+"define tempx=("sndtemp"-"_m1"*log10(lev)-"_m3")/"_m2
+"define dewpx=("snddewp"-"_m1"*log10(lev)-"_m3")/"_m2
+
+If (PageType = "Portrait") 
+   "set parea 0.7 7 0.75 10.5"
+Else
+   "set parea 0.7 6.5 0.5 8"
+Endif
+  
+"set axlim 0 100"
+"set lon 0 100"
+"set grid on 1 1"
+
+"set z "_zmin " " _zmax
+"set lon 0 100"
+"set clevs -900"
+"set gxout contour"
+
+*-------------------------------------
+* Draw pressure lines 
+*-------------------------------------
+
+If (DrawPLev = 0) 
+   "set ylab off"
+Else
+   "set ylab on"
+   "set ylopts 1 3 0.10"
+   "set xlopts 1 3 0.125"
+Endif
+
+"d lon"
+
+*--------------------------------------
+* Determine corners of skewt/logp frame
+*--------------------------------------
+
+"q w2xy 100 "_pmin
+rxloc=subwrd(result,3)
+tyloc=subwrd(result,6)
+"q w2xy 0 "_pmax
+lxloc=subwrd(result,3)
+byloc=subwrd(result,6)
+
+If (DrawPLev = 1 & LblAxes = 1)
+   "set strsiz 0.10"
+   "set string 1 c 3 0"
+   If (PageType = "Portrait") 
+      "draw string 0.5 10.85 mb"
+   Else
+      "draw string 0.5 8.35 mb"
+   Endif
+Endif
+
+*---------------------------------------------------
+* Calculate & draw actual height lines using temp data
+*---------------------------------------------------
+
+If (DrawZLev > 0)
+   say "Calculating observed height levels from temp/pressure data."
+   zz=1
+   "set gxout stat"
+   "set x "_xval
+   "set y "_yval
+   "set t "_tval
+   count=0
+   while (zz < _zmax)
+      "set z "zz
+      pp.zz=subwrd(result,4)
+      lpp.zz=log(pp.zz)
+      "d "sndtemp
+      rec=sublin(result,1)
+      check=substr(rec,1,6)
+      If (check = "Notice") 
+          rec=sublin(result,9)
+      Else
+          rec=sublin(result,8)
+      Endif
+      tt=subwrd(rec,4)
+      if (tt > -900) 
+         tk=tt+273.15
+         count=count+1
+         zzm=zz-1
+         If (count = 1) 
+            If (DrawZLev = 2)
+               htlb="ASL"
+               height.zz=SfcElev
+            Else
+               htlb="AGL"
+               height.zz=0
+            Endif
+            sfcz=height.zz
+         Else
+            DZ=29.2857*(lpp.zzm-lpp.zz)*(lpp.zz*tk+lpp.zzm*tkold)/(lpp.zz+lpp.zzm) 
+            height.zz=height.zzm+DZ
+            highz=height.zz
+         Endif
+      else
+         height.zz = -9999
+      endif
+      tkold=tk
+      zz=zz+1
+   endwhile
+
+   maxht=int(highz/1000)
+   if (int(sfcz/1000) = sfcz/1000)
+      minht=int(sfcz/1000)
+   else
+      minht=1+int(sfcz/1000)
+   endif
+
+   ht=minht
+   "set line 1 3 1"
+   "set strsiz 0.10"
+   "set string 1 l 3 0"
+   while (ht <= maxht)
+       zz=1
+       while (height.zz/1000 <= ht)
+          zz=zz+1
+       endwhile
+       zzm=zz-1
+       PBelow=pp.zzm
+       PAbove=pp.zz
+       HBelow=height.zzm
+       HAbove=height.zz
+       DZ=HAbove-HBelow
+       DP=PAbove-PBelow
+       Del=ht*1000-HBelow
+       Est=PBelow+Del*DP/DZ
+       If (Est >= _pmin & Est <= _pmax)
+          "q w2xy 1 " Est
+          yloc=subwrd(result,6)
+          "draw line " lxloc " " yloc " " rxloc " " yloc
+          "draw string 0.22 "yloc-0.05" "ht
+       Endif
+       ht=ht+1
+   endwhile
+   "set strsiz 0.10"
+   "set string 1"
+   If (LblAxes = 1)
+      If (PageType = "Portrait") 
+         "draw string 0.25 10.85 km"
+         "draw string 0.25 10.75 "htlb
+         "draw string 0.25 10.65 OBS"
+      Else
+         "draw string 0.25 8.35 km"
+         "draw string 0.25 8.25 "htlb
+         "draw string 0.25 8.15 OBS"
+      Endif
+   Endif
+Endif
+
+
+*---------------------------------------------------
+* Draw height levels (height above MSL using Std Atm)
+*---------------------------------------------------
+
+If (DrawZSTD = 1)
+   "set strsiz 0.10"
+   minht=30.735*(1-pow(_pmax/1013.26,0.287))
+   minht=int(minht+0.5)
+   maxht=30.735*(1-pow(_pmin/1013.26,0.287))
+   maxht=int(maxht)
+   "set gxout stat"
+   zcount=minht        
+   while (zcount <= maxht) 
+      plev=1013.26*pow((1-zcount/30.735),3.4843)
+      "q w2xy 0 "plev 
+      yloc=subwrd(result,6)
+      "draw string 0 "yloc-0.05" "zcount
+      zcount=zcount+1
+   endwhile
+   "set strsiz 0.10"
+   If (LblAxes = 1)
+      If (PageType = "Portrait") 
+         "draw string 0 10.85 km"
+         "draw string 0 10.75 ASL"
+         "draw string 0 10.65 STD"
+      Else
+         "draw string 0 8.35 km"
+         "draw string 0 8.25 ASL"
+         "draw string 0 8.15 STD"
+      Endif
+  Endif
+Endif
+
+
+*-----------------------
+* Plot temperature lines 
+*-----------------------
+
+If (DrawTemp = 1)
+   "set strsiz 0.1"
+   "set z "_zmin " " _zmax
+   "set line "TempCol " " TempLine " "TempThk
+   "set string 1 c 3 0"
+   "set gxout stat"
+   maxtline=GetTemp(100,_pmax)
+   mintline=GetTemp(0,_pmin)
+
+   maxtline=tempint*int(maxtline/tempint)
+   mintline=tempint*int(mintline/tempint)
+
+   tloop=mintline
+   While (tloop <= maxtline) 
+       Botxtemp=GetXLoc(tloop,_pmax)
+       "q w2xy "Botxtemp " " _pmax
+       Botxloc=subwrd(result,3)
+       Botyloc=byloc           
+       Topxtemp=GetXLoc(tloop,_pmin)
+        "q w2xy "Topxtemp " " _pmin
+       Topxloc=subwrd(result,3)
+       Topyloc=tyloc            
+       If (Botxtemp <= 100 | Topxtemp <= 100) 
+          If (Topxtemp > 100)
+             Slope=(Topyloc-Botyloc)/(Topxtemp-Botxtemp)
+             b=Topyloc-Slope*Topxtemp
+             Topyloc=Slope*100+b
+             Topxloc=rxloc         
+          Endif
+          If (Botxtemp < 0)
+             Slope=(Topyloc-Botyloc)/(Topxtemp-Botxtemp)
+             b=Botyloc-Slope*Botxtemp
+             Botyloc=b
+             Botxloc=lxloc 
+          Else
+             "draw string " Botxloc-0.05 " " Botyloc-0.15 " " tloop
+          Endif
+          "draw line "Botxloc " " Botyloc " " Topxloc " " Topyloc
+       Endif
+       tloop=tloop+tempint
+   EndWhile
+   If (LblAxes = 1) 
+      "set strsiz 0.15"
+      "set string 1 c"
+      If (PageType = "Portrait")
+         "draw string 4.0 0.35 Temperature (`3.`0C)"
+      Else
+         "draw string 3.5 0.15 Temperature (`3.`0C)"
+      Endif
+   Endif
+Endif
+
+
+*------------------
+* Plot dry adiabats
+*------------------
+
+If (DrawThet = 1)
+   temp=GetTemp(100,_pmin)
+   maxtheta=GetThet2(temp,-100,_pmin)
+   maxtheta=thetaint*int(maxtheta/thetaint)
+   temp=GetTemp(0,_pmax)
+   mintheta=GetThet2(temp,-100,_pmax)
+   mintheta=thetaint*int(mintheta/thetaint)
+   
+   "set lon 0 100"
+   "set y 1"
+   "set z 1"
+   tloop=mintheta
+   "set line "ThetCol" "ThetLine " "ThetThk
+   While (tloop <= maxtheta)
+     PTemp=LiftDry(tloop,1000,_pmin,1,_pmin,_pmax)     
+     tloop=tloop+thetaint
+   Endwhile
+Endif
+
+*------------------------
+* Plot mixing ratio lines
+*------------------------
+
+If (DrawMix = 1)
+   If (MixStop < _pmin) 
+      MixStop = _pmin
+   Endif
+   "set string 1 l"
+   "set z "_zmin " " _zmax
+   "set cint 1"
+   "set line "MixCol" " MixLine " "MixThk
+   cont = 1
+   mloop=subwrd(wsclevs,1)
+   count = 1
+   While (cont = 1) 
+       BotCoef=log(mloop*_pmax/3801.66)
+       BotTval=-245.5*BotCoef/(BotCoef-17.67)
+       Botxtemp=GetXLoc(BotTval,_pmax)
+       "q w2xy "Botxtemp " " _pmax
+       Botxloc=subwrd(result,3)
+       Botyloc=byloc            
+       TopCoef=log(mloop*MixStop/3801.66)
+       TopTval=-245.5*TopCoef/(TopCoef-17.67)
+       Topxtemp=GetXLoc(TopTval,MixStop)
+       "q w2xy "Topxtemp " " MixStop
+       Topxloc=subwrd(result,3)
+       Topyloc=subwrd(result,6) 
+       "set string "MixCol" l 3"
+       "set strsiz 0.09"
+       If (Botxtemp <= 100 | Topxtemp <= 100) 
+          If (Topxtemp > 100)
+             Slope=(Topyloc-Botyloc)/(Topxtemp-Botxtemp)
+             b=Topyloc-Slope*Topxtemp
+             Topyloc=Slope*100+b
+             Topxloc=rxloc 
+             "draw string " Topxloc+0.05 " " Topyloc  " " mloop
+          Else
+             "draw string " Topxloc " " Topyloc+0.1 " " mloop
+          Endif
+          If (Botxtemp < 0)
+             Slope=(Topyloc-Botyloc)/(Topxtemp-Botxtemp)
+             b=Botyloc-Slope*Botxtemp
+             Botyloc=b
+             Botxloc=lxloc        
+          Endif
+          "draw line "Botxloc " " Botyloc " " Topxloc " " Topyloc
+       Endif
+       count=count+1
+       mloop=subwrd(wsclevs,count)
+       If (mloop = "" | count > 50) 
+          cont = 0
+       Endif
+   EndWhile
+   If (LblAxes = 1)
+      "set strsiz 0.15"
+      "set string 1 c 3 90"
+      If (PageType = "Portrait")
+         "draw string 7.40 4.75 Mixing Ratio (g/kg)"
+      Else
+         "draw string 6.90 4.25 Mixing Ratio (g/kg)"
+      Endif
+      "set string 1 c 3 0"
+   Endif
+Endif
+
+*-----------------------------
+* Plot moist (pseudo) adiabats
+*-----------------------------
+
+If (DrawThtw = 1)
+   "set lon 0 100"
+   "set y 1"
+   "set z 1"
+   "set gxout stat"
+   tloop=80
+   "set line "ThtwCol" "ThtwLine " "ThtwThk
+   While (tloop > -80)
+     PTemp=LiftWet(tloop,1000,ThtwStop,1,_pmin,_pmax)     
+     tloop=tloop-thetwint
+   Endwhile
+Endif
+
+
+*-----------------------------------------------------
+* Plot transformed user-specified temperature sounding
+*-----------------------------------------------------
+
+If (DrawTSnd = 1)
+   say "Drawing temperature sounding."
+   "set gxout line"
+   "set x "_xval
+   "set y "_yval
+   "set z "_zmin" "_zmax     
+   "set ccolor "TSndCol
+   "set cstyle "TSndLine
+   "set cmark "TSndMrk
+   "set digsiz "MrkSize
+   "set cthick "TSndThk 
+   "set missconn on"
+   "d tempx"
+Endif
+
+*---------------------------------------------------
+* Plot transformed user-specified dewpoint sounding
+*---------------------------------------------------
+
+If (DrawDSnd = 1)
+   say "Drawing dewpoint sounding."
+   "set gxout line"
+   "set x "_xval
+   "set y "_yval
+   "set z "_zmin" "_zmax
+   "set cmark "DSndMrk 
+   "set digsiz "MrkSize
+   "set ccolor "DSndCol
+   "set cstyle "DSndLine
+   "set cthick "DSndThk
+   "set missconn on"
+   "d dewpx"
+Endif
+
+*----------------------------------------
+* Determine lowest level of reported  data
+*----------------------------------------
+
+If (DrawTSnd = 1) 
+   field=sndtemp
+Else
+   field=sndspd
+Endif
+
+"set gxout stat"
+"set x "_xval
+"set y "_yval
+"set t "_tval
+"set lev " _pmax " " _pmin
+"d maskout(lev,"field"+300)"
+rec=sublin(result,1)
+check=substr(rec,1,6)
+If (check = "Notice") 
+    rec=sublin(result,9)
+Else
+    rec=sublin(result,8)
+Endif
+SfcPlev=subwrd(rec,5)
+
+If (DrawTSnd = 1 & DrawDSnd = 1)
+   "set lev "SfcPlev
+   "d "sndtemp
+   rec=sublin(result,1)
+   check=substr(rec,1,6)
+   If (check = "Notice") 
+       rec=sublin(result,9)
+   Else
+       rec=sublin(result,8)
+   Endif
+   Sfctemp=subwrd(rec,4)
+   "d "snddewp
+   rec=sublin(result,1)
+   check=substr(rec,1,6)
+   If (check = "Notice") 
+       rec=sublin(result,9)
+   Else
+       rec=sublin(result,8)
+   Endif
+   Sfcdewp=subwrd(rec,4)
+   SfcThee=Thetae(Sfctemp,Sfcdewp,SfcPlev)
+
+*------------------------------------------
+* Calculate temperature and pressure of LCL
+*------------------------------------------
+
+   TLcl=Templcl(Sfctemp,Sfcdewp)
+   PLcl=Preslcl(Sfctemp,Sfcdewp,SfcPlev)
+Endif
+
+*----------------------------------------------------------
+* Plot parcel path from surface to LCL and up moist adiabat
+*----------------------------------------------------------
+
+If (DrawPrcl = 1)
+   say "Drawing parcel path from surface upward."
+   If (PageType = "Portrait")
+      xloc=7.15
+   Else
+      xloc=6.65
+   Endif
+   "q w2xy 1 "PLcl
+   rec=sublin(result,1)
+   yloc=subwrd(rec,6)
+   "set strsiz 0.1"
+   If (PLcl < _pmax) 
+      "set string 1 l"
+      "draw string "xloc" "yloc" LCL"
+      "set line 1 1 1"
+      "draw line "xloc-0.15" "yloc" "xloc-0.05" "yloc
+   Endif
+   "set lon 0 100"
+   "set gxout stat"
+   "set line "PrclCol" "PrclLine " " PrclThk
+   PTemp=LiftDry(Sfctemp,SfcPlev,PLcl,1,_pmin,_pmax)
+   Ptemp=LiftWet(TLcl,PLcl,_pmin,1,_pmin,_pmax)
+Endif
+
+*-------------------------------------------------------
+* Determine level within lowest 250mb having highest
+* theta-e value
+*-------------------------------------------------------
+
+If (DrawTSnd = 1 & DrawDSnd = 1)
+  "set x "_xval
+  "set y "_yval
+  "set t "_tval
+   zz=1
+   MaxThee=-999
+   "set gxout stat"
+   while (zz <= _zmax & pp > _pmax-250)
+       "set z "zz
+       pp=subwrd(result,4)
+       "d "sndtemp
+       rec=sublin(result,1)
+       check=substr(rec,1,6)
+       If (check = "Notice") 
+           rec=sublin(result,9)
+       Else
+           rec=sublin(result,8)
+       Endif
+       tt=subwrd(rec,4)
+       "d "snddewp
+       rec=sublin(result,1)
+       check=substr(rec,1,6)
+       If (check = "Notice") 
+           rec=sublin(result,9)
+       Else
+           rec=sublin(result,8)
+       Endif
+       dd=subwrd(rec,4)
+       If (abs(tt) < 130 & abs(dd) < 130) 
+          Thee=Thetae(tt,dd,pp)
+          If (Thee > MaxThee) 
+             MaxThee=Thee
+             TMaxThee=tt
+             DMaxThee=dd 
+             PMaxThee=pp
+          Endif
+       endif
+       zz=zz+1
+   Endwhile
+   If (PMaxThee = SfcPlev-250) 
+      PMaxThee = SfcPlev
+   Endif
+*------------------------------------------------------
+* Calculate temperature and pressure of LCL from highest   
+* theta-e level
+*------------------------------------------------------
+   If (SfcPlev != PMaxThee) 
+      TLclMax=Templcl(TMaxThee,DMaxThee)
+      PLclMax=Preslcl(TMaxThee,DMaxThee,PMaxThee)
+   Endif
+Endif
+
+*----------------------------------------------------------
+* Plot parcel path from highest theta-e level to LCL and up
+* moist adiabat
+*----------------------------------------------------------
+
+If (DrawPMax = 1 & SfcPlev != PMaxThee)
+   say "Drawing parcel path from most unstable level upward."
+   If (PageType = "Portrait")
+      xloc=7.15
+   Else
+      xloc=6.65
+   Endif
+   "q w2xy 1 "PLclMax
+   rec=sublin(result,1)
+   yloc=subwrd(rec,6)
+   "set strsiz 0.1"
+   If (PLclMax < _pmax) 
+      "set string 1 l"
+      "draw string "xloc" "yloc" LCL"
+      "set line 1 1 1"
+      "draw line "xloc-0.15" "yloc" "xloc-0.05" "yloc
+   Endif
+   "set lon 0 100"
+   "set gxout stat"
+   "set line "PrclCol" "PrclLine " " PrclThk
+   PTemp=LiftDry(TMaxThee,PMaxThee,PLclMax,1,_pmin,_pmax)
+   Ptemp=LiftWet(TLclMax,PLclMax,_pmin,1,_pmin,_pmax)
+Endif
+
+*--------------------------------
+* Draw thermodynamic indices
+*--------------------------------
+
+If (DrawIndx = 1) 
+   "set string 1 l"
+   "set strsiz 0.10"
+   "set x "_xval
+   "set y "_yval
+   "set t "_tval
+   say "Calculating precipitable water."
+   pw=precipw(sndtemp,snddewp,_pmax,_pmin)
+   say "Calculating thermodynamic indices."
+   Temp850=interp(sndtemp,850)
+   Temp700=interp(sndtemp,700)
+   Temp500=interp(sndtemp,500)
+   Dewp850=interp(snddewp,850)
+   Dewp700=interp(snddewp,700) 
+   Dewp500=interp(snddewp,500)
+   If (Temp850>-900 & Dewp850>-900 & Dewp700>-900 & Temp700>-900 & Temp500>-900) 
+      K=Temp850+Dewp850+Dewp700-Temp700-Temp500
+   Else 
+      K=-999
+   Endif
+   If (Temp850 > -900 & Dewp850 > -900 & Temp500 > -900)
+      tt=Temp850+Dewp850-2*Temp500
+   Else
+      tt=-999
+   Endif
+   Temp500V=virtual2(Temp500+273.15,Dewp500+273.15,500)-273.15
+   PclTemp=LiftWet(TLcl,PLcl,500,0)
+   PclTempV=virtual2(PclTemp+273.15,PclTemp+273.15,500)-273.15
+   SLI=Temp500V-PclTempV
+   rec=CAPE(TLcl,PLcl,100,sndtemp,snddewp)
+   Pos=subwrd(rec,1)
+   CIN=subwrd(rec,2)
+
+   If (SfcPlev != PMaxThee) 
+      PclTemp=LiftWet(TLclMax,PLclMax,500,0)
+      PclTempV=virtual2(PclTemp+273.15,PclTemp+273.15,500)-273.15
+      LIMax=Temp500V-PclTempV
+      rec=CAPE(TLclMax,PLclMax,100,sndtemp,snddewp)
+      PosMax=subwrd(rec,1)
+      CINMax=subwrd(rec,2)
+   Else
+      LIMax=SLI
+      PosMax=Pos
+      CINMax=CIN
+      MaxThee=SfcThee
+   Endif
+ 
+   If (PageType = "Portrait") 
+      If (Text1XC = -1)
+         Text1XC=rxloc-0.75
+      Endif
+      If (Text1YC = -1)
+         Text1YC=tyloc-2.25
+      Endif
+      If (Text2XC = -1)
+         Text2XC=rxloc-0.75
+      Endif
+      If (Text2YC = -1)
+         Text2YC=tyloc-3.25
+      Endif
+      If (Text3XC = -1)
+          Text3XC=rxloc-0.75
+      Endif
+      If (Text3YC = -1)
+         Text3YC=tyloc-4.40
+      Endif
+   Else
+      If (Text1XC = -1)
+         Text1XC=rxloc+2.50
+      Endif
+      If (Text1YC = -1)
+         Text1YC=tyloc-3.00
+      Endif
+      If (Text2XC = -1)
+         Text2XC=rxloc+2.50
+      Endif
+      If (Text2YC = -1)
+         Text2YC=tyloc-4.00
+      Endif
+      If (Text3XC = -1)
+         Text3XC=rxloc+2.50
+      Endif
+      If (Text3YC = -1)
+         Text3YC=tyloc-5.10
+      Endif
+   Endif
+   "set string 1 l 3"
+   "set line 0 1 3"
+   "draw recf  "Text1XC-0.75 " " Text1YC-0.40 " " Text1XC+0.75 " " Text1YC+0.25
+   "set line 1 1 3"
+   "draw rec  "Text1XC-0.75 " " Text1YC-0.40 " " Text1XC+0.75 " " Text1YC+0.25
+   "draw string "Text1XC-0.70 " " Text1YC+0.10"  K" 
+   "draw string "Text1XC+0.25 " " Text1YC+0.10" " int(K)      
+   "draw string "Text1XC-0.70 " " Text1YC-0.10 "  TT" 
+   "draw string "Text1XC+0.25 " " Text1YC-0.10 " " int(tt)
+   "draw string "Text1XC-0.70 " " Text1YC-0.25 "  PW(cm)" 
+   "draw string "Text1XC+0.25 " " Text1YC-0.25 " " int(pw*100)/100
+   "set line 0 1 3"
+   "draw recf  "Text2XC-0.75 " " Text2YC-0.60 " " Text2XC+0.75 " " Text2YC+0.60
+   "set line 1 1 3"
+   "draw rec  "Text2XC-0.75 " " Text2YC-0.60 " " Text2XC+0.75 " " Text2YC+0.60
+   "draw string "Text2XC-0.35 " " Text2YC+0.50 " Surface"
+   "draw string "Text2XC-0.70 " " Text2YC+0.30 "  Temp(`3.`0C)" 
+   "draw string "Text2XC+0.25 " " Text2YC+0.30 " " int(Sfctemp*10)/10
+   "draw string "Text2XC-0.70 " " Text2YC+0.15 "  Dewp(`3.`0C)" 
+   "draw string "Text2XC+0.25 " " Text2YC+0.15 " " int(Sfcdewp*10)/10
+   "draw string "Text2XC-0.70 " " Text2YC "   `3z`0`bE`n(K)"
+   "draw string "Text2XC+0.25 " " Text2YC " " int(SfcThee) 
+   "draw string "Text2XC-0.70 " " Text2YC-0.15 "  LI"
+   "draw string "Text2XC+0.25 " " Text2YC-0.15 " " round(SLI)
+   "draw string "Text2XC-0.70 " " Text2YC-0.30 "  CAPE(J)"
+   "draw string "Text2XC+0.25 " " Text2YC-0.30 " " int(Pos)   
+   "draw string "Text2XC-0.70 " " Text2YC-0.45 "  CIN(J)"
+   "draw string "Text2XC+0.25 " " Text2YC-0.45 " " int(CIN)      
+   "set line 0 1 3"
+   "draw recf  "Text3XC-0.75 " " Text3YC-0.55 " "  Text3XC+0.75 " " Text3YC+0.55
+   "set line 1 1 3"
+   "draw rec  "Text3XC-0.75 " " Text3YC-0.55 " "  Text3XC+0.75 " " Text3YC+0.55
+   "draw string "Text3XC-0.60 " " Text3YC+0.45 " Most Unstable"
+   "draw string "Text3XC-0.70 " " Text3YC+0.20 "  Press(mb)" 
+   "draw string "Text3XC+0.25 " " Text3YC+0.20 " " int(PMaxThee)
+   "draw string "Text3XC-0.70 " " Text3YC+0.05 " `3z`0`bE`n(K)"
+   "draw string "Text3XC+0.25 " " Text3YC+0.05 " " int(MaxThee)
+   "draw string "Text3XC-0.70 " " Text3YC-0.10 " LI" 
+   "draw string "Text3XC+0.25 " " Text3YC-0.10 " "round(LIMax)
+   "draw string "Text3XC-0.70 " " Text3YC-0.25 " CAPE(J)" 
+   "draw string "Text3XC+0.25 " " Text3YC-0.25 " "int(PosMax) 
+   "draw string "Text3XC-0.70 " " Text3YC-0.40 " CIN(J)"
+   "draw string "Text3XC+0.25 " " Text3YC-0.40 " " int(CINMax) 
+Endif
+
+*-----------------------------
+* Draw wind profile along side
+*-----------------------------
+
+If (DrawBarb = 1) 
+   say "Drawing Wind Profile."
+   If (poleloc = -1) 
+      If (PageType = "Portrait")
+         poleloc = 8.0
+      Else
+         poleloc = 7.5 
+      Endif
+   Endif
+   If (barbline = 1)
+      "set line 1 1 3"
+      "draw line "poleloc " " byloc " " poleloc " " tyloc
+   Endif
+   If (BarbCol = -1) 
+      'set rgb 41 255 0 132'
+      'set rgb 42 255 0 168'
+      'set rgb 43 255 0 204'
+      'set rgb 44 255 0 240'
+      'set rgb 45 255 0 255'
+      'set rgb 46 204 0 255'
+      'set rgb 47 174 0 255'
+      'set rgb 48 138 0 255'
+      'set rgb 49 108 0 255'
+      'set rgb 50 84 0 255'
+      'set rgb 51 40 0 255'
+      'set rgb 52 0 0  255'
+      'set rgb 53 0 42 255'
+      'set rgb 54 0 84 255'
+      'set rgb 55 0 120 255'
+      'set rgb 56 0 150 255'
+      'set rgb 57 0 192 255'
+      'set rgb 58 0 240 255'
+      'set rgb 59 0 255 210'
+      'set rgb 60 0 255 160' 
+      'set rgb 61 0 255 126'
+      'set rgb 62 0 255 78'
+      'set rgb 63 84 255 0'
+      'set rgb 64 138 255 0'
+      'set rgb 65 188 255 0'
+      'set rgb 66 236 255 0'
+      'set rgb 67 255 255 0'
+      'set rgb 68 255 222 0'
+      'set rgb 69 255 192 0'
+      'set rgb 70 255 162 0'
+      'set rgb 71 255 138 0'
+      'set rgb 72 255 108 0'
+      'set rgb 73 255 84 0'
+      'set rgb 74 255 54 0'
+      'set rgb 75 255 12 0'
+      'set rgb 76 255 0 34'
+      'set rgb 77 255 0 70'
+      'set rgb 78 255 0 105'
+      'set rgb 79 255 0 140'
+      'set rgb 80 255 0 175'
+      'set rgb 81 255 0 215'
+      'set rgb 82 255 0 255'
+      'set rgb 83 255 255 255'
+
+      col1='83 83 83 83 83 83 83 83 83 83 82 81 80 79 78'
+      col2='77 76 75 74 73 72 71 70 69 68 67 66 65 64 63'
+      col3='62 61 60 59 58 57 56 55 54 53 52 51 50 49 48'
+      'set rbcols 'col1' 'col2' 'col3
+   Endif
+   "set z "_zmin" "_zmax
+   "set gxout stat"
+   zz=1
+   wspd=-999
+   cont=1
+   While (cont = 1 & zz < _zmax) 
+      "set z "zz
+      pres=subwrd(result,4)
+      "d "sndspd
+      rec=sublin(result,1)
+      check=substr(rec,1,6)
+      If (check = "Notice") 
+          rec=sublin(result,9)
+      Else
+          rec=sublin(result,8)
+      Endif
+      wspd=subwrd(rec,4)
+      if (wspd < 0 | pres > _pmax) 
+          zz=zz+1
+      else
+          cont=0
+      Endif
+   Endwhile
+   While (zz <= _zmax)
+      "d "sndspd"(z="zz")"
+      rec=sublin(result,1)
+      check=substr(rec,1,6)
+      If (check = "Notice") 
+          rec=sublin(result,9)
+      Else
+          rec=sublin(result,8)
+      Endif
+      wspd=subwrd(rec,4)
+      If (BarbCol >= 0)
+         "set line "BarbCol " 1 "BarbThk
+      Else
+         tempbcol=55+wspd/5     
+         If (tempbcol > 83) 
+            tempbcol = 83
+         Endif
+         "set line "tempbcol " 1 "BarbThk
+      Endif
+      "d "snddir"(z="zz")"
+      rec=sublin(result,1)
+      check=substr(rec,1,6)
+      If (check = "Notice") 
+          rec=sublin(result,9)
+      Else
+          rec=sublin(result,8)
+      Endif
+      wdir=subwrd(rec,4)
+      xwind=GetUWnd(wspd,wdir)
+      ywind=GetVWnd(wspd,wdir)
+      "query gr2xy 5 "zz
+      y1=subwrd(result,6) 
+      if (wspd > 0) 
+         cc=polelen/wspd
+         xendpole=poleloc-xwind*cc
+         yendpole=y1-ywind*cc
+      endif
+      if (xendpole>0 & wspd >= 0.5)
+        if (flagbase = 1) 
+           "draw mark 3 "poleloc " " y1 " 0.05"
+        endif
+        "draw line " poleloc " " y1 "  " xendpole " " yendpole
+        flagloop=wspd/10
+        windcount=wspd
+        flagcount=0
+        xflagstart=xendpole
+        yflagstart=yendpole
+        dx=cos((180-wdir)*_dtr)
+        dy=sin((180-wdir)*_dtr)
+        while (windcount > 47.5)
+           flagcount=flagcount+1
+           dxflag=-len50*dx
+           dyflag=-len50*dy
+           xflagend=xflagstart+dxflag
+           yflagend=yflagstart+dyflag
+           windcount=windcount-50
+           x1=xflagstart+0.5*wid50*xwind/wspd
+           y1=yflagstart+0.5*wid50*ywind/wspd
+           x2=xflagstart-0.5*wid50*xwind/wspd
+           y2=yflagstart-0.5*wid50*ywind/wspd
+           If (Fill50 = 1) 
+              "draw polyf "x1" "y1" "x2" "y2" "xflagend" "yflagend" "x1" "y1
+           Else
+              "draw line "x1 " "y1 " " xflagend " " yflagend " "  
+              "draw line "x2 " "y2 " " xflagend " " yflagend
+              "draw line "x1 " "y1 " " x2 " " y2
+           Endif
+           xflagstart=xflagstart+spac50*xwind/wspd
+           yflagstart=yflagstart+spac50*ywind/wspd
+        endwhile
+        while (windcount > 7.5 ) 
+           flagcount=flagcount+1
+           dxflag=-len10*dx
+           dyflag=-len10*dy
+           xflagend=xflagstart+dxflag
+           yflagend=yflagstart+dyflag
+           windcount=windcount-10
+           "draw line " xflagstart " " yflagstart " " xflagend " " yflagend
+           xflagstart=xflagstart+spac10*xwind/wspd
+           yflagstart=yflagstart+spac10*ywind/wspd
+        endwhile
+        if (windcount > 2.5) 
+           flagcount=flagcount+1
+           if (flagcount = 1) 
+              xflagstart=xflagstart+spac05*xwind/wspd
+              yflagstart=yflagstart+spac05*ywind/wspd
+           endif
+           dxflag=-len05*dx
+           dyflag=-len05*dy
+           xflagend=xflagstart+dxflag
+           yflagend=yflagstart+dyflag
+           windcount=windcount-5
+           "draw line " xflagstart " " yflagstart " " xflagend " " yflagend
+        endif
+      else
+        if (wspd < 0.5 & wspd >= 0) 
+           "draw mark 2 " poleloc " " y1 " 0.08"
+        endif
+      endif
+      zz=zz+barbint
+   endwhile
+Endif
+
+*----------------
+* Draw Hodograph
+*----------------
+
+If (DrawHodo = 1)
+   say "Drawing Hodograph."
+
+   If (HodXcent = -1 | HodYcent = -1) 
+      If (PageType = "Portrait") 
+         HodXcent=6
+         HodYcent=9.5
+      Else
+         HodXcent=9
+         HodYcent=7.0
+      Endif
+   Endif
+   HodL=HodXcent-HodSize/2.0
+   HodR=HodXcent+HodSize/2.0
+   HodT=HodYcent+HodSize/2.0
+   HodB=HodYcent-HodSize/2.0
+   RingSpac=HodSize/(NumRing*2)
+   "set line 0"
+   "draw recf "HodL" "HodB" "HodR" "HodT
+   "set line "HodoCol" 1 6"
+   "draw rec "HodL" "HodB" "HodR" "HodT
+   "set line 1 1 3"
+   "set string 1 c"
+   "draw mark 1 "HodXcent " "HodYcent " " HodSize
+   i=1
+   While (i <= NumRing)
+     "set strsiz 0.10"
+     "set string 1 c 3 45"
+     uwnd=-i*HodRing*cos(45*_dtr)
+     xloc=HodXcent+uwnd*RingSpac/HodRing
+     yloc=HodYcent+uwnd*RingSpac/HodRing
+  
+     "draw mark 2 "HodXcent " " HodYcent " " i*HodSize/NumRing
+     "draw string "xloc " " yloc " " HodRing*i
+     i=i+1
+   Endwhile
+   "set string 1 l 3 0"
+   If (TickInt > 0) 
+      i=0
+      while (i < HodRing*NumRing) 
+         dist=i*RingSpac/HodRing
+         hrxloc=HodXcent+dist                
+         hlxloc=HodXcent-dist                      
+         htyloc=HodYcent+dist
+         hbyloc=HodYcent-dist
+         "set line 1 1 3"
+         "draw line "hrxloc " " HodYcent-TickSize/2 " " hrxloc " " HodYcent+TickSize/2
+         "draw line "hlxloc " " HodYcent-TickSize/2 " " hlxloc " " HodYcent+TickSize/2
+         "draw line "HodXcent+TickSize/2 " " htyloc " " HodXcent-TickSize/2 " " htyloc
+         "draw line "HodXcent+TickSize/2 " " hbyloc " " HodXcent-TickSize/2 " " hbyloc
+         i=i+TickInt
+      endwhile
+   Endif
+   "set line "HodoCol " " HodoLine " "HodoThk
+   "draw string "HodL+0.05 " " HodT-0.1 " knots"
+   zloop=_zmin
+   xold=-999
+   yold=-999
+   count=0
+   Depth=0
+   While (zloop < _zmax & Depth < HodoDep)
+      "set z "zloop
+      pres=subwrd(result,4)
+      "d "sndspd
+      rec=sublin(result,1)
+      check=substr(rec,1,6)
+      If (check = "Notice") 
+          rec=sublin(result,9)
+      Else
+          rec=sublin(result,8)
+      Endif
+      wspd=subwrd(rec,4)
+      "d "snddir
+      rec=sublin(result,1)
+      check=substr(rec,1,6)
+      If (check = "Notice") 
+          rec=sublin(result,9)
+      Else
+          rec=sublin(result,8)
+      Endif
+      wdir=subwrd(rec,4)
+      uwnd=GetUWnd(wspd,wdir)
+      vwnd=GetVWnd(wspd,wdir)
+      If (wspd >= 0) 
+         xloc=HodXcent+uwnd*RingSpac/HodRing
+         yloc=HodYcent+vwnd*RingSpac/HodRing
+         If (xloc > 0 & yloc > 0 & xold > 0 & yold > 0) 
+            Depth=Depth+pold-pres
+            count=count+1
+            If (count = 1) 
+               "draw mark 3 "xold " " yold " 0.05"
+            Endif
+            "draw line "xold" "yold" "xloc" "yloc
+         Endif
+         xold=xloc
+         yold=yloc
+      Endif
+      zloop=zloop+1
+      pold=pres
+   EndWhile
+
+   If (count > 0) 
+      "draw mark 3 "xold " " yold " 0.05"
+   Endif
+Endif
+
+*----------------------------------------------
+* Calculate and Display Absolute & S-R Helicity
+*----------------------------------------------
+
+If (DrawHeli = 1) 
+   say "Calculating Helicity & SR Helicity."
+   delp=10
+   UTotal=0
+   VTotal=0
+
+* First, calculate mass-weighted mean wind 
+* Since delp is a constant, and mass is proportional to 
+* delp, this is a simple sum.
+
+   "set lev "_pmax " " _pmin
+   "define uwndarr="sndspd"*cos((270-"snddir")*"_dtr")"
+   "define vwndarr="sndspd"*sin((270-"snddir")*"_dtr")"
+
+   pres=MeanVBot
+   While (pres >= MeanVTop)
+      uwnd=interp(uwndarr,pres)*_ktm
+      vwnd=interp(vwndarr,pres)*_ktm
+      If (uwnd > -900 & vwnd > -900) 
+         UTotal=UTotal+uwnd
+         VTotal=VTotal+vwnd
+      Endif
+      pres=pres-delp
+   EndWhile
+   vcount=1+(MeanVBot-MeanVTop)/delp 
+   Umean=UTotal/vcount
+   Vmean=VTotal/vcount
+   Spdmean=GetWSpd(Umean,Vmean)
+   MeanDir=GetWDir(Umean,Vmean)
+
+* Now, rotate and reduce mean wind to get storm motion
+
+   If (StormMot = 1) 
+      If (Spdmean < 15) 
+         Reduct=0.25
+         Rotate=30
+      Else
+         Reduct=0.20
+         Rotate=20
+      Endif
+   Else
+      Reduct=0.0
+      Rotate=0.0
+   Endif
+
+   UReduce=(1-Reduct)*Umean
+   VReduce=(1-Reduct)*Vmean
+   StormSpd=GetWSpd(UReduce,VReduce)
+
+   StormDir=GetWDir(UReduce,VReduce)+Rotate
+   If (StormDir >= 360) 
+      StormDir=StormDir-360
+   Endif
+
+   StormU=GetUWnd(StormSpd,StormDir)
+   StormV=GetVWnd(StormSpd,StormDir)
+
+* Draw Storm Motion Vector
+
+   xloc=HodXcent+_mtk*StormU*RingSpac/HodRing
+   yloc=HodYcent+_mtk*StormV*RingSpac/HodRing
+
+   "set line 1 1 4"
+   "draw line "HodXcent " " HodYcent " " xloc " " yloc
+   Arr1U=GetUWnd(HodRing/10,StormDir+30)
+   Arr1V=GetVWnd(HodRing/10,StormDir+30)
+   Arr2U=GetUWnd(HodRing/10,StormDir-30)
+   Arr2V=GetVWnd(HodRing/10,StormDir-30)
+
+   xloc2=xloc-Arr1U/HodRing
+   xloc3=xloc-Arr2U/HodRing
+   yloc2=yloc-Arr1V/HodRing
+   yloc3=yloc-Arr2V/HodRing
+
+   "set line 1 1 3"
+
+   If (FillArrw = 0) 
+      "draw line "xloc" "yloc" "xloc2" "yloc2
+      "draw line "xloc" "yloc" "xloc3" "yloc3
+   Else
+      "draw polyf "xloc" "yloc" "xloc2" "yloc2" "xloc3" "yloc3" "xloc" "yloc
+   Endif
+
+ 
+* Now, calculate SR and Environmental Helicity
+ 
+   helic=0
+   SRhelic=0
+   MinP=SfcPlev-HelicDep
+   pres=SfcPlev
+   uwndold=-999
+   vwndold=-999
+   While (pres >= MinP)
+      uwnd=interp(uwndarr,pres)*_ktm
+      vwnd=interp(vwndarr,pres)*_ktm
+      If (uwnd > -900 & uwndold > -900)
+          du=uwnd-uwndold
+          dv=vwnd-vwndold
+          ubar=0.5*(uwnd+uwndold)
+          vbar=0.5*(vwnd+vwndold)
+          uhelic=-dv*ubar                   
+          vhelic=du*vbar                   
+          SRuhelic=-dv*(ubar-StormU)
+          SRvhelic=du*(vbar-StormV)
+          SRhelic=SRhelic+SRuhelic+SRvhelic
+          helic=helic+uhelic+vhelic
+      Endif
+      uwndold=uwnd
+      vwndold=vwnd
+      pres=pres-delp
+   EndWhile
+
+   "set strsiz 0.1"
+   "set string 1 l 3"
+   If (PageType = "Portrait") 
+      If (Text4XC = -1)
+         Text4XC=rxloc-0.75
+      Endif
+      If (Text4YC = -1) 
+         Text4YC=tyloc-5.45
+      Endif
+   Else
+      If (Text4XC = -1)
+         Text4XC=rxloc+2.50
+      Endif
+      If (Text4YC = -1)
+         Text4YC=tyloc-6.10
+      Endif
+   Endif
+   "set line 0 1 3"
+   "draw recf  "Text4XC-0.75 " "Text4YC-0.5 " " Text4XC+0.75 " " Text4YC+0.5
+   "set line 1 1 3"
+   "draw rec  "Text4XC-0.75 " "Text4YC-0.5 " " Text4XC+0.75 " " Text4YC+0.5
+   "draw string "Text4XC-0.45 " " Text4YC+0.40 " Hodograph"
+   "draw string "Text4XC-0.70 " " Text4YC+0.20 " EH"
+   "draw string "Text4XC+0.25 " " Text4YC+0.20 " "int(helic)
+   "draw string "Text4XC-0.70 " " Text4YC+0.05 " SREH"
+   "draw string "Text4XC+0.25 " " Text4YC+0.05 " " int(SRhelic)
+   "draw string "Text4XC-0.70 " " Text4YC-0.20 " StmDir"
+   "draw string "Text4XC+0.25 " " Text4YC-0.20 " " int(StormDir)"`3.`0"
+   "draw string "Text4XC-0.70 " " Text4YC-0.35 " StmSpd(kt)"
+   "draw string "Text4XC+0.25 " " Text4YC-0.35 " " int(_mtk*StormSpd)
+Endif
+
+ "draw string "Text4XC-0.70 " " Text4YC-0.80 " Longitude"
+ "draw string "Text4XC+0.25 " " Text4YC-0.80 " " _xlon
+ "draw string "Text4XC-0.70 " " Text4YC-1.00 " Latitude"
+ "draw string "Text4XC+0.25 " " Text4YC-1.00 " " _ylat
+ if (OL = 1)
+ "draw string "Text4XC-0.70 " " Text4YC-1.20 " Time"
+ "draw string "Text4XC+0.25 " " Text4YC-1.20 " " _ttime
+ endif
+ if (OL = 2)
+  "set string 3"
+  "draw string "Text4XC+0.25 " " Text4YC-1.40 " " _ttime
+  "set string 1"
+ endif
+ "set string 7"
+ "draw string "Text4XC-0.99 " " Text4YC-1.70 " Initial Time"
+ "draw string "Text4XC+0.25 " " Text4YC-1.70 " " _analysis
+ "set string 1"
+
+*---------------------------------------------------
+* Plot RH profile.
+*---------------------------------------------------
+
+If (DrawRH = 1)
+  "set z "_zmin" "_zmax
+  "set x "_xval
+  "set y "_yval
+  "set t "_tval
+  "set zlog on"
+  "set gxout line"
+  "set ccolor "RHCol
+  "set cstyle "RHLine
+  "set cmark "RHMrk
+  "set digsiz "MrkSize
+  "set missconn on"
+  "set xlab on"
+  "set frame off"
+  "set vrange 0 350"
+  "set xlpos 0 t"
+  "set xlevs 25 50 75 100"
+  "set grid vertical 5"
+  "define rh=100*exp((17.2694*"snddewp")/("snddewp"+237.3)-(17.2694*"sndtemp")/("sndtemp"+237.3))"
+  "d rh"
+   If (LblAxes = 1)
+     "set string 1 c 3 0"
+     "set strsiz 0.125"
+     If (PageType = "Portrait")
+       "draw string 1.5 10.85 RH (%)"
+     Else
+       "draw string 1.75 8.35 RH (%)"
+     Endif
+   Endif
+Endif
+
+*------------------------------------------
+* Reset environment to original dimensions
+*------------------------------------------
+
+"set t "_tval
+"set x "_xval 
+"set y "_yval 
+"set z "_zmin " "_zmax
+
+say "Done."
+
+Return(0)
+
+*************************************************************************
+function Templcl(temp,dewp)
+
+*------------------------------------------------------
+* Calculate the temp at the LCL given temp & dewp in C
+*------------------------------------------------------
+
+tempk=temp+273.15
+dewpk=dewp+273.15
+Parta=1/(dewpk-56)
+Partb=log(tempk/dewpk)/800
+Tlcl=1/(Parta+Partb)+56
+return(Tlcl-273.15)
+
+**************************************************************************
+
+function Preslcl(temp,dewp,pres)
+
+*-------------------------------------------------------
+* Calculate press of LCL given temp & dewp in C and pressure
+*-------------------------------------------------------
+
+Tlclk=Templcl(temp,dewp)+273.15
+tempk=temp+273.15
+theta=tempk*pow(1000/pres,0.286)
+plcl=1000*pow(Tlclk/theta,3.48)
+return(plcl)
+
+**************************************************************************
+function LiftWet(startt,startp,endp,display,Pmin,Pmax)
+
+*--------------------------------------------------------------------
+* Lift a parcel moist adiabatically from startp to endp.
+* Init temp is startt in C.  If you wish to see the parcel's
+* path plotted, display should be 1.  Returns temp of parcel at endp.
+*--------------------------------------------------------------------
+
+temp=startt
+pres=startp
+cont = 1
+delp=10
+While (pres >= endp & cont = 1) 
+    If (display = 1) 
+       xtemp=GetXLoc(temp,pres)
+       "q w2xy "xtemp" "pres
+       xloc=subwrd(result,3)
+       yloc=subwrd(result,6)
+       If (xtemp < 0 | xtemp > 100)
+          cont=0
+       Else
+          If (pres >= Pmin & pres < Pmax & pres < startp)  
+             "draw line "xold" "yold" "xloc" "yloc 
+          Endif
+       Endif
+    Endif
+    xold=xloc
+    yold=yloc
+    temp=temp-100*delp*gammaw(temp,pres-delp/2,100)
+    pres=pres-delp
+EndWhile
+return(temp)
+
+
+**************************************************************************
+function LiftDry(startt,startp,endp,display,Pmin,Pmax)
+
+*--------------------------------------------------------------------
+* Lift a parcel dry adiabatically from startp to endp.
+* Init temp is startt in C.  If you wish to see the parcel's
+* path plotted, display should be 1.  Returns temp of parcel at endp.
+*--------------------------------------------------------------------
+
+starttk=startt+273.15
+cont = 1
+delp=10
+round=int(startp/10)*10
+subscr=0.1*round
+powstart=pow(startp,-0.286)
+temp=starttk*_powpres.subscr*powstart-273.15
+pres=round-10
+While (pres >= endp & cont = 1) 
+    subscr=0.1*pres
+    temp=starttk*_powpres.subscr*powstart-273.15
+    If (display = 1) 
+       xtemp=GetXLoc(temp,pres)
+       "q w2xy "xtemp" "pres
+       xloc=subwrd(result,3)
+       yloc=subwrd(result,6)
+       If (xtempold > 0 & xtempold < 100 & xtemp > 0 & xtemp < 100) 
+          If (pres >= Pmin & pres < Pmax & pres < startp)  
+             "draw line "xold" "yold" "xloc" "yloc 
+          Endif
+       Endif
+    Endif
+    xold=xloc
+    xtempold=xtemp
+    yold=yloc
+    pres=pres-delp
+EndWhile
+return(temp)
+
+**************************************************************************
+function CAPE(startt,startp,endp,sndtemp,snddewp)
+
+*---------------------------------------------------------------------
+* Returns all postive area and convective inhibition above LCL.
+* Parcel is lifted from LCL at startt,startp and is halted
+* at endp.   Integration method used is trapezoid method.
+*---------------------------------------------------------------------
+
+pres=startp
+PclTemp=startt
+PclTempV=virtual2(PclTemp+273.15,PclTemp+273.15,pres)-273.15
+delp=10
+Pos=0
+Neg=0
+Neg2=0
+
+count=0
+While (pres >= endp)
+   EnvTemp=interp(sndtemp,pres)
+   EnvDewp=interp(snddewp,pres)
+   EnvTempV=virtual2(EnvTemp+273.15,EnvDewp+273.15,pres)-273.15
+   DelT=PclTempV-EnvTempV
+   If (abs(EnvTempV) < 130 & abs(PclTempV) < 130)
+     count=count+1
+     If (count > 1) 
+       Val=DelT/pres+Prev 
+       If (Val > 0)
+          Pos=Pos+Val
+          Neg2=0
+       Else
+          Neg=Neg+abs(Val)
+          Neg2=Neg2+abs(Val)
+       Endif
+     Endif
+     Prev=DelT/pres
+   Endif
+   pres=pres-delp
+   PclTemp=PclTemp-100*delp*gammaw(PclTemp,pres,100)
+   PclTempV=virtual2(PclTemp+273.15,PclTemp+273.15,pres)-273.15
+Endwhile
+
+Pos=0.5*Pos*287*delp
+CIN=0.5*(Neg-Neg2)*287*delp
+
+return(Pos" "CIN)
+
+***************************************************************************
+function gammaw(tempc,pres,rh)
+
+*-----------------------------------------------------------------------
+* Function to calculate the moist adiabatic lapse rate (deg C/Pa) based
+* on the temperature, pressure, and rh of the environment.
+*----------------------------------------------------------------------
+
+tempk=tempc+273.15
+es=satvap2(tempc)
+ws=mixratio(es,pres)
+w=rh*ws/100
+tempv=virtual(tempk,w)
+latent=latentc(tempc)
+
+A=1.0+latent*ws/(287*tempk)
+B=1.0+0.622*latent*latent*ws/(1005*287*tempk*tempk)
+Density=100*pres/(287*tempv)
+lapse=(A/B)/(1005*Density)
+return(lapse)
+
+*************************************************************************
+function latentc(tempc)
+
+*-----------------------------------------------------------------------
+* Function to return the latent heat of condensation in J/kg given
+* temperature in degrees Celsius.
+*-----------------------------------------------------------------------
+
+val=2502.2-2.43089*tempc
+
+return(val*1000)
+
+*************************************************************************
+function precipw(sndtemp,snddewp,startp,endp)
+
+*-----------------------------------------------------------------------
+* Function to calculate the precipitable water (cm) in a sounding
+* starting at pressure level startp and ending at pressure level endp.
+*-----------------------------------------------------------------------
+
+ppold=-999
+ttold=-999
+ddold=-999
+delp=10
+Int=0
+mix=0 
+pres=startp
+logpp=log(pres)
+logppm=log(pres-delp)
+while (pres >= endp)
+   tt=interp(sndtemp,pres)
+   dd=interp(snddewp,pres)
+   if (tt>-900 & ttold>-900 & dd>-900 & ddold>-900) 
+      e=satvap2(dd)
+      mix=mixratio(e,pres)
+      mixavg=(logpp*mix+logppm*mixold)/(logpp+logppm)
+      Int=Int+1.020408*mixavg*delp
+   endif
+   ttold=tt
+   ddold=dd
+   ppold=pp
+   mixold=mix
+   pres=pres-delp
+   logpp=logppm
+   logppm=log(pres-delp)
+endwhile
+
+return(Int)
+
+*************************************************************************
+
+function virtual(temp,mix)
+
+*------------------------------------------------------------
+* Function to return virtual temperature given temperature in 
+* kelvin and mixing ratio in g/g.
+*-------------------------------------------------------------
+
+tempv=temp*(1.0+0.6*mix)
+
+return (tempv)
+
+************************************************************************
+
+function virtual2(temp,dewp,pres)
+  
+*------------------------------------------------------------
+* Function to return virtual temperature in kelvin given temperature in
+* kelvin and dewpoint in kelvin and pressure in mb
+*-------------------------------------------------------------
+
+if (temp > 0 & dewp > 0) 
+  vap=satvap2(dewp-273.15)
+  mix=mixratio(vap,pres)
+  tempv=virtual(temp,mix)
+else
+  tempv=-9999
+endif
+
+return (tempv)
+  
+************************************************************************
+
+function satvapor(temp)
+
+*---------------------------------------------------------------
+* Given temp in Celsius, returns saturation vapor pressure in mb
+*---------------------------------------------------------------
+
+pol=_C0+temp*(_C1+temp*(_C2+temp*(_C3+temp*(_C4+temp*(_C5+temp*(_C6+temp*(_C7+temp*(_C8+temp*(_C9)))))))))
+
+return(6.1078/pow(pol,8))
+
+************************************************************************
+
+function satvap2(temp)
+
+*---------------------------------------------------------------
+* Given temp in Celsius, returns saturation vapor pressure in mb
+*---------------------------------------------------------------
+
+es=6.112*exp(17.67*temp/(temp+243.5))
+
+return(es)
+
+*************************************************************************
+
+function mixratio(e,p)
+
+*------------------------------------------------------
+* Given vapor pressure and pressure, return mixing ratio
+*-------------------------------------------------------
+
+mix=0.622*e/(p-e)
+
+return(mix)
+
+************************************************************************
+
+function getrh(temp,dewp,pres)
+
+tempk=temp+273.15
+dewpk=dewp+273.15
+
+es=satvap2(temp)
+
+If (temp > 0) 
+   A=2.53*pow(10,9)
+   B=5420
+Else
+   A=3.41*pow(10,10)
+   B=6130
+Endif
+
+w=A*0.622*exp(-B/dewpk)/pres
+ws=mixratio(es,pres)
+
+return(100*w/ws)
+
+************************************************************************
+function interp(array,pres)
+
+*------------------------------------------------------------------------
+* Interpolate inside array for pressure level pres.
+* Returns estimated value of array at pressure pres.
+*------------------------------------------------------------------------
+
+"set gxout stat"
+"set lev "pres
+altpres=subwrd(result,4)
+"q dims"
+rec=sublin(result,4)
+zlev=subwrd(rec,9)
+
+If (zlev < 2 | zlev > _zmaxfile)
+  Vest = -9999.0
+Else
+  If (altpres > pres)
+    zlev=zlev+1
+  Endif
+  "set z "zlev
+  PAbove=subwrd(result,4)
+  "d "array"(lev="PAbove")"
+  rec=sublin(result,1)
+  check=substr(rec,1,6)
+  If (check = "Notice") 
+      rec=sublin(result,9)
+  Else
+      rec=sublin(result,8)
+  Endif
+  VAbove=subwrd(rec,4)
+  "set z "zlev-1
+  PBelow=subwrd(result,4)
+  "d "array"(lev="PBelow")"
+  rec=sublin(result,1)
+  check=substr(rec,1,6)
+  If (check = "Notice") 
+      rec=sublin(result,9)
+  Else
+      rec=sublin(result,8)
+  Endif
+  VBelow=subwrd(rec,4)
+
+* Now if we are in a region of missing data, find next good level.
+
+  If (abs(VAbove) > 130 & zlev > 1 & zlev < _zmaxfile)
+     zz=zlev
+     While (abs(VAbove) > 130 & zz < _zmaxfile)
+       zz=zz+1
+       "set z "zz
+       PAbove=subwrd(result,4)
+       "d "array"(lev="PAbove")"
+       rec=sublin(result,1)
+       check=substr(rec,1,6)
+       If (check = "Notice") 
+           rec=sublin(result,9)
+       Else
+           rec=sublin(result,8)
+       Endif
+       VAbove=subwrd(rec,4)
+     EndWhile
+  Endif
+
+  If (abs(VBelow) > 130 & zlev > 1 & zlev < _zmaxfile)
+      zz=zlev-1
+      While (abs(VBelow) > 130 & zz > 1) 
+        zz=zz-1
+        "set z "zz
+        PBelow=subwrd(result,4)
+        "d "array"(lev="PBelow")"
+        rec=sublin(result,1)
+        check=substr(rec,1,6)
+        If (check = "Notice") 
+            rec=sublin(result,9)
+        Else
+            rec=sublin(result,8)
+        Endif
+        VBelow=subwrd(rec,4)
+      EndWhile
+  Endif
+
+  If (abs(VAbove) < 130 & abs(VBelow) < 130)
+     Vest=VBelow+log(PBelow/pres)*(VAbove-VBelow)/log(PBelow/PAbove)
+  Else
+     Vest=-9999.0
+  Endif
+
+Endif
+
+Return(Vest)
+
+****************************************************************************
+
+function GetUWnd(wspd,wdir)
+
+*------------------------
+* Get x-component of wind. 
+*------------------------
+
+
+If (wspd >= 0) 
+   xwind=wspd*cos((270-wdir)*_dtr)
+Else
+   xwind = -9999.0
+Endif
+return(xwind)
+
+**************************************************************************
+
+function GetVWnd(wspd,wdir)
+
+*-----------------------
+* Get y-component of wind
+*------------------------
+
+If (wspd >= 0) 
+   ywind=wspd*sin((270-wdir)*_dtr)
+Else
+   ywind = -9999.0
+Endif
+return(ywind)
+
+
+*************************************************************************
+
+function GetWSpd(xwind,ywind)
+
+
+"set gxout stat"
+"d mag("xwind","ywind")"
+rec=sublin(result,1)
+check=substr(rec,1,6)
+If (check = "Notice") 
+    rec=sublin(result,9)
+Else
+    rec=sublin(result,8)
+Endif
+val=subwrd(rec,4)
+
+return (val)
+
+*************************************************************************
+
+function GetWDir(xwind,ywind)
+
+* Return wind direction given x and y components
+
+"set gxout stat"
+"define theta=270-"_rtd"*atan2("ywind","xwind")"
+"d theta"
+rec=sublin(result,1)
+check=substr(rec,1,6)
+If (check = "Notice") 
+    rec=sublin(result,9)
+Else
+    rec=sublin(result,8)
+Endif
+Dir=subwrd(rec,4)
+
+If (Dir > 360)
+   Dir=Dir-360
+Endif
+
+If (Dir < 0)
+   Dir=360+Dir
+Endif
+
+return(Dir)
+
+*************************************************************************
+
+function GetXLoc(temp,pres)
+
+*-------------------------------------------------
+* Get x-location on skew-t based on temp, pressure
+*-------------------------------------------------
+
+xloc=(temp-_m1*log10(pres)-_m3)/_m2
+return(xloc)
+
+*************************************************************************
+ 
+function GetTemp(xloc,pres) 
+
+*------------------------------------------------- 
+* Return temperature at location given by xloc,pres
+*-------------------------------------------------
+
+tempval=_m1*log10(pres)+_m2*xloc+_m3
+return(tempval)
+
+**************************************************************************
+
+function GetTheta(temp,pres)         
+
+*---------------------------------------------------
+* Calculate theta for a given temperature and pressure
+*---------------------------------------------------
+
+theta=(temp+273.15)*pow(1000/pres,0.286)-273.15
+return(theta)
+
+
+*************************************************************************
+
+function GetThet2(temp,dewp,pres)         
+
+*---------------------------------------------------
+* Calculate theta for a given temperature,dewp, and pressure
+*---------------------------------------------------
+
+tempk=273.15+temp
+dewpk=273.15+dewp
+
+es=satvap2(temp)
+ws=mixratio(es,pres)
+
+mix=10*getrh(temp,dewp,pres)*ws
+
+exponent=0.2854*(1.0-0.00028*mix)
+theta=(temp+273.15)*pow(1000/pres,exponent)-273.15
+return(theta)
+
+*************************************************************************
+
+function Thetae(temp,dewp,pres)
+
+*--------------------------------------------------------------
+* Return equiv. pot. temp in Kelvin given temp, dewp in celsius
+*--------------------------------------------------------------
+
+es=satvap2(temp)
+ws=mixratio(es,pres)
+mix=10*getrh(temp,dewp,pres)*ws
+theta=GetThet2(temp,dewp,pres)+273.15
+TLcl=Templcl(temp,dewp)+273.15
+thetae=theta*exp((3.376/TLcl-0.00254)*mix*1.0+0.00081*mix)
+
+return(thetae)
+
+**************************************************************************
+
+
+function int(i0)
+
+*--------------------------
+* Return integer of i0
+*--------------------------
+  i=0
+  while(i<12)
+    i=i+1
+    if(substr(i0,i,1)='.')
+      i0=substr(i0,1,i-1)
+      break
+    endif
+  endwhile
+return(i0)
+
+*************************************************************************
+
+function abs(i)
+
+*----------------------------
+* return absolute value of i
+*----------------------------
+
+  if (i < 0) 
+     absval=-i
+  else 
+     absval=i
+  endif
+
+return(absval)
+
+*************************************************************************
+
+function log(i)
+
+*---------------------------
+* return natural log of i
+*---------------------------
+
+"set gxout stat"
+"d log("i")"
+rec=sublin(result,1)
+check=substr(rec,1,6)
+If (check = "Notice") 
+    rec=sublin(result,9)
+Else
+    rec=sublin(result,8)
+Endif
+val=subwrd(rec,4)
+return(val)
+
+*************************************************************************
+
+function log10(i)
+
+*--------------------------
+* return log base 10 of i
+*--------------------------
+
+"set gxout stat"
+"d log10("i")"
+rec=sublin(result,1)
+check=substr(rec,1,6)
+If (check = "Notice") 
+    rec=sublin(result,9)
+Else
+    rec=sublin(result,8)
+Endif
+val=subwrd(rec,4)
+return(val)
+
+*************************************************************************
+
+function pow(i,j)
+
+*-------------------------------
+* return power of i raised to j
+*-------------------------------
+
+"set gxout stat"
+"d pow("i","j")"
+rec=sublin(result,1)
+check=substr(rec,1,6)
+If (check = "Notice") 
+    rec=sublin(result,9)
+Else
+    rec=sublin(result,8)
+Endif
+val=subwrd(rec,4)
+return(val)
+
+************************************************************************
+
+function cos(i)
+
+*-----------------------------------------
+* return cosine of i, where i is in radians
+*------------------------------------------
+
+"set gxout stat"
+"d cos("i")"
+rec=sublin(result,1)
+check=substr(rec,1,6)
+If (check = "Notice") 
+    rec=sublin(result,9)
+Else
+    rec=sublin(result,8)
+Endif
+val=subwrd(rec,4)
+return(val)
+
+************************************************************************
+
+function sin(i)
+
+*------------------------------------------
+* return sine of i, where i is in radians
+*------------------------------------------
+
+"set gxout stat"
+"d sin("i")"
+rec=sublin(result,1)
+check=substr(rec,1,6)
+If (check = "Notice") 
+    rec=sublin(result,9)
+Else
+    rec=sublin(result,8)
+Endif
+val=subwrd(rec,4)
+return(val)
+
+************************************************************************
+
+function exp(i)
+
+*------------------------------------------
+* return exponential of i
+*------------------------------------------
+
+"set gxout stat"
+"d exp("i")"
+rec=sublin(result,1)
+check=substr(rec,1,6)
+If (check = "Notice") 
+    rec=sublin(result,9)
+Else
+    rec=sublin(result,8)
+Endif
+val=subwrd(rec,4)
+return(val)
+
+***********************************************************************
+function round(i)
+
+rr=abs(1.0*i)
+rr=int(rr+0.5)
+if (i < 0)
+   rr=-1*rr      
+endif
+return(rr)
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/sqx.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/sqx.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/sqx.gs	(revision 207)
@@ -0,0 +1,70 @@
+'reinit'
+'open sqx.ctl'
+
+'set display color white'
+'run rgbset.gs'
+
+say 'Create gif images as well (1=yes ; 0=no)'
+pull ans
+frame = 1
+
+'q file'
+rec=sublin(result,5)
+_endtime=subwrd(rec,12)
+
+runscript = 1
+dis_t = 1
+
+'set xlab off'
+'set ylab off'
+
+while(runscript)
+
+'set t ' dis_t
+'q dims'
+rec=sublin(result,5)
+_analysis=subwrd(rec,6)
+
+say 'Time is ' _analysis
+'c'
+'set grads off'
+'set gxout shaded'
+'d qvapor*1000.0'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.0 8.35   Water Vapor (g/kg)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 8.5 8.1 ' _analysis
+'run cbar.gs'
+if(ans)
+'printim sqx'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+'c'
+'set grads off'
+'set gxout shaded'
+'d qcloud*1000.0'
+'set gxout contour'
+'set cmin 0.01'
+'d qrain*1000.0'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.0.7 8.35   Cloud (color) and rain (g/kg)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 8.5 8.1 ' _analysis
+'run cbar.gs'
+if(ans)
+'printim sqx'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+
+if ( dis_t=_endtime )
+ runscript=0
+endif 
+dis_t = dis_t + 1
+endwhile
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/sqy.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/sqy.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/sqy.gs	(revision 207)
@@ -0,0 +1,70 @@
+'reinit'
+'open sqy.ctl'
+
+'set display color white'
+'run rgbset.gs'
+
+say 'Create gif images as well (1=yes ; 0=no)'
+pull ans
+frame = 1
+
+'q file'
+rec=sublin(result,5)
+_endtime=subwrd(rec,12)
+
+runscript = 1
+dis_t = 1
+
+'set xlab off'
+'set ylab off'
+
+while(runscript)
+
+'set t ' dis_t
+'q dims'
+rec=sublin(result,5)
+_analysis=subwrd(rec,6)
+
+say 'Time is ' _analysis
+'c'
+'set grads off'
+'set gxout shaded'
+'d qvapor*1000.0'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.0 8.35   Water Vapor (g/kg)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 8.5 8.1 ' _analysis
+'run cbar.gs'
+if(ans)
+'printim sqy'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+'c'
+'set grads off'
+'set gxout shaded'
+'d qcloud*1000.0'
+'set gxout contour'
+'set cmin 0.01'
+'d qrain*1000.0'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 4.0.7 8.35   Cloud (color) and rain (g/kg)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 8.5 8.1 ' _analysis
+'run cbar.gs'
+if(ans)
+'printim sqy'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+
+if ( dis_t=_endtime )
+ runscript=0
+endif 
+dis_t = dis_t + 1
+endwhile
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/zlevels.gs
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/zlevels.gs	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/scripts/zlevels.gs	(revision 207)
@@ -0,0 +1,160 @@
+'reinit'
+'open real_z.ctl'
+
+** need input data on height levels
+
+'set mpdset hires'
+'set display color white'
+'run rgbset.gs'
+
+say 'Create gif images as well (1=yes ; 0=no)'
+pull ans
+frame = 1
+
+'q file'
+rec=sublin(result,5)
+_endtime=subwrd(rec,12)
+_endlev=subwrd(rec,9)
+
+runscript = 1
+dis_t = 1
+
+while(runscript)
+dis_z = 1
+'set t ' dis_t
+'q dims'
+rec=sublin(result,5)
+_analysis=subwrd(rec,6)
+say 'Time is ' _analysis
+
+runlevel = 1
+while(runlevel)
+'set z ' dis_z
+'q dims'
+rec=sublin(result,4)
+newz=subwrd(rec,6)
+say 'Level is ' newz
+
+** Looking for 2 km data
+if (newz=2)
+say 'Plotting'
+'c'
+'set grads off'
+'set gxout shaded'
+'set clevs 10 20 30 40 50 60 70 80 90 100'        
+'set ccols 0 0 0  0 33 34 35 36 37 38  39'
+'d rh'
+'set gxout contour'
+'set ccolor 4'
+'set cthick 6'
+'set cint 2'
+'d p'
+'set ccolor 2'
+'set cthick 6'
+'set cint 2'
+'d tc'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 2.7 8.35  Height (m,blue), T(C,red), RH(color)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 1.5 8.0 ' newz ' km'
+'run cbar.gs'
+if(ans)
+'printim realz'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+endif
+
+** Looking for 5 km data
+if (newz=5)
+say 'Plotting'
+'c'
+'set ccolor 4'
+'set cthick 6'
+'set cint 2'
+'d p'
+'set ccolor 2'
+'set cthick 6'
+'set cint 2'
+'d tc'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 3.7 8.35  Height (m,blue), T(C,red)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 1.5 8.0 ' newz ' km'
+if(ans)
+'printim realz'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+endif
+
+** Looking for 10 km data
+if (newz=10)
+say 'Plotting'
+'c'
+'set ccolor 4'
+'set cthick 6'
+'set cint 2'
+'d p'
+'set ccolor 2'
+'set cthick 6'
+'set cint 2'
+'d tc'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 3.7 8.35  Height (m,blue), T(C,red)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 1.5 8.0 ' newz ' km'
+if(ans)
+'printim realz'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+endif
+
+** Looking for 16 km data
+if (newz=16)
+say 'Plotting'
+'c'
+'set ccolor 4'
+'set cthick 6'
+'set cint 2'
+'d p'
+'set ccolor 2'
+'set cthick 6'
+'set cint 2'
+'d tc'
+'set strsiz .2'
+'set string 1 l 6'
+'draw string 3.7 8.35  Height (m,blue), T(C,red)'
+'set strsiz .15'
+'set string 1 l 3'
+'draw string 7.5 8.0 ' _analysis
+'draw string 1.5 8.0 ' newz ' km'
+if(ans)
+'printim realz'frame'.gif gif '
+frame=frame+1
+endif
+pull dummy
+endif
+
+if ( dis_z=_endlev )
+ runlevel=0
+endif
+dis_z = dis_z + 1
+endwhile
+
+if ( dis_t=_endtime )
+ runscript=0
+endif 
+dis_t = dis_t + 1
+endwhile
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/ARWpost.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/ARWpost.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/ARWpost.f90	(revision 207)
@@ -0,0 +1,29 @@
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! PROGRAM ARWpost
+!
+! First version: Cindy Bruyere - November 2006 
+! 
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+PROGRAM ARWpost
+
+   USE gridinfo_module
+   USE module_debug
+   USE process_domain_module
+
+
+   ! Get info about how many nests there are to process, etc.
+   CALL get_namelist_params()
+
+   ! Now begin the processing work
+   CALL mprintf(.true.,STDOUT,'START PROCESSING DATA')
+   CALL process_domain()
+
+   ! If we are back here - all went well
+   CALL mprintf(.true.,STDOUT,'  ')
+   CALL mprintf(.true.,STDOUT,'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
+   CALL mprintf(.true.,STDOUT,'!  Successful completion of ARWpost.  !')
+   CALL mprintf(.true.,STDOUT,'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
+
+   STOP
+ 
+END PROGRAM ARWpost
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/Makefile
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/Makefile	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/Makefile	(revision 207)
@@ -0,0 +1,96 @@
+
+include ../configure.arwp
+
+OBJS = wrf_debug.o module_model_basics.o constants_module.o gridinfo_module.o ARWpost.o input_module.o output_module.o module_map_utils.o v5d_module.o misc_definitions_module.o module_date_pack.o module_debug.o process_domain_module.o queue_module.o module_get_file_names.o module_interp.o module_diagnostics.o module_arrays.o module_pressure.o module_calc_height.o module_calc_pressure.o module_calc_theta.o module_calc_tk.o module_calc_tc.o module_calc_td.o module_calc_rh.o module_calc_uvmet.o module_calc_slp.o module_calc_dbz.o module_calc_cape.o module_calc_wdir.o module_calc_wspd.o module_calc_clfr.o
+
+
+wrong: 
+	clear ;
+	@echo " "
+	@echo "go up one directory and type compile to build ARWpost"
+	@echo " "
+	@echo " "
+
+
+all: ARWpost.exe
+
+ARWpost.exe: $(OBJS)
+	$(FC) $(LDFLAGS) -o $@ $(OBJS)  \
+		$(WRF_DIR_PRE)$(WRF_DIR)/frame/module_internal_header_util.o  \
+		$(WRF_DIR_PRE)$(WRF_DIR)/frame/module_machine.o  \
+		$(WRF_DIR_PRE)$(WRF_DIR)/frame/pack_utils.o  \
+		-L$(NETCDF)/lib -I$(NETCDF)/include  \
+		-I$(WRF_DIR_PRE)$(WRF_DIR)/external/io_grib1  \
+		-I$(WRF_DIR_PRE)$(WRF_DIR)/external/io_int  \
+		-I$(WRF_DIR_PRE)$(WRF_DIR)/external/io_netcdf  \
+		-I$(WRF_DIR_PRE)$(WRF_DIR)/external/io_grib_share  \
+		-L$(WRF_DIR_PRE)$(WRF_DIR)/external/io_netcdf  \
+		-L$(WRF_DIR_PRE)$(WRF_DIR)/external/io_grib1  \
+		-L$(WRF_DIR_PRE)$(WRF_DIR)/external/io_int  \
+		-L$(WRF_DIR_PRE)$(WRF_DIR)/external/io_grib_share  \
+		-lwrfio_int -lwrfio_nf -lio_grib1 -lio_grib_share -lnetcdf \
+		$(LIBVIS5D)
+
+
+module_model_basics.o:
+
+constants_module.o:
+
+misc_definitions_module.o:
+
+module_date_pack.o:
+
+module_get_file_names.o:
+
+module_arrays.o: module_model_basics.o gridinfo_module.o
+
+module_pressure.o: module_model_basics.o
+
+module_interp.o:
+
+module_map_utils.o:
+
+wrf_debug.o:
+
+module_debug.o:
+
+queue_module.o: module_debug.o
+
+gridinfo_module.o: misc_definitions_module.o module_debug.o module_get_file_names.o
+
+input_module.o: gridinfo_module.o misc_definitions_module.o queue_module.o 
+
+output_module.o: input_module.o module_model_basics.o module_arrays.o
+
+v5d_module.o: gridinfo_module.o output_module.o module_map_utils.o
+
+process_domain_module.o: module_date_pack.o gridinfo_module.o input_module.o output_module.o v5d_module.o misc_definitions_module.o module_debug.o module_interp.o module_diagnostics.o module_arrays.o module_model_basics.o module_pressure.o
+
+ARWpost.o: gridinfo_module.o module_debug.o process_domain_module.o
+
+
+
+module_diagnostics.o: gridinfo_module.o output_module.o module_arrays.o module_interp.o module_pressure.o module_calc_height.o module_calc_pressure.o module_calc_tk.o module_calc_tc.o module_calc_theta.o module_calc_td.o module_calc_rh.o module_calc_uvmet.o module_calc_slp.o module_calc_dbz.o module_calc_cape.o module_calc_wdir.o module_calc_wspd.o module_calc_clfr.o
+
+module_calc_cape.o: module_model_basics.o constants_module.o
+module_calc_dbz.o: module_model_basics.o constants_module.o
+module_calc_height.o: module_model_basics.o constants_module.o
+module_calc_pressure.o: module_model_basics.o
+module_calc_slp.o: module_model_basics.o constants_module.o
+module_calc_rh.o: module_model_basics.o constants_module.o
+module_calc_tk.o: module_model_basics.o constants_module.o
+module_calc_tc.o: module_model_basics.o constants_module.o
+module_calc_td.o: module_model_basics.o
+module_calc_theta.o: module_model_basics.o
+module_calc_uvmet.o: module_model_basics.o
+module_calc_wdir.o: module_model_basics.o
+module_calc_wspd.o: module_model_basics.o
+module_calc_clfr.o: module_model_basics.o
+
+clean:
+	rm -f $(OBJS) *.mod
+
+clobber:
+	rm -f $(OBJS) *.mod
+	rm -f *.f
+	rm -f ARWpost.exe 
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/Mars_modif
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/Mars_modif	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/Mars_modif	(revision 207)
@@ -0,0 +1,14 @@
+-rw-r--r--    1 aslmd    lmdjus       1751 Aug 31 09:17 constants_module_Mars.f90
+-rw-r--r--    1 aslmd    lmdjus        465 Aug 31 09:23 module_calc_theta_Mars.f90
+-rw-r--r--    1 aslmd    lmdjus      19833 Aug 31 09:41 module_date_pack_Mars.f90
+-rw-r--r--    1 aslmd    lmdjus      21120 Aug 31 09:44 module_diagnostics_Mars.f90
+-rw-r--r--    1 aslmd    lmdjus      41221 Aug 31 09:47 module_map_utils_Mars.f90
+-rw-r--r--    1 aslmd    lmdjus      13153 Aug 31 09:57 output_module_Mars.F90
+-rw-r--r--    1 aslmd    lmdjus      26895 Aug 31 10:02 process_domain_module.F90
+gridinfo_module.F90
+
+
+TODO IF NEEDED
+-rw-r--r--    1 aslmd    lmdjus      10012 May 29 23:50 v5d_module.f90
+-rwxr-xr--    1 aslmd    lmdjus        739 May 24 22:21 v5df.h
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/constants_module.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/constants_module.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/constants_module.f90	(revision 207)
@@ -0,0 +1,55 @@
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! MODULE CONSTANTS_MODULE
+!
+! This module defines constants that are used by other modules 
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+MODULE constants_module
+
+   real, parameter :: PI = 3.141592653589793
+   real, parameter :: OMEGA_E = 7.0721E-5 ! Angular rotation rate of Mars
+
+   real, parameter :: DEG_PER_RAD = 180./PI
+   real, parameter :: RAD_PER_DEG = PI/180.
+ 
+   ! Mean Earth Radius in m.  The value below is consistent
+   ! with NCEP's routines and grids.
+   real, parameter :: EARTH_RADIUS_M = 3397200.   ! same as MM5 system
+   real, parameter :: EARTH_CIRC_M = 2.*PI*EARTH_RADIUS_M
+
+   real, parameter :: G = 3.72
+   real, parameter :: Rd = 192.
+   real, parameter :: Rv = 461.6
+   real, parameter :: Cp = 4.4*Rd
+   real, parameter :: Cv = Cp-Rd
+   real, parameter :: RCP = Rd/Cp
+   real, parameter :: T0 = 273.16
+   real, parameter :: p0 = 610.
+!   real, parameter :: GAMMA = 0.0065
+   real, parameter :: GAMMA = Rd/Cp 
+   real, parameter :: GAMMA_RIP = Rd/Cp 
+
+!
+! TODO: modify below for Mars
+!
+
+   real, parameter :: Rm = .608 
+   real, parameter :: CPMD = 0.887
+   real, parameter :: GAMMAMD = Rm-CPMD
+
+   real, parameter :: CELKEL = 273.15
+   real, parameter :: RHOWAT = 1000.
+   real, parameter :: EPS = 0.622
+   real, parameter :: EZERO = 6.112
+
+   real, parameter :: ESLCON1 = 17.67
+   real, parameter :: ESLCON2 = 29.65
+   real, parameter :: THTECON1 = 3376.
+   real, parameter :: THTECON2 = 2.54
+   real, parameter :: THTECON3 = 0.81
+   real, parameter :: TLCLC1 = 2840.
+   real, parameter :: TLCLC2 = 3.5
+   real, parameter :: TLCLC3 = 4.805
+   real, parameter :: TLCLC4 = 55.
+
+
+END MODULE constants_module
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/gridinfo_module.F90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/gridinfo_module.F90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/gridinfo_module.F90	(revision 207)
@@ -0,0 +1,198 @@
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! MODULE GRIDINFO_MODULE
+!
+! This module handles (i.e., acquires, stores, and makes available) all data
+!   describing the model domains to be processed.
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+MODULE gridinfo_module
+
+   USE misc_definitions_module
+   USE module_debug
+   USE module_model_basics
+   USE module_get_file_names
+ 
+   ! Variables
+   integer                             :: interval_seconds, io_form_input
+   character (len=19)                  :: start_date, end_date
+   character (len=128)                 :: input_root_name, output_root_name
+   character (len=128)                 :: output_title
+   logical                             :: is_used, mercator_defs 
+   logical                             :: keep_moist_arrays, keep_wind_arrays
+   integer                             :: interp_method
+   real, dimension(100)                :: interp_levels
+   integer                             :: number_of_zlevs
+   real, allocatable, dimension(:,:,:) :: vert_array
+   character (len=4000)                :: plot_these_fields
+   character (len=20)                  :: plot
+   character (len=5)                   :: output_type
+ 
+   CONTAINS
+ 
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  
+   ! Name: get_namelist_params
+   ! Purpose: Read namelist parameters.
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  
+   SUBROUTINE get_namelist_params()
+ 
+      implicit none
+  
+      ! Local variables
+      integer              :: start_year, start_month, start_day, start_hour, &
+                              end_year,   end_month,   end_day,   end_hour 
+      integer              :: funit, i
+      character (len=20)   :: dummy
+      character (len=2000) :: fields,fields_file
+      namelist /datetime/ start_date, start_year, start_month, start_day, start_hour,   &
+                          end_date,   end_year,   end_month,   end_day,   end_hour,     &
+                          interval_seconds
+      namelist /io/       io_form_input, input_root_name, output_root_name,             &
+                          output_title, mercator_defs,                                  &
+                          keep_moist_arrays, keep_wind_arrays,                          &
+                          plot, fields, fields_file, output_type
+      namelist /interp/   interp_method, interp_levels
+        
+      ! Set defaults
+      io_form_input    = -1
+      start_date       = '0000-00-00_00:00:00'
+      end_date         = '0000-00-00_00:00:00'
+      input_root_name  = './'
+      output_root_name = './'
+      output_title     = '  '
+      plot             = 'all'     ! all, basic, file, list, all_file, all_list, basic_file, basic_list, list_file, all_list_file, basic_list_file
+      interp_method    = 0
+      vertical_type    = 'n'
+      interp_levels    = -99999.
+      mercator_defs    = .FALSE.
+      keep_moist_arrays= .TRUE.
+      keep_wind_arrays = .TRUE.
+      output_type      = 'grads'
+  
+      ! Read parameters from Fortran namelist
+      DO funit=10,100
+         inquire(unit=funit, opened=is_used)
+         IF (.not. is_used) EXIT
+      END DO
+      OPEN(funit,file='namelist.ARWpost',status='old',form='formatted',err=1000)
+
+!MARS
+! aymeric: more practical
+!
+      READ(funit,io)
+      READ(funit,datetime)
+!      READ(funit,io)
+      READ(funit,interp)
+        !WRITE(*,*) interp_levels
+      CLOSE(funit)
+
+      ! Get all the input file names
+      CALL unix_ls ( input_root_name )
+  
+      ! Check for valid io_form_input
+      IF ( &
+#ifdef IO_BINARY
+          io_form_input /= BINARY .and. & 
+#endif
+#ifdef IO_NETCDF
+          io_form_input /= NETCDF .and. & 
+#endif
+#ifdef IO_GRIB1
+          io_form_input /= GRIB1 .and. & 
+#endif
+          .true. ) then
+         write(6,*) ' '
+         write(6,*) 'Error: No valid value for io_form_input was specified in the namelist.'
+         write(6,*) '       Valid io_form_input values are:'
+#ifdef IO_BINARY
+         write(6,*) '       ',BINARY,' (=BINARY)'
+#endif
+#ifdef IO_NETCDF
+         write(6,*) '       ',NETCDF,' (=NETCDF)'
+#endif
+#ifdef IO_GRIB1
+         write(6,*) '       ',GRIB1,' (=GRIB1)'
+#endif
+         write(6,*) ' '
+         STOP
+      END IF
+
+#ifdef IO_GRIB1
+      IF (io_form_input == GRIB1) THEN
+        open (13, file = "gribinfo.txt")
+      END IF
+#endif
+  
+  
+      IF (start_date == '0000-00-00_00:00:00') then
+         ! Build starting date string
+         WRITE(start_date, '(i4.4,a1,i2.2,a1,i2.2,a1,i2.2,a6)') &
+               start_year,'-',start_month,'-',start_day,' ',start_hour,':00:00'
+     
+         ! Build ending date string
+         WRITE(end_date, '(i4.4,a1,i2.2,a1,i2.2,a1,i2.2,a6)') &
+               end_year,'-',end_month,'-',end_day,' ',end_hour,':00:00'
+      END IF
+
+      number_of_zlevs = 0
+      IF (interp_method == -1 .or. interp_method == 0) interp_levels    = -99999.
+      IF (abs(interp_method) == 1) vertical_type = 'z'
+!      IF (interp_method == 1 .and. interp_levels(1) .gt. 100.) vertical_type = 'p'
+!*****MARS
+      IF (interp_method == 1 .and. interp_levels(1) .gt. interp_levels(2)) vertical_type = 'p'
+!!!!!!!!!!!!!!!! ajout octobre 2009
+      IF (interp_method == 2) vertical_type = 'zabg'
+!!!!!!!!!!!!!!!!
+      IF (interp_method == 1) THEN
+        DO
+          IF (interp_levels(number_of_zlevs+1) == -99999.) EXIT
+          number_of_zlevs = number_of_zlevs + 1
+        END DO
+      ENDIF
+
+      !! Which fields do we want. Options are:  all, basic, file, list, all_file, all_list, basic_file, basic_list, list_file, all_list_file, basic_list_file
+      plot_these_fields = ','
+      IF ( INDEX(plot,'basic') /= 0) &
+         plot_these_fields = &
+         ',HGT,HGT_M,MU,MUB,P,PB,PH,PHB,PSFC,T,TT,TSK,U,UU,U10,V,VV,V10,W'
+!
+!         ',HGT,HGT_M,LANDMASK,LU_INDEX,MU,MUB,P,PB,PBLH,PH,PHB,PSFC, &
+!&Q2,RAINC,RAINNC,SST,T,TT,T2,TH2,TMN,TSK,U,UU,U10,V,VV,V10,VEGFRA,W, &
+!&XLAND,XLAT,XLAT_M,XLONG,XLONG_M,'
+
+      IF ( INDEX(plot,'list') /= 0) THEN
+        DO i = 1 , len(fields)
+          IF (fields(i:i) /= ' ' ) THEN
+            plot_these_fields = trim(plot_these_fields)//fields(i:i)
+          ENDIF
+        END DO
+        plot_these_fields = trim(plot_these_fields)//","
+      END IF
+      IF ( INDEX(plot,'file') /= 0) THEN
+        DO funit=10,100
+           inquire(unit=funit, opened=is_used)
+           IF (.not. is_used) EXIT
+        END DO
+        OPEN(funit,file=fields_file,status='old',form='formatted',err=1001)
+        DO 
+          READ(funit,*,END=999) dummy
+          plot_these_fields = trim(plot_these_fields)//trim(dummy)//","
+        END DO
+  999   CLOSE(funit)
+      END IF
+
+      IF ( INDEX(plot,'all') /= 0 .and. output_type == 'v5d' ) THEN
+        CALL mprintf(.true.,ERROR,'ERROR: plot ALL not currently supported for VIS5D')
+      END IF
+  
+      RETURN
+  
+ 1000 CALL mprintf(.true.,ERROR,'Error opening file namelist.ARWpost')
+      RETURN
+
+!1001 CALL mprintf(.true.,ERROR,'Error opening fields input file')
+ 1001 CALL mprintf(.true.,STDOUT,'   WARNING: Could not open fields input file: %s', s1=trim(fields_file) )
+      CALL mprintf(.true.,STDOUT,' ')
+      RETURN
+ 
+   END SUBROUTINE get_namelist_params
+  
+END MODULE gridinfo_module
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/input_module.F90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/input_module.F90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/input_module.F90	(revision 207)
@@ -0,0 +1,650 @@
+MODULE input_module
+
+   USE gridinfo_module
+   USE misc_definitions_module
+   USE module_debug
+   USE module_model_basics
+   USE queue_module
+#ifdef IO_BINARY
+   USE module_internal_header_util
+#endif
+ 
+ 
+   ! WRF I/O API related variables
+   integer                             :: handle
+ 
+   type (queue)                        :: unit_desc
+   integer                             :: num_calls, iatts
+   character (len=200), dimension(200) :: catts
+
+   CONTAINS
+ 
+ 
+   SUBROUTINE input_init (file_number, istatus)
+ 
+      implicit none
+
+#include "wrf_io_flags.h"
+#include "wrf_status_codes.h"
+  
+      ! Arguments
+      integer, intent(in)  :: file_number
+      integer, intent(out) :: istatus
+  
+      ! Local variables
+      character (len=128)  :: input_fname
+  
+      istatus = 0
+      CALL arw_ioinit(istatus)
+     
+      istatus = 0
+      input_fname = ' '
+      input_fname = trim(input_file_names(file_number))
+      CALL arw_open_for_read(input_fname, handle, istatus)
+     
+      CALL q_init(unit_desc)
+  
+      num_calls = 0
+ 
+   END SUBROUTINE input_init
+ 
+ 
+   SUBROUTINE read_next_field (domain_start, domain_end, &
+                               cname, cunits, cdesc, memorder, &
+                               stagger, dimnames, real_array, valid_date, istatus)
+ 
+      implicit none
+
+#include "wrf_io_flags.h"
+#include "wrf_status_codes.h"
+  
+      ! Arguments
+      integer, dimension(3)             :: domain_start, domain_end
+      real, pointer, dimension(:,:,:)   :: real_array
+      character (len=*), intent(out)    :: cname, memorder, stagger, cunits, cdesc
+      character (len=128), dimension(3) :: dimnames
+      integer, intent(inout)            :: istatus
+  
+      ! Local variables
+      integer                           :: ndim, wrftype
+      real, pointer, dimension(:,:,:)   :: real_domain
+      character (len=19)                :: valid_date
+      type (q_data)                     :: qd
+  
+
+      num_calls = num_calls + 1
+      domain_start = 1
+      domain_end   = 1
+
+#ifdef IO_NETCDF
+      IF (io_form_input == NETCDF) THEN
+        CALL arw_get_next_var(handle, cname, istatus) 
+      END IF
+#endif
+      if (istatus /= 0) return
+ 
+      istatus = 0
+      CALL arw_get_var_info(handle, cname, ndim, memorder, stagger, cdesc, cunits, domain_start, domain_end, wrftype, istatus)
+      if (istatus /= 0) return
+      if (ndim == 0) return
+      if (ndim /= 3) then
+         domain_start(3) = 1
+         domain_end(3) = 1
+      end if
+
+     
+      IF ( ASSOCIATED(real_array) ) DEALLOCATE(real_array)
+      IF ( ASSOCIATED(real_domain) ) DEALLOCATE(real_domain)
+      ALLOCATE(real_domain(domain_end(1), domain_end(2), domain_end(3)))
+      CALL arw_read_field(handle, valid_date, cname, real_domain, wrftype, &
+                          memorder, stagger, dimnames, domain_start, domain_end, istatus)
+
+     
+         if (io_form_input == BINARY) then
+            qd = q_remove(unit_desc)
+            cunits  = qd%units
+            cdesc   = qd%description
+         else
+        
+#ifdef IO_NETCDF
+            if (io_form_input == NETCDF) then
+               CALL ext_ncd_get_var_ti_char(handle, 'units', cname, cunits, istatus)
+               CALL ext_ncd_get_var_ti_char(handle, 'description', cname, cdesc, istatus)
+            end if
+#endif
+!!#ifdef IO_GRIB1
+!!          if (io_form_input == GRIB1) then
+!!             CALL ext_gr1_get_var_ti_char(handle, 'units', cname, cunits, istatus)
+!!             CALL ext_gr1_get_var_ti_char(handle, 'description', cname, cdesc, istatus)
+!!          end if
+!!#endif
+
+         end if
+
+      IF (len_trim(cdesc) == 1 ) cdesc = cname     !!! Because .ctl must have a description
+
+      real_array => real_domain
+ 
+   END SUBROUTINE read_next_field
+ 
+   SUBROUTINE read_spec_field (domain_start, domain_end, cname, wrftype, memorder, &
+                               stagger, dimnames, real_array, valid_date, istatus)
+ 
+      implicit none
+
+#include "wrf_io_flags.h"
+#include "wrf_status_codes.h"
+  
+      ! Arguments
+      integer, dimension(3)             :: domain_start, domain_end
+      real, pointer, dimension(:,:,:)   :: real_array
+      character (len=*), intent(in)     :: memorder, stagger
+      character (len=*), intent(in)     :: cname
+      character (len=128), dimension(3) :: dimnames
+      integer, intent(inout)            :: istatus
+  
+      ! Local variables
+      integer                           :: ndim, wrftype
+      real, pointer, dimension(:,:,:)   :: real_domain
+      character (len=19)                :: valid_date
+      type (q_data)                     :: qd
+  
+
+      istatus = 0
+   
+      IF ( ASSOCIATED(real_domain) ) DEALLOCATE(real_domain)
+      IF ( ASSOCIATED(real_array) ) DEALLOCATE(real_array)
+
+!!      IF ( ASSOCIATED(real_domain) ) DEALLOCATE(real_domain)
+!      nullify(real_domain) ! Bug fix
+!      IF ( ASSOCIATED(real_array) ) DEALLOCATE(real_array)
+
+
+      ALLOCATE(real_domain(domain_end(1), domain_end(2), domain_end(3)))
+      CALL arw_read_field(handle, valid_date, cname, real_domain, wrftype, &
+                          memorder, stagger, dimnames, domain_start, domain_end, istatus)
+
+
+      real_array => real_domain
+ 
+   END SUBROUTINE read_spec_field
+ 
+   
+   SUBROUTINE read_global_attrs ()
+ 
+      implicit none
+  
+      ! Local variables
+      integer                          :: dyn_opt
+      integer                          :: outcount, istatus
+      character (len=19)               :: start_date
+      character (len=128)              :: grid_type
+      character (len=128)              :: cunits, cdesc, cstagger, mminlu
+      type (q_data)                    :: qd
+      real                             :: dum_r
+      integer                          :: dum_i
+  
+      iatts = 0
+      
+      iprogram = 8
+      CALL arw_get_gbl_att_char(handle, 'TITLE', title, istatus)
+      IF ( INDEX(title,'OUTPUT FROM WRF SI') /= 0 ) iprogram = 0  !! WRFSI output
+      IF (trim(title) == 'OUTPUT FROM GRIDGEN') iprogram = 1      !! geogrid output 
+      IF (trim(title) == 'OUTPUT FROM METGRID') iprogram = 3      !! metgrid output
+      IF ( INDEX(title,'OUTPUT FROM REAL_EM') /= 0 ) iprogram = 6 !! real.exe output
+
+      CALL arw_get_gbl_att_char(handle, 'SIMULATION_START_DATE', start_date, istatus)
+      CALL arw_get_gbl_att_char(handle, 'GRIDTYPE', grid_type, istatus)
+      CALL arw_get_gbl_att_char(handle, 'MMINLU', mminlu, istatus)
+      
+      !! Make sure we are working with the unstaggered values here
+      CALL arw_get_gbl_att_int_sca(handle, 'WEST-EAST_GRID_DIMENSION', west_east_dim, 1, outcount, istatus)
+           west_east_dim = west_east_dim - 1
+      CALL arw_get_gbl_att_int_sca(handle, 'SOUTH-NORTH_GRID_DIMENSION', south_north_dim, 1, outcount, istatus)
+           south_north_dim = south_north_dim - 1
+      CALL arw_get_gbl_att_int_sca(handle, 'BOTTOM-TOP_GRID_DIMENSION', bottom_top_dim, 1, outcount, istatus)
+!!!!
+!!!! fix to allow the use of ncrcat to reduce vertical levels number in wrfout input files
+!!!!
+include "../change_bottom_top_dim"
+!!!!
+!!!!
+           IF ( iprogram  .le.  1 ) bottom_top_dim = 24      !!! Just to make room for the 3D datasets
+           IF ( iprogram .ge. 6 ) bottom_top_dim = bottom_top_dim - 1
+
+
+
+      CALL arw_get_gbl_att_int_sca(handle, 'DYN_OPT', dyn_opt, 1, outcount, istatus)
+      CALL arw_get_gbl_att_int_sca(handle, 'MAP_PROJ', map_proj, 1, outcount, istatus)
+      CALL arw_get_gbl_att_real_sca(handle, 'DX', dx, 1, outcount, istatus)
+      CALL arw_get_gbl_att_real_sca(handle, 'DY', dy, 1, outcount, istatus)
+      CALL arw_get_gbl_att_real_sca(handle, 'CEN_LAT', cen_lat, 1, outcount, istatus)
+      CALL arw_get_gbl_att_real_sca(handle, 'CEN_LON', cen_lon, 1, outcount, istatus)
+      CALL arw_get_gbl_att_real_sca(handle, 'TRUELAT1', truelat1, 1, outcount, istatus)
+      CALL arw_get_gbl_att_real_sca(handle, 'TRUELAT2', truelat2, 1, outcount, istatus)
+      CALL arw_get_gbl_att_real_sca(handle, 'MOAD_CEN_LAT', moad_cen_lat, 1, outcount, istatus)
+      CALL arw_get_gbl_att_real_sca(handle, 'STAND_LON', stand_lon, 1, outcount, istatus)
+      !!CALL arw_get_gbl_att_real_arr(handle, 'corner_lats', corner_lats, 16, outcount, istatus)
+      !!CALL arw_get_gbl_att_real_arr(handle, 'corner_lons', corner_lons, 16, outcount, istatus)
+
+      !!! Just needed for meta data in the .ctl file
+      !CALL arw_get_gbl_att_int_sca(handle, 'DYN_OPT', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'DIFF_OPT', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'KM_OPT', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'DAMP_OPT', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_real_sca(handle, 'KHDIF', dum_r, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_real_sca(handle, 'KVDIF', dum_r, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'MP_PHYSICS', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'RA_LW_PHYSICS', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'RA_SW_PHYSICS', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'SF_SFCLAY_PHYSICS', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'SF_SURFACE_PHYSICS', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'BL_PBL_PHYSICS', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'CU_PHYSICS', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'GRID_ID', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'PARENT_ID', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'I_PARENT_START', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'J_PARENT_START', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'PARENT_GRID_RATIO', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_real_sca(handle, 'DT', dum_r, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'ISWATER', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'ISICE', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'ISURBAN', dum_i, 1, outcount, istatus)
+      !CALL arw_get_gbl_att_int_sca(handle, 'ISOILWATER', dum_i, 1, outcount, istatus)
+
+
+   END SUBROUTINE read_global_attrs
+ 
+ 
+   SUBROUTINE input_close()
+ 
+      implicit none
+  
+      ! Local variables
+      integer :: istatus
+  
+      istatus = 0
+#ifdef IO_BINARY
+      if (io_form_input == BINARY) then
+         CALL ext_int_ioclose(handle, istatus)
+         CALL ext_int_ioexit(istatus)
+      end if
+#endif
+#ifdef IO_NETCDF
+      if (io_form_input == NETCDF) then
+         CALL ext_ncd_ioclose(handle, istatus)
+         CALL ext_ncd_ioexit(istatus)
+      end if
+#endif
+#ifdef IO_GRIB1
+      if (io_form_input == GRIB1) then
+         CALL ext_gr1_ioclose(handle, istatus)
+         CALL ext_gr1_ioexit(istatus)
+      end if
+#endif
+ 
+      CALL q_destroy(unit_desc)
+ 
+   END SUBROUTINE input_close
+!------------------------------------------------------------------------------------------
+!------------------------------------------------------------------------------------------
+!------------------------------------------------------------------------------------------
+
+   SUBROUTINE arw_ioinit (istatus)
+
+      implicit none
+
+      ! Arguments
+      integer             :: istatus
+
+#ifdef IO_BINARY
+         if (io_form_input == BINARY) CALL ext_int_ioinit('sysdep info', istatus)
+#endif
+#ifdef IO_NETCDF
+         if (io_form_input == NETCDF) CALL ext_ncd_ioinit('sysdep info', istatus)
+#endif
+#ifdef IO_GRIB1
+         if (io_form_input == GRIB1) CALL ext_gr1_ioinit('sysdep info', istatus)
+#endif
+         CALL mprintf((istatus /= 0),ERROR,'Error in ext_pkg_ioinit')
+
+   END SUBROUTINE arw_ioinit
+
+!------------------------------------------------------------------------------------------
+
+   SUBROUTINE arw_open_for_read (input_fname, handle, istatus)
+
+      implicit none
+
+      ! Arguments
+      integer             :: handle, istatus
+      character (len=128) :: input_fname
+
+#ifdef IO_BINARY
+         if (io_form_input == BINARY) &
+            CALL ext_int_open_for_read(trim(input_fname), 1, 1, 'sysdep info', handle, istatus)
+#endif
+#ifdef IO_NETCDF
+         if (io_form_input == NETCDF) &
+            CALL ext_ncd_open_for_read(trim(input_fname), 1, 1, 'sysdep info', handle, istatus)
+#endif
+#ifdef IO_GRIB1
+         if (io_form_input == GRIB1) &
+            CALL ext_gr1_open_for_read(trim(input_fname), 1, 1, 'sysdep info', handle, istatus)
+#endif
+         CALL mprintf((istatus /= 0),ERROR,'Error in ext_pkg_open_for_read')
+
+   END SUBROUTINE arw_open_for_read
+
+!------------------------------------------------------------------------------------------
+
+   SUBROUTINE arw_get_next_time (handle, datestr, istatus)
+
+      implicit none
+
+      ! Arguments
+      integer             :: handle, istatus
+      character (len=*)   :: datestr
+
+
+#ifdef IO_BINARY
+        if (io_form_input == BINARY) CALL ext_int_get_next_time(handle, datestr, istatus)
+#endif
+#ifdef IO_NETCDF
+        if (io_form_input == NETCDF) CALL ext_ncd_get_next_time(handle, datestr, istatus)
+#endif
+#ifdef IO_GRIB1
+        if (io_form_input == GRIB1)  CALL ext_gr1_get_next_time(handle, datestr, istatus)
+#endif
+        !!CALL mprintf((istatus /= 0),ERROR,'Error while reading next time .')
+
+   END SUBROUTINE arw_get_next_time
+
+!------------------------------------------------------------------------------------------
+
+   SUBROUTINE arw_get_gbl_att_char (handle, att_string, att, istatus)
+
+      implicit none
+
+      ! Arguments
+      integer             :: handle, istatus
+      character*(*)       :: att_string
+      character (len=*)   :: att
+
+
+#ifdef IO_BINARY
+        if (io_form_input == BINARY) CALL ext_int_get_dom_ti_char(handle, att_string, att, istatus)
+#endif
+#ifdef IO_NETCDF
+        if (io_form_input == NETCDF) CALL ext_ncd_get_dom_ti_char(handle, att_string, att, istatus)
+#endif
+#ifdef IO_GRIB1
+        if (io_form_input == GRIB1)  CALL ext_gr1_get_dom_ti_char(handle, att_string, att, istatus)
+#endif
+        !!CALL mprintf((istatus /= 0),ERROR,'Error while reading domain global charachter attribute.')
+        IF ( istatus == 0 ) THEN
+          iatts = iatts + 1
+          WRITE(catts(iatts),'("@ global String comment ",A," = ",A)') trim(att_string), trim(att)
+        END IF 
+
+   END SUBROUTINE arw_get_gbl_att_char
+
+!------------------------------------------------------------------------------------------
+
+   SUBROUTINE arw_get_gbl_att_int_sca (handle, att_string, att, dim, outcount, istatus)
+
+      implicit none
+
+      ! Arguments
+      integer             :: handle, dim, outcount, istatus
+      character*(*)       :: att_string
+      integer             :: att
+
+
+#ifdef IO_BINARY
+        if (io_form_input == BINARY) CALL ext_int_get_dom_ti_integer(handle, att_string, att, dim, outcount, istatus)
+#endif
+#ifdef IO_NETCDF
+        if (io_form_input == NETCDF) CALL ext_ncd_get_dom_ti_integer(handle, att_string, att, dim, outcount, istatus)
+#endif
+#ifdef IO_GRIB1
+        if (io_form_input == GRIB1)  CALL ext_gr1_get_dom_ti_integer(handle, att_string, att, dim, outcount, istatus)
+#endif
+        !!CALL mprintf((istatus /= 0),ERROR,'Error while reading domain global integer attribute.')
+        IF ( istatus == 0 ) THEN
+          iatts = iatts + 1
+          WRITE(catts(iatts),'("@ global String comment ",A," = ",i5)') trim(att_string), att
+        END IF
+
+   END SUBROUTINE arw_get_gbl_att_int_sca
+
+!------------------------------------------------------------------------------------------
+
+   SUBROUTINE arw_get_gbl_att_real_sca (handle, att_string, att, dim, outcount, istatus)
+
+      implicit none
+
+      ! Arguments
+      integer             :: handle, dim, outcount, istatus
+      character*(*)       :: att_string
+      real                :: att
+
+
+#ifdef IO_BINARY
+        if (io_form_input == BINARY) CALL ext_int_get_dom_ti_real(handle, att_string, att, dim, outcount, istatus)
+#endif
+#ifdef IO_NETCDF
+        if (io_form_input == NETCDF) CALL ext_ncd_get_dom_ti_real(handle, att_string, att, dim, outcount, istatus)
+#endif
+#ifdef IO_GRIB1
+        if (io_form_input == GRIB1)  CALL ext_gr1_get_dom_ti_real(handle, att_string, att, dim, outcount, istatus)
+#endif
+        !!CALL mprintf((istatus /= 0),ERROR,'Error while reading domain global real attribute.')
+        IF ( istatus == 0 ) THEN
+          iatts = iatts + 1
+          WRITE(catts(iatts),'("@ global String comment ",A," = ",f12.2)') trim(att_string), att
+        END IF
+
+   END SUBROUTINE arw_get_gbl_att_real_sca
+
+!------------------------------------------------------------------------------------------
+
+   SUBROUTINE arw_get_gbl_att_real_arr (handle, att_string, att, dim, outcount, istatus)
+
+      implicit none
+
+      ! Arguments
+      integer             :: handle, dim, outcount, istatus
+      character*(*)       :: att_string
+      real, dimension(*)  :: att
+
+
+#ifdef IO_BINARY
+        if (io_form_input == BINARY) CALL ext_int_get_dom_ti_real(handle, att_string, att, dim, outcount, istatus)
+#endif
+#ifdef IO_NETCDF
+        if (io_form_input == NETCDF) CALL ext_ncd_get_dom_ti_real(handle, att_string, att, dim, outcount, istatus)
+#endif
+#ifdef IO_GRIB1
+        if (io_form_input == GRIB1)  CALL ext_gr1_get_dom_ti_real(handle, att_string, att, dim, outcount, istatus)
+#endif
+        CALL mprintf((istatus /= 0),ERROR,'Error while reading domain global real attribute.')
+
+   END SUBROUTINE arw_get_gbl_att_real_arr
+
+!------------------------------------------------------------------------------------------
+
+   SUBROUTINE arw_get_next_var (handle, cname, istatus)
+
+      implicit none
+
+      ! Arguments
+      integer             :: handle, istatus
+      character*(*)       :: cname
+
+#ifdef IO_BINARY
+         if (io_form_input == BINARY) CALL ext_int_get_next_var(handle, cname, istatus) 
+#endif
+#ifdef IO_NETCDF
+         if (io_form_input == NETCDF) CALL ext_ncd_get_next_var(handle, cname, istatus) 
+#endif
+#ifdef IO_GRIB1
+         if (io_form_input == GRIB1) CALL ext_gr1_get_next_var(handle, cname, istatus) 
+#endif
+
+   END SUBROUTINE arw_get_next_var
+ 
+!------------------------------------------------------------------------------------------
+
+   SUBROUTINE arw_get_var_info (handle, cname, ndim, memorder, stagger, cdesc, cunits, domain_start, domain_end, wrftype, istatus)
+
+      implicit none
+
+      ! Arguments
+      integer               :: handle, istatus
+      integer               :: ndim, wrftype
+      integer, dimension(3) :: domain_start, domain_end
+      character*(*)         :: cname, memorder, stagger, cdesc, cunits
+
+
+      cunits  = ' '
+      cdesc   = ' '
+
+
+#ifdef IO_BINARY
+         if (io_form_input == BINARY) &
+            CALL ext_int_get_var_info(handle, cname, ndim, memorder, stagger, domain_start, domain_end, wrftype, istatus)
+#endif
+#ifdef IO_NETCDF
+         if (io_form_input == NETCDF) &
+            CALL ext_ncd_get_var_info(handle, cname, ndim, memorder, stagger, domain_start, domain_end, wrftype, istatus)
+#endif
+#ifdef IO_GRIB1
+      IF (io_form_input == GRIB1) THEN
+ 10     read (13,'(i3,5x,A3,4x,A1,5x,A13,A48,A15)',END=999) wrftype, memorder, stagger, cname, cdesc, cunits
+        ndim =  LEN_trim(memorder) 
+        IF (iprogram .le. 1 .AND. ndim == 3 .AND. INDEX(memorder,'m') == 0) GOTO 10
+        IF (iprogram .le. 1 .AND. ndim == 1) GOTO 10
+        IF (iprogram == 8 .AND. INDEX(memorder,'g') /= 0) GOTO 10
+        IF      ( LEN_trim(memorder) == 3 ) THEN
+                domain_end(1) = west_east_dim
+                domain_end(2) = south_north_dim
+                domain_end(3) = bottom_top_dim
+                IF (stagger(1:1) == "X") domain_end(1) = domain_end(1) + 1
+                IF (stagger(1:1) == "Y") domain_end(2) = domain_end(2) + 1
+                IF (iprogram .ge. 6 .AND. stagger(1:1) == "Z") domain_end(3) = domain_end(3) + 1
+                IF ( INDEX(memorder,'m') /= 0 ) domain_end(3) = 12
+                IF ( INDEX(memorder,'u') /= 0 ) domain_end(3) = 24
+                memorder = "XYZ"
+        ELSE IF ( LEN_trim(memorder) == 2 ) THEN
+                domain_end(1) = west_east_dim
+                domain_end(2) = south_north_dim
+                IF (stagger(1:1) == "X") domain_end(1) = domain_end(1) + 1
+                IF (stagger(1:1) == "Y") domain_end(2) = domain_end(2) + 1
+                memorder = "XY"
+        ELSE IF ( LEN_trim(memorder) == 1 ) THEN
+                domain_end(1) = bottom_top_dim
+                IF (iprogram .ge. 6 .AND. stagger(1:1) == "Z") domain_end(1) = domain_end(1) + 1
+                memorder = "Z"
+        END IF
+      END IF
+#endif
+     
+         CALL mprintf((istatus /= 0),ERROR,'In read_next_field(), problems with ext_pkg_get_var_info()')
+        RETURN
+  999   istatus = -1     !!! Reached end of file
+
+   END SUBROUTINE arw_get_var_info
+ 
+!------------------------------------------------------------------------------------------
+
+   SUBROUTINE arw_read_field (handle, valid_date, cname, real_domain, wrftype, &
+                             memorder, stagger, &
+                             dimnames, domain_start, domain_end, istatus)
+
+      implicit none
+
+      ! Arguments
+      integer                            :: handle, istatus
+      integer                            :: ndim, wrftype
+      integer, dimension(3)              :: domain_start, domain_end
+      character*(*)                      :: cname, memorder, stagger, valid_date
+      character (len=128), dimension(3)  :: dimnames
+      real, pointer, dimension(:,:,:)    :: real_domain
+      integer, pointer, dimension(:,:,:) :: int_domain
+  
+#include "wrf_io_flags.h"
+#include "wrf_status_codes.h"
+ 
+
+!!! caca 
+!print *, 'arw_read_field ', handle, valid_date, cname, wrftype, &
+!                             memorder, stagger, &
+!                             dimnames, domain_start, domain_end, istatus
+!!! caca
+
+         if (wrftype == WRF_REAL) then
+#ifdef IO_BINARY
+            if (io_form_input == BINARY) then
+               CALL ext_int_read_field(handle, valid_date, cname, real_domain, wrftype, &
+                             1, 1, 0, memorder, stagger, &
+                             dimnames, domain_start, domain_end, domain_start, domain_end, &
+                             domain_start, domain_end, istatus)
+            end if
+#endif
+#ifdef IO_NETCDF
+            if (io_form_input == NETCDF) then
+               CALL ext_ncd_read_field(handle, valid_date, cname, real_domain, wrftype, &
+                             1, 1, 0, memorder, stagger, &
+                             dimnames, domain_start, domain_end, domain_start, domain_end, &
+                             domain_start, domain_end, istatus)
+            end if
+#endif
+#ifdef IO_GRIB1
+            if (io_form_input == GRIB1) then
+               CALL ext_gr1_read_field(handle, valid_date, cname, real_domain, wrftype, &
+                             1, 1, 0, memorder, stagger, &
+                             dimnames, domain_start, domain_end, domain_start, domain_end, &
+                             domain_start, domain_end, istatus)
+            end if
+#endif
+         elseif (wrftype == WRF_INTEGER) then
+         allocate(int_domain(domain_start(1):domain_end(1), domain_start(2):domain_end(2), domain_start(3):domain_end(3)))
+#ifdef IO_BINARY
+            if (io_form_input == BINARY) then
+               CALL ext_int_read_field(handle, valid_date, cname, int_domain, wrftype, &
+                             1, 1, 0, memorder, stagger, &
+                             dimnames, domain_start, domain_end, domain_start, domain_end, &
+                             domain_start, domain_end, istatus)
+            end if
+#endif
+#ifdef IO_NETCDF
+            if (io_form_input == NETCDF) then
+               CALL ext_ncd_read_field(handle, valid_date, cname, int_domain, wrftype, &
+                             1, 1, 0, memorder, stagger, &
+                             dimnames, domain_start, domain_end, domain_start, domain_end, &
+                             domain_start, domain_end, istatus)
+            end if
+#endif
+#ifdef IO_GRIB1
+            if (io_form_input == GRIB1) then
+               CALL ext_gr1_read_field(handle, valid_date, cname, int_domain, wrftype, &
+                             1, 1, 0, memorder, stagger, &
+                             dimnames, domain_start, domain_end, domain_start, domain_end, &
+                             domain_start, domain_end, istatus)
+            end if
+#endif
+            real_domain = real(int_domain)
+            deallocate(int_domain)
+         end if 
+#ifdef IO_GRIB1
+            if (io_form_input == GRIB1 .AND. istatus == -5 ) RETURN
+#endif
+         CALL mprintf((istatus /= 0),ERROR,'In read_field(), got error code %i.', i1=istatus)
+
+
+   END SUBROUTINE arw_read_field
+ 
+!------------------------------------------------------------------------------------------
+
+END MODULE input_module
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/misc_definitions_module.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/misc_definitions_module.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/misc_definitions_module.f90	(revision 207)
@@ -0,0 +1,21 @@
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! MODULE MISC_DEFINITIONS_MODULE
+!
+! This module defines various non-meteorological constants that are used 
+!   by other modules for readability.
+!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+MODULE misc_definitions_module
+
+   !!integer, parameter :: BINARY=1, NETCDF=2, GRIB1=3, HDF=4
+   integer, parameter :: BINARY=1, NETCDF=2, GRIB1=5
+
+   ! Projection codes for proj_info structure:
+   INTEGER, PUBLIC, PARAMETER  :: PROJ_LATLON = 0
+   INTEGER, PUBLIC, PARAMETER  :: PROJ_LC = 1
+!   INTEGER, PUBLIC, PARAMETER  :: PROJ_PS = 2
+   INTEGER, PUBLIC, PARAMETER  :: PROJ_MERC = 3
+   !!INTEGER, PUBLIC, PARAMETER  :: PROJ_GAUSS = 4
+   !!INTEGER, PUBLIC, PARAMETER  :: PROJ_ROTLL = 6
+
+END MODULE misc_definitions_module
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_arrays.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_arrays.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_arrays.f90	(revision 207)
@@ -0,0 +1,215 @@
+!! Which arrays are we carrying around
+
+MODULE module_arrays
+
+  CONTAINS
+  SUBROUTINE clobber_arrays()
+
+  USE module_model_basics
+
+     IF (ALLOCATED(XLAT)) DEALLOCATE(XLAT)
+     have_XLAT = .FALSE.
+     IF (ALLOCATED(XLONG)) DEALLOCATE(XLONG)
+     have_XLONG = .FALSE.
+     IF (ALLOCATED(HGT)) DEALLOCATE(HGT)
+     have_HGT = .FALSE.
+
+     IF (ALLOCATED(U10)) DEALLOCATE(U10)
+     have_U10 = .FALSE.
+     IF (ALLOCATED(V10)) DEALLOCATE(V10)
+     have_V10 = .FALSE.
+
+     IF (ALLOCATED(PRES)) DEALLOCATE(PRES)
+     have_PRES = .FALSE.
+     IF (ALLOCATED(P)) DEALLOCATE(P)
+     have_P = .FALSE.
+     IF (ALLOCATED(PB)) DEALLOCATE(PB)
+     have_PB = .FALSE.
+     IF (ALLOCATED(PSFC)) DEALLOCATE(PSFC)
+     have_PSFC = .FALSE.
+
+     IF (ALLOCATED(MU)) DEALLOCATE(MU)
+     have_MU = .FALSE.
+     IF (ALLOCATED(MUB)) DEALLOCATE(MUB)
+     have_MUB = .FALSE.
+     IF (ALLOCATED(ZNU)) DEALLOCATE(ZNU)
+     have_ZNU = .FALSE.
+     IF (ALLOCATED(ZNW)) DEALLOCATE(ZNW)
+     have_ZNW = .FALSE.
+     
+     have_PTOP = .FALSE.
+
+     IF (ALLOCATED(PH)) DEALLOCATE(PH)
+     have_PH = .FALSE.
+     IF (ALLOCATED(PHB)) DEALLOCATE(PHB)
+     have_PHB = .FALSE.
+
+     IF (ALLOCATED(UUU)) DEALLOCATE(UUU)
+     have_UUU = .FALSE.
+     IF (ALLOCATED(VVV)) DEALLOCATE(VVV)
+     have_VVV = .FALSE.
+
+     IF (ALLOCATED(TK)) DEALLOCATE(TK)
+     have_TK = .FALSE.
+     IF (ALLOCATED(T)) DEALLOCATE(T)
+     have_T = .FALSE.
+
+     IF (ALLOCATED(QV)) DEALLOCATE(QV)
+     have_QV = .FALSE.
+     IF (ALLOCATED(QR)) DEALLOCATE(QR)
+     have_QR = .FALSE.
+     IF (ALLOCATED(QS)) DEALLOCATE(QS)
+     have_QS = .FALSE.
+     IF (ALLOCATED(QG)) DEALLOCATE(QG)
+     have_QG = .FALSE.
+
+  END SUBROUTINE clobber_arrays
+
+
+
+
+  SUBROUTINE keep_arrays(cname, real_array)
+
+  USE gridinfo_module
+  USE module_model_basics
+
+! Arguments
+  character (len=128)             :: cname
+  real, pointer, dimension(:,:,:) :: real_array
+
+  IF (cname(1:4) == 'XLAT') THEN
+     allocate(XLAT(west_east_dim,south_north_dim))
+     XLAT = real_array(:,:,1)
+     have_XLAT = .TRUE.
+  ELSE IF (cname(1:5) == 'XLONG') THEN
+     allocate(XLONG(west_east_dim,south_north_dim))
+     XLONG = real_array(:,:,1)
+     have_XLONG = .TRUE.
+  ELSE IF (cname(1:3) == 'HGT') THEN
+     allocate(HGT(west_east_dim,south_north_dim))
+     HGT = real_array(:,:,1)
+     have_HGT = .TRUE.
+
+  ELSE IF (trim(cname) == 'U10' .and. keep_wind_arrays) THEN
+     allocate(U10(west_east_dim,south_north_dim))
+     U10 = real_array(:,:,1)
+     have_U10 = .TRUE.
+  ELSE IF (trim(cname) == 'V10' .and. keep_wind_arrays) THEN
+     allocate(V10(west_east_dim,south_north_dim))
+     V10 = real_array(:,:,1)
+     have_V10 = .TRUE.
+
+  ELSE IF (trim(cname) == 'PRES') THEN
+     allocate(PRES(west_east_dim,south_north_dim,bottom_top_dim))
+     PRES = real_array
+     have_PRES = .TRUE.
+!!
+!! MARS MARS
+!!
+!  ELSE IF (trim(cname) == 'P') THEN
+!     allocate(P(west_east_dim,south_north_dim,bottom_top_dim))
+!     P = real_array
+!     have_P = .TRUE.
+!  ELSE IF (trim(cname) == 'PB') THEN
+!     allocate(PB(west_east_dim,south_north_dim,bottom_top_dim))
+!     PB = real_array
+!     have_PB = .TRUE.
+  ELSE IF (trim(cname) == 'PTOT') THEN
+     allocate(P(west_east_dim,south_north_dim,bottom_top_dim))
+     allocate(PB(west_east_dim,south_north_dim,bottom_top_dim))
+     P = 0.5*real_array
+     PB = 0.5*real_array
+     have_P = .TRUE.
+     have_PB = .TRUE.
+
+  ELSE IF (trim(cname) == 'PSFC') THEN
+     allocate(PSFC(west_east_dim,south_north_dim))
+     PSFC = real_array(:,:,1)
+     have_PSFC = .TRUE.
+
+  ELSE IF (trim(cname) == 'MU') THEN
+     allocate(MU(west_east_dim,south_north_dim))
+     MU = real_array(:,:,1)
+     have_MU = .TRUE.
+  ELSE IF (trim(cname) == 'MUB') THEN
+     allocate(MUB(west_east_dim,south_north_dim))
+     MUB = real_array(:,:,1)
+     have_MUB = .TRUE.
+  ELSE IF (trim(cname) == 'ZNU') THEN
+     allocate(ZNU(bottom_top_dim))
+     ZNU = real_array(:,1,1)
+     have_ZNU = .TRUE.
+  ELSE IF (trim(cname) == 'ZNW') THEN
+     allocate(ZNW(bottom_top_dim+1))
+     ZNW = real_array(:,1,1)
+     have_ZNW = .TRUE.
+  ELSE IF (trim(cname) == 'P_TOP') THEN
+     PTOP = real_array(1,1,1)
+     have_PTOP = .TRUE.
+
+!!
+!! MARS MARS
+!!
+!  ELSE IF (trim(cname) == 'PH') THEN
+!     allocate(PH(west_east_dim,south_north_dim,bottom_top_dim))
+!     PH = 0.5*(real_array(:,:,1:bottom_top_dim)+real_array(:,:,2:bottom_top_dim+1))
+!     have_PH = .TRUE.
+!  ELSE IF (trim(cname) == 'PHB') THEN
+!     allocate(PHB(west_east_dim,south_north_dim,bottom_top_dim))
+!     PHB = 0.5*(real_array(:,:,1:bottom_top_dim)+real_array(:,:,2:bottom_top_dim+1))!
+!     have_PHB = .TRUE.
+  ELSE IF (trim(cname) == 'PHTOT') THEN
+     allocate(PH(west_east_dim,south_north_dim,bottom_top_dim))
+     allocate(PHB(west_east_dim,south_north_dim,bottom_top_dim))	
+     PH = 0.5*real_array
+     PHB = 0.5*real_array
+
+!PH = 0.5*0.5*(real_array(:,:,1:bottom_top_dim)+real_array(:,:,2:bottom_top_dim+1))
+!PHB = 0.5*0.5*(real_array(:,:,1:bottom_top_dim)+real_array(:,:,2:bottom_top_dim+1))
+
+     have_PH = .TRUE.
+     have_PHB = .TRUE.	
+
+  ELSE IF (trim(cname) == 'U' .or. trim(cname) == 'UU') THEN
+     IF (keep_wind_arrays) THEN
+       allocate(UUU(west_east_dim,south_north_dim,bottom_top_dim))
+       UUU = 0.5*(real_array(1:west_east_dim,:,:)+real_array(2:west_east_dim+1,:,:))
+       have_UUU = .TRUE.
+     END IF
+  ELSE IF (trim(cname) == 'V' .or. trim(cname) == 'VV') THEN
+     IF (keep_wind_arrays) THEN
+       allocate(VVV(west_east_dim,south_north_dim,bottom_top_dim))
+       VVV = 0.5*(real_array(:,1:south_north_dim,:)+real_array(:,2:south_north_dim+1,:))
+       have_VVV = .TRUE.
+     END IF
+
+  ELSE IF (trim(cname) == 'TT' .or. trim(cname) == 'TK') THEN
+     allocate(TK(west_east_dim,south_north_dim,bottom_top_dim))
+     TK = real_array
+     have_TK = .TRUE.
+  ELSE IF (trim(cname) == 'T') THEN
+     allocate(T(west_east_dim,south_north_dim,bottom_top_dim))
+     T = real_array
+     have_T = .TRUE.
+
+  ELSE IF (trim(cname) == 'QVAPOR') THEN
+     allocate(QV(west_east_dim,south_north_dim,bottom_top_dim))
+     QV = real_array
+     have_QV = .TRUE.
+  ELSE IF (trim(cname) == 'QRAIN' .and. keep_moist_arrays ) THEN
+     allocate(QR(west_east_dim,south_north_dim,bottom_top_dim))
+     QR = real_array
+     have_QR = .TRUE.
+  ELSE IF (trim(cname) == 'QSNOW' .and. keep_moist_arrays ) THEN
+     allocate(QS(west_east_dim,south_north_dim,bottom_top_dim))
+     QS = real_array
+     have_QS = .TRUE.
+  ELSE IF (trim(cname) == 'QGRAUP' .and. keep_moist_arrays ) THEN
+     allocate(QG(west_east_dim,south_north_dim,bottom_top_dim))
+     QG = real_array
+     have_QG = .TRUE.
+  END IF
+  
+  END SUBROUTINE keep_arrays
+
+END MODULE module_arrays
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_arrays_new.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_arrays_new.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_arrays_new.f90	(revision 207)
@@ -0,0 +1,215 @@
+!! Which arrays are we carrying around
+
+MODULE module_arrays
+
+  CONTAINS
+  SUBROUTINE clobber_arrays()
+
+  USE module_model_basics
+
+     IF (ALLOCATED(XLAT)) DEALLOCATE(XLAT)
+     have_XLAT = .FALSE.
+     IF (ALLOCATED(XLONG)) DEALLOCATE(XLONG)
+     have_XLONG = .FALSE.
+     IF (ALLOCATED(HGT)) DEALLOCATE(HGT)
+     have_HGT = .FALSE.
+
+     IF (ALLOCATED(U10)) DEALLOCATE(U10)
+     have_U10 = .FALSE.
+     IF (ALLOCATED(V10)) DEALLOCATE(V10)
+     have_V10 = .FALSE.
+
+     IF (ALLOCATED(PRES)) DEALLOCATE(PRES)
+     have_PRES = .FALSE.
+     IF (ALLOCATED(P)) DEALLOCATE(P)
+     have_P = .FALSE.
+     IF (ALLOCATED(PB)) DEALLOCATE(PB)
+     have_PB = .FALSE.
+     IF (ALLOCATED(PSFC)) DEALLOCATE(PSFC)
+     have_PSFC = .FALSE.
+
+     IF (ALLOCATED(MU)) DEALLOCATE(MU)
+     have_MU = .FALSE.
+     IF (ALLOCATED(MUB)) DEALLOCATE(MUB)
+     have_MUB = .FALSE.
+     IF (ALLOCATED(ZNU)) DEALLOCATE(ZNU)
+     have_ZNU = .FALSE.
+     IF (ALLOCATED(ZNW)) DEALLOCATE(ZNW)
+     have_ZNW = .FALSE.
+     
+     have_PTOP = .FALSE.
+
+     IF (ALLOCATED(PH)) DEALLOCATE(PH)
+     have_PH = .FALSE.
+     IF (ALLOCATED(PHB)) DEALLOCATE(PHB)
+     have_PHB = .FALSE.
+
+     IF (ALLOCATED(UUU)) DEALLOCATE(UUU)
+     have_UUU = .FALSE.
+     IF (ALLOCATED(VVV)) DEALLOCATE(VVV)
+     have_VVV = .FALSE.
+
+     IF (ALLOCATED(TK)) DEALLOCATE(TK)
+     have_TK = .FALSE.
+     IF (ALLOCATED(T)) DEALLOCATE(T)
+     have_T = .FALSE.
+
+     IF (ALLOCATED(QV)) DEALLOCATE(QV)
+     have_QV = .FALSE.
+     IF (ALLOCATED(QR)) DEALLOCATE(QR)
+     have_QR = .FALSE.
+     IF (ALLOCATED(QS)) DEALLOCATE(QS)
+     have_QS = .FALSE.
+     IF (ALLOCATED(QG)) DEALLOCATE(QG)
+     have_QG = .FALSE.
+
+  END SUBROUTINE clobber_arrays
+
+
+
+
+  SUBROUTINE keep_arrays(cname, real_array)
+
+  USE gridinfo_module
+  USE module_model_basics
+
+! Arguments
+  character (len=128)             :: cname
+  real, pointer, dimension(:,:,:) :: real_array
+
+  IF (cname(1:4) == 'XLAT') THEN
+     allocate(XLAT(west_east_dim,south_north_dim))
+     XLAT = real_array(:,:,1)
+     have_XLAT = .TRUE.
+  ELSE IF (cname(1:5) == 'XLONG') THEN
+     allocate(XLONG(west_east_dim,south_north_dim))
+     XLONG = real_array(:,:,1)
+     have_XLONG = .TRUE.
+  ELSE IF (cname(1:3) == 'HGT') THEN
+     allocate(HGT(west_east_dim,south_north_dim))
+     HGT = real_array(:,:,1)
+     have_HGT = .TRUE.
+
+  ELSE IF (trim(cname) == 'U10' .and. keep_wind_arrays) THEN
+     allocate(U10(west_east_dim,south_north_dim))
+     U10 = real_array(:,:,1)
+     have_U10 = .TRUE.
+  ELSE IF (trim(cname) == 'V10' .and. keep_wind_arrays) THEN
+     allocate(V10(west_east_dim,south_north_dim))
+     V10 = real_array(:,:,1)
+     have_V10 = .TRUE.
+
+  ELSE IF (trim(cname) == 'PRES') THEN
+     allocate(PRES(west_east_dim,south_north_dim,bottom_top_dim))
+     PRES = real_array
+     have_PRES = .TRUE.
+!!
+!! MARS MARS
+!!
+!  ELSE IF (trim(cname) == 'P') THEN
+!     allocate(P(west_east_dim,south_north_dim,bottom_top_dim))
+!     P = real_array
+!     have_P = .TRUE.
+!  ELSE IF (trim(cname) == 'PB') THEN
+!     allocate(PB(west_east_dim,south_north_dim,bottom_top_dim))
+!     PB = real_array
+!     have_PB = .TRUE.
+  ELSE IF (trim(cname) == 'PTOT') THEN
+     allocate(P(west_east_dim,south_north_dim,bottom_top_dim))
+     allocate(PB(west_east_dim,south_north_dim,bottom_top_dim))
+     P = 0.5*real_array
+     PB = 0.5*real_array
+     have_P = .TRUE.
+     have_PB = .TRUE.
+
+  ELSE IF (trim(cname) == 'PSFC') THEN
+     allocate(PSFC(west_east_dim,south_north_dim))
+     PSFC = real_array(:,:,1)
+     have_PSFC = .TRUE.
+
+  ELSE IF (trim(cname) == 'MU') THEN
+     allocate(MU(west_east_dim,south_north_dim))
+     MU = real_array(:,:,1)
+     have_MU = .TRUE.
+  ELSE IF (trim(cname) == 'MUB') THEN
+     allocate(MUB(west_east_dim,south_north_dim))
+     MUB = real_array(:,:,1)
+     have_MUB = .TRUE.
+  ELSE IF (trim(cname) == 'ZNU') THEN
+     allocate(ZNU(bottom_top_dim))
+     ZNU = real_array(:,1,1)
+     have_ZNU = .TRUE.
+  ELSE IF (trim(cname) == 'ZNW') THEN
+     allocate(ZNW(bottom_top_dim+1))
+     ZNW = real_array(:,1,1)
+     have_ZNW = .TRUE.
+  ELSE IF (trim(cname) == 'P_TOP') THEN
+     PTOP = real_array(1,1,1)
+     have_PTOP = .TRUE.
+
+!!
+!! MARS MARS
+!!
+!  ELSE IF (trim(cname) == 'PH') THEN
+!     allocate(PH(west_east_dim,south_north_dim,bottom_top_dim))
+!     PH = 0.5*(real_array(:,:,1:bottom_top_dim)+real_array(:,:,2:bottom_top_dim+1))
+!     have_PH = .TRUE.
+!  ELSE IF (trim(cname) == 'PHB') THEN
+!     allocate(PHB(west_east_dim,south_north_dim,bottom_top_dim))
+!     PHB = 0.5*(real_array(:,:,1:bottom_top_dim)+real_array(:,:,2:bottom_top_dim+1))!
+!     have_PHB = .TRUE.
+  ELSE IF (trim(cname) == 'PHTOT') THEN
+     allocate(PH(west_east_dim,south_north_dim,bottom_top_dim))
+     allocate(PHB(west_east_dim,south_north_dim,bottom_top_dim))	
+     PH = 0.5*real_array
+     PHB = 0.5*real_array
+
+!PH = 0.5*0.5*(real_array(:,:,1:bottom_top_dim)+real_array(:,:,2:bottom_top_dim+1))
+!PHB = 0.5*0.5*(real_array(:,:,1:bottom_top_dim)+real_array(:,:,2:bottom_top_dim+1))
+
+     have_PH = .TRUE.
+     have_PHB = .TRUE.	
+
+  ELSE IF (trim(cname) == 'U' .or. trim(cname) == 'UU') THEN
+     IF (keep_wind_arrays) THEN
+       allocate(UUU(west_east_dim,south_north_dim,bottom_top_dim))
+       UUU = 0.5*(real_array(1:west_east_dim,:,:)+real_array(2:west_east_dim+1,:,:))
+       have_UUU = .TRUE.
+     END IF
+  ELSE IF (trim(cname) == 'V' .or. trim(cname) == 'VV') THEN
+     IF (keep_wind_arrays) THEN
+       allocate(VVV(west_east_dim,south_north_dim,bottom_top_dim))
+       VVV = 0.5*(real_array(:,1:south_north_dim,:)+real_array(:,2:south_north_dim+1,:))
+       have_VVV = .TRUE.
+     END IF
+
+  ELSE IF (trim(cname) == 'TT' .or. trim(cname) == 'TK') THEN
+     allocate(TK(west_east_dim,south_north_dim,bottom_top_dim))
+     TK = real_array
+     have_TK = .TRUE.
+  ELSE IF (trim(cname) == 'T') THEN
+     allocate(T(west_east_dim,south_north_dim,bottom_top_dim))
+     T = real_array
+     have_T = .TRUE.
+
+  ELSE IF (trim(cname) == 'QVAPOR') THEN
+     allocate(QV(west_east_dim,south_north_dim,bottom_top_dim))
+     QV = real_array
+     have_QV = .TRUE.
+  ELSE IF (trim(cname) == 'QRAIN' .and. keep_moist_arrays ) THEN
+     allocate(QR(west_east_dim,south_north_dim,bottom_top_dim))
+     QR = real_array
+     have_QR = .TRUE.
+  ELSE IF (trim(cname) == 'QSNOW' .and. keep_moist_arrays ) THEN
+     allocate(QS(west_east_dim,south_north_dim,bottom_top_dim))
+     QS = real_array
+     have_QS = .TRUE.
+  ELSE IF (trim(cname) == 'QGRAUP' .and. keep_moist_arrays ) THEN
+     allocate(QG(west_east_dim,south_north_dim,bottom_top_dim))
+     QG = real_array
+     have_QG = .TRUE.
+  END IF
+  
+  END SUBROUTINE keep_arrays
+
+END MODULE module_arrays
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_arrays_old.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_arrays_old.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_arrays_old.f90	(revision 207)
@@ -0,0 +1,211 @@
+!! Which arrays are we carrying around
+
+MODULE module_arrays
+
+  CONTAINS
+  SUBROUTINE clobber_arrays()
+
+  USE module_model_basics
+
+     IF (ALLOCATED(XLAT)) DEALLOCATE(XLAT)
+     have_XLAT = .FALSE.
+     IF (ALLOCATED(XLONG)) DEALLOCATE(XLONG)
+     have_XLONG = .FALSE.
+     IF (ALLOCATED(HGT)) DEALLOCATE(HGT)
+     have_HGT = .FALSE.
+
+     IF (ALLOCATED(U10)) DEALLOCATE(U10)
+     have_U10 = .FALSE.
+     IF (ALLOCATED(V10)) DEALLOCATE(V10)
+     have_V10 = .FALSE.
+
+     IF (ALLOCATED(PRES)) DEALLOCATE(PRES)
+     have_PRES = .FALSE.
+     IF (ALLOCATED(P)) DEALLOCATE(P)
+     have_P = .FALSE.
+     IF (ALLOCATED(PB)) DEALLOCATE(PB)
+     have_PB = .FALSE.
+     IF (ALLOCATED(PSFC)) DEALLOCATE(PSFC)
+     have_PSFC = .FALSE.
+
+     IF (ALLOCATED(MU)) DEALLOCATE(MU)
+     have_MU = .FALSE.
+     IF (ALLOCATED(MUB)) DEALLOCATE(MUB)
+     have_MUB = .FALSE.
+     IF (ALLOCATED(ZNU)) DEALLOCATE(ZNU)
+     have_ZNU = .FALSE.
+     IF (ALLOCATED(ZNW)) DEALLOCATE(ZNW)
+     have_ZNW = .FALSE.
+     
+     have_PTOP = .FALSE.
+
+     IF (ALLOCATED(PH)) DEALLOCATE(PH)
+     have_PH = .FALSE.
+     IF (ALLOCATED(PHB)) DEALLOCATE(PHB)
+     have_PHB = .FALSE.
+
+     IF (ALLOCATED(UUU)) DEALLOCATE(UUU)
+     have_UUU = .FALSE.
+     IF (ALLOCATED(VVV)) DEALLOCATE(VVV)
+     have_VVV = .FALSE.
+
+     IF (ALLOCATED(TK)) DEALLOCATE(TK)
+     have_TK = .FALSE.
+     IF (ALLOCATED(T)) DEALLOCATE(T)
+     have_T = .FALSE.
+
+     IF (ALLOCATED(QV)) DEALLOCATE(QV)
+     have_QV = .FALSE.
+     IF (ALLOCATED(QR)) DEALLOCATE(QR)
+     have_QR = .FALSE.
+     IF (ALLOCATED(QS)) DEALLOCATE(QS)
+     have_QS = .FALSE.
+     IF (ALLOCATED(QG)) DEALLOCATE(QG)
+     have_QG = .FALSE.
+
+  END SUBROUTINE clobber_arrays
+
+
+
+
+  SUBROUTINE keep_arrays(cname, real_array)
+
+  USE gridinfo_module
+  USE module_model_basics
+
+! Arguments
+  character (len=128)             :: cname
+  real, pointer, dimension(:,:,:) :: real_array
+
+  IF (cname(1:4) == 'XLAT') THEN
+     allocate(XLAT(west_east_dim,south_north_dim))
+     XLAT = real_array(:,:,1)
+     have_XLAT = .TRUE.
+  ELSE IF (cname(1:5) == 'XLONG') THEN
+     allocate(XLONG(west_east_dim,south_north_dim))
+     XLONG = real_array(:,:,1)
+     have_XLONG = .TRUE.
+  ELSE IF (cname(1:3) == 'HGT') THEN
+     allocate(HGT(west_east_dim,south_north_dim))
+     HGT = real_array(:,:,1)
+     have_HGT = .TRUE.
+
+  ELSE IF (trim(cname) == 'U10' .and. keep_wind_arrays) THEN
+     allocate(U10(west_east_dim,south_north_dim))
+     U10 = real_array(:,:,1)
+     have_U10 = .TRUE.
+  ELSE IF (trim(cname) == 'V10' .and. keep_wind_arrays) THEN
+     allocate(V10(west_east_dim,south_north_dim))
+     V10 = real_array(:,:,1)
+     have_V10 = .TRUE.
+
+  ELSE IF (trim(cname) == 'PRES') THEN
+     allocate(PRES(west_east_dim,south_north_dim,bottom_top_dim))
+     PRES = real_array
+     have_PRES = .TRUE.
+
+  ELSE IF (trim(cname) == 'P') THEN
+     allocate(P(west_east_dim,south_north_dim,bottom_top_dim))
+     P = real_array
+     have_P = .TRUE.
+  ELSE IF (trim(cname) == 'PB') THEN
+     allocate(PB(west_east_dim,south_north_dim,bottom_top_dim))
+     PB = real_array
+     have_PB = .TRUE.
+!  ELSE IF (trim(cname) == 'PTOT') THEN
+!     allocate(P(west_east_dim,south_north_dim,bottom_top_dim))
+!     allocate(PB(west_east_dim,south_north_dim,bottom_top_dim))
+!     P = 0.5*real_array
+!     PB = 0.5*real_array
+!     have_P = .TRUE.
+!     have_PB = .TRUE.
+
+  ELSE IF (trim(cname) == 'PSFC') THEN
+     allocate(PSFC(west_east_dim,south_north_dim))
+     PSFC = real_array(:,:,1)
+     have_PSFC = .TRUE.
+
+  ELSE IF (trim(cname) == 'MU') THEN
+     allocate(MU(west_east_dim,south_north_dim))
+     MU = real_array(:,:,1)
+     have_MU = .TRUE.
+  ELSE IF (trim(cname) == 'MUB') THEN
+     allocate(MUB(west_east_dim,south_north_dim))
+     MUB = real_array(:,:,1)
+     have_MUB = .TRUE.
+  ELSE IF (trim(cname) == 'ZNU') THEN
+     allocate(ZNU(bottom_top_dim))
+     ZNU = real_array(:,1,1)
+     have_ZNU = .TRUE.
+  ELSE IF (trim(cname) == 'ZNW') THEN
+     allocate(ZNW(bottom_top_dim+1))
+     ZNW = real_array(:,1,1)
+     have_ZNW = .TRUE.
+  ELSE IF (trim(cname) == 'P_TOP') THEN
+     PTOP = real_array(1,1,1)
+     have_PTOP = .TRUE.
+
+  ELSE IF (trim(cname) == 'PH') THEN
+     allocate(PH(west_east_dim,south_north_dim,bottom_top_dim))
+     PH = 0.5*(real_array(:,:,1:bottom_top_dim)+real_array(:,:,2:bottom_top_dim+1))
+     have_PH = .TRUE.
+  ELSE IF (trim(cname) == 'PHB') THEN
+     allocate(PHB(west_east_dim,south_north_dim,bottom_top_dim))
+     PHB = 0.5*(real_array(:,:,1:bottom_top_dim)+real_array(:,:,2:bottom_top_dim+1))!
+     have_PHB = .TRUE.
+!  ELSE IF (trim(cname) == 'PHTOT') THEN
+!     allocate(PH(west_east_dim,south_north_dim,bottom_top_dim))
+!     allocate(PHB(west_east_dim,south_north_dim,bottom_top_dim))	
+!!
+!! MARS caca: staggering problems
+!!
+!!     PH = 0.5*0.5*(real_array(:,:,1:bottom_top_dim)+real_array(:,:,2:bottom_top_dim+1))
+!!     PHB = 0.5*0.5*(real_array(:,:,1:bottom_top_dim)+real_array(:,:,2:bottom_top_dim+1))
+!PH = 0.5*real_array
+!PHB = 0.5*real_array
+!     have_PH = .TRUE.
+!     have_PHB = .TRUE.	
+
+  ELSE IF (trim(cname) == 'U' .or. trim(cname) == 'UU') THEN
+     IF (keep_wind_arrays) THEN
+       allocate(UUU(west_east_dim,south_north_dim,bottom_top_dim))
+       UUU = 0.5*(real_array(1:west_east_dim,:,:)+real_array(2:west_east_dim+1,:,:))
+       have_UUU = .TRUE.
+     END IF
+  ELSE IF (trim(cname) == 'V' .or. trim(cname) == 'VV') THEN
+     IF (keep_wind_arrays) THEN
+       allocate(VVV(west_east_dim,south_north_dim,bottom_top_dim))
+       VVV = 0.5*(real_array(:,1:south_north_dim,:)+real_array(:,2:south_north_dim+1,:))
+       have_VVV = .TRUE.
+     END IF
+
+  ELSE IF (trim(cname) == 'TT' .or. trim(cname) == 'TK') THEN
+     allocate(TK(west_east_dim,south_north_dim,bottom_top_dim))
+     TK = real_array
+     have_TK = .TRUE.
+  ELSE IF (trim(cname) == 'T') THEN
+     allocate(T(west_east_dim,south_north_dim,bottom_top_dim))
+     T = real_array
+     have_T = .TRUE.
+
+  ELSE IF (trim(cname) == 'QVAPOR') THEN
+     allocate(QV(west_east_dim,south_north_dim,bottom_top_dim))
+     QV = real_array
+     have_QV = .TRUE.
+  ELSE IF (trim(cname) == 'QRAIN' .and. keep_moist_arrays ) THEN
+     allocate(QR(west_east_dim,south_north_dim,bottom_top_dim))
+     QR = real_array
+     have_QR = .TRUE.
+  ELSE IF (trim(cname) == 'QSNOW' .and. keep_moist_arrays ) THEN
+     allocate(QS(west_east_dim,south_north_dim,bottom_top_dim))
+     QS = real_array
+     have_QS = .TRUE.
+  ELSE IF (trim(cname) == 'QGRAUP' .and. keep_moist_arrays ) THEN
+     allocate(QG(west_east_dim,south_north_dim,bottom_top_dim))
+     QG = real_array
+     have_QG = .TRUE.
+  END IF
+  
+  END SUBROUTINE keep_arrays
+
+END MODULE module_arrays
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_cape.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_cape.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_cape.f90	(revision 207)
@@ -0,0 +1,438 @@
+!! Diagnostics: CAPE / CIN / LCL / LFC
+!! Depend on 2D/3D flag send in
+!! Code originally from RIP4
+
+MODULE module_calc_cape
+
+  real, dimension(150)                                           :: buoy, zrel, benaccum
+  real, dimension(150)                                           :: psadithte, psadiprs
+  real, dimension(150,150)                                       :: psaditmk
+
+  CONTAINS
+  SUBROUTINE calc_cape(SCR4, cname, cdesc, cunits, i3dflag)
+
+!   If i3dflag=1, this routine calculates CAPE and CIN (in m**2/s**2,
+!   or J/kg) for every grid point in the entire 3D domain (treating
+!   each grid point as a parcel).  If i3dflag=0, then it
+!   calculates CAPE and CIN only for the parcel with max theta-e in
+!   the column, (i.e. something akin to Colman's MCAPE).  By "parcel",
+!   we mean a 500-m deep parcel, with actual temperature and moisture
+!   averaged over that depth.
+!
+!   In the case of i3dflag=0,
+!   MCAPE, MCIN, LCL and LFC (2D fields are calculated)
+
+
+  USE constants_module
+  USE module_model_basics
+
+  IMPLICIT NONE
+
+  !Arguments
+  real, allocatable, dimension(:,:,:,:)                          :: SCR4
+  character (len=128)                                            :: cname, cdesc, cunits
+  integer                                                        :: i3dflag
+
+  ! Local variables
+  integer                                                        :: i, j, k, kk, jt, ip, iustnlist
+  integer                                                        :: kpar, kpar1, kpar2, kmax, klev, kel
+  integer                                                        :: ilcl, klcl, klfc
+  integer                                                        :: nprs, nthte
+  real, dimension(west_east_dim,south_north_dim)                 :: ter
+  real, dimension(west_east_dim,south_north_dim,bottom_top_dim)  :: prs, tmk, ght, qvp
+  real, dimension(west_east_dim,south_north_dim,bottom_top_dim)  :: prsf, cape, cin
+  real                                                           :: ethpari, zlcl, tvenv
+  real                                                           :: p1, p2, pp1, pp2, pup, pdn
+  real                                                           :: totprs, totqvp, totthe
+  real                                                           :: eslift, ghtlift, qvplift, tmklift, tvlift
+  real                                                           :: ghtpari, prspari, qvppari, tmkpari
+  real                                                           :: tmkenv, qvpenv, tlcl
+  real                                                           :: fac1, fac2, facden, th, deltap
+  real                                                           :: benamin, davg, pavg, pressure, temp
+  real                                                           :: e, eth, ethmax, q, dz, cpm
+  character (len=20)                                             :: fname
+  logical                                                        :: is_used
+
+  
+  SCR4 = 0.0
+
+
+     ! Open psadilookup.dat     
+     DO iustnlist = 10,100
+        INQUIRE(unit=iustnlist, opened=is_used)
+        if (.not. is_used) exit
+     END DO
+     fname = 'src/psadilookup.dat' 
+     OPEN (unit=iustnlist,file=fname,form='formatted',status='old')
+
+     DO i = 1,14
+       READ (iustnlist,*)
+     ENDDO
+     READ (iustnlist,*) nthte,nprs
+     IF ( nthte.ne.150 .OR. nprs.ne.150 ) then
+       PRINT*, 'Number of pressure or theta_e levels in lookup table'
+       PRINT*, '     file not = 150.  Check lookup table file.'
+       STOP
+     ENDIF
+     READ (iustnlist,173) (psadithte(jt),jt=1,nthte) 
+     READ (iustnlist,173) (psadiprs(ip),ip=1,nprs)
+     READ (iustnlist,173) ((psaditmk(ip,jt),ip=1,nprs),jt=1,nthte)
+ 173 FORMAT (5e15.7)
+     CLOSE (iustnlist)  
+
+
+  !! Get fields we want from the ones we have
+     ter      = HGT
+     qvp      = QV
+     prs      = PRES * 0.01                   ! pressure in hPa
+     tmk      = TK                            ! temperature in K
+     ght      = (PH+PHB) / G                  ! height in m
+
+
+  !! First calculate a pressure array on FULL SIGMA levels
+  !! Similar to the pfcalc.f routine from RIP4
+  !! Top full sigma level is ommitted
+     prsf(:,:,1) = PSFC(:,:)             !! Lowest full sigma set to surface pressure
+     DO k = 2, bottom_top_dim
+       prsf(:,:,k)=.5*(prs(:,:,k-1)+prs(:,:,k))
+     END DO
+
+     
+     cape = 0.0
+     cin  = 0.0
+
+     DO j = 1,south_north_dim          !! BIG i/j loop
+     DO i = 1,west_east_dim
+
+       IF ( i3dflag == 1 ) THEN       !! 3D case
+
+         kpar1=bottom_top_dim-1
+         kpar2=1
+
+       ELSE                           !! 2D case
+ 
+!      Find parcel with max theta-e in lowest 3 km AGL.
+         ethmax = -1.
+         DO k = 1, bottom_top_dim
+           IF ( ght(i,j,k)-ter(i,j) .lt. 3000. ) THEN
+             q        = max(qvp(i,j,k),1.e-15)
+             temp     = tmk(i,j,k)
+             pressure = prs(i,j,k)
+             e        = (q*pressure)/(EPS+q)
+             tlcl     = TLCLC1/(log(temp**TLCLC2/e)-TLCLC3)+TLCLC4
+             eth  =     temp*(1000./pressure)**( GAMMA_RIP*(1.+GAMMAMD*q) )*     &
+                        exp( (THTECON1/tlcl-THTECON2)*q*(1.+THTECON3*q) )
+             IF ( eth .gt. ethmax ) THEN
+               klev=k
+               ethmax=eth
+             END IF
+           END IF
+         END DO
+         kpar1=klev
+         kpar2=klev
+ 
+!      Establish average properties of that parcel
+!      (over depth of approximately davg meters)
+         davg = 500.
+         pavg = davg*prs(i,j,kpar1)*G /                        &
+                ( Rd*virtual(tmk(i,j,kpar1),qvp(i,j,kpar1)) )
+         p2 = min(prs(i,j,kpar1)+.5*pavg,prsf(i,j,1))
+         p1 = p2-pavg
+         totthe = 0.
+         totqvp = 0.
+         totprs = 0.
+         DO k = 1,bottom_top_dim-1
+           IF ( prsf(i,j,k)   .le. p1 ) GOTO 35
+           IF ( prsf(i,j,k+1) .ge. p2 ) GOTO 34
+           pressure = prs(i,j,k)
+           pup      = prsf(i,j,k)
+           pdn      = prsf(i,j,k+1)
+           q        = max(qvp(i,j,k),1.e-15)
+           th       = tmk(i,j,k)*(1000./pressure)**(GAMMA_RIP*(1.+GAMMAMD*q))
+           pp1      = max(p1,pdn)
+           pp2      = min(p2,pup)
+           IF ( pp2 .gt. pp1 ) THEN
+             deltap = pp2-pp1
+             totqvp = totqvp+q*deltap
+             totthe = totthe+th*deltap
+             totprs = totprs+deltap
+           END IF
+ 34        CONTINUE
+         END DO
+ 35      CONTINUE
+         qvppari = totqvp/totprs
+         tmkpari = (totthe/totprs)*(prs(i,j,kpar1)/1000.)**    &
+                   (GAMMA_RIP*(1.+GAMMAMD*qvp(i,j,kpar1)))
+       ENDIF
+
+       !!!   END of 2D / 3D specific bits 
+
+
+       DO kpar = kpar1,kpar2,-1                      !! This loop is done for both 2D / 3D
+ 
+!   Calculate temperature and moisture properties of parcel
+
+         IF ( i3dflag == 1 ) THEN    ! (Note, qvppari and tmkpari already calculated above for 2D case.)
+           qvppari = qvp(i,j,kpar)
+           tmkpari = tmk(i,j,kpar)
+         END IF
+         prspari = prs(i,j,kpar)
+         ghtpari = ght(i,j,kpar)
+         cpm     = cp*(1.+CPMD*qvppari)
+ 
+         e       = max(1.e-20,qvppari*prspari/(EPS+qvppari))
+         tlcl    = TLCLC1/(log(tmkpari**TLCLC2/e)-TLCLC3)+TLCLC4
+         ethpari = tmkpari*(1000./prspari)**(GAMMA_RIP*(1.+GAMMAMD*qvppari))*   &
+                   exp((THTECON1/tlcl-THTECON2)*qvppari*                    &
+                   (1.+THTECON3*qvppari))
+         zlcl    = ghtpari+(tmkpari-tlcl)/(G/cpm)
+
+!   Calculate buoyancy and relative height of lifted parcel at
+!   all levels, and store in bottom up arrays.  Add a level at the LCL,
+!   and at all points where buoyancy is zero.
+ 
+         kk = 0                    ! for arrays that go bottom to top
+         ilcl = 0
+         IF ( ghtpari .ge. zlcl ) THEN
+           !! initial parcel already saturated or supersaturated.
+           ilcl = 2
+           klcl = 1
+         END IF
+
+         DO k = kpar,bottom_top_dim
+ 33        kk=kk+1                ! for arrays that go bottom to top
+
+           IF ( ght(i,j,k) .lt. zlcl ) THEN ! model level is below LCL
+             qvplift = qvppari
+             tmklift = tmkpari-G/cpm*(ght(i,j,k)-ghtpari)
+             tvenv   = virtual(tmk(i,j,k),qvp(i,j,k))
+             tvlift  = virtual(tmklift,qvplift)
+             ghtlift = ght(i,j,k)
+           ELSE IF ( ght(i,j,k) .ge. zlcl .AND. ilcl .eq. 0 ) THEN
+             !! This model level and previous model level straddle the LCL,
+             !! so first create a new level in the bottom-up array, at the LCL.
+             tmklift = tlcl
+             qvplift = qvppari
+             facden  = ght(i,j,k)-ght(i,j,k-1)
+             fac1    = (zlcl-ght(i,j,k-1))/facden
+             fac2    = (ght(i,j,k)-zlcl)/facden
+             tmkenv  = tmk(i,j,k-1)*fac2+tmk(i,j,k)*fac1
+             qvpenv  = qvp(i,j,k-1)*fac2+qvp(i,j,k)*fac1
+             tvenv   = virtual(tmkenv,qvpenv)
+             tvlift  = virtual(tmklift,qvplift)
+             ghtlift = zlcl
+             ilcl    = 1
+           ELSE
+             tmklift = tonpsadiabat(ethpari,prs(i,j,k))                                
+             eslift  = EZERO*exp(eslcon1*(tmklift-CELKEL)/    &
+                       (tmklift-eslcon2))
+             qvplift = EPS*eslift/(prs(i,j,k)-eslift)
+             tvenv   = virtual(tmk(i,j,k),qvp(i,j,k))
+             tvlift  = virtual(tmklift,qvplift)
+             ghtlift = ght(i,j,k)
+           END IF
+
+           buoy(kk) = G*(tvlift-tvenv)/tvenv  ! buoyancy
+           zrel(kk) = ghtlift-ghtpari
+
+           IF ( (buoy(kk)*buoy(kk-1).lt.0.0) .AND. (kk.gt.1) ) THEN
+             !! Parcel ascent curve crosses sounding curve, so create a new level
+             !! in the bottom-up array at the crossing.
+             kk = kk+1
+             buoy(kk)   = buoy(kk-1)
+             zrel(kk)   = zrel(kk-1)
+             buoy(kk-1) = 0.
+             zrel(kk-1) = zrel(kk-2) + buoy(kk-2)/(buoy(kk-2)-buoy(kk))*  &
+                          (zrel(kk)-zrel(kk-2))
+           END IF
+
+           IF (ilcl == 1) THEN
+             klcl = kk
+             ilcl = 2
+             GOTO 33
+           END IF
+
+         END DO         !! END DO k = kpar,bottom_top_dim
+
+         kmax = kk
+         IF (kmax .gt. 150) THEN
+           PRINT*, 'in calc_cape: kmax got too big. kmax=',kmax
+           STOP
+         ENDIF
+
+ 
+!        Get the accumulated buoyant energy from the parcel's starting
+!        point, at all levels up to the top level.
+
+         benaccum(1) = 0.0
+         benamin     = 9e9
+         DO k = 2,kmax
+           dz          = zrel(k)-zrel(k-1)
+           benaccum(k) = benaccum(k-1)+.5*dz*(buoy(k-1)+buoy(k))
+             IF ( benaccum(k) .lt. benamin ) THEN
+               benamin = benaccum(k)
+             END IF
+         END DO
+
+
+!        Determine equilibrium level (EL), which we define as the highest
+!        level of non-negative buoyancy above the LCL. Note, this may be
+!        the top level if the parcel is still buoyant there.
+
+         DO k = kmax,klcl,-1
+           IF ( buoy(k) .ge. 0. ) THEN
+             kel = k   ! k of equilibrium level
+             GOTO 50
+           END IF
+         END DO
+
+
+!        If we got through that loop, then there is no non-negative
+!        buoyancy above the LCL in the sounding.  In these situations,
+!        both CAPE and CIN will be set to -0.1 J/kg.  Also, where CAPE is
+!        non-zero, CAPE and CIN will be set to a minimum of +0.1 J/kg, so
+!        that the zero contour in either the CIN or CAPE fields will
+!        circumscribe regions of non-zero CAPE.
+ 
+         cape(i,j,kpar) = -0.1
+         cin(i,j,kpar)  = -0.1
+         klfc = kmax
+ 
+         GOTO 102
+ 
+ 50      CONTINUE
+
+ 
+
+!        If there is an equilibrium level, then CAPE is positive.  We'll
+!        define the level of free convection (LFC) as the point below the
+!        EL, but at or above the LCL, where accumulated buoyant energy is a
+!        minimum.  The net positive area (accumulated buoyant energy) from
+!        the LFC up to the EL will be defined as the CAPE, and the net
+!        negative area (negative of accumulated buoyant energy) from the
+!        parcel starting point to the LFC will be defined as the convective
+!        inhibition (CIN).
+ 
+!        First get the LFC according to the above definition.
+ 
+         benamin = 9e9
+         klfc = kmax
+         DO k = klcl,kel
+           IF ( benaccum(k) .lt. benamin ) THEN
+             benamin = benaccum(k)
+             klfc = k
+           END IF
+         END DO
+ 
+!        Now we can assign values to cape and cin
+ 
+         cape(i,j,kpar) = max(benaccum(kel)-benamin,0.1)
+         cin(i,j,kpar)  = max(-benamin,0.1)
+ 
+!        CIN is uninteresting when CAPE is small (< 100 J/kg), so set
+!        CIN to -.1 in that case.
+ 
+         IF ( cape(i,j,kpar) .lt. 100. ) cin(i,j,kpar) = -0.1
+
+ 102     CONTINUE
+
+       ENDDO          !! END of BIG 2D/3D loop
+
+
+       IF ( i3dflag == 0 ) THEN
+         SCR4(i,j,1,1) = cape(i,j,kpar1)
+         SCR4(i,j,1,2) = cin(i,j,kpar1)
+         SCR4(i,j,1,3) = zrel(klcl)+ghtpari-ter(i,j)   ! meters AGL (LCL)
+         SCR4(i,j,1,4) = zrel(klfc)+ghtpari-ter(i,j)   ! meters AGL (LFC)
+       ENDIF
+
+ 
+     END DO
+     END DO                !! END BIG i/j loop
+ 
+
+  !! These will be set by module_diagnostics as we have more than 1 field
+
+  IF ( i3dflag == 1 ) THEN
+    SCR4(:,:,:,1) = cape(:,:,:)
+    SCR4(:,:,:,2) = cin(:,:,:)
+  ENDIF
+
+  cname    = " "
+  cdesc    = " "
+  cunits   = " "
+  
+
+  END SUBROUTINE calc_cape
+
+
+!*********************************************************************c
+!*********************************************************************c
+  FUNCTION tonpsadiabat (thte,prs)
+ 
+!   This function gives the temperature (in K) on a moist adiabat
+!   (specified by thte in K) given pressure in hPa.  It uses a
+!   lookup table, with data that was generated by the Bolton (1980)
+!   formula for theta_e.
+
+ 
+!     First check if pressure is less than min pressure in lookup table.
+!     If it is, assume parcel is so dry that the given theta-e value can
+!     be interpretted as theta, and get temperature from the simple dry
+!     theta formula.
+ 
+      IF ( prs .lt. psadiprs(150) ) THEN
+        tonpsadiabat = thte*(prs/1000.)**GAMMA_RIP
+        RETURN
+      ENDIF
+ 
+
+!     Otherwise, look for the given thte/prs point in the lookup table.
+ 
+      DO jtch = 1,150-1
+        IF ( thte.ge.psadithte(jtch) .AND. thte.lt.psadithte(jtch+1) ) THEN
+          jt = jtch
+          GOTO 213
+        END IF
+      END DO
+      jt = -1
+ 213  CONTINUE
+
+      DO ipch = 1,150-1
+        if ( prs.le.psadiprs(ipch) .AND. prs.gt.psadiprs(ipch+1) ) THEN
+          ip = ipch
+          GOTO 215
+        END IF
+      ENDDO
+      ip = -1
+ 215  CONTINUE
+
+
+      IF ( jt.eq.-1 .OR. ip.eq.-1 ) THEN
+        PRINT*, 'Outside of lookup table bounds. prs,thte=',prs,thte
+        STOP 
+      ENDIF
+
+
+      fracjt  = (thte-psadithte(jt))/(psadithte(jt+1)-psadithte(jt))
+      fracjt2 = 1.-fracjt
+      fracip  = (psadiprs(ip)-prs)/(psadiprs(ip)-psadiprs(ip+1))
+      fracip2 = 1.-fracip
+
+      IF ( psaditmk(ip,jt  ).gt.1e9 .OR. psaditmk(ip+1,jt  ).gt.1e9 .OR.   &
+           psaditmk(ip,jt+1).gt.1e9 .OR. psaditmk(ip+1,jt+1).gt.1e9 ) THEN
+        PRINT*, 'Tried to access missing tmperature in lookup table.'
+        PRINT*, 'Prs and Thte probably unreasonable. prs,thte=',prs,thte
+        STOP
+      ENDIF
+
+      tonpsadiabat = fracip2*fracjt2*psaditmk(ip  ,jt  )+   &
+                     fracip *fracjt2*psaditmk(ip+1,jt  )+   &
+                     fracip2*fracjt *psaditmk(ip  ,jt+1)+   &
+                     fracip *fracjt *psaditmk(ip+1,jt+1)
+      
+
+  END FUNCTION tonpsadiabat 
+
+
+END MODULE module_calc_cape
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_clfr.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_clfr.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_clfr.f90	(revision 207)
@@ -0,0 +1,62 @@
+!! Diagnostics: low / mid / high cloud fraction
+!! Code originally from MM5toGrADS
+
+MODULE module_calc_clfr
+
+  CONTAINS
+  SUBROUTINE calc_clfr(SCR4, cname, cdesc, cunits, RH_in)
+
+  USE module_model_basics
+
+  IMPLICIT NONE
+
+  !Arguments
+  real, allocatable, dimension(:,:,:,:)                          :: SCR4
+  real, pointer, dimension(:,:,:)                                :: RH_in
+  character (len=128)                                            :: cname, cdesc, cunits
+
+  ! Local variables
+  integer                                                        :: i, j, k, kclo, kcmi, kchi
+
+  
+  SCR4 = 0.0
+
+   DO j = 1,south_north_dim   
+     DO i = 1,west_east_dim
+       DO k = 1,bottom_top_dim
+          IF ( PRES(i,j,k) .gt. 97000. ) kclo=k
+          IF ( PRES(i,j,k) .gt. 80000. ) kcmi=k
+          IF ( PRES(i,j,k) .gt. 45000. ) kchi=k
+       END DO
+       DO k = 1,bottom_top_dim
+          IF ( k .ge. kclo .AND. k .lt. kcmi ) &               !! low cloud
+               SCR4(i,j,1,1) = AMAX1(RH_in(i,j,k),SCR4(i,j,1,1))
+          IF ( k .ge. kcmi .AND. k .lt. kchi ) &               !! mid cloud
+               SCR4(i,j,1,2) = AMAX1(RH_in(i,j,k),SCR4(i,j,1,2))
+          IF ( k .ge. kchi ) &                                 !! high cloud
+               SCR4(i,j,1,3) = AMAX1(RH_in(i,j,k),SCR4(i,j,1,3))
+       END DO
+
+       SCR4(i,j,1,1)=4.0*SCR4(i,j,1,1)/100.-3.0
+       SCR4(i,j,1,2)=4.0*SCR4(i,j,1,2)/100.-3.0
+       SCR4(i,j,1,3)=2.5*SCR4(i,j,1,3)/100.-1.5
+
+       SCR4(i,j,1,1)=amin1(SCR4(i,j,1,1),1.0)
+       SCR4(i,j,1,1)=amax1(SCR4(i,j,1,1),0.0)
+       SCR4(i,j,1,2)=amin1(SCR4(i,j,1,2),1.0)
+       SCR4(i,j,1,2)=amax1(SCR4(i,j,1,2),0.0)
+       SCR4(i,j,1,3)=amin1(SCR4(i,j,1,3),1.0)
+       SCR4(i,j,1,3)=amax1(SCR4(i,j,1,3),0.0)
+
+     END DO 
+   END DO 
+
+
+  cname    = " "
+  cdesc    = " "
+  cunits   = "%"
+  
+
+  END SUBROUTINE calc_clfr
+
+END MODULE module_calc_clfr
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_dbz.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_dbz.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_dbz.f90	(revision 207)
@@ -0,0 +1,162 @@
+!! Diagnostics: Reflectivity
+!! This routine - including comments were taken from the RIP4 program
+!! The only change was the removing of the old "ivarint=0" option
+
+MODULE module_calc_dbz
+
+  CONTAINS
+  SUBROUTINE calc_dbz (SCR, cname, cdesc, cunits)
+
+!
+!     This routine computes equivalent reflectivity factor (in dBZ) at
+!     each model grid point.  In calculating Ze, the RIP algorithm makes
+!     assumptions consistent with those made in an early version
+!     (ca. 1996) of the bulk mixed-phase microphysical scheme in the MM5
+!     model (i.e., the scheme known as "Resiner-2").  For each species:
+!
+!     1. Particles are assumed to be spheres of constant density.  The
+!     densities of rain drops, snow particles, and graupel particles are
+!     taken to be rho_r = rho_l = 1000 kg m^-3, rho_s = 100 kg m^-3, and
+!     rho_g = 400 kg m^-3, respectively. (l refers to the density of
+!     liquid water.)
+!
+!     2. The size distribution (in terms of the actual diameter of the
+!     particles, rather than the melted diameter or the equivalent solid
+!     ice sphere diameter) is assumed to follow an exponential
+!     distribution of the form N(D) = N_0 * exp( lambda*D ).
+!
+!     3. If ivarint=0, the intercept parameters are assumed constant (as
+!     in early Reisner-2), with values of 8x10^6, 2x10^7, and 4x10^6 m^-4,
+!     for rain, snow, and graupel, respectively.  If ivarint=1, variable
+!     intercept parameters are used, as calculated in Thompson, Rasmussen,
+!     and Manning (2004, Monthly Weather Review, Vol. 132, No. 2, pp. 519-542.)
+!
+!     More information on the derivation of simulated reflectivity in RIP
+!     can be found in Stoelinga (2005, unpublished write-up).  Contact
+!     Mark Stoelinga (stoeling@atmos.washington.edu) for a copy.
+!
+
+  USE constants_module
+  USE module_model_basics
+
+  IMPLICIT NONE
+
+  !Arguments
+  real, pointer, dimension(:,:,:)                                :: SCR
+  character (len=128)                                            :: cname, cdesc, cunits
+
+  !Local Variables
+  integer                                                        :: i, j, k
+  real                                                           :: temp_c
+  real                                                           :: gonv, ronv, sonv
+  real                                                           :: factor_g, factor_r, factor_s
+  real                                                           :: factorb_g, factorb_r, factorb_s
+  real                                                           :: rhoair, z_e
+  real, dimension(west_east_dim,south_north_dim,bottom_top_dim)  :: qvp, qra, qsn, qgr
+  real, dimension(west_east_dim,south_north_dim,bottom_top_dim)  :: tmk, prs
+
+!   Constants used to calculate variable intercepts
+  real, parameter                                                :: r1 = 1.e-15
+  real, parameter                                                :: ron = 8.e6
+  real, parameter                                                :: ron2 = 1.e10
+  real, parameter                                                :: son = 2.e7
+  real, parameter                                                :: gon = 5.e7
+  real, parameter                                                :: ron_min = 8.e6
+  real, parameter                                                :: ron_qr0 = 0.00010
+  real, parameter                                                :: ron_delqr0 = 0.25*ron_qr0
+  real, parameter                                                :: ron_const1r = (ron2-ron_min)*0.5
+  real, parameter                                                :: ron_const2r = (ron2+ron_min)*0.5
+!   Other constants
+  real, parameter                                                :: gamma_seven = 720.
+  real, parameter                                                :: rho_r = RHOWAT           ! 1000. kg m^-3
+  real, parameter                                                :: rho_s = 100.             ! kg m^-3
+  real, parameter                                                :: rho_g = 400.             ! kg m^-3
+  real, parameter                                                :: alpha = 0.224
+
+  ALLOCATE(SCR(west_east_dim,south_north_dim,bottom_top_dim))
+
+
+      prs      = PRES * 0.01                  ! pressure in hPa
+      tmk      = TK                           ! temperature in K
+
+      qvp = QV
+      qra = QR
+      qsn = 0.0
+      qgr = 0.0
+      IF ( have_QS ) qsn = QS
+      IF ( have_QG ) qgr = QG
+      IF ( maxval(qsn) == 0.0 .AND. maxval(qgr) == 0.0 ) THEN
+        !! No ice in this run
+        WHERE ( tmk .lt. CELKEL )
+          qra = 0.0
+          qsn = qr
+        END WHERE
+      END IF
+
+      factor_r = gamma_seven * 1.e18 * (1./(PI*rho_r))**1.75
+      factor_s = gamma_seven * 1.e18 * (1./(PI*rho_s))**1.75   &
+                    * (rho_s/RHOWAT)**2 * alpha
+      factor_g = gamma_seven * 1.e18 * (1./(PI*rho_g))**1.75   &
+                    * (rho_g/RHOWAT)**2 * alpha
+ 
+      DO k = 1,bottom_top_dim
+        DO j = 1,south_north_dim
+          DO i = 1,west_east_dim
+ 
+            rhoair=prs(i,j,k)*100./ ( Rd*virtual(tmk(i,j,k),qvp(i,j,k)) )  ! air density
+ 
+!      Adjust factor for brightband, where snow or graupel particle
+!      scatters like liquid water (alpha=1.0) because it is assumed to
+!      have a liquid skin.
+ 
+            IF (tmk(i,j,k) .gt. CELKEL) THEN
+              factorb_s=factor_s/alpha
+              factorb_g=factor_g/alpha
+            ELSE
+              factorb_s=factor_s
+              factorb_g=factor_g
+            ENDIF
+ 
+!      Calculate variable intercept parameters
+ 
+            temp_c = amin1(-0.001, tmk(i,j,k)-CELKEL)
+            sonv   = amin1(2.0e8, 2.0e6*exp(-0.12*temp_c))
+ 
+            gonv = gon
+            IF (qgr(i,j,k).gt.r1) THEN
+              gonv = 2.38*(PI*rho_g/(rhoair*qgr(i,j,k)))**0.92
+              gonv = max(1.e4, min(gonv,gon))
+            ENDIF
+ 
+            ronv = ron2
+            IF (qra(i,j,k).gt. r1) THEN
+               ronv = ron_const1r*tanh((ron_qr0-qra(i,j,k))     &
+                      /ron_delqr0) + ron_const2r
+            ENDIF
+ 
+!      Total equivalent reflectivity factor (z_e, in mm^6 m^-3) is
+!      the sum of z_e for each hydrometeor species:
+ 
+            z_e =   factor_r  * (rhoair*qra(i,j,k))**1.75 /ronv**.75   &
+                  + factorb_s * (rhoair*qsn(i,j,k))**1.75 /sonv**.75   &
+                  + factorb_g * (rhoair*qgr(i,j,k))**1.75 /gonv**.75      
+
+!      Adjust small values of Z_e so that dBZ is no lower than -30
+            z_e = max(z_e,.001)
+
+!      Convert to dBZ
+            SCR(i,j,k) = 10. * log10(z_e)
+ 
+          ENDDO
+        ENDDO
+      ENDDO
+
+
+  cname    = "dbz"
+  cdesc    = "Reflectivity"
+  cunits   = "-"
+ 
+  END SUBROUTINE calc_dbz
+
+END MODULE module_calc_dbz
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_height.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_height.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_height.f90	(revision 207)
@@ -0,0 +1,23 @@
+!! Diagnostics: Height
+
+MODULE module_calc_height
+
+  CONTAINS
+  SUBROUTINE calc_height(SCR, cname, cdesc, cunits)
+
+  USE constants_module
+  USE module_model_basics
+
+  !Arguments
+  real, pointer, dimension(:,:,:)       :: SCR
+  character (len=128)                   :: cname, cdesc, cunits
+
+  
+  SCR      = ( (PH+PHB) / G ) / 1000.
+  cname    = "height"
+  cdesc    = "Model height"
+  cunits   = "KM"
+  
+  END SUBROUTINE calc_height
+
+END MODULE module_calc_height
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_pressure.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_pressure.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_pressure.f90	(revision 207)
@@ -0,0 +1,22 @@
+!! Diagnostics: Model Pressure in hPa
+
+MODULE module_calc_pressure
+
+  CONTAINS
+  SUBROUTINE calc_pressure(SCR, cname, cdesc, cunits)
+
+  USE module_model_basics
+
+  !Arguments
+  real, pointer, dimension(:,:,:)       :: SCR
+  character (len=128)                   :: cname, cdesc, cunits
+   
+
+  SCR      = PRES * 0.01
+  cname    = "pressure"
+  cdesc    = "Model pressure"
+  cunits   = "hPa"
+  
+  END SUBROUTINE calc_pressure
+
+END MODULE module_calc_pressure
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_rh.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_rh.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_rh.f90	(revision 207)
@@ -0,0 +1,30 @@
+!! Diagnostics: Relative Humidity
+
+MODULE module_calc_rh
+
+  CONTAINS
+  SUBROUTINE calc_rh(SCR, cname, cdesc, cunits)
+
+  USE constants_module
+  USE module_model_basics
+
+  !Arguments
+  real, pointer, dimension(:,:,:)                                :: SCR
+  character (len=128)                                            :: cname, cdesc, cunits
+
+  !Local
+  real, dimension(west_east_dim,south_north_dim,bottom_top_dim)  :: tmp1, tmp2  
+  
+
+  tmp1     = 10.*0.6112*exp(17.67*(TK-T0)/(TK-29.65))
+  tmp2     = EPS*tmp1/(0.01 * PRES -  (1.-EPS)*tmp1)
+  tmp1     = 100.*AMAX1(AMIN1(QV/tmp2,1.0),0.0)
+
+  SCR      = tmp1
+  cname    = "rh"
+  cdesc    = "Relative Humidity"
+  cunits   = "%"
+  
+  END SUBROUTINE calc_rh
+
+END MODULE module_calc_rh
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_slp.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_slp.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_slp.f90	(revision 207)
@@ -0,0 +1,146 @@
+!! Diagnostics: Sea Level Pressure
+
+MODULE module_calc_slp
+
+  CONTAINS
+  SUBROUTINE calc_slp(SCR, cname, cdesc, cunits)
+
+  USE constants_module
+  USE module_model_basics
+
+  !Arguments
+  real, pointer, dimension(:,:,:)                                :: SCR
+  character (len=128)                                            :: cname, cdesc, cunits
+
+  !Local
+  real, dimension(west_east_dim,south_north_dim,bottom_top_dim)  :: temp, p_tmp, z
+  integer, dimension(west_east_dim,south_north_dim)              :: level
+  real, dimension(west_east_dim,south_north_dim)                 :: slp
+  real, dimension(west_east_dim,south_north_dim)                 :: t_surf, t_sea_level
+
+  real, parameter                                                :: TC=273.16+17.5
+  real, parameter                                                :: PCONST = 10000.
+  logical, parameter                                             :: traditional_comp = .TRUE.
+
+  integer                                                        :: i, j, k
+  integer                                                        :: klo, khi
+  real                                                           :: plo, phi, tlo, thi, zlo, zhi
+  real                                                           :: p_at_pconst, t_at_pconst, z_at_pconst
+  real                                                           :: z_half_lowest
+  logical                                                        :: l1, l2, l3, found
+
+
+
+  p_tmp    = PRES                  ! Pressure in Pa
+  z        = (PH+PHB)/G
+  temp     = TK                    ! Temp in K
+
+
+!     Find least zeta level that is PCONST Pa above the surface.  We later use this
+!     level to extrapolate a surface pressure and temperature, which is supposed
+!     to reduce the effect of the diurnal heating cycle in the pressure field.
+
+  DO j = 1 , south_north_dim
+    DO i = 1 , west_east_dim
+
+      level(i,j) = -1
+      k = 1
+      found = .FALSE.
+      DO WHILE( (.not. found) .and. (k.le.bottom_top_dim) )
+        IF ( p_tmp(i,j,k) .LT. p_tmp(i,j,1)-PCONST ) THEN
+          level(i,j) = k
+          found = .TRUE.
+        END IF
+        k = k+1
+      END DO
+
+      IF ( level(i,j) .EQ. -1 ) THEN
+        PRINT '(A,I4,A)','Troubles finding level ',   &
+                    NINT(PCONST)/100,' above ground.'
+        PRINT '(A,I4,A,I4,A)',                        &
+              'Problems first occur at (',i,',',j,')'
+        PRINT '(A,F6.1,A)',                           &
+              'Surface pressure = ',p_tmp(i,j,1)/100,' hPa.'
+        STOP 'Error_in_finding_100_hPa_up'
+      END IF
+
+    END DO
+  END DO
+
+
+!     Get temperature PCONST Pa above surface.  Use this to extrapolate
+!     the temperature at the surface and down to sea level.
+
+  DO j = 1 , south_north_dim
+    DO i = 1 , west_east_dim
+
+      klo = MAX ( level(i,j) - 1 , 1      )
+      khi = MIN ( klo + 1        , bottom_top_dim - 1 )
+
+      IF ( klo .EQ. khi ) THEN
+         PRINT '(A)','Trapping levels are weird.'
+         PRINT '(A,I3,A,I3,A)','klo = ',klo,', khi = ',khi, &
+                      ': and they should not be equal.'
+         STOP 'Error_trapping_levels'
+      END IF
+
+      plo = p_tmp(i,j,klo)
+      phi = p_tmp(i,j,khi)
+      tlo = temp(i,j,klo)*(1. + 0.608 * qv(i,j,klo) )
+      thi = temp(i,j,khi)*(1. + 0.608 * qv(i,j,khi) )
+      zlo = z(i,j,klo)
+      zhi = z(i,j,khi)
+
+      p_at_pconst = p_tmp(i,j,1) - pconst
+      t_at_pconst = thi-(thi-tlo)*LOG(p_at_pconst/phi)*LOG(plo/phi)
+      z_at_pconst = zhi-(zhi-zlo)*LOG(p_at_pconst/phi)*LOG(plo/phi)
+
+      t_surf(i,j) = t_at_pconst*(p_tmp(i,j,1)/p_at_pconst)**(GAMMA*Rd/G)
+      t_sea_level(i,j) = t_at_pconst+GAMMA*z_at_pconst
+
+    END DO
+  END DO
+
+
+!     If we follow a traditional computation, there is a correction to the sea level
+!     temperature if both the surface and sea level temperatures are *too* hot.
+
+  IF ( traditional_comp ) THEN
+    DO j = 1 , south_north_dim
+      DO i = 1 , west_east_dim
+        l1 = t_sea_level(i,j) .LT. TC
+        l2 = t_surf     (i,j) .LE. TC
+        l3 = .NOT. l1
+        IF ( l2 .AND. l3 ) THEN
+          t_sea_level(i,j) = TC
+        ELSE
+          t_sea_level(i,j) = TC - 0.005*(t_surf(i,j)-TC)**2
+        END IF
+      END DO
+    END DO
+  END IF
+
+
+!     The grand finale
+
+  DO j = 1 , south_north_dim
+    DO i = 1 , west_east_dim
+      z_half_lowest=z(i,j,1)
+      slp(i,j) = p_tmp(i,j,1) *              &
+                            EXP((2.*G*z_half_lowest)/   &
+                            (Rd*(t_sea_level(i,j)+t_surf(i,j))))
+      slp(i,j) = slp(i,j)*0.01
+
+    END DO
+  END DO
+
+
+  SCR(:,:,1) = slp(:,:)
+  cname      = "slp"
+  cdesc      = "Sea Levelp Pressure"
+  cunits     = "hPa"
+
+  END SUBROUTINE calc_slp
+
+END MODULE module_calc_slp
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_tc.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_tc.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_tc.f90	(revision 207)
@@ -0,0 +1,23 @@
+!! Diagnostics: Temperature (C)
+
+MODULE module_calc_tc
+
+  CONTAINS
+  SUBROUTINE calc_tc(SCR, cname, cdesc, cunits)
+
+  USE constants_module
+  USE module_model_basics
+
+  !Arguments
+  real, pointer, dimension(:,:,:)       :: SCR
+  character (len=128)                   :: cname, cdesc, cunits
+  
+
+  SCR      = TK - T0
+  cname    = "tc"
+  cdesc    = "Temperature"
+  cunits   = "C"
+  
+  END SUBROUTINE calc_tc
+
+END MODULE module_calc_tc
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_td.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_td.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_td.f90	(revision 207)
@@ -0,0 +1,28 @@
+!! Diagnostics: Dewpoint Temperature
+
+MODULE module_calc_td
+
+  CONTAINS
+  SUBROUTINE calc_td(SCR, cname, cdesc, cunits)
+
+  USE module_model_basics
+
+  !Arguments
+  real, pointer, dimension(:,:,:)                                :: SCR
+  character (len=128)                                            :: cname, cdesc, cunits
+
+  !Local
+  real, dimension(west_east_dim,south_north_dim,bottom_top_dim)  :: tmp
+  
+
+  tmp      = QV*( PRES /100.)/(0.622+QV)
+  tmp      = AMAX1(tmp,0.001)
+
+  SCR      = (243.5*log(tmp)-440.8)/(19.48-log(tmp))
+  cname    = "td"
+  cdesc    = "Dewpoint Temperature"
+  cunits   = "C"
+  
+  END SUBROUTINE calc_td
+
+END MODULE module_calc_td
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_theta.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_theta.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_theta.f90	(revision 207)
@@ -0,0 +1,23 @@
+!! Diagnostics: Potential Temperature
+
+MODULE module_calc_theta
+
+  CONTAINS
+  SUBROUTINE calc_theta(SCR, cname, cdesc, cunits)
+
+  USE module_model_basics
+
+  !Arguments
+  real, pointer, dimension(:,:,:)       :: SCR
+  character (len=128)                   :: cname, cdesc, cunits
+  
+
+!!  SCR      = T + 300.
+  SCR      = T + 220.
+  cname    = "theta"
+  cdesc    = "Potential Temperature"
+  cunits   = "K"
+  
+  END SUBROUTINE calc_theta
+
+END MODULE module_calc_theta
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_tk.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_tk.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_tk.f90	(revision 207)
@@ -0,0 +1,23 @@
+!! Diagnostics: Temperature (Kelvin)
+
+MODULE module_calc_tk
+
+  CONTAINS
+  SUBROUTINE calc_tk(SCR, cname, cdesc, cunits)
+
+  USE constants_module
+  USE module_model_basics
+
+  !Arguments
+  real, pointer, dimension(:,:,:)       :: SCR
+  character (len=128)                   :: cname, cdesc, cunits
+  
+
+  SCR      = TK
+  cname    = "tk"
+  cdesc    = "Temperature"
+  cunits   = "K"
+  
+  END SUBROUTINE calc_tk
+
+END MODULE module_calc_tk
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_uvmet.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_uvmet.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_uvmet.f90	(revision 207)
@@ -0,0 +1,79 @@
+!! Diagnostics: U & V on earth coordinates
+
+MODULE module_calc_uvmet
+
+  CONTAINS
+  SUBROUTINE calc_uvmet(SCR4, cname, cdesc, cunits)
+
+  USE constants_module
+  USE module_model_basics
+
+  !Arguments
+  real,allocatable,dimension(:,:,:,:)             :: SCR4
+  character (len=128)                             :: cname, cdesc, cunits
+
+  !Local
+  integer                                         :: i, j
+  real                                            :: cone
+  real, dimension(west_east_dim,south_north_dim)  :: diff, alpha
+
+  
+  SCR4 = 0.0
+
+
+  IF ( map_proj .ge. 3 ) THEN                         ! No need to rotate
+    SCR4(:,:,:,1) = UUU
+    SCR4(:,:,:,2) = VVV
+  END IF
+
+
+  cone = 1.                                          !  PS
+  IF ( map_proj .eq. 1) THEN                         !  Lambert Conformal mapping
+    IF (ABS(truelat1-truelat2) .GT. 0.1) THEN
+       cone=(ALOG(COS(truelat1*RAD_PER_DEG))-            &
+             ALOG(COS(truelat2*RAD_PER_DEG))) /          &
+       (ALOG(TAN((90.-ABS(truelat1))*RAD_PER_DEG*0.5 ))- &
+        ALOG(TAN((90.-ABS(truelat2))*RAD_PER_DEG*0.5 )) )
+    ELSE
+       cone = SIN(ABS(truelat1)*RAD_PER_DEG )
+    ENDIF
+  END IF
+
+
+  diff = XLONG - stand_lon
+  DO i = 1, west_east_dim
+  DO j = 1, south_north_dim
+    IF ( diff(i,j) .gt. 180. ) THEN
+      diff(i,j) = diff(i,j) - 360.
+    END IF
+    IF ( diff(i,j) .lt. -180. ) THEN
+      diff(i,j) = diff(i,j) + 360.
+    END IF
+  END DO
+  END DO
+
+
+  DO i = 1, west_east_dim
+  DO j = 1, south_north_dim
+     IF ( XLAT(i,j) .lt. 0. ) THEN
+       alpha(i,j) = - diff(i,j) * cone * RAD_PER_DEG
+     ELSE
+       alpha(i,j) = diff(i,j) * cone * RAD_PER_DEG
+     END IF
+  END DO
+  END DO
+
+
+  DO k = 1,bottom_top_dim
+    SCR4(:,:,k,1) = VVV(:,:,k)*sin(alpha) + UUU(:,:,k)*cos(alpha)
+    SCR4(:,:,k,2) = VVV(:,:,k)*cos(alpha) - UUU(:,:,k)*sin(alpha)
+  END DO
+
+
+  cname    = "uvmet"
+  cdesc    = "Rotated wind component"
+  cunits   = "m s-1"
+  
+  END SUBROUTINE calc_uvmet
+
+END MODULE module_calc_uvmet
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_wdir.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_wdir.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_wdir.f90	(revision 207)
@@ -0,0 +1,38 @@
+!! Diagnostics: Wind Direction
+
+MODULE module_calc_wdir
+
+  CONTAINS
+  SUBROUTINE calc_wdir(SCR, cname, cdesc, cunits, i3dflag)
+
+  USE constants_module
+  USE module_model_basics
+
+  !Arguments
+  real, pointer, dimension(:,:,:)                 :: SCR
+  character (len=128)                             :: cname, cdesc, cunits
+
+  !Local
+  integer                                         :: i3dflag
+  
+
+  IF ( i3dflag == 1 ) THEN
+    SCR      = 270. - ATAN2(VVV,UUU) * DEG_PER_RAD
+    cname    = "wdir"
+    cdesc    = "Wind Direction"
+  ELSE
+    SCR(:,:,1)      = 270. - ATAN2(V10(:,:),U10(:,:)) * DEG_PER_RAD
+    cname    = "wd10"
+    cdesc    = "Wind Direction at 10 M"
+  ENDIF
+  
+  WHERE (SCR .gt. 360. ) 
+    SCR    = SCR - 360.
+  END WHERE
+
+  cunits   = "Degrees"
+  
+  END SUBROUTINE calc_wdir
+
+END MODULE module_calc_wdir
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_wspd.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_wspd.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_calc_wspd.f90	(revision 207)
@@ -0,0 +1,34 @@
+!! Diagnostics: Wind Speed
+
+MODULE module_calc_wspd
+
+  CONTAINS
+  SUBROUTINE calc_wspd(SCR, cname, cdesc, cunits, i3dflag)
+
+  USE module_model_basics
+
+  !Arguments
+  real, pointer, dimension(:,:,:)                 :: SCR
+  character (len=128)                             :: cname, cdesc, cunits
+
+  !Local Variables
+  integer                                         :: i3dflag
+
+
+
+  IF ( i3dflag == 1 ) THEN
+    SCR      = SQRT(UUU*UUU + VVV*VVV)
+    cname    = "wspd"
+    cdesc    = "Wind Speed"
+  ELSE
+    SCR(:,:,1)      = SQRT(U10(:,:)*U10(:,:) + V10(:,:)*V10(:,:))
+    cname    = "ws10"
+    cdesc    = "Wind Speed at 10 M"
+  ENDIF
+
+  cunits   = "m s-1"
+  
+  END SUBROUTINE calc_wspd
+
+END MODULE module_calc_wspd
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_date_pack.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_date_pack.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_date_pack.f90	(revision 207)
@@ -0,0 +1,647 @@
+MODULE date_pack
+
+!  This module is able to perform three date and time functions:
+
+!  1.  geth_idts (ndate, odate, idts)
+!  Get the time period between two dates.
+
+!  2. geth_newdate ( ndate, odate, idts)
+!  Get the new date based on the old date and a time difference.
+
+!  3. split_date_char ( date , century_year , month , day , hour , minute , second )
+!  Given the date, return the integer components.
+
+CONTAINS
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+   SUBROUTINE geth_idts (ndate, odate, idts)
+   
+      IMPLICIT NONE
+      
+      !  From 2 input mdates ('YYYY-MM-DD HH:MM:SS.ffff'), 
+      !  compute the time difference.
+      
+      !  on entry     -  ndate  -  the new hdate.
+      !                  odate  -  the old hdate.
+      
+      !  on exit      -  idts    -  the change in time in seconds.
+      
+      CHARACTER (LEN=*) , INTENT(INOUT) :: ndate, odate
+      INTEGER           , INTENT(OUT)   :: idts
+      
+      !  Local Variables
+      
+      !  yrnew    -  indicates the year associated with "ndate"
+      !  yrold    -  indicates the year associated with "odate"
+      !  monew    -  indicates the month associated with "ndate"
+      !  moold    -  indicates the month associated with "odate"
+      !  dynew    -  indicates the day associated with "ndate"
+      !  dyold    -  indicates the day associated with "odate"
+      !  hrnew    -  indicates the hour associated with "ndate"
+      !  hrold    -  indicates the hour associated with "odate"
+      !  minew    -  indicates the minute associated with "ndate"
+      !  miold    -  indicates the minute associated with "odate"
+      !  scnew    -  indicates the second associated with "ndate"
+      !  scold    -  indicates the second associated with "odate"
+      !  i        -  loop counter
+      !  mday     -  a list assigning the number of days in each month
+      
+      CHARACTER (LEN=24) :: tdate
+      INTEGER :: olen, nlen
+      INTEGER :: yrnew, monew, dynew, hrnew, minew, scnew
+      INTEGER :: yrold, moold, dyold, hrold, miold, scold
+      INTEGER :: mday(12), i, newdys, olddys
+      LOGICAL :: npass, opass
+      INTEGER :: isign
+      
+      IF (odate.GT.ndate) THEN
+         isign = -1
+         tdate=ndate
+         ndate=odate
+         odate=tdate
+      ELSE
+         isign = 1
+      END IF
+      
+      !  Assign the number of days in a months
+      
+! months as defined in Martian ESMF routines
+ 
+      mday( 1) = 61
+      mday( 2) = 66
+      mday( 3) = 66
+      mday( 4) = 65
+      mday( 5) = 60
+      mday( 6) = 54
+      mday( 7) = 50
+      mday( 8) = 46
+      mday( 9) = 47
+      mday(10) = 47
+      mday(11) = 51
+      mday(12) = 56
+      
+      !  Break down old hdate into parts
+      
+      hrold = 0
+      miold = 0
+      scold = 0
+      olen = LEN(odate)
+      
+      READ(odate(1:4),  '(I4)') yrold
+      READ(odate(6:7),  '(I2)') moold
+      READ(odate(9:10), '(I2)') dyold
+      IF (olen.GE.13) THEN
+         READ(odate(12:13),'(I2)') hrold
+         IF (olen.GE.16) THEN
+            READ(odate(15:16),'(I2)') miold
+            IF (olen.GE.19) THEN
+               READ(odate(18:19),'(I2)') scold
+            END IF
+         END IF
+      END IF
+      
+      !  Break down new hdate into parts
+      
+      hrnew = 0
+      minew = 0
+      scnew = 0
+      nlen = LEN(ndate)
+      
+      READ(ndate(1:4),  '(I4)') yrnew
+      READ(ndate(6:7),  '(I2)') monew
+      READ(ndate(9:10), '(I2)') dynew
+      IF (nlen.GE.13) THEN
+         READ(ndate(12:13),'(I2)') hrnew
+         IF (nlen.GE.16) THEN
+            READ(ndate(15:16),'(I2)') minew
+            IF (nlen.GE.19) THEN
+               READ(ndate(18:19),'(I2)') scnew
+            END IF
+         END IF
+      END IF
+      
+      !  Check that the dates make sense.
+      
+      npass = .true.
+      opass = .true.
+      
+      !  Check that the month of NDATE makes sense.
+      
+      IF ((monew.GT.12).or.(monew.LT.1)) THEN
+         PRINT*, 'GETH_IDTS:  Month of NDATE = ', monew
+         npass = .false.
+      END IF
+      
+      !  Check that the month of ODATE makes sense.
+      
+      IF ((moold.GT.12).or.(moold.LT.1)) THEN
+         PRINT*, 'GETH_IDTS:  Month of ODATE = ', moold
+         opass = .false.
+      END IF
+      
+      !  Check that the day of NDATE makes sense.
+      
+!      IF (monew.ne.2) THEN
+      ! ...... For all months but February
+         IF ((dynew.GT.mday(monew)).or.(dynew.LT.1)) THEN
+            PRINT*, 'GETH_IDTS:  Day of NDATE = ', dynew
+            npass = .false.
+         END IF
+!      ELSE IF (monew.eq.2) THEN
+!      ! ...... For February
+!         IF ((dynew.GT.nfeb(yrnew)).OR.(dynew.LT.1)) THEN
+!            PRINT*, 'GETH_IDTS:  Day of NDATE = ', dynew
+!            npass = .false.
+!         END IF
+!      END IF
+      
+      !  Check that the day of ODATE makes sense.
+      
+!      IF (moold.ne.2) THEN
+      ! ...... For all months but February
+         IF ((dyold.GT.mday(moold)).or.(dyold.LT.1)) THEN
+            PRINT*, 'GETH_IDTS:  Day of ODATE = ', dyold
+            opass = .false.
+         END IF
+!      ELSE IF (moold.eq.2) THEN
+!      ! ....... For February
+!         IF ((dyold.GT.nfeb(yrold)).or.(dyold.LT.1)) THEN
+!            PRINT*, 'GETH_IDTS:  Day of ODATE = ', dyold
+!            opass = .false.
+!         END IF
+!      END IF
+      
+      !  Check that the hour of NDATE makes sense.
+      
+      IF ((hrnew.GT.23).or.(hrnew.LT.0)) THEN
+         PRINT*, 'GETH_IDTS:  Hour of NDATE = ', hrnew
+         npass = .false.
+      END IF
+      
+      !  Check that the hour of ODATE makes sense.
+      
+      IF ((hrold.GT.23).or.(hrold.LT.0)) THEN
+         PRINT*, 'GETH_IDTS:  Hour of ODATE = ', hrold
+         opass = .false.
+      END IF
+      
+      !  Check that the minute of NDATE makes sense.
+      
+      IF ((minew.GT.36).or.(minew.LT.0)) THEN
+         PRINT*, 'GETH_IDTS:  Minute of NDATE = ', minew
+         npass = .false.
+      END IF
+      
+      !  Check that the minute of ODATE makes sense.
+      
+      IF ((miold.GT.36).or.(miold.LT.0)) THEN
+         PRINT*, 'GETH_IDTS:  Minute of ODATE = ', miold
+         opass = .false.
+      END IF
+      
+      !  Check that the second of NDATE makes sense.
+      
+      IF ((scnew.GT.99).or.(scnew.LT.0)) THEN
+         PRINT*, 'GETH_IDTS:  SECOND of NDATE = ', scnew
+         npass = .false.
+      END IF
+      
+      !  Check that the second of ODATE makes sense.
+      
+      IF ((scold.GT.99).or.(scold.LT.0)) THEN
+         PRINT*, 'GETH_IDTS:  Second of ODATE = ', scold
+         opass = .false.
+      END IF
+      
+      IF (.not. npass) THEN
+         PRINT*, 'Screwy NDATE: ', ndate(1:nlen)
+         STOP 'ndate_2'
+      END IF
+      
+      IF (.not. opass) THEN
+         PRINT*, 'Screwy ODATE: ', odate(1:olen)
+         STOP 'odate_1'
+      END IF
+      
+      !  Date Checks are completed.  Continue.
+      
+      !  Compute number of days from 1 January ODATE, 00:00:00 until ndate
+      !  Compute number of hours from 1 January ODATE, 00:00:00 until ndate
+      !  Compute number of minutes from 1 January ODATE, 00:00:00 until ndate
+      
+      newdys = 0
+      DO i = yrold, yrnew - 1
+!         newdys = newdys + (365 + (nfeb(i)-28))
+! so cool to deal with a planet without any february month :)
+         newdys = newdys + 669
+      END DO
+      
+      IF (monew .GT. 1) THEN
+!         mday(2) = nfeb(yrnew)
+         DO i = 1, monew - 1
+            newdys = newdys + mday(i)
+         END DO
+!         mday(2) = 28
+      END IF
+      
+      newdys = newdys + dynew-1
+      
+      !  Compute number of hours from 1 January ODATE, 00:00:00 until odate
+      !  Compute number of minutes from 1 January ODATE, 00:00:00 until odate
+      
+      olddys = 0
+      
+      IF (moold .GT. 1) THEN
+!         mday(2) = nfeb(yrold)
+         DO i = 1, moold - 1
+            olddys = olddys + mday(i)
+         END DO
+!         mday(2) = 28
+      END IF
+      
+      olddys = olddys + dyold-1
+      
+      !  Determine the time difference in seconds
+      
+      idts = (newdys - olddys) * 88800    !martian sols
+      idts = idts + (hrnew - hrold) * 3700  !hours
+      idts = idts + (minew - miold) * 100  !minutes
+      idts = idts + (scnew - scold)
+      
+      IF (isign .eq. -1) THEN
+         tdate=ndate
+         ndate=odate
+         odate=tdate
+         idts = idts * isign
+      END IF
+   
+   END SUBROUTINE geth_idts
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+   SUBROUTINE geth_newdate (ndate, odate, idt)
+   
+      IMPLICIT NONE
+      
+      !  From old date ('YYYY-MM-DD HH:MM:SS.ffff') and 
+      !  delta-time, compute the new date.
+   
+      !  on entry     -  odate  -  the old hdate.
+      !                  idt    -  the change in time
+   
+      !  on exit      -  ndate  -  the new hdate.
+      
+      INTEGER , INTENT(IN)           :: idt
+      CHARACTER (LEN=*) , INTENT(OUT) :: ndate
+      CHARACTER (LEN=*) , INTENT(IN)  :: odate
+      
+       
+      !  Local Variables
+       
+      !  yrold    -  indicates the year associated with "odate"
+      !  moold    -  indicates the month associated with "odate"
+      !  dyold    -  indicates the day associated with "odate"
+      !  hrold    -  indicates the hour associated with "odate"
+      !  miold    -  indicates the minute associated with "odate"
+      !  scold    -  indicates the second associated with "odate"
+       
+      !  yrnew    -  indicates the year associated with "ndate"
+      !  monew    -  indicates the month associated with "ndate"
+      !  dynew    -  indicates the day associated with "ndate"
+      !  hrnew    -  indicates the hour associated with "ndate"
+      !  minew    -  indicates the minute associated with "ndate"
+      !  scnew    -  indicates the second associated with "ndate"
+       
+      !  mday     -  a list assigning the number of days in each month
+      
+      !  i        -  loop counter
+      !  nday     -  the integer number of days represented by "idt"
+      !  nhour    -  the integer number of hours in "idt" after taking out
+      !              all the whole days
+      !  nmin     -  the integer number of minutes in "idt" after taking out
+      !              all the whole days and whole hours.
+      !  nsec     -  the integer number of minutes in "idt" after taking out
+      !              all the whole days, whole hours, and whole minutes.
+       
+      INTEGER :: nlen, olen
+      INTEGER :: yrnew, monew, dynew, hrnew, minew, scnew, frnew
+      INTEGER :: yrold, moold, dyold, hrold, miold, scold, frold
+      INTEGER :: mday(12), nday, nhour, nmin, nsec, nfrac, i, ifrc
+      LOGICAL :: opass
+      CHARACTER (LEN=10) :: hfrc
+      CHARACTER (LEN=1) :: sp
+      ! INTEGER, EXTERNAL :: nfeb  ! in the same module now
+
+      !  Assign the number of days in a months
+      
+      mday( 1) = 61
+      mday( 2) = 66
+      mday( 3) = 66
+      mday( 4) = 65
+      mday( 5) = 60
+      mday( 6) = 54
+      mday( 7) = 50
+      mday( 8) = 46
+      mday( 9) = 47
+      mday(10) = 47
+      mday(11) = 51
+      mday(12) = 56
+      
+      !  Break down old hdate into parts
+      
+      hrold = 0
+      miold = 0
+      scold = 0
+      frold = 0
+      olen = LEN(odate)
+      IF (olen.GE.11) THEN
+         sp = odate(11:11)
+      else
+         sp = ' '
+      END IF
+      
+      !  Use internal READ statements to convert the CHARACTER string
+      !  date into INTEGER components.
+   
+      READ(odate(1:4),  '(I4)') yrold
+      READ(odate(6:7),  '(I2)') moold
+      READ(odate(9:10), '(I2)') dyold
+      IF (olen.GE.13) THEN
+         READ(odate(12:13),'(I2)') hrold
+         IF (olen.GE.16) THEN
+            READ(odate(15:16),'(I2)') miold
+            IF (olen.GE.19) THEN
+               READ(odate(18:19),'(I2)') scold
+               IF (olen.GT.20) THEN
+                  READ(odate(21:olen),'(I2)') frold
+               END IF
+            END IF
+         END IF
+      END IF
+      
+!      !  Set the number of days in February for that year.
+      
+!      mday(2) = nfeb(yrold)
+      
+      !  Check that ODATE makes sense.
+      
+      opass = .TRUE.
+      
+      !  Check that the month of ODATE makes sense.
+      
+      IF ((moold.GT.12).or.(moold.LT.1)) THEN
+         WRITE(*,*) 'GETH_NEWDATE:  Month of ODATE = ', moold
+         opass = .FALSE.
+      END IF
+      
+      !  Check that the day of ODATE makes sense.
+      
+      IF ((dyold.GT.mday(moold)).or.(dyold.LT.1)) THEN
+         WRITE(*,*) 'GETH_NEWDATE:  Day of ODATE = ', dyold
+         opass = .FALSE.
+      END IF
+      
+      !  Check that the hour of ODATE makes sense.
+      
+      IF ((hrold.GT.23).or.(hrold.LT.0)) THEN
+         WRITE(*,*) 'GETH_NEWDATE:  Hour of ODATE = ', hrold
+         opass = .FALSE.
+      END IF
+      
+      !  Check that the minute of ODATE makes sense.
+      
+      IF ((miold.GT.36).or.(miold.LT.0)) THEN
+         WRITE(*,*) 'GETH_NEWDATE:  Minute of ODATE = ', miold
+         opass = .FALSE.
+      END IF
+      
+      !  Check that the second of ODATE makes sense.
+      
+      IF ((scold.GT.99).or.(scold.LT.0)) THEN
+         WRITE(*,*) 'GETH_NEWDATE:  Second of ODATE = ', scold
+         opass = .FALSE.
+      END IF
+      
+      !  Check that the fractional part  of ODATE makes sense.
+      
+      
+      IF (.not.opass) THEN
+         WRITE(*,*) 'GETH_NEWDATE: Crazy ODATE: ', odate(1:olen), olen
+         STOP 'odate_3'
+      END IF
+      
+      !  Date Checks are completed.  Continue.
+      
+      
+      !  Compute the number of days, hours, minutes, and seconds in idt
+      
+      IF (olen.GT.20) THEN !idt should be in fractions of seconds
+         ifrc = olen-20
+         ifrc = 10**ifrc
+         nday   = ABS(idt)/(88800*ifrc)
+         nhour  = MOD(ABS(idt),88800*ifrc)/(3700*ifrc)
+         nmin   = MOD(ABS(idt),3700*ifrc)/(100*ifrc)
+         nsec   = MOD(ABS(idt),100*ifrc)/(ifrc)
+         nfrac = MOD(ABS(idt), ifrc)
+      ELSE IF (olen.eq.19) THEN  !idt should be in seconds
+         ifrc = 1
+         nday   = ABS(idt)/88800 ! Integer number of days in delta-time
+         nhour  = MOD(ABS(idt),88800)/3700
+         nmin   = MOD(ABS(idt),3700)/100
+         nsec   = MOD(ABS(idt),100)
+         nfrac  = 0
+      ELSE IF (olen.eq.16) THEN !idt should be in minutes
+         ifrc = 1
+         nday   = ABS(idt)/2400 ! Integer number of days in delta-time
+         nhour  = MOD(ABS(idt),2400)/100
+         nmin   = MOD(ABS(idt),100)
+         nsec   = 0
+         nfrac  = 0
+      ELSE IF (olen.eq.13) THEN !idt should be in hours
+         ifrc = 1
+         nday   = ABS(idt)/24 ! Integer number of days in delta-time
+         nhour  = MOD(ABS(idt),24)
+         nmin   = 0
+         nsec   = 0
+         nfrac  = 0
+      ELSE IF (olen.eq.10) THEN !idt should be in days
+         ifrc = 1
+         nday   = ABS(idt)/24 ! Integer number of days in delta-time
+         nhour  = 0
+         nmin   = 0
+         nsec   = 0
+         nfrac  = 0
+      ELSE
+         WRITE(*,'(''GETH_NEWDATE: Strange length for ODATE: '', i3)') &
+              olen
+         WRITE(*,*) odate(1:olen)
+         STOP 'odate_4'
+      END IF
+      
+      IF (idt.GE.0) THEN
+      
+         frnew = frold + nfrac
+         IF (frnew.GE.ifrc) THEN
+            frnew = frnew - ifrc
+            nsec = nsec + 1
+         END IF
+      
+         scnew = scold + nsec
+         IF (scnew .GE. 100) THEN
+            scnew = scnew - 100
+            nmin  = nmin + 1
+         END IF
+      
+         minew = miold + nmin
+         IF (minew .GE. 37) THEN
+            minew = minew - 37
+            nhour  = nhour + 1
+         END IF
+      
+         hrnew = hrold + nhour
+         IF (hrnew .GE. 24) THEN
+            hrnew = hrnew - 24
+            nday  = nday + 1
+         END IF
+      
+         dynew = dyold
+         monew = moold
+         yrnew = yrold
+         DO i = 1, nday
+            dynew = dynew + 1
+            IF (dynew.GT.mday(monew)) THEN
+               dynew = dynew - mday(monew)
+               monew = monew + 1
+               IF (monew .GT. 12) THEN
+                  monew = 1
+                  yrnew = yrnew + 1
+                  !! If the year changes, recompute the number of days in February
+                  !mday(2) = nfeb(yrnew)
+               END IF
+            END IF
+         END DO
+      
+      ELSE IF (idt.LT.0) THEN
+      
+         frnew = frold - nfrac
+         IF (frnew .LT. 0) THEN
+            frnew = frnew + ifrc
+            nsec = nsec - 1
+         END IF
+      
+         scnew = scold - nsec
+         IF (scnew .LT. 00) THEN
+            scnew = scnew + 100
+            nmin  = nmin + 1
+         END IF
+      
+         minew = miold - nmin
+         IF (minew .LT. 00) THEN
+            minew = minew + 37
+            nhour  = nhour + 1
+         END IF
+      
+         hrnew = hrold - nhour
+         IF (hrnew .LT. 00) THEN
+            hrnew = hrnew + 24
+            nday  = nday + 1
+         END IF
+      
+         dynew = dyold
+         monew = moold
+         yrnew = yrold
+         DO i = 1, nday
+            dynew = dynew - 1
+            IF (dynew.eq.0) THEN
+               monew = monew - 1
+               IF (monew.eq.0) THEN
+                  monew = 12
+                  yrnew = yrnew - 1
+                  !! If the year changes, recompute the number of days in February
+                  !mday(2) = nfeb(yrnew)
+               END IF
+               dynew = mday(monew)
+            END IF
+         END DO
+      END IF
+      
+      !  Now construct the new mdate
+      
+      nlen = LEN(ndate)
+      
+      IF (nlen.GT.20) THEN
+         WRITE(ndate(1:19),19) yrnew, monew, dynew, hrnew, minew, scnew
+         WRITE(hfrc,'(I10)') frnew+1000000000
+         ndate = ndate(1:19)//'.'//hfrc(31-nlen:10)
+      
+      ELSE IF (nlen.eq.19.or.nlen.eq.20) THEN
+         WRITE(ndate(1:19),19) yrnew, monew, dynew, hrnew, minew, scnew
+      19   format(I4.4,'-',I2.2,'-',I2.2,'_',I2.2,':',I2.2,':',I2.2)
+         IF (nlen.eq.20) ndate = ndate(1:19)//'.'
+      
+      ELSE IF (nlen.eq.16) THEN
+         WRITE(ndate,16) yrnew, monew, dynew, hrnew, minew
+      16   format(I4.4,'-',I2.2,'-',I2.2,'_',I2.2,':',I2.2)
+      
+      ELSE IF (nlen.eq.13) THEN
+         WRITE(ndate,13) yrnew, monew, dynew, hrnew
+      13   format(I4.4,'-',I2.2,'-',I2.2,'_',I2.2)
+      
+      ELSE IF (nlen.eq.10) THEN
+         WRITE(ndate,10) yrnew, monew, dynew
+      10   format(I4.4,'-',I2.2,'-',I2.2)
+      
+      END IF
+      
+      IF (olen.GE.11) ndate(11:11) = sp
+   
+   END SUBROUTINE geth_newdate
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+!   FUNCTION nfeb ( year ) RESULT (num_days)
+!   
+!      ! Compute the number of days in February for the given year
+!   
+!      IMPLICIT NONE
+!   
+!      INTEGER :: year
+!      INTEGER :: num_days
+!   
+!      num_days = 28 ! By default, February has 28 days ...
+!      IF (MOD(year,4).eq.0) THEN  
+!         num_days = 29  ! But every four years, it has 29 days ...
+!         IF (MOD(year,100).eq.0) THEN
+!            num_days = 28  ! Except every 100 years, when it has 28 days ...
+!            IF (MOD(year,400).eq.0) THEN
+!               num_days = 29  ! Except every 400 years, when it has 29 days.
+!            END IF
+!         END IF
+!      END IF
+!   
+!   END FUNCTION nfeb
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE split_date_char ( date , century_year , month , day , hour , minute , second )
+     
+      IMPLICIT NONE
+   
+      !  Input data.
+   
+      CHARACTER(LEN=19) , INTENT(IN) :: date 
+   
+      !  Output data.
+   
+      INTEGER , INTENT(OUT) :: century_year , month , day , hour , minute , second
+      
+      READ(date,FMT='(    I4.4)') century_year
+      READ(date,FMT='( 5X,I2.2)') month
+      READ(date,FMT='( 8X,I2.2)') day
+      READ(date,FMT='(11X,I2.2)') hour
+      READ(date,FMT='(14X,I2.2)') minute
+      READ(date,FMT='(17X,I2.2)') second
+   
+   END SUBROUTINE split_date_char
+   
+END MODULE date_pack
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_debug.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_debug.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_debug.f90	(revision 207)
@@ -0,0 +1,137 @@
+MODULE module_debug
+
+   integer, parameter :: STDOUT=-1, DEBUG=0, INFORM=1, WARN=2, ERROR=3
+
+   CONTAINS
+
+   SUBROUTINE mprintf(assertion, level, fmtstring, i1, i2, i3, f1, f2, f3, s1, s2, s3)
+
+      implicit none
+
+      ! Arguments
+      integer, intent(in)                     :: level
+      logical, intent(in)                     :: assertion
+      character (len=*), intent(in)           :: fmtstring
+      integer, intent(in), optional           :: i1, i2, i3
+      real, intent(in), optional              :: f1, f2, f3
+      character (len=*), intent(in), optional :: s1, s2, s3
+
+      ! Local variables 
+      integer                                 :: idxi, idxf, idxs, istart, i, iend, ia
+      real                                    :: fa
+      character (len=128)                     :: sa
+
+      idxi = 1
+      idxf = 1
+      idxs = 1
+      istart = 1
+      iend = len_trim(fmtstring)
+
+      IF (assertion) THEN
+
+         IF (level == DEBUG) THEN
+            WRITE(6,'(a)',advance='no') 'DEBUG: '
+         ELSE IF (level == INFORM) THEN
+            WRITE(6,'(a)',advance='no') 'INFORM: '
+         ELSE IF (level == WARN) THEN
+            WRITE(6,'(a)',advance='no') 'WARNING: '
+         ELSE IF (level == ERROR) THEN
+            WRITE(6,'(a)',advance='no') 'ERROR: '
+         END IF
+      
+         i = index(fmtstring(istart:iend),'%')
+         DO WHILE (i > 0 .and. i < iend)
+            i = i + istart - 1
+            WRITE(6,'(a)',advance='no') fmtstring(istart:i-1)
+   
+            IF (fmtstring(i+1:i+1) == '%') THEN
+               WRITE(6,'(a1)',advance='no') '%'
+                            
+            ELSE IF (fmtstring(i+1:i+1) == 'i') THEN
+               IF (idxi == 1 .and. present(i1)) THEN
+                  ia = i1
+               ELSE IF (idxi == 2 .and. present(i2)) THEN
+                  ia = i2
+               ELSE IF (idxi == 3 .and. present(i3)) THEN
+                  ia = i3
+               END IF
+   
+               IF (ia < 10) THEN
+                  WRITE(6,'(i1)',advance='no') ia
+               ELSE IF (ia < 100) THEN
+                  WRITE(6,'(i2)',advance='no') ia
+               ELSE IF (ia < 1000) THEN
+                  WRITE(6,'(i3)',advance='no') ia
+               ELSE IF (ia < 10000) THEN
+                  WRITE(6,'(i4)',advance='no') ia
+               ELSE IF (ia < 100000) THEN
+                  WRITE(6,'(i5)',advance='no') ia
+               ELSE
+                  WRITE(6,'(i9)',advance='no') ia
+               END IF
+               idxi = idxi + 1
+   
+            ELSE IF (fmtstring(i+1:i+1) == 'f') THEN
+               IF (idxf == 1 .and. present(f1)) THEN
+                  fa = f1
+               ELSE IF (idxf == 2 .and. present(f2)) THEN
+                  fa = f2
+               ELSE IF (idxf == 3 .and. present(f3)) THEN
+                  fa = f3
+               END IF
+   
+               IF (fa < -100000.) THEN
+                  WRITE(6,'(f12.4)',advance='no') fa
+               ELSE IF (fa < -10000.) THEN
+                  WRITE(6,'(f11.4)',advance='no') fa
+               ELSE IF (fa < -1000.) THEN
+                  WRITE(6,'(f10.4)',advance='no') fa
+               ELSE IF (fa < -100.) THEN
+                  WRITE(6,'(f9.4)',advance='no') fa
+               ELSE IF (fa < -10.) THEN
+                  WRITE(6,'(f8.4)',advance='no') fa
+               ELSE IF (fa < 0.) THEN
+                  WRITE(6,'(f7.4)',advance='no') fa
+               ELSE IF (fa < 10.) THEN
+                  WRITE(6,'(f6.4)',advance='no') fa
+               ELSE IF (fa < 100.) THEN
+                  WRITE(6,'(f7.4)',advance='no') fa
+               ELSE IF (fa < 1000.) THEN
+                  WRITE(6,'(f8.4)',advance='no') fa
+               ELSE IF (fa < 10000.) THEN
+                  WRITE(6,'(f9.4)',advance='no') fa
+               ELSE IF (fa < 100000.) THEN
+                  WRITE(6,'(f10.4)',advance='no') fa
+               ELSE
+                  WRITE(6,'(f15.4)',advance='no') fa
+               END IF
+               idxf = idxf + 1
+   
+            ELSE IF (fmtstring(i+1:i+1) == 's') THEN
+               IF (idxs == 1 .and. present(s1)) THEN
+                  sa = s1
+               ELSE IF (idxs == 2 .and. present(s2)) THEN
+                  sa = s2
+               ELSE IF (idxs == 3 .and. present(s3)) THEN
+                  sa = s3
+               END IF
+   
+               WRITE(6,'(a)',advance='no') trim(sa)
+               idxs = idxs + 1
+   
+            END IF
+   
+            istart = i+2
+            i = index(fmtstring(istart:iend),'%')
+         END do
+   
+         WRITE(6,'(a)') fmtstring(istart:iend)
+
+         IF (level == ERROR) stop
+
+      END IF
+
+
+   END SUBROUTINE mprintf
+
+END MODULE module_debug
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_diagnostics.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_diagnostics.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_diagnostics.f90	(revision 207)
@@ -0,0 +1,512 @@
+!! Diagnostics
+!! See moddule_diagnostic for which fields are available 
+
+MODULE module_diagnostics
+
+  USE output_module
+  USE gridinfo_module
+  USE module_interp
+  USE module_arrays
+  USE constants_module
+  USE module_pressure
+
+
+  USE module_calc_pressure
+  USE module_calc_height
+  USE module_calc_theta
+  USE module_calc_tk
+  USE module_calc_tc
+  USE module_calc_td
+  USE module_calc_rh
+  USE module_calc_uvmet
+  USE module_calc_wdir
+  USE module_calc_wspd
+  USE module_calc_slp
+  USE module_calc_dbz
+  USE module_calc_cape
+  USE module_calc_clfr
+
+  CONTAINS
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: process_diagnostics
+   ! Purpose: All new calls to diagnostics routines go here
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE process_diagnostics ()
+
+      IMPLICIT NONE
+
+      ! Local variables
+      character (len=128)                    :: cname, cunits, cdesc, c_nm
+      real, allocatable, dimension(:,:)      :: SCR2
+      real, pointer, dimension(:,:,:)        :: SCR3
+      real, allocatable, dimension(:,:,:,:)  :: SCR4
+      real, pointer, dimension(:,:,:)        :: SCR
+      real, pointer, dimension(:,:,:)        :: data_out 
+      integer                                :: nxout, nyout, nzout
+      integer                                :: ii, jj, kk
+
+
+
+!!! If we don't have PRES (Pa) already - calculate and keep
+      IF ( .not. have_PRES ) THEN 
+        IF ( iprogram == 8 .AND. have_P .AND. have_PB ) THEN 
+          ALLOCATE(SCR3(west_east_dim,south_north_dim,bottom_top_dim))
+          SCR3 = P + PB
+          c_nm = 'PRES'
+          CALL keep_arrays(c_nm, SCR3)
+        END IF
+        IF ( iprogram == 6 .AND. have_MU .AND. have_MUB .AND. have_ZNU .AND. have_ZNW .AND. have_PTOP) THEN 
+          CALL pressure(SCR3)
+          c_nm = 'PRES'
+          CALL keep_arrays(c_nm, SCR3)
+        END IF
+        DEALLOCATE(SCR3)
+      END IF
+
+
+!!! If we don't have TK (K) already - calculate and keep 
+      IF ( .not. have_TK ) THEN 
+        IF ( have_T .AND. have_PRES ) THEN 
+          ALLOCATE(SCR3(west_east_dim,south_north_dim,bottom_top_dim))
+          c_nm = 'TK'
+!!          SCR3 = (T+300.) * ( PRES / p0 )**RCP
+          SCR3 = (T+220.) * ( PRES / p0 )**RCP
+          CALL keep_arrays(c_nm, SCR3)
+          DEALLOCATE(SCR3)
+        END IF
+      END IF
+
+
+
+!!
+!! DIAGNOSTICS GO HERE
+!!
+
+
+
+!!! Calculate pressure in hPA
+        IF ( INDEX(plot_these_fields,",pressure,") /= 0 ) THEN
+          IF ( have_PRES ) THEN 
+            IF ( ASSOCIATED(SCR) ) DEALLOCATE(SCR)
+            ALLOCATE(SCR(west_east_dim,south_north_dim,bottom_top_dim))
+            CALL calc_pressure(SCR, cname, cdesc, cunits) 
+            CALL interp (SCR, west_east_dim, south_north_dim, bottom_top_dim, &
+                         data_out, nxout, nyout, nzout, &
+                         vert_array, interp_levels, number_of_zlevs) 
+            CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            DEALLOCATE(SCR)
+          END IF
+        END IF
+
+
+!!! Calculate height from PH and PHB 
+        IF ( INDEX(plot_these_fields,",height,") /= 0 ) THEN
+          IF ( have_PH .AND. have_PHB ) THEN 
+            IF ( ASSOCIATED(SCR) ) DEALLOCATE(SCR)
+            ALLOCATE(SCR(west_east_dim,south_north_dim,bottom_top_dim))
+            CALL calc_height(SCR, cname, cdesc, cunits) 
+            CALL interp (SCR, west_east_dim, south_north_dim, bottom_top_dim, &
+                         data_out, nxout, nyout, nzout, &
+                         vert_array, interp_levels, number_of_zlevs) 
+            CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            DEALLOCATE(SCR)
+          END IF
+        END IF
+
+
+!!! Calculate temperature 
+        IF ( INDEX(plot_these_fields,",tk,") /= 0 ) THEN
+          IF ( have_TK ) THEN 
+            IF ( ASSOCIATED(SCR) ) DEALLOCATE(SCR)
+            ALLOCATE(SCR(west_east_dim,south_north_dim,bottom_top_dim))
+            CALL calc_tk(SCR, cname, cdesc, cunits) 
+            CALL interp (SCR, west_east_dim, south_north_dim, bottom_top_dim, &
+                         data_out, nxout, nyout, nzout, &
+                         vert_array, interp_levels, number_of_zlevs) 
+            CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            DEALLOCATE(SCR)
+          END IF
+        END IF
+        IF ( INDEX(plot_these_fields,",tc,") /= 0 ) THEN
+          IF ( have_TK ) THEN 
+            IF ( ASSOCIATED(SCR) ) DEALLOCATE(SCR)
+            ALLOCATE(SCR(west_east_dim,south_north_dim,bottom_top_dim))
+            CALL calc_tc(SCR, cname, cdesc, cunits) 
+            CALL interp (SCR, west_east_dim, south_north_dim, bottom_top_dim, &
+                         data_out, nxout, nyout, nzout, &
+                         vert_array, interp_levels, number_of_zlevs) 
+            CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            DEALLOCATE(SCR)
+          END IF
+        END IF
+
+
+!!! Calculate theta
+        IF ( INDEX(plot_these_fields,",theta,") /= 0 ) THEN
+          IF ( have_T ) THEN 
+            IF ( ASSOCIATED(SCR) ) DEALLOCATE(SCR)
+            ALLOCATE(SCR(west_east_dim,south_north_dim,bottom_top_dim))
+            CALL calc_theta(SCR, cname, cdesc, cunits) 
+            CALL interp (SCR, west_east_dim, south_north_dim, bottom_top_dim, &
+                         data_out, nxout, nyout, nzout, &
+                         vert_array, interp_levels, number_of_zlevs) 
+            CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            DEALLOCATE(SCR)
+          END IF
+        END IF
+
+
+!!! Dewpoint temperature
+        IF ( INDEX(plot_these_fields,",td,") /= 0 ) THEN
+          IF ( have_QV .AND. have_PRES ) THEN 
+            IF ( ASSOCIATED(SCR) ) DEALLOCATE(SCR)
+            ALLOCATE(SCR(west_east_dim,south_north_dim,bottom_top_dim))
+            CALL calc_td(SCR, cname, cdesc, cunits) 
+            CALL interp (SCR, west_east_dim, south_north_dim, bottom_top_dim, &
+                         data_out, nxout, nyout, nzout, &
+                         vert_array, interp_levels, number_of_zlevs) 
+            CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            DEALLOCATE(SCR)
+          END IF
+        END IF
+
+
+!!! Relative Humidity    
+        IF ( INDEX(plot_these_fields,",rh,") /= 0 .OR. INDEX(plot_these_fields,",clfr,") /= 0 ) THEN
+          IF ( have_TK .AND. have_QV .AND. have_PRES ) THEN 
+            IF ( ASSOCIATED(SCR) ) DEALLOCATE(SCR)
+            ALLOCATE(SCR(west_east_dim,south_north_dim,bottom_top_dim))
+            CALL calc_rh(SCR, cname, cdesc, cunits) 
+            CALL interp (SCR, west_east_dim, south_north_dim, bottom_top_dim, &
+                         data_out, nxout, nyout, nzout, &
+                         vert_array, interp_levels, number_of_zlevs) 
+            CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+
+            !!!  Cloud fractions
+            IF ( INDEX(plot_these_fields,",clfr,") /= 0 ) THEN
+              IF ( ALLOCATED(SCR4) ) DEALLOCATE(SCR4)
+              ALLOCATE(SCR4(west_east_dim,south_north_dim,bottom_top_dim,4))
+              SCR4 = 0.0
+              CALL calc_clfr(SCR4, cname, cdesc, cunits, SCR) 
+              DEALLOCATE(SCR)
+              ALLOCATE(SCR(west_east_dim,south_north_dim,1))
+              cname = "clflo"
+              cdesc = "Low Cloud Fraction"
+              SCR(:,:,1) = SCR4(:,:,1,1)
+              CALL interp (SCR, west_east_dim, south_north_dim, 1, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+              cname = "clfmi"
+              cdesc = "Mid Cloud Fraction"
+              SCR(:,:,1) = SCR4(:,:,1,2)
+              CALL interp (SCR, west_east_dim, south_north_dim, 1, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+              cname = "clfhi"
+              cdesc = "High Cloud Fraction"
+              SCR(:,:,1) = SCR4(:,:,1,3)
+              CALL interp (SCR, west_east_dim, south_north_dim, 1, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            END IF
+
+            DEALLOCATE(SCR)
+          END IF
+        END IF
+
+
+!!! Wind speed       
+        IF ( INDEX(plot_these_fields,",wspd,") /= 0 ) THEN
+          IF ( have_UUU .AND. have_VVV ) THEN 
+            IF ( ASSOCIATED(SCR) ) DEALLOCATE(SCR)
+            ALLOCATE(SCR(west_east_dim,south_north_dim,bottom_top_dim))
+            CALL calc_wspd(SCR, cname, cdesc, cunits, 1) 
+            CALL interp (SCR, west_east_dim, south_north_dim, bottom_top_dim, &
+                         data_out, nxout, nyout, nzout, &
+                         vert_array, interp_levels, number_of_zlevs) 
+            CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            DEALLOCATE(SCR)
+          END IF
+        END IF
+
+
+!!! Wind direction       
+        IF ( INDEX(plot_these_fields,",wdir,") /= 0 ) THEN
+          IF ( have_UUU .AND. have_VVV ) THEN 
+            IF ( ASSOCIATED(SCR) ) DEALLOCATE(SCR)
+            ALLOCATE(SCR(west_east_dim,south_north_dim,bottom_top_dim))
+            CALL calc_wdir(SCR, cname, cdesc, cunits, 1) 
+            CALL interp (SCR, west_east_dim, south_north_dim, bottom_top_dim, &
+                         data_out, nxout, nyout, nzout, &
+                         vert_array, interp_levels, number_of_zlevs) 
+            CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            DEALLOCATE(SCR)
+          END IF
+        END IF
+
+
+!!! Wind speed  - 10m      
+        IF ( INDEX(plot_these_fields,",ws10,") /= 0 ) THEN
+          IF ( have_U10 .AND. have_V10 ) THEN 
+            IF ( ASSOCIATED(SCR) ) DEALLOCATE(SCR)
+            ALLOCATE(SCR(west_east_dim,south_north_dim,1))
+            CALL calc_wspd(SCR, cname, cdesc, cunits, 0) 
+            CALL interp (SCR, west_east_dim, south_north_dim, 1, &
+                         data_out, nxout, nyout, nzout, &
+                         vert_array, interp_levels, number_of_zlevs) 
+            CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            DEALLOCATE(SCR)
+          END IF
+        END IF
+
+
+!!! Wind direction  - 10m      
+        IF ( INDEX(plot_these_fields,",wd10,") /= 0 ) THEN
+          IF ( have_U10 .AND. have_V10 ) THEN 
+            IF ( ASSOCIATED(SCR) ) DEALLOCATE(SCR)
+            ALLOCATE(SCR(west_east_dim,south_north_dim,1))
+            CALL calc_wdir(SCR, cname, cdesc, cunits, 0) 
+            CALL interp (SCR, west_east_dim, south_north_dim, 1, &
+                         data_out, nxout, nyout, nzout, &
+                         vert_array, interp_levels, number_of_zlevs) 
+            CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            DEALLOCATE(SCR)
+          END IF
+        END IF
+
+
+!!! Rotated U and V      
+        IF ( INDEX(plot_these_fields,",umet,") /= 0 .OR. &
+             INDEX(plot_these_fields,",vmet,") /= 0) THEN
+          IF ( have_UUU .AND. have_VVV .AND. have_XLAT .AND. have_XLONG ) THEN 
+
+            IF ( ALLOCATED(SCR4) ) DEALLOCATE(SCR4)
+            ALLOCATE(SCR4(west_east_dim,south_north_dim,bottom_top_dim,4))
+            SCR4 = 0.0
+            CALL calc_uvmet(SCR4, cname, cdesc, cunits) 
+
+            ALLOCATE(SCR(west_east_dim,south_north_dim,bottom_top_dim))
+            IF ( INDEX(plot_these_fields,",umet,") /= 0 ) THEN
+              cname = "umet"
+              SCR(:,:,:) = SCR4(:,:,:,1)
+              CALL interp (SCR, west_east_dim, south_north_dim, bottom_top_dim, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            END IF
+            IF ( INDEX(plot_these_fields,",vmet,") /= 0) THEN
+              cname = "vmet"
+              SCR(:,:,:) = SCR4(:,:,:,2)
+              CALL interp (SCR, west_east_dim, south_north_dim, bottom_top_dim, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            END IF
+            DEALLOCATE(SCR)
+            DEALLOCATE(SCR4)
+
+          END IF
+        END IF
+
+
+!!! Rotated U10 and V10      
+        IF ( INDEX(plot_these_fields,",u10m,") /= 0 .OR. &
+             INDEX(plot_these_fields,",v10m,") /= 0) THEN
+          IF ( have_U10 .AND. have_V10 .AND. have_XLAT .AND. have_XLONG ) THEN 
+
+            IF ( ALLOCATED(SCR4) ) DEALLOCATE(SCR4)
+            ALLOCATE(SCR4(west_east_dim,south_north_dim,bottom_top_dim,4))
+            SCR4 = 0.0
+            CALL calc_uvmet(SCR4, cname, cdesc, cunits) 
+
+            ALLOCATE(SCR(west_east_dim,south_north_dim,1))
+            IF ( INDEX(plot_these_fields,",u10m,") /= 0 ) THEN
+              cname = "u10m"
+              SCR(:,:,1) = SCR4(:,:,1,1)
+              CALL interp (SCR, west_east_dim, south_north_dim, 1, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            END IF
+            IF ( INDEX(plot_these_fields,",v10m,") /= 0) THEN
+              cname = "v10m"
+              SCR(:,:,1) = SCR4(:,:,1,2)
+              CALL interp( SCR, west_east_dim, south_north_dim, 1, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            END IF
+            DEALLOCATE(SCR)
+            DEALLOCATE(SCR4)
+
+          END IF
+        END IF
+
+
+!!! Sea Level Pressure  
+        IF ( INDEX(plot_these_fields,",slp,") /= 0 ) THEN
+          IF ( have_TK .AND. have_QV .AND. have_PRES .AND. have_PH .AND. have_PHB) THEN 
+            IF ( ASSOCIATED(SCR) ) DEALLOCATE(SCR)
+            ALLOCATE(SCR(west_east_dim,south_north_dim,bottom_top_dim))
+            CALL calc_slp(SCR, cname, cdesc, cunits) 
+            CALL interp (SCR, west_east_dim, south_north_dim, 1, &
+                         data_out, nxout, nyout, nzout, &
+                         vert_array, interp_levels, number_of_zlevs) 
+            CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            DEALLOCATE(SCR)
+          END IF
+        END IF
+
+
+!!! Reflectivity             
+        IF ( INDEX(plot_these_fields,",dbz,") /= 0 .OR. &
+             INDEX(plot_these_fields,",max_dbz,") /= 0) THEN
+          IF ( have_QV .AND. have_QR .AND. have_TK .AND. have_PRES ) THEN 
+            CALL calc_dbz(SCR, cname, cdesc, cunits) 
+
+            IF ( INDEX(plot_these_fields,",dbz,") /= 0 ) THEN
+              CALL interp (SCR, west_east_dim, south_north_dim, bottom_top_dim, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            END IF
+
+            IF ( INDEX(plot_these_fields,",max_dbz,") /= 0) THEN
+              ALLOCATE(SCR2(west_east_dim,south_north_dim))
+              SCR2 = 0.0
+              DO jj = 1,south_north_dim
+                DO ii = 1,west_east_dim
+                  DO kk = 1,bottom_top_dim
+                    SCR2(ii,jj) = MAX( SCR2(ii,jj) , SCR(ii,jj,kk) )
+                  END DO 
+                END DO 
+              END DO 
+              IF (ASSOCIATED(SCR)) DEALLOCATE(SCR)
+              ALLOCATE(SCR(west_east_dim,south_north_dim,1))
+              SCR(:,:,1) = SCR2(:,:)
+              cname = "max_dbz"
+              cdesc    = "Max Reflectivity"
+              CALL interp (SCR, west_east_dim, south_north_dim, 1, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+              DEALLOCATE(SCR2)
+              DEALLOCATE(SCR)
+            END IF
+
+          END IF
+        END IF
+
+
+
+!!! 3D CAPE/CIN 
+        IF ( INDEX(plot_these_fields,",cape,") /= 0 .OR. &
+             INDEX(plot_these_fields,",cin,") /= 0) THEN
+          IF ( have_HGT .AND. have_QV .AND. have_PRES .AND. have_TK .AND. &
+               have_PH .AND. have_PHB) THEN 
+
+            IF ( ALLOCATED(SCR4) ) DEALLOCATE(SCR4)
+            ALLOCATE(SCR4(west_east_dim,south_north_dim,bottom_top_dim,4))
+            SCR4 = 0.0
+            CALL calc_cape(SCR4, cname, cdesc, cunits,1) 
+
+            ALLOCATE(SCR(west_east_dim,south_north_dim,bottom_top_dim))
+            IF ( INDEX(plot_these_fields,",cape,") /= 0 ) THEN
+              cname = "cape"
+              cdesc = "CAPE"
+              cunits = "J/kg"
+              SCR(:,:,:) = SCR4(:,:,:,1)
+              CALL interp (SCR, west_east_dim, south_north_dim, bottom_top_dim, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            END IF
+            IF ( INDEX(plot_these_fields,",cin,") /= 0) THEN
+              cname = "cin"
+              cdesc = "CIN"
+              cunits = "J/kg"
+              SCR(:,:,:) = SCR4(:,:,:,2)
+              CALL interp (SCR, west_east_dim, south_north_dim, bottom_top_dim, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            END IF
+            DEALLOCATE(SCR)
+            DEALLOCATE(SCR4)
+
+          END IF
+        END IF
+
+
+
+!!! 2D CAPE/CIN & LCL/LFC
+        IF ( INDEX(plot_these_fields,",mcape,") /= 0 .OR. &
+             INDEX(plot_these_fields,",mcin,") /= 0 .OR.  &
+             INDEX(plot_these_fields,",lcl,") /= 0 .OR.   &
+             INDEX(plot_these_fields,",lfc,") /= 0) THEN
+          IF ( have_HGT .AND. have_QV .AND. have_PRES .AND. have_TK .AND. &
+               have_PH .AND. have_PHB) THEN 
+
+            IF ( ALLOCATED(SCR4) ) DEALLOCATE(SCR4)
+            ALLOCATE(SCR4(west_east_dim,south_north_dim,bottom_top_dim,4))
+            SCR4 = 0.0
+            CALL calc_cape(SCR4, cname, cdesc, cunits,0) 
+
+            ALLOCATE(SCR(west_east_dim,south_north_dim,1))
+            IF ( INDEX(plot_these_fields,",mcape,") /= 0 ) THEN
+              cname = "mcape"
+              cdesc = "MCAPE"
+              cunits = "J/kg"
+              SCR(:,:,1) = SCR4(:,:,1,1)
+              CALL interp (SCR, west_east_dim, south_north_dim, 1, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            END IF
+            IF ( INDEX(plot_these_fields,",mcin,") /= 0) THEN
+              cname = "mcin"
+              cdesc = "MCIN"
+              cunits = "J/kg"
+              SCR(:,:,1) = SCR4(:,:,1,2)
+              CALL interp (SCR, west_east_dim, south_north_dim, 1, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            END IF
+            IF ( INDEX(plot_these_fields,",lcl,") /= 0) THEN
+              cname = "lcl"
+              cdesc = "LCL"
+              cunits = "meters AGL"
+              SCR(:,:,1) = SCR4(:,:,1,3)
+              CALL interp (SCR, west_east_dim, south_north_dim, 1, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            END IF
+            IF ( INDEX(plot_these_fields,",lfc,") /= 0) THEN
+              cname = "lfc"
+              cdesc = "LFC"
+              cunits = "meters AGL"
+              SCR(:,:,1) = SCR4(:,:,1,4)
+              CALL interp (SCR, west_east_dim, south_north_dim, 1, &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            END IF
+            DEALLOCATE(SCR)
+            DEALLOCATE(SCR4)
+
+          END IF
+        END IF
+
+
+       IF ( ALLOCATED(SCR4) ) DEALLOCATE(SCR4)
+       IF ( ASSOCIATED(SCR) ) DEALLOCATE(SCR)
+
+   END SUBROUTINE process_diagnostics
+
+END MODULE module_diagnostics
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_get_file_names.F90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_get_file_names.F90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_get_file_names.F90	(revision 207)
@@ -0,0 +1,138 @@
+MODULE module_get_file_names
+
+!  To allow for multiple input files, we use a couple of UNIX
+!  commands.  These are activated from either the "system" command or 
+!  the "exec" command.  Neither is part of the Fortran standard.
+
+   INTEGER                                       :: number_of_input_files
+   CHARACTER(LEN=132), DIMENSION(:), ALLOCATABLE :: input_file_names
+
+CONTAINS
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+#ifdef crayx1
+   SUBROUTINE system(cmd)
+      IMPLICIT NONE
+      CHARACTER (LEN=*) , INTENT(IN) :: cmd
+      integer                        :: ierr
+      CALL pxfsystem(cmd, len(cmd), ierr)
+   RETURN
+   END SUBROUTINE system
+#endif
+
+   SUBROUTINE unix_ls ( root )
+
+      USE module_debug
+
+      IMPLICIT NONE
+     
+      CHARACTER (LEN=*), INTENT(IN) :: root
+      CHARACTER (LEN=132)           :: command
+      INTEGER                       :: ierr , loop , loslen , strlen
+
+
+      !  Build a UNIX command, and "ls", of all of the files mnatching the "root*" prefix.
+
+         loslen = LEN ( command )
+         CALL all_spaces ( command , loslen ) 
+         WRITE ( command , FMT='("ls -1 ",A,"* > .foo")' ) TRIM ( root )
+         
+         !  We stuck all of the matching files in the ".foo" file.  Now we place the 
+         !  number of the those file (i.e. how many there are) in ".foo1".  Also, if we
+         !  do get inside one of these CPP ifdefs, then we set our access flag to true.
+
+         CALL SYSTEM ( TRIM ( command ) ) 
+         CALL SYSTEM ( '( cat .foo | wc -l > .foo1 )' )
+
+         !  Read the number of files.
+
+         OPEN (FILE   = '.foo1'       , &
+               UNIT   = 112           , &
+               STATUS = 'OLD'         , &
+               ACCESS = 'SEQUENTIAL'  , &
+               FORM   = 'FORMATTED'     )
+
+         READ ( 112 , * ) number_of_input_files
+         CLOSE ( 112 )
+
+         !  If there are zero files, we are toast.
+
+         IF ( number_of_input_files .LE. 0 ) THEN
+            CALL mprintf(.true.,STDOUT, ' Oops, we need at least ONE input file for the program to read.')
+            STOP
+         END IF
+
+      !  Allocate space for this many files.
+
+      ALLOCATE ( input_file_names(number_of_input_files) , STAT=ierr )
+
+      !  Did the allocate work OK?
+
+      IF ( ierr .NE. 0 ) THEN
+         CALL mprintf(.true.,STDOUT, ' tried to allocate %i  input files, (look at ./foo)', i1=number_of_input_files)
+         STOP
+      END IF
+
+      !  Initialize all of the file names to blank.
+
+      CALL init_module_get_file_names
+
+
+      !  Open the file that has the list of filenames.
+
+      OPEN (FILE   = '.foo'        , &
+            UNIT   = 111           , &
+            STATUS = 'OLD'         , &
+            ACCESS = 'SEQUENTIAL'  , &
+            FORM   = 'FORMATTED'     )
+
+      !  Read all of the file names and store them.
+
+      CALL mprintf(.true.,STDOUT, ' ')
+      CALL mprintf(.true.,STDOUT, 'FOUND the following input files:')
+
+      DO loop = 1 , number_of_input_files
+         READ ( 111 , FMT='(A)' ) input_file_names(loop)
+         CALL mprintf(.true.,STDOUT, ' %s ', s1=TRIM(input_file_names(loop)))
+      END DO
+      CLOSE ( 112 )
+      CALL mprintf(.true.,STDOUT, ' ')
+
+      !   We clean up our own messes.
+
+      CALL SYSTEM ( '/bin/rm -f .foo'  )
+      CALL SYSTEM ( '/bin/rm -f .foo1' )
+
+
+   END SUBROUTINE unix_ls
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+   SUBROUTINE all_spaces ( command , length_of_char ) 
+
+      IMPLICIT NONE
+
+      INTEGER                        :: length_of_char
+      CHARACTER (LEN=length_of_char) :: command
+      INTEGER                        :: loop
+
+      DO loop = 1 , length_of_char
+         command(loop:loop) = ' '
+      END DO
+
+   END SUBROUTINE all_spaces
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+   SUBROUTINE init_module_get_file_names
+   
+      IMPLICIT NONE
+      input_file_names = '                                                  ' // &
+                         '                                                  ' // &
+                         '                                '
+
+   END SUBROUTINE init_module_get_file_names
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+END MODULE module_get_file_names
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_interp.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_interp.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_interp.f90	(revision 207)
@@ -0,0 +1,164 @@
+MODULE module_interp
+
+  CONTAINS
+!--------------------------------------------------------
+
+  SUBROUTINE interp( data_in, nx, ny, nz, &
+                     data_out, nxout, nyout, nzout, &
+                     z_data, z_levs, number_of_zlevs )
+
+  USE module_model_basics
+
+  implicit none
+
+ ! Arguments
+  integer                                                       :: nx, ny, nz, number_of_zlevs
+  real, dimension(west_east_dim,south_north_dim,bottom_top_dim) :: z_data
+  real, dimension(nx,ny,nz)                                     :: data_in
+  real, pointer, dimension(:,:,:)                               :: data_out
+  real, dimension(number_of_zlevs)                              :: z_levs
+
+  ! Local variables
+  integer                                                       :: nxout, nyout, nzout
+  real, allocatable, dimension(:,:,:)                           :: SCR2
+  real, dimension(bottom_top_dim)                               :: data_in_1d, z_data_1d
+  real, dimension(number_of_zlevs)                              :: data_out_1d
+  integer                                                       :: i,j,k
+
+
+    IF ( ALLOCATED(SCR2) ) DEALLOCATE(SCR2)
+    IF ( ASSOCIATED(data_out) ) DEALLOCATE(data_out)
+    nxout = nx
+    nyout = ny
+    nzout = nz
+
+    !! We may be dealing with a staggered field
+    IF ( nx .gt. west_east_dim ) THEN
+      ALLOCATE(SCR2(west_east_dim,south_north_dim,bottom_top_dim))
+      SCR2 = 0.5*(data_in(1:west_east_dim,:,:)+data_in(2:west_east_dim+1,:,:))
+      nxout = west_east_dim
+    ELSE IF ( ny .gt. south_north_dim ) THEN
+      ALLOCATE(SCR2(west_east_dim,south_north_dim,bottom_top_dim))
+      SCR2 = 0.5*(data_in(:,1:south_north_dim,:)+data_in(:,2:south_north_dim+1,:))
+      nyout = south_north_dim
+    ELSE IF ( nz .gt. bottom_top_dim ) THEN  
+      ALLOCATE(SCR2(west_east_dim,south_north_dim,bottom_top_dim))
+      SCR2 = 0.5*(data_in(:,:,1:bottom_top_dim)+data_in(:,:,2:bottom_top_dim+1))
+      nzout = bottom_top_dim
+    ELSE
+      ALLOCATE(SCR2(nx,ny,nz))
+      SCR2 = data_in
+    ENDIF
+
+
+    IF ( iprogram .ge. 6 .AND. nzout .gt. 10 .AND.                  &
+         (vertical_type == 'p' .or. vertical_type == 'z') ) THEN
+
+      ALLOCATE(data_out(west_east_dim,south_north_dim,number_of_zlevs))
+      DO i=1,west_east_dim
+      DO j=1,south_north_dim
+  
+        DO k=1,bottom_top_dim
+          data_in_1d(k) = SCR2(i,j,k)
+          z_data_1d(k)  = z_data(i,j,k)
+        ENDDO
+  
+        CALL interp_1d( data_in_1d, z_data_1d, bottom_top_dim, &
+                        data_out_1d, z_levs, number_of_zlevs,  &
+                        vertical_type)
+  
+        DO k=1,number_of_zlevs
+          data_out(i,j,k) = data_out_1d(k)
+        ENDDO
+
+      ENDDO
+      ENDDO
+      
+      nzout = number_of_zlevs
+
+    ELSE
+
+      ALLOCATE(data_out(nxout,nyout,nzout))
+      data_out = SCR2
+      DEALLOCATE(SCR2)
+
+    ENDIF
+
+  END SUBROUTINE interp
+
+!----------------------------------------------
+
+  SUBROUTINE interp_1d( a, xa, na, b, xb, nb, vertical_type)
+
+  implicit none
+
+ ! Arguments
+  integer, intent(in)              :: na, nb
+  real, intent(in), dimension(na)  :: a, xa
+  real, intent(in), dimension(nb)  :: xb
+  real, intent(out), dimension(nb) :: b
+  character (len=1)                :: vertical_type
+
+  ! Local variables
+  real                             :: missing_value
+  integer                          :: n_in, n_out
+  real                             :: w1, w2
+  logical                          :: interp
+
+!  parameter (MISSING_VALUE=1.0E37)
+!!!!
+!!!!AYM AYM
+!!!!
+  parameter (MISSING_VALUE=-9999.)
+
+
+
+  IF ( vertical_type == 'p' ) THEN
+
+    DO n_out = 1, nb
+
+      b(n_out) = missing_value
+      interp = .false.
+      n_in = 1
+
+      DO WHILE ( (.not.interp) .and. (n_in < na) )
+        IF( (xa(n_in)   >= xb(n_out)) .and. &
+            (xa(n_in+1) <= xb(n_out))        ) THEN
+          interp = .true.
+          w1 = (xa(n_in+1)-xb(n_out))/(xa(n_in+1)-xa(n_in))
+          w2 = 1. - w1
+          b(n_out) = w1*a(n_in) + w2*a(n_in+1)
+        END IF
+        n_in = n_in +1
+      ENDDO
+
+    ENDDO
+
+  ELSE
+
+    DO n_out = 1, nb
+  
+      b(n_out) = missing_value
+      interp = .false.
+      n_in = 1
+  
+      DO WHILE ( (.not.interp) .and. (n_in < na) )
+        IF( (xa(n_in)   <= xb(n_out)) .and. &
+            (xa(n_in+1) >= xb(n_out))        ) THEN
+          interp = .true.
+          w1 = (xa(n_in+1)-xb(n_out))/(xa(n_in+1)-xa(n_in))
+          w2 = 1. - w1
+          b(n_out) = w1*a(n_in) + w2*a(n_in+1)
+        END IF
+        n_in = n_in +1
+      ENDDO
+
+    ENDDO
+
+  END IF
+
+  END SUBROUTINE interp_1d
+
+!-------------------------------------------------------------------------
+
+END MODULE module_interp
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_map_utils.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_map_utils.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_map_utils.f90	(revision 207)
@@ -0,0 +1,1154 @@
+!dis   
+!dis    Open Source License/Disclaimer, Forecast Systems Laboratory
+!dis    NOAA/OAR/FSL, 325 Broadway Boulder, CO 80305
+!dis    
+!dis    This software is distributed under the Open Source Definition,
+!dis    which may be found at http://www.opensource.org/osd.html.
+!dis    
+!dis    In particular, redistribution and use in source and binary forms,
+!dis    with or without modification, are permitted provided that the
+!dis    following conditions are met:
+!dis    
+!dis    - Redistributions of source code must retain this notice, this
+!dis    list of conditions and the following disclaimer.
+!dis    
+!dis    - Redistributions in binary form must provide access to this
+!dis    notice, this list of conditions and the following disclaimer, and
+!dis    the underlying source code.
+!dis    
+!dis    - All modifications to this software must be clearly documented,
+!dis    and are solely the responsibility of the agent making the
+!dis    modifications.
+!dis    
+!dis    - If significant modifications or enhancements are made to this
+!dis    software, the FSL Software Policy Manager
+!dis    (softwaremgr@fsl.noaa.gov) should be notified.
+!dis    
+!dis    THIS SOFTWARE AND ITS DOCUMENTATION ARE IN THE PUBLIC DOMAIN
+!dis    AND ARE FURNISHED "AS IS."  THE AUTHORS, THE UNITED STATES
+!dis    GOVERNMENT, ITS INSTRUMENTALITIES, OFFICERS, EMPLOYEES, AND
+!dis    AGENTS MAKE NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE USEFULNESS
+!dis    OF THE SOFTWARE AND DOCUMENTATION FOR ANY PURPOSE.  THEY ASSUME
+!dis    NO RESPONSIBILITY (1) FOR THE USE OF THE SOFTWARE AND
+!dis    DOCUMENTATION; OR (2) TO PROVIDE TECHNICAL SUPPORT TO USERS.
+!dis   
+!dis 
+
+MODULE map_utils
+
+! Module that defines constants, data structures, and
+! subroutines used to convert grid indices to lat/lon
+! and vice versa.   
+!
+! SUPPORTED PROJECTIONS
+! ---------------------
+! Cylindrical Lat/Lon (code = PROJ_LATLON)
+! Mercator (code = PROJ_MERC)
+! Lambert Conformal (code = PROJ_LC)
+! Polar Stereographic (code = PROJ_PS)
+!
+! REMARKS
+! -------
+! The routines contained within were adapted from routines
+! obtained from the NCEP w3 library.  The original NCEP routines were less
+! flexible (e.g., polar-stereo routines only supported truelat of 60N/60S)
+! than what we needed, so modifications based on equations in Hoke, Hayes, and
+! Renninger (AFGWC/TN/79-003) were added to improve the flexibility.  
+! Additionally, coding was improved to F90 standards and the routines were
+! combined into this module.  
+!
+! ASSUMPTIONS
+! -----------
+!  Grid Definition:
+!    For mercator, lambert conformal, and polar-stereographic projections,
+!    the routines within assume the following:
+!
+!       1.  Grid is dimensioned (i,j) where i is the East-West direction, 
+!           positive toward the east, and j is the north-south direction, 
+!           positive toward the north.  
+!       2.  Origin is at (1,1) and is located at the southwest corner,
+!           regardless of hemispere.
+!       3.  Grid spacing (dx) is always positive.
+!       4.  Values of true latitudes must be positive for NH domains
+!           and negative for SH domains.
+!
+!     For the latlon projection, the grid origin may be at any of the
+!     corners, and the deltalat and deltalon values can be signed to 
+!     account for this using the following convention:
+!       Origin Location        Deltalat Sign      Deltalon Sign
+!       ---------------        -------------      -------------
+!        SW Corner                  +                   +
+!        NE Corner                  -                   -
+!        NW Corner                  -                   +
+!        SE Corner                  +                   -
+!       
+!  Data Definitions:
+!       1. Any arguments that are a latitude value are expressed in 
+!          degrees north with a valid range of -90 -> 90
+!       2. Any arguments that are a longitude value are expressed in
+!          degrees east with a valid range of -180 -> 180.
+!       3. Distances are in meters and are always positive.
+!       4. The standard longitude (stdlon) is defined as the longitude
+!          line which is parallel to the y-axis (j-direction), along
+!          which latitude increases (NOT the absolute value of latitude, but
+!          the actual latitude, such that latitude increases continuously
+!          from the south pole to the north pole) as j increases.  
+!       5. One true latitude value is required for polar-stereographic and
+!          mercator projections, and defines at which latitude the 
+!          grid spacing is true.  For lambert conformal, two true latitude
+!          values must be specified, but may be set equal to each other to
+!          specify a tangent projection instead of a secant projection.  
+!       
+! USAGE
+! -----
+! To use the routines in this module, the calling routines must have the 
+! following statement at the beginning of its declaration block:
+!   USE map_utils
+! 
+! The use of the module not only provides access to the necessary routines,
+! but also defines a structure of TYPE (proj_info) that can be used
+! to declare a variable of the same type to hold your map projection
+! information.  It also defines some integer parameters that contain
+! the projection codes so one only has to use those variable names rather
+! than remembering the acutal code when using them.  The basic steps are
+! as follows:
+!  
+!   1.  Ensure the "USE map_utils" is in your declarations.
+!   2.  Declare the projection information structure as type(proj_info):
+!         TYPE(proj_info) :: proj
+!   3.  Populate your structure by calling the map_set routine:
+!         CALL map_set(code,lat1,lon1,dx,stdlon,truelat1,truelat2,nx,ny,proj)
+!       where:
+!         code (input) = one of PROJ_LATLON, PROJ_MERC, PROJ_LC, or PROJ_PS
+!         lat1 (input) = Latitude of grid origin point (i,j)=(1,1) 
+!                         (see assumptions!)
+!         lon1 (input) = Longitude of grid origin 
+!         dx (input) = grid spacing in meters (ignored for LATLON projections)
+!         stdlon (input) = Standard longitude for PROJ_PS and PROJ_LC, 
+!               deltalon (see assumptions) for PROJ_LATLON, 
+!               ignored for PROJ_MERC
+!         truelat1 (input) = 1st true latitude for PROJ_PS, PROJ_LC, and
+!                PROJ_MERC, deltalat (see assumptions) for PROJ_LATLON
+!         truelat2 (input) = 2nd true latitude for PROJ_LC, 
+!                ignored for all others.
+!         nx = number of points in east-west direction
+!         ny = number of points in north-south direction
+!         proj (output) = The structure of type (proj_info) that will be fully 
+!                populated after this call
+!
+!   4.  Now that the proj structure is populated, you may call any 
+!       of the following routines:
+!       
+!       latlon_to_ij(proj, lat, lon, i, j)
+!       ij_to_latlon(proj, i, j, lat, lon)
+!       truewind_to_gridwind(lon, proj, ugrid, vgrid, utrue, vtrue)
+!       gridwind_to_truewind(lon, proj, utrue, vtrue, ugrid, vgrid)
+!       compare_projections(proj1, proj2, same_proj)
+!
+!       It is incumbent upon the calling routine to determine whether or
+!       not the values returned are within your domain bounds.  All values
+!       of i, j, lat, and lon are REAL values.
+!
+!
+! REFERENCES
+! ----------
+!  Hoke, Hayes, and Renninger, "Map Preojections and Grid Systems for
+!       Meteorological Applications." AFGWC/TN-79/003(Rev), Air Weather
+!       Service, 1985.
+!
+!  NCAR MM5v3 Modeling System, REGRIDDER program, module_first_guess_map.F
+!  NCEP routines w3fb06, w3fb07, w3fb08, w3fb09, w3fb11, w3fb12
+!
+! HISTORY
+! -------
+! 27 Mar 2001 - Original Version
+!               Brent L. Shaw, NOAA/FSL (CSU/CIRA)
+! 02 Apr 2001 - Added routines to rotate winds from true to grid
+!               and vice versa.
+!               Brent L. Shaw, NOAA/FSL (CSU/CIRA)
+! 09 Apr 2001 - Added compare_projections routine to compare two
+!               sets of projection parameters.
+!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+IMPLICIT NONE
+
+  ! Define some private constants
+  REAL, PRIVATE, PARAMETER     :: pi = 3.1415927
+  REAL, PRIVATE, PARAMETER    :: deg_per_rad = 180./pi
+  REAL, PRIVATE, PARAMETER    :: rad_per_deg = pi / 180.
+
+  !! Mean Earth Radius in m.  The value below is consistent
+  !! with NCEPs routines and grids.
+  !REAL, PUBLIC, PARAMETER     :: earth_radius_m = 6371200.
+  REAL, PUBLIC, PARAMETER     :: earth_radius_m = 3397200.
+
+  ! Define public parameters
+ 
+  ! Projection codes for proj_info structure:
+  INTEGER, PUBLIC, PARAMETER  :: PROJ_LATLON = 0
+  INTEGER, PUBLIC, PARAMETER  :: PROJ_MERC = 3
+  INTEGER, PUBLIC, PARAMETER  :: PROJ_LC = 1
+  INTEGER, PUBLIC, PARAMETER  :: PROJ_PS = 2
+
+   
+  ! Define data structures to define various projections
+
+  TYPE proj_info
+
+    INTEGER          :: code     ! Integer code for projection type
+    REAL             :: lat1    ! SW latitude (1,1) in degrees (-90->90N)
+    REAL             :: lon1    ! SW longitude (1,1) in degrees (-180->180E)
+    REAL             :: dx       ! Grid spacing in meters at truelats, used
+                                 ! only for ps, lc, and merc projections
+    REAL             :: dlat     ! Lat increment for lat/lon grids
+    REAL             :: dlon     ! Lon increment for lat/lon grids
+    REAL             :: stdlon   ! Longitude parallel to y-axis (-180->180E)
+    REAL             :: truelat1 ! First true latitude (all projections)
+    REAL             :: truelat2 ! Second true lat (LC only)
+    REAL             :: hemi     ! 1 for NH, -1 for SH
+    REAL             :: cone     ! Cone factor for LC projections
+    REAL             :: polei    ! Computed i-location of pole point
+    REAL             :: polej    ! Computed j-location of pole point
+    REAL             :: rsw      ! Computed radius to SW corner
+    REAL             :: rebydx   ! Earth radius divided by dx
+    LOGICAL          :: init     ! Flag to indicate if this struct is 
+                                 ! ready for use
+    INTEGER          :: nx
+    INTEGER          :: ny
+  END TYPE proj_info
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+CONTAINS
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE map_init(proj)
+    ! Initializes the map projection structure to missing values
+
+    IMPLICIT NONE
+    TYPE(proj_info), INTENT(INOUT)  :: proj
+
+    proj%lat1 =    -999.9
+    proj%lon1 =    -999.9
+    proj%dx    =    -999.9
+    proj%stdlon =   -999.9
+    proj%truelat1 = -999.9
+    proj%truelat2 = -999.9
+    proj%hemi     = 0.0
+    proj%cone     = -999.9
+    proj%polei    = -999.9
+    proj%polej    = -999.9
+    proj%rsw      = -999.9
+    proj%init     = .FALSE.
+    proj%nx       = -99
+    proj%ny       = -99 
+  END SUBROUTINE map_init
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE map_set(proj_code,lat1,lon1,dx,stdlon,truelat1,truelat2, &
+                     idim,jdim,proj)
+    ! Given a partially filled proj_info structure, this routine computes
+    ! polei, polej, rsw, and cone (if LC projection) to complete the 
+    ! structure.  This allows us to eliminate redundant calculations when
+    ! calling the coordinate conversion routines multiple times for the
+    ! same map.
+    ! This will generally be the first routine called when a user wants
+    ! to be able to use the coordinate conversion routines, and it
+    ! will call the appropriate subroutines based on the 
+    ! proj%code which indicates which projection type  this is.
+
+    IMPLICIT NONE
+    
+    ! Declare arguments
+    INTEGER, INTENT(IN)               :: proj_code
+    REAL, INTENT(IN)                  :: lat1
+    REAL, INTENT(IN)                  :: lon1
+    REAL, INTENT(IN)                  :: dx
+    REAL, INTENT(IN)                  :: stdlon
+    REAL, INTENT(IN)                  :: truelat1
+    REAL, INTENT(IN)                  :: truelat2
+    INTEGER, INTENT(IN)               :: idim
+    INTEGER, INTENT(IN)               :: jdim
+    TYPE(proj_info), INTENT(OUT)      :: proj
+
+    ! Local variables
+
+
+    ! Executable code
+
+    ! First, check for validity of mandatory variables in proj
+    IF ( ABS(lat1) .GT. 90.001 ) THEN
+      PRINT '(A)', 'Latitude of origin corner required as follows:'
+      PRINT '(A)', '    -90N <= lat1 < = 90.N'
+      STOP 'MAP_INIT'
+    ENDIF
+    IF ( ABS(lon1) .GT. 180.) THEN
+      PRINT '(A)', 'Longitude of origin required as follows:'
+      PRINT '(A)', '   -180E <= lon1 <= 180W'
+      STOP 'MAP_INIT'
+    ENDIF
+    IF ((dx .LE. 0.).AND.(proj_code .NE. PROJ_LATLON)) THEN
+      PRINT '(A)', 'Require grid spacing (dx) in meters be positive!'
+      STOP 'MAP_INIT'
+    ENDIF
+    IF ((ABS(stdlon) .GT. 180.).AND.(proj_code .NE. PROJ_MERC)) THEN
+      PRINT '(A)', 'Need orientation longitude (stdlon) as: '
+      PRINT '(A)', '   -180E <= lon1 <= 180W' 
+      STOP 'MAP_INIT'
+    ENDIF
+    IF (ABS(truelat1).GT.90.) THEN
+      PRINT '(A)', 'Set true latitude 1 for all projections!'
+      STOP 'MAP_INIT'
+    ENDIF
+   
+    CALL map_init(proj) 
+    proj%code  = proj_code
+    proj%lat1 = lat1
+    proj%lon1 = lon1
+    proj%dx    = dx
+    proj%stdlon = stdlon
+    proj%truelat1 = truelat1
+    proj%truelat2 = truelat2
+    proj%nx = idim
+    proj%ny = jdim
+    IF (proj%code .NE. PROJ_LATLON) THEN
+      proj%dx = dx
+      IF (truelat1 .LT. 0.) THEN
+        proj%hemi = -1.0 
+      ELSE
+        proj%hemi = 1.0
+      ENDIF
+      proj%rebydx = earth_radius_m / dx
+    ENDIF
+    pick_proj: SELECT CASE(proj%code)
+
+      CASE(PROJ_PS)
+        !PRINT '(A)', 'Setting up POLAR STEREOGRAPHIC map...'
+        CALL set_ps(proj)
+
+      CASE(PROJ_LC)
+        !PRINT '(A)', 'Setting up LAMBERT CONFORMAL map...'
+        IF (ABS(proj%truelat2) .GT. 90.) THEN
+          PRINT '(A)', 'Second true latitude not set, assuming a tangent'
+          PRINT '(A,F10.3)', 'projection at truelat1: ', proj%truelat1
+          proj%truelat2=proj%truelat1
+        ELSE 
+          ! Ensure truelat1 < truelat2
+          proj%truelat1 = MIN(truelat1,truelat2)
+          proj%truelat2 = MAX(truelat1,truelat2)
+        ENDIF
+        CALL set_lc(proj)
+   
+      CASE (PROJ_MERC)
+        !PRINT '(A)', 'Setting up MERCATOR map...'
+        CALL set_merc(proj)
+   
+      CASE (PROJ_LATLON)
+        !PRINT '(A)', 'Setting up CYLINDRICAL EQUIDISTANT LATLON map...'
+        ! Convert lon1 to 0->360 notation
+        IF (proj%lon1 .LT. 0.) proj%lon1 = proj%lon1 + 360.
+   
+      CASE DEFAULT
+        PRINT '(A,I2)', 'Unknown projection code: ', proj%code
+        STOP 'MAP_INIT'
+    
+    END SELECT pick_proj
+    proj%init = .TRUE.
+    RETURN
+  END SUBROUTINE map_set
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE latlon_to_ij(proj, lat, lon, i, j)
+    ! Converts input lat/lon values to the cartesian (i,j) value
+    ! for the given projection. 
+
+    IMPLICIT NONE
+    TYPE(proj_info), INTENT(IN)          :: proj
+    REAL, INTENT(IN)                     :: lat
+    REAL, INTENT(IN)                     :: lon
+    REAL, INTENT(OUT)                    :: i
+    REAL, INTENT(OUT)                    :: j
+
+    IF (.NOT.proj%init) THEN
+      PRINT '(A)', 'You have not called map_set for this projection!'
+      STOP 'LATLON_TO_IJ'
+    ENDIF
+
+    SELECT CASE(proj%code)
+ 
+      CASE(PROJ_LATLON)
+        CALL llij_latlon(lat,lon,proj,i,j)
+
+      CASE(PROJ_MERC)
+        CALL llij_merc(lat,lon,proj,i,j)
+
+      CASE(PROJ_PS)
+        CALL llij_ps(lat,lon,proj,i,j)
+      
+      CASE(PROJ_LC)
+        CALL llij_lc(lat,lon,proj,i,j)
+
+      CASE DEFAULT
+        PRINT '(A,I2)', 'Unrecognized map projection code: ', proj%code
+        STOP 'LATLON_TO_IJ'
+ 
+    END SELECT
+    RETURN
+  END SUBROUTINE latlon_to_ij
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE ij_to_latlon(proj, i, j, lat, lon)
+    ! Computes geographical latitude and longitude for a given (i,j) point
+    ! in a grid with a projection of proj
+
+    IMPLICIT NONE
+    TYPE(proj_info),INTENT(IN)          :: proj
+    REAL, INTENT(IN)                    :: i
+    REAL, INTENT(IN)                    :: j
+    REAL, INTENT(OUT)                   :: lat
+    REAL, INTENT(OUT)                   :: lon
+
+    IF (.NOT.proj%init) THEN
+      PRINT '(A)', 'You have not called map_set for this projection!'
+      STOP 'IJ_TO_LATLON'
+    ENDIF
+    SELECT CASE (proj%code)
+
+      CASE (PROJ_LATLON)
+        CALL ijll_latlon(i, j, proj, lat, lon)
+
+      CASE (PROJ_MERC)
+        CALL ijll_merc(i, j, proj, lat, lon)
+
+      CASE (PROJ_PS)
+        CALL ijll_ps(i, j, proj, lat, lon)
+
+      CASE (PROJ_LC)
+        CALL ijll_lc(i, j, proj, lat, lon)
+
+      CASE DEFAULT
+        PRINT '(A,I2)', 'Unrecognized map projection code: ', proj%code
+        STOP 'IJ_TO_LATLON'
+
+    END SELECT
+    RETURN
+  END SUBROUTINE ij_to_latlon
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE set_ps(proj)
+    ! Initializes a polar-stereographic map projection from the partially
+    ! filled proj structure. This routine computes the radius to the
+    ! southwest corner and computes the i/j location of the pole for use
+    ! in llij_ps and ijll_ps.
+    IMPLICIT NONE
+ 
+    ! Declare args
+    TYPE(proj_info), INTENT(INOUT)    :: proj
+
+    ! Local vars
+    REAL                              :: ala1
+    REAL                              :: alo1
+    REAL                              :: reflon
+    REAL                              :: scale_top
+
+    ! Executable code
+    reflon = proj%stdlon + 90.
+  
+    ! Cone factor
+    proj%cone = 1.0
+
+    ! Compute numerator term of map scale factor
+    scale_top = 1. + proj%hemi * SIN(proj%truelat1 * rad_per_deg)
+
+    ! Compute radius to lower-left (SW) corner
+    ala1 = proj%lat1 * rad_per_deg
+    proj%rsw = proj%rebydx*COS(ala1)*scale_top/(1.+proj%hemi*SIN(ala1))
+
+    ! Find the pole point
+    alo1 = (proj%lon1 - reflon) * rad_per_deg
+    proj%polei = 1. - proj%rsw * COS(alo1)
+    proj%polej = 1. - proj%hemi * proj%rsw * SIN(alo1)
+    PRINT '(A,2F10.1)', 'Computed (I,J) of pole point: ',proj%polei,proj%polej
+    RETURN
+  END SUBROUTINE set_ps
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE llij_ps(lat,lon,proj,i,j)
+    ! Given latitude (-90 to 90), longitude (-180 to 180), and the
+    ! standard polar-stereographic projection information via the 
+    ! public proj structure, this routine returns the i/j indices which
+    ! if within the domain range from 1->nx and 1->ny, respectively.
+
+    IMPLICIT NONE
+
+    ! Delcare input arguments
+    REAL, INTENT(IN)               :: lat
+    REAL, INTENT(IN)               :: lon
+    TYPE(proj_info),INTENT(IN)     :: proj
+
+    ! Declare output arguments     
+    REAL, INTENT(OUT)              :: i !(x-index)
+    REAL, INTENT(OUT)              :: j !(y-index)
+
+    ! Declare local variables
+    
+    REAL                           :: reflon
+    REAL                           :: scale_top
+    REAL                           :: ala
+    REAL                           :: alo
+    REAL                           :: rm
+
+    ! BEGIN CODE
+
+  
+    reflon = proj%stdlon + 90.
+   
+    ! Compute numerator term of map scale factor
+
+    scale_top = 1. + proj%hemi * SIN(proj%truelat1 * rad_per_deg)
+
+    ! Find radius to desired point
+    ala = lat * rad_per_deg
+    rm = proj%rebydx * COS(ala) * scale_top/(1. + proj%hemi *SIN(ala))
+    alo = (lon - reflon) * rad_per_deg
+    i = proj%polei + rm * COS(alo)
+    j = proj%polej + proj%hemi * rm * SIN(alo)
+ 
+    RETURN
+  END SUBROUTINE llij_ps
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE ijll_ps(i, j, proj, lat, lon)
+
+    ! This is the inverse subroutine of llij_ps.  It returns the 
+    ! latitude and longitude of an i/j point given the projection info 
+    ! structure.  
+
+    IMPLICIT NONE
+
+    ! Declare input arguments
+    REAL, INTENT(IN)                    :: i    ! Column
+    REAL, INTENT(IN)                    :: j    ! Row
+    TYPE (proj_info), INTENT(IN)        :: proj
+    
+    ! Declare output arguments
+    REAL, INTENT(OUT)                   :: lat     ! -90 -> 90 North
+    REAL, INTENT(OUT)                   :: lon     ! -180 -> 180 East
+
+    ! Local variables
+    REAL                                :: reflon
+    REAL                                :: scale_top
+    REAL                                :: xx,yy
+    REAL                                :: gi2, r2
+    REAL                                :: arccos
+
+    ! Begin Code
+
+    ! Compute the reference longitude by rotating 90 degrees to the east
+    ! to find the longitude line parallel to the positive x-axis.
+    reflon = proj%stdlon + 90.
+   
+    ! Compute numerator term of map scale factor
+    scale_top = 1. + proj%hemi * SIN(proj%truelat1 * rad_per_deg)
+
+    ! Compute radius to point of interest
+    xx = i - proj%polei
+    yy = (j - proj%polej) * proj%hemi
+    r2 = xx**2 + yy**2
+
+    ! Now the magic code
+    IF (r2 .EQ. 0.) THEN 
+      lat = proj%hemi * 90.
+      lon = reflon
+    ELSE
+      gi2 = (proj%rebydx * scale_top)**2.
+      lat = deg_per_rad * proj%hemi * ASIN((gi2-r2)/(gi2+r2))
+      arccos = ACOS(xx/SQRT(r2))
+      IF (yy .GT. 0) THEN
+        lon = reflon + deg_per_rad * arccos
+      ELSE
+        lon = reflon - deg_per_rad * arccos
+      ENDIF
+    ENDIF
+  
+    ! Convert to a -180 -> 180 East convention
+    IF (lon .GT. 180.) lon = lon - 360.
+    IF (lon .LT. -180.) lon = lon + 360.
+    RETURN
+  
+  END SUBROUTINE ijll_ps
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE set_lc(proj)
+    ! Initialize the remaining items in the proj structure for a
+    ! lambert conformal grid.
+
+    IMPLICIT NONE
+    
+    TYPE(proj_info), INTENT(INOUT)     :: proj
+
+    REAL                               :: arg
+    REAL                               :: deltalon1
+    REAL                               :: tl1r
+    REAL                               :: ctl1r
+
+    ! Compute cone factor
+    CALL lc_cone(proj%truelat1, proj%truelat2, proj%cone)
+    ! PRINT '(A,F8.6)', 'Computed cone factor: ', proj%cone
+    ! Compute longitude differences and ensure we stay out of the
+    ! forbidden "cut zone"
+    deltalon1 = proj%lon1 - proj%stdlon
+    IF (deltalon1 .GT. +180.) deltalon1 = deltalon1 - 360.
+    IF (deltalon1 .LT. -180.) deltalon1 = deltalon1 + 360.
+
+    ! Convert truelat1 to radian and compute COS for later use
+    tl1r = proj%truelat1 * rad_per_deg
+    ctl1r = COS(tl1r)
+
+    ! Compute the radius to our known lower-left (SW) corner
+    proj%rsw = proj%rebydx * ctl1r/proj%cone * &
+           (TAN((90.*proj%hemi-proj%lat1)*rad_per_deg/2.) / &
+            TAN((90.*proj%hemi-proj%truelat1)*rad_per_deg/2.))**proj%cone
+
+    ! Find pole point
+    arg = proj%cone*(deltalon1*rad_per_deg)
+    proj%polei = 1. - proj%hemi * proj%rsw * SIN(arg)
+    proj%polej = 1. + proj%rsw * COS(arg)  
+    !PRINT '(A,2F10.3)', 'Computed pole i/j = ', proj%polei, proj%polej
+    RETURN
+  END SUBROUTINE set_lc                             
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE lc_cone(truelat1, truelat2, cone)
+
+  ! Subroutine to compute the cone factor of a Lambert Conformal projection
+
+    IMPLICIT NONE
+    
+    ! Input Args
+    REAL, INTENT(IN)             :: truelat1  ! (-90 -> 90 degrees N)
+    REAL, INTENT(IN)             :: truelat2  !   "   "  "   "     "
+
+    ! Output Args
+    REAL, INTENT(OUT)            :: cone
+
+    ! Locals
+
+    ! BEGIN CODE
+
+    ! First, see if this is a secant or tangent projection.  For tangent
+    ! projections, truelat1 = truelat2 and the cone is tangent to the 
+    ! Earth surface at this latitude.  For secant projections, the cone
+    ! intersects the Earth surface at each of the distinctly different
+    ! latitudes
+    IF (ABS(truelat1-truelat2) .GT. 0.1) THEN
+
+      ! Compute cone factor following:
+      cone=(ALOG(COS(truelat1*rad_per_deg))-ALOG(COS(truelat2*rad_per_deg))) / &
+       (ALOG(TAN((90.-ABS(truelat1))*rad_per_deg*0.5 ))- &
+        ALOG(TAN((90.-ABS(truelat2))*rad_per_deg*0.5 )) )
+    ELSE
+       cone = SIN(ABS(truelat1)*rad_per_deg )  
+    ENDIF
+  RETURN
+  END SUBROUTINE lc_cone
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE ijll_lc( i, j, proj, lat, lon)
+
+  ! Subroutine to convert from the (i,j) cartesian coordinate to the 
+  ! geographical latitude and longitude for a Lambert Conformal projection.
+
+  ! History:
+  ! 25 Jul 01: Corrected by B. Shaw, NOAA/FSL
+  ! 
+    IMPLICIT NONE
+
+    ! Input Args
+    REAL, INTENT(IN)              :: i        ! Cartesian X coordinate
+    REAL, INTENT(IN)              :: j        ! Cartesian Y coordinate
+    TYPE(proj_info),INTENT(IN)    :: proj     ! Projection info structure
+
+    ! Output Args                 
+    REAL, INTENT(OUT)             :: lat      ! Latitude (-90->90 deg N)
+    REAL, INTENT(OUT)             :: lon      ! Longitude (-180->180 E)
+
+    ! Locals 
+    REAL                          :: inew
+    REAL                          :: jnew
+    REAL                          :: r
+    REAL                          :: chi,chi1,chi2
+    REAL                          :: r2
+    REAL                          :: xx
+    REAL                          :: yy
+
+    ! BEGIN CODE
+
+    chi1 = (90. - proj%hemi*proj%truelat1)*rad_per_deg
+    chi2 = (90. - proj%hemi*proj%truelat2)*rad_per_deg
+
+    ! See if we are in the southern hemispere and flip the indices
+    ! if we are. 
+    IF (proj%hemi .EQ. -1.) THEN 
+      inew = -i + 2.
+      jnew = -j + 2.
+    ELSE
+      inew = i
+      jnew = j
+    ENDIF
+
+    ! Compute radius**2 to i/j location
+    xx = inew - proj%polei
+    yy = proj%polej - jnew
+    r2 = (xx*xx + yy*yy)
+    r = SQRT(r2)/proj%rebydx
+   
+    ! Convert to lat/lon
+    IF (r2 .EQ. 0.) THEN
+      lat = proj%hemi * 90.
+      lon = proj%stdlon
+    ELSE
+       
+      ! Longitude
+      lon = proj%stdlon + deg_per_rad * ATAN2(proj%hemi*xx,yy)/proj%cone
+      lon = AMOD(lon+360., 360.)
+
+      ! Latitude.  Latitude determined by solving an equation adapted 
+      ! from:
+      !  Maling, D.H., 1973: Coordinate Systems and Map Projections
+      ! Equations #20 in Appendix I.  
+        
+      IF (chi1 .EQ. chi2) THEN
+        chi = 2.0*ATAN( ( r/TAN(chi1) )**(1./proj%cone) * TAN(chi1*0.5) )
+      ELSE
+        chi = 2.0*ATAN( (r*proj%cone/SIN(chi1))**(1./proj%cone) * TAN(chi1*0.5)) 
+      ENDIF
+      lat = (90.0-chi*deg_per_rad)*proj%hemi
+
+    ENDIF
+
+    IF (lon .GT. +180.) lon = lon - 360.
+    IF (lon .LT. -180.) lon = lon + 360.
+    RETURN
+    END SUBROUTINE ijll_lc
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE llij_lc( lat, lon, proj, i, j)
+
+  ! Subroutine to compute the geographical latitude and longitude values
+  ! to the cartesian x/y on a Lambert Conformal projection.
+    
+    IMPLICIT NONE
+
+    ! Input Args
+    REAL, INTENT(IN)              :: lat      ! Latitude (-90->90 deg N)
+    REAL, INTENT(IN)              :: lon      ! Longitude (-180->180 E)
+    TYPE(proj_info),INTENT(IN)      :: proj     ! Projection info structure
+
+    ! Output Args                 
+    REAL, INTENT(OUT)             :: i        ! Cartesian X coordinate
+    REAL, INTENT(OUT)             :: j        ! Cartesian Y coordinate
+
+    ! Locals 
+    REAL                          :: arg
+    REAL                          :: deltalon
+    REAL                          :: tl1r
+    REAL                          :: rm
+    REAL                          :: ctl1r
+    
+
+    ! BEGIN CODE
+    
+    ! Compute deltalon between known longitude and standard lon and ensure
+    ! it is not in the cut zone
+    deltalon = lon - proj%stdlon
+    IF (deltalon .GT. +180.) deltalon = deltalon - 360.
+    IF (deltalon .LT. -180.) deltalon = deltalon + 360.
+    
+    ! Convert truelat1 to radian and compute COS for later use
+    tl1r = proj%truelat1 * rad_per_deg
+    ctl1r = COS(tl1r)     
+   
+    ! Radius to desired point
+    rm = proj%rebydx * ctl1r/proj%cone * &
+         (TAN((90.*proj%hemi-lat)*rad_per_deg/2.) / &
+          TAN((90.*proj%hemi-proj%truelat1)*rad_per_deg/2.))**proj%cone
+
+    arg = proj%cone*(deltalon*rad_per_deg)
+    i = proj%polei + proj%hemi * rm * SIN(arg)
+    j = proj%polej - rm * COS(arg)
+
+    ! Finally, if we are in the southern hemisphere, flip the i/j
+    ! values to a coordinate system where (1,1) is the SW corner
+    ! (what we assume) which is different than the original NCEP
+    ! algorithms which used the NE corner as the origin in the 
+    ! southern hemisphere (left-hand vs. right-hand coordinate?)
+    IF (proj%hemi .EQ. -1.) THEN
+      i = 2. - i  
+      j = 2. - j
+    ENDIF
+    RETURN
+  END SUBROUTINE llij_lc
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE set_merc(proj)
+  
+    ! Sets up the remaining basic elements for the mercator projection
+
+    IMPLICIT NONE
+    TYPE(proj_info), INTENT(INOUT)       :: proj
+    REAL                                 :: clain
+
+
+    !  Preliminary variables
+
+    clain = COS(rad_per_deg*proj%truelat1)
+    proj%dlon = proj%dx / (earth_radius_m * clain)
+
+    ! Compute distance from equator to origin, and store in the 
+    ! proj%rsw tag.
+
+    proj%rsw = 0.
+    IF (proj%lat1 .NE. 0.) THEN
+      proj%rsw = (ALOG(TAN(0.5*((proj%lat1+90.)*rad_per_deg))))/proj%dlon
+    ENDIF
+    RETURN
+  END SUBROUTINE set_merc
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE llij_merc(lat, lon, proj, i, j)
+
+    ! Compute i/j coordinate from lat lon for mercator projection
+  
+    IMPLICIT NONE
+    REAL, INTENT(IN)              :: lat
+    REAL, INTENT(IN)              :: lon
+    TYPE(proj_info),INTENT(IN)    :: proj
+    REAL,INTENT(OUT)              :: i
+    REAL,INTENT(OUT)              :: j
+    REAL                          :: deltalon
+
+    deltalon = lon - proj%lon1
+    IF (deltalon .LT. -180.) deltalon = deltalon + 360.
+    IF (deltalon .GT. 180.) deltalon = deltalon - 360.
+    i = 1. + (deltalon/(proj%dlon*deg_per_rad))
+    j = 1. + (ALOG(TAN(0.5*((lat + 90.) * rad_per_deg)))) / &
+           proj%dlon - proj%rsw
+
+    RETURN
+  END SUBROUTINE llij_merc
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE ijll_merc(i, j, proj, lat, lon)
+
+    ! Compute the lat/lon from i/j for mercator projection
+
+    IMPLICIT NONE
+    REAL,INTENT(IN)               :: i
+    REAL,INTENT(IN)               :: j    
+    TYPE(proj_info),INTENT(IN)    :: proj
+    REAL, INTENT(OUT)             :: lat
+    REAL, INTENT(OUT)             :: lon 
+
+
+    lat = 2.0*ATAN(EXP(proj%dlon*(proj%rsw + j-1.)))*deg_per_rad - 90.
+    lon = (i-1.)*proj%dlon*deg_per_rad + proj%lon1
+    IF (lon.GT.180.) lon = lon - 360.
+    IF (lon.LT.-180.) lon = lon + 360.
+    RETURN
+  END SUBROUTINE ijll_merc
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE llij_latlon(lat, lon, proj, i, j)
+ 
+    ! Compute the i/j location of a lat/lon on a LATLON grid.
+    IMPLICIT NONE
+    REAL, INTENT(IN)             :: lat
+    REAL, INTENT(IN)             :: lon
+    TYPE(proj_info), INTENT(IN)  :: proj
+    REAL, INTENT(OUT)            :: i
+    REAL, INTENT(OUT)            :: j
+
+    REAL                         :: deltalat
+    REAL                         :: deltalon
+    REAL                         :: lon360
+    REAL                         :: latinc
+    REAL                         :: loninc
+
+    ! Extract the latitude and longitude increments for this grid
+    ! (e.g., 2.5 deg for NCEP reanalysis) from the proj structure, where
+    ! loninc is saved in the stdlon tag and latinc is saved in truelat1
+
+    latinc = proj%truelat1
+    loninc = proj%stdlon
+
+    ! Compute deltalat and deltalon as the difference between the input 
+    ! lat/lon and the origin lat/lon
+
+    deltalat = lat - proj%lat1
+
+    ! To account for issues around the dateline, convert the incoming
+    ! longitudes to be 0->360.
+    IF (lon .LT. 0) THEN 
+      lon360 = lon + 360. 
+    ELSE 
+      lon360 = lon
+    ENDIF    
+    deltalon = lon360 - proj%lon1      
+    IF (deltalon .LT. 0) deltalon = deltalon + 360.
+ 
+    ! Compute i/j
+    i = deltalon/loninc + 1.
+    j = deltalat/latinc + 1.
+    RETURN
+    END SUBROUTINE llij_latlon
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE ijll_latlon(i, j, proj, lat, lon)
+ 
+    ! Compute the lat/lon location of an i/j on a LATLON grid.
+    IMPLICIT NONE
+    REAL, INTENT(IN)             :: i
+    REAL, INTENT(IN)             :: j
+    TYPE(proj_info), INTENT(IN)  :: proj
+    REAL, INTENT(OUT)            :: lat
+    REAL, INTENT(OUT)            :: lon
+
+    REAL                         :: deltalat
+    REAL                         :: deltalon
+    REAL                         :: lon360
+    REAL                         :: latinc
+    REAL                         :: loninc
+
+    ! Extract the latitude and longitude increments for this grid
+    ! (e.g., 2.5 deg for NCEP reanalysis) from the proj structure, where
+    ! loninc is saved in the stdlon tag and latinc is saved in truelat1
+
+    latinc = proj%truelat1
+    loninc = proj%stdlon
+
+    ! Compute deltalat and deltalon 
+
+    deltalat = (j-1.)*latinc
+    deltalon = (i-1.)*loninc
+    lat = proj%lat1 + deltalat
+    lon = proj%lon1 + deltalon
+
+    IF ((ABS(lat) .GT. 90.).OR.(ABS(deltalon) .GT.360.)) THEN
+      ! Off the earth for this grid
+      lat = -999.
+      lon = -999.
+    ELSE
+      lon = lon + 360.
+      lon = AMOD(lon,360.)
+      IF (lon .GT. 180.) lon = lon -360.
+    ENDIF
+
+    RETURN
+  END SUBROUTINE ijll_latlon
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE gridwind_to_truewind(lon,proj,ugrid,vgrid,utrue,vtrue)
+  
+    ! Subroutine to convert a wind from grid north to true north.
+
+    IMPLICIT NONE
+    
+    ! Arguments
+    REAL, INTENT(IN)          :: lon     ! Longitude of point in degrees
+    TYPE(proj_info),INTENT(IN):: proj    ! Projection info structure 
+    REAL, INTENT(IN)          :: ugrid   ! U-component, grid-relative
+    REAL, INTENT(IN)          :: vgrid   ! V-component, grid-relative
+    REAL, INTENT(OUT)         :: utrue   ! U-component, earth-relative
+    REAL, INTENT(OUT)         :: vtrue   ! V-component, earth-relative
+
+    ! Locals
+    REAL                      :: alpha
+    REAL                      :: diff
+
+    IF ((proj%code .EQ. PROJ_PS).OR.(proj%code .EQ. PROJ_LC))THEN
+      diff = lon - proj%stdlon
+      IF (diff .GT. 180.) diff = diff - 360.
+      IF (diff .LT.-180.) diff = diff + 360.
+      alpha = diff * proj%cone * rad_per_deg * SIGN(1.,proj%truelat1)
+      utrue = vgrid * SIN(alpha) + ugrid * COS(alpha)
+      vtrue = vgrid * COS(alpha) - ugrid * SIN(alpha)
+    ELSEIF ((proj%code .EQ. PROJ_MERC).OR.(proj%code .EQ. PROJ_LATLON))THEN
+      utrue = ugrid
+      vtrue = vgrid
+    ELSE  
+      PRINT '(A)', 'Unrecognized projection.'
+      STOP 'GRIDWIND_TO_TRUEWIND'
+    ENDIF
+
+    RETURN
+  END SUBROUTINE gridwind_to_truewind
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE truewind_to_gridwind(lon, proj, utrue, vtrue, ugrid, vgrid)
+ 
+    ! Subroutine to compute grid-relative u/v wind components from the earth-
+    ! relative values for a given projection.
+
+    IMPLICIT NONE
+    
+    ! Arguments
+    REAL, INTENT(IN)                 :: lon
+    TYPE(proj_info),INTENT(IN)       :: proj 
+    REAL, INTENT(IN)                 :: utrue
+    REAL, INTENT(IN)                 :: vtrue
+    REAL, INTENT(OUT)                :: ugrid
+    REAL, INTENT(OUT)                :: vgrid
+
+    ! Locals
+    REAL                             :: alpha
+    REAL                             :: diff
+
+    IF ((proj%code .EQ. PROJ_PS).OR.(proj%code .EQ. PROJ_LC))THEN
+      
+      diff = proj%stdlon - lon
+      IF (diff .GT. 180.) diff = diff - 360.
+      IF (diff .LT.-180.) diff = diff + 360.
+      alpha = diff * proj%cone * rad_per_deg * SIGN(1.,proj%truelat1)
+      ugrid = vtrue * SIN(alpha) + utrue * COS(alpha)
+      vgrid = vtrue * COS(alpha) - utrue * SIN(alpha)
+
+    ELSEIF((proj%code .EQ. PROJ_MERC).OR.(proj%code .EQ. PROJ_LATLON)) THEN
+      ugrid = utrue
+      vgrid = vtrue
+    ELSE
+      PRINT '(A)', 'Unrecognized map projection.'
+      STOP 'TRUEWIND_TO_GRIDWIND'
+    ENDIF
+    RETURN
+  END SUBROUTINE truewind_to_gridwind
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE compare_projections(proj1, proj2, same_proj)
+  
+    ! Subroutine to compare two proj_info structures to determine if the
+    ! maps are the same.  
+
+    IMPLICIT NONE
+
+    ! Arguments
+    TYPE(proj_info), INTENT(IN)   :: proj1
+    TYPE(proj_info), INTENT(IN)   :: proj2
+    LOGICAL, INTENT(OUT)          :: same_proj
+
+    ! Locals
+   
+    same_proj = .false.
+
+    ! Make sure both structures are initialized
+
+    IF ((.NOT. proj1%init).OR.(.NOT.proj2%init)) THEN
+      PRINT '(A)', 'COMPARE_PROJECTIONS: Map_Set not called yet!'
+      same_proj = .false.
+    ELSE  
+      same_proj = .true.
+    ENDIF
+        
+    ! Check projection type
+    IF (same_proj) THEN
+      IF (proj1%code .NE. proj2%code) THEN
+        PRINT '(A)', 'COMPARE_PROJECTIONS: Different projection type.'
+      ELSE
+        same_proj = .true.
+      ENDIF
+    ENDIF
+
+    ! Check corner lat/lon
+    IF (same_proj) THEN
+      IF ( (ABS(proj1%lat1-proj2%lat1) .GT. 0.001) .OR. &
+           (ABS(proj1%lon1-proj2%lon1) .GT. 0.001) ) THEN
+        PRINT '(A)', 'COMPARE_PROJECTIONS: Different lat1/lon1'
+        same_proj = .false.
+      ENDIF
+    ENDIF
+
+    ! Compare dx
+    IF ((same_proj).AND.(proj1%code .NE. PROJ_LATLON)) THEN
+      IF ( ABS(proj1%dx-proj2%dx).GT.1. ) THEN
+        PRINT '(A)', 'COMPARE_PROJECTIONS: Different dx'
+        same_proj = .false.
+      ENDIF
+    ENDIF
+    ! Compare dimensions
+    IF ((same_proj).AND.( (proj1%nx .NE. proj2%nx).OR. &
+                          (proj1%ny .NE. proj2%ny) ) ) THEN
+      PRINT '(A)', 'COMPARE_PROJECTIONS: Different dimensions'
+      same_proj = .false.
+    ENDIF        
+
+    IF ((same_proj).AND.(proj1%code .EQ. PROJ_LATLON)) THEN
+      IF ( (proj1%dlat .NE. proj2%dlat).OR. &
+           (proj1%dlon .NE. proj2%dlon)) THEN
+        PRINT '(A)', 'COMPARE_PROJECTIONS: Different dlat/dlon'
+        same_proj = .false.
+      ENDIF
+    ENDIF
+
+    ! Compare stdlon for Polar and LC projections
+    IF ( (same_proj).AND. (  (proj1%code .EQ. PROJ_PS).OR. &
+                             (proj1%code .EQ. PROJ_LC) ) ) THEN
+      IF (proj1%stdlon .NE. proj2%stdlon) THEN
+        PRINT '(A)', 'COMPARE_PROJECTIONS: Different stdlon.'
+        same_proj = .false.
+      ENDIF
+    ENDIF
+    ! Compare true latitude1 if polar stereo, mercator, or lambert
+    IF ( (same_proj).AND. ( (proj1%code .EQ. PROJ_PS) .OR. &
+                            (proj1%code .EQ. PROJ_LC) .OR. &
+                            (proj1%code .EQ. PROJ_MERC) ) ) THEN
+      IF (proj1%truelat1 .NE. proj2%truelat1) THEN
+        PRINT '(A)', 'COMPARE_PROJECTIONS: Different truelat1'
+        same_proj = .false.
+      ENDIF
+    ENDIF
+
+    ! Compare true latitude2 if LC
+    IF ( (same_proj).AND.(proj1%code .EQ. PROJ_LC)) THEN
+      IF (proj1%truelat2 .NE. proj2%truelat2) THEN
+        PRINT '(A)', 'COMPARE_PROJECTIONS: Different truelat2'
+        same_proj = .false.
+      ENDIF
+    ENDIF
+
+    RETURN
+  END SUBROUTINE compare_projections
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE compute_msf_lc(lat,truelat1,truelat2,msf)
+  
+    ! Computes the map scale factor for a Lambert Conformal grid at a given
+    ! latitude.
+
+    IMPLICIT NONE
+    REAL, INTENT(IN)            :: lat  ! latitude where msf is requested
+    REAL, INTENT(IN)            :: truelat1
+    REAL, INTENT(IN)            :: truelat2
+    REAL, INTENT(OUT)           :: msf   
+
+    REAL                        :: cone
+    REAL                        :: psi1, psix, pole
+
+    CALL lc_cone(truelat1,truelat2, cone)
+    IF (truelat1 .GE. 0.) THEN
+      psi1 = (90. - truelat1) * rad_per_deg
+      pole =90.
+    ELSE
+      psi1 = (90. + truelat1) * rad_per_deg
+      pole = -90.
+    ENDIF
+    psix = (pole - lat)*rad_per_deg
+    msf = (SIN(psi1)/SIN(psix)) &
+        * ((TAN(psix*0.5)/TAN(psi1*0.5))**cone)
+    RETURN
+  END SUBROUTINE compute_msf_lc
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    SUBROUTINE compute_msf_ps(lat,truelat1,msf)
+
+    ! Computes the map scale factor for a Polar Stereographic grid at a given
+    ! latitude.
+
+    IMPLICIT NONE
+    REAL, INTENT(IN)            :: lat  ! latitude where msf is requested
+    REAL, INTENT(IN)            :: truelat1
+    REAL, INTENT(OUT)           :: msf
+
+    REAL                        :: psi1, psix, pole
+
+    IF (truelat1 .GE. 0.) THEN
+      psi1 = (90. - truelat1) * rad_per_deg
+      pole =90.
+    ELSE
+      psi1 = (90. + truelat1) * rad_per_deg
+      pole = -90.
+    ENDIF
+    psix = (pole - lat)*rad_per_deg
+    msf = ((1.+COS(psi1))/(1.0 + COS(psix)))
+    RETURN
+  END SUBROUTINE compute_msf_ps                                             
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!         
+END MODULE map_utils
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_model_basics.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_model_basics.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_model_basics.f90	(revision 207)
@@ -0,0 +1,46 @@
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+MODULE module_model_basics
+
+   integer                              :: west_east_dim, south_north_dim, bottom_top_dim
+   integer                              :: iprogram
+   character (len=1)                    :: vertical_type
+
+   integer                              :: map_proj
+   real                                 :: dx, dy, cen_lat, moad_cen_lat, cen_lon, stand_lon
+   real                                 :: truelat1, truelat2
+   character (len=128)                  :: title
+
+   real                                 :: PTOP
+   real, allocatable, dimension(:)      :: ZNU, ZNW
+   real, allocatable, dimension(:,:)    :: XLAT, XLONG, HGT
+   real, allocatable, dimension(:,:)    :: U10, V10
+   real, allocatable, dimension(:,:)    :: PSFC
+   real, allocatable, dimension(:,:)    :: MU, MUB
+   real, allocatable, dimension(:,:,:)  :: P, PB, PH, PHB, PRES  !! PRES is pressure in Pa
+   real, allocatable, dimension(:,:,:)  :: UUU, VVV, T, TK       !! TK is temp in K, T is theta-300
+   real, allocatable, dimension(:,:,:)  :: QV, QR, QS, QG
+
+   logical                              :: have_PTOP
+   logical                              :: have_ZNU, have_ZNW
+   logical                              :: have_XLAT, have_XLONG, have_HGT
+   logical                              :: have_U10, have_V10
+   logical                              :: have_PSFC
+   logical                              :: have_MU, have_MUB
+   logical                              :: have_P, have_PB, have_PH, have_PHB, have_PRES
+   logical                              :: have_UUU, have_VVV, have_T, have_TK
+   logical                              :: have_QV, have_QR, have_QS, have_QG
+
+   CONTAINS
+
+   FUNCTION virtual (tmp,rmix)
+!      This function returns virtual temperature in K, given temperature
+!      in K and mixing ratio in kg/kg.
+ 
+     real                              :: tmp, rmix, virtual
+ 
+     virtual=tmp*(0.622+rmix)/(0.622*(1.+rmix))
+
+   END FUNCTION virtual
+
+
+END MODULE module_model_basics
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_pressure.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_pressure.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_pressure.f90	(revision 207)
@@ -0,0 +1,69 @@
+!! Calculate pressure (Pa) from MU and MUB (wrfinput data)
+
+MODULE module_pressure
+
+  CONTAINS
+  SUBROUTINE pressure(prs) 
+
+  USE module_model_basics
+
+  !Arguments
+  real, pointer, dimension(:,:,:)       :: prs
+  real, dimension(bottom_top_dim)       :: rdnw, rdn
+  real                                  :: dnw, dn
+  real                                  :: qvf1, qvf2
+  real                                  :: p_base
+  integer                               :: i, j, k
+   
+
+  ALLOCATE(prs(west_east_dim,south_north_dim,bottom_top_dim))
+
+
+
+     DO k = 1, bottom_top_dim
+        dnw=(ZNW(k+1) - ZNW(k))
+        rdnw(k) = 1./dnw
+     END DO
+     DO k = 1, bottom_top_dim
+        dn=.5 * ( 1./rdnw(k+1) + 1./rdnw(k))
+        rdn(k)=1./dn
+     END DO
+
+
+
+     DO j = 1, south_north_dim
+     DO i = 1, west_east_dim
+
+!      Get pressure perturbation at model top
+       k = bottom_top_dim  
+       qvf1 = QV(i,j,k) * .001
+       qvf2 = 1. / (1.+qvf1)
+       qvf1 = qvf1 * qvf2
+       prs(i,j,k) = - 0.5 * ( MU(i,j) + qvf1*MUB(i,j) ) / rdnw(k) / qvf2
+
+
+
+
+!      Now get pressure perturbation at levels below
+       DO k = 1, bottom_top_dim-1
+          qvf1 = 0.5 * (QV(i,j,k)+QV(i,j,k+1)) * .001
+          qvf2 = 1. / (1.+qvf1)
+          qvf1 = qvf1 * qvf2
+          prs(i,j,k) = prs(i,j,k+1) - ( MU(i,j) + qvf1*MUB(i,j) ) / qvf2 / rdn(k)
+       END DO
+
+
+!      Finally compute base state pressure and add to pressure perturbation
+!      to get total pressure
+       DO k = 1, bottom_top_dim
+          p_base = ZNU(k) * MUB(i,j) + PTOP
+          prs(i,j,k) =  prs(i,j,k) + p_base     ! Pa 
+       END DO
+
+     END DO
+     END DO
+
+
+  END SUBROUTINE pressure
+
+END MODULE module_pressure
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_pressure.f90_orig
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_pressure.f90_orig	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/module_pressure.f90_orig	(revision 207)
@@ -0,0 +1,70 @@
+!! Calculate pressure (Pa) from MU and MUB (wrfinput data)
+
+MODULE module_pressure
+
+  CONTAINS
+  SUBROUTINE pressure(prs) 
+
+  USE module_model_basics
+
+  !Arguments
+  real, pointer, dimension(:,:,:)       :: prs
+  real, dimension(bottom_top_dim)       :: rdnw, rdn
+  real                                  :: dnw, dn
+  real                                  :: qvf1, qvf2
+  real                                  :: p_base
+  integer                               :: i, j, k
+   
+
+  NULLIFY (prs)
+  ALLOCATE(prs(west_east_dim,south_north_dim,bottom_top_dim))
+
+
+
+     DO k = 1 , bottom_top_dim
+        dnw=(ZNW(k+1) - ZNW(k))
+        rdnw(k) = 1./dnw
+     END DO
+     DO k = 1 , bottom_top_dim
+        dn=.5 * ( 1./rdnw(k+1) + 1./rdnw(k))
+        rdn(k)=1./dn
+     END DO
+
+
+
+     DO j = 1 , south_north_dim
+     DO i = 1 , west_east_dim
+
+!      Get pressure perturbation at model top
+       k = bottom_top_dim  
+       qvf1 = QV(i,j,k) * .001
+       qvf2 = 1. / (1.+qvf1)
+       qvf1 = qvf1 * qvf2
+       prs(i,j,k) = - 0.5 * ( MU(i,j) + qvf1*MUB(i,j) ) / rdnw(k) / qvf2
+
+
+
+
+!      Now get pressure perturbation at levels below
+       DO k = 1 , bottom_top_dim-1
+          qvf1 = 0.5 * (QV(i,j,k)+QV(i,j,k+1)) * .001
+          qvf2 = 1. / (1.+qvf1)
+          qvf1 = qvf1 * qvf2
+          prs(i,j,k) = prs(i,j,k+1) - ( MU(i,j) + qvf1*MUB(i,j) ) / qvf2 / rdn(k)
+       END DO
+
+
+!      Finally compute base state pressure and add to pressure perturbation
+!      to get total pressure
+       DO k = 1 , bottom_top_dim
+          p_base = ZNU(k) * MUB(i,j) + PTOP
+          prs(i,j,k) =  prs(i,j,k) + p_base     ! Pa 
+       END DO
+
+     END DO
+     END DO
+
+
+  END SUBROUTINE pressure
+
+END MODULE module_pressure
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/output_module.F90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/output_module.F90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/output_module.F90	(revision 207)
@@ -0,0 +1,552 @@
+MODULE output_module
+   
+   USE input_module
+   USE module_model_basics
+   USE module_arrays
+   
+   integer                             :: time, rec, ivars   !!! process time ; rec in .dat file ; variables in .dat file
+   integer                             :: cunit, dunit       !!! .ctl and .dat output files
+   character (len=128)                 :: ctlfile, datfile, v5dfile
+   character (len=200), dimension(200) :: ctl_var_string     !!! List of fields foe .ctl file
+   character (len=2000)                :: could_not_find     !!! Keep list of what we wrote out
+   character (len=19)                  :: tdef_date          !!! Output start date
+   character (len=40)                  :: tdef               !!! tdef string in .ctl file
+   character (len=10), dimension(100)  :: varnames 
+   integer                             :: numvars
+
+   CONTAINS
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: create_ctl     
+   ! Purpose: Create the .ctl file                  
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE create_ctl ()
+
+      IMPLICIT NONE
+  
+      ! Local variables
+      real, dimension(4)               :: xlat_a, xlon_a
+      real                             :: dxll, slack, temp
+      real                             :: abslatmin, abslonmax, abslonmin, abslatmax
+      integer                          :: i, k, ipoints, jpoints, ilon 
+      integer                          :: ipole
+      real                             :: xi, r, re, xj, dx_ps, earthr, radpd
+      real                             :: rlat, rlong, ref_lon, ref_lat
+      integer                          :: file_start, file_end
+      integer                          :: we_dim, sn_dim
+
+
+      
+      file_start = INDEX(datfile,"/",BACK=.TRUE.)
+      file_end   = len_trim(datfile)
+      write(cunit,'("dset ^",A)') datfile(file_start+1:file_end)
+#ifdef bytesw
+   write (cunit, '("options byteswapped")')
+#endif
+      write(cunit, '("undef 1.e37")')
+
+      IF ( output_title /= '   ') THEN
+        write(cunit,'("title ",A)') trim(output_title)
+      ELSE
+        write(cunit,'("title ",A)') trim(title)
+      END IF
+
+      IF (map_proj == 1) THEN                                     !! Lambert Projection
+
+
+!!!!!!!
+!!!!!!! TEMP
+!!!!!!!
+IF ( mercator_defs ) THEN
+   WRITE(cunit,'("xdef ",i4," levels ")') west_east_dim
+     DO i = 1,west_east_dim
+        WRITE(cunit,*) XLONG(i,int(west_east_dim/2))
+     ENDDO
+   WRITE(cunit,'("ydef ",i4," levels ")') south_north_dim
+     DO i = 1,south_north_dim
+        WRITE(cunit,*) XLAT(int(south_north_dim/2),i)
+     END DO
+ELSE
+
+        ! Make sure truelat1 is the larger number
+         IF (truelat1 < truelat2) THEN
+            temp = truelat1
+            truelat1 = truelat2
+            truelat2 = temp
+         END IF
+
+         !!WRITE(cunit,'("pdef ",i4," ",i3," lcc ",f9.5," ",f10.5," ", &   !! rounding off
+         WRITE(cunit,'("pdef ",i4," ",i3," lcc ",f7.3," ",f8.3," ", &    
+&             f8.3," ",f8.3," ",f9.5," ",f9.5," ",f10.5," ",         &
+&             f10.3," ",f10.3)')                                       &
+              west_east_dim,south_north_dim,cen_lat,cen_lon,         &
+              (west_east_dim+1)/2.,(south_north_dim+1)/2.,           &
+              truelat1,truelat2,stand_lon,dx,dy
+
+
+         xlon_a(1) = XLONG(1,1)
+         xlon_a(2) = XLONG(1,south_north_dim)
+         xlon_a(3) = XLONG(west_east_dim,1)
+         xlon_a(4) = XLONG(west_east_dim,south_north_dim)
+
+         !check for dateline
+         ilon = 0
+         if ( abs(xlon_a(1) - xlon_a(3)) .GT. 180. ) ilon = 1
+         if ( abs(xlon_a(2) - xlon_a(4)) .GT. 180. ) ilon = 1
+
+         abslatmin = minval(XLAT)
+         abslatmax = maxval(XLAT)
+         abslonmin =  99999.
+         abslonmax = -99999.
+         DO i=1,4
+           IF ( xlon_a(i) .lt. 0.0 .AND. ilon .eq. 1 ) THEN
+             abslonmin=min(abslonmin,360.+xlon_a(i))
+             abslonmax=max(abslonmax,360.+xlon_a(i))
+           ELSE
+             abslonmin=min(abslonmin,xlon_a(i))
+             abslonmax=max(abslonmax,xlon_a(i))
+           ENDIF
+         END DO
+
+!         dxll = (dx/1000.)/111./2.
+         dxll = (dx/1000.)/59./2.
+         slack = ((dx/1000.)*3.)/100.
+         ipoints = int(((abslonmax-abslonmin)+(3*slack))/dxll)
+         jpoints = int(((abslatmax-abslatmin)+(3*slack))/dxll)
+
+         WRITE(cunit,'("xdef ",i4," linear ",f10.5," ",f12.8)') ipoints, &
+                      (abslonmin-1.5*slack),dxll
+         WRITE(cunit,'("ydef ",i4," linear ",f10.5," ",f12.8)') jpoints, &
+                      (abslatmin-1.5*slack),dxll
+
+!!!!!!!!!!!!!
+!!!!!!!!!!!!! TEMP
+!!!!!!!!!!!!!
+ENDIF
+
+
+      ENDIF
+
+      IF (map_proj == 2) THEN                                     !! Polar Stereo Projection
+
+         ipole = 1
+         IF (truelat1 .lt. 0.0) ipole = -1
+         radpd  = .01745329
+!         earthr = 6.3712E6
+	 earthr = 3.3972E6
+
+         dx_ps = dx/( (1.0+sin(ipole*TRUELAT1*radpd))/(1.0+sin(60*radpd)) ) !! true dx (meter) at 60degrees
+         re    = ( earthr * (1.0 + sin(60*radpd)) ) / dx_ps          !! 
+
+
+         IF ( ipole == 1 ) THEN
+           rlong  = (XLONG(1,1) - stand_lon) * radpd
+           rlat   = XLAT(1,1) * radpd
+
+           r    =  (re * cos(rlat)) / (1.0 + sin(rlat))
+           xi   =  (1. - r * sin(rlong))
+           xj   =  (1. + r * cos(rlong))
+           
+           write(cunit,'("pdef ",i3," ",i3," nps ",f8.3," ",f8.3," ", &
+&                f12.4," ",f12.7)') west_east_dim, south_north_dim,   &
+                 xi, xj, stand_lon, dx_ps*0.001
+
+         ELSE IF ( ipole == -1 ) THEN
+           rlong  = (180.0 + XLONG(1,1) - stand_lon) * radpd
+           rlat   = ipole*XLAT(1,1) * radpd
+
+           r    =  (re * cos(rlat)) / (1.0 + sin(rlat))
+           xi   =  (1. - ipole * r * sin(rlong))
+           xj   =  (1. + r * cos(rlong))
+
+           write(cunit,'("pdef ",i3," ",i3," sps ",f8.3," ",f8.3," ", &
+&                f12.4," ",f12.7)') west_east_dim, south_north_dim,   &
+                 xi, xj, (180+stand_lon), -0.001*dx_ps
+         END IF
+
+
+         abslonmin = minval(XLONG)
+         abslonmax = maxval(XLONG)
+         abslatmin = minval(XLAT)
+         abslatmax = maxval(XLAT)
+   
+!!         dxll = (dx_ps/1000.)/111./2.
+         dxll = (dx_ps/1000.)/59./2.
+         ipoints = int(((abslonmax-abslonmin)+2.)/dxll)-2
+         jpoints = int(((abslatmax-abslatmin)+2.)/dxll)-3
+
+         ref_lon = abslonmin-1.
+         IF ( abslonmax .ge. 175. .AND. abslonmax .le. 180.) THEN
+           IF ( abslonmin .ge. -180. .AND. abslonmin .le. -175.) THEN
+             ref_lon = 0.0
+           END IF
+         END IF
+
+         ref_lat = abslatmin-1.
+         !!IF ( ipole == -1 ) ref_lat = abslatmax+1.
+         IF ( ipole == -1 ) ref_lat = abslatmin
+   
+         WRITE(cunit,'("xdef ",i4," linear ",f6.1," ",f12.8)') ipoints, &
+                      ref_lon,dxll
+         WRITE(cunit,'("ydef ",i4," linear ",f6.1," ",f12.8)') jpoints, &
+                      ref_lat,dxll
+
+      ENDIF
+
+      IF (map_proj == 3) THEN                         !! Mercator Projection
+   
+          !check for dateline
+          ilon = 0
+          IF ( abs(XLONG(1,1) - XLONG(west_east_dim,1)) .GT. 180. ) ilon = 1
+          IF ( abs(XLONG(1,south_north_dim) - XLONG(west_east_dim,south_north_dim)) .GT. 180. ) ilon = 1
+   
+          IF ( mercator_defs .AND. map_proj == 3 ) THEN
+            WRITE(cunit,'("xdef ",i4," levels ")') west_east_dim
+            DO i = 1,west_east_dim
+              WRITE(cunit,*) XLONG(i,1)
+              !!IF ( XLONG(i,1) .lt. 0.0 ) THEN
+                !!WRITE(cunit,*) XLONG(i,1) + 180.0
+              !!ELSE
+                !!WRITE(cunit,*) XLONG(i,1)
+              !!END IF
+            END DO
+          ELSE
+            IF ( ilon == 1 ) THEN
+              WRITE(cunit,'("xdef ",i4," linear ",f9.4," ",f8.4)')   &
+                    west_east_dim,XLONG(1,1), &
+                    (abs(XLONG(1,1)-(360.+XLONG(west_east_dim,south_north_dim)))/(west_east_dim-1))
+            ELSE
+              WRITE(cunit,'("xdef ",i4," linear ",f9.4," ",f8.4)')   &
+                    west_east_dim,XLONG(1,1), &
+                    (abs(XLONG(1,1)-XLONG(west_east_dim,south_north_dim))/(west_east_dim-1))
+            ENDIF
+          ENDIF
+
+          IF ( mercator_defs .AND. map_proj == 3 ) THEN
+             WRITE(cunit,'("ydef ",i4," levels ")') south_north_dim
+             DO i = 1,south_north_dim
+               WRITE(cunit,*) XLAT(1,i)
+             END DO
+          ELSE
+             WRITE(cunit,'("ydef ",i4," linear ",f9.4," ",f8.4)')   &
+                       south_north_dim,XLAT(1,1),(abs(XLAT(1,1)-XLAT(west_east_dim,south_north_dim))/(south_north_dim-1))
+          ENDIF
+
+      ENDIF
+
+
+      IF (map_proj == 0) THEN                         !! Ideal
+        we_dim = west_east_dim
+        sn_dim = south_north_dim
+        IF (we_dim == 2) we_dim = 1
+        IF (sn_dim == 2) sn_dim = 1
+        write (cunit, '("xdef  ",i4, " linear 0 0.0001")') we_dim
+        write (cunit, '("ydef  ",i4, " linear 0 0.0001")') sn_dim
+      ENDIF
+      !! END of projection specific section
+
+      IF (iprogram .ge. 6 .and. (vertical_type=='p'.or.vertical_type=='z')) THEN
+        WRITE(cunit,'("zdef  ",i3, " levels  ")') number_of_zlevs
+        DO k = 1,number_of_zlevs
+           WRITE(cunit,'(f10.5)') interp_levels(k)
+        END DO
+      ELSE
+        WRITE(cunit,'("zdef ",i4," linear 1 1  ")') bottom_top_dim
+      ENDIF
+
+       IF (tdef_date == '0000-00-00_00:00:00') THEN
+         tdef = '   1 linear 00z01jan2000  1hr'
+       ELSE
+         IF ( output_type == 'grads' ) THEN
+                CALL tdef_calc_grads () 
+         ELSE 
+                CALL tdef_calc ()
+         ENDIF
+       END IF
+       WRITE(cunit,'("tdef ",A)') tdef
+
+       WRITE(cunit,'("VARS  ",i3)') ivars
+       DO i = 1,ivars
+          WRITE(cunit,'(A)') trim(ctl_var_string(i))
+       ENDDO
+       WRITE(cunit,'("ENDVARS")')
+       
+       DO i=1,iatts
+         WRITE(cunit,'(A)') trim(catts(i))
+       ENDDO
+
+
+   END SUBROUTINE create_ctl
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: tdef_calc      
+   ! Purpose: Make the tdef line for the .ctl file
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE tdef_calc ()
+
+     IMPLICIT NONE
+
+     character (len=3)              :: cmonth
+     integer                        :: year,month,day,hour
+  
+     tdef = '                               '
+  
+     !! Time comes in as YYYY-MM-DD_HH:MM:SS
+     !!                  1234 67 90 23 45 89
+     READ(tdef_date(1:4),*)   year
+     READ(tdef_date(6:7),*)   month
+     READ(tdef_date(9:10),*)  day
+     READ(tdef_date(12:13),*) hour
+
+    IF (month == 1) cmonth = 'M1'
+    IF (month == 2) cmonth = 'M2'
+    IF (month == 3) cmonth = 'M3'
+    IF (month == 4) cmonth = 'M4'
+    IF (month == 5) cmonth = 'M5'
+    IF (month == 6) cmonth = 'M6'
+    IF (month == 7) cmonth = 'M7'
+    IF (month == 8) cmonth = 'M8'
+    IF (month == 9) cmonth = 'M9'
+    IF (month ==10) cmonth = 'M10'
+    IF (month ==11) cmonth = 'M11'
+    IF (month ==12) cmonth = 'M12'
+
+    IF ( year < 100 ) year = 2000
+
+    WRITE (tdef,'(i4," linear ",i2.2,"Z",i2.2,A,i4,"  ",i6,"MN")') time, hour, day, cmonth, year, interval_seconds
+
+   END SUBROUTINE tdef_calc
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: tdef_calc_grads      
+   ! Purpose: Make the tdef line for the .ctl file
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE tdef_calc_grads ()
+
+     IMPLICIT NONE
+
+     character (len=3)              :: cmonth
+     integer                        :: year,month,day,hour
+
+     tdef = '                               '
+
+     !! Time comes in as YYYY-MM-DD_HH:MM:SS
+     !!                  1234 67 90 23 45 89
+     READ(tdef_date(1:4),*)   year
+     READ(tdef_date(6:7),*)   month
+     READ(tdef_date(9:10),*)  day
+     READ(tdef_date(12:13),*) hour
+
+    IF (month == 1) cmonth = 'jan'
+    IF (month == 2) cmonth = 'fev'
+    IF (month == 3) cmonth = 'mar'
+    IF (month == 4) cmonth = 'avr'
+    IF (month == 5) cmonth = 'may'
+    IF (month == 6) cmonth = 'jun'
+    IF (month == 7) cmonth = 'jul'
+    IF (month == 8) cmonth = 'aug'
+    IF (month == 9) cmonth = 'sep'
+    IF (month ==10) cmonth = 'oct'
+    IF (month ==11) cmonth = 'nov'
+    IF (month ==12) cmonth = 'dec'
+
+    IF ( year < 100 ) year = 2000
+
+    WRITE (tdef,'(i4," linear ",i2.2,"Z",i2.2,A,i4,"  ",i6,"MN")') time, hour, day, cmonth, year, interval_seconds
+
+   END SUBROUTINE tdef_calc_grads
+
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: write_dat
+   ! Purpose: Write the data to the .dat file. Also keep record of what has been
+   !          written for creation of the .ctl file
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE write_dat (data_out, nx, ny, nz, cname, cdesc, cunits)
+
+      IMPLICIT NONE
+
+      ! ------ some vis5d stuff, contain MAXVARS,MAXTIMES,MAXROWS,MAXCOLUMNS,MAXLEVELS
+      include 'v5df.h'
+
+      ! Arguments
+      integer                        :: nx, ny, nz
+      real, dimension(nx,ny,nz)      :: data_out
+      character (len=128)            :: cname, cunits, cdesc
+
+      ! Local variables
+      integer                        :: ii, jj, kk
+      integer                        :: is_there, ret, ivar
+      character (len=20)             :: dummy
+      real, dimension(ny,nx,nz)      :: v5d_data_out
+
+
+!     IF ( output_type == 'ncdf' ) THEN   !!! Create the netcdf file
+!        IF ( nx == 2 ) nx = 1
+!        IF ( ny == 2 ) ny = 1
+!        !DO kk=1,nz
+!        !  rec = rec + 1
+!        !  WRITE(dunit,rec=rec) ((data_out(ii,jj,kk),ii=1,nx),jj=1,ny)
+!        !END DO
+!        CALL writencdf(unite nx,ny,nz,"u","W.m-2",3,data_out)
+!     END IF
+
+
+
+      IF ( output_type == 'grads' ) THEN   !!! Create the grads file
+        IF ( nx == 2 ) nx = 1
+        IF ( ny == 2 ) ny = 1
+        DO kk=1,nz
+          rec = rec + 1
+          WRITE(dunit,rec=rec) ((data_out(ii,jj,kk),ii=1,nx),jj=1,ny)
+        END DO
+      END IF
+
+!!!!****MARS IDL
+      IF ( output_type == 'idl' ) THEN   !!! Create the IDL ascii file
+        IF ( nx == 2 ) nx = 1
+        IF ( ny == 2 ) ny = 1
+        DO kk=1,nz 
+          rec = rec + 1
+!!!****MARS
+!          WRITE(dunit,rec=rec) ((data_out(ii,jj,kk),ii=1,nx),jj=1,ny)
+          WRITE(dunit,FMT='(F20.8)') ((data_out(ii,jj,kk),ii=1,nx),jj=1,ny)
+        END DO
+      END IF
+
+
+
+#ifdef V5D
+      IF ( output_type == 'v5d' ) THEN   !!! Create the vis5d file
+        DO kk = 1,nz
+        DO jj = 1,nx
+        DO ii = 1,ny
+          v5d_data_out(ii,jj,kk) = data_out(jj,ny-ii+1,kk)
+        END DO
+        END DO
+        END DO
+
+
+        ivar = 0
+        DO ii = 1,numvars
+          IF ( trim(varnames(ii)) == trim(cname) ) THEN 
+            ivar = ii
+          END IF
+        END DO 
+        ret = v5dwrite ( time+1, ivar, v5d_data_out )
+      END IF
+#endif
+
+
+      IF (time == 0) THEN
+        IF ( cname(1:3) == 'clf' ) then
+          dummy = ",clfr,"
+        ELSE
+          dummy = ","//trim(cname)//","
+        END IF
+        is_there = INDEX(could_not_find,trim(dummy))
+        DO WHILE ( is_there /= 0 )
+          could_not_find = could_not_find(1:is_there)//could_not_find(is_there+len_trim(dummy):len_trim(could_not_find))
+          is_there = INDEX(could_not_find,trim(dummy))
+        END DO
+        ivars = ivars + 1
+        WRITE(ctl_var_string(ivars),'(A,"  ",i4,"  0  ",A," (",A,")")') cname(1:10),nz,trim(cdesc),trim(cunits)
+      ENDIF
+
+
+   END SUBROUTINE write_dat
+
+!   SUBROUTINE writencdf(unite,nx,ny,nz,"u","W.m-2",3,data_out)
+!
+!
+!        ! NETCDF file
+!        fichnom="diagfi.nc"
+!        if (firstnom.eq.'1234567890') then
+!        firstnom = nom
+!        ierr = NF_CREATE  (fichnom, NF_CLOBBER, nid)
+!        ! Build dimensions
+!        ierr = NF_DEF_DIM (nid, "Time",      NF_UNLIMITED, idim)
+!        ierr = NF_DEF_DIM (nid, "latitude",  ny,           idim_lat)
+!        ierr = NF_DEF_DIM (nid, "longitude", nx,           idim_lon)
+!        ierr = NF_DEF_DIM (nid, "altitude",  nz,           idim_alt)
+!        ! Write dimensions attributes
+!        ierr = NF_DEF_VAR (nid, "Time", NF_FLOAT, 1, idim, varid)
+!        ierr = NF_PUT_ATT_TEXT (nid, varid, "long_name",  4, "Time")
+!        ierr = NF_PUT_ATT_TEXT (nid, varid, 'units',     29, "Time")
+!        ierr = NF_ENDDEF(nid)
+!        !
+!        ierr = NF_DEF_VAR (nid, "latitude",  NF_FLOAT,  1, idim_lat, varid)
+!        ierr = NF_PUT_ATT_TEXT (nid, varid, 'units',     13, "degrees_north")
+!        ierr = NF_PUT_ATT_TEXT (nid, varid, "long_name", 14, "North latitude")
+!        ierr = NF_ENDDEF(nid)
+!        ierr = NF_DEF_VAR (nid, "longitude", NF_FLOAT,  1, idim_lon, varid)
+!        ierr = NF_PUT_ATT_TEXT (nid, varid, 'units',     12, "degrees_east")
+!        ierr = NF_PUT_ATT_TEXT (nid, varid, "long_name", 14, "East longitude")
+!        ierr = NF_ENDDEF(nid)
+!        ierr = NF_DEF_VAR (nid, "altitude",  NF_FLOAT,  1, idim_alt, varid)
+!        ierr = NF_PUT_ATT_TEXT (nid, varid, 'units',      2, "km")
+!        ierr = NF_PUT_ATT_TEXT (nid, varid, "long_name", 10, "pseudo-alt")
+!        ierr = NF_PUT_ATT_TEXT (nid, varid, 'positive',   2, "up")
+!        ierr = NF_ENDDEF(nid)
+!        else
+!        ierr = NF_OPEN(fichnom,NF_WRITE,nid)
+!        endif
+!        ! Advance time
+!        ierr = NF_INQ_VARID (nid, "Time", varid)
+!        ierr = NF_PUT_VARA_REAL (nid, varid, ntime, 1, date)
+!        ! Write field
+!        ierr = NF_INQ_VARID(nid,nom,varid)
+!        if (ierr /= NF_NOERR) then
+!        ! Create variable if does not exist
+!        ierr = NF_INQ_DIMID(nid,"longitude",id(1))
+!        ierr = NF_INQ_DIMID(nid,"latitude",id(2))
+!        ierr = NF_INQ_DIMID(nid,"altitude",id(3))
+!        ierr = NF_INQ_DIMID(nid,"Time",id(4))
+!        write (*,*) "====================================="
+!        write (*,*) "NETCDF: create ",nom
+!        call def_var (nid,nom,titre,unite,4,id,varid,ierr)
+!        endif
+!   END SUBROUTINE writencdf
+
+
+!!==================================================================================
+!!==================================================================================
+!
+!subroutine def_var(nid,name,title,units,nbdim,dim,nvarid,ierr)
+!
+!implicit none
+!
+!include "netcdf.inc"
+!
+!character (len=*) :: title,units,name
+!integer :: nid,nbdim,nvarid,ierr
+!integer, dimension(nbdim) :: dim
+!
+!ierr=NF_REDEF(nid)
+!#ifdef NC_DOUBLE
+!ierr = NF_DEF_VAR (nid,adjustl(name),NF_DOUBLE,nbdim,dim,nvarid)
+!#else
+!ierr = NF_DEF_VAR (nid,adjustl(name),NF_FLOAT,nbdim,dim,nvarid)
+!#endif
+!if(ierr/=NF_NOERR) then
+!   write(*,*) NF_STRERROR(ierr)
+!   stop "in def_var"
+!endif
+!ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title",
+!len_trim(adjustl(title)),adjustl(title))
+!if(ierr/=NF_NOERR) then
+!   write(*,*) NF_STRERROR(ierr)
+!   stop "in def_var"
+!endif
+!ierr = NF_PUT_ATT_TEXT (nid, nvarid, "units",
+!len_trim(adjustl(units)),adjustl(units))
+!if(ierr/=NF_NOERR) then
+!   write(*,*) NF_STRERROR(ierr)
+!   stop "in def_var"
+!endif
+!ierr = NF_ENDDEF(nid)
+!
+!end subroutine def_var
+
+
+END MODULE output_module
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/process_domain_module.F90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/process_domain_module.F90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/process_domain_module.F90	(revision 207)
@@ -0,0 +1,804 @@
+MODULE process_domain_module
+   
+   USE input_module
+   USE output_module
+   USE module_model_basics
+   USE module_arrays
+   
+   integer                             :: next_file
+   logical                             :: run_out_of_files
+   logical                             :: file_is_open
+   integer                             :: vertical       !!! needed for v5dcreation
+ 
+
+   CONTAINS
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: process_domain
+   ! Purpose: Process the input data
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE process_domain ()
+   
+      USE date_pack
+      USE gridinfo_module
+      USE misc_definitions_module
+      USE module_debug
+      USE v5d_module
+   
+      IMPLICIT NONE
+
+      ! ------ some vis5d stuff, contain MAXVARS,MAXTIMES,MAXROWS,MAXCOLUMNS,MAXLEVELS
+      include 'v5df.h'
+   
+      ! Local variables
+      integer                                :: idiff, n_times, i
+      character (len=19)                     :: valid_date, temp_date, datestr
+      character (len=128)                    :: cname, stagger, cunits, cdesc
+      integer                                :: istatus, reclength
+      integer                                :: ret                         !!! v5d stuff
+      integer, dimension(MAXLEVELS)          :: v5d_nl
+      real, dimension(MAXLEVELS)             :: v5d_levels
+      integer, dimension(MAXTIMES)           :: timestamp, datestamp
+      integer                                :: projection
+      real, dimension(100)                   :: proj_args
+   
+
+      ! Compute number of times that we will process
+      CALL geth_idts(end_date, start_date, idiff)
+      CALL mprintf((idiff < 0),ERROR,'Ending date is earlier than starting date in namelist.')
+   
+   
+      ! Check that the interval evenly divides the range of times to process
+      n_times = idiff / interval_seconds
+      CALL mprintf((mod(idiff, interval_seconds) /= 0),WARN, &
+                   'In namelist, interval_seconds does not evenly divide '// &
+                   '(end_date - start_date). Only %i time periods '// &
+                   'will be processed.', i2=n_times)
+   
+      ! 
+      ! DO TIME_INDEPENDANT PROCESSING
+      ! 
+
+      ! Initialize the input module to read input data
+      CALL input_init(1, istatus)
+      CALL mprintf((istatus /= 0),ERROR, 'input_init(): Error opening input.')
+   
+      ! Read global attributes from the input file 
+      CALL read_global_attrs ()
+      IF ( iprogram .le. 1 ) n_times = 0
+
+
+!      IF ( output_type == 'grads' ) THEN    !!! We are making grads type files
+      IF (( output_type == 'grads' ) .OR. ( output_type == 'idl' )) THEN    !!! We are making grads type files
+
+
+        ! Open .dat and .ctl files
+        DO cunit=10,100
+          INQUIRE(unit=cunit, opened=is_used)
+          if (.not. is_used) exit
+        END DO
+        ctlfile = trim(output_root_name)//'.ctl'
+        OPEN(cunit,file=ctlfile)
+
+        DO dunit=10,100
+          INQUIRE(unit=dunit, opened=is_used)
+          IF (.not. is_used) EXIT
+        END DO
+
+        IF      ( west_east_dim .gt. 2 .AND. south_north_dim .gt. 2 ) THEN
+          reclength = (west_east_dim)*(south_north_dim)
+        ELSE IF ( west_east_dim .gt. 2 .AND. south_north_dim .eq. 2 ) THEN
+          reclength = west_east_dim
+        ELSE IF ( west_east_dim .eq. 2 .AND. south_north_dim .gt. 2 ) THEN
+          reclength = south_north_dim
+        ELSE IF ( west_east_dim .eq. 2 .AND. south_north_dim .eq. 2 ) THEN
+          reclength = 1
+        END IF
+#ifdef RECL4
+        reclength = reclength*4
+#endif
+        datfile = trim(output_root_name)//'.dat'
+!!!****MARS
+!        OPEN(dunit,file=datfile,form='unformatted',access="direct", recl=reclength)
+        IF ( output_type == 'idl' ) OPEN(dunit,file=datfile)
+        IF ( output_type == 'grads' ) OPEN(dunit,file=datfile,form='unformatted',access="direct", recl=reclength)
+
+      ELSE IF ( output_type == 'v5d' ) THEN    !!! We are making grads type files
+
+        v5dfile = trim(output_root_name)//'.v5d'
+  
+      END IF
+
+
+      CALL arw_get_next_time(handle, datestr, istatus)
+
+!!!
+!!! MARS: au cas ou il n y a pas le geop init pour calculer les hauteurs
+!!!
+!!CALL arw_get_next_time(handle, datestr, istatus)
+
+
+
+      vertical = 0      !!! needed for v5d creation (equally spaced levels in generic units)
+      ! If interp_method /= 0, then we need to know if this can be done, for now only doing it for wrfout data
+      IF ( iprogram .ge. 6 .AND. interp_method /= 0 ) THEN
+         CALL get_interp_info (datestr)
+      ELSE
+        vertical_type = 'n'   !! In case user set this for other programs
+        number_of_zlevs = bottom_top_dim
+      END IF
+
+
+
+#ifdef V5D
+      IF ( output_type == 'v5d' ) THEN   !!! Create the vis5d file
+        v5d_nl = IMISSING
+        CALL v5d_varnames (v5d_nl)
+        CALL v5d_times (n_times+1, timestamp, datestamp)
+        CALL v5d_proj (datestr, projection, proj_args)
+        v5d_levels = MISSING
+        IF (vertical == 0 ) THEN
+          v5d_levels(1) = 0.0   !!! Same basics set up for sigma level data
+          v5d_levels(2) = 1.0
+        ELSE
+          DO i=1,number_of_zlevs
+            v5d_levels(i) = interp_levels(i)
+          END DO
+        END IF
+        ret = v5dCreate( v5dfile, n_times+1, numvars,                     &
+                         !!west_east_dim, south_north_dim, v5d_nl,        &
+                         south_north_dim, west_east_dim, v5d_nl,        &
+                         varnames, timestamp, datestamp, 1, projection, & 
+                         proj_args, vertical, v5d_levels )
+        IF ( ret == 0 ) THEN 
+          CALL mprintf(.true.,ERROR, 'v5dCreate')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   ')
+          CALL mprintf(.true.,STDOUT, '   SUCCESS: v5d file has been Created')
+        END IF
+
+      END IF 
+#endif
+
+      CALL input_close()       !!! Will be opened again by next process if needed
+
+      !
+      ! BEGIN TIME-DEPENDANT PROCESSING
+        next_file = 1
+        ivars     = 0
+      
+      ! Loop over all times to be processed
+      could_not_find = plot_these_fields      !!! Keep a list of requested fields
+      run_out_of_files = .FALSE.
+      file_is_open = .FALSE.
+      rec = 0
+      all_files : DO time=0,n_times
+   
+         IF ( iprogram == 1 ) then
+           temp_date = "0000-00-00_00:00:00" 
+         ELSE 
+           CALL geth_newdate(valid_date, trim(start_date), time*interval_seconds)
+           temp_date = ' '
+           write(temp_date,'(a19)') valid_date(1:10)//'_'//valid_date(12:19)
+         ENDIF
+         IF ( time == 0 ) tdef_date = temp_date
+   
+         CALL get_fields(temp_date)
+   
+         IF (run_out_of_files) EXIT all_files
+   
+      ENDDO all_files  ! Loop over n_times
+
+      CALL mprintf(.true.,STDOUT, ' ')
+      CALL mprintf(.true.,STDOUT, 'DONE Processing Data')
+
+      IF (( output_type == 'grads' ) .or. ( output_type == 'idl' )) THEN    !!! We are making grads type files
+        ! Create the .ctl file
+        CALL mprintf(.true.,STDOUT, ' ')
+        CALL mprintf(.true.,STDOUT, 'CREATING .ctl file')
+        CALL create_ctl ()
+      END IF  
+
+
+#ifdef V5D
+      IF ( output_type == 'v5d' ) THEN   !!! Create the vis5d file
+        ret = v5dclose()
+      END IF
+#endif
+
+   
+   END SUBROUTINE process_domain
+
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: get_interp_info
+   ! Purpose: Get extra info if we need to interpolate to pressure / height    
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE get_interp_info (valid_date)
+
+      IMPLICIT NONE
+
+      ! Arguments
+      character (len=19)                 :: valid_date
+    
+      ! Local variables
+      integer                             :: istatus, wrftype
+      real, pointer, dimension(:,:,:)     :: real_array
+      character (len=3)                   :: memorder
+      character (len=128)                 :: cname, stagger
+      character (len=128), dimension(3)   :: dimnames
+      integer, dimension(3)               :: domain_start, domain_end
+      integer, dimension(2)               :: loc_of_min_z
+      real, allocatable, dimension(:,:,:) :: ph_tmp, phb_tmp
+      integer                             :: found
+
+
+      found = 0
+
+      wrftype = 104
+      memorder = "XYZ"
+      domain_start = 1
+      domain_end(1) = west_east_dim
+      domain_end(2) = south_north_dim
+
+      IF (iprogram == 6 .AND. vertical_type == 'p') THEN
+        domain_end(3) = bottom_top_dim
+        stagger = '-'
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'QVAPOR', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        memorder = "XY"
+        domain_end(3) = 1
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'MU', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'MUB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        memorder = "0"
+        domain_end(1) = 1
+        domain_end(2) = 1
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'P_TOP', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        memorder = "Z"
+        domain_end(1) = bottom_top_dim
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'ZNU', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        domain_end(1) = bottom_top_dim + 1
+        stagger = 'Z'
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'ZNW', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        IF ( found == 0 ) THEN
+          vertical = 3    !!! (unequally spaced levels in mb - v5d)
+          CALL mprintf(.true.,STDOUT, '   Interpolating to PRESSURE levels ')
+          CALL mprintf(.true.,STDOUT, '   ')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   WARNING: Asked to interpolate to PRESSURE, but we do not have enough information ' )
+          CALL mprintf(.true.,STDOUT, '            Will output data on MODEL LEVELS ' )
+          vertical_type = 'n'
+        ENDIF
+
+      ENDIF
+
+      IF (iprogram == 8 .AND. vertical_type == 'p') THEN
+        domain_end(3) = bottom_top_dim
+        stagger = '-'
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'P', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'PB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        IF ( found == 0 ) THEN
+          vertical = 3    !!! (unequally spaced levels in mb - v5d)
+          CALL mprintf(.true.,STDOUT, '   Interpolating to PRESSURE levels ')
+          CALL mprintf(.true.,STDOUT, '   ')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   WARNING: Asked to interpolate to PRESSURE, but we do not have enough information ' )
+          CALL mprintf(.true.,STDOUT, '            Will output data on MODEL LEVELS ' )
+          vertical_type = 'n'
+        ENDIF
+
+      ENDIF
+
+
+      IF (vertical_type == 'z' .AND. interp_method == 1 ) THEN
+
+        domain_end(3) = bottom_top_dim + 1
+        stagger = 'Z'
+
+!domain_end(3) = bottom_top_dim
+!stagger = ''
+
+!        istatus = 0
+!        CALL read_spec_field(domain_start, domain_end, 'PH', wrftype, &
+!                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+!        found = found + istatus
+!
+!        istatus = 0
+!        CALL read_spec_field(domain_start, domain_end, 'PHB', wrftype, &
+!                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+!        found = found + istatus
+
+!!
+!! MARS MARS
+!!
+!!print *, 'get_interp_info'
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'PHTOT', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        IF ( found == 0 ) THEN
+          vertical = 2    !!! (unequally spaced levels in km - v5d)
+          CALL mprintf(.true.,STDOUT, '   Interpolating to USER SPECIFIED HEIGHT levels ')
+          CALL mprintf(.true.,STDOUT, '   ')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   WARNING: Asked to interpolate&
+& to USER SPECIFIED HEIGHT, but we do not have enough information ' )
+          CALL mprintf(.true.,STDOUT, '            Will output data on MODEL LEVELS ' )
+          vertical_type = 'n'
+        ENDIF
+
+      ENDIF
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! octobre 2009
+      IF (vertical_type == 'zabg' .AND. interp_method == 2 ) THEN
+
+        domain_end(3) = bottom_top_dim + 1
+        stagger = 'Z'
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'PHTOT', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        domain_end(3) = 1
+        stagger = '-'
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'HGT', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        IF ( found == 0 ) THEN
+          vertical = 2    !!! (unequally spaced levels in km - v5d)
+          CALL mprintf(.true.,STDOUT, '   Interpolating to USER SPECIFIED HEIGHT ABOVE MOLA levels ')
+          CALL mprintf(.true.,STDOUT, '   ')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   WARNING: Asked to interpolate&
+& to USER SPECIFIED HEIGHT, but we do not have enough information ' )
+          CALL mprintf(.true.,STDOUT, '            Will output data on MODEL LEVELS ' )
+          vertical_type = 'n'
+        ENDIF
+
+      ENDIF
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! octobre 2009
+
+
+      IF (vertical_type == 'z' .AND. interp_method == -1 ) THEN
+        domain_end(3) = bottom_top_dim + 1
+        stagger = 'Z'
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'PH', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+        IF ( istatus == 0 ) THEN
+          allocate(ph_tmp(domain_end(1),domain_end(2),domain_end(3)-1))
+          ph_tmp = 0.5*(real_array(:,:,1:domain_end(3)-1)+real_array(:,:,2:domain_end(3)))
+        ENDIF
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'PHB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+        IF ( istatus == 0 ) THEN
+          allocate(phb_tmp(domain_end(1),domain_end(2),domain_end(3)-1))
+          phb_tmp = 0.5*(real_array(:,:,1:domain_end(3)-1)+real_array(:,:,2:domain_end(3)))
+        ENDIF
+
+        IF ( found == 0 ) THEN
+          vertical = 2    !!! (unequally spaced levels in km - v5d)
+!!          ph_tmp = ( (ph_tmp+phb_tmp) / 9.81)/1000.        !!! convert to height in km
+
+          ph_tmp = ( (ph_tmp+phb_tmp) / 3.72)/1000.        !!! convert to height in km
+
+          !!! Generate nice heights. 
+          !!! Get location of lowest height on model grid
+          !!! Use column above this point as our heights to interpolate to
+          !!! Adjust lowerst and heighest heights a bit
+          number_of_zlevs = bottom_top_dim
+          loc_of_min_z = minloc(ph_tmp(:,:,1))
+          interp_levels(1:number_of_zlevs) =                                   &
+                    ph_tmp(loc_of_min_z(1),loc_of_min_z(2),1:number_of_zlevs)
+
+	  !!--- .002 problematic on Mars with low pressure
+          !!interp_levels(1) = interp_levels(1) + 0.002
+          !!interp_levels(1) = MAX(interp_levels(1), interp_levels(2)/2.0)  !! no neg values
+          !!interp_levels(number_of_zlevs) = interp_levels(number_of_zlevs) - 0.002
+          vertical = 2
+          CALL mprintf(.true.,STDOUT, '   Interpolating to GENERATED HEIGHT levels ')
+          CALL mprintf(.true.,STDOUT, '   ')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   WARNING: Asked to interpolate to GENERATED &
+&HEIGHT, but we do not have enough information ' )
+          CALL mprintf(.true.,STDOUT, '            Will output data on MODEL LEVELS ' )
+          vertical_type = 'n'
+        ENDIF
+
+        IF (ALLOCATED(ph_tmp))  DEALLOCATE(ph_tmp)
+        IF (ALLOCATED(phb_tmp)) DEALLOCATE(phb_tmp)
+      ENDIF
+    
+
+   END SUBROUTINE get_interp_info
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: get_interp_array
+   ! Purpose: Get array we will use when interpolting 
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE get_interp_array (valid_date)
+
+      USE module_pressure
+
+      IMPLICIT NONE
+
+      ! Arguments
+      character (len=19)                 :: valid_date
+    
+      ! Local variables
+      integer                             :: istatus, wrftype, k
+      real, pointer, dimension(:,:,:)     :: real_array
+      character (len=3)                   :: memorder
+      character (len=128)                 :: cname, stagger
+      character (len=128), dimension(3)   :: dimnames
+      integer, dimension(3)               :: domain_start, domain_end
+      integer, dimension(2)               :: loc_of_min_z
+      real, allocatable, dimension(:,:,:) :: p_tmp, pb_tmp, ph_tmp, phb_tmp
+      real, pointer, dimension(:,:,:)     :: SCR3
+
+
+      wrftype = 104
+      memorder = "XYZ"
+      domain_start = 1
+      domain_end(1) = west_east_dim
+      domain_end(2) = south_north_dim
+
+      IF (iprogram == 6 .AND. vertical_type == 'p') THEN
+        domain_end(3) = bottom_top_dim
+        stagger = '-'
+        CALL read_spec_field(domain_start, domain_end, 'QVAPOR', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(QV(west_east_dim,south_north_dim,bottom_top_dim))
+        QV = real_array
+
+        memorder = "XY"
+        domain_end(3) = 1
+        stagger = '-'
+        CALL read_spec_field(domain_start, domain_end, 'MU', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(MU(west_east_dim,south_north_dim))
+        MU = real_array(:,:,1)
+        CALL read_spec_field(domain_start, domain_end, 'MUB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(MUB(west_east_dim,south_north_dim))
+        MUB = real_array(:,:,1)
+
+        memorder = "0"
+        domain_end(1) = 1
+        domain_end(2) = 1
+        CALL read_spec_field(domain_start, domain_end, 'P_TOP', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        PTOP = real_array(1,1,1)
+
+        memorder = "Z"
+        domain_end(1) = bottom_top_dim
+        CALL read_spec_field(domain_start, domain_end, 'ZNU', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(ZNU(bottom_top_dim))
+        ZNU = real_array(:,1,1)
+
+        domain_end(1) = bottom_top_dim + 1
+        stagger = 'Z'
+        CALL read_spec_field(domain_start, domain_end, 'ZNW', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(ZNW(bottom_top_dim+1))
+        ZNW = real_array(:,1,1)
+
+       
+        CALL pressure(SCR3)
+        ALLOCATE(vert_array(west_east_dim,south_north_dim,bottom_top_dim))
+        vert_array = 0.01 * SCR3      !! pressure array in HPa
+
+        IF (ALLOCATED(QV))  DEALLOCATE(QV)
+        IF (ALLOCATED(MU))  DEALLOCATE(MU)
+        IF (ALLOCATED(MUB)) DEALLOCATE(MUB)
+        IF (ALLOCATED(ZNU)) DEALLOCATE(ZNU)
+        IF (ALLOCATED(ZNW)) DEALLOCATE(ZNW)
+      ENDIF
+
+
+
+      IF (iprogram == 8 .AND. vertical_type == 'p') THEN
+        domain_end(3) = bottom_top_dim
+        stagger = '-'
+        CALL read_spec_field(domain_start, domain_end, 'P', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(p_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+        p_tmp = real_array
+        CALL read_spec_field(domain_start, domain_end, 'PB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(pb_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+        pb_tmp = real_array
+
+        IF (ALLOCATED(vert_array)) DEALLOCATE(vert_array)
+        ALLOCATE(vert_array(west_east_dim,south_north_dim,bottom_top_dim))
+        vert_array = (p_tmp+pb_tmp)/100.      !! pressure array in HPa
+
+        IF (ALLOCATED(p_tmp))   DEALLOCATE(p_tmp)
+        IF (ALLOCATED(pb_tmp))  DEALLOCATE(pb_tmp)
+      ENDIF
+
+
+
+      IF (vertical_type == 'z' ) THEN
+
+        domain_end(3) = bottom_top_dim + 1
+        stagger = 'Z'
+
+!domain_end(3) = bottom_top_dim
+!stagger = ''
+
+!!!
+!!! MARS MARS
+!!!
+
+!        CALL read_spec_field(domain_start, domain_end, 'PH', wrftype, &
+!                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+!        allocate(ph_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+!        ph_tmp = 0.5*(real_array(:,:,1:domain_end(3)-1)+real_array(:,:,2:domain_end(3)))
+!        CALL read_spec_field(domain_start, domain_end, 'PHB', wrftype, &
+!                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+!        allocate(phb_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+!        phb_tmp = 0.5*(real_array(:,:,1:domain_end(3)-1)+real_array(:,:,2:domain_end(3)))
+
+
+        CALL read_spec_field(domain_start, domain_end, 'PHTOT', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+
+        allocate(ph_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+        ph_tmp = 0.5*real_array
+
+        allocate(phb_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+        phb_tmp = 0.5*real_array
+
+
+        IF (ALLOCATED(vert_array)) DEALLOCATE(vert_array)
+        ALLOCATE(vert_array(west_east_dim,south_north_dim,bottom_top_dim))
+!!        vert_array = ( (ph_tmp+phb_tmp) / 9.81)/1000.        !! height array in km
+        vert_array = ( (ph_tmp+phb_tmp) / 3.72)/1000.        !! height array in km
+
+        IF (ALLOCATED(ph_tmp))  DEALLOCATE(ph_tmp)
+        IF (ALLOCATED(phb_tmp)) DEALLOCATE(phb_tmp)
+      ENDIF
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AJOUT AJOUT octobre 2009
+      IF (vertical_type == 'zabg' ) THEN
+
+        !
+        ! ALTITUDE ABOVE MOLA
+        !
+        domain_end(3) = bottom_top_dim + 1
+        stagger = 'Z'
+        CALL read_spec_field(domain_start, domain_end, 'PHTOT', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(ph_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+        ph_tmp = real_array / 3.72 
+
+        !
+        ! ALTIMETRY MOLA
+        !
+        domain_end(3) = 1
+        stagger = '-'
+        CALL read_spec_field(domain_start, domain_end, 'HGT', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(phb_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+          DO k=1,bottom_top_dim
+            phb_tmp(:,:,k) = real_array(:,:,1)
+          ENDDO
+
+        !
+        ! ALTITUDE ABOVE MOLA
+        !
+        IF (ALLOCATED(vert_array)) DEALLOCATE(vert_array)
+        ALLOCATE(vert_array(west_east_dim,south_north_dim,bottom_top_dim))
+        vert_array = ( ph_tmp - phb_tmp ) / 1000.        !! height array in km
+
+        IF (ALLOCATED(ph_tmp))  DEALLOCATE(ph_tmp)
+        IF (ALLOCATED(phb_tmp)) DEALLOCATE(phb_tmp)
+      ENDIF
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AJOUT AJOUT octobre 2009
+
+
+   END SUBROUTINE get_interp_array
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: get_fields
+   ! Purpose: Read all fields in input file and process required output fields
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE get_fields (valid_date)
+
+      USE module_get_file_names
+      USE module_diagnostics
+      USE module_interp
+
+      IMPLICIT NONE
+
+      ! Local variables
+      integer                            :: istatus, i, j, k, ii, jj, kk
+      real, pointer, dimension(:,:,:)    :: real_array
+      character (len=3)                  :: memorder
+      character (len=19)                 :: datestr, valid_date
+      character (len=128)                :: cname, stagger, cunits, cdesc
+      character (len=128), dimension(3)  :: dimnames
+      integer, dimension(3)              :: domain_start, domain_end
+      real, pointer, dimension(:,:,:)    :: data_out 
+      real, allocatable, dimension(:,:,:):: SCR
+      integer                            :: nxout, nyout, nzout
+      character (len=20)                 :: dummy
+      integer                            :: is_there
+
+
+      ! Initialize the input module to read static input data for this domain
+      CALL mprintf(.true.,STDOUT, ' ')
+      CALL mprintf(.true.,STDOUT, ' Processing  time --- %s', s1=trim(valid_date))
+      get_right_time : DO
+        IF ( next_file > number_of_input_files ) THEN
+           CALL mprintf(.true.,STDOUT, '   --- WE HAVE RUN OUT OF INPUT FILES ---')
+           run_out_of_files = .TRUE.
+           RETURN
+        END IF
+        IF ( .not. file_is_open) THEN
+          CALL input_init(next_file, istatus)
+          CALL mprintf((istatus /= 0),ERROR, 'input_init(): Error opening input.')
+          file_is_open = .TRUE.
+        END IF
+        CALL arw_get_next_time(handle, datestr, istatus)
+        IF ( istatus /= 0 ) THEN     ! might be in a next file
+           CALL input_close()
+           file_is_open = .FALSE.
+           CALL mprintf(.true.,STDOUT, '   Date not in this file - see if there are more files ')
+           next_file = next_file + 1
+           CYCLE get_right_time
+        END IF
+        IF ( TRIM(datestr) .LT. TRIM(valid_date) ) THEN
+           CALL mprintf(.true.,STDOUT, '   Not looking for %s - skipping to next time' , s1=datestr )
+           CYCLE get_right_time
+        ELSEIF ( TRIM(datestr) .EQ. TRIM(valid_date) ) THEN
+           CALL mprintf(.true.,STDOUT, '   Found the right date - continue ' )
+           EXIT get_right_time
+        ELSEIF ( TRIM(datestr) .GT. TRIM(valid_date) ) THEN
+           CALL mprintf(.true.,STDOUT, '   Found  %s  before  %s', s1=trim(datestr),s2=trim(valid_date))
+           run_out_of_files = .TRUE.
+           RETURN
+        ENDIF
+      ENDDO get_right_time
+
+      CALL clobber_arrays
+#ifdef IO_GRIB1
+      IF (io_form_input == GRIB1) THEN
+        REWIND (13)
+      END IF
+#endif
+   
+
+      !! IF we are interpolting we need the pressure/height array to interpolate to
+      IF ( vertical_type /= 'n' ) THEN
+         CALL get_interp_array (valid_date)
+      ENDIF
+
+   
+      ! Read fields using the input module; we know that there are no more
+      !   fields to be read when read_next_field() returns a non-zero status.
+      istatus = 0
+      process_all_fields : DO WHILE (istatus == 0)  
+        CALL read_next_field(domain_start, domain_end, cname, cunits, cdesc, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+#ifdef IO_GRIB1
+        IF (io_form_input == GRIB1) THEN
+          IF (istatus == -5) THEN
+            istatus = 0
+            CYCLE process_all_fields
+          END IF
+        END IF
+#endif
+        IF (istatus == 0) THEN
+          IF (cname(len_trim(cname)-1:len_trim(cname)) == "_U" ) CYCLE process_all_fields
+          IF (cname(len_trim(cname)-1:len_trim(cname)) == "_V" ) CYCLE process_all_fields
+
+            CALL keep_arrays(cname, real_array)  !!! Keep some fields around
+
+!!
+!! DECIDE IF WE WANT THE FIELD AND IF YES, INTERPOLATE TO CORRECT GRID IF NEEEDED
+!! assume we got the grid info up at the top somewhere
+!!
+
+            dummy = ","//trim(cname)//","
+            is_there = INDEX(plot_these_fields,trim(dummy))
+            IF ( ( INDEX(plot,'all') /= 0 .OR. is_there /= 0) .AND. domain_end(2) /= 1) THEN
+              IF (ALLOCATED(SCR)) DEALLOCATE(SCR)
+              ALLOCATE(SCR(domain_end(1),domain_end(2),domain_end(3)))
+              SCR = real_array
+              CALL interp( SCR, domain_end(1), domain_end(2), domain_end(3), &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+                           
+            ! Write the fields we want out to the .dat file, also keeps a list of what is written out
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            ENDIF
+
+        ENDIF    !! end "istatus==0"
+
+      END DO process_all_fields
+
+
+
+      IF (  INDEX(plot,'list') /= 0 .OR. INDEX(plot,'file') /= 0 ) THEN
+!! Do we have any DIAGNOSTICS to process?
+        CALL process_diagnostics ()
+      END IF
+
+
+!! We are DONE for this time
+
+
+
+
+   !! print a list of the requested fields we could not find
+   IF ( len_trim(could_not_find) > 1 ) THEN
+     CALL mprintf(.true.,STDOUT, '   ')
+     CALL mprintf(.true.,STDOUT, '   WARNING: The following requested fields could not be found ' )
+
+     could_not_find = could_not_find(2:len_trim(could_not_find))
+     is_there = INDEX(could_not_find,",")
+#ifdef V5D
+     IF ( output_type == 'v5d' .AND. is_there > 1 ) THEN   !!! Warning for possible bad data file
+       CALL mprintf(.true.,STDOUT, '   WARNING: This will create a problem for VIS5D, please ' )
+       CALL mprintf(.true.,STDOUT, '            remove these fields from your input list and ' )
+       CALL mprintf(.true.,STDOUT, '            run the code again.                          ' )
+       CALL mprintf(.true.,STDOUT, '                                                         ' )
+     END IF
+#endif
+     DO WHILE ( is_there > 1 ) 
+       PRINT*,"           ", could_not_find(1:is_there-1)
+       could_not_find = could_not_find(is_there+1:len_trim(could_not_find))
+       is_there = INDEX(could_not_find,",")
+     END DO
+   
+   CALL mprintf(.true.,STDOUT, '   ')
+   ENDIF
+    
+
+   END SUBROUTINE get_fields
+
+END MODULE process_domain_module
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/process_domain_module_new.F90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/process_domain_module_new.F90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/process_domain_module_new.F90	(revision 207)
@@ -0,0 +1,730 @@
+MODULE process_domain_module
+   
+   USE input_module
+   USE output_module
+   USE module_model_basics
+   USE module_arrays
+   
+   integer                             :: next_file
+   logical                             :: run_out_of_files
+   logical                             :: file_is_open
+   integer                             :: vertical       !!! needed for v5dcreation
+ 
+
+   CONTAINS
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: process_domain
+   ! Purpose: Process the input data
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE process_domain ()
+   
+      USE date_pack
+      USE gridinfo_module
+      USE misc_definitions_module
+      USE module_debug
+      USE v5d_module
+   
+      IMPLICIT NONE
+
+      ! ------ some vis5d stuff, contain MAXVARS,MAXTIMES,MAXROWS,MAXCOLUMNS,MAXLEVELS
+      include 'v5df.h'
+   
+      ! Local variables
+      integer                                :: idiff, n_times, i
+      character (len=19)                     :: valid_date, temp_date, datestr
+      character (len=128)                    :: cname, stagger, cunits, cdesc
+      integer                                :: istatus, reclength
+      integer                                :: ret                         !!! v5d stuff
+      integer, dimension(MAXLEVELS)          :: v5d_nl
+      real, dimension(MAXLEVELS)             :: v5d_levels
+      integer, dimension(MAXTIMES)           :: timestamp, datestamp
+      integer                                :: projection
+      real, dimension(100)                   :: proj_args
+   
+
+      ! Compute number of times that we will process
+      CALL geth_idts(end_date, start_date, idiff)
+      CALL mprintf((idiff < 0),ERROR,'Ending date is earlier than starting date in namelist.')
+   
+   
+      ! Check that the interval evenly divides the range of times to process
+      n_times = idiff / interval_seconds
+      CALL mprintf((mod(idiff, interval_seconds) /= 0),WARN, &
+                   'In namelist, interval_seconds does not evenly divide '// &
+                   '(end_date - start_date). Only %i time periods '// &
+                   'will be processed.', i2=n_times)
+   
+      ! 
+      ! DO TIME_INDEPENDANT PROCESSING
+      ! 
+
+      ! Initialize the input module to read input data
+      CALL input_init(1, istatus)
+      CALL mprintf((istatus /= 0),ERROR, 'input_init(): Error opening input.')
+   
+      ! Read global attributes from the input file 
+      CALL read_global_attrs ()
+      IF ( iprogram .le. 1 ) n_times = 0
+
+
+      IF (( output_type == 'grads' ) .OR. ( output_type == 'idl' )) THEN    !!! We are making grads type files
+
+        ! Open .dat and .ctl files
+        DO cunit=10,100
+          INQUIRE(unit=cunit, opened=is_used)
+          if (.not. is_used) exit
+        END DO
+        ctlfile = trim(output_root_name)//'.ctl'
+        OPEN(cunit,file=ctlfile)
+
+        DO dunit=10,100
+          INQUIRE(unit=dunit, opened=is_used)
+          IF (.not. is_used) EXIT
+        END DO
+
+        IF      ( west_east_dim .gt. 2 .AND. south_north_dim .gt. 2 ) THEN
+          reclength = (west_east_dim)*(south_north_dim)
+        ELSE IF ( west_east_dim .gt. 2 .AND. south_north_dim .eq. 2 ) THEN
+          reclength = west_east_dim
+        ELSE IF ( west_east_dim .eq. 2 .AND. south_north_dim .gt. 2 ) THEN
+          reclength = south_north_dim
+        ELSE IF ( west_east_dim .eq. 2 .AND. south_north_dim .eq. 2 ) THEN
+          reclength = 1
+        END IF
+#ifdef RECL4
+        reclength = reclength*4
+#endif
+        datfile = trim(output_root_name)//'.dat'
+!        OPEN(dunit,file=datfile,form='unformatted',access="direct", recl=reclength)
+        OPEN(dunit,file=datfile)
+
+      ELSE IF ( output_type == 'v5d' ) THEN    !!! We are making grads type files
+
+        v5dfile = trim(output_root_name)//'.v5d'
+  
+      END IF
+
+
+      CALL arw_get_next_time(handle, datestr, istatus)
+
+!!!
+!!! MARS: au cas ou il n y a pas le geop init pour calculer les hauteurs
+!!!
+!!CALL arw_get_next_time(handle, datestr, istatus)
+
+
+
+      vertical = 0      !!! needed for v5d creation (equally spaced levels in generic units)
+      ! If interp_method /= 0, then we need to know if this can be done, for now only doing it for wrfout data
+      IF ( iprogram .ge. 6 .AND. interp_method /= 0 ) THEN
+         CALL get_interp_info (datestr)
+      ELSE
+        vertical_type = 'n'   !! In case user set this for other programs
+        number_of_zlevs = bottom_top_dim
+      END IF
+
+
+
+#ifdef V5D
+      IF ( output_type == 'v5d' ) THEN   !!! Create the vis5d file
+        v5d_nl = IMISSING
+        CALL v5d_varnames (v5d_nl)
+        CALL v5d_times (n_times+1, timestamp, datestamp)
+        CALL v5d_proj (datestr, projection, proj_args)
+        v5d_levels = MISSING
+        IF (vertical == 0 ) THEN
+          v5d_levels(1) = 0.0   !!! Same basics set up for sigma level data
+          v5d_levels(2) = 1.0
+        ELSE
+          DO i=1,number_of_zlevs
+            v5d_levels(i) = interp_levels(i)
+          END DO
+        END IF
+        ret = v5dCreate( v5dfile, n_times+1, numvars,                     &
+                         !!west_east_dim, south_north_dim, v5d_nl,        &
+                         south_north_dim, west_east_dim, v5d_nl,        &
+                         varnames, timestamp, datestamp, 1, projection, & 
+                         proj_args, vertical, v5d_levels )
+        IF ( ret == 0 ) THEN 
+          CALL mprintf(.true.,ERROR, 'v5dCreate')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   ')
+          CALL mprintf(.true.,STDOUT, '   SUCCESS: v5d file has been Created')
+        END IF
+
+      END IF 
+#endif
+
+      CALL input_close()       !!! Will be opened again by next process if needed
+
+      !
+      ! BEGIN TIME-DEPENDANT PROCESSING
+        next_file = 1
+        ivars     = 0
+      
+      ! Loop over all times to be processed
+      could_not_find = plot_these_fields      !!! Keep a list of requested fields
+      run_out_of_files = .FALSE.
+      file_is_open = .FALSE.
+      rec = 0
+      all_files : DO time=0,n_times
+   
+         IF ( iprogram == 1 ) then
+           temp_date = "0000-00-00_00:00:00" 
+         ELSE 
+           CALL geth_newdate(valid_date, trim(start_date), time*interval_seconds)
+           temp_date = ' '
+           write(temp_date,'(a19)') valid_date(1:10)//'_'//valid_date(12:19)
+         ENDIF
+         IF ( time == 0 ) tdef_date = temp_date
+   
+         CALL get_fields(temp_date)
+   
+         IF (run_out_of_files) EXIT all_files
+   
+      ENDDO all_files  ! Loop over n_times
+
+      CALL mprintf(.true.,STDOUT, ' ')
+      CALL mprintf(.true.,STDOUT, 'DONE Processing Data')
+
+      IF ( output_type == 'grads' ) THEN    !!! We are making grads type files
+        ! Create the .ctl file
+        CALL mprintf(.true.,STDOUT, ' ')
+        CALL mprintf(.true.,STDOUT, 'CREATING .ctl file')
+        CALL create_ctl ()
+      END IF  
+
+
+#ifdef V5D
+      IF ( output_type == 'v5d' ) THEN   !!! Create the vis5d file
+        ret = v5dclose()
+      END IF
+#endif
+
+   
+   END SUBROUTINE process_domain
+
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: get_interp_info
+   ! Purpose: Get extra info if we need to interpolate to pressure / height    
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE get_interp_info (valid_date)
+
+      IMPLICIT NONE
+
+      ! Arguments
+      character (len=19)                 :: valid_date
+    
+      ! Local variables
+      integer                             :: istatus, wrftype
+      real, pointer, dimension(:,:,:)     :: real_array
+      character (len=3)                   :: memorder
+      character (len=128)                 :: cname, stagger
+      character (len=128), dimension(3)   :: dimnames
+      integer, dimension(3)               :: domain_start, domain_end
+      integer, dimension(2)               :: loc_of_min_z
+      real, allocatable, dimension(:,:,:) :: ph_tmp, phb_tmp
+      integer                             :: found
+
+
+      found = 0
+
+      wrftype = 104
+      memorder = "XYZ"
+      domain_start = 1
+      domain_end(1) = west_east_dim
+      domain_end(2) = south_north_dim
+
+      IF (iprogram == 6 .AND. vertical_type == 'p') THEN
+        domain_end(3) = bottom_top_dim
+        stagger = '-'
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'QVAPOR', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        memorder = "XY"
+        domain_end(3) = 1
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'MU', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'MUB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        memorder = "0"
+        domain_end(1) = 1
+        domain_end(2) = 1
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'P_TOP', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        memorder = "Z"
+        domain_end(1) = bottom_top_dim
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'ZNU', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        domain_end(1) = bottom_top_dim + 1
+        stagger = 'Z'
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'ZNW', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        IF ( found == 0 ) THEN
+          vertical = 3    !!! (unequally spaced levels in mb - v5d)
+          CALL mprintf(.true.,STDOUT, '   Interpolating to PRESSURE levels ')
+          CALL mprintf(.true.,STDOUT, '   ')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   WARNING: Asked to interpolate to PRESSURE, but we do not have enough information ' )
+          CALL mprintf(.true.,STDOUT, '            Will output data on MODEL LEVELS ' )
+          vertical_type = 'n'
+        ENDIF
+
+      ENDIF
+
+      IF (iprogram == 8 .AND. vertical_type == 'p') THEN
+        domain_end(3) = bottom_top_dim
+        stagger = '-'
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'P', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'PB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        IF ( found == 0 ) THEN
+          vertical = 3    !!! (unequally spaced levels in mb - v5d)
+          CALL mprintf(.true.,STDOUT, '   Interpolating to PRESSURE levels ')
+          CALL mprintf(.true.,STDOUT, '   ')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   WARNING: Asked to interpolate to PRESSURE, but we do not have enough information ' )
+          CALL mprintf(.true.,STDOUT, '            Will output data on MODEL LEVELS ' )
+          vertical_type = 'n'
+        ENDIF
+
+      ENDIF
+
+
+      IF (vertical_type == 'z' .AND. interp_method == 1 ) THEN
+
+        domain_end(3) = bottom_top_dim + 1
+        stagger = 'Z'
+
+!domain_end(3) = bottom_top_dim
+!stagger = ''
+
+!        istatus = 0
+!        CALL read_spec_field(domain_start, domain_end, 'PH', wrftype, &
+!                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+!        found = found + istatus
+!
+!        istatus = 0
+!        CALL read_spec_field(domain_start, domain_end, 'PHB', wrftype, &
+!                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+!        found = found + istatus
+
+!!
+!! MARS MARS
+!!
+!!print *, 'get_interp_info'
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'PHTOT', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        IF ( found == 0 ) THEN
+          vertical = 2    !!! (unequally spaced levels in km - v5d)
+          CALL mprintf(.true.,STDOUT, '   Interpolating to USER SPECIFIED HEIGHT levels ')
+          CALL mprintf(.true.,STDOUT, '   ')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   WARNING: Asked to interpolate&
+& to USER SPECIFIED HEIGHT, but we do not have enough information ' )
+          CALL mprintf(.true.,STDOUT, '            Will output data on MODEL LEVELS ' )
+          vertical_type = 'n'
+        ENDIF
+
+      ENDIF
+
+      IF (vertical_type == 'z' .AND. interp_method == -1 ) THEN
+        domain_end(3) = bottom_top_dim + 1
+        stagger = 'Z'
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'PH', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+        IF ( istatus == 0 ) THEN
+          allocate(ph_tmp(domain_end(1),domain_end(2),domain_end(3)-1))
+          ph_tmp = 0.5*(real_array(:,:,1:domain_end(3)-1)+real_array(:,:,2:domain_end(3)))
+        ENDIF
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'PHB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+        IF ( istatus == 0 ) THEN
+          allocate(phb_tmp(domain_end(1),domain_end(2),domain_end(3)-1))
+          phb_tmp = 0.5*(real_array(:,:,1:domain_end(3)-1)+real_array(:,:,2:domain_end(3)))
+        ENDIF
+
+        IF ( found == 0 ) THEN
+          vertical = 2    !!! (unequally spaced levels in km - v5d)
+!!          ph_tmp = ( (ph_tmp+phb_tmp) / 9.81)/1000.        !!! convert to height in km
+
+          ph_tmp = ( (ph_tmp+phb_tmp) / 3.72)/1000.        !!! convert to height in km
+
+          !!! Generate nice heights. 
+          !!! Get location of lowest height on model grid
+          !!! Use column above this point as our heights to interpolate to
+          !!! Adjust lowerst and heighest heights a bit
+          number_of_zlevs = bottom_top_dim
+          loc_of_min_z = minloc(ph_tmp(:,:,1))
+          interp_levels(1:number_of_zlevs) =                                   &
+                    ph_tmp(loc_of_min_z(1),loc_of_min_z(2),1:number_of_zlevs)
+
+	  !!--- .002 problematic on Mars with low pressure
+          !!interp_levels(1) = interp_levels(1) + 0.002
+          !!interp_levels(1) = MAX(interp_levels(1), interp_levels(2)/2.0)  !! no neg values
+          !!interp_levels(number_of_zlevs) = interp_levels(number_of_zlevs) - 0.002
+          vertical = 2
+          CALL mprintf(.true.,STDOUT, '   Interpolating to GENERATED HEIGHT levels ')
+          CALL mprintf(.true.,STDOUT, '   ')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   WARNING: Asked to interpolate to GENERATED &
+&HEIGHT, but we do not have enough information ' )
+          CALL mprintf(.true.,STDOUT, '            Will output data on MODEL LEVELS ' )
+          vertical_type = 'n'
+        ENDIF
+
+        IF (ALLOCATED(ph_tmp))  DEALLOCATE(ph_tmp)
+        IF (ALLOCATED(phb_tmp)) DEALLOCATE(phb_tmp)
+      ENDIF
+    
+
+   END SUBROUTINE get_interp_info
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: get_interp_array
+   ! Purpose: Get array we will use when interpolting 
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE get_interp_array (valid_date)
+
+      USE module_pressure
+
+      IMPLICIT NONE
+
+      ! Arguments
+      character (len=19)                 :: valid_date
+    
+      ! Local variables
+      integer                             :: istatus, wrftype
+      real, pointer, dimension(:,:,:)     :: real_array
+      character (len=3)                   :: memorder
+      character (len=128)                 :: cname, stagger
+      character (len=128), dimension(3)   :: dimnames
+      integer, dimension(3)               :: domain_start, domain_end
+      integer, dimension(2)               :: loc_of_min_z
+      real, allocatable, dimension(:,:,:) :: p_tmp, pb_tmp, ph_tmp, phb_tmp
+      real, pointer, dimension(:,:,:)     :: SCR3
+
+
+      wrftype = 104
+      memorder = "XYZ"
+      domain_start = 1
+      domain_end(1) = west_east_dim
+      domain_end(2) = south_north_dim
+
+      IF (iprogram == 6 .AND. vertical_type == 'p') THEN
+        domain_end(3) = bottom_top_dim
+        stagger = '-'
+        CALL read_spec_field(domain_start, domain_end, 'QVAPOR', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(QV(west_east_dim,south_north_dim,bottom_top_dim))
+        QV = real_array
+
+        memorder = "XY"
+        domain_end(3) = 1
+        stagger = '-'
+        CALL read_spec_field(domain_start, domain_end, 'MU', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(MU(west_east_dim,south_north_dim))
+        MU = real_array(:,:,1)
+        CALL read_spec_field(domain_start, domain_end, 'MUB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(MUB(west_east_dim,south_north_dim))
+        MUB = real_array(:,:,1)
+
+        memorder = "0"
+        domain_end(1) = 1
+        domain_end(2) = 1
+        CALL read_spec_field(domain_start, domain_end, 'P_TOP', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        PTOP = real_array(1,1,1)
+
+        memorder = "Z"
+        domain_end(1) = bottom_top_dim
+        CALL read_spec_field(domain_start, domain_end, 'ZNU', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(ZNU(bottom_top_dim))
+        ZNU = real_array(:,1,1)
+
+        domain_end(1) = bottom_top_dim + 1
+        stagger = 'Z'
+        CALL read_spec_field(domain_start, domain_end, 'ZNW', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(ZNW(bottom_top_dim+1))
+        ZNW = real_array(:,1,1)
+
+       
+        CALL pressure(SCR3)
+        ALLOCATE(vert_array(west_east_dim,south_north_dim,bottom_top_dim))
+        vert_array = 0.01 * SCR3      !! pressure array in HPa
+
+        IF (ALLOCATED(QV))  DEALLOCATE(QV)
+        IF (ALLOCATED(MU))  DEALLOCATE(MU)
+        IF (ALLOCATED(MUB)) DEALLOCATE(MUB)
+        IF (ALLOCATED(ZNU)) DEALLOCATE(ZNU)
+        IF (ALLOCATED(ZNW)) DEALLOCATE(ZNW)
+      ENDIF
+
+
+
+      IF (iprogram == 8 .AND. vertical_type == 'p') THEN
+        domain_end(3) = bottom_top_dim
+        stagger = '-'
+        CALL read_spec_field(domain_start, domain_end, 'P', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(p_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+        p_tmp = real_array
+        CALL read_spec_field(domain_start, domain_end, 'PB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(pb_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+        pb_tmp = real_array
+
+        IF (ALLOCATED(vert_array)) DEALLOCATE(vert_array)
+        ALLOCATE(vert_array(west_east_dim,south_north_dim,bottom_top_dim))
+        vert_array = (p_tmp+pb_tmp)/100.      !! pressure array in HPa
+
+        IF (ALLOCATED(p_tmp))   DEALLOCATE(p_tmp)
+        IF (ALLOCATED(pb_tmp))  DEALLOCATE(pb_tmp)
+      ENDIF
+
+
+
+      IF (vertical_type == 'z' ) THEN
+
+        domain_end(3) = bottom_top_dim + 1
+        stagger = 'Z'
+
+!domain_end(3) = bottom_top_dim
+!stagger = ''
+
+!!!
+!!! MARS MARS
+!!!
+
+!        CALL read_spec_field(domain_start, domain_end, 'PH', wrftype, &
+!                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+!        allocate(ph_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+!        ph_tmp = 0.5*(real_array(:,:,1:domain_end(3)-1)+real_array(:,:,2:domain_end(3)))
+!        CALL read_spec_field(domain_start, domain_end, 'PHB', wrftype, &
+!                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+!        allocate(phb_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+!        phb_tmp = 0.5*(real_array(:,:,1:domain_end(3)-1)+real_array(:,:,2:domain_end(3)))
+
+
+        CALL read_spec_field(domain_start, domain_end, 'PHTOT', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+
+        allocate(ph_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+        ph_tmp = 0.5*real_array
+
+        allocate(phb_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+        phb_tmp = 0.5*real_array
+
+
+        IF (ALLOCATED(vert_array)) DEALLOCATE(vert_array)
+        ALLOCATE(vert_array(west_east_dim,south_north_dim,bottom_top_dim))
+!!        vert_array = ( (ph_tmp+phb_tmp) / 9.81)/1000.        !! height array in km
+        vert_array = ( (ph_tmp+phb_tmp) / 3.72)/1000.        !! height array in km
+
+        IF (ALLOCATED(ph_tmp))  DEALLOCATE(ph_tmp)
+        IF (ALLOCATED(phb_tmp)) DEALLOCATE(phb_tmp)
+      ENDIF
+
+
+   END SUBROUTINE get_interp_array
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: get_fields
+   ! Purpose: Read all fields in input file and process required output fields
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE get_fields (valid_date)
+
+      USE module_get_file_names
+      USE module_diagnostics
+      USE module_interp
+
+      IMPLICIT NONE
+
+      ! Local variables
+      integer                            :: istatus, i, j, k, ii, jj, kk
+      real, pointer, dimension(:,:,:)    :: real_array
+      character (len=3)                  :: memorder
+      character (len=19)                 :: datestr, valid_date
+      character (len=128)                :: cname, stagger, cunits, cdesc
+      character (len=128), dimension(3)  :: dimnames
+      integer, dimension(3)              :: domain_start, domain_end
+      real, pointer, dimension(:,:,:)    :: data_out 
+      real, allocatable, dimension(:,:,:):: SCR
+      integer                            :: nxout, nyout, nzout
+      character (len=20)                 :: dummy
+      integer                            :: is_there
+
+
+      ! Initialize the input module to read static input data for this domain
+      CALL mprintf(.true.,STDOUT, ' ')
+      CALL mprintf(.true.,STDOUT, ' Processing  time --- %s', s1=trim(valid_date))
+      get_right_time : DO
+        IF ( next_file > number_of_input_files ) THEN
+           CALL mprintf(.true.,STDOUT, '   --- WE HAVE RUN OUT OF INPUT FILES ---')
+           run_out_of_files = .TRUE.
+           RETURN
+        END IF
+        IF ( .not. file_is_open) THEN
+          CALL input_init(next_file, istatus)
+          CALL mprintf((istatus /= 0),ERROR, 'input_init(): Error opening input.')
+          file_is_open = .TRUE.
+        END IF
+        CALL arw_get_next_time(handle, datestr, istatus)
+        IF ( istatus /= 0 ) THEN     ! might be in a next file
+           CALL input_close()
+           file_is_open = .FALSE.
+           CALL mprintf(.true.,STDOUT, '   Date not in this file - see if there are more files ')
+           next_file = next_file + 1
+           CYCLE get_right_time
+        END IF
+        IF ( TRIM(datestr) .LT. TRIM(valid_date) ) THEN
+           CALL mprintf(.true.,STDOUT, '   Not looking for %s - skipping to next time' , s1=datestr )
+           CYCLE get_right_time
+        ELSEIF ( TRIM(datestr) .EQ. TRIM(valid_date) ) THEN
+           CALL mprintf(.true.,STDOUT, '   Found the right date - continue ' )
+           EXIT get_right_time
+        ELSEIF ( TRIM(datestr) .GT. TRIM(valid_date) ) THEN
+           CALL mprintf(.true.,STDOUT, '   Found  %s  before  %s', s1=trim(datestr),s2=trim(valid_date))
+           run_out_of_files = .TRUE.
+           RETURN
+        ENDIF
+      ENDDO get_right_time
+
+      CALL clobber_arrays
+#ifdef IO_GRIB1
+      IF (io_form_input == GRIB1) THEN
+        REWIND (13)
+      END IF
+#endif
+   
+
+      !! IF we are interpolting we need the pressure/height array to interpolate to
+      IF ( vertical_type /= 'n' ) THEN
+         CALL get_interp_array (valid_date)
+      ENDIF
+
+   
+      ! Read fields using the input module; we know that there are no more
+      !   fields to be read when read_next_field() returns a non-zero status.
+      istatus = 0
+      process_all_fields : DO WHILE (istatus == 0)  
+        CALL read_next_field(domain_start, domain_end, cname, cunits, cdesc, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+#ifdef IO_GRIB1
+        IF (io_form_input == GRIB1) THEN
+          IF (istatus == -5) THEN
+            istatus = 0
+            CYCLE process_all_fields
+          END IF
+        END IF
+#endif
+        IF (istatus == 0) THEN
+          IF (cname(len_trim(cname)-1:len_trim(cname)) == "_U" ) CYCLE process_all_fields
+          IF (cname(len_trim(cname)-1:len_trim(cname)) == "_V" ) CYCLE process_all_fields
+
+            CALL keep_arrays(cname, real_array)  !!! Keep some fields around
+
+!!
+!! DECIDE IF WE WANT THE FIELD AND IF YES, INTERPOLATE TO CORRECT GRID IF NEEEDED
+!! assume we got the grid info up at the top somewhere
+!!
+
+            dummy = ","//trim(cname)//","
+            is_there = INDEX(plot_these_fields,trim(dummy))
+            IF ( ( INDEX(plot,'all') /= 0 .OR. is_there /= 0) .AND. domain_end(2) /= 1) THEN
+              IF (ALLOCATED(SCR)) DEALLOCATE(SCR)
+              ALLOCATE(SCR(domain_end(1),domain_end(2),domain_end(3)))
+              SCR = real_array
+              CALL interp( SCR, domain_end(1), domain_end(2), domain_end(3), &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+                           
+            ! Write the fields we want out to the .dat file, also keeps a list of what is written out
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            ENDIF
+
+        ENDIF    !! end "istatus==0"
+
+      END DO process_all_fields
+
+
+
+      IF (  INDEX(plot,'list') /= 0 .OR. INDEX(plot,'file') /= 0 ) THEN
+!! Do we have any DIAGNOSTICS to process?
+        CALL process_diagnostics ()
+      END IF
+
+
+!! We are DONE for this time
+
+
+
+
+   !! print a list of the requested fields we could not find
+   IF ( len_trim(could_not_find) > 1 ) THEN
+     CALL mprintf(.true.,STDOUT, '   ')
+     CALL mprintf(.true.,STDOUT, '   WARNING: The following requested fields could not be found ' )
+
+     could_not_find = could_not_find(2:len_trim(could_not_find))
+     is_there = INDEX(could_not_find,",")
+#ifdef V5D
+     IF ( output_type == 'v5d' .AND. is_there > 1 ) THEN   !!! Warning for possible bad data file
+       CALL mprintf(.true.,STDOUT, '   WARNING: This will create a problem for VIS5D, please ' )
+       CALL mprintf(.true.,STDOUT, '            remove these fields from your input list and ' )
+       CALL mprintf(.true.,STDOUT, '            run the code again.                          ' )
+       CALL mprintf(.true.,STDOUT, '                                                         ' )
+     END IF
+#endif
+     DO WHILE ( is_there > 1 ) 
+       PRINT*,"           ", could_not_find(1:is_there-1)
+       could_not_find = could_not_find(is_there+1:len_trim(could_not_find))
+       is_there = INDEX(could_not_find,",")
+     END DO
+   
+   CALL mprintf(.true.,STDOUT, '   ')
+   ENDIF
+    
+
+   END SUBROUTINE get_fields
+
+END MODULE process_domain_module
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/process_domain_module_old.F90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/process_domain_module_old.F90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/process_domain_module_old.F90	(revision 207)
@@ -0,0 +1,746 @@
+MODULE process_domain_module
+   
+   USE input_module
+   USE output_module
+   USE module_model_basics
+   USE module_arrays
+   
+   integer                             :: next_file
+   logical                             :: run_out_of_files
+   logical                             :: file_is_open
+   integer                             :: vertical       !!! needed for v5dcreation
+ 
+
+   CONTAINS
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: process_domain
+   ! Purpose: Process the input data
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE process_domain ()
+   
+      USE date_pack
+      USE gridinfo_module
+      USE misc_definitions_module
+      USE module_debug
+      USE v5d_module
+   
+      IMPLICIT NONE
+
+      ! ------ some vis5d stuff, contain MAXVARS,MAXTIMES,MAXROWS,MAXCOLUMNS,MAXLEVELS
+      include 'v5df.h'
+   
+      ! Local variables
+      integer                                :: idiff, n_times, i
+      character (len=19)                     :: valid_date, temp_date, datestr
+      character (len=128)                    :: cname, stagger, cunits, cdesc
+      integer                                :: istatus, reclength
+      integer                                :: ret                         !!! v5d stuff
+      integer, dimension(MAXLEVELS)          :: v5d_nl
+      real, dimension(MAXLEVELS)             :: v5d_levels
+      integer, dimension(MAXTIMES)           :: timestamp, datestamp
+      integer                                :: projection
+      real, dimension(100)                   :: proj_args
+   
+
+      ! Compute number of times that we will process
+      CALL geth_idts(end_date, start_date, idiff)
+      CALL mprintf((idiff < 0),ERROR,'Ending date is earlier than starting date in namelist.')
+   
+   
+      ! Check that the interval evenly divides the range of times to process
+      n_times = idiff / interval_seconds
+      CALL mprintf((mod(idiff, interval_seconds) /= 0),WARN, &
+                   'In namelist, interval_seconds does not evenly divide '// &
+                   '(end_date - start_date). Only %i time periods '// &
+                   'will be processed.', i2=n_times)
+   
+      ! 
+      ! DO TIME_INDEPENDANT PROCESSING
+      ! 
+
+      ! Initialize the input module to read input data
+      CALL input_init(1, istatus)
+      CALL mprintf((istatus /= 0),ERROR, 'input_init(): Error opening input.')
+   
+      ! Read global attributes from the input file 
+      CALL read_global_attrs ()
+      IF ( iprogram .le. 1 ) n_times = 0
+
+
+      IF ( output_type == 'grads' ) THEN    !!! We are making grads type files
+
+        ! Open .dat and .ctl files
+        DO cunit=10,100
+          INQUIRE(unit=cunit, opened=is_used)
+          if (.not. is_used) exit
+        END DO
+        ctlfile = trim(output_root_name)//'.ctl'
+        OPEN(cunit,file=ctlfile)
+
+        DO dunit=10,100
+          INQUIRE(unit=dunit, opened=is_used)
+          IF (.not. is_used) EXIT
+        END DO
+
+        IF      ( west_east_dim .gt. 2 .AND. south_north_dim .gt. 2 ) THEN
+          reclength = (west_east_dim)*(south_north_dim)
+        ELSE IF ( west_east_dim .gt. 2 .AND. south_north_dim .eq. 2 ) THEN
+          reclength = west_east_dim
+        ELSE IF ( west_east_dim .eq. 2 .AND. south_north_dim .gt. 2 ) THEN
+          reclength = south_north_dim
+        ELSE IF ( west_east_dim .eq. 2 .AND. south_north_dim .eq. 2 ) THEN
+          reclength = 1
+        END IF
+#ifdef RECL4
+        reclength = reclength*4
+#endif
+        datfile = trim(output_root_name)//'.dat'
+!        OPEN(dunit,file=datfile,form='unformatted',access="direct", recl=reclength)
+        OPEN(dunit,file=datfile)
+
+      ELSE IF ( output_type == 'v5d' ) THEN    !!! We are making grads type files
+
+        v5dfile = trim(output_root_name)//'.v5d'
+  
+      END IF
+
+
+      CALL arw_get_next_time(handle, datestr, istatus)
+
+!!!
+!!!
+!!! MARS: we go to next time to init, because first step of PHTOT and PTOT are not filled
+!!! MARS: caca caca caca. il vaut mieux le geop init pour calculer les hauteurs
+!!!
+!CALL arw_get_next_time(handle, datestr, istatus)
+
+
+
+      vertical = 0      !!! needed for v5d creation (equally spaced levels in generic units)
+      ! If interp_method /= 0, then we need to know if this can be done, for now only doing it for wrfout data
+      IF ( iprogram .ge. 6 .AND. interp_method /= 0 ) THEN
+         CALL get_interp_info (datestr)
+      ELSE
+        vertical_type = 'n'   !! In case user set this for other programs
+        number_of_zlevs = bottom_top_dim
+      END IF
+
+
+
+#ifdef V5D
+      IF ( output_type == 'v5d' ) THEN   !!! Create the vis5d file
+        v5d_nl = IMISSING
+        CALL v5d_varnames (v5d_nl)
+        CALL v5d_times (n_times+1, timestamp, datestamp)
+        CALL v5d_proj (datestr, projection, proj_args)
+        v5d_levels = MISSING
+        IF (vertical == 0 ) THEN
+          v5d_levels(1) = 0.0   !!! Same basics set up for sigma level data
+          v5d_levels(2) = 1.0
+        ELSE
+          DO i=1,number_of_zlevs
+            v5d_levels(i) = interp_levels(i)
+          END DO
+        END IF
+        ret = v5dCreate( v5dfile, n_times+1, numvars,                     &
+                         !!west_east_dim, south_north_dim, v5d_nl,        &
+                         south_north_dim, west_east_dim, v5d_nl,        &
+                         varnames, timestamp, datestamp, 1, projection, & 
+                         proj_args, vertical, v5d_levels )
+        IF ( ret == 0 ) THEN 
+          CALL mprintf(.true.,ERROR, 'v5dCreate')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   ')
+          CALL mprintf(.true.,STDOUT, '   SUCCESS: v5d file has been Created')
+        END IF
+
+      END IF 
+#endif
+
+      CALL input_close()       !!! Will be opened again by next process if needed
+
+      !
+      ! BEGIN TIME-DEPENDANT PROCESSING
+        next_file = 1
+        ivars     = 0
+      
+      ! Loop over all times to be processed
+      could_not_find = plot_these_fields      !!! Keep a list of requested fields
+      run_out_of_files = .FALSE.
+      file_is_open = .FALSE.
+      rec = 0
+      all_files : DO time=0,n_times
+   
+         IF ( iprogram == 1 ) then
+           temp_date = "0000-00-00_00:00:00" 
+         ELSE 
+           CALL geth_newdate(valid_date, trim(start_date), time*interval_seconds)
+           temp_date = ' '
+           write(temp_date,'(a19)') valid_date(1:10)//'_'//valid_date(12:19)
+         ENDIF
+         IF ( time == 0 ) tdef_date = temp_date
+   
+         CALL get_fields(temp_date)
+   
+         IF (run_out_of_files) EXIT all_files
+   
+      ENDDO all_files  ! Loop over n_times
+
+      CALL mprintf(.true.,STDOUT, ' ')
+      CALL mprintf(.true.,STDOUT, 'DONE Processing Data')
+
+      IF ( output_type == 'grads' ) THEN    !!! We are making grads type files
+        ! Create the .ctl file
+        CALL mprintf(.true.,STDOUT, ' ')
+        CALL mprintf(.true.,STDOUT, 'CREATING .ctl file')
+        CALL create_ctl ()
+      END IF  
+
+
+#ifdef V5D
+      IF ( output_type == 'v5d' ) THEN   !!! Create the vis5d file
+        ret = v5dclose()
+      END IF
+#endif
+
+   
+   END SUBROUTINE process_domain
+
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: get_interp_info
+   ! Purpose: Get extra info if we need to interpolate to pressure / height    
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE get_interp_info (valid_date)
+
+      IMPLICIT NONE
+
+      ! Arguments
+      character (len=19)                 :: valid_date
+    
+      ! Local variables
+      integer                             :: istatus, wrftype
+      real, pointer, dimension(:,:,:)     :: real_array
+      character (len=3)                   :: memorder
+      character (len=128)                 :: cname, stagger
+      character (len=128), dimension(3)   :: dimnames
+      integer, dimension(3)               :: domain_start, domain_end
+      integer, dimension(2)               :: loc_of_min_z
+      real, allocatable, dimension(:,:,:) :: ph_tmp, phb_tmp
+      integer                             :: found
+
+
+      found = 0
+
+      wrftype = 104
+      memorder = "XYZ"
+      domain_start = 1
+      domain_end(1) = west_east_dim
+      domain_end(2) = south_north_dim
+
+      IF (iprogram == 6 .AND. vertical_type == 'p') THEN
+        domain_end(3) = bottom_top_dim
+        stagger = '-'
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'QVAPOR', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        memorder = "XY"
+        domain_end(3) = 1
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'MU', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'MUB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        memorder = "0"
+        domain_end(1) = 1
+        domain_end(2) = 1
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'P_TOP', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        memorder = "Z"
+        domain_end(1) = bottom_top_dim
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'ZNU', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        domain_end(1) = bottom_top_dim + 1
+        stagger = 'Z'
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'ZNW', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        IF ( found == 0 ) THEN
+          vertical = 3    !!! (unequally spaced levels in mb - v5d)
+          CALL mprintf(.true.,STDOUT, '   Interpolating to PRESSURE levels ')
+          CALL mprintf(.true.,STDOUT, '   ')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   WARNING: Asked to interpolate to PRESSURE, but we do not have enough information ' )
+          CALL mprintf(.true.,STDOUT, '            Will output data on MODEL LEVELS ' )
+          vertical_type = 'n'
+        ENDIF
+
+      ENDIF
+
+      IF (iprogram == 8 .AND. vertical_type == 'p') THEN
+        domain_end(3) = bottom_top_dim
+        stagger = '-'
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'P', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'PB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        IF ( found == 0 ) THEN
+          vertical = 3    !!! (unequally spaced levels in mb - v5d)
+          CALL mprintf(.true.,STDOUT, '   Interpolating to PRESSURE levels ')
+          CALL mprintf(.true.,STDOUT, '   ')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   WARNING: Asked to interpolate to PRESSURE, but we do not have enough information ' )
+          CALL mprintf(.true.,STDOUT, '            Will output data on MODEL LEVELS ' )
+          vertical_type = 'n'
+        ENDIF
+
+      ENDIF
+
+
+      IF (vertical_type == 'z' .AND. interp_method == 1 ) THEN
+
+!!!
+!!! MARS MARS: caca caca caca: corriger ce probleme de staggering ?
+!!!
+        domain_end(3) = bottom_top_dim + 1
+        stagger = 'Z'
+
+!         domain_end(3) = bottom_top_dim
+!         stagger = ''
+!!!
+!!! MARS MARS: caca caca caca
+!!!
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'PH', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'PHB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+
+!!!print *, 'get_interp_info'
+!
+!        istatus = 0
+!        CALL read_spec_field(domain_start, domain_end, 'PHTOT', wrftype, &
+!                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+!        found = found + istatus
+
+        IF ( found == 0 ) THEN
+          vertical = 2    !!! (unequally spaced levels in km - v5d)
+          CALL mprintf(.true.,STDOUT, '   Interpolating to USER SPECIFIED HEIGHT levels ')
+          CALL mprintf(.true.,STDOUT, '   ')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   WARNING: Asked to interpolate&
+& to USER SPECIFIED HEIGHT, but we do not have enough information ' )
+          CALL mprintf(.true.,STDOUT, '            Will output data on MODEL LEVELS ' )
+          vertical_type = 'n'
+        ENDIF
+
+      ENDIF
+
+      IF (vertical_type == 'z' .AND. interp_method == -1 ) THEN
+        domain_end(3) = bottom_top_dim + 1
+        stagger = 'Z'
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'PH', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+        IF ( istatus == 0 ) THEN
+          allocate(ph_tmp(domain_end(1),domain_end(2),domain_end(3)-1))
+          ph_tmp = 0.5*(real_array(:,:,1:domain_end(3)-1)+real_array(:,:,2:domain_end(3)))
+        ENDIF
+
+        istatus = 0
+        CALL read_spec_field(domain_start, domain_end, 'PHB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        found = found + istatus
+        IF ( istatus == 0 ) THEN
+          allocate(phb_tmp(domain_end(1),domain_end(2),domain_end(3)-1))
+          phb_tmp = 0.5*(real_array(:,:,1:domain_end(3)-1)+real_array(:,:,2:domain_end(3)))
+        ENDIF
+
+        IF ( found == 0 ) THEN
+          vertical = 2    !!! (unequally spaced levels in km - v5d)
+!!          ph_tmp = ( (ph_tmp+phb_tmp) / 9.81)/1000.        !!! convert to height in km
+
+          ph_tmp = ( (ph_tmp+phb_tmp) / 3.72)/1000.        !!! convert to height in km
+
+          !!! Generate nice heights. 
+          !!! Get location of lowest height on model grid
+          !!! Use column above this point as our heights to interpolate to
+          !!! Adjust lowerst and heighest heights a bit
+          number_of_zlevs = bottom_top_dim
+          loc_of_min_z = minloc(ph_tmp(:,:,1))
+          interp_levels(1:number_of_zlevs) =                                   &
+                    ph_tmp(loc_of_min_z(1),loc_of_min_z(2),1:number_of_zlevs)
+
+	  !!--- .002 problematic on Mars with low pressure
+          !!interp_levels(1) = interp_levels(1) + 0.002
+          !!interp_levels(1) = MAX(interp_levels(1), interp_levels(2)/2.0)  !! no neg values
+          !!interp_levels(number_of_zlevs) = interp_levels(number_of_zlevs) - 0.002
+          vertical = 2
+          CALL mprintf(.true.,STDOUT, '   Interpolating to GENERATED HEIGHT levels ')
+          CALL mprintf(.true.,STDOUT, '   ')
+        ELSE
+          CALL mprintf(.true.,STDOUT, '   WARNING: Asked to interpolate to GENERATED &
+&HEIGHT, but we do not have enough information ' )
+          CALL mprintf(.true.,STDOUT, '            Will output data on MODEL LEVELS ' )
+          vertical_type = 'n'
+        ENDIF
+
+        IF (ALLOCATED(ph_tmp))  DEALLOCATE(ph_tmp)
+        IF (ALLOCATED(phb_tmp)) DEALLOCATE(phb_tmp)
+      ENDIF
+    
+
+   END SUBROUTINE get_interp_info
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: get_interp_array
+   ! Purpose: Get array we will use when interpolting 
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE get_interp_array (valid_date)
+
+      USE module_pressure
+
+      IMPLICIT NONE
+
+      ! Arguments
+      character (len=19)                 :: valid_date
+    
+      ! Local variables
+      integer                             :: istatus, wrftype
+      real, pointer, dimension(:,:,:)     :: real_array
+      character (len=3)                   :: memorder
+      character (len=128)                 :: cname, stagger
+      character (len=128), dimension(3)   :: dimnames
+      integer, dimension(3)               :: domain_start, domain_end
+      integer, dimension(2)               :: loc_of_min_z
+      real, allocatable, dimension(:,:,:) :: p_tmp, pb_tmp, ph_tmp, phb_tmp
+      real, pointer, dimension(:,:,:)     :: SCR3
+
+
+      wrftype = 104
+      memorder = "XYZ"
+      domain_start = 1
+      domain_end(1) = west_east_dim
+      domain_end(2) = south_north_dim
+
+      IF (iprogram == 6 .AND. vertical_type == 'p') THEN
+        domain_end(3) = bottom_top_dim
+        stagger = '-'
+        CALL read_spec_field(domain_start, domain_end, 'QVAPOR', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(QV(west_east_dim,south_north_dim,bottom_top_dim))
+        QV = real_array
+
+        memorder = "XY"
+        domain_end(3) = 1
+        stagger = '-'
+        CALL read_spec_field(domain_start, domain_end, 'MU', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(MU(west_east_dim,south_north_dim))
+        MU = real_array(:,:,1)
+        CALL read_spec_field(domain_start, domain_end, 'MUB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(MUB(west_east_dim,south_north_dim))
+        MUB = real_array(:,:,1)
+
+        memorder = "0"
+        domain_end(1) = 1
+        domain_end(2) = 1
+        CALL read_spec_field(domain_start, domain_end, 'P_TOP', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        PTOP = real_array(1,1,1)
+
+        memorder = "Z"
+        domain_end(1) = bottom_top_dim
+        CALL read_spec_field(domain_start, domain_end, 'ZNU', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(ZNU(bottom_top_dim))
+        ZNU = real_array(:,1,1)
+
+        domain_end(1) = bottom_top_dim + 1
+        stagger = 'Z'
+        CALL read_spec_field(domain_start, domain_end, 'ZNW', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(ZNW(bottom_top_dim+1))
+        ZNW = real_array(:,1,1)
+
+       
+        CALL pressure(SCR3)
+        ALLOCATE(vert_array(west_east_dim,south_north_dim,bottom_top_dim))
+        vert_array = 0.01 * SCR3      !! pressure array in HPa
+
+        IF (ALLOCATED(QV))  DEALLOCATE(QV)
+        IF (ALLOCATED(MU))  DEALLOCATE(MU)
+        IF (ALLOCATED(MUB)) DEALLOCATE(MUB)
+        IF (ALLOCATED(ZNU)) DEALLOCATE(ZNU)
+        IF (ALLOCATED(ZNW)) DEALLOCATE(ZNW)
+      ENDIF
+
+
+
+      IF (iprogram == 8 .AND. vertical_type == 'p') THEN
+        domain_end(3) = bottom_top_dim
+        stagger = '-'
+        CALL read_spec_field(domain_start, domain_end, 'P', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(p_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+        p_tmp = real_array
+        CALL read_spec_field(domain_start, domain_end, 'PB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(pb_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+        pb_tmp = real_array
+
+        IF (ALLOCATED(vert_array)) DEALLOCATE(vert_array)
+        ALLOCATE(vert_array(west_east_dim,south_north_dim,bottom_top_dim))
+        vert_array = (p_tmp+pb_tmp)/100.      !! pressure array in HPa
+
+        IF (ALLOCATED(p_tmp))   DEALLOCATE(p_tmp)
+        IF (ALLOCATED(pb_tmp))  DEALLOCATE(pb_tmp)
+      ENDIF
+
+
+
+      IF (vertical_type == 'z' ) THEN
+
+!!!
+!!! MARS MARS: caca caca caca: corriger ce probleme de staggering ?
+!!!
+        domain_end(3) = bottom_top_dim + 1
+        stagger = 'Z'
+
+!         domain_end(3) = bottom_top_dim
+!         stagger = ''
+!!!
+!!! MARS MARS: caca caca caca
+!!!
+
+        CALL read_spec_field(domain_start, domain_end, 'PH', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(ph_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+        ph_tmp = 0.5*(real_array(:,:,1:domain_end(3)-1)+real_array(:,:,2:domain_end(3)))
+        CALL read_spec_field(domain_start, domain_end, 'PHB', wrftype, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+        allocate(phb_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+        phb_tmp = 0.5*(real_array(:,:,1:domain_end(3)-1)+real_array(:,:,2:domain_end(3)))
+
+
+!        CALL read_spec_field(domain_start, domain_end, 'PHTOT', wrftype, &
+!                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+!
+!!print *, 'get_interp_array'
+!!!!
+!!!! MARS MARS: caca caca caca
+!!!!
+!        allocate(ph_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+!        !!ph_tmp = 0.5*0.5*(real_array(:,:,1:domain_end(3)-1)+real_array(:,:,2:domain_end(3)))
+!ph_tmp = 0.5*real_array
+!
+!        allocate(phb_tmp(west_east_dim,south_north_dim,bottom_top_dim))
+!        !!phb_tmp = 0.5*0.5*(real_array(:,:,1:domain_end(3)-1)+real_array(:,:,2:domain_end(3)))
+!phb_tmp = 0.5*real_array
+!!!!
+!!!! MARS MARS: caca caca caca
+!!!!
+
+        IF (ALLOCATED(vert_array)) DEALLOCATE(vert_array)
+        ALLOCATE(vert_array(west_east_dim,south_north_dim,bottom_top_dim))
+!!        vert_array = ( (ph_tmp+phb_tmp) / 9.81)/1000.        !! height array in km
+        vert_array = ( (ph_tmp+phb_tmp) / 3.72)/1000.        !! height array in km
+
+        IF (ALLOCATED(ph_tmp))  DEALLOCATE(ph_tmp)
+        IF (ALLOCATED(phb_tmp)) DEALLOCATE(phb_tmp)
+      ENDIF
+
+
+   END SUBROUTINE get_interp_array
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: get_fields
+   ! Purpose: Read all fields in input file and process required output fields
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE get_fields (valid_date)
+
+      USE module_get_file_names
+      USE module_diagnostics
+      USE module_interp
+
+      IMPLICIT NONE
+
+      ! Local variables
+      integer                            :: istatus, i, j, k, ii, jj, kk
+      real, pointer, dimension(:,:,:)    :: real_array
+      character (len=3)                  :: memorder
+      character (len=19)                 :: datestr, valid_date
+      character (len=128)                :: cname, stagger, cunits, cdesc
+      character (len=128), dimension(3)  :: dimnames
+      integer, dimension(3)              :: domain_start, domain_end
+      real, pointer, dimension(:,:,:)    :: data_out 
+      real, allocatable, dimension(:,:,:):: SCR
+      integer                            :: nxout, nyout, nzout
+      character (len=20)                 :: dummy
+      integer                            :: is_there
+
+
+      ! Initialize the input module to read static input data for this domain
+      CALL mprintf(.true.,STDOUT, ' ')
+      CALL mprintf(.true.,STDOUT, ' Processing  time --- %s', s1=trim(valid_date))
+      get_right_time : DO
+        IF ( next_file > number_of_input_files ) THEN
+           CALL mprintf(.true.,STDOUT, '   --- WE HAVE RUN OUT OF INPUT FILES ---')
+           run_out_of_files = .TRUE.
+           RETURN
+        END IF
+        IF ( .not. file_is_open) THEN
+          CALL input_init(next_file, istatus)
+          CALL mprintf((istatus /= 0),ERROR, 'input_init(): Error opening input.')
+          file_is_open = .TRUE.
+        END IF
+        CALL arw_get_next_time(handle, datestr, istatus)
+        IF ( istatus /= 0 ) THEN     ! might be in a next file
+           CALL input_close()
+           file_is_open = .FALSE.
+           CALL mprintf(.true.,STDOUT, '   Date not in this file - see if there are more files ')
+           next_file = next_file + 1
+           CYCLE get_right_time
+        END IF
+        IF ( TRIM(datestr) .LT. TRIM(valid_date) ) THEN
+           CALL mprintf(.true.,STDOUT, '   Not looking for %s - skipping to next time' , s1=datestr )
+           CYCLE get_right_time
+        ELSEIF ( TRIM(datestr) .EQ. TRIM(valid_date) ) THEN
+           CALL mprintf(.true.,STDOUT, '   Found the right date - continue ' )
+           EXIT get_right_time
+        ELSEIF ( TRIM(datestr) .GT. TRIM(valid_date) ) THEN
+           CALL mprintf(.true.,STDOUT, '   Found  %s  before  %s', s1=trim(datestr),s2=trim(valid_date))
+           run_out_of_files = .TRUE.
+           RETURN
+        ENDIF
+      ENDDO get_right_time
+
+      CALL clobber_arrays
+#ifdef IO_GRIB1
+      IF (io_form_input == GRIB1) THEN
+        REWIND (13)
+      END IF
+#endif
+   
+
+      !! IF we are interpolting we need the pressure/height array to interpolate to
+      IF ( vertical_type /= 'n' ) THEN
+         CALL get_interp_array (valid_date)
+      ENDIF
+
+   
+      ! Read fields using the input module; we know that there are no more
+      !   fields to be read when read_next_field() returns a non-zero status.
+      istatus = 0
+      process_all_fields : DO WHILE (istatus == 0)  
+        CALL read_next_field(domain_start, domain_end, cname, cunits, cdesc, &
+                             memorder, stagger, dimnames, real_array, valid_date, istatus)
+#ifdef IO_GRIB1
+        IF (io_form_input == GRIB1) THEN
+          IF (istatus == -5) THEN
+            istatus = 0
+            CYCLE process_all_fields
+          END IF
+        END IF
+#endif
+        IF (istatus == 0) THEN
+          IF (cname(len_trim(cname)-1:len_trim(cname)) == "_U" ) CYCLE process_all_fields
+          IF (cname(len_trim(cname)-1:len_trim(cname)) == "_V" ) CYCLE process_all_fields
+
+            CALL keep_arrays(cname, real_array)  !!! Keep some fields around
+
+!!
+!! DECIDE IF WE WANT THE FIELD AND IF YES, INTERPOLATE TO CORRECT GRID IF NEEEDED
+!! assume we got the grid info up at the top somewhere
+!!
+
+            dummy = ","//trim(cname)//","
+            is_there = INDEX(plot_these_fields,trim(dummy))
+            IF ( ( INDEX(plot,'all') /= 0 .OR. is_there /= 0) .AND. domain_end(2) /= 1) THEN
+              IF (ALLOCATED(SCR)) DEALLOCATE(SCR)
+              ALLOCATE(SCR(domain_end(1),domain_end(2),domain_end(3)))
+              SCR = real_array
+              CALL interp( SCR, domain_end(1), domain_end(2), domain_end(3), &
+                           data_out, nxout, nyout, nzout, &
+                           vert_array, interp_levels, number_of_zlevs) 
+                           
+            ! Write the fields we want out to the .dat file, also keeps a list of what is written out
+              CALL write_dat (data_out, nxout, nyout, nzout, cname, cdesc, cunits)
+            ENDIF
+
+        ENDIF    !! end "istatus==0"
+
+      END DO process_all_fields
+
+
+
+      IF (  INDEX(plot,'list') /= 0 .OR. INDEX(plot,'file') /= 0 ) THEN
+!! Do we have any DIAGNOSTICS to process?
+        CALL process_diagnostics ()
+      END IF
+
+
+!! We are DONE for this time
+
+
+
+
+   !! print a list of the requested fields we could not find
+   IF ( len_trim(could_not_find) > 1 ) THEN
+     CALL mprintf(.true.,STDOUT, '   ')
+     CALL mprintf(.true.,STDOUT, '   WARNING: The following requested fields could not be found ' )
+
+     could_not_find = could_not_find(2:len_trim(could_not_find))
+     is_there = INDEX(could_not_find,",")
+#ifdef V5D
+     IF ( output_type == 'v5d' .AND. is_there > 1 ) THEN   !!! Warning for possible bad data file
+       CALL mprintf(.true.,STDOUT, '   WARNING: This will create a problem for VIS5D, please ' )
+       CALL mprintf(.true.,STDOUT, '            remove these fields from your input list and ' )
+       CALL mprintf(.true.,STDOUT, '            run the code again.                          ' )
+       CALL mprintf(.true.,STDOUT, '                                                         ' )
+     END IF
+#endif
+     DO WHILE ( is_there > 1 ) 
+       PRINT*,"           ", could_not_find(1:is_there-1)
+       could_not_find = could_not_find(is_there+1:len_trim(could_not_find))
+       is_there = INDEX(could_not_find,",")
+     END DO
+   
+   CALL mprintf(.true.,STDOUT, '   ')
+   ENDIF
+    
+
+   END SUBROUTINE get_fields
+
+END MODULE process_domain_module
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/psadilookup.dat
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/psadilookup.dat	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/psadilookup.dat	(revision 207)
@@ -0,0 +1,4575 @@
+ This formatted F77 output file contains lookup data
+ for obtaining temperature (K) on a pseudoadiabat,
+ given pressure (hPa) and theta_e (K).  It is based
+ on the Bolton (1980) formula for theta_e.  It can be
+ read in as follows:
+       do i=1,14
+          read(iunit,*)
+       enddo
+       read(iunit,*) nthte,nprs
+       read(iunit,173) (thtelevs(jt),jt=1,nthte)
+       read(iunit,173) (prslevs(ip),ip=1,nprs)
+       read(iunit,173) ((arr(ip,jt),ip=1,nprs),jt=1,nthte)
+  173  format(5e15.7)
+ Start data:
+   150  150
+  0.2000000E+03  0.2016653E+03  0.2033444E+03  0.2050374E+03  0.2067446E+03
+  0.2084660E+03  0.2102018E+03  0.2119519E+03  0.2137168E+03  0.2154962E+03
+  0.2172905E+03  0.2190997E+03  0.2209240E+03  0.2227634E+03  0.2246182E+03
+  0.2264884E+03  0.2283742E+03  0.2302757E+03  0.2321930E+03  0.2341263E+03
+  0.2360757E+03  0.2380413E+03  0.2400232E+03  0.2420218E+03  0.2440370E+03
+  0.2460689E+03  0.2481177E+03  0.2501835E+03  0.2522666E+03  0.2543671E+03
+  0.2564850E+03  0.2586205E+03  0.2607738E+03  0.2629451E+03  0.2651344E+03
+  0.2673420E+03  0.2695679E+03  0.2718124E+03  0.2740757E+03  0.2763577E+03
+  0.2786587E+03  0.2809789E+03  0.2833184E+03  0.2856773E+03  0.2880559E+03
+  0.2904543E+03  0.2928727E+03  0.2953112E+03  0.2977700E+03  0.3002493E+03
+  0.3027493E+03  0.3052700E+03  0.3078117E+03  0.3103748E+03  0.3129590E+03
+  0.3155648E+03  0.3181922E+03  0.3208416E+03  0.3235130E+03  0.3262066E+03
+  0.3289226E+03  0.3316613E+03  0.3344228E+03  0.3372073E+03  0.3400149E+03
+  0.3428459E+03  0.3457006E+03  0.3485789E+03  0.3514814E+03  0.3544079E+03
+  0.3573588E+03  0.3603342E+03  0.3633344E+03  0.3663596E+03  0.3694100E+03
+  0.3724858E+03  0.3755872E+03  0.3787144E+03  0.3818676E+03  0.3850471E+03
+  0.3882531E+03  0.3914858E+03  0.3947454E+03  0.3980323E+03  0.4013464E+03
+  0.4046881E+03  0.4080576E+03  0.4114552E+03  0.4148810E+03  0.4183354E+03
+  0.4218185E+03  0.4253307E+03  0.4288721E+03  0.4324429E+03  0.4360435E+03
+  0.4396741E+03  0.4433349E+03  0.4470262E+03  0.4507485E+03  0.4545015E+03
+  0.4582858E+03  0.4621015E+03  0.4659491E+03  0.4698286E+03  0.4737405E+03
+  0.4776850E+03  0.4816623E+03  0.4856727E+03  0.4897165E+03  0.4937940E+03
+  0.4979054E+03  0.5020511E+03  0.5062312E+03  0.5104465E+03  0.5146965E+03
+  0.5189820E+03  0.5233032E+03  0.5276603E+03  0.5320536E+03  0.5364836E+03
+  0.5409505E+03  0.5454546E+03  0.5499962E+03  0.5545755E+03  0.5591930E+03
+  0.5638489E+03  0.5685437E+03  0.5732775E+03  0.5780510E+03  0.5828636E+03
+  0.5877170E+03  0.5926104E+03  0.5975446E+03  0.6025199E+03  0.6075366E+03
+  0.6125950E+03  0.6176956E+03  0.6228387E+03  0.6280245E+03  0.6332536E+03
+  0.6385262E+03  0.6438427E+03  0.6492034E+03  0.6546091E+03  0.6600593E+03
+  0.6655554E+03  0.6710969E+03  0.6766846E+03  0.6823188E+03  0.6879999E+03
+  0.1100000E+04  0.1075803E+04  0.1052138E+04  0.1028994E+04  0.1006359E+04
+  0.9842219E+03  0.9625715E+03  0.9413974E+03  0.9206895E+03  0.9004366E+03
+  0.8806293E+03  0.8612581E+03  0.8423126E+03  0.8237839E+03  0.8056631E+03
+  0.7879406E+03  0.7706078E+03  0.7536568E+03  0.7370782E+03  0.7208644E+03
+  0.7050075E+03  0.6894991E+03  0.6743322E+03  0.6594986E+03  0.6449913E+03
+  0.6308035E+03  0.6169274E+03  0.6033565E+03  0.5900845E+03  0.5771041E+03
+  0.5644093E+03  0.5519940E+03  0.5398515E+03  0.5279761E+03  0.5163622E+03
+  0.5050036E+03  0.4938948E+03  0.4830306E+03  0.4724051E+03  0.4620134E+03
+  0.4518505E+03  0.4419109E+03  0.4321902E+03  0.4226831E+03  0.4133852E+03
+  0.4042919E+03  0.3953985E+03  0.3867007E+03  0.3781945E+03  0.3698752E+03
+  0.3617389E+03  0.3537817E+03  0.3459994E+03  0.3383883E+03  0.3309447E+03
+  0.3236648E+03  0.3165450E+03  0.3095819E+03  0.3027719E+03  0.2961117E+03
+  0.2895981E+03  0.2832277E+03  0.2769974E+03  0.2709043E+03  0.2649451E+03
+  0.2591170E+03  0.2534172E+03  0.2478426E+03  0.2423907E+03  0.2370589E+03
+  0.2318442E+03  0.2267442E+03  0.2217565E+03  0.2168784E+03  0.2121076E+03
+  0.2074419E+03  0.2028787E+03  0.1984159E+03  0.1940513E+03  0.1897827E+03
+  0.1856079E+03  0.1815251E+03  0.1775320E+03  0.1736268E+03  0.1698075E+03
+  0.1660722E+03  0.1624190E+03  0.1588463E+03  0.1553521E+03  0.1519347E+03
+  0.1485926E+03  0.1453240E+03  0.1421272E+03  0.1390008E+03  0.1359432E+03
+  0.1329527E+03  0.1300282E+03  0.1271679E+03  0.1243705E+03  0.1216347E+03
+  0.1189591E+03  0.1163423E+03  0.1137831E+03  0.1112802E+03  0.1088323E+03
+  0.1064383E+03  0.1040970E+03  0.1018071E+03  0.9956760E+02  0.9737740E+02
+  0.9523535E+02  0.9314041E+02  0.9109160E+02  0.8908781E+02  0.8712811E+02
+  0.8521156E+02  0.8333711E+02  0.8150391E+02  0.7971107E+02  0.7795763E+02
+  0.7624275E+02  0.7456564E+02  0.7292538E+02  0.7132121E+02  0.6975236E+02
+  0.6821799E+02  0.6671736E+02  0.6524978E+02  0.6381445E+02  0.6241069E+02
+  0.6103785E+02  0.5969517E+02  0.5838202E+02  0.5709779E+02  0.5584179E+02
+  0.5461341E+02  0.5341208E+02  0.5223714E+02  0.5108807E+02  0.4996428E+02
+  0.4886519E+02  0.4779029E+02  0.4673904E+02  0.4571090E+02  0.4470538E+02
+  0.4372198E+02  0.4276021E+02  0.4181961E+02  0.4089969E+02  0.4000000E+02
+  0.2055137E+03  0.2042125E+03  0.2029193E+03  0.2016342E+03  0.2003570E+03
+  0.1990878E+03  0.1978265E+03  0.1965731E+03  0.1953276E+03  0.1940898E+03
+  0.1928599E+03  0.1916377E+03  0.1904232E+03  0.1892163E+03  0.1880171E+03
+  0.1868254E+03  0.1856413E+03  0.1844646E+03  0.1832954E+03  0.1821335E+03
+  0.1809791E+03  0.1798319E+03  0.1786920E+03  0.1775593E+03  0.1764338E+03
+  0.1753154E+03  0.1742041E+03  0.1730999E+03  0.1720026E+03  0.1709123E+03
+  0.1698289E+03  0.1687524E+03  0.1676826E+03  0.1666197E+03  0.1655635E+03
+  0.1645140E+03  0.1634712E+03  0.1624350E+03  0.1614053E+03  0.1603821E+03
+  0.1593655E+03  0.1583553E+03  0.1573515E+03  0.1563540E+03  0.1553629E+03
+  0.1543781E+03  0.1533994E+03  0.1524270E+03  0.1514608E+03  0.1505007E+03
+  0.1495467E+03  0.1485987E+03  0.1476568E+03  0.1467207E+03  0.1457907E+03
+  0.1448665E+03  0.1439482E+03  0.1430358E+03  0.1421290E+03  0.1412281E+03
+  0.1403329E+03  0.1394433E+03  0.1385594E+03  0.1376810E+03  0.1368083E+03
+  0.1359410E+03  0.1350793E+03  0.1342231E+03  0.1333722E+03  0.1325268E+03
+  0.1316867E+03  0.1308519E+03  0.1300225E+03  0.1291983E+03  0.1283793E+03
+  0.1275655E+03  0.1267568E+03  0.1259533E+03  0.1251549E+03  0.1243616E+03
+  0.1235732E+03  0.1227899E+03  0.1220116E+03  0.1212381E+03  0.1204696E+03
+  0.1197059E+03  0.1189471E+03  0.1181931E+03  0.1174439E+03  0.1166994E+03
+  0.1159597E+03  0.1152246E+03  0.1144942E+03  0.1137684E+03  0.1130473E+03
+  0.1123306E+03  0.1116186E+03  0.1109110E+03  0.1102080E+03  0.1095094E+03
+  0.1088152E+03  0.1081254E+03  0.1074400E+03  0.1067590E+03  0.1060822E+03
+  0.1054098E+03  0.1047416E+03  0.1040776E+03  0.1034179E+03  0.1027623E+03
+  0.1021109E+03  0.1014636E+03  0.1008204E+03  0.1001813E+03  0.9954629E+02
+  0.9891528E+02  0.9828825E+02  0.9766520E+02  0.9704611E+02  0.9643093E+02
+  0.9581966E+02  0.9521227E+02  0.9460871E+02  0.9400898E+02  0.9341307E+02
+  0.9282092E+02  0.9223253E+02  0.9164787E+02  0.9106693E+02  0.9048965E+02
+  0.8991605E+02  0.8934606E+02  0.8877969E+02  0.8821693E+02  0.8765772E+02
+  0.8710206E+02  0.8654993E+02  0.8600128E+02  0.8545613E+02  0.8491442E+02
+  0.8437615E+02  0.8384129E+02  0.8330983E+02  0.8278172E+02  0.8225697E+02
+  0.8173555E+02  0.8121742E+02  0.8070259E+02  0.8019102E+02  0.7968269E+02
+  0.2072220E+03  0.2059104E+03  0.2046068E+03  0.2033112E+03  0.2020237E+03
+  0.2007441E+03  0.1994725E+03  0.1982088E+03  0.1969531E+03  0.1957052E+03
+  0.1944651E+03  0.1932328E+03  0.1920082E+03  0.1907914E+03  0.1895822E+03
+  0.1883807E+03  0.1871867E+03  0.1860003E+03  0.1848214E+03  0.1836499E+03
+  0.1824858E+03  0.1813291E+03  0.1801797E+03  0.1790376E+03  0.1779028E+03
+  0.1767751E+03  0.1756546E+03  0.1745411E+03  0.1734347E+03  0.1723353E+03
+  0.1712429E+03  0.1701574E+03  0.1690788E+03  0.1680070E+03  0.1669420E+03
+  0.1658838E+03  0.1648323E+03  0.1637874E+03  0.1627491E+03  0.1617175E+03
+  0.1606924E+03  0.1596737E+03  0.1586616E+03  0.1576558E+03  0.1566565E+03
+  0.1556634E+03  0.1546767E+03  0.1536962E+03  0.1527219E+03  0.1517538E+03
+  0.1507918E+03  0.1498360E+03  0.1488862E+03  0.1479424E+03  0.1470046E+03
+  0.1460727E+03  0.1451468E+03  0.1442267E+03  0.1433124E+03  0.1424040E+03
+  0.1415013E+03  0.1406043E+03  0.1397130E+03  0.1388274E+03  0.1379474E+03
+  0.1370729E+03  0.1362040E+03  0.1353406E+03  0.1344827E+03  0.1336302E+03
+  0.1327831E+03  0.1319414E+03  0.1311051E+03  0.1302740E+03  0.1294482E+03
+  0.1286276E+03  0.1278122E+03  0.1270020E+03  0.1261970E+03  0.1253970E+03
+  0.1246021E+03  0.1238123E+03  0.1230274E+03  0.1222476E+03  0.1214727E+03
+  0.1207026E+03  0.1199375E+03  0.1191772E+03  0.1184218E+03  0.1176711E+03
+  0.1169252E+03  0.1161840E+03  0.1154475E+03  0.1147157E+03  0.1139885E+03
+  0.1132659E+03  0.1125479E+03  0.1118345E+03  0.1111256E+03  0.1104212E+03
+  0.1097212E+03  0.1090257E+03  0.1083346E+03  0.1076479E+03  0.1069655E+03
+  0.1062874E+03  0.1056137E+03  0.1049442E+03  0.1042789E+03  0.1036179E+03
+  0.1029611E+03  0.1023084E+03  0.1016599E+03  0.1010155E+03  0.1003751E+03
+  0.9973886E+02  0.9910662E+02  0.9847838E+02  0.9785413E+02  0.9723383E+02
+  0.9661746E+02  0.9600502E+02  0.9539644E+02  0.9479172E+02  0.9419085E+02
+  0.9359377E+02  0.9300048E+02  0.9241096E+02  0.9182516E+02  0.9124308E+02
+  0.9066470E+02  0.9008997E+02  0.8951889E+02  0.8895144E+02  0.8838757E+02
+  0.8782729E+02  0.8727055E+02  0.8671735E+02  0.8616765E+02  0.8562144E+02
+  0.8507868E+02  0.8453938E+02  0.8400348E+02  0.8347099E+02  0.8294186E+02
+  0.8241610E+02  0.8189366E+02  0.8137453E+02  0.8085871E+02  0.8034615E+02
+  0.2089439E+03  0.2076218E+03  0.2063078E+03  0.2050018E+03  0.2037038E+03
+  0.2024139E+03  0.2011320E+03  0.1998580E+03  0.1985919E+03  0.1973338E+03
+  0.1960835E+03  0.1948410E+03  0.1936064E+03  0.1923795E+03  0.1911603E+03
+  0.1899489E+03  0.1887450E+03  0.1875488E+03  0.1863600E+03  0.1851788E+03
+  0.1840051E+03  0.1828388E+03  0.1816799E+03  0.1805283E+03  0.1793840E+03
+  0.1782469E+03  0.1771171E+03  0.1759943E+03  0.1748787E+03  0.1737702E+03
+  0.1726687E+03  0.1715742E+03  0.1704866E+03  0.1694059E+03  0.1683320E+03
+  0.1672650E+03  0.1662047E+03  0.1651511E+03  0.1641042E+03  0.1630640E+03
+  0.1620303E+03  0.1610032E+03  0.1599826E+03  0.1589685E+03  0.1579608E+03
+  0.1569595E+03  0.1559646E+03  0.1549759E+03  0.1539935E+03  0.1530173E+03
+  0.1520474E+03  0.1510835E+03  0.1501258E+03  0.1491742E+03  0.1482286E+03
+  0.1472890E+03  0.1463553E+03  0.1454276E+03  0.1445057E+03  0.1435897E+03
+  0.1426795E+03  0.1417750E+03  0.1408763E+03  0.1399833E+03  0.1390959E+03
+  0.1382142E+03  0.1373381E+03  0.1364675E+03  0.1356024E+03  0.1347429E+03
+  0.1338887E+03  0.1330400E+03  0.1321967E+03  0.1313587E+03  0.1305260E+03
+  0.1296986E+03  0.1288764E+03  0.1280595E+03  0.1272477E+03  0.1264411E+03
+  0.1256396E+03  0.1248432E+03  0.1240518E+03  0.1232654E+03  0.1224841E+03
+  0.1217076E+03  0.1209361E+03  0.1201695E+03  0.1194078E+03  0.1186508E+03
+  0.1178987E+03  0.1171514E+03  0.1164087E+03  0.1156708E+03  0.1149376E+03
+  0.1142090E+03  0.1134850E+03  0.1127657E+03  0.1120508E+03  0.1113406E+03
+  0.1106348E+03  0.1099334E+03  0.1092366E+03  0.1085442E+03  0.1078561E+03
+  0.1071724E+03  0.1064930E+03  0.1058180E+03  0.1051472E+03  0.1044807E+03
+  0.1038184E+03  0.1031603E+03  0.1025063E+03  0.1018565E+03  0.1012109E+03
+  0.1005693E+03  0.9993180E+02  0.9929833E+02  0.9866888E+02  0.9804343E+02
+  0.9742192E+02  0.9680437E+02  0.9619073E+02  0.9558098E+02  0.9497511E+02
+  0.9437305E+02  0.9377482E+02  0.9318039E+02  0.9258971E+02  0.9200278E+02
+  0.9141959E+02  0.9084009E+02  0.9026424E+02  0.8969207E+02  0.8912351E+02
+  0.8855856E+02  0.8799719E+02  0.8743938E+02  0.8688510E+02  0.8633434E+02
+  0.8578706E+02  0.8524326E+02  0.8470291E+02  0.8416598E+02  0.8363245E+02
+  0.8310231E+02  0.8257552E+02  0.8205208E+02  0.8153195E+02  0.8101512E+02
+  0.2106792E+03  0.2093467E+03  0.2080223E+03  0.2067059E+03  0.2053975E+03
+  0.2040972E+03  0.2028048E+03  0.2015205E+03  0.2002441E+03  0.1989757E+03
+  0.1977151E+03  0.1964625E+03  0.1952177E+03  0.1939807E+03  0.1927515E+03
+  0.1915300E+03  0.1903162E+03  0.1891100E+03  0.1879115E+03  0.1867205E+03
+  0.1855370E+03  0.1843610E+03  0.1831925E+03  0.1820313E+03  0.1808775E+03
+  0.1797310E+03  0.1785917E+03  0.1774596E+03  0.1763348E+03  0.1752170E+03
+  0.1741063E+03  0.1730027E+03  0.1719061E+03  0.1708164E+03  0.1697336E+03
+  0.1686576E+03  0.1675885E+03  0.1665262E+03  0.1654706E+03  0.1644217E+03
+  0.1633794E+03  0.1623438E+03  0.1613147E+03  0.1602921E+03  0.1592760E+03
+  0.1582664E+03  0.1572631E+03  0.1562663E+03  0.1552757E+03  0.1542914E+03
+  0.1533133E+03  0.1523415E+03  0.1513758E+03  0.1504162E+03  0.1494628E+03
+  0.1485153E+03  0.1475739E+03  0.1466384E+03  0.1457089E+03  0.1447852E+03
+  0.1438674E+03  0.1429555E+03  0.1420493E+03  0.1411488E+03  0.1402541E+03
+  0.1393650E+03  0.1384816E+03  0.1376037E+03  0.1367315E+03  0.1358647E+03
+  0.1350035E+03  0.1341477E+03  0.1332974E+03  0.1324524E+03  0.1316128E+03
+  0.1307785E+03  0.1299495E+03  0.1291257E+03  0.1283072E+03  0.1274939E+03
+  0.1266857E+03  0.1258826E+03  0.1250847E+03  0.1242918E+03  0.1235039E+03
+  0.1227210E+03  0.1219431E+03  0.1211701E+03  0.1204020E+03  0.1196387E+03
+  0.1188804E+03  0.1181268E+03  0.1173780E+03  0.1166339E+03  0.1158946E+03
+  0.1151599E+03  0.1144299E+03  0.1137046E+03  0.1129838E+03  0.1122676E+03
+  0.1115559E+03  0.1108488E+03  0.1101461E+03  0.1094479E+03  0.1087541E+03
+  0.1080647E+03  0.1073797E+03  0.1066990E+03  0.1060227E+03  0.1053506E+03
+  0.1046828E+03  0.1040192E+03  0.1033598E+03  0.1027046E+03  0.1020536E+03
+  0.1014067E+03  0.1007639E+03  0.1001251E+03  0.9949043E+02  0.9885976E+02
+  0.9823308E+02  0.9761039E+02  0.9699163E+02  0.9637680E+02  0.9576588E+02
+  0.9515882E+02  0.9455560E+02  0.9395622E+02  0.9336064E+02  0.9276882E+02
+  0.9218077E+02  0.9159644E+02  0.9101580E+02  0.9043887E+02  0.8986557E+02
+  0.8929591E+02  0.8872987E+02  0.8816741E+02  0.8760852E+02  0.8705318E+02
+  0.8650134E+02  0.8595302E+02  0.8540816E+02  0.8486676E+02  0.8432879E+02
+  0.8379424E+02  0.8326306E+02  0.8273526E+02  0.8221081E+02  0.8168967E+02
+  0.2124279E+03  0.2110851E+03  0.2097502E+03  0.2084234E+03  0.2071046E+03
+  0.2057939E+03  0.2044911E+03  0.2031965E+03  0.2019097E+03  0.2006310E+03
+  0.1993601E+03  0.1980973E+03  0.1968422E+03  0.1955951E+03  0.1943557E+03
+  0.1931241E+03  0.1919003E+03  0.1906842E+03  0.1894757E+03  0.1882748E+03
+  0.1870816E+03  0.1858958E+03  0.1847176E+03  0.1835468E+03  0.1823834E+03
+  0.1812273E+03  0.1800786E+03  0.1789371E+03  0.1778029E+03  0.1766758E+03
+  0.1755559E+03  0.1744431E+03  0.1733374E+03  0.1722386E+03  0.1711468E+03
+  0.1700619E+03  0.1689839E+03  0.1679127E+03  0.1668483E+03  0.1657907E+03
+  0.1647397E+03  0.1636955E+03  0.1626578E+03  0.1616267E+03  0.1606022E+03
+  0.1595841E+03  0.1585725E+03  0.1575673E+03  0.1565685E+03  0.1555760E+03
+  0.1545898E+03  0.1536099E+03  0.1526362E+03  0.1516686E+03  0.1507072E+03
+  0.1497519E+03  0.1488026E+03  0.1478593E+03  0.1469221E+03  0.1459907E+03
+  0.1450653E+03  0.1441457E+03  0.1432320E+03  0.1423241E+03  0.1414219E+03
+  0.1405254E+03  0.1396346E+03  0.1387495E+03  0.1378699E+03  0.1369960E+03
+  0.1361275E+03  0.1352646E+03  0.1344072E+03  0.1335552E+03  0.1327086E+03
+  0.1318674E+03  0.1310315E+03  0.1302009E+03  0.1293755E+03  0.1285554E+03
+  0.1277405E+03  0.1269308E+03  0.1261261E+03  0.1253266E+03  0.1245322E+03
+  0.1237428E+03  0.1229584E+03  0.1221789E+03  0.1214044E+03  0.1206349E+03
+  0.1198702E+03  0.1191103E+03  0.1183553E+03  0.1176050E+03  0.1168596E+03
+  0.1161188E+03  0.1153827E+03  0.1146513E+03  0.1139245E+03  0.1132024E+03
+  0.1124848E+03  0.1117717E+03  0.1110632E+03  0.1103592E+03  0.1096596E+03
+  0.1089645E+03  0.1082738E+03  0.1075874E+03  0.1069054E+03  0.1062278E+03
+  0.1055544E+03  0.1048853E+03  0.1042204E+03  0.1035598E+03  0.1029033E+03
+  0.1022510E+03  0.1016028E+03  0.1009588E+03  0.1003188E+03  0.9968288E+02
+  0.9905098E+02  0.9842310E+02  0.9779919E+02  0.9717924E+02  0.9656324E+02
+  0.9595113E+02  0.9534289E+02  0.9473852E+02  0.9413797E+02  0.9354123E+02
+  0.9294828E+02  0.9235908E+02  0.9177361E+02  0.9119187E+02  0.9061380E+02
+  0.9003940E+02  0.8946865E+02  0.8890150E+02  0.8833797E+02  0.8777799E+02
+  0.8722157E+02  0.8666867E+02  0.8611929E+02  0.8557337E+02  0.8503092E+02
+  0.8449192E+02  0.8395632E+02  0.8342413E+02  0.8289530E+02  0.8236983E+02
+  0.2141900E+03  0.2128368E+03  0.2114916E+03  0.2101544E+03  0.2088253E+03
+  0.2075041E+03  0.2061910E+03  0.2048859E+03  0.2035888E+03  0.2022997E+03
+  0.2010186E+03  0.1997454E+03  0.1984801E+03  0.1972227E+03  0.1959732E+03
+  0.1947315E+03  0.1934975E+03  0.1922714E+03  0.1910529E+03  0.1898421E+03
+  0.1886390E+03  0.1874434E+03  0.1862554E+03  0.1850749E+03  0.1839018E+03
+  0.1827361E+03  0.1815779E+03  0.1804269E+03  0.1792833E+03  0.1781469E+03
+  0.1770176E+03  0.1758956E+03  0.1747806E+03  0.1736727E+03  0.1725718E+03
+  0.1714778E+03  0.1703909E+03  0.1693108E+03  0.1682375E+03  0.1671711E+03
+  0.1661114E+03  0.1650584E+03  0.1640121E+03  0.1629725E+03  0.1619394E+03
+  0.1609129E+03  0.1598928E+03  0.1588793E+03  0.1578722E+03  0.1568714E+03
+  0.1558770E+03  0.1548889E+03  0.1539071E+03  0.1529314E+03  0.1519620E+03
+  0.1509987E+03  0.1500415E+03  0.1490905E+03  0.1481454E+03  0.1472063E+03
+  0.1462731E+03  0.1453459E+03  0.1444246E+03  0.1435091E+03  0.1425994E+03
+  0.1416954E+03  0.1407972E+03  0.1399047E+03  0.1390179E+03  0.1381366E+03
+  0.1372610E+03  0.1363909E+03  0.1355263E+03  0.1346672E+03  0.1338136E+03
+  0.1329653E+03  0.1321225E+03  0.1312849E+03  0.1304527E+03  0.1296258E+03
+  0.1288041E+03  0.1279876E+03  0.1271763E+03  0.1263701E+03  0.1255691E+03
+  0.1247731E+03  0.1239822E+03  0.1231962E+03  0.1224153E+03  0.1216393E+03
+  0.1208682E+03  0.1201021E+03  0.1193407E+03  0.1185842E+03  0.1178326E+03
+  0.1170856E+03  0.1163434E+03  0.1156059E+03  0.1148731E+03  0.1141449E+03
+  0.1134213E+03  0.1127024E+03  0.1119879E+03  0.1112781E+03  0.1105727E+03
+  0.1098717E+03  0.1091753E+03  0.1084832E+03  0.1077955E+03  0.1071122E+03
+  0.1064333E+03  0.1057586E+03  0.1050882E+03  0.1044220E+03  0.1037601E+03
+  0.1031024E+03  0.1024488E+03  0.1017994E+03  0.1011541E+03  0.1005129E+03
+  0.9987570E+02  0.9924260E+02  0.9861349E+02  0.9798839E+02  0.9736725E+02
+  0.9675004E+02  0.9613673E+02  0.9552733E+02  0.9492178E+02  0.9432008E+02
+  0.9372219E+02  0.9312808E+02  0.9253774E+02  0.9195116E+02  0.9136827E+02
+  0.9078909E+02  0.9021358E+02  0.8964172E+02  0.8907349E+02  0.8850885E+02
+  0.8794779E+02  0.8739030E+02  0.8683633E+02  0.8628588E+02  0.8573891E+02
+  0.8519542E+02  0.8465536E+02  0.8411874E+02  0.8358551E+02  0.8305566E+02
+  0.2159651E+03  0.2146017E+03  0.2132463E+03  0.2118988E+03  0.2105593E+03
+  0.2092278E+03  0.2079043E+03  0.2065888E+03  0.2052813E+03  0.2039818E+03
+  0.2026904E+03  0.2014068E+03  0.2001312E+03  0.1988636E+03  0.1976039E+03
+  0.1963520E+03  0.1951079E+03  0.1938716E+03  0.1926431E+03  0.1914223E+03
+  0.1902092E+03  0.1890038E+03  0.1878059E+03  0.1866156E+03  0.1854328E+03
+  0.1842575E+03  0.1830896E+03  0.1819291E+03  0.1807759E+03  0.1796301E+03
+  0.1784914E+03  0.1773600E+03  0.1762358E+03  0.1751186E+03  0.1740086E+03
+  0.1729056E+03  0.1718096E+03  0.1707205E+03  0.1696383E+03  0.1685630E+03
+  0.1674945E+03  0.1664327E+03  0.1653777E+03  0.1643294E+03  0.1632877E+03
+  0.1622527E+03  0.1612241E+03  0.1602021E+03  0.1591866E+03  0.1581776E+03
+  0.1571749E+03  0.1561785E+03  0.1551885E+03  0.1542048E+03  0.1532273E+03
+  0.1522560E+03  0.1512908E+03  0.1503318E+03  0.1493789E+03  0.1484319E+03
+  0.1474910E+03  0.1465561E+03  0.1456271E+03  0.1447040E+03  0.1437867E+03
+  0.1428752E+03  0.1419695E+03  0.1410696E+03  0.1401754E+03  0.1392868E+03
+  0.1384039E+03  0.1375265E+03  0.1366548E+03  0.1357885E+03  0.1349277E+03
+  0.1340724E+03  0.1332225E+03  0.1323780E+03  0.1315389E+03  0.1307051E+03
+  0.1298765E+03  0.1290533E+03  0.1282352E+03  0.1274223E+03  0.1266146E+03
+  0.1258120E+03  0.1250145E+03  0.1242220E+03  0.1234345E+03  0.1226521E+03
+  0.1218746E+03  0.1211021E+03  0.1203344E+03  0.1195716E+03  0.1188137E+03
+  0.1180605E+03  0.1173121E+03  0.1165685E+03  0.1158295E+03  0.1150953E+03
+  0.1143657E+03  0.1136407E+03  0.1129204E+03  0.1122046E+03  0.1114933E+03
+  0.1107866E+03  0.1100843E+03  0.1093865E+03  0.1086931E+03  0.1080041E+03
+  0.1073194E+03  0.1066391E+03  0.1059632E+03  0.1052915E+03  0.1046240E+03
+  0.1039608E+03  0.1033018E+03  0.1026470E+03  0.1019963E+03  0.1013497E+03
+  0.1007073E+03  0.1000689E+03  0.9943457E+02  0.9880426E+02  0.9817795E+02
+  0.9755560E+02  0.9693719E+02  0.9632272E+02  0.9571213E+02  0.9510540E+02
+  0.9450254E+02  0.9390349E+02  0.9330823E+02  0.9271676E+02  0.9212903E+02
+  0.9154501E+02  0.9096472E+02  0.9038809E+02  0.8981513E+02  0.8924580E+02
+  0.8868007E+02  0.8811793E+02  0.8755936E+02  0.8700431E+02  0.8645279E+02
+  0.8590478E+02  0.8536022E+02  0.8481912E+02  0.8428146E+02  0.8374720E+02
+  0.2177531E+03  0.2163797E+03  0.2150141E+03  0.2136564E+03  0.2123066E+03
+  0.2109648E+03  0.2096309E+03  0.2083051E+03  0.2069873E+03  0.2056774E+03
+  0.2043755E+03  0.2030817E+03  0.2017958E+03  0.2005179E+03  0.1992478E+03
+  0.1979857E+03  0.1967314E+03  0.1954850E+03  0.1942464E+03  0.1930155E+03
+  0.1917924E+03  0.1905770E+03  0.1893693E+03  0.1881691E+03  0.1869765E+03
+  0.1857914E+03  0.1846139E+03  0.1834437E+03  0.1822810E+03  0.1811256E+03
+  0.1799775E+03  0.1788367E+03  0.1777031E+03  0.1765767E+03  0.1754574E+03
+  0.1743452E+03  0.1732400E+03  0.1721419E+03  0.1710507E+03  0.1699664E+03
+  0.1688891E+03  0.1678185E+03  0.1667547E+03  0.1656976E+03  0.1646473E+03
+  0.1636036E+03  0.1625665E+03  0.1615360E+03  0.1605120E+03  0.1594946E+03
+  0.1584835E+03  0.1574789E+03  0.1564807E+03  0.1554887E+03  0.1545031E+03
+  0.1535237E+03  0.1525505E+03  0.1515835E+03  0.1506226E+03  0.1496678E+03
+  0.1487191E+03  0.1477764E+03  0.1468396E+03  0.1459088E+03  0.1449839E+03
+  0.1440648E+03  0.1431516E+03  0.1422442E+03  0.1413425E+03  0.1404465E+03
+  0.1395562E+03  0.1386716E+03  0.1377926E+03  0.1369191E+03  0.1360511E+03
+  0.1351887E+03  0.1343318E+03  0.1334802E+03  0.1326341E+03  0.1317934E+03
+  0.1309579E+03  0.1301278E+03  0.1293029E+03  0.1284832E+03  0.1276688E+03
+  0.1268595E+03  0.1260553E+03  0.1252563E+03  0.1244623E+03  0.1236733E+03
+  0.1228894E+03  0.1221104E+03  0.1213363E+03  0.1205672E+03  0.1198029E+03
+  0.1190435E+03  0.1182889E+03  0.1175390E+03  0.1167939E+03  0.1160536E+03
+  0.1153179E+03  0.1145869E+03  0.1138606E+03  0.1131388E+03  0.1124216E+03
+  0.1117090E+03  0.1110009E+03  0.1102972E+03  0.1095981E+03  0.1089033E+03
+  0.1082130E+03  0.1075270E+03  0.1068454E+03  0.1061681E+03  0.1054951E+03
+  0.1048264E+03  0.1041619E+03  0.1035016E+03  0.1028455E+03  0.1021936E+03
+  0.1015458E+03  0.1009021E+03  0.1002625E+03  0.9962691E+02  0.9899539E+02
+  0.9836786E+02  0.9774430E+02  0.9712471E+02  0.9650903E+02  0.9589726E+02
+  0.9528938E+02  0.9468534E+02  0.9408513E+02  0.9348873E+02  0.9289610E+02
+  0.9230724E+02  0.9172211E+02  0.9114068E+02  0.9056294E+02  0.8998887E+02
+  0.8941843E+02  0.8885161E+02  0.8828838E+02  0.8772872E+02  0.8717261E+02
+  0.8662003E+02  0.8607094E+02  0.8552534E+02  0.8498320E+02  0.8444449E+02
+  0.2195538E+03  0.2181705E+03  0.2167950E+03  0.2154272E+03  0.2140672E+03
+  0.2127152E+03  0.2113710E+03  0.2100349E+03  0.2087067E+03  0.2073865E+03
+  0.2060743E+03  0.2047701E+03  0.2034738E+03  0.2021856E+03  0.2009053E+03
+  0.1996329E+03  0.1983683E+03  0.1971118E+03  0.1958630E+03  0.1946220E+03
+  0.1933888E+03  0.1921634E+03  0.1909456E+03  0.1897355E+03  0.1885331E+03
+  0.1873382E+03  0.1861509E+03  0.1849710E+03  0.1837986E+03  0.1826336E+03
+  0.1814760E+03  0.1803257E+03  0.1791827E+03  0.1780469E+03  0.1769183E+03
+  0.1757969E+03  0.1746825E+03  0.1735753E+03  0.1724750E+03  0.1713817E+03
+  0.1702953E+03  0.1692158E+03  0.1681432E+03  0.1670773E+03  0.1660182E+03
+  0.1649659E+03  0.1639202E+03  0.1628811E+03  0.1618486E+03  0.1608226E+03
+  0.1598031E+03  0.1587902E+03  0.1577836E+03  0.1567834E+03  0.1557896E+03
+  0.1548020E+03  0.1538207E+03  0.1528457E+03  0.1518768E+03  0.1509140E+03
+  0.1499574E+03  0.1490068E+03  0.1480623E+03  0.1471237E+03  0.1461911E+03
+  0.1452644E+03  0.1443436E+03  0.1434286E+03  0.1425194E+03  0.1416160E+03
+  0.1407183E+03  0.1398262E+03  0.1389399E+03  0.1380592E+03  0.1371840E+03
+  0.1363144E+03  0.1354503E+03  0.1345917E+03  0.1337385E+03  0.1328907E+03
+  0.1320484E+03  0.1312113E+03  0.1303796E+03  0.1295531E+03  0.1287319E+03
+  0.1279158E+03  0.1271050E+03  0.1262993E+03  0.1254986E+03  0.1247031E+03
+  0.1239126E+03  0.1231272E+03  0.1223466E+03  0.1215711E+03  0.1208005E+03
+  0.1200347E+03  0.1192738E+03  0.1185177E+03  0.1177664E+03  0.1170199E+03
+  0.1162782E+03  0.1155411E+03  0.1148086E+03  0.1140809E+03  0.1133577E+03
+  0.1126392E+03  0.1119251E+03  0.1112157E+03  0.1105107E+03  0.1098101E+03
+  0.1091141E+03  0.1084224E+03  0.1077351E+03  0.1070522E+03  0.1063736E+03
+  0.1056993E+03  0.1050292E+03  0.1043634E+03  0.1037019E+03  0.1030445E+03
+  0.1023913E+03  0.1017423E+03  0.1010973E+03  0.1004565E+03  0.9981970E+02
+  0.9918694E+02  0.9855819E+02  0.9793344E+02  0.9731264E+02  0.9669577E+02
+  0.9608283E+02  0.9547376E+02  0.9486855E+02  0.9426719E+02  0.9366962E+02
+  0.9307585E+02  0.9248586E+02  0.9189958E+02  0.9131704E+02  0.9073818E+02
+  0.9016299E+02  0.8959145E+02  0.8902354E+02  0.8845921E+02  0.8789847E+02
+  0.8734129E+02  0.8678763E+02  0.8623748E+02  0.8569083E+02  0.8514764E+02
+  0.2213667E+03  0.2199737E+03  0.2185884E+03  0.2172107E+03  0.2158407E+03
+  0.2144786E+03  0.2131243E+03  0.2117778E+03  0.2104394E+03  0.2091089E+03
+  0.2077863E+03  0.2064718E+03  0.2051652E+03  0.2038666E+03  0.2025760E+03
+  0.2012933E+03  0.2000185E+03  0.1987517E+03  0.1974927E+03  0.1962415E+03
+  0.1949982E+03  0.1937627E+03  0.1925349E+03  0.1913148E+03  0.1901024E+03
+  0.1888977E+03  0.1877005E+03  0.1865108E+03  0.1853288E+03  0.1841541E+03
+  0.1829869E+03  0.1818270E+03  0.1806745E+03  0.1795293E+03  0.1783913E+03
+  0.1772605E+03  0.1761369E+03  0.1750204E+03  0.1739110E+03  0.1728086E+03
+  0.1717132E+03  0.1706247E+03  0.1695432E+03  0.1684684E+03  0.1674005E+03
+  0.1663394E+03  0.1652850E+03  0.1642372E+03  0.1631962E+03  0.1621617E+03
+  0.1611337E+03  0.1601123E+03  0.1590973E+03  0.1580888E+03  0.1570867E+03
+  0.1560910E+03  0.1551015E+03  0.1541183E+03  0.1531414E+03  0.1521706E+03
+  0.1512060E+03  0.1502475E+03  0.1492951E+03  0.1483487E+03  0.1474083E+03
+  0.1464739E+03  0.1455454E+03  0.1446228E+03  0.1437060E+03  0.1427951E+03
+  0.1418899E+03  0.1409905E+03  0.1400968E+03  0.1392087E+03  0.1383262E+03
+  0.1374494E+03  0.1365781E+03  0.1357123E+03  0.1348521E+03  0.1339972E+03
+  0.1331478E+03  0.1323038E+03  0.1314651E+03  0.1306318E+03  0.1298037E+03
+  0.1289809E+03  0.1281633E+03  0.1273509E+03  0.1265436E+03  0.1257414E+03
+  0.1249444E+03  0.1241524E+03  0.1233653E+03  0.1225833E+03  0.1218063E+03
+  0.1210341E+03  0.1202669E+03  0.1195045E+03  0.1187470E+03  0.1179943E+03
+  0.1172463E+03  0.1165031E+03  0.1157646E+03  0.1150308E+03  0.1143016E+03
+  0.1135770E+03  0.1128571E+03  0.1121417E+03  0.1114308E+03  0.1107244E+03
+  0.1100226E+03  0.1093251E+03  0.1086321E+03  0.1079435E+03  0.1072592E+03
+  0.1065793E+03  0.1059037E+03  0.1052324E+03  0.1045653E+03  0.1039025E+03
+  0.1032439E+03  0.1025894E+03  0.1019391E+03  0.1012929E+03  0.1006508E+03
+  0.1000128E+03  0.9937881E+02  0.9874886E+02  0.9812289E+02  0.9750088E+02
+  0.9688284E+02  0.9626869E+02  0.9565844E+02  0.9505207E+02  0.9444953E+02
+  0.9385081E+02  0.9325591E+02  0.9266476E+02  0.9207736E+02  0.9149368E+02
+  0.9091370E+02  0.9033741E+02  0.8976476E+02  0.8919574E+02  0.8863033E+02
+  0.8806851E+02  0.8751024E+02  0.8695551E+02  0.8640431E+02  0.8585659E+02
+  0.2231913E+03  0.2217890E+03  0.2203941E+03  0.2190067E+03  0.2176269E+03
+  0.2162548E+03  0.2148905E+03  0.2135339E+03  0.2121853E+03  0.2108445E+03
+  0.2095117E+03  0.2081869E+03  0.2068700E+03  0.2055610E+03  0.2042601E+03
+  0.2029671E+03  0.2016820E+03  0.2004049E+03  0.1991356E+03  0.1978743E+03
+  0.1966208E+03  0.1953751E+03  0.1941373E+03  0.1929071E+03  0.1916847E+03
+  0.1904700E+03  0.1892629E+03  0.1880635E+03  0.1868716E+03  0.1856872E+03
+  0.1845103E+03  0.1833408E+03  0.1821787E+03  0.1810240E+03  0.1798766E+03
+  0.1787364E+03  0.1776034E+03  0.1764777E+03  0.1753590E+03  0.1742474E+03
+  0.1731429E+03  0.1720454E+03  0.1709548E+03  0.1698711E+03  0.1687943E+03
+  0.1677244E+03  0.1666612E+03  0.1656047E+03  0.1645550E+03  0.1635118E+03
+  0.1624753E+03  0.1614454E+03  0.1604220E+03  0.1594051E+03  0.1583947E+03
+  0.1573906E+03  0.1563929E+03  0.1554015E+03  0.1544164E+03  0.1534376E+03
+  0.1524650E+03  0.1514985E+03  0.1505381E+03  0.1495839E+03  0.1486357E+03
+  0.1476935E+03  0.1467572E+03  0.1458270E+03  0.1449026E+03  0.1439840E+03
+  0.1430713E+03  0.1421644E+03  0.1412632E+03  0.1403678E+03  0.1394780E+03
+  0.1385938E+03  0.1377153E+03  0.1368423E+03  0.1359749E+03  0.1351129E+03
+  0.1342564E+03  0.1334054E+03  0.1325597E+03  0.1317194E+03  0.1308845E+03
+  0.1300548E+03  0.1292304E+03  0.1284112E+03  0.1275972E+03  0.1267884E+03
+  0.1259847E+03  0.1251861E+03  0.1243925E+03  0.1236040E+03  0.1228205E+03
+  0.1220419E+03  0.1212683E+03  0.1204996E+03  0.1197357E+03  0.1189767E+03
+  0.1182225E+03  0.1174731E+03  0.1167284E+03  0.1159885E+03  0.1152533E+03
+  0.1145227E+03  0.1137967E+03  0.1130754E+03  0.1123586E+03  0.1116463E+03
+  0.1109386E+03  0.1102354E+03  0.1095366E+03  0.1088423E+03  0.1081523E+03
+  0.1074667E+03  0.1067855E+03  0.1061086E+03  0.1054360E+03  0.1047676E+03
+  0.1041035E+03  0.1034436E+03  0.1027879E+03  0.1021363E+03  0.1014889E+03
+  0.1008455E+03  0.1002063E+03  0.9957105E+02  0.9893987E+02  0.9831269E+02
+  0.9768951E+02  0.9707024E+02  0.9645491E+02  0.9584350E+02  0.9523594E+02
+  0.9463224E+02  0.9403238E+02  0.9343630E+02  0.9284402E+02  0.9225548E+02
+  0.9167067E+02  0.9108958E+02  0.9051216E+02  0.8993841E+02  0.8936829E+02
+  0.8880179E+02  0.8823887E+02  0.8767953E+02  0.8712373E+02  0.8657145E+02
+  0.2250271E+03  0.2236158E+03  0.2222117E+03  0.2208149E+03  0.2194255E+03
+  0.2180437E+03  0.2166694E+03  0.2153029E+03  0.2139442E+03  0.2125933E+03
+  0.2112503E+03  0.2099152E+03  0.2085880E+03  0.2072688E+03  0.2059575E+03
+  0.2046542E+03  0.2033588E+03  0.2020714E+03  0.2007919E+03  0.1995203E+03
+  0.1982566E+03  0.1970007E+03  0.1957528E+03  0.1945125E+03  0.1932801E+03
+  0.1920553E+03  0.1908383E+03  0.1896289E+03  0.1884272E+03  0.1872330E+03
+  0.1860463E+03  0.1848671E+03  0.1836954E+03  0.1825311E+03  0.1813741E+03
+  0.1802244E+03  0.1790821E+03  0.1779470E+03  0.1768190E+03  0.1756982E+03
+  0.1745845E+03  0.1734778E+03  0.1723782E+03  0.1712855E+03  0.1701997E+03
+  0.1691209E+03  0.1680488E+03  0.1669835E+03  0.1659250E+03  0.1648733E+03
+  0.1638281E+03  0.1627896E+03  0.1617577E+03  0.1607323E+03  0.1597135E+03
+  0.1587010E+03  0.1576950E+03  0.1566954E+03  0.1557021E+03  0.1547151E+03
+  0.1537344E+03  0.1527599E+03  0.1517915E+03  0.1508293E+03  0.1498732E+03
+  0.1489232E+03  0.1479792E+03  0.1470411E+03  0.1461090E+03  0.1451829E+03
+  0.1442625E+03  0.1433481E+03  0.1424394E+03  0.1415365E+03  0.1406393E+03
+  0.1397478E+03  0.1388619E+03  0.1379817E+03  0.1371070E+03  0.1362379E+03
+  0.1353743E+03  0.1345161E+03  0.1336635E+03  0.1328161E+03  0.1319743E+03
+  0.1311376E+03  0.1303064E+03  0.1294804E+03  0.1286596E+03  0.1278440E+03
+  0.1270336E+03  0.1262284E+03  0.1254282E+03  0.1246331E+03  0.1238431E+03
+  0.1230580E+03  0.1222780E+03  0.1215029E+03  0.1207326E+03  0.1199673E+03
+  0.1192069E+03  0.1184512E+03  0.1177003E+03  0.1169543E+03  0.1162129E+03
+  0.1154762E+03  0.1147442E+03  0.1140168E+03  0.1132941E+03  0.1125759E+03
+  0.1118623E+03  0.1111532E+03  0.1104486E+03  0.1097485E+03  0.1090528E+03
+  0.1083615E+03  0.1076746E+03  0.1069921E+03  0.1063139E+03  0.1056399E+03
+  0.1049703E+03  0.1043049E+03  0.1036437E+03  0.1029867E+03  0.1023339E+03
+  0.1016852E+03  0.1010406E+03  0.1004001E+03  0.9976366E+02  0.9913126E+02
+  0.9850288E+02  0.9787846E+02  0.9725801E+02  0.9664150E+02  0.9602888E+02
+  0.9542016E+02  0.9481530E+02  0.9421426E+02  0.9361704E+02  0.9302361E+02
+  0.9243394E+02  0.9184800E+02  0.9126578E+02  0.9068724E+02  0.9011238E+02
+  0.8954116E+02  0.8897356E+02  0.8840955E+02  0.8784913E+02  0.8729225E+02
+  0.2268734E+03  0.2254536E+03  0.2240407E+03  0.2226348E+03  0.2212361E+03
+  0.2198448E+03  0.2184609E+03  0.2170846E+03  0.2157160E+03  0.2143551E+03
+  0.2130020E+03  0.2116567E+03  0.2103193E+03  0.2089899E+03  0.2076683E+03
+  0.2063547E+03  0.2050490E+03  0.2037513E+03  0.2024615E+03  0.2011796E+03
+  0.1999057E+03  0.1986396E+03  0.1973814E+03  0.1961311E+03  0.1948885E+03
+  0.1936537E+03  0.1924266E+03  0.1912073E+03  0.1899956E+03  0.1887915E+03
+  0.1875950E+03  0.1864061E+03  0.1852247E+03  0.1840507E+03  0.1828841E+03
+  0.1817249E+03  0.1805731E+03  0.1794285E+03  0.1782912E+03  0.1771610E+03
+  0.1760381E+03  0.1749222E+03  0.1738134E+03  0.1727116E+03  0.1716168E+03
+  0.1705290E+03  0.1694480E+03  0.1683739E+03  0.1673066E+03  0.1662460E+03
+  0.1651922E+03  0.1641451E+03  0.1631046E+03  0.1620706E+03  0.1610433E+03
+  0.1600224E+03  0.1590080E+03  0.1580001E+03  0.1569986E+03  0.1560033E+03
+  0.1550144E+03  0.1540318E+03  0.1530554E+03  0.1520852E+03  0.1511211E+03
+  0.1501632E+03  0.1492113E+03  0.1482654E+03  0.1473256E+03  0.1463917E+03
+  0.1454637E+03  0.1445416E+03  0.1436254E+03  0.1427149E+03  0.1418103E+03
+  0.1409113E+03  0.1400181E+03  0.1391305E+03  0.1382486E+03  0.1373722E+03
+  0.1365014E+03  0.1356362E+03  0.1347764E+03  0.1339220E+03  0.1330731E+03
+  0.1322295E+03  0.1313913E+03  0.1305585E+03  0.1297308E+03  0.1289085E+03
+  0.1280914E+03  0.1272794E+03  0.1264725E+03  0.1256708E+03  0.1248742E+03
+  0.1240826E+03  0.1232961E+03  0.1225145E+03  0.1217379E+03  0.1209662E+03
+  0.1201994E+03  0.1194375E+03  0.1186804E+03  0.1179281E+03  0.1171805E+03
+  0.1164377E+03  0.1156996E+03  0.1149662E+03  0.1142374E+03  0.1135133E+03
+  0.1127937E+03  0.1120787E+03  0.1113682E+03  0.1106623E+03  0.1099608E+03
+  0.1092638E+03  0.1085711E+03  0.1078829E+03  0.1071991E+03  0.1065195E+03
+  0.1058443E+03  0.1051733E+03  0.1045066E+03  0.1038442E+03  0.1031859E+03
+  0.1025318E+03  0.1018819E+03  0.1012361E+03  0.1005943E+03  0.9995665E+02
+  0.9932304E+02  0.9869343E+02  0.9806780E+02  0.9744617E+02  0.9682845E+02
+  0.9621465E+02  0.9560476E+02  0.9499872E+02  0.9439652E+02  0.9379815E+02
+  0.9320356E+02  0.9261275E+02  0.9202568E+02  0.9144233E+02  0.9086268E+02
+  0.9028671E+02  0.8971437E+02  0.8914568E+02  0.8858059E+02  0.8801907E+02
+  0.2287293E+03  0.2273016E+03  0.2258803E+03  0.2244658E+03  0.2230582E+03
+  0.2216577E+03  0.2202645E+03  0.2188786E+03  0.2175004E+03  0.2161296E+03
+  0.2147665E+03  0.2134112E+03  0.2120637E+03  0.2107241E+03  0.2093923E+03
+  0.2080685E+03  0.2067525E+03  0.2054445E+03  0.2041444E+03  0.2028523E+03
+  0.2015681E+03  0.2002918E+03  0.1990234E+03  0.1977628E+03  0.1965101E+03
+  0.1952652E+03  0.1940280E+03  0.1927986E+03  0.1915770E+03  0.1903630E+03
+  0.1891566E+03  0.1879578E+03  0.1867666E+03  0.1855829E+03  0.1844067E+03
+  0.1832378E+03  0.1820764E+03  0.1809223E+03  0.1797756E+03  0.1786360E+03
+  0.1775037E+03  0.1763786E+03  0.1752606E+03  0.1741496E+03  0.1730457E+03
+  0.1719488E+03  0.1708588E+03  0.1697758E+03  0.1686996E+03  0.1676302E+03
+  0.1665676E+03  0.1655117E+03  0.1644626E+03  0.1634201E+03  0.1623842E+03
+  0.1613548E+03  0.1603320E+03  0.1593156E+03  0.1583057E+03  0.1573022E+03
+  0.1563051E+03  0.1553143E+03  0.1543298E+03  0.1533515E+03  0.1523794E+03
+  0.1514134E+03  0.1504536E+03  0.1494999E+03  0.1485522E+03  0.1476106E+03
+  0.1466749E+03  0.1457451E+03  0.1448212E+03  0.1439032E+03  0.1429910E+03
+  0.1420846E+03  0.1411839E+03  0.1402890E+03  0.1393997E+03  0.1385160E+03
+  0.1376380E+03  0.1367655E+03  0.1358985E+03  0.1350371E+03  0.1341811E+03
+  0.1333305E+03  0.1324853E+03  0.1316455E+03  0.1308110E+03  0.1299818E+03
+  0.1291579E+03  0.1283391E+03  0.1275256E+03  0.1267172E+03  0.1259140E+03
+  0.1251158E+03  0.1243227E+03  0.1235346E+03  0.1227515E+03  0.1219734E+03
+  0.1212002E+03  0.1204319E+03  0.1196685E+03  0.1189099E+03  0.1181562E+03
+  0.1174072E+03  0.1166629E+03  0.1159234E+03  0.1151886E+03  0.1144584E+03
+  0.1137328E+03  0.1130119E+03  0.1122955E+03  0.1115837E+03  0.1108764E+03
+  0.1101735E+03  0.1094751E+03  0.1087812E+03  0.1080916E+03  0.1074064E+03
+  0.1067256E+03  0.1060490E+03  0.1053768E+03  0.1047088E+03  0.1040451E+03
+  0.1033855E+03  0.1027302E+03  0.1020790E+03  0.1014319E+03  0.1007889E+03
+  0.1001500E+03  0.9951516E+02  0.9888433E+02  0.9825751E+02  0.9763466E+02
+  0.9701575E+02  0.9640078E+02  0.9578969E+02  0.9518249E+02  0.9457912E+02
+  0.9397959E+02  0.9338386E+02  0.9279190E+02  0.9220369E+02  0.9161922E+02
+  0.9103844E+02  0.9046135E+02  0.8988792E+02  0.8931812E+02  0.8875193E+02
+  0.2305941E+03  0.2291589E+03  0.2277299E+03  0.2263072E+03  0.2248912E+03
+  0.2234819E+03  0.2220797E+03  0.2206846E+03  0.2192969E+03  0.2179165E+03
+  0.2165437E+03  0.2151785E+03  0.2138211E+03  0.2124713E+03  0.2111295E+03
+  0.2097954E+03  0.2084693E+03  0.2071510E+03  0.2058407E+03  0.2045383E+03
+  0.2032438E+03  0.2019572E+03  0.2006786E+03  0.1994078E+03  0.1981449E+03
+  0.1968898E+03  0.1956426E+03  0.1944031E+03  0.1931714E+03  0.1919473E+03
+  0.1907310E+03  0.1895223E+03  0.1883213E+03  0.1871278E+03  0.1859418E+03
+  0.1847633E+03  0.1835922E+03  0.1824286E+03  0.1812723E+03  0.1801233E+03
+  0.1789816E+03  0.1778470E+03  0.1767197E+03  0.1755995E+03  0.1744865E+03
+  0.1733804E+03  0.1722814E+03  0.1711893E+03  0.1701042E+03  0.1690259E+03
+  0.1679545E+03  0.1668898E+03  0.1658319E+03  0.1647807E+03  0.1637362E+03
+  0.1626983E+03  0.1616669E+03  0.1606421E+03  0.1596238E+03  0.1586119E+03
+  0.1576065E+03  0.1566075E+03  0.1556147E+03  0.1546283E+03  0.1536481E+03
+  0.1526741E+03  0.1517063E+03  0.1507447E+03  0.1497891E+03  0.1488396E+03
+  0.1478961E+03  0.1469586E+03  0.1460271E+03  0.1451014E+03  0.1441816E+03
+  0.1432676E+03  0.1423595E+03  0.1414570E+03  0.1405603E+03  0.1396693E+03
+  0.1387840E+03  0.1379042E+03  0.1370301E+03  0.1361614E+03  0.1352983E+03
+  0.1344406E+03  0.1335884E+03  0.1327416E+03  0.1319002E+03  0.1310640E+03
+  0.1302332E+03  0.1294077E+03  0.1285874E+03  0.1277723E+03  0.1269623E+03
+  0.1261575E+03  0.1253578E+03  0.1245632E+03  0.1237735E+03  0.1229890E+03
+  0.1222094E+03  0.1214347E+03  0.1206649E+03  0.1199000E+03  0.1191400E+03
+  0.1183847E+03  0.1176343E+03  0.1168886E+03  0.1161477E+03  0.1154114E+03
+  0.1146798E+03  0.1139529E+03  0.1132305E+03  0.1125127E+03  0.1117995E+03
+  0.1110908E+03  0.1103866E+03  0.1096869E+03  0.1089916E+03  0.1083007E+03
+  0.1076142E+03  0.1069320E+03  0.1062542E+03  0.1055806E+03  0.1049114E+03
+  0.1042463E+03  0.1035855E+03  0.1029289E+03  0.1022764E+03  0.1016281E+03
+  0.1009839E+03  0.1003437E+03  0.9970766E+02  0.9907562E+02  0.9844758E+02
+  0.9782352E+02  0.9720343E+02  0.9658725E+02  0.9597499E+02  0.9536661E+02
+  0.9476208E+02  0.9416138E+02  0.9356451E+02  0.9297140E+02  0.9238205E+02
+  0.9179645E+02  0.9121455E+02  0.9063634E+02  0.9006180E+02  0.8949090E+02
+  0.2324663E+03  0.2310246E+03  0.2295885E+03  0.2281583E+03  0.2267343E+03
+  0.2253168E+03  0.2239060E+03  0.2225020E+03  0.2211052E+03  0.2197155E+03
+  0.2183332E+03  0.2169584E+03  0.2155911E+03  0.2142315E+03  0.2128796E+03
+  0.2115355E+03  0.2101992E+03  0.2088708E+03  0.2075502E+03  0.2062375E+03
+  0.2049328E+03  0.2036360E+03  0.2023471E+03  0.2010661E+03  0.1997929E+03
+  0.1985277E+03  0.1972702E+03  0.1960206E+03  0.1947788E+03  0.1935448E+03
+  0.1923184E+03  0.1910998E+03  0.1898888E+03  0.1886854E+03  0.1874897E+03
+  0.1863014E+03  0.1851206E+03  0.1839473E+03  0.1827814E+03  0.1816229E+03
+  0.1804717E+03  0.1793278E+03  0.1781911E+03  0.1770616E+03  0.1759392E+03
+  0.1748240E+03  0.1737158E+03  0.1726147E+03  0.1715205E+03  0.1704332E+03
+  0.1693529E+03  0.1682794E+03  0.1672126E+03  0.1661527E+03  0.1650995E+03
+  0.1640529E+03  0.1630130E+03  0.1619797E+03  0.1609529E+03  0.1599326E+03
+  0.1589188E+03  0.1579114E+03  0.1569104E+03  0.1559158E+03  0.1549274E+03
+  0.1539453E+03  0.1529695E+03  0.1519998E+03  0.1510363E+03  0.1500789E+03
+  0.1491275E+03  0.1481822E+03  0.1472429E+03  0.1463095E+03  0.1453820E+03
+  0.1444605E+03  0.1435448E+03  0.1426348E+03  0.1417307E+03  0.1408322E+03
+  0.1399395E+03  0.1390524E+03  0.1381710E+03  0.1372951E+03  0.1364248E+03
+  0.1355600E+03  0.1347007E+03  0.1338468E+03  0.1329984E+03  0.1321553E+03
+  0.1313176E+03  0.1304852E+03  0.1296580E+03  0.1288361E+03  0.1280195E+03
+  0.1272079E+03  0.1264016E+03  0.1256003E+03  0.1248041E+03  0.1240130E+03
+  0.1232269E+03  0.1224457E+03  0.1216696E+03  0.1208983E+03  0.1201319E+03
+  0.1193704E+03  0.1186137E+03  0.1178618E+03  0.1171147E+03  0.1163723E+03
+  0.1156347E+03  0.1149016E+03  0.1141733E+03  0.1134495E+03  0.1127304E+03
+  0.1120158E+03  0.1113057E+03  0.1106002E+03  0.1098991E+03  0.1092024E+03
+  0.1085102E+03  0.1078224E+03  0.1071389E+03  0.1064597E+03  0.1057849E+03
+  0.1051143E+03  0.1044480E+03  0.1037859E+03  0.1031280E+03  0.1024743E+03
+  0.1018247E+03  0.1011792E+03  0.1005378E+03  0.9990055E+02  0.9926728E+02
+  0.9863802E+02  0.9801276E+02  0.9739146E+02  0.9677410E+02  0.9616065E+02
+  0.9555109E+02  0.9494540E+02  0.9434354E+02  0.9374550E+02  0.9315125E+02
+  0.9256077E+02  0.9197402E+02  0.9139100E+02  0.9081168E+02  0.9023602E+02
+  0.2343449E+03  0.2328973E+03  0.2314549E+03  0.2300179E+03  0.2285866E+03
+  0.2271615E+03  0.2257426E+03  0.2243302E+03  0.2229247E+03  0.2215261E+03
+  0.2201346E+03  0.2187504E+03  0.2173735E+03  0.2160042E+03  0.2146425E+03
+  0.2132884E+03  0.2119421E+03  0.2106036E+03  0.2092729E+03  0.2079500E+03
+  0.2066351E+03  0.2053280E+03  0.2040289E+03  0.2027376E+03  0.2014542E+03
+  0.2001788E+03  0.1989111E+03  0.1976514E+03  0.1963994E+03  0.1951553E+03
+  0.1939189E+03  0.1926902E+03  0.1914692E+03  0.1902560E+03  0.1890503E+03
+  0.1878522E+03  0.1866617E+03  0.1854787E+03  0.1843031E+03  0.1831349E+03
+  0.1819742E+03  0.1808207E+03  0.1796746E+03  0.1785357E+03  0.1774041E+03
+  0.1762796E+03  0.1751622E+03  0.1740518E+03  0.1729486E+03  0.1718523E+03
+  0.1707629E+03  0.1696805E+03  0.1686049E+03  0.1675361E+03  0.1664741E+03
+  0.1654189E+03  0.1643703E+03  0.1633283E+03  0.1622930E+03  0.1612642E+03
+  0.1602420E+03  0.1592262E+03  0.1582169E+03  0.1572140E+03  0.1562174E+03
+  0.1552271E+03  0.1542431E+03  0.1532654E+03  0.1522938E+03  0.1513285E+03
+  0.1503692E+03  0.1494160E+03  0.1484689E+03  0.1475277E+03  0.1465925E+03
+  0.1456633E+03  0.1447399E+03  0.1438224E+03  0.1429108E+03  0.1420048E+03
+  0.1411047E+03  0.1402102E+03  0.1393214E+03  0.1384383E+03  0.1375607E+03
+  0.1366887E+03  0.1358223E+03  0.1349613E+03  0.1341058E+03  0.1332557E+03
+  0.1324110E+03  0.1315716E+03  0.1307376E+03  0.1299088E+03  0.1290854E+03
+  0.1282671E+03  0.1274540E+03  0.1266461E+03  0.1258433E+03  0.1250456E+03
+  0.1242529E+03  0.1234653E+03  0.1226826E+03  0.1219049E+03  0.1211322E+03
+  0.1203643E+03  0.1196013E+03  0.1188432E+03  0.1180899E+03  0.1173413E+03
+  0.1165975E+03  0.1158583E+03  0.1151239E+03  0.1143941E+03  0.1136690E+03
+  0.1129485E+03  0.1122325E+03  0.1115210E+03  0.1108141E+03  0.1101117E+03
+  0.1094137E+03  0.1087201E+03  0.1080309E+03  0.1073461E+03  0.1066657E+03
+  0.1059895E+03  0.1053176E+03  0.1046500E+03  0.1039867E+03  0.1033275E+03
+  0.1026725E+03  0.1020217E+03  0.1013749E+03  0.1007323E+03  0.1000938E+03
+  0.9945930E+02  0.9882884E+02  0.9820236E+02  0.9757986E+02  0.9696130E+02
+  0.9634667E+02  0.9573593E+02  0.9512907E+02  0.9452604E+02  0.9392684E+02
+  0.9333144E+02  0.9273981E+02  0.9215194E+02  0.9156779E+02  0.9098734E+02
+  0.2362281E+03  0.2347758E+03  0.2333280E+03  0.2318850E+03  0.2304472E+03
+  0.2290150E+03  0.2275886E+03  0.2261685E+03  0.2247547E+03  0.2233476E+03
+  0.2219473E+03  0.2205540E+03  0.2191679E+03  0.2177891E+03  0.2164178E+03
+  0.2150540E+03  0.2136978E+03  0.2123493E+03  0.2110085E+03  0.2096756E+03
+  0.2083505E+03  0.2070332E+03  0.2057239E+03  0.2044224E+03  0.2031288E+03
+  0.2018431E+03  0.2005653E+03  0.1992953E+03  0.1980332E+03  0.1967789E+03
+  0.1955324E+03  0.1942937E+03  0.1930627E+03  0.1918394E+03  0.1906238E+03
+  0.1894158E+03  0.1882155E+03  0.1870227E+03  0.1858374E+03  0.1846595E+03
+  0.1834891E+03  0.1823261E+03  0.1811705E+03  0.1800222E+03  0.1788811E+03
+  0.1777472E+03  0.1766205E+03  0.1755010E+03  0.1743885E+03  0.1732831E+03
+  0.1721847E+03  0.1710932E+03  0.1700087E+03  0.1689310E+03  0.1678602E+03
+  0.1667961E+03  0.1657388E+03  0.1646882E+03  0.1636443E+03  0.1626069E+03
+  0.1615762E+03  0.1605520E+03  0.1595342E+03  0.1585229E+03  0.1575181E+03
+  0.1565196E+03  0.1555274E+03  0.1545415E+03  0.1535619E+03  0.1525885E+03
+  0.1516212E+03  0.1506601E+03  0.1497051E+03  0.1487561E+03  0.1478131E+03
+  0.1468761E+03  0.1459451E+03  0.1450199E+03  0.1441007E+03  0.1431872E+03
+  0.1422795E+03  0.1413777E+03  0.1404815E+03  0.1395909E+03  0.1387061E+03
+  0.1378268E+03  0.1369531E+03  0.1360850E+03  0.1352224E+03  0.1343652E+03
+  0.1335135E+03  0.1326671E+03  0.1318261E+03  0.1309905E+03  0.1301602E+03
+  0.1293351E+03  0.1285152E+03  0.1277006E+03  0.1268911E+03  0.1260867E+03
+  0.1252875E+03  0.1244932E+03  0.1237041E+03  0.1229200E+03  0.1221408E+03
+  0.1213665E+03  0.1205972E+03  0.1198327E+03  0.1190731E+03  0.1183183E+03
+  0.1175683E+03  0.1168230E+03  0.1160825E+03  0.1153466E+03  0.1146154E+03
+  0.1138889E+03  0.1131670E+03  0.1124496E+03  0.1117368E+03  0.1110285E+03
+  0.1103247E+03  0.1096253E+03  0.1089304E+03  0.1082399E+03  0.1075538E+03
+  0.1068720E+03  0.1061945E+03  0.1055214E+03  0.1048525E+03  0.1041878E+03
+  0.1035274E+03  0.1028711E+03  0.1022190E+03  0.1015711E+03  0.1009272E+03
+  0.1002874E+03  0.9965171E+02  0.9902001E+02  0.9839233E+02  0.9776862E+02
+  0.9714887E+02  0.9653305E+02  0.9592113E+02  0.9531309E+02  0.9470889E+02
+  0.9410854E+02  0.9351199E+02  0.9291921E+02  0.9233021E+02  0.9174492E+02
+  0.2381144E+03  0.2366584E+03  0.2352062E+03  0.2337581E+03  0.2323147E+03
+  0.2308763E+03  0.2294432E+03  0.2280158E+03  0.2265945E+03  0.2251793E+03
+  0.2237707E+03  0.2223688E+03  0.2209738E+03  0.2195859E+03  0.2182052E+03
+  0.2168319E+03  0.2154660E+03  0.2141077E+03  0.2127571E+03  0.2114141E+03
+  0.2100790E+03  0.2087516E+03  0.2074321E+03  0.2061204E+03  0.2048166E+03
+  0.2035207E+03  0.2022326E+03  0.2009524E+03  0.1996802E+03  0.1984157E+03
+  0.1971591E+03  0.1959102E+03  0.1946692E+03  0.1934359E+03  0.1922103E+03
+  0.1909924E+03  0.1897820E+03  0.1885794E+03  0.1873843E+03  0.1861967E+03
+  0.1850166E+03  0.1838440E+03  0.1826788E+03  0.1815209E+03  0.1803703E+03
+  0.1792271E+03  0.1780910E+03  0.1769622E+03  0.1758405E+03  0.1747259E+03
+  0.1736183E+03  0.1725178E+03  0.1714242E+03  0.1703376E+03  0.1692578E+03
+  0.1681849E+03  0.1671188E+03  0.1660594E+03  0.1650068E+03  0.1639608E+03
+  0.1629215E+03  0.1618887E+03  0.1608625E+03  0.1598428E+03  0.1588296E+03
+  0.1578228E+03  0.1568223E+03  0.1558282E+03  0.1548405E+03  0.1538589E+03
+  0.1528836E+03  0.1519145E+03  0.1509515E+03  0.1499946E+03  0.1490438E+03
+  0.1480990E+03  0.1471602E+03  0.1462274E+03  0.1453005E+03  0.1443794E+03
+  0.1434642E+03  0.1425548E+03  0.1416511E+03  0.1407532E+03  0.1398610E+03
+  0.1389744E+03  0.1380934E+03  0.1372181E+03  0.1363482E+03  0.1354839E+03
+  0.1346251E+03  0.1337717E+03  0.1329237E+03  0.1320811E+03  0.1312439E+03
+  0.1304119E+03  0.1295853E+03  0.1287638E+03  0.1279476E+03  0.1271365E+03
+  0.1263306E+03  0.1255298E+03  0.1247341E+03  0.1239434E+03  0.1231577E+03
+  0.1223770E+03  0.1216013E+03  0.1208305E+03  0.1200645E+03  0.1193034E+03
+  0.1185472E+03  0.1177957E+03  0.1170490E+03  0.1163070E+03  0.1155697E+03
+  0.1148372E+03  0.1141092E+03  0.1133859E+03  0.1126671E+03  0.1119529E+03
+  0.1112433E+03  0.1105381E+03  0.1098374E+03  0.1091411E+03  0.1084493E+03
+  0.1077618E+03  0.1070787E+03  0.1064000E+03  0.1057255E+03  0.1050553E+03
+  0.1043894E+03  0.1037276E+03  0.1030701E+03  0.1024168E+03  0.1017675E+03
+  0.1011224E+03  0.1004814E+03  0.9984447E+02  0.9921156E+02  0.9858266E+02
+  0.9795775E+02  0.9733680E+02  0.9671979E+02  0.9610667E+02  0.9549746E+02
+  0.9489211E+02  0.9429058E+02  0.9369287E+02  0.9309896E+02  0.9250880E+02
+  0.2400018E+03  0.2385434E+03  0.2370879E+03  0.2356359E+03  0.2341878E+03
+  0.2327440E+03  0.2313051E+03  0.2298713E+03  0.2284430E+03  0.2270205E+03
+  0.2256040E+03  0.2241940E+03  0.2227906E+03  0.2213939E+03  0.2200042E+03
+  0.2186217E+03  0.2172464E+03  0.2158786E+03  0.2145182E+03  0.2131654E+03
+  0.2118203E+03  0.2104829E+03  0.2091533E+03  0.2078315E+03  0.2065176E+03
+  0.2052115E+03  0.2039132E+03  0.2026228E+03  0.2013404E+03  0.2000657E+03
+  0.1987989E+03  0.1975399E+03  0.1962888E+03  0.1950454E+03  0.1938098E+03
+  0.1925818E+03  0.1913616E+03  0.1901490E+03  0.1889440E+03  0.1877466E+03
+  0.1865568E+03  0.1853745E+03  0.1841996E+03  0.1830321E+03  0.1818720E+03
+  0.1807192E+03  0.1795737E+03  0.1784355E+03  0.1773045E+03  0.1761806E+03
+  0.1750638E+03  0.1739541E+03  0.1728515E+03  0.1717558E+03  0.1706671E+03
+  0.1695852E+03  0.1685102E+03  0.1674421E+03  0.1663807E+03  0.1653260E+03
+  0.1642780E+03  0.1632367E+03  0.1622019E+03  0.1611737E+03  0.1601520E+03
+  0.1591368E+03  0.1581281E+03  0.1571257E+03  0.1561297E+03  0.1551400E+03
+  0.1541566E+03  0.1531794E+03  0.1522084E+03  0.1512435E+03  0.1502848E+03
+  0.1493321E+03  0.1483855E+03  0.1474449E+03  0.1465103E+03  0.1455815E+03
+  0.1446587E+03  0.1437417E+03  0.1428306E+03  0.1419251E+03  0.1410255E+03
+  0.1401315E+03  0.1392432E+03  0.1383606E+03  0.1374835E+03  0.1366120E+03
+  0.1357460E+03  0.1348855E+03  0.1340305E+03  0.1331809E+03  0.1323367E+03
+  0.1314978E+03  0.1306642E+03  0.1298359E+03  0.1290129E+03  0.1281951E+03
+  0.1273825E+03  0.1265750E+03  0.1257726E+03  0.1249754E+03  0.1241832E+03
+  0.1233960E+03  0.1226138E+03  0.1218365E+03  0.1210642E+03  0.1202968E+03
+  0.1195342E+03  0.1187765E+03  0.1180236E+03  0.1172754E+03  0.1165320E+03
+  0.1157933E+03  0.1150593E+03  0.1143299E+03  0.1136052E+03  0.1128851E+03
+  0.1121695E+03  0.1114585E+03  0.1107519E+03  0.1100499E+03  0.1093523E+03
+  0.1086591E+03  0.1079703E+03  0.1072859E+03  0.1066058E+03  0.1059300E+03
+  0.1052585E+03  0.1045913E+03  0.1039283E+03  0.1032695E+03  0.1026149E+03
+  0.1019644E+03  0.1013181E+03  0.1006758E+03  0.1000376E+03  0.9940348E+02
+  0.9877336E+02  0.9814725E+02  0.9752509E+02  0.9690688E+02  0.9629259E+02
+  0.9568220E+02  0.9507566E+02  0.9447298E+02  0.9387412E+02  0.9327905E+02
+  0.2418880E+03  0.2404285E+03  0.2389712E+03  0.2375164E+03  0.2360648E+03
+  0.2346168E+03  0.2331729E+03  0.2317335E+03  0.2302991E+03  0.2288700E+03
+  0.2274464E+03  0.2260289E+03  0.2246175E+03  0.2232126E+03  0.2218143E+03
+  0.2204229E+03  0.2190385E+03  0.2176614E+03  0.2162915E+03  0.2149292E+03
+  0.2135743E+03  0.2122271E+03  0.2108875E+03  0.2095557E+03  0.2082316E+03
+  0.2069154E+03  0.2056070E+03  0.2043064E+03  0.2030138E+03  0.2017289E+03
+  0.2004520E+03  0.1991828E+03  0.1979215E+03  0.1966680E+03  0.1954223E+03
+  0.1941843E+03  0.1929541E+03  0.1917315E+03  0.1905166E+03  0.1893094E+03
+  0.1881097E+03  0.1869176E+03  0.1857330E+03  0.1845558E+03  0.1833861E+03
+  0.1822238E+03  0.1810688E+03  0.1799211E+03  0.1787806E+03  0.1776474E+03
+  0.1765214E+03  0.1754025E+03  0.1742906E+03  0.1731858E+03  0.1720880E+03
+  0.1709972E+03  0.1699133E+03  0.1688362E+03  0.1677660E+03  0.1667025E+03
+  0.1656458E+03  0.1645958E+03  0.1635524E+03  0.1625157E+03  0.1614855E+03
+  0.1604618E+03  0.1594447E+03  0.1584339E+03  0.1574296E+03  0.1564317E+03
+  0.1554401E+03  0.1544548E+03  0.1534757E+03  0.1525028E+03  0.1515361E+03
+  0.1505755E+03  0.1496210E+03  0.1486726E+03  0.1477301E+03  0.1467937E+03
+  0.1458631E+03  0.1449385E+03  0.1440198E+03  0.1431068E+03  0.1421997E+03
+  0.1412983E+03  0.1404026E+03  0.1395126E+03  0.1386282E+03  0.1377495E+03
+  0.1368763E+03  0.1360086E+03  0.1351464E+03  0.1342898E+03  0.1334385E+03
+  0.1325926E+03  0.1317522E+03  0.1309170E+03  0.1300871E+03  0.1292625E+03
+  0.1284431E+03  0.1276289E+03  0.1268198E+03  0.1260159E+03  0.1252171E+03
+  0.1244234E+03  0.1236347E+03  0.1228509E+03  0.1220722E+03  0.1212984E+03
+  0.1205295E+03  0.1197654E+03  0.1190062E+03  0.1182519E+03  0.1175023E+03
+  0.1167574E+03  0.1160173E+03  0.1152819E+03  0.1145511E+03  0.1138250E+03
+  0.1131034E+03  0.1123865E+03  0.1116741E+03  0.1109662E+03  0.1102628E+03
+  0.1095638E+03  0.1088693E+03  0.1081792E+03  0.1074934E+03  0.1068120E+03
+  0.1061349E+03  0.1054621E+03  0.1047936E+03  0.1041293E+03  0.1034693E+03
+  0.1028134E+03  0.1021616E+03  0.1015140E+03  0.1008705E+03  0.1002311E+03
+  0.9959576E+02  0.9896443E+02  0.9833710E+02  0.9771375E+02  0.9709434E+02
+  0.9647886E+02  0.9586728E+02  0.9525957E+02  0.9465573E+02  0.9405571E+02
+  0.2437707E+03  0.2423118E+03  0.2408539E+03  0.2393978E+03  0.2379439E+03
+  0.2364928E+03  0.2350451E+03  0.2336012E+03  0.2321616E+03  0.2307267E+03
+  0.2292968E+03  0.2278724E+03  0.2264537E+03  0.2250411E+03  0.2236348E+03
+  0.2222350E+03  0.2208419E+03  0.2194558E+03  0.2180768E+03  0.2167050E+03
+  0.2153407E+03  0.2139837E+03  0.2126344E+03  0.2112926E+03  0.2099586E+03
+  0.2086324E+03  0.2073139E+03  0.2060032E+03  0.2047004E+03  0.2034053E+03
+  0.2021182E+03  0.2008389E+03  0.1995674E+03  0.1983038E+03  0.1970479E+03
+  0.1957999E+03  0.1945596E+03  0.1933270E+03  0.1921021E+03  0.1908849E+03
+  0.1896754E+03  0.1884734E+03  0.1872790E+03  0.1860921E+03  0.1849127E+03
+  0.1837408E+03  0.1825762E+03  0.1814190E+03  0.1802691E+03  0.1791264E+03
+  0.1779910E+03  0.1768628E+03  0.1757417E+03  0.1746278E+03  0.1735208E+03
+  0.1724209E+03  0.1713280E+03  0.1702419E+03  0.1691628E+03  0.1680905E+03
+  0.1670250E+03  0.1659662E+03  0.1649142E+03  0.1638688E+03  0.1628300E+03
+  0.1617979E+03  0.1607722E+03  0.1597531E+03  0.1587404E+03  0.1577342E+03
+  0.1567343E+03  0.1557408E+03  0.1547536E+03  0.1537726E+03  0.1527978E+03
+  0.1518292E+03  0.1508668E+03  0.1499104E+03  0.1489602E+03  0.1480159E+03
+  0.1470776E+03  0.1461453E+03  0.1452189E+03  0.1442984E+03  0.1433837E+03
+  0.1424748E+03  0.1415716E+03  0.1406742E+03  0.1397825E+03  0.1388964E+03
+  0.1380159E+03  0.1371411E+03  0.1362717E+03  0.1354079E+03  0.1345496E+03
+  0.1336966E+03  0.1328491E+03  0.1320070E+03  0.1311702E+03  0.1303387E+03
+  0.1295125E+03  0.1286915E+03  0.1278758E+03  0.1270652E+03  0.1262597E+03
+  0.1254593E+03  0.1246641E+03  0.1238738E+03  0.1230886E+03  0.1223083E+03
+  0.1215330E+03  0.1207626E+03  0.1199971E+03  0.1192365E+03  0.1184806E+03
+  0.1177296E+03  0.1169833E+03  0.1162417E+03  0.1155049E+03  0.1147727E+03
+  0.1140452E+03  0.1133222E+03  0.1126039E+03  0.1118901E+03  0.1111808E+03
+  0.1104761E+03  0.1097757E+03  0.1090799E+03  0.1083884E+03  0.1077013E+03
+  0.1070186E+03  0.1063402E+03  0.1056662E+03  0.1049963E+03  0.1043308E+03
+  0.1036694E+03  0.1030123E+03  0.1023593E+03  0.1017104E+03  0.1010657E+03
+  0.1004250E+03  0.9978844E+02  0.9915588E+02  0.9852733E+02  0.9790276E+02
+  0.9728217E+02  0.9666549E+02  0.9605273E+02  0.9544386E+02  0.9483884E+02
+  0.2456473E+03  0.2441905E+03  0.2427338E+03  0.2412778E+03  0.2398230E+03
+  0.2383702E+03  0.2369199E+03  0.2354726E+03  0.2340289E+03  0.2325892E+03
+  0.2311539E+03  0.2297234E+03  0.2282982E+03  0.2268785E+03  0.2254648E+03
+  0.2240571E+03  0.2226558E+03  0.2212612E+03  0.2198734E+03  0.2184926E+03
+  0.2171190E+03  0.2157526E+03  0.2143937E+03  0.2130422E+03  0.2116984E+03
+  0.2103622E+03  0.2090337E+03  0.2077130E+03  0.2064000E+03  0.2050949E+03
+  0.2037976E+03  0.2025081E+03  0.2012265E+03  0.1999527E+03  0.1986867E+03
+  0.1974285E+03  0.1961781E+03  0.1949355E+03  0.1937007E+03  0.1924734E+03
+  0.1912540E+03  0.1900421E+03  0.1888378E+03  0.1876411E+03  0.1864520E+03
+  0.1852703E+03  0.1840961E+03  0.1829293E+03  0.1817699E+03  0.1806177E+03
+  0.1794729E+03  0.1783353E+03  0.1772049E+03  0.1760817E+03  0.1749656E+03
+  0.1738565E+03  0.1727544E+03  0.1716594E+03  0.1705713E+03  0.1694900E+03
+  0.1684156E+03  0.1673481E+03  0.1662873E+03  0.1652332E+03  0.1641858E+03
+  0.1631450E+03  0.1621109E+03  0.1610832E+03  0.1600621E+03  0.1590475E+03
+  0.1580393E+03  0.1570375E+03  0.1560421E+03  0.1550529E+03  0.1540700E+03
+  0.1530934E+03  0.1521229E+03  0.1511586E+03  0.1502004E+03  0.1492483E+03
+  0.1483022E+03  0.1473622E+03  0.1464280E+03  0.1454998E+03  0.1445775E+03
+  0.1436610E+03  0.1427504E+03  0.1418455E+03  0.1409463E+03  0.1400529E+03
+  0.1391651E+03  0.1382829E+03  0.1374063E+03  0.1365353E+03  0.1356698E+03
+  0.1348098E+03  0.1339553E+03  0.1331061E+03  0.1322623E+03  0.1314240E+03
+  0.1305909E+03  0.1297630E+03  0.1289405E+03  0.1281232E+03  0.1273110E+03
+  0.1265039E+03  0.1257020E+03  0.1249052E+03  0.1241134E+03  0.1233267E+03
+  0.1225449E+03  0.1217681E+03  0.1209962E+03  0.1202292E+03  0.1194671E+03
+  0.1187098E+03  0.1179573E+03  0.1172096E+03  0.1164666E+03  0.1157283E+03
+  0.1149947E+03  0.1142658E+03  0.1135414E+03  0.1128217E+03  0.1121065E+03
+  0.1113959E+03  0.1106898E+03  0.1099881E+03  0.1092909E+03  0.1085981E+03
+  0.1079097E+03  0.1072256E+03  0.1065459E+03  0.1058706E+03  0.1051994E+03
+  0.1045326E+03  0.1038700E+03  0.1032115E+03  0.1025573E+03  0.1019072E+03
+  0.1012612E+03  0.1006193E+03  0.9998147E+02  0.9934769E+02  0.9871792E+02
+  0.9809216E+02  0.9747034E+02  0.9685248E+02  0.9623854E+02  0.9562848E+02
+  0.2475152E+03  0.2460623E+03  0.2446083E+03  0.2431540E+03  0.2417000E+03
+  0.2402469E+03  0.2387954E+03  0.2373461E+03  0.2358994E+03  0.2344560E+03
+  0.2330163E+03  0.2315808E+03  0.2301499E+03  0.2287240E+03  0.2273034E+03
+  0.2258885E+03  0.2244796E+03  0.2230770E+03  0.2216809E+03  0.2202914E+03
+  0.2189089E+03  0.2175334E+03  0.2161652E+03  0.2148042E+03  0.2134507E+03
+  0.2121048E+03  0.2107664E+03  0.2094357E+03  0.2081128E+03  0.2067976E+03
+  0.2054902E+03  0.2041906E+03  0.2028988E+03  0.2016149E+03  0.2003387E+03
+  0.1990705E+03  0.1978099E+03  0.1965572E+03  0.1953123E+03  0.1940750E+03
+  0.1928456E+03  0.1916237E+03  0.1904096E+03  0.1892030E+03  0.1880040E+03
+  0.1868126E+03  0.1856287E+03  0.1844522E+03  0.1832832E+03  0.1821215E+03
+  0.1809672E+03  0.1798201E+03  0.1786803E+03  0.1775477E+03  0.1764224E+03
+  0.1753041E+03  0.1741929E+03  0.1730887E+03  0.1719915E+03  0.1709013E+03
+  0.1698180E+03  0.1687415E+03  0.1676719E+03  0.1666090E+03  0.1655529E+03
+  0.1645034E+03  0.1634607E+03  0.1624245E+03  0.1613949E+03  0.1603718E+03
+  0.1593552E+03  0.1583451E+03  0.1573414E+03  0.1563440E+03  0.1553529E+03
+  0.1543681E+03  0.1533896E+03  0.1524173E+03  0.1514511E+03  0.1504911E+03
+  0.1495371E+03  0.1485892E+03  0.1476473E+03  0.1467113E+03  0.1457814E+03
+  0.1448572E+03  0.1439390E+03  0.1430266E+03  0.1421199E+03  0.1412190E+03
+  0.1403239E+03  0.1394344E+03  0.1385505E+03  0.1376722E+03  0.1367995E+03
+  0.1359323E+03  0.1350707E+03  0.1342145E+03  0.1333636E+03  0.1325183E+03
+  0.1316783E+03  0.1308435E+03  0.1300141E+03  0.1291900E+03  0.1283710E+03
+  0.1275573E+03  0.1267487E+03  0.1259453E+03  0.1251469E+03  0.1243536E+03
+  0.1235653E+03  0.1227820E+03  0.1220037E+03  0.1212303E+03  0.1204619E+03
+  0.1196983E+03  0.1189395E+03  0.1181855E+03  0.1174364E+03  0.1166919E+03
+  0.1159522E+03  0.1152172E+03  0.1144869E+03  0.1137611E+03  0.1130400E+03
+  0.1123234E+03  0.1116114E+03  0.1109039E+03  0.1102009E+03  0.1095023E+03
+  0.1088082E+03  0.1081185E+03  0.1074331E+03  0.1067521E+03  0.1060754E+03
+  0.1054030E+03  0.1047349E+03  0.1040709E+03  0.1034112E+03  0.1027557E+03
+  0.1021043E+03  0.1014571E+03  0.1008140E+03  0.1001749E+03  0.9953991E+02
+  0.9890894E+02  0.9828194E+02  0.9765894E+02  0.9703989E+02  0.9642474E+02
+  0.2493711E+03  0.2479239E+03  0.2464746E+03  0.2450238E+03  0.2435721E+03
+  0.2421204E+03  0.2406692E+03  0.2392191E+03  0.2377710E+03  0.2363251E+03
+  0.2348821E+03  0.2334427E+03  0.2320070E+03  0.2305758E+03  0.2291494E+03
+  0.2277280E+03  0.2263122E+03  0.2249022E+03  0.2234982E+03  0.2221006E+03
+  0.2207097E+03  0.2193254E+03  0.2179482E+03  0.2165780E+03  0.2152152E+03
+  0.2138597E+03  0.2125116E+03  0.2111711E+03  0.2098383E+03  0.2085131E+03
+  0.2071957E+03  0.2058860E+03  0.2045841E+03  0.2032901E+03  0.2020038E+03
+  0.2007254E+03  0.1994548E+03  0.1981919E+03  0.1969369E+03  0.1956896E+03
+  0.1944501E+03  0.1932183E+03  0.1919942E+03  0.1907777E+03  0.1895688E+03
+  0.1883676E+03  0.1871739E+03  0.1859876E+03  0.1848089E+03  0.1836376E+03
+  0.1824737E+03  0.1813172E+03  0.1801679E+03  0.1790259E+03  0.1778912E+03
+  0.1767636E+03  0.1756432E+03  0.1745298E+03  0.1734235E+03  0.1723242E+03
+  0.1712319E+03  0.1701465E+03  0.1690679E+03  0.1679962E+03  0.1669313E+03
+  0.1658731E+03  0.1648217E+03  0.1637769E+03  0.1627387E+03  0.1617071E+03
+  0.1606821E+03  0.1596635E+03  0.1586514E+03  0.1576457E+03  0.1566464E+03
+  0.1556534E+03  0.1546668E+03  0.1536863E+03  0.1527121E+03  0.1517441E+03
+  0.1507822E+03  0.1498264E+03  0.1488766E+03  0.1479329E+03  0.1469952E+03
+  0.1460634E+03  0.1451375E+03  0.1442174E+03  0.1433032E+03  0.1423948E+03
+  0.1414922E+03  0.1405953E+03  0.1397041E+03  0.1388185E+03  0.1379385E+03
+  0.1370641E+03  0.1361953E+03  0.1353320E+03  0.1344741E+03  0.1336217E+03
+  0.1327746E+03  0.1319330E+03  0.1310966E+03  0.1302657E+03  0.1294399E+03
+  0.1286194E+03  0.1278041E+03  0.1269939E+03  0.1261889E+03  0.1253890E+03
+  0.1245941E+03  0.1238043E+03  0.1230196E+03  0.1222397E+03  0.1214649E+03
+  0.1206949E+03  0.1199298E+03  0.1191696E+03  0.1184142E+03  0.1176636E+03
+  0.1169177E+03  0.1161765E+03  0.1154401E+03  0.1147083E+03  0.1139812E+03
+  0.1132587E+03  0.1125407E+03  0.1118273E+03  0.1111185E+03  0.1104141E+03
+  0.1097142E+03  0.1090187E+03  0.1083276E+03  0.1076409E+03  0.1069586E+03
+  0.1062806E+03  0.1056069E+03  0.1049374E+03  0.1042723E+03  0.1036113E+03
+  0.1029545E+03  0.1023019E+03  0.1016534E+03  0.1010090E+03  0.1003687E+03
+  0.9973247E+02  0.9910026E+02  0.9847207E+02  0.9784785E+02  0.9722760E+02
+  0.2512121E+03  0.2497727E+03  0.2483298E+03  0.2468843E+03  0.2454368E+03
+  0.2439881E+03  0.2425388E+03  0.2410897E+03  0.2396415E+03  0.2381945E+03
+  0.2367497E+03  0.2353074E+03  0.2338683E+03  0.2324328E+03  0.2310013E+03
+  0.2295744E+03  0.2281524E+03  0.2267358E+03  0.2253247E+03  0.2239195E+03
+  0.2225206E+03  0.2211281E+03  0.2197423E+03  0.2183633E+03  0.2169913E+03
+  0.2156266E+03  0.2142691E+03  0.2129190E+03  0.2115764E+03  0.2102414E+03
+  0.2089141E+03  0.2075944E+03  0.2062825E+03  0.2049784E+03  0.2036820E+03
+  0.2023935E+03  0.2011127E+03  0.1998398E+03  0.1985746E+03  0.1973173E+03
+  0.1960677E+03  0.1948258E+03  0.1935917E+03  0.1923652E+03  0.1911465E+03
+  0.1899353E+03  0.1887318E+03  0.1875358E+03  0.1863473E+03  0.1851663E+03
+  0.1839928E+03  0.1828267E+03  0.1816679E+03  0.1805164E+03  0.1793722E+03
+  0.1782353E+03  0.1771055E+03  0.1759829E+03  0.1748674E+03  0.1737590E+03
+  0.1726576E+03  0.1715631E+03  0.1704756E+03  0.1693950E+03  0.1683212E+03
+  0.1672542E+03  0.1661940E+03  0.1651405E+03  0.1640937E+03  0.1630535E+03
+  0.1620199E+03  0.1609929E+03  0.1599724E+03  0.1589583E+03  0.1579507E+03
+  0.1569494E+03  0.1559545E+03  0.1549659E+03  0.1539836E+03  0.1530075E+03
+  0.1520376E+03  0.1510739E+03  0.1501162E+03  0.1491646E+03  0.1482191E+03
+  0.1472795E+03  0.1463459E+03  0.1454182E+03  0.1444964E+03  0.1435805E+03
+  0.1426703E+03  0.1417659E+03  0.1408673E+03  0.1399743E+03  0.1390871E+03
+  0.1382054E+03  0.1373293E+03  0.1364588E+03  0.1355937E+03  0.1347342E+03
+  0.1338802E+03  0.1330315E+03  0.1321882E+03  0.1313503E+03  0.1305176E+03
+  0.1296903E+03  0.1288682E+03  0.1280513E+03  0.1272396E+03  0.1264330E+03
+  0.1256315E+03  0.1248352E+03  0.1240438E+03  0.1232575E+03  0.1224762E+03
+  0.1216998E+03  0.1209284E+03  0.1201618E+03  0.1194001E+03  0.1186432E+03
+  0.1178912E+03  0.1171439E+03  0.1164013E+03  0.1156634E+03  0.1149302E+03
+  0.1142017E+03  0.1134778E+03  0.1127584E+03  0.1120437E+03  0.1113334E+03
+  0.1106277E+03  0.1099264E+03  0.1092296E+03  0.1085372E+03  0.1078492E+03
+  0.1071655E+03  0.1064862E+03  0.1058112E+03  0.1051404E+03  0.1044740E+03
+  0.1038117E+03  0.1031536E+03  0.1024998E+03  0.1018500E+03  0.1012044E+03
+  0.1005629E+03  0.9992539E+02  0.9929197E+02  0.9866256E+02  0.9803714E+02
+  0.2530353E+03  0.2516054E+03  0.2501709E+03  0.2487326E+03  0.2472911E+03
+  0.2458473E+03  0.2444017E+03  0.2429552E+03  0.2415085E+03  0.2400621E+03
+  0.2386168E+03  0.2371731E+03  0.2357317E+03  0.2342931E+03  0.2328578E+03
+  0.2314263E+03  0.2299991E+03  0.2285766E+03  0.2271592E+03  0.2257472E+03
+  0.2243409E+03  0.2229407E+03  0.2215468E+03  0.2201594E+03  0.2187787E+03
+  0.2174050E+03  0.2160384E+03  0.2146789E+03  0.2133269E+03  0.2119822E+03
+  0.2106451E+03  0.2093156E+03  0.2079938E+03  0.2066796E+03  0.2053732E+03
+  0.2040746E+03  0.2027838E+03  0.2015007E+03  0.2002255E+03  0.1989580E+03
+  0.1976983E+03  0.1964464E+03  0.1952022E+03  0.1939658E+03  0.1927370E+03
+  0.1915160E+03  0.1903025E+03  0.1890966E+03  0.1878984E+03  0.1867077E+03
+  0.1855244E+03  0.1843486E+03  0.1831802E+03  0.1820192E+03  0.1808656E+03
+  0.1797192E+03  0.1785800E+03  0.1774481E+03  0.1763233E+03  0.1752056E+03
+  0.1740951E+03  0.1729915E+03  0.1718950E+03  0.1708054E+03  0.1697227E+03
+  0.1686468E+03  0.1675778E+03  0.1665155E+03  0.1654600E+03  0.1644111E+03
+  0.1633689E+03  0.1623333E+03  0.1613044E+03  0.1602818E+03  0.1592658E+03
+  0.1582562E+03  0.1572530E+03  0.1562562E+03  0.1552657E+03  0.1542815E+03
+  0.1533035E+03  0.1523317E+03  0.1513661E+03  0.1504066E+03  0.1494532E+03
+  0.1485058E+03  0.1475644E+03  0.1466290E+03  0.1456995E+03  0.1447759E+03
+  0.1438582E+03  0.1429463E+03  0.1420401E+03  0.1411398E+03  0.1402451E+03
+  0.1393561E+03  0.1384727E+03  0.1375949E+03  0.1367227E+03  0.1358560E+03
+  0.1349949E+03  0.1341391E+03  0.1332888E+03  0.1324439E+03  0.1316043E+03
+  0.1307701E+03  0.1299412E+03  0.1291175E+03  0.1282990E+03  0.1274857E+03
+  0.1266776E+03  0.1258746E+03  0.1250767E+03  0.1242838E+03  0.1234960E+03
+  0.1227131E+03  0.1219353E+03  0.1211623E+03  0.1203943E+03  0.1196311E+03
+  0.1188727E+03  0.1181192E+03  0.1173705E+03  0.1166264E+03  0.1158872E+03
+  0.1151525E+03  0.1144226E+03  0.1136973E+03  0.1129766E+03  0.1122604E+03
+  0.1115488E+03  0.1108417E+03  0.1101390E+03  0.1094409E+03  0.1087471E+03
+  0.1080578E+03  0.1073728E+03  0.1066922E+03  0.1060159E+03  0.1053438E+03
+  0.1046761E+03  0.1040125E+03  0.1033532E+03  0.1026980E+03  0.1020470E+03
+  0.1014002E+03  0.1007574E+03  0.1001187E+03  0.9948404E+02  0.9885341E+02
+  0.2548374E+03  0.2534189E+03  0.2519948E+03  0.2505656E+03  0.2491321E+03
+  0.2476950E+03  0.2462550E+03  0.2448129E+03  0.2433695E+03  0.2419252E+03
+  0.2404810E+03  0.2390375E+03  0.2375952E+03  0.2361549E+03  0.2347170E+03
+  0.2332821E+03  0.2318507E+03  0.2304234E+03  0.2290005E+03  0.2275824E+03
+  0.2261696E+03  0.2247623E+03  0.2233609E+03  0.2219656E+03  0.2205767E+03
+  0.2191945E+03  0.2178190E+03  0.2164506E+03  0.2150893E+03  0.2137352E+03
+  0.2123885E+03  0.2110494E+03  0.2097177E+03  0.2083937E+03  0.2070774E+03
+  0.2057687E+03  0.2044678E+03  0.2031747E+03  0.2018894E+03  0.2006118E+03
+  0.1993421E+03  0.1980800E+03  0.1968258E+03  0.1955793E+03  0.1943405E+03
+  0.1931095E+03  0.1918861E+03  0.1906704E+03  0.1894622E+03  0.1882617E+03
+  0.1870687E+03  0.1858832E+03  0.1847051E+03  0.1835345E+03  0.1823712E+03
+  0.1812153E+03  0.1800668E+03  0.1789254E+03  0.1777913E+03  0.1766644E+03
+  0.1755446E+03  0.1744318E+03  0.1733262E+03  0.1722275E+03  0.1711358E+03
+  0.1700509E+03  0.1689730E+03  0.1679019E+03  0.1668376E+03  0.1657800E+03
+  0.1647292E+03  0.1636850E+03  0.1626474E+03  0.1616164E+03  0.1605919E+03
+  0.1595739E+03  0.1585624E+03  0.1575572E+03  0.1565585E+03  0.1555661E+03
+  0.1545799E+03  0.1536001E+03  0.1526264E+03  0.1516589E+03  0.1506976E+03
+  0.1497423E+03  0.1487931E+03  0.1478499E+03  0.1469126E+03  0.1459814E+03
+  0.1450560E+03  0.1441365E+03  0.1432228E+03  0.1423149E+03  0.1414128E+03
+  0.1405164E+03  0.1396257E+03  0.1387406E+03  0.1378611E+03  0.1369872E+03
+  0.1361189E+03  0.1352560E+03  0.1343986E+03  0.1335467E+03  0.1327001E+03
+  0.1318589E+03  0.1310231E+03  0.1301925E+03  0.1293672E+03  0.1285472E+03
+  0.1277323E+03  0.1269226E+03  0.1261181E+03  0.1253186E+03  0.1245242E+03
+  0.1237349E+03  0.1229505E+03  0.1221711E+03  0.1213967E+03  0.1206272E+03
+  0.1198625E+03  0.1191027E+03  0.1183477E+03  0.1175975E+03  0.1168521E+03
+  0.1161113E+03  0.1153753E+03  0.1146439E+03  0.1139172E+03  0.1131951E+03
+  0.1124776E+03  0.1117646E+03  0.1110561E+03  0.1103521E+03  0.1096526E+03
+  0.1089575E+03  0.1082668E+03  0.1075805E+03  0.1068986E+03  0.1062209E+03
+  0.1055476E+03  0.1048786E+03  0.1042137E+03  0.1035531E+03  0.1028967E+03
+  0.1022444E+03  0.1015963E+03  0.1009523E+03  0.1003124E+03  0.9967648E+02
+  0.2566152E+03  0.2552103E+03  0.2537984E+03  0.2523802E+03  0.2509566E+03
+  0.2495282E+03  0.2480957E+03  0.2466599E+03  0.2452216E+03  0.2437813E+03
+  0.2423400E+03  0.2408982E+03  0.2394566E+03  0.2380160E+03  0.2365768E+03
+  0.2351398E+03  0.2337055E+03  0.2322745E+03  0.2308471E+03  0.2294239E+03
+  0.2280054E+03  0.2265918E+03  0.2251836E+03  0.2237811E+03  0.2223846E+03
+  0.2209943E+03  0.2196105E+03  0.2182334E+03  0.2168632E+03  0.2155000E+03
+  0.2141441E+03  0.2127954E+03  0.2114541E+03  0.2101204E+03  0.2087943E+03
+  0.2074757E+03  0.2061648E+03  0.2048617E+03  0.2035663E+03  0.2022787E+03
+  0.2009989E+03  0.1997268E+03  0.1984625E+03  0.1972059E+03  0.1959571E+03
+  0.1947161E+03  0.1934827E+03  0.1922570E+03  0.1910389E+03  0.1898285E+03
+  0.1886257E+03  0.1874304E+03  0.1862426E+03  0.1850623E+03  0.1838894E+03
+  0.1827240E+03  0.1815658E+03  0.1804151E+03  0.1792715E+03  0.1781352E+03
+  0.1770061E+03  0.1758841E+03  0.1747692E+03  0.1736614E+03  0.1725606E+03
+  0.1714668E+03  0.1703799E+03  0.1692999E+03  0.1682267E+03  0.1671603E+03
+  0.1661007E+03  0.1650478E+03  0.1640016E+03  0.1629620E+03  0.1619290E+03
+  0.1609025E+03  0.1598826E+03  0.1588691E+03  0.1578620E+03  0.1568613E+03
+  0.1558670E+03  0.1548790E+03  0.1538972E+03  0.1529216E+03  0.1519523E+03
+  0.1509891E+03  0.1500319E+03  0.1490809E+03  0.1481359E+03  0.1471968E+03
+  0.1462638E+03  0.1453366E+03  0.1444153E+03  0.1434999E+03  0.1425903E+03
+  0.1416863E+03  0.1407882E+03  0.1398958E+03  0.1390089E+03  0.1381278E+03
+  0.1372522E+03  0.1363822E+03  0.1355176E+03  0.1346586E+03  0.1338050E+03
+  0.1329568E+03  0.1321140E+03  0.1312765E+03  0.1304444E+03  0.1296175E+03
+  0.1287959E+03  0.1279794E+03  0.1271682E+03  0.1263620E+03  0.1255610E+03
+  0.1247651E+03  0.1239742E+03  0.1231883E+03  0.1224075E+03  0.1216315E+03
+  0.1208605E+03  0.1200944E+03  0.1193331E+03  0.1185766E+03  0.1178250E+03
+  0.1170781E+03  0.1163359E+03  0.1155985E+03  0.1148657E+03  0.1141376E+03
+  0.1134141E+03  0.1126951E+03  0.1119808E+03  0.1112709E+03  0.1105656E+03
+  0.1098647E+03  0.1091683E+03  0.1084763E+03  0.1077886E+03  0.1071054E+03
+  0.1064264E+03  0.1057518E+03  0.1050814E+03  0.1044153E+03  0.1037534E+03
+  0.1030958E+03  0.1024422E+03  0.1017928E+03  0.1011476E+03  0.1005064E+03
+  0.2583661E+03  0.2569763E+03  0.2555784E+03  0.2541734E+03  0.2527615E+03
+  0.2513438E+03  0.2499207E+03  0.2484932E+03  0.2470618E+03  0.2456274E+03
+  0.2441907E+03  0.2427525E+03  0.2413133E+03  0.2398739E+03  0.2384352E+03
+  0.2369975E+03  0.2355616E+03  0.2341281E+03  0.2326974E+03  0.2312702E+03
+  0.2298469E+03  0.2284280E+03  0.2270138E+03  0.2256048E+03  0.2242013E+03
+  0.2228036E+03  0.2214120E+03  0.2200268E+03  0.2186481E+03  0.2172762E+03
+  0.2159112E+03  0.2145534E+03  0.2132027E+03  0.2118595E+03  0.2105236E+03
+  0.2091953E+03  0.2078746E+03  0.2065616E+03  0.2052562E+03  0.2039586E+03
+  0.2026687E+03  0.2013866E+03  0.2001122E+03  0.1988456E+03  0.1975867E+03
+  0.1963356E+03  0.1950922E+03  0.1938565E+03  0.1926285E+03  0.1914082E+03
+  0.1901954E+03  0.1889903E+03  0.1877928E+03  0.1866027E+03  0.1854202E+03
+  0.1842450E+03  0.1830773E+03  0.1819170E+03  0.1807640E+03  0.1796182E+03
+  0.1784798E+03  0.1773485E+03  0.1762243E+03  0.1751073E+03  0.1739973E+03
+  0.1728944E+03  0.1717985E+03  0.1707095E+03  0.1696274E+03  0.1685521E+03
+  0.1674837E+03  0.1664220E+03  0.1653671E+03  0.1643188E+03  0.1632772E+03
+  0.1622422E+03  0.1612138E+03  0.1601918E+03  0.1591764E+03  0.1581674E+03
+  0.1571648E+03  0.1561685E+03  0.1551786E+03  0.1541949E+03  0.1532175E+03
+  0.1522462E+03  0.1512811E+03  0.1503222E+03  0.1493693E+03  0.1484224E+03
+  0.1474816E+03  0.1465467E+03  0.1456177E+03  0.1446947E+03  0.1437775E+03
+  0.1428661E+03  0.1419604E+03  0.1410606E+03  0.1401664E+03  0.1392779E+03
+  0.1383950E+03  0.1375177E+03  0.1366460E+03  0.1357798E+03  0.1349191E+03
+  0.1340638E+03  0.1332140E+03  0.1323696E+03  0.1315305E+03  0.1306967E+03
+  0.1298682E+03  0.1290450E+03  0.1282270E+03  0.1274141E+03  0.1266065E+03
+  0.1258039E+03  0.1250065E+03  0.1242140E+03  0.1234267E+03  0.1226443E+03
+  0.1218668E+03  0.1210943E+03  0.1203267E+03  0.1195639E+03  0.1188060E+03
+  0.1180529E+03  0.1173046E+03  0.1165610E+03  0.1158221E+03  0.1150879E+03
+  0.1143584E+03  0.1136335E+03  0.1129131E+03  0.1121974E+03  0.1114862E+03
+  0.1107795E+03  0.1100772E+03  0.1093795E+03  0.1086861E+03  0.1079971E+03
+  0.1073126E+03  0.1066323E+03  0.1059564E+03  0.1052847E+03  0.1046173E+03
+  0.1039541E+03  0.1032952E+03  0.1026404E+03  0.1019898E+03  0.1013432E+03
+  0.2600871E+03  0.2587141E+03  0.2573321E+03  0.2559418E+03  0.2545437E+03
+  0.2531384E+03  0.2517269E+03  0.2503095E+03  0.2488872E+03  0.2474605E+03
+  0.2460304E+03  0.2445975E+03  0.2431626E+03  0.2417263E+03  0.2402894E+03
+  0.2388527E+03  0.2374167E+03  0.2359821E+03  0.2345495E+03  0.2331195E+03
+  0.2316926E+03  0.2302694E+03  0.2288502E+03  0.2274356E+03  0.2260259E+03
+  0.2246215E+03  0.2232227E+03  0.2218298E+03  0.2204432E+03  0.2190630E+03
+  0.2176895E+03  0.2163228E+03  0.2149631E+03  0.2136105E+03  0.2122653E+03
+  0.2109274E+03  0.2095970E+03  0.2082742E+03  0.2069589E+03  0.2056513E+03
+  0.2043515E+03  0.2030593E+03  0.2017749E+03  0.2004982E+03  0.1992293E+03
+  0.1979682E+03  0.1967148E+03  0.1954691E+03  0.1942311E+03  0.1930008E+03
+  0.1917781E+03  0.1905631E+03  0.1893557E+03  0.1881558E+03  0.1869635E+03
+  0.1857787E+03  0.1846013E+03  0.1834314E+03  0.1822688E+03  0.1811136E+03
+  0.1799657E+03  0.1788250E+03  0.1776915E+03  0.1765652E+03  0.1754460E+03
+  0.1743339E+03  0.1732289E+03  0.1721308E+03  0.1710397E+03  0.1699555E+03
+  0.1688782E+03  0.1678077E+03  0.1667440E+03  0.1656870E+03  0.1646367E+03
+  0.1635931E+03  0.1625561E+03  0.1615256E+03  0.1605017E+03  0.1594843E+03
+  0.1584733E+03  0.1574688E+03  0.1564706E+03  0.1554787E+03  0.1544932E+03
+  0.1535138E+03  0.1525407E+03  0.1515738E+03  0.1506129E+03  0.1496582E+03
+  0.1487095E+03  0.1477669E+03  0.1468302E+03  0.1458994E+03  0.1449746E+03
+  0.1440556E+03  0.1431424E+03  0.1422351E+03  0.1413334E+03  0.1404375E+03
+  0.1395473E+03  0.1386627E+03  0.1377837E+03  0.1369103E+03  0.1360424E+03
+  0.1351801E+03  0.1343232E+03  0.1334717E+03  0.1326256E+03  0.1317849E+03
+  0.1309495E+03  0.1301194E+03  0.1292946E+03  0.1284750E+03  0.1276606E+03
+  0.1268514E+03  0.1260473E+03  0.1252483E+03  0.1244543E+03  0.1236654E+03
+  0.1228815E+03  0.1221026E+03  0.1213285E+03  0.1205594E+03  0.1197952E+03
+  0.1190358E+03  0.1182813E+03  0.1175315E+03  0.1167865E+03  0.1160462E+03
+  0.1153106E+03  0.1145796E+03  0.1138533E+03  0.1131316E+03  0.1124144E+03
+  0.1117018E+03  0.1109938E+03  0.1102902E+03  0.1095910E+03  0.1088963E+03
+  0.1082061E+03  0.1075201E+03  0.1068386E+03  0.1061613E+03  0.1054884E+03
+  0.1048197E+03  0.1041552E+03  0.1034950E+03  0.1028389E+03  0.1021870E+03
+  0.2617758E+03  0.2604211E+03  0.2590566E+03  0.2576828E+03  0.2563001E+03
+  0.2549094E+03  0.2535110E+03  0.2521058E+03  0.2506944E+03  0.2492775E+03
+  0.2478559E+03  0.2464304E+03  0.2450015E+03  0.2435701E+03  0.2421371E+03
+  0.2407029E+03  0.2392685E+03  0.2378344E+03  0.2364013E+03  0.2349698E+03
+  0.2335407E+03  0.2321143E+03  0.2306912E+03  0.2292720E+03  0.2278570E+03
+  0.2264467E+03  0.2250416E+03  0.2236418E+03  0.2222478E+03  0.2208599E+03
+  0.2194782E+03  0.2181031E+03  0.2167347E+03  0.2153732E+03  0.2140188E+03
+  0.2126716E+03  0.2113317E+03  0.2099993E+03  0.2086743E+03  0.2073569E+03
+  0.2060471E+03  0.2047450E+03  0.2034506E+03  0.2021639E+03  0.2008850E+03
+  0.1996138E+03  0.1983503E+03  0.1970946E+03  0.1958466E+03  0.1946063E+03
+  0.1933737E+03  0.1921488E+03  0.1909314E+03  0.1897217E+03  0.1885196E+03
+  0.1873250E+03  0.1861379E+03  0.1849583E+03  0.1837861E+03  0.1826213E+03
+  0.1814639E+03  0.1803137E+03  0.1791709E+03  0.1780352E+03  0.1769067E+03
+  0.1757854E+03  0.1746711E+03  0.1735639E+03  0.1724638E+03  0.1713706E+03
+  0.1702843E+03  0.1692048E+03  0.1681323E+03  0.1670665E+03  0.1660075E+03
+  0.1649552E+03  0.1639096E+03  0.1628705E+03  0.1618381E+03  0.1608122E+03
+  0.1597928E+03  0.1587799E+03  0.1577734E+03  0.1567733E+03  0.1557795E+03
+  0.1547920E+03  0.1538108E+03  0.1528358E+03  0.1518670E+03  0.1509043E+03
+  0.1499477E+03  0.1489972E+03  0.1480527E+03  0.1471142E+03  0.1461817E+03
+  0.1452550E+03  0.1443343E+03  0.1434193E+03  0.1425102E+03  0.1416068E+03
+  0.1407092E+03  0.1398172E+03  0.1389309E+03  0.1380503E+03  0.1371752E+03
+  0.1363056E+03  0.1354416E+03  0.1345830E+03  0.1337299E+03  0.1328822E+03
+  0.1320399E+03  0.1312029E+03  0.1303712E+03  0.1295447E+03  0.1287236E+03
+  0.1279076E+03  0.1270968E+03  0.1262911E+03  0.1254906E+03  0.1246951E+03
+  0.1239046E+03  0.1231192E+03  0.1223388E+03  0.1215632E+03  0.1207927E+03
+  0.1200270E+03  0.1192661E+03  0.1185101E+03  0.1177589E+03  0.1170124E+03
+  0.1162707E+03  0.1155336E+03  0.1148012E+03  0.1140735E+03  0.1133504E+03
+  0.1126319E+03  0.1119179E+03  0.1112085E+03  0.1105035E+03  0.1098030E+03
+  0.1091070E+03  0.1084154E+03  0.1077281E+03  0.1070453E+03  0.1063667E+03
+  0.1056924E+03  0.1050225E+03  0.1043567E+03  0.1036952E+03  0.1030379E+03
+  0.2634300E+03  0.2620948E+03  0.2607492E+03  0.2593935E+03  0.2580279E+03
+  0.2566534E+03  0.2552701E+03  0.2538790E+03  0.2524804E+03  0.2510752E+03
+  0.2496641E+03  0.2482478E+03  0.2468271E+03  0.2454026E+03  0.2439751E+03
+  0.2425454E+03  0.2411142E+03  0.2396824E+03  0.2382504E+03  0.2368190E+03
+  0.2353889E+03  0.2339608E+03  0.2325350E+03  0.2311123E+03  0.2296931E+03
+  0.2282780E+03  0.2268673E+03  0.2254614E+03  0.2240608E+03  0.2226657E+03
+  0.2212766E+03  0.2198936E+03  0.2185169E+03  0.2171469E+03  0.2157837E+03
+  0.2144275E+03  0.2130784E+03  0.2117365E+03  0.2104020E+03  0.2090749E+03
+  0.2077554E+03  0.2064435E+03  0.2051392E+03  0.2038425E+03  0.2025536E+03
+  0.2012724E+03  0.1999989E+03  0.1987331E+03  0.1974751E+03  0.1962248E+03
+  0.1949822E+03  0.1937473E+03  0.1925201E+03  0.1913004E+03  0.1900885E+03
+  0.1888840E+03  0.1876872E+03  0.1864978E+03  0.1853160E+03  0.1841415E+03
+  0.1829745E+03  0.1818148E+03  0.1806625E+03  0.1795174E+03  0.1783795E+03
+  0.1772489E+03  0.1761254E+03  0.1750090E+03  0.1738997E+03  0.1727974E+03
+  0.1717020E+03  0.1706136E+03  0.1695322E+03  0.1684575E+03  0.1673897E+03
+  0.1663286E+03  0.1652743E+03  0.1642266E+03  0.1631856E+03  0.1621512E+03
+  0.1611233E+03  0.1601020E+03  0.1590871E+03  0.1580786E+03  0.1570766E+03
+  0.1560809E+03  0.1550915E+03  0.1541084E+03  0.1531315E+03  0.1521608E+03
+  0.1511962E+03  0.1502378E+03  0.1492854E+03  0.1483391E+03  0.1473988E+03
+  0.1464644E+03  0.1455360E+03  0.1446135E+03  0.1436967E+03  0.1427859E+03
+  0.1418808E+03  0.1409814E+03  0.1400877E+03  0.1391997E+03  0.1383173E+03
+  0.1374405E+03  0.1365693E+03  0.1357036E+03  0.1348434E+03  0.1339886E+03
+  0.1331392E+03  0.1322953E+03  0.1314566E+03  0.1306234E+03  0.1297953E+03
+  0.1289726E+03  0.1281550E+03  0.1273426E+03  0.1265354E+03  0.1257333E+03
+  0.1249363E+03  0.1241443E+03  0.1233574E+03  0.1225754E+03  0.1217984E+03
+  0.1210263E+03  0.1202591E+03  0.1194968E+03  0.1187393E+03  0.1179866E+03
+  0.1172388E+03  0.1164956E+03  0.1157571E+03  0.1150233E+03  0.1142942E+03
+  0.1135697E+03  0.1128498E+03  0.1121344E+03  0.1114236E+03  0.1107173E+03
+  0.1100155E+03  0.1093181E+03  0.1086251E+03  0.1079365E+03  0.1072523E+03
+  0.1065725E+03  0.1058969E+03  0.1052256E+03  0.1045586E+03  0.1038958E+03
+  0.2650474E+03  0.2637332E+03  0.2624078E+03  0.2610713E+03  0.2597245E+03
+  0.2583677E+03  0.2570013E+03  0.2556258E+03  0.2542421E+03  0.2528506E+03
+  0.2514519E+03  0.2500468E+03  0.2486361E+03  0.2472204E+03  0.2458005E+03
+  0.2443772E+03  0.2429512E+03  0.2415233E+03  0.2400942E+03  0.2386646E+03
+  0.2372352E+03  0.2358066E+03  0.2343797E+03  0.2329548E+03  0.2315326E+03
+  0.2301137E+03  0.2286985E+03  0.2272874E+03  0.2258811E+03  0.2244797E+03
+  0.2230837E+03  0.2216934E+03  0.2203091E+03  0.2189310E+03  0.2175594E+03
+  0.2161945E+03  0.2148365E+03  0.2134856E+03  0.2121418E+03  0.2108053E+03
+  0.2094761E+03  0.2081545E+03  0.2068404E+03  0.2055339E+03  0.2042351E+03
+  0.2029439E+03  0.2016604E+03  0.2003846E+03  0.1991166E+03  0.1978563E+03
+  0.1966037E+03  0.1953588E+03  0.1941216E+03  0.1928920E+03  0.1916702E+03
+  0.1904559E+03  0.1892492E+03  0.1880500E+03  0.1868584E+03  0.1856743E+03
+  0.1844976E+03  0.1833283E+03  0.1821664E+03  0.1810119E+03  0.1798646E+03
+  0.1787245E+03  0.1775917E+03  0.1764660E+03  0.1753475E+03  0.1742360E+03
+  0.1731316E+03  0.1720342E+03  0.1709437E+03  0.1698601E+03  0.1687834E+03
+  0.1677135E+03  0.1666504E+03  0.1655940E+03  0.1645443E+03  0.1635013E+03
+  0.1624648E+03  0.1614350E+03  0.1604117E+03  0.1593948E+03  0.1583844E+03
+  0.1573804E+03  0.1563828E+03  0.1553915E+03  0.1544064E+03  0.1534277E+03
+  0.1524551E+03  0.1514887E+03  0.1505284E+03  0.1495742E+03  0.1486261E+03
+  0.1476839E+03  0.1467478E+03  0.1458176E+03  0.1448932E+03  0.1439747E+03
+  0.1430621E+03  0.1421552E+03  0.1412541E+03  0.1403587E+03  0.1394690E+03
+  0.1385849E+03  0.1377064E+03  0.1368335E+03  0.1359661E+03  0.1351042E+03
+  0.1342478E+03  0.1333968E+03  0.1325512E+03  0.1317109E+03  0.1308760E+03
+  0.1300464E+03  0.1292220E+03  0.1284029E+03  0.1275890E+03  0.1267802E+03
+  0.1259765E+03  0.1251780E+03  0.1243845E+03  0.1235960E+03  0.1228125E+03
+  0.1220340E+03  0.1212604E+03  0.1204918E+03  0.1197280E+03  0.1189690E+03
+  0.1182149E+03  0.1174655E+03  0.1167209E+03  0.1159810E+03  0.1152458E+03
+  0.1145153E+03  0.1137894E+03  0.1130681E+03  0.1123513E+03  0.1116391E+03
+  0.1109315E+03  0.1102283E+03  0.1095295E+03  0.1088352E+03  0.1081453E+03
+  0.1074598E+03  0.1067786E+03  0.1061017E+03  0.1054292E+03  0.1047608E+03
+  0.2666269E+03  0.2653343E+03  0.2640300E+03  0.2627142E+03  0.2613873E+03
+  0.2600497E+03  0.2587016E+03  0.2573437E+03  0.2559765E+03  0.2546003E+03
+  0.2532160E+03  0.2518242E+03  0.2504254E+03  0.2490205E+03  0.2476102E+03
+  0.2461953E+03  0.2447764E+03  0.2433543E+03  0.2419299E+03  0.2405038E+03
+  0.2390768E+03  0.2376496E+03  0.2362229E+03  0.2347973E+03  0.2333735E+03
+  0.2319520E+03  0.2305335E+03  0.2291184E+03  0.2277072E+03  0.2263004E+03
+  0.2248984E+03  0.2235015E+03  0.2221102E+03  0.2207247E+03  0.2193453E+03
+  0.2179722E+03  0.2166057E+03  0.2152460E+03  0.2138932E+03  0.2125475E+03
+  0.2112090E+03  0.2098779E+03  0.2085542E+03  0.2072379E+03  0.2059293E+03
+  0.2046282E+03  0.2033348E+03  0.2020491E+03  0.2007711E+03  0.1995008E+03
+  0.1982381E+03  0.1969833E+03  0.1957361E+03  0.1944966E+03  0.1932647E+03
+  0.1920406E+03  0.1908240E+03  0.1896150E+03  0.1884136E+03  0.1872197E+03
+  0.1860333E+03  0.1848544E+03  0.1836828E+03  0.1825187E+03  0.1813619E+03
+  0.1802124E+03  0.1790702E+03  0.1779352E+03  0.1768074E+03  0.1756867E+03
+  0.1745730E+03  0.1734665E+03  0.1723669E+03  0.1712743E+03  0.1701887E+03
+  0.1691099E+03  0.1680379E+03  0.1669727E+03  0.1659143E+03  0.1648626E+03
+  0.1638175E+03  0.1627791E+03  0.1617473E+03  0.1607219E+03  0.1597032E+03
+  0.1586908E+03  0.1576848E+03  0.1566853E+03  0.1556920E+03  0.1547051E+03
+  0.1537245E+03  0.1527500E+03  0.1517817E+03  0.1508196E+03  0.1498636E+03
+  0.1489136E+03  0.1479696E+03  0.1470316E+03  0.1460996E+03  0.1451735E+03
+  0.1442533E+03  0.1433388E+03  0.1424302E+03  0.1415274E+03  0.1406302E+03
+  0.1397387E+03  0.1388530E+03  0.1379728E+03  0.1370982E+03  0.1362291E+03
+  0.1353655E+03  0.1345075E+03  0.1336548E+03  0.1328076E+03  0.1319657E+03
+  0.1311292E+03  0.1302980E+03  0.1294720E+03  0.1286513E+03  0.1278358E+03
+  0.1270254E+03  0.1262202E+03  0.1254201E+03  0.1246251E+03  0.1238351E+03
+  0.1230501E+03  0.1222701E+03  0.1214950E+03  0.1207249E+03  0.1199596E+03
+  0.1191992E+03  0.1184436E+03  0.1176927E+03  0.1169467E+03  0.1162054E+03
+  0.1154688E+03  0.1147368E+03  0.1140095E+03  0.1132868E+03  0.1125687E+03
+  0.1118551E+03  0.1111460E+03  0.1104415E+03  0.1097414E+03  0.1090458E+03
+  0.1083545E+03  0.1076677E+03  0.1069852E+03  0.1063070E+03  0.1056331E+03
+  0.2681671E+03  0.2668968E+03  0.2656145E+03  0.2643203E+03  0.2630144E+03
+  0.2616972E+03  0.2603688E+03  0.2590299E+03  0.2576805E+03  0.2563216E+03
+  0.2549535E+03  0.2535766E+03  0.2521918E+03  0.2507998E+03  0.2494010E+03
+  0.2479964E+03  0.2465866E+03  0.2451724E+03  0.2437546E+03  0.2423339E+03
+  0.2409112E+03  0.2394870E+03  0.2380623E+03  0.2366376E+03  0.2352136E+03
+  0.2337910E+03  0.2323705E+03  0.2309525E+03  0.2295377E+03  0.2281265E+03
+  0.2267194E+03  0.2253169E+03  0.2239193E+03  0.2225270E+03  0.2211404E+03
+  0.2197597E+03  0.2183852E+03  0.2170172E+03  0.2156558E+03  0.2143012E+03
+  0.2129537E+03  0.2116133E+03  0.2102802E+03  0.2089544E+03  0.2076361E+03
+  0.2063253E+03  0.2050220E+03  0.2037264E+03  0.2024385E+03  0.2011582E+03
+  0.1998856E+03  0.1986207E+03  0.1973635E+03  0.1961140E+03  0.1948723E+03
+  0.1936381E+03  0.1924116E+03  0.1911928E+03  0.1899815E+03  0.1887778E+03
+  0.1875817E+03  0.1863930E+03  0.1852118E+03  0.1840381E+03  0.1828717E+03
+  0.1817127E+03  0.1805610E+03  0.1794166E+03  0.1782794E+03  0.1771494E+03
+  0.1760265E+03  0.1749108E+03  0.1738021E+03  0.1727004E+03  0.1716057E+03
+  0.1705179E+03  0.1694370E+03  0.1683630E+03  0.1672957E+03  0.1662353E+03
+  0.1651815E+03  0.1641344E+03  0.1630940E+03  0.1620602E+03  0.1610329E+03
+  0.1600121E+03  0.1589978E+03  0.1579899E+03  0.1569884E+03  0.1559932E+03
+  0.1550044E+03  0.1540219E+03  0.1530455E+03  0.1520754E+03  0.1511114E+03
+  0.1501535E+03  0.1492017E+03  0.1482559E+03  0.1473161E+03  0.1463822E+03
+  0.1454543E+03  0.1445323E+03  0.1436161E+03  0.1427057E+03  0.1418011E+03
+  0.1409023E+03  0.1400091E+03  0.1391216E+03  0.1382397E+03  0.1373634E+03
+  0.1364926E+03  0.1356274E+03  0.1347677E+03  0.1339134E+03  0.1330645E+03
+  0.1322210E+03  0.1313829E+03  0.1305500E+03  0.1297225E+03  0.1289002E+03
+  0.1280831E+03  0.1272712E+03  0.1264644E+03  0.1256627E+03  0.1248662E+03
+  0.1240746E+03  0.1232881E+03  0.1225066E+03  0.1217300E+03  0.1209584E+03
+  0.1201917E+03  0.1194298E+03  0.1186727E+03  0.1179204E+03  0.1171729E+03
+  0.1164302E+03  0.1156921E+03  0.1149588E+03  0.1142300E+03  0.1135059E+03
+  0.1127864E+03  0.1120715E+03  0.1113611E+03  0.1106551E+03  0.1099537E+03
+  0.1092567E+03  0.1085641E+03  0.1078759E+03  0.1071921E+03  0.1065126E+03
+  0.2696669E+03  0.2684195E+03  0.2671598E+03  0.2658879E+03  0.2646039E+03
+  0.2633082E+03  0.2620007E+03  0.2606819E+03  0.2593521E+03  0.2580118E+03
+  0.2566614E+03  0.2553013E+03  0.2539324E+03  0.2525548E+03  0.2511696E+03
+  0.2497773E+03  0.2483786E+03  0.2469744E+03  0.2455652E+03  0.2441518E+03
+  0.2427352E+03  0.2413160E+03  0.2398950E+03  0.2384729E+03  0.2370505E+03
+  0.2356284E+03  0.2342072E+03  0.2327878E+03  0.2313706E+03  0.2299562E+03
+  0.2285451E+03  0.2271379E+03  0.2257350E+03  0.2243368E+03  0.2229437E+03
+  0.2215561E+03  0.2201742E+03  0.2187984E+03  0.2174289E+03  0.2160659E+03
+  0.2147097E+03  0.2133603E+03  0.2120180E+03  0.2106829E+03  0.2093551E+03
+  0.2080347E+03  0.2067218E+03  0.2054164E+03  0.2041186E+03  0.2028284E+03
+  0.2015459E+03  0.2002711E+03  0.1990039E+03  0.1977444E+03  0.1964927E+03
+  0.1952486E+03  0.1940121E+03  0.1927834E+03  0.1915622E+03  0.1903487E+03
+  0.1891427E+03  0.1879443E+03  0.1867534E+03  0.1855699E+03  0.1843939E+03
+  0.1832253E+03  0.1820641E+03  0.1809102E+03  0.1797636E+03  0.1786242E+03
+  0.1774920E+03  0.1763670E+03  0.1752491E+03  0.1741382E+03  0.1730344E+03
+  0.1719376E+03  0.1708477E+03  0.1697647E+03  0.1686886E+03  0.1676193E+03
+  0.1665568E+03  0.1655010E+03  0.1644519E+03  0.1634095E+03  0.1623736E+03
+  0.1613444E+03  0.1603216E+03  0.1593053E+03  0.1582955E+03  0.1572921E+03
+  0.1562950E+03  0.1553043E+03  0.1543198E+03  0.1533416E+03  0.1523696E+03
+  0.1514037E+03  0.1504439E+03  0.1494903E+03  0.1485426E+03  0.1476010E+03
+  0.1466654E+03  0.1457357E+03  0.1448119E+03  0.1438939E+03  0.1429818E+03
+  0.1420754E+03  0.1411748E+03  0.1402799E+03  0.1393907E+03  0.1385071E+03
+  0.1376291E+03  0.1367567E+03  0.1358898E+03  0.1350284E+03  0.1341724E+03
+  0.1333219E+03  0.1324768E+03  0.1316370E+03  0.1308026E+03  0.1299734E+03
+  0.1291495E+03  0.1283308E+03  0.1275173E+03  0.1267090E+03  0.1259058E+03
+  0.1251077E+03  0.1243146E+03  0.1235266E+03  0.1227436E+03  0.1219655E+03
+  0.1211924E+03  0.1204241E+03  0.1196608E+03  0.1189023E+03  0.1181485E+03
+  0.1173996E+03  0.1166554E+03  0.1159159E+03  0.1151811E+03  0.1144510E+03
+  0.1137255E+03  0.1130046E+03  0.1122883E+03  0.1115765E+03  0.1108692E+03
+  0.1101664E+03  0.1094680E+03  0.1087741E+03  0.1080846E+03  0.1073995E+03
+  0.2711260E+03  0.2699018E+03  0.2686649E+03  0.2674160E+03  0.2661545E+03
+  0.2648809E+03  0.2635952E+03  0.2622977E+03  0.2609886E+03  0.2596683E+03
+  0.2583370E+03  0.2569955E+03  0.2556439E+03  0.2542828E+03  0.2529130E+03
+  0.2515349E+03  0.2501492E+03  0.2487568E+03  0.2473584E+03  0.2459544E+03
+  0.2445459E+03  0.2431337E+03  0.2417183E+03  0.2403007E+03  0.2388815E+03
+  0.2374616E+03  0.2360415E+03  0.2346221E+03  0.2332039E+03  0.2317877E+03
+  0.2303739E+03  0.2289631E+03  0.2275559E+03  0.2261528E+03  0.2247541E+03
+  0.2233603E+03  0.2219717E+03  0.2205888E+03  0.2192117E+03  0.2178408E+03
+  0.2164763E+03  0.2151184E+03  0.2137673E+03  0.2124232E+03  0.2110861E+03
+  0.2097564E+03  0.2084339E+03  0.2071189E+03  0.2058114E+03  0.2045114E+03
+  0.2032190E+03  0.2019343E+03  0.2006572E+03  0.1993877E+03  0.1981260E+03
+  0.1968720E+03  0.1956256E+03  0.1943869E+03  0.1931558E+03  0.1919324E+03
+  0.1907166E+03  0.1895083E+03  0.1883076E+03  0.1871144E+03  0.1859287E+03
+  0.1847505E+03  0.1835797E+03  0.1824162E+03  0.1812601E+03  0.1801113E+03
+  0.1789697E+03  0.1778353E+03  0.1767081E+03  0.1755880E+03  0.1744750E+03
+  0.1733691E+03  0.1722702E+03  0.1711782E+03  0.1700931E+03  0.1690149E+03
+  0.1679436E+03  0.1668790E+03  0.1658212E+03  0.1647700E+03  0.1637256E+03
+  0.1626877E+03  0.1616565E+03  0.1606317E+03  0.1596135E+03  0.1586017E+03
+  0.1575963E+03  0.1565974E+03  0.1556047E+03  0.1546183E+03  0.1536382E+03
+  0.1526643E+03  0.1516966E+03  0.1507350E+03  0.1497794E+03  0.1488300E+03
+  0.1478866E+03  0.1469491E+03  0.1460176E+03  0.1450920E+03  0.1441723E+03
+  0.1432584E+03  0.1423503E+03  0.1414479E+03  0.1405513E+03  0.1396603E+03
+  0.1387750E+03  0.1378953E+03  0.1370212E+03  0.1361526E+03  0.1352896E+03
+  0.1344320E+03  0.1335798E+03  0.1327330E+03  0.1318917E+03  0.1310556E+03
+  0.1302248E+03  0.1293994E+03  0.1285791E+03  0.1277640E+03  0.1269541E+03
+  0.1261494E+03  0.1253497E+03  0.1245551E+03  0.1237656E+03  0.1229810E+03
+  0.1222015E+03  0.1214268E+03  0.1206571E+03  0.1198923E+03  0.1191323E+03
+  0.1183771E+03  0.1176267E+03  0.1168811E+03  0.1161402E+03  0.1154039E+03
+  0.1146724E+03  0.1139455E+03  0.1132232E+03  0.1125055E+03  0.1117923E+03
+  0.1110837E+03  0.1103795E+03  0.1096798E+03  0.1089846E+03  0.1082937E+03
+  0.2725441E+03  0.2713430E+03  0.2701295E+03  0.2689036E+03  0.2676651E+03
+  0.2664143E+03  0.2651512E+03  0.2638758E+03  0.2625883E+03  0.2612892E+03
+  0.2599785E+03  0.2586566E+03  0.2573239E+03  0.2559809E+03  0.2546283E+03
+  0.2532661E+03  0.2518956E+03  0.2505170E+03  0.2491310E+03  0.2477385E+03
+  0.2463402E+03  0.2449368E+03  0.2435291E+03  0.2421179E+03  0.2407039E+03
+  0.2392879E+03  0.2378707E+03  0.2364530E+03  0.2350355E+03  0.2336189E+03
+  0.2322037E+03  0.2307908E+03  0.2293805E+03  0.2279735E+03  0.2265702E+03
+  0.2251712E+03  0.2237768E+03  0.2223875E+03  0.2210035E+03  0.2196252E+03
+  0.2182530E+03  0.2168870E+03  0.2155276E+03  0.2141748E+03  0.2128288E+03
+  0.2114900E+03  0.2101582E+03  0.2088338E+03  0.2075166E+03  0.2062070E+03
+  0.2049049E+03  0.2036103E+03  0.2023234E+03  0.2010440E+03  0.1997724E+03
+  0.1985084E+03  0.1972520E+03  0.1960034E+03  0.1947624E+03  0.1935290E+03
+  0.1923033E+03  0.1910852E+03  0.1898747E+03  0.1886717E+03  0.1874763E+03
+  0.1862883E+03  0.1851078E+03  0.1839348E+03  0.1827690E+03  0.1816107E+03
+  0.1804597E+03  0.1793159E+03  0.1781794E+03  0.1770500E+03  0.1759278E+03
+  0.1748126E+03  0.1737046E+03  0.1726035E+03  0.1715094E+03  0.1704222E+03
+  0.1693419E+03  0.1682685E+03  0.1672019E+03  0.1661420E+03  0.1650889E+03
+  0.1640424E+03  0.1630025E+03  0.1619693E+03  0.1609426E+03  0.1599223E+03
+  0.1589086E+03  0.1579013E+03  0.1569003E+03  0.1559058E+03  0.1549175E+03
+  0.1539355E+03  0.1529597E+03  0.1519901E+03  0.1510266E+03  0.1500693E+03
+  0.1491180E+03  0.1481727E+03  0.1472334E+03  0.1463002E+03  0.1453728E+03
+  0.1444512E+03  0.1435356E+03  0.1426257E+03  0.1417216E+03  0.1408232E+03
+  0.1399306E+03  0.1390435E+03  0.1381621E+03  0.1372863E+03  0.1364161E+03
+  0.1355513E+03  0.1346921E+03  0.1338383E+03  0.1329899E+03  0.1321469E+03
+  0.1313092E+03  0.1304768E+03  0.1296497E+03  0.1288279E+03  0.1280112E+03
+  0.1271998E+03  0.1263935E+03  0.1255923E+03  0.1247961E+03  0.1240050E+03
+  0.1232190E+03  0.1224379E+03  0.1216618E+03  0.1208906E+03  0.1201242E+03
+  0.1193628E+03  0.1186061E+03  0.1178543E+03  0.1171072E+03  0.1163649E+03
+  0.1156273E+03  0.1148943E+03  0.1141660E+03  0.1134423E+03  0.1127232E+03
+  0.1120086E+03  0.1112986E+03  0.1105931E+03  0.1098920E+03  0.1091954E+03
+  0.2739214E+03  0.2727433E+03  0.2715530E+03  0.2703502E+03  0.2691350E+03
+  0.2679073E+03  0.2666672E+03  0.2654145E+03  0.2641496E+03  0.2628723E+03
+  0.2615832E+03  0.2602823E+03  0.2589699E+03  0.2576465E+03  0.2563123E+03
+  0.2549680E+03  0.2536142E+03  0.2522512E+03  0.2508799E+03  0.2495008E+03
+  0.2481146E+03  0.2467222E+03  0.2453241E+03  0.2439213E+03  0.2425145E+03
+  0.2411044E+03  0.2396919E+03  0.2382777E+03  0.2368625E+03  0.2354472E+03
+  0.2340322E+03  0.2326185E+03  0.2312065E+03  0.2297969E+03  0.2283902E+03
+  0.2269870E+03  0.2255878E+03  0.2241929E+03  0.2228029E+03  0.2214180E+03
+  0.2200387E+03  0.2186652E+03  0.2172979E+03  0.2159369E+03  0.2145825E+03
+  0.2132348E+03  0.2118941E+03  0.2105604E+03  0.2092340E+03  0.2079149E+03
+  0.2066031E+03  0.2052989E+03  0.2040022E+03  0.2027130E+03  0.2014315E+03
+  0.2001575E+03  0.1988913E+03  0.1976327E+03  0.1963817E+03  0.1951385E+03
+  0.1939028E+03  0.1926749E+03  0.1914544E+03  0.1902416E+03  0.1890364E+03
+  0.1878387E+03  0.1866485E+03  0.1854657E+03  0.1842904E+03  0.1831225E+03
+  0.1819619E+03  0.1808087E+03  0.1796627E+03  0.1785240E+03  0.1773924E+03
+  0.1762681E+03  0.1751508E+03  0.1740405E+03  0.1729374E+03  0.1718412E+03
+  0.1707519E+03  0.1696695E+03  0.1685940E+03  0.1675253E+03  0.1664634E+03
+  0.1654082E+03  0.1643597E+03  0.1633178E+03  0.1622826E+03  0.1612539E+03
+  0.1602317E+03  0.1592160E+03  0.1582067E+03  0.1572039E+03  0.1562074E+03
+  0.1552171E+03  0.1542333E+03  0.1532556E+03  0.1522841E+03  0.1513188E+03
+  0.1503596E+03  0.1494064E+03  0.1484594E+03  0.1475183E+03  0.1465832E+03
+  0.1456540E+03  0.1447307E+03  0.1438132E+03  0.1429016E+03  0.1419958E+03
+  0.1410956E+03  0.1402012E+03  0.1393125E+03  0.1384294E+03  0.1375519E+03
+  0.1366800E+03  0.1358136E+03  0.1349526E+03  0.1340972E+03  0.1332471E+03
+  0.1324025E+03  0.1315632E+03  0.1307292E+03  0.1299005E+03  0.1290771E+03
+  0.1282589E+03  0.1274458E+03  0.1266380E+03  0.1258352E+03  0.1250375E+03
+  0.1242449E+03  0.1234574E+03  0.1226748E+03  0.1218971E+03  0.1211244E+03
+  0.1203566E+03  0.1195937E+03  0.1188356E+03  0.1180823E+03  0.1173338E+03
+  0.1165900E+03  0.1158509E+03  0.1151166E+03  0.1143868E+03  0.1136617E+03
+  0.1129412E+03  0.1122253E+03  0.1115139E+03  0.1108070E+03  0.1101046E+03
+  0.2752579E+03  0.2741026E+03  0.2729354E+03  0.2717556E+03  0.2705638E+03
+  0.2693593E+03  0.2681426E+03  0.2669130E+03  0.2656710E+03  0.2644165E+03
+  0.2631498E+03  0.2618707E+03  0.2605797E+03  0.2592769E+03  0.2579629E+03
+  0.2566379E+03  0.2553024E+03  0.2539568E+03  0.2526019E+03  0.2512380E+03
+  0.2498661E+03  0.2484865E+03  0.2471001E+03  0.2457078E+03  0.2443101E+03
+  0.2429080E+03  0.2415021E+03  0.2400933E+03  0.2386824E+03  0.2372700E+03
+  0.2358570E+03  0.2344441E+03  0.2330319E+03  0.2316211E+03  0.2302123E+03
+  0.2288062E+03  0.2274032E+03  0.2260039E+03  0.2246087E+03  0.2232181E+03
+  0.2218325E+03  0.2204522E+03  0.2190776E+03  0.2177089E+03  0.2163465E+03
+  0.2149905E+03  0.2136411E+03  0.2122986E+03  0.2109631E+03  0.2096347E+03
+  0.2083136E+03  0.2069998E+03  0.2056935E+03  0.2043945E+03  0.2031032E+03
+  0.2018195E+03  0.2005433E+03  0.1992748E+03  0.1980140E+03  0.1967608E+03
+  0.1955152E+03  0.1942773E+03  0.1930470E+03  0.1918244E+03  0.1906093E+03
+  0.1894017E+03  0.1882018E+03  0.1870093E+03  0.1858243E+03  0.1846468E+03
+  0.1834766E+03  0.1823138E+03  0.1811584E+03  0.1800102E+03  0.1788692E+03
+  0.1777355E+03  0.1766090E+03  0.1754895E+03  0.1743772E+03  0.1732719E+03
+  0.1721735E+03  0.1710822E+03  0.1699977E+03  0.1689201E+03  0.1678494E+03
+  0.1667854E+03  0.1657282E+03  0.1646776E+03  0.1636337E+03  0.1625965E+03
+  0.1615658E+03  0.1605417E+03  0.1595240E+03  0.1585128E+03  0.1575080E+03
+  0.1565095E+03  0.1555174E+03  0.1545316E+03  0.1535520E+03  0.1525787E+03
+  0.1516115E+03  0.1506504E+03  0.1496954E+03  0.1487466E+03  0.1478036E+03
+  0.1468667E+03  0.1459357E+03  0.1450106E+03  0.1440914E+03  0.1431780E+03
+  0.1422704E+03  0.1413686E+03  0.1404725E+03  0.1395820E+03  0.1386972E+03
+  0.1378180E+03  0.1369444E+03  0.1360763E+03  0.1352137E+03  0.1343566E+03
+  0.1335049E+03  0.1326586E+03  0.1318177E+03  0.1309821E+03  0.1301518E+03
+  0.1293268E+03  0.1285070E+03  0.1276924E+03  0.1268829E+03  0.1260786E+03
+  0.1252794E+03  0.1244853E+03  0.1236962E+03  0.1229121E+03  0.1221329E+03
+  0.1213587E+03  0.1205894E+03  0.1198250E+03  0.1190655E+03  0.1183107E+03
+  0.1175607E+03  0.1168155E+03  0.1160750E+03  0.1153392E+03  0.1146081E+03
+  0.1138816E+03  0.1131597E+03  0.1124424E+03  0.1117296E+03  0.1110214E+03
+  0.2765544E+03  0.2754214E+03  0.2742769E+03  0.2731202E+03  0.2719514E+03
+  0.2707703E+03  0.2695768E+03  0.2683706E+03  0.2671519E+03  0.2659205E+03
+  0.2646767E+03  0.2634203E+03  0.2621515E+03  0.2608706E+03  0.2595779E+03
+  0.2582733E+03  0.2569576E+03  0.2556310E+03  0.2542941E+03  0.2529473E+03
+  0.2515912E+03  0.2502265E+03  0.2488539E+03  0.2474740E+03  0.2460876E+03
+  0.2446954E+03  0.2432982E+03  0.2418968E+03  0.2404921E+03  0.2390846E+03
+  0.2376754E+03  0.2362650E+03  0.2348542E+03  0.2334438E+03  0.2320345E+03
+  0.2306267E+03  0.2292213E+03  0.2278187E+03  0.2264194E+03  0.2250240E+03
+  0.2236331E+03  0.2222467E+03  0.2208656E+03  0.2194899E+03  0.2181200E+03
+  0.2167562E+03  0.2153987E+03  0.2140477E+03  0.2127036E+03  0.2113662E+03
+  0.2100359E+03  0.2087128E+03  0.2073970E+03  0.2060886E+03  0.2047876E+03
+  0.2034941E+03  0.2022081E+03  0.2009298E+03  0.1996590E+03  0.1983959E+03
+  0.1971405E+03  0.1958926E+03  0.1946524E+03  0.1934199E+03  0.1921950E+03
+  0.1909776E+03  0.1897678E+03  0.1885656E+03  0.1873708E+03  0.1861836E+03
+  0.1850038E+03  0.1838314E+03  0.1826664E+03  0.1815087E+03  0.1803583E+03
+  0.1792152E+03  0.1780793E+03  0.1769506E+03  0.1758290E+03  0.1747145E+03
+  0.1736070E+03  0.1725066E+03  0.1714131E+03  0.1703265E+03  0.1692469E+03
+  0.1681741E+03  0.1671080E+03  0.1660488E+03  0.1649962E+03  0.1639503E+03
+  0.1629110E+03  0.1618784E+03  0.1608522E+03  0.1598326E+03  0.1588194E+03
+  0.1578126E+03  0.1568123E+03  0.1558183E+03  0.1548305E+03  0.1538491E+03
+  0.1528738E+03  0.1519048E+03  0.1509418E+03  0.1499850E+03  0.1490343E+03
+  0.1480895E+03  0.1471508E+03  0.1462180E+03  0.1452912E+03  0.1443702E+03
+  0.1434550E+03  0.1425456E+03  0.1416420E+03  0.1407442E+03  0.1398520E+03
+  0.1389655E+03  0.1380846E+03  0.1372093E+03  0.1363395E+03  0.1354753E+03
+  0.1346165E+03  0.1337632E+03  0.1329152E+03  0.1320727E+03  0.1312355E+03
+  0.1304036E+03  0.1295770E+03  0.1287556E+03  0.1279394E+03  0.1271284E+03
+  0.1263225E+03  0.1255218E+03  0.1247261E+03  0.1239354E+03  0.1231498E+03
+  0.1223692E+03  0.1215935E+03  0.1208227E+03  0.1200568E+03  0.1192958E+03
+  0.1185396E+03  0.1177881E+03  0.1170415E+03  0.1162996E+03  0.1155623E+03
+  0.1148298E+03  0.1141019E+03  0.1133786E+03  0.1126599E+03  0.1119457E+03
+  0.2778113E+03  0.2767004E+03  0.2755780E+03  0.2744440E+03  0.2732981E+03
+  0.2721401E+03  0.2709697E+03  0.2697870E+03  0.2685917E+03  0.2673839E+03
+  0.2661632E+03  0.2649300E+03  0.2636841E+03  0.2624258E+03  0.2611551E+03
+  0.2598722E+03  0.2585775E+03  0.2572713E+03  0.2559538E+03  0.2546257E+03
+  0.2532874E+03  0.2519393E+03  0.2505823E+03  0.2492168E+03  0.2478436E+03
+  0.2464635E+03  0.2450770E+03  0.2436851E+03  0.2422885E+03  0.2408880E+03
+  0.2394844E+03  0.2380784E+03  0.2366709E+03  0.2352626E+03  0.2338542E+03
+  0.2324465E+03  0.2310400E+03  0.2296354E+03  0.2282334E+03  0.2268344E+03
+  0.2254390E+03  0.2240477E+03  0.2226609E+03  0.2212789E+03  0.2199023E+03
+  0.2185313E+03  0.2171662E+03  0.2158072E+03  0.2144548E+03  0.2131089E+03
+  0.2117697E+03  0.2104376E+03  0.2091126E+03  0.2077947E+03  0.2064843E+03
+  0.2051812E+03  0.2038855E+03  0.2025974E+03  0.2013169E+03  0.2000439E+03
+  0.1987785E+03  0.1975208E+03  0.1962707E+03  0.1950283E+03  0.1937935E+03
+  0.1925662E+03  0.1913466E+03  0.1901346E+03  0.1889300E+03  0.1877330E+03
+  0.1865435E+03  0.1853615E+03  0.1841869E+03  0.1830196E+03  0.1818597E+03
+  0.1807071E+03  0.1795618E+03  0.1784237E+03  0.1772928E+03  0.1761691E+03
+  0.1750524E+03  0.1739429E+03  0.1728403E+03  0.1717447E+03  0.1706561E+03
+  0.1695743E+03  0.1684994E+03  0.1674313E+03  0.1663700E+03  0.1653154E+03
+  0.1642675E+03  0.1632262E+03  0.1621915E+03  0.1611634E+03  0.1601418E+03
+  0.1591266E+03  0.1581180E+03  0.1571156E+03  0.1561197E+03  0.1551301E+03
+  0.1541467E+03  0.1531696E+03  0.1521986E+03  0.1512339E+03  0.1502752E+03
+  0.1493226E+03  0.1483760E+03  0.1474355E+03  0.1465009E+03  0.1455722E+03
+  0.1446494E+03  0.1437325E+03  0.1428214E+03  0.1419160E+03  0.1410164E+03
+  0.1401226E+03  0.1392343E+03  0.1383517E+03  0.1374747E+03  0.1366033E+03
+  0.1357373E+03  0.1348769E+03  0.1340219E+03  0.1331723E+03  0.1323282E+03
+  0.1314893E+03  0.1306558E+03  0.1298276E+03  0.1290046E+03  0.1281869E+03
+  0.1273743E+03  0.1265669E+03  0.1257646E+03  0.1249674E+03  0.1241752E+03
+  0.1233880E+03  0.1226059E+03  0.1218287E+03  0.1210564E+03  0.1202891E+03
+  0.1195266E+03  0.1187689E+03  0.1180160E+03  0.1172679E+03  0.1165245E+03
+  0.1157859E+03  0.1150519E+03  0.1143226E+03  0.1135979E+03  0.1128778E+03
+  0.2790297E+03  0.2779402E+03  0.2768397E+03  0.2757278E+03  0.2746043E+03
+  0.2734689E+03  0.2723217E+03  0.2711623E+03  0.2699902E+03  0.2688058E+03
+  0.2676086E+03  0.2663989E+03  0.2651764E+03  0.2639411E+03  0.2626932E+03
+  0.2614329E+03  0.2601602E+03  0.2588754E+03  0.2575788E+03  0.2562707E+03
+  0.2549516E+03  0.2536219E+03  0.2522822E+03  0.2509330E+03  0.2495750E+03
+  0.2482088E+03  0.2468351E+03  0.2454548E+03  0.2440684E+03  0.2426768E+03
+  0.2412809E+03  0.2398814E+03  0.2384790E+03  0.2370746E+03  0.2356691E+03
+  0.2342629E+03  0.2328570E+03  0.2314520E+03  0.2300485E+03  0.2286472E+03
+  0.2272486E+03  0.2258533E+03  0.2244619E+03  0.2230746E+03  0.2216921E+03
+  0.2203146E+03  0.2189426E+03  0.2175762E+03  0.2162160E+03  0.2148620E+03
+  0.2135144E+03  0.2121736E+03  0.2108397E+03  0.2095128E+03  0.2081930E+03
+  0.2068805E+03  0.2055753E+03  0.2042775E+03  0.2029873E+03  0.2017045E+03
+  0.2004294E+03  0.1991618E+03  0.1979018E+03  0.1966495E+03  0.1954048E+03
+  0.1941677E+03  0.1929382E+03  0.1917163E+03  0.1905019E+03  0.1892952E+03
+  0.1880959E+03  0.1869041E+03  0.1857198E+03  0.1845430E+03  0.1833735E+03
+  0.1822114E+03  0.1810566E+03  0.1799091E+03  0.1787688E+03  0.1776357E+03
+  0.1765098E+03  0.1753910E+03  0.1742793E+03  0.1731746E+03  0.1720769E+03
+  0.1709861E+03  0.1699023E+03  0.1688253E+03  0.1677552E+03  0.1666918E+03
+  0.1656351E+03  0.1645852E+03  0.1635419E+03  0.1625052E+03  0.1614751E+03
+  0.1604515E+03  0.1594345E+03  0.1584238E+03  0.1574195E+03  0.1564217E+03
+  0.1554301E+03  0.1544449E+03  0.1534658E+03  0.1524931E+03  0.1515264E+03
+  0.1505659E+03  0.1496114E+03  0.1486630E+03  0.1477207E+03  0.1467843E+03
+  0.1458538E+03  0.1449292E+03  0.1440105E+03  0.1430977E+03  0.1421906E+03
+  0.1412892E+03  0.1403936E+03  0.1395036E+03  0.1386193E+03  0.1377406E+03
+  0.1368675E+03  0.1359999E+03  0.1351378E+03  0.1342812E+03  0.1334300E+03
+  0.1325842E+03  0.1317437E+03  0.1309086E+03  0.1300788E+03  0.1292542E+03
+  0.1284349E+03  0.1276207E+03  0.1268117E+03  0.1260079E+03  0.1252091E+03
+  0.1244154E+03  0.1236267E+03  0.1228431E+03  0.1220644E+03  0.1212906E+03
+  0.1205218E+03  0.1197578E+03  0.1189986E+03  0.1182443E+03  0.1174947E+03
+  0.1167500E+03  0.1160099E+03  0.1152745E+03  0.1145438E+03  0.1138177E+03
+  0.2802106E+03  0.2791419E+03  0.2780625E+03  0.2769722E+03  0.2758707E+03
+  0.2747577E+03  0.2736330E+03  0.2724964E+03  0.2713476E+03  0.2701866E+03
+  0.2690128E+03  0.2678265E+03  0.2666275E+03  0.2654157E+03  0.2641913E+03
+  0.2629539E+03  0.2617040E+03  0.2604416E+03  0.2591667E+03  0.2578800E+03
+  0.2565815E+03  0.2552716E+03  0.2539510E+03  0.2526197E+03  0.2512786E+03
+  0.2499284E+03  0.2485694E+03  0.2472025E+03  0.2458285E+03  0.2444479E+03
+  0.2430617E+03  0.2416707E+03  0.2402755E+03  0.2388770E+03  0.2374761E+03
+  0.2360734E+03  0.2346697E+03  0.2332659E+03  0.2318626E+03  0.2304604E+03
+  0.2290600E+03  0.2276620E+03  0.2262671E+03  0.2248756E+03  0.2234881E+03
+  0.2221050E+03  0.2207268E+03  0.2193538E+03  0.2179864E+03  0.2166248E+03
+  0.2152694E+03  0.2139203E+03  0.2125779E+03  0.2112422E+03  0.2099134E+03
+  0.2085917E+03  0.2072772E+03  0.2059700E+03  0.2046701E+03  0.2033777E+03
+  0.2020928E+03  0.2008155E+03  0.1995457E+03  0.1982835E+03  0.1970289E+03
+  0.1957819E+03  0.1945425E+03  0.1933108E+03  0.1920866E+03  0.1908700E+03
+  0.1896610E+03  0.1884594E+03  0.1872655E+03  0.1860789E+03  0.1848998E+03
+  0.1837281E+03  0.1825637E+03  0.1814067E+03  0.1802570E+03  0.1791145E+03
+  0.1779793E+03  0.1768512E+03  0.1757302E+03  0.1746164E+03  0.1735096E+03
+  0.1724097E+03  0.1713169E+03  0.1702310E+03  0.1691519E+03  0.1680797E+03
+  0.1670143E+03  0.1659556E+03  0.1649036E+03  0.1638583E+03  0.1628196E+03
+  0.1617875E+03  0.1607619E+03  0.1597429E+03  0.1587302E+03  0.1577241E+03
+  0.1567243E+03  0.1557308E+03  0.1547436E+03  0.1537627E+03  0.1527880E+03
+  0.1518195E+03  0.1508571E+03  0.1499008E+03  0.1489506E+03  0.1480064E+03
+  0.1470682E+03  0.1461360E+03  0.1452096E+03  0.1442891E+03  0.1433745E+03
+  0.1424656E+03  0.1415625E+03  0.1406652E+03  0.1397735E+03  0.1388875E+03
+  0.1380071E+03  0.1371323E+03  0.1362630E+03  0.1353992E+03  0.1345409E+03
+  0.1336881E+03  0.1328406E+03  0.1319986E+03  0.1311618E+03  0.1303304E+03
+  0.1295042E+03  0.1286833E+03  0.1278676E+03  0.1270570E+03  0.1262516E+03
+  0.1254513E+03  0.1246561E+03  0.1238659E+03  0.1230807E+03  0.1223005E+03
+  0.1215252E+03  0.1207549E+03  0.1199894E+03  0.1192288E+03  0.1184730E+03
+  0.1177220E+03  0.1169758E+03  0.1162343E+03  0.1154975E+03  0.1147653E+03
+  0.2813550E+03  0.2803063E+03  0.2792475E+03  0.2781781E+03  0.2770980E+03
+  0.2760068E+03  0.2749042E+03  0.2737901E+03  0.2726641E+03  0.2715260E+03
+  0.2703756E+03  0.2692127E+03  0.2680374E+03  0.2668492E+03  0.2656482E+03
+  0.2644343E+03  0.2632078E+03  0.2619685E+03  0.2607164E+03  0.2594519E+03
+  0.2581750E+03  0.2568862E+03  0.2555858E+03  0.2542742E+03  0.2529517E+03
+  0.2516191E+03  0.2502767E+03  0.2489253E+03  0.2475656E+03  0.2461980E+03
+  0.2448236E+03  0.2434431E+03  0.2420571E+03  0.2406666E+03  0.2392723E+03
+  0.2378750E+03  0.2364756E+03  0.2350747E+03  0.2336732E+03  0.2322717E+03
+  0.2308710E+03  0.2294717E+03  0.2280746E+03  0.2266800E+03  0.2252887E+03
+  0.2239011E+03  0.2225177E+03  0.2211388E+03  0.2197650E+03  0.2183966E+03
+  0.2170338E+03  0.2156771E+03  0.2143265E+03  0.2129825E+03  0.2116451E+03
+  0.2103145E+03  0.2089909E+03  0.2076744E+03  0.2063652E+03  0.2050633E+03
+  0.2037688E+03  0.2024817E+03  0.2012022E+03  0.1999302E+03  0.1986658E+03
+  0.1974090E+03  0.1961597E+03  0.1949181E+03  0.1936841E+03  0.1924576E+03
+  0.1912388E+03  0.1900275E+03  0.1888237E+03  0.1876274E+03  0.1864386E+03
+  0.1852573E+03  0.1840833E+03  0.1829167E+03  0.1817575E+03  0.1806056E+03
+  0.1794610E+03  0.1783235E+03  0.1771933E+03  0.1760701E+03  0.1749541E+03
+  0.1738452E+03  0.1727432E+03  0.1716483E+03  0.1705602E+03  0.1694791E+03
+  0.1684048E+03  0.1673373E+03  0.1662766E+03  0.1652226E+03  0.1641753E+03
+  0.1631345E+03  0.1621005E+03  0.1610729E+03  0.1600519E+03  0.1590373E+03
+  0.1580292E+03  0.1570274E+03  0.1560320E+03  0.1550430E+03  0.1540602E+03
+  0.1530836E+03  0.1521132E+03  0.1511489E+03  0.1501908E+03  0.1492388E+03
+  0.1482927E+03  0.1473527E+03  0.1464187E+03  0.1454905E+03  0.1445682E+03
+  0.1436518E+03  0.1427412E+03  0.1418364E+03  0.1409373E+03  0.1400439E+03
+  0.1391561E+03  0.1382740E+03  0.1373975E+03  0.1365266E+03  0.1356611E+03
+  0.1348012E+03  0.1339467E+03  0.1330976E+03  0.1322539E+03  0.1314155E+03
+  0.1305825E+03  0.1297547E+03  0.1289322E+03  0.1281149E+03  0.1273028E+03
+  0.1264958E+03  0.1256940E+03  0.1248972E+03  0.1241055E+03  0.1233188E+03
+  0.1225371E+03  0.1217603E+03  0.1209885E+03  0.1202215E+03  0.1194595E+03
+  0.1187022E+03  0.1179498E+03  0.1172021E+03  0.1164591E+03  0.1157209E+03
+  0.2824640E+03  0.2814348E+03  0.2803958E+03  0.2793467E+03  0.2782873E+03
+  0.2772172E+03  0.2761363E+03  0.2750441E+03  0.2739404E+03  0.2728250E+03
+  0.2716977E+03  0.2705579E+03  0.2694058E+03  0.2682412E+03  0.2670639E+03
+  0.2658737E+03  0.2646708E+03  0.2634548E+03  0.2622260E+03  0.2609844E+03
+  0.2597303E+03  0.2584636E+03  0.2571847E+03  0.2558939E+03  0.2545915E+03
+  0.2532781E+03  0.2519540E+03  0.2506199E+03  0.2492763E+03  0.2479238E+03
+  0.2465633E+03  0.2451953E+03  0.2438206E+03  0.2424401E+03  0.2410546E+03
+  0.2396647E+03  0.2382714E+03  0.2368754E+03  0.2354775E+03  0.2340785E+03
+  0.2326792E+03  0.2312803E+03  0.2298824E+03  0.2284861E+03  0.2270922E+03
+  0.2257012E+03  0.2243136E+03  0.2229299E+03  0.2215506E+03  0.2201761E+03
+  0.2188067E+03  0.2174429E+03  0.2160849E+03  0.2147329E+03  0.2133874E+03
+  0.2120483E+03  0.2107159E+03  0.2093905E+03  0.2080722E+03  0.2067609E+03
+  0.2054570E+03  0.2041604E+03  0.2028712E+03  0.2015896E+03  0.2003154E+03
+  0.1990487E+03  0.1977897E+03  0.1965382E+03  0.1952943E+03  0.1940580E+03
+  0.1928293E+03  0.1916082E+03  0.1903946E+03  0.1891886E+03  0.1879901E+03
+  0.1867990E+03  0.1856154E+03  0.1844392E+03  0.1832705E+03  0.1821090E+03
+  0.1809549E+03  0.1798080E+03  0.1786684E+03  0.1775360E+03  0.1764107E+03
+  0.1752925E+03  0.1741814E+03  0.1730774E+03  0.1719803E+03  0.1708902E+03
+  0.1698069E+03  0.1687306E+03  0.1676610E+03  0.1665982E+03  0.1655422E+03
+  0.1644928E+03  0.1634501E+03  0.1624140E+03  0.1613845E+03  0.1603615E+03
+  0.1593450E+03  0.1583349E+03  0.1573312E+03  0.1563339E+03  0.1553429E+03
+  0.1543582E+03  0.1533797E+03  0.1524074E+03  0.1514413E+03  0.1504814E+03
+  0.1495275E+03  0.1485796E+03  0.1476378E+03  0.1467019E+03  0.1457719E+03
+  0.1448479E+03  0.1439297E+03  0.1430173E+03  0.1421108E+03  0.1412099E+03
+  0.1403148E+03  0.1394254E+03  0.1385415E+03  0.1376633E+03  0.1367907E+03
+  0.1359236E+03  0.1350620E+03  0.1342058E+03  0.1333551E+03  0.1325097E+03
+  0.1316698E+03  0.1308351E+03  0.1300057E+03  0.1291817E+03  0.1283628E+03
+  0.1275491E+03  0.1267405E+03  0.1259371E+03  0.1251388E+03  0.1243456E+03
+  0.1235574E+03  0.1227741E+03  0.1219959E+03  0.1212225E+03  0.1204541E+03
+  0.1196906E+03  0.1189318E+03  0.1181779E+03  0.1174288E+03  0.1166844E+03
+  0.2835388E+03  0.2825283E+03  0.2815084E+03  0.2804789E+03  0.2794395E+03
+  0.2783900E+03  0.2773300E+03  0.2762591E+03  0.2751772E+03  0.2740839E+03
+  0.2729789E+03  0.2718621E+03  0.2707331E+03  0.2695919E+03  0.2684380E+03
+  0.2672717E+03  0.2660922E+03  0.2649001E+03  0.2636949E+03  0.2624767E+03
+  0.2612458E+03  0.2600020E+03  0.2587455E+03  0.2574767E+03  0.2561956E+03
+  0.2549029E+03  0.2535987E+03  0.2522834E+03  0.2509577E+03  0.2496222E+03
+  0.2482774E+03  0.2469240E+03  0.2455628E+03  0.2441943E+03  0.2428195E+03
+  0.2414392E+03  0.2400540E+03  0.2386649E+03  0.2372727E+03  0.2358781E+03
+  0.2344819E+03  0.2330850E+03  0.2316880E+03  0.2302916E+03  0.2288965E+03
+  0.2275035E+03  0.2261130E+03  0.2247255E+03  0.2233418E+03  0.2219621E+03
+  0.2205870E+03  0.2192168E+03  0.2178520E+03  0.2164928E+03  0.2151396E+03
+  0.2137925E+03  0.2124518E+03  0.2111178E+03  0.2097906E+03  0.2084703E+03
+  0.2071572E+03  0.2058512E+03  0.2045526E+03  0.2032613E+03  0.2019775E+03
+  0.2007011E+03  0.1994323E+03  0.1981710E+03  0.1969173E+03  0.1956712E+03
+  0.1944327E+03  0.1932017E+03  0.1919783E+03  0.1907625E+03  0.1895542E+03
+  0.1883534E+03  0.1871601E+03  0.1859742E+03  0.1847958E+03  0.1836248E+03
+  0.1824612E+03  0.1813048E+03  0.1801557E+03  0.1790139E+03  0.1778793E+03
+  0.1767519E+03  0.1756316E+03  0.1745184E+03  0.1734122E+03  0.1723129E+03
+  0.1712207E+03  0.1701354E+03  0.1690569E+03  0.1679853E+03  0.1669205E+03
+  0.1658624E+03  0.1648110E+03  0.1637663E+03  0.1627282E+03  0.1616967E+03
+  0.1606717E+03  0.1596532E+03  0.1586412E+03  0.1576356E+03  0.1566363E+03
+  0.1556434E+03  0.1546568E+03  0.1536764E+03  0.1527023E+03  0.1517343E+03
+  0.1507724E+03  0.1498167E+03  0.1488670E+03  0.1479234E+03  0.1469857E+03
+  0.1460539E+03  0.1451281E+03  0.1442081E+03  0.1432940E+03  0.1423857E+03
+  0.1414831E+03  0.1405862E+03  0.1396951E+03  0.1388095E+03  0.1379296E+03
+  0.1370553E+03  0.1361865E+03  0.1353232E+03  0.1344654E+03  0.1336130E+03
+  0.1327661E+03  0.1319245E+03  0.1310882E+03  0.1302572E+03  0.1294315E+03
+  0.1286111E+03  0.1277958E+03  0.1269857E+03  0.1261808E+03  0.1253809E+03
+  0.1245861E+03  0.1237964E+03  0.1230116E+03  0.1222318E+03  0.1214570E+03
+  0.1206871E+03  0.1199221E+03  0.1191619E+03  0.1184065E+03  0.1176560E+03
+  0.2845808E+03  0.2835882E+03  0.2825866E+03  0.2815757E+03  0.2805559E+03
+  0.2795262E+03  0.2784862E+03  0.2774361E+03  0.2763753E+03  0.2753036E+03
+  0.2742206E+03  0.2731261E+03  0.2720198E+03  0.2709015E+03  0.2697710E+03
+  0.2686279E+03  0.2674722E+03  0.2663037E+03  0.2651224E+03  0.2639280E+03
+  0.2627207E+03  0.2615004E+03  0.2602671E+03  0.2590210E+03  0.2577623E+03
+  0.2564913E+03  0.2552082E+03  0.2539133E+03  0.2526071E+03  0.2512902E+03
+  0.2499629E+03  0.2486261E+03  0.2472800E+03  0.2459257E+03  0.2445639E+03
+  0.2431951E+03  0.2418202E+03  0.2404401E+03  0.2390555E+03  0.2376673E+03
+  0.2362763E+03  0.2348831E+03  0.2334889E+03  0.2320940E+03  0.2306994E+03
+  0.2293058E+03  0.2279137E+03  0.2265239E+03  0.2251368E+03  0.2237531E+03
+  0.2223732E+03  0.2209977E+03  0.2196268E+03  0.2182611E+03  0.2169008E+03
+  0.2155463E+03  0.2141978E+03  0.2128557E+03  0.2115200E+03  0.2101911E+03
+  0.2088690E+03  0.2075539E+03  0.2062460E+03  0.2049453E+03  0.2036519E+03
+  0.2023660E+03  0.2010875E+03  0.1998165E+03  0.1985530E+03  0.1972971E+03
+  0.1960487E+03  0.1948079E+03  0.1935747E+03  0.1923491E+03  0.1911310E+03
+  0.1899204E+03  0.1887174E+03  0.1875218E+03  0.1863337E+03  0.1851531E+03
+  0.1839798E+03  0.1828140E+03  0.1816554E+03  0.1805041E+03  0.1793601E+03
+  0.1782234E+03  0.1770937E+03  0.1759713E+03  0.1748559E+03  0.1737476E+03
+  0.1726463E+03  0.1715519E+03  0.1704645E+03  0.1693839E+03  0.1683103E+03
+  0.1672434E+03  0.1661833E+03  0.1651298E+03  0.1640831E+03  0.1630430E+03
+  0.1620095E+03  0.1609825E+03  0.1599620E+03  0.1589481E+03  0.1579405E+03
+  0.1569393E+03  0.1559445E+03  0.1549559E+03  0.1539737E+03  0.1529977E+03
+  0.1520278E+03  0.1510641E+03  0.1501065E+03  0.1491550E+03  0.1482095E+03
+  0.1472700E+03  0.1463365E+03  0.1454088E+03  0.1444871E+03  0.1435712E+03
+  0.1426611E+03  0.1417568E+03  0.1408582E+03  0.1399653E+03  0.1390780E+03
+  0.1381964E+03  0.1373204E+03  0.1364499E+03  0.1355850E+03  0.1347255E+03
+  0.1338715E+03  0.1330229E+03  0.1321796E+03  0.1313418E+03  0.1305092E+03
+  0.1296819E+03  0.1288599E+03  0.1280430E+03  0.1272314E+03  0.1264248E+03
+  0.1256234E+03  0.1248271E+03  0.1240358E+03  0.1232496E+03  0.1224683E+03
+  0.1216920E+03  0.1209206E+03  0.1201541E+03  0.1193924E+03  0.1186356E+03
+  0.2855910E+03  0.2846154E+03  0.2836314E+03  0.2826389E+03  0.2816375E+03
+  0.2806268E+03  0.2796065E+03  0.2785764E+03  0.2775360E+03  0.2764851E+03
+  0.2754234E+03  0.2743507E+03  0.2732665E+03  0.2721705E+03  0.2710629E+03
+  0.2699431E+03  0.2688108E+03  0.2676659E+03  0.2665083E+03  0.2653378E+03
+  0.2641542E+03  0.2629576E+03  0.2617482E+03  0.2605254E+03  0.2592898E+03
+  0.2580415E+03  0.2567805E+03  0.2555072E+03  0.2542220E+03  0.2529251E+03
+  0.2516170E+03  0.2502983E+03  0.2489696E+03  0.2476314E+03  0.2462843E+03
+  0.2449291E+03  0.2435666E+03  0.2421976E+03  0.2408228E+03  0.2394430E+03
+  0.2380591E+03  0.2366719E+03  0.2352822E+03  0.2338908E+03  0.2324984E+03
+  0.2311058E+03  0.2297137E+03  0.2283229E+03  0.2269339E+03  0.2255473E+03
+  0.2241638E+03  0.2227839E+03  0.2214080E+03  0.2200366E+03  0.2186701E+03
+  0.2173088E+03  0.2159532E+03  0.2146034E+03  0.2132598E+03  0.2119225E+03
+  0.2105919E+03  0.2092681E+03  0.2079511E+03  0.2066413E+03  0.2053386E+03
+  0.2040432E+03  0.2027551E+03  0.2014745E+03  0.2002013E+03  0.1989356E+03
+  0.1976775E+03  0.1964269E+03  0.1951839E+03  0.1939484E+03  0.1927205E+03
+  0.1915002E+03  0.1902874E+03  0.1890821E+03  0.1878843E+03  0.1866939E+03
+  0.1855110E+03  0.1843356E+03  0.1831674E+03  0.1820067E+03  0.1808532E+03
+  0.1797070E+03  0.1785680E+03  0.1774363E+03  0.1763116E+03  0.1751941E+03
+  0.1740836E+03  0.1729802E+03  0.1718837E+03  0.1707942E+03  0.1697116E+03
+  0.1686358E+03  0.1675669E+03  0.1665047E+03  0.1654492E+03  0.1644005E+03
+  0.1633584E+03  0.1623228E+03  0.1612939E+03  0.1602715E+03  0.1592555E+03
+  0.1582460E+03  0.1572429E+03  0.1562461E+03  0.1552557E+03  0.1542715E+03
+  0.1532936E+03  0.1523219E+03  0.1513563E+03  0.1503969E+03  0.1494435E+03
+  0.1484962E+03  0.1475549E+03  0.1466195E+03  0.1456901E+03  0.1447666E+03
+  0.1438489E+03  0.1429371E+03  0.1420310E+03  0.1411307E+03  0.1402361E+03
+  0.1393471E+03  0.1384638E+03  0.1375861E+03  0.1367139E+03  0.1358473E+03
+  0.1349861E+03  0.1341305E+03  0.1332802E+03  0.1324354E+03  0.1315959E+03
+  0.1307617E+03  0.1299328E+03  0.1291091E+03  0.1282907E+03  0.1274775E+03
+  0.1266694E+03  0.1258665E+03  0.1250686E+03  0.1242758E+03  0.1234880E+03
+  0.1227052E+03  0.1219274E+03  0.1211545E+03  0.1203865E+03  0.1196234E+03
+  0.2865706E+03  0.2856115E+03  0.2846445E+03  0.2836693E+03  0.2826856E+03
+  0.2816933E+03  0.2806917E+03  0.2796808E+03  0.2786601E+03  0.2776295E+03
+  0.2765884E+03  0.2755368E+03  0.2744742E+03  0.2734003E+03  0.2723148E+03
+  0.2712178E+03  0.2701082E+03  0.2689868E+03  0.2678527E+03  0.2667058E+03
+  0.2655461E+03  0.2643735E+03  0.2631878E+03  0.2619889E+03  0.2607769E+03
+  0.2595520E+03  0.2583141E+03  0.2570633E+03  0.2558000E+03  0.2545246E+03
+  0.2532371E+03  0.2519382E+03  0.2506283E+03  0.2493079E+03  0.2479776E+03
+  0.2466381E+03  0.2452900E+03  0.2439341E+03  0.2425712E+03  0.2412020E+03
+  0.2398273E+03  0.2384480E+03  0.2370649E+03  0.2356788E+03  0.2342905E+03
+  0.2329008E+03  0.2315104E+03  0.2301202E+03  0.2287308E+03  0.2273429E+03
+  0.2259570E+03  0.2245739E+03  0.2231941E+03  0.2218180E+03  0.2204461E+03
+  0.2190789E+03  0.2177168E+03  0.2163601E+03  0.2150091E+03  0.2136641E+03
+  0.2123254E+03  0.2109931E+03  0.2096675E+03  0.2083488E+03  0.2070370E+03
+  0.2057323E+03  0.2044349E+03  0.2031448E+03  0.2018620E+03  0.2005867E+03
+  0.1993189E+03  0.1980585E+03  0.1968057E+03  0.1955605E+03  0.1943228E+03
+  0.1930926E+03  0.1918700E+03  0.1906549E+03  0.1894474E+03  0.1882474E+03
+  0.1870548E+03  0.1858697E+03  0.1846919E+03  0.1835216E+03  0.1823586E+03
+  0.1812029E+03  0.1800546E+03  0.1789134E+03  0.1777795E+03  0.1766526E+03
+  0.1755330E+03  0.1744204E+03  0.1733148E+03  0.1722162E+03  0.1711246E+03
+  0.1700399E+03  0.1689621E+03  0.1678910E+03  0.1668268E+03  0.1657693E+03
+  0.1647185E+03  0.1636744E+03  0.1626369E+03  0.1616059E+03  0.1605815E+03
+  0.1595636E+03  0.1585521E+03  0.1575471E+03  0.1565484E+03  0.1555560E+03
+  0.1545700E+03  0.1535901E+03  0.1526166E+03  0.1516491E+03  0.1506878E+03
+  0.1497326E+03  0.1487835E+03  0.1478403E+03  0.1469032E+03  0.1459720E+03
+  0.1450466E+03  0.1441272E+03  0.1432136E+03  0.1423057E+03  0.1414037E+03
+  0.1405073E+03  0.1396167E+03  0.1387316E+03  0.1378522E+03  0.1369784E+03
+  0.1361101E+03  0.1352473E+03  0.1343899E+03  0.1335380E+03  0.1326915E+03
+  0.1318504E+03  0.1310146E+03  0.1301841E+03  0.1293589E+03  0.1285389E+03
+  0.1277241E+03  0.1269144E+03  0.1261099E+03  0.1253105E+03  0.1245162E+03
+  0.1237269E+03  0.1229426E+03  0.1221632E+03  0.1213889E+03  0.1206194E+03
+  0.2875207E+03  0.2865776E+03  0.2856266E+03  0.2846679E+03  0.2837015E+03
+  0.2827266E+03  0.2817432E+03  0.2807507E+03  0.2797491E+03  0.2787379E+03
+  0.2777167E+03  0.2766854E+03  0.2756436E+03  0.2745911E+03  0.2735274E+03
+  0.2724522E+03  0.2713654E+03  0.2702670E+03  0.2691559E+03  0.2680325E+03
+  0.2668964E+03  0.2657476E+03  0.2645857E+03  0.2634109E+03  0.2622229E+03
+  0.2610216E+03  0.2598073E+03  0.2585798E+03  0.2573395E+03  0.2560864E+03
+  0.2548208E+03  0.2535430E+03  0.2522535E+03  0.2509526E+03  0.2496408E+03
+  0.2483188E+03  0.2469870E+03  0.2456464E+03  0.2442973E+03  0.2429408E+03
+  0.2415775E+03  0.2402082E+03  0.2388338E+03  0.2374550E+03  0.2360728E+03
+  0.2346879E+03  0.2333012E+03  0.2319133E+03  0.2305252E+03  0.2291374E+03
+  0.2277507E+03  0.2263658E+03  0.2249832E+03  0.2236036E+03  0.2222275E+03
+  0.2208553E+03  0.2194876E+03  0.2181247E+03  0.2167670E+03  0.2154149E+03
+  0.2140686E+03  0.2127284E+03  0.2113946E+03  0.2100673E+03  0.2087468E+03
+  0.2074332E+03  0.2061266E+03  0.2048272E+03  0.2035350E+03  0.2022502E+03
+  0.2009727E+03  0.1997027E+03  0.1984402E+03  0.1971852E+03  0.1959377E+03
+  0.1946978E+03  0.1934654E+03  0.1922405E+03  0.1910232E+03  0.1898134E+03
+  0.1886111E+03  0.1874163E+03  0.1862289E+03  0.1850490E+03  0.1838764E+03
+  0.1827112E+03  0.1815533E+03  0.1804028E+03  0.1792594E+03  0.1781233E+03
+  0.1769943E+03  0.1758725E+03  0.1747577E+03  0.1736500E+03  0.1725493E+03
+  0.1714556E+03  0.1703688E+03  0.1692889E+03  0.1682158E+03  0.1671495E+03
+  0.1660900E+03  0.1650371E+03  0.1639910E+03  0.1629515E+03  0.1619185E+03
+  0.1608921E+03  0.1598723E+03  0.1588588E+03  0.1578519E+03  0.1568512E+03
+  0.1558569E+03  0.1548690E+03  0.1538873E+03  0.1529118E+03  0.1519425E+03
+  0.1509793E+03  0.1500223E+03  0.1490713E+03  0.1481263E+03  0.1471874E+03
+  0.1462543E+03  0.1453272E+03  0.1444060E+03  0.1434906E+03  0.1425810E+03
+  0.1416772E+03  0.1407791E+03  0.1398867E+03  0.1390000E+03  0.1381189E+03
+  0.1372433E+03  0.1363734E+03  0.1355089E+03  0.1346499E+03  0.1337964E+03
+  0.1329482E+03  0.1321055E+03  0.1312681E+03  0.1304360E+03  0.1296091E+03
+  0.1287875E+03  0.1279712E+03  0.1271600E+03  0.1263539E+03  0.1255529E+03
+  0.1247571E+03  0.1239662E+03  0.1231804E+03  0.1223996E+03  0.1216237E+03
+  0.2884430E+03  0.2875147E+03  0.2865791E+03  0.2856365E+03  0.2846863E+03
+  0.2837283E+03  0.2827620E+03  0.2817874E+03  0.2808039E+03  0.2798114E+03
+  0.2788095E+03  0.2777979E+03  0.2767762E+03  0.2757442E+03  0.2747016E+03
+  0.2736480E+03  0.2725831E+03  0.2715067E+03  0.2704183E+03  0.2693181E+03
+  0.2682053E+03  0.2670801E+03  0.2659421E+03  0.2647911E+03  0.2636271E+03
+  0.2624499E+03  0.2612595E+03  0.2600558E+03  0.2588390E+03  0.2576091E+03
+  0.2563663E+03  0.2551108E+03  0.2538429E+03  0.2525628E+03  0.2512711E+03
+  0.2499683E+03  0.2486547E+03  0.2473310E+03  0.2459979E+03  0.2446561E+03
+  0.2433062E+03  0.2419491E+03  0.2405855E+03  0.2392162E+03  0.2378422E+03
+  0.2364641E+03  0.2350829E+03  0.2336994E+03  0.2323143E+03  0.2309284E+03
+  0.2295425E+03  0.2281573E+03  0.2267735E+03  0.2253917E+03  0.2240125E+03
+  0.2226365E+03  0.2212641E+03  0.2198960E+03  0.2185325E+03  0.2171739E+03
+  0.2158207E+03  0.2144732E+03  0.2131317E+03  0.2117964E+03  0.2104675E+03
+  0.2091452E+03  0.2078298E+03  0.2065214E+03  0.2052200E+03  0.2039258E+03
+  0.2026389E+03  0.2013593E+03  0.2000872E+03  0.1988225E+03  0.1975653E+03
+  0.1963156E+03  0.1950734E+03  0.1938388E+03  0.1926117E+03  0.1913922E+03
+  0.1901801E+03  0.1889756E+03  0.1877785E+03  0.1865889E+03  0.1854067E+03
+  0.1842319E+03  0.1830645E+03  0.1819044E+03  0.1807516E+03  0.1796061E+03
+  0.1784678E+03  0.1773366E+03  0.1762126E+03  0.1750957E+03  0.1739859E+03
+  0.1728831E+03  0.1717872E+03  0.1706984E+03  0.1696163E+03  0.1685412E+03
+  0.1674728E+03  0.1664112E+03  0.1653564E+03  0.1643082E+03  0.1632667E+03
+  0.1622317E+03  0.1612034E+03  0.1601815E+03  0.1591661E+03  0.1581572E+03
+  0.1571546E+03  0.1561584E+03  0.1551685E+03  0.1541849E+03  0.1532076E+03
+  0.1522364E+03  0.1512714E+03  0.1503125E+03  0.1493596E+03  0.1484129E+03
+  0.1474721E+03  0.1465372E+03  0.1456083E+03  0.1446853E+03  0.1437682E+03
+  0.1428568E+03  0.1419513E+03  0.1410515E+03  0.1401573E+03  0.1392689E+03
+  0.1383861E+03  0.1375088E+03  0.1366371E+03  0.1357710E+03  0.1349104E+03
+  0.1340552E+03  0.1332054E+03  0.1323610E+03  0.1315220E+03  0.1306883E+03
+  0.1298598E+03  0.1290367E+03  0.1282187E+03  0.1274059E+03  0.1265983E+03
+  0.1257958E+03  0.1249984E+03  0.1242060E+03  0.1234187E+03  0.1226363E+03
+  0.2893380E+03  0.2884240E+03  0.2875036E+03  0.2865759E+03  0.2856413E+03
+  0.2846994E+03  0.2837497E+03  0.2827921E+03  0.2818260E+03  0.2808514E+03
+  0.2798679E+03  0.2788752E+03  0.2778730E+03  0.2768608E+03  0.2758386E+03
+  0.2748057E+03  0.2737621E+03  0.2727074E+03  0.2716412E+03  0.2705635E+03
+  0.2694736E+03  0.2683716E+03  0.2672570E+03  0.2661297E+03  0.2649897E+03
+  0.2638364E+03  0.2626701E+03  0.2614905E+03  0.2602976E+03  0.2590915E+03
+  0.2578722E+03  0.2566398E+03  0.2553945E+03  0.2541365E+03  0.2528662E+03
+  0.2515839E+03  0.2502901E+03  0.2489853E+03  0.2476699E+03  0.2463447E+03
+  0.2450103E+03  0.2436675E+03  0.2423168E+03  0.2409592E+03  0.2395954E+03
+  0.2382263E+03  0.2368527E+03  0.2354754E+03  0.2340954E+03  0.2327132E+03
+  0.2313299E+03  0.2299461E+03  0.2285626E+03  0.2271801E+03  0.2257993E+03
+  0.2244207E+03  0.2230449E+03  0.2216726E+03  0.2203042E+03  0.2189401E+03
+  0.2175808E+03  0.2162267E+03  0.2148781E+03  0.2135352E+03  0.2121985E+03
+  0.2108680E+03  0.2095442E+03  0.2082270E+03  0.2069166E+03  0.2056134E+03
+  0.2043172E+03  0.2030282E+03  0.2017466E+03  0.2004723E+03  0.1992054E+03
+  0.1979461E+03  0.1966942E+03  0.1954498E+03  0.1942130E+03  0.1929837E+03
+  0.1917618E+03  0.1905475E+03  0.1893407E+03  0.1881414E+03  0.1869496E+03
+  0.1857652E+03  0.1845882E+03  0.1834185E+03  0.1822562E+03  0.1811012E+03
+  0.1799535E+03  0.1788130E+03  0.1776797E+03  0.1765535E+03  0.1754345E+03
+  0.1743225E+03  0.1732176E+03  0.1721196E+03  0.1710286E+03  0.1699445E+03
+  0.1688673E+03  0.1677969E+03  0.1667332E+03  0.1656763E+03  0.1646261E+03
+  0.1635826E+03  0.1625457E+03  0.1615153E+03  0.1604915E+03  0.1594741E+03
+  0.1584632E+03  0.1574587E+03  0.1564606E+03  0.1554688E+03  0.1544833E+03
+  0.1535040E+03  0.1525310E+03  0.1515641E+03  0.1506033E+03  0.1496486E+03
+  0.1487000E+03  0.1477574E+03  0.1468208E+03  0.1458901E+03  0.1449653E+03
+  0.1440464E+03  0.1431333E+03  0.1422259E+03  0.1413244E+03  0.1404285E+03
+  0.1395384E+03  0.1386538E+03  0.1377749E+03  0.1369016E+03  0.1360337E+03
+  0.1351714E+03  0.1343146E+03  0.1334631E+03  0.1326171E+03  0.1317765E+03
+  0.1309411E+03  0.1301111E+03  0.1292863E+03  0.1284668E+03  0.1276524E+03
+  0.1268433E+03  0.1260392E+03  0.1252402E+03  0.1244464E+03  0.1236575E+03
+  0.2902071E+03  0.2893069E+03  0.2884004E+03  0.2874875E+03  0.2865676E+03
+  0.2856411E+03  0.2847072E+03  0.2837658E+03  0.2828165E+03  0.2818591E+03
+  0.2808933E+03  0.2799188E+03  0.2789351E+03  0.2779421E+03  0.2769394E+03
+  0.2759267E+03  0.2749036E+03  0.2738698E+03  0.2728251E+03  0.2717692E+03
+  0.2707017E+03  0.2696223E+03  0.2685309E+03  0.2674269E+03  0.2663104E+03
+  0.2651812E+03  0.2640388E+03  0.2628832E+03  0.2617146E+03  0.2605325E+03
+  0.2593372E+03  0.2581286E+03  0.2569066E+03  0.2556715E+03  0.2544237E+03
+  0.2531633E+03  0.2518907E+03  0.2506062E+03  0.2493103E+03  0.2480034E+03
+  0.2466864E+03  0.2453597E+03  0.2440240E+03  0.2426801E+03  0.2413288E+03
+  0.2399708E+03  0.2386070E+03  0.2372381E+03  0.2358651E+03  0.2344888E+03
+  0.2331100E+03  0.2317294E+03  0.2303480E+03  0.2289664E+03  0.2275854E+03
+  0.2262057E+03  0.2248279E+03  0.2234526E+03  0.2220804E+03  0.2207119E+03
+  0.2193474E+03  0.2179875E+03  0.2166325E+03  0.2152829E+03  0.2139388E+03
+  0.2126007E+03  0.2112688E+03  0.2099433E+03  0.2086244E+03  0.2073123E+03
+  0.2060071E+03  0.2047090E+03  0.2034181E+03  0.2021344E+03  0.2008580E+03
+  0.1995890E+03  0.1983274E+03  0.1970734E+03  0.1958268E+03  0.1945877E+03
+  0.1933561E+03  0.1921321E+03  0.1909156E+03  0.1897065E+03  0.1885050E+03
+  0.1873109E+03  0.1861242E+03  0.1849450E+03  0.1837731E+03  0.1826086E+03
+  0.1814514E+03  0.1803015E+03  0.1791588E+03  0.1780233E+03  0.1768950E+03
+  0.1757738E+03  0.1746597E+03  0.1735526E+03  0.1724525E+03  0.1713594E+03
+  0.1702733E+03  0.1691939E+03  0.1681214E+03  0.1670558E+03  0.1659968E+03
+  0.1649446E+03  0.1638990E+03  0.1628601E+03  0.1618277E+03  0.1608019E+03
+  0.1597826E+03  0.1587697E+03  0.1577633E+03  0.1567632E+03  0.1557695E+03
+  0.1547821E+03  0.1538010E+03  0.1528260E+03  0.1518573E+03  0.1508947E+03
+  0.1499381E+03  0.1489877E+03  0.1480432E+03  0.1471048E+03  0.1461723E+03
+  0.1452457E+03  0.1443250E+03  0.1434101E+03  0.1425011E+03  0.1415977E+03
+  0.1407002E+03  0.1398083E+03  0.1389220E+03  0.1380414E+03  0.1371664E+03
+  0.1362969E+03  0.1354329E+03  0.1345744E+03  0.1337213E+03  0.1328737E+03
+  0.1320314E+03  0.1311944E+03  0.1303628E+03  0.1295364E+03  0.1287153E+03
+  0.1278994E+03  0.1270886E+03  0.1262830E+03  0.1254825E+03  0.1246871E+03
+  0.2910515E+03  0.2901642E+03  0.2892712E+03  0.2883721E+03  0.2874668E+03
+  0.2865545E+03  0.2856360E+03  0.2847100E+03  0.2837767E+03  0.2828357E+03
+  0.2818868E+03  0.2809296E+03  0.2799638E+03  0.2789891E+03  0.2780052E+03
+  0.2770118E+03  0.2760085E+03  0.2749952E+03  0.2739711E+03  0.2729363E+03
+  0.2718905E+03  0.2708333E+03  0.2697644E+03  0.2686833E+03  0.2675901E+03
+  0.2664843E+03  0.2653657E+03  0.2642342E+03  0.2630896E+03  0.2619317E+03
+  0.2607605E+03  0.2595760E+03  0.2583779E+03  0.2571666E+03  0.2559421E+03
+  0.2547046E+03  0.2534542E+03  0.2521914E+03  0.2509162E+03  0.2496296E+03
+  0.2483316E+03  0.2470228E+03  0.2457041E+03  0.2443760E+03  0.2430391E+03
+  0.2416943E+03  0.2403424E+03  0.2389841E+03  0.2376204E+03  0.2362519E+03
+  0.2348796E+03  0.2335043E+03  0.2321268E+03  0.2307480E+03  0.2293686E+03
+  0.2279893E+03  0.2266110E+03  0.2252341E+03  0.2238595E+03  0.2224876E+03
+  0.2211191E+03  0.2197543E+03  0.2183939E+03  0.2170383E+03  0.2156877E+03
+  0.2143425E+03  0.2130032E+03  0.2116698E+03  0.2103428E+03  0.2090222E+03
+  0.2077083E+03  0.2064013E+03  0.2051013E+03  0.2038083E+03  0.2025226E+03
+  0.2012442E+03  0.1999731E+03  0.1987094E+03  0.1974531E+03  0.1962044E+03
+  0.1949631E+03  0.1937293E+03  0.1925030E+03  0.1912842E+03  0.1900730E+03
+  0.1888692E+03  0.1876729E+03  0.1864840E+03  0.1853025E+03  0.1841284E+03
+  0.1829617E+03  0.1818023E+03  0.1806501E+03  0.1795053E+03  0.1783676E+03
+  0.1772371E+03  0.1761138E+03  0.1749975E+03  0.1738883E+03  0.1727861E+03
+  0.1716909E+03  0.1706026E+03  0.1695212E+03  0.1684467E+03  0.1673789E+03
+  0.1663179E+03  0.1652637E+03  0.1642161E+03  0.1631751E+03  0.1621408E+03
+  0.1611130E+03  0.1600917E+03  0.1590769E+03  0.1580685E+03  0.1570665E+03
+  0.1560709E+03  0.1550815E+03  0.1540985E+03  0.1531216E+03  0.1521510E+03
+  0.1511865E+03  0.1502282E+03  0.1492759E+03  0.1483296E+03  0.1473894E+03
+  0.1464551E+03  0.1455267E+03  0.1446042E+03  0.1436876E+03  0.1427767E+03
+  0.1418717E+03  0.1409724E+03  0.1400787E+03  0.1391908E+03  0.1383084E+03
+  0.1374317E+03  0.1365605E+03  0.1356949E+03  0.1348347E+03  0.1339800E+03
+  0.1331307E+03  0.1322868E+03  0.1314482E+03  0.1306150E+03  0.1297870E+03
+  0.1289643E+03  0.1281468E+03  0.1273345E+03  0.1265273E+03  0.1257253E+03
+  0.2918719E+03  0.2909971E+03  0.2901168E+03  0.2892310E+03  0.2883392E+03
+  0.2874413E+03  0.2865366E+03  0.2856259E+03  0.2847077E+03  0.2837824E+03
+  0.2828498E+03  0.2819091E+03  0.2809604E+03  0.2800033E+03  0.2790374E+03
+  0.2780626E+03  0.2770783E+03  0.2760844E+03  0.2750805E+03  0.2740663E+03
+  0.2730414E+03  0.2720056E+03  0.2709586E+03  0.2698997E+03  0.2688292E+03
+  0.2677464E+03  0.2666512E+03  0.2655434E+03  0.2644226E+03  0.2632889E+03
+  0.2621419E+03  0.2609815E+03  0.2598078E+03  0.2586206E+03  0.2574200E+03
+  0.2562061E+03  0.2549789E+03  0.2537387E+03  0.2524858E+03  0.2512204E+03
+  0.2499431E+03  0.2486541E+03  0.2473540E+03  0.2460435E+03  0.2447232E+03
+  0.2433937E+03  0.2420557E+03  0.2407101E+03  0.2393577E+03  0.2379992E+03
+  0.2366356E+03  0.2352676E+03  0.2338961E+03  0.2325220E+03  0.2311460E+03
+  0.2297690E+03  0.2283918E+03  0.2270150E+03  0.2256393E+03  0.2242655E+03
+  0.2228941E+03  0.2215257E+03  0.2201609E+03  0.2188001E+03  0.2174438E+03
+  0.2160924E+03  0.2147463E+03  0.2134057E+03  0.2120710E+03  0.2107425E+03
+  0.2094204E+03  0.2081048E+03  0.2067960E+03  0.2054941E+03  0.2041992E+03
+  0.2029115E+03  0.2016309E+03  0.2003578E+03  0.1990919E+03  0.1978335E+03
+  0.1965826E+03  0.1953391E+03  0.1941031E+03  0.1928746E+03  0.1916536E+03
+  0.1904401E+03  0.1892340E+03  0.1880355E+03  0.1868444E+03  0.1856607E+03
+  0.1844843E+03  0.1833154E+03  0.1821538E+03  0.1809995E+03  0.1798524E+03
+  0.1787125E+03  0.1775799E+03  0.1764544E+03  0.1753360E+03  0.1742246E+03
+  0.1731203E+03  0.1720230E+03  0.1709326E+03  0.1698491E+03  0.1687725E+03
+  0.1677027E+03  0.1666396E+03  0.1655833E+03  0.1645337E+03  0.1634908E+03
+  0.1624544E+03  0.1614246E+03  0.1604014E+03  0.1593846E+03  0.1583743E+03
+  0.1573703E+03  0.1563728E+03  0.1553815E+03  0.1543966E+03  0.1534178E+03
+  0.1524453E+03  0.1514790E+03  0.1505188E+03  0.1495646E+03  0.1486166E+03
+  0.1476745E+03  0.1467384E+03  0.1458082E+03  0.1448839E+03  0.1439655E+03
+  0.1430529E+03  0.1421461E+03  0.1412450E+03  0.1403497E+03  0.1394600E+03
+  0.1385760E+03  0.1376976E+03  0.1368247E+03  0.1359574E+03  0.1350955E+03
+  0.1342392E+03  0.1333882E+03  0.1325427E+03  0.1317025E+03  0.1308676E+03
+  0.1300381E+03  0.1292138E+03  0.1283947E+03  0.1275808E+03  0.1267721E+03
+  0.2926696E+03  0.2918066E+03  0.2909386E+03  0.2900654E+03  0.2891866E+03
+  0.2883020E+03  0.2874114E+03  0.2865143E+03  0.2856110E+03  0.2847006E+03
+  0.2837831E+03  0.2828585E+03  0.2819261E+03  0.2809858E+03  0.2800374E+03
+  0.2790803E+03  0.2781143E+03  0.2771392E+03  0.2761545E+03  0.2751600E+03
+  0.2741553E+03  0.2731402E+03  0.2721142E+03  0.2710771E+03  0.2700288E+03
+  0.2689684E+03  0.2678961E+03  0.2668115E+03  0.2657143E+03  0.2646044E+03
+  0.2634814E+03  0.2623452E+03  0.2611958E+03  0.2600329E+03  0.2588565E+03
+  0.2576667E+03  0.2564633E+03  0.2552468E+03  0.2540169E+03  0.2527740E+03
+  0.2515185E+03  0.2502506E+03  0.2489709E+03  0.2476797E+03  0.2463777E+03
+  0.2450654E+03  0.2437435E+03  0.2424127E+03  0.2410738E+03  0.2397275E+03
+  0.2383746E+03  0.2370161E+03  0.2356527E+03  0.2342853E+03  0.2329148E+03
+  0.2315420E+03  0.2301677E+03  0.2287926E+03  0.2274176E+03  0.2260433E+03
+  0.2246705E+03  0.2232998E+03  0.2219318E+03  0.2205670E+03  0.2192060E+03
+  0.2178492E+03  0.2164971E+03  0.2151500E+03  0.2138084E+03  0.2124724E+03
+  0.2111425E+03  0.2098188E+03  0.2085016E+03  0.2071911E+03  0.2058873E+03
+  0.2045905E+03  0.2033008E+03  0.2020183E+03  0.2007430E+03  0.1994751E+03
+  0.1982145E+03  0.1969614E+03  0.1957157E+03  0.1944775E+03  0.1932468E+03
+  0.1920236E+03  0.1908079E+03  0.1895996E+03  0.1883988E+03  0.1872054E+03
+  0.1860195E+03  0.1848410E+03  0.1836698E+03  0.1825060E+03  0.1813495E+03
+  0.1802002E+03  0.1790581E+03  0.1779234E+03  0.1767957E+03  0.1756751E+03
+  0.1745616E+03  0.1734552E+03  0.1723557E+03  0.1712632E+03  0.1701777E+03
+  0.1690989E+03  0.1680271E+03  0.1669620E+03  0.1659037E+03  0.1648520E+03
+  0.1638070E+03  0.1627687E+03  0.1617369E+03  0.1607117E+03  0.1596929E+03
+  0.1586806E+03  0.1576748E+03  0.1566753E+03  0.1556821E+03  0.1546952E+03
+  0.1537146E+03  0.1527402E+03  0.1517720E+03  0.1508099E+03  0.1498540E+03
+  0.1489041E+03  0.1479601E+03  0.1470222E+03  0.1460903E+03  0.1451642E+03
+  0.1442440E+03  0.1433297E+03  0.1424211E+03  0.1415183E+03  0.1406212E+03
+  0.1397298E+03  0.1388441E+03  0.1379639E+03  0.1370894E+03  0.1362204E+03
+  0.1353569E+03  0.1344989E+03  0.1336463E+03  0.1327991E+03  0.1319573E+03
+  0.1311208E+03  0.1302896E+03  0.1294637E+03  0.1286431E+03  0.1278276E+03
+  0.2934454E+03  0.2925936E+03  0.2917375E+03  0.2908762E+03  0.2900096E+03
+  0.2891378E+03  0.2882603E+03  0.2873769E+03  0.2864872E+03  0.2855913E+03
+  0.2846886E+03  0.2837791E+03  0.2828623E+03  0.2819380E+03  0.2810060E+03
+  0.2800659E+03  0.2791175E+03  0.2781603E+03  0.2771943E+03  0.2762185E+03
+  0.2752334E+03  0.2742381E+03  0.2732326E+03  0.2722165E+03  0.2711893E+03
+  0.2701510E+03  0.2691010E+03  0.2680390E+03  0.2669650E+03  0.2658784E+03
+  0.2647792E+03  0.2636670E+03  0.2625417E+03  0.2614032E+03  0.2602510E+03
+  0.2590856E+03  0.2579065E+03  0.2567139E+03  0.2555078E+03  0.2542884E+03
+  0.2530558E+03  0.2518103E+03  0.2505522E+03  0.2492819E+03  0.2479998E+03
+  0.2467065E+03  0.2454025E+03  0.2440884E+03  0.2427651E+03  0.2414331E+03
+  0.2400932E+03  0.2387463E+03  0.2373932E+03  0.2360348E+03  0.2346718E+03
+  0.2333051E+03  0.2319357E+03  0.2305643E+03  0.2291917E+03  0.2278187E+03
+  0.2264460E+03  0.2250744E+03  0.2237046E+03  0.2223371E+03  0.2209725E+03
+  0.2196114E+03  0.2182543E+03  0.2169016E+03  0.2155537E+03  0.2142111E+03
+  0.2128740E+03  0.2115427E+03  0.2102176E+03  0.2088987E+03  0.2075865E+03
+  0.2062810E+03  0.2049823E+03  0.2036907E+03  0.2024062E+03  0.2011289E+03
+  0.1998588E+03  0.1985962E+03  0.1973409E+03  0.1960930E+03  0.1948526E+03
+  0.1936197E+03  0.1923943E+03  0.1911763E+03  0.1899658E+03  0.1887628E+03
+  0.1875672E+03  0.1863790E+03  0.1851982E+03  0.1840249E+03  0.1828588E+03
+  0.1817001E+03  0.1805486E+03  0.1794044E+03  0.1782674E+03  0.1771376E+03
+  0.1760149E+03  0.1748992E+03  0.1737907E+03  0.1726891E+03  0.1715945E+03
+  0.1705068E+03  0.1694260E+03  0.1683521E+03  0.1672850E+03  0.1662246E+03
+  0.1651709E+03  0.1641239E+03  0.1630835E+03  0.1620497E+03  0.1610225E+03
+  0.1600018E+03  0.1589876E+03  0.1579798E+03  0.1569783E+03  0.1559833E+03
+  0.1549945E+03  0.1540120E+03  0.1530357E+03  0.1520656E+03  0.1511017E+03
+  0.1501439E+03  0.1491921E+03  0.1482464E+03  0.1473066E+03  0.1463729E+03
+  0.1454450E+03  0.1445230E+03  0.1436069E+03  0.1426966E+03  0.1417920E+03
+  0.1408932E+03  0.1400001E+03  0.1391126E+03  0.1382308E+03  0.1373546E+03
+  0.1364839E+03  0.1356187E+03  0.1347590E+03  0.1339048E+03  0.1330560E+03
+  0.1322125E+03  0.1313745E+03  0.1305417E+03  0.1297142E+03  0.1288919E+03
+  0.2942003E+03  0.2933594E+03  0.2925143E+03  0.2916643E+03  0.2908097E+03
+  0.2899499E+03  0.2890849E+03  0.2882143E+03  0.2873381E+03  0.2864555E+03
+  0.2855671E+03  0.2846718E+03  0.2837701E+03  0.2828612E+03  0.2819449E+03
+  0.2810211E+03  0.2800893E+03  0.2791493E+03  0.2782008E+03  0.2772433E+03
+  0.2762768E+03  0.2753009E+03  0.2743150E+03  0.2733190E+03  0.2723125E+03
+  0.2712951E+03  0.2702671E+03  0.2692270E+03  0.2681754E+03  0.2671118E+03
+  0.2660358E+03  0.2649473E+03  0.2638457E+03  0.2627313E+03  0.2616035E+03
+  0.2604624E+03  0.2593079E+03  0.2581395E+03  0.2569577E+03  0.2557623E+03
+  0.2545534E+03  0.2533312E+03  0.2520959E+03  0.2508477E+03  0.2495870E+03
+  0.2483142E+03  0.2470298E+03  0.2457344E+03  0.2444285E+03  0.2431128E+03
+  0.2417879E+03  0.2404548E+03  0.2391142E+03  0.2377668E+03  0.2364135E+03
+  0.2350552E+03  0.2336927E+03  0.2323270E+03  0.2309588E+03  0.2295889E+03
+  0.2282181E+03  0.2268473E+03  0.2254772E+03  0.2241084E+03  0.2227416E+03
+  0.2213773E+03  0.2200163E+03  0.2186590E+03  0.2173058E+03  0.2159573E+03
+  0.2146137E+03  0.2132755E+03  0.2119431E+03  0.2106165E+03  0.2092962E+03
+  0.2079823E+03  0.2066750E+03  0.2053746E+03  0.2040810E+03  0.2027946E+03
+  0.2015152E+03  0.2002432E+03  0.1989784E+03  0.1977209E+03  0.1964709E+03
+  0.1952283E+03  0.1939932E+03  0.1927656E+03  0.1915454E+03  0.1903326E+03
+  0.1891274E+03  0.1879296E+03  0.1867392E+03  0.1855562E+03  0.1843806E+03
+  0.1832123E+03  0.1820514E+03  0.1808978E+03  0.1797513E+03  0.1786122E+03
+  0.1774802E+03  0.1763553E+03  0.1752375E+03  0.1741268E+03  0.1730231E+03
+  0.1719264E+03  0.1708367E+03  0.1697538E+03  0.1686777E+03  0.1676085E+03
+  0.1665461E+03  0.1654904E+03  0.1644414E+03  0.1633990E+03  0.1623632E+03
+  0.1613340E+03  0.1603113E+03  0.1592951E+03  0.1582854E+03  0.1572820E+03
+  0.1562850E+03  0.1552943E+03  0.1543099E+03  0.1533317E+03  0.1523598E+03
+  0.1513940E+03  0.1504343E+03  0.1494807E+03  0.1485331E+03  0.1475916E+03
+  0.1466560E+03  0.1457264E+03  0.1448026E+03  0.1438847E+03  0.1429726E+03
+  0.1420663E+03  0.1411658E+03  0.1402709E+03  0.1393818E+03  0.1384982E+03
+  0.1376203E+03  0.1367479E+03  0.1358811E+03  0.1350197E+03  0.1341638E+03
+  0.1333134E+03  0.1324683E+03  0.1316286E+03  0.1307942E+03  0.1299651E+03
+  0.2949350E+03  0.2941045E+03  0.2932699E+03  0.2924309E+03  0.2915874E+03
+  0.2907392E+03  0.2898861E+03  0.2890279E+03  0.2881642E+03  0.2872947E+03
+  0.2864192E+03  0.2855383E+03  0.2846506E+03  0.2837563E+03  0.2828551E+03
+  0.2819468E+03  0.2810310E+03  0.2801074E+03  0.2791758E+03  0.2782357E+03
+  0.2772872E+03  0.2763295E+03  0.2753626E+03  0.2743860E+03  0.2733994E+03
+  0.2724025E+03  0.2713949E+03  0.2703764E+03  0.2693467E+03  0.2683053E+03
+  0.2672520E+03  0.2661865E+03  0.2651084E+03  0.2640177E+03  0.2629140E+03
+  0.2617971E+03  0.2606668E+03  0.2595231E+03  0.2583657E+03  0.2571947E+03
+  0.2560100E+03  0.2548118E+03  0.2536001E+03  0.2523750E+03  0.2511369E+03
+  0.2498860E+03  0.2486228E+03  0.2473474E+03  0.2460609E+03  0.2447634E+03
+  0.2434557E+03  0.2421383E+03  0.2408122E+03  0.2394780E+03  0.2381367E+03
+  0.2367889E+03  0.2354355E+03  0.2340775E+03  0.2327157E+03  0.2313509E+03
+  0.2299840E+03  0.2286158E+03  0.2272471E+03  0.2258786E+03  0.2245110E+03
+  0.2231451E+03  0.2217815E+03  0.2204207E+03  0.2190633E+03  0.2177098E+03
+  0.2163607E+03  0.2150163E+03  0.2136772E+03  0.2123435E+03  0.2110157E+03
+  0.2096939E+03  0.2083784E+03  0.2070695E+03  0.2057673E+03  0.2044718E+03
+  0.2031834E+03  0.2019021E+03  0.2006280E+03  0.1993611E+03  0.1981016E+03
+  0.1968494E+03  0.1956047E+03  0.1943674E+03  0.1931375E+03  0.1919151E+03
+  0.1907002E+03  0.1894927E+03  0.1882926E+03  0.1871000E+03  0.1859148E+03
+  0.1847370E+03  0.1835665E+03  0.1824034E+03  0.1812475E+03  0.1800989E+03
+  0.1789576E+03  0.1778234E+03  0.1766964E+03  0.1755764E+03  0.1744636E+03
+  0.1733578E+03  0.1722590E+03  0.1711671E+03  0.1700821E+03  0.1690040E+03
+  0.1679327E+03  0.1668682E+03  0.1658105E+03  0.1647594E+03  0.1637151E+03
+  0.1626773E+03  0.1616461E+03  0.1606214E+03  0.1596033E+03  0.1585916E+03
+  0.1575862E+03  0.1565873E+03  0.1555947E+03  0.1546084E+03  0.1536283E+03
+  0.1526545E+03  0.1516868E+03  0.1507253E+03  0.1497699E+03  0.1488204E+03
+  0.1478771E+03  0.1469397E+03  0.1460082E+03  0.1450827E+03  0.1441630E+03
+  0.1432492E+03  0.1423411E+03  0.1414388E+03  0.1405423E+03  0.1396514E+03
+  0.1387661E+03  0.1378865E+03  0.1370124E+03  0.1361439E+03  0.1352809E+03
+  0.1344234E+03  0.1335712E+03  0.1327245E+03  0.1318832E+03  0.1310472E+03
+  0.2956505E+03  0.2948298E+03  0.2940053E+03  0.2931767E+03  0.2923439E+03
+  0.2915068E+03  0.2906650E+03  0.2898184E+03  0.2889669E+03  0.2881097E+03
+  0.2872472E+03  0.2863791E+03  0.2855051E+03  0.2846247E+03  0.2837379E+03
+  0.2828443E+03  0.2819438E+03  0.2810359E+03  0.2801204E+03  0.2791969E+03
+  0.2782656E+03  0.2773255E+03  0.2763766E+03  0.2754185E+03  0.2744510E+03
+  0.2734738E+03  0.2724863E+03  0.2714885E+03  0.2704799E+03  0.2694599E+03
+  0.2684288E+03  0.2673856E+03  0.2663304E+03  0.2652630E+03  0.2641829E+03
+  0.2630899E+03  0.2619838E+03  0.2608644E+03  0.2597314E+03  0.2585851E+03
+  0.2574249E+03  0.2562510E+03  0.2550636E+03  0.2538623E+03  0.2526476E+03
+  0.2514198E+03  0.2501789E+03  0.2489253E+03  0.2476595E+03  0.2463819E+03
+  0.2450930E+03  0.2437934E+03  0.2424840E+03  0.2411651E+03  0.2398377E+03
+  0.2385027E+03  0.2371606E+03  0.2358126E+03  0.2344593E+03  0.2331017E+03
+  0.2317407E+03  0.2303771E+03  0.2290116E+03  0.2276452E+03  0.2262786E+03
+  0.2249125E+03  0.2235477E+03  0.2221848E+03  0.2208244E+03  0.2194671E+03
+  0.2181134E+03  0.2167639E+03  0.2154189E+03  0.2140788E+03  0.2127441E+03
+  0.2114151E+03  0.2100919E+03  0.2087749E+03  0.2074643E+03  0.2061603E+03
+  0.2048631E+03  0.2035728E+03  0.2022896E+03  0.2010134E+03  0.1997445E+03
+  0.1984828E+03  0.1972285E+03  0.1959816E+03  0.1947422E+03  0.1935101E+03
+  0.1922855E+03  0.1910684E+03  0.1898586E+03  0.1886564E+03  0.1874615E+03
+  0.1862741E+03  0.1850940E+03  0.1839214E+03  0.1827560E+03  0.1815979E+03
+  0.1804472E+03  0.1793036E+03  0.1781673E+03  0.1770381E+03  0.1759160E+03
+  0.1748010E+03  0.1736931E+03  0.1725921E+03  0.1714982E+03  0.1704111E+03
+  0.1693309E+03  0.1682576E+03  0.1671910E+03  0.1661312E+03  0.1650782E+03
+  0.1640318E+03  0.1629920E+03  0.1619588E+03  0.1609321E+03  0.1599120E+03
+  0.1588983E+03  0.1578911E+03  0.1568902E+03  0.1558957E+03  0.1549075E+03
+  0.1539255E+03  0.1529498E+03  0.1519803E+03  0.1510169E+03  0.1500596E+03
+  0.1491084E+03  0.1481631E+03  0.1472239E+03  0.1462907E+03  0.1453634E+03
+  0.1444419E+03  0.1435263E+03  0.1426165E+03  0.1417124E+03  0.1408141E+03
+  0.1399215E+03  0.1390346E+03  0.1381532E+03  0.1372775E+03  0.1364073E+03
+  0.1355426E+03  0.1346834E+03  0.1338296E+03  0.1329813E+03  0.1321383E+03
+  0.2963476E+03  0.2955363E+03  0.2947213E+03  0.2939027E+03  0.2930801E+03
+  0.2922534E+03  0.2914224E+03  0.2905869E+03  0.2897467E+03  0.2889015E+03
+  0.2880512E+03  0.2871956E+03  0.2863342E+03  0.2854676E+03  0.2845943E+03
+  0.2837149E+03  0.2828288E+03  0.2819359E+03  0.2810358E+03  0.2801283E+03
+  0.2792132E+03  0.2782900E+03  0.2773584E+03  0.2764181E+03  0.2754689E+03
+  0.2745105E+03  0.2735424E+03  0.2725642E+03  0.2715759E+03  0.2705767E+03
+  0.2695669E+03  0.2685456E+03  0.2675128E+03  0.2664680E+03  0.2654109E+03
+  0.2643414E+03  0.2632590E+03  0.2621637E+03  0.2610552E+03  0.2599331E+03
+  0.2587976E+03  0.2576483E+03  0.2564853E+03  0.2553085E+03  0.2541180E+03
+  0.2529139E+03  0.2516964E+03  0.2504655E+03  0.2492218E+03  0.2479656E+03
+  0.2466972E+03  0.2454172E+03  0.2441262E+03  0.2428245E+03  0.2415134E+03
+  0.2401931E+03  0.2388646E+03  0.2375287E+03  0.2361862E+03  0.2348380E+03
+  0.2334850E+03  0.2321280E+03  0.2307678E+03  0.2294054E+03  0.2280415E+03
+  0.2266770E+03  0.2253127E+03  0.2239491E+03  0.2225871E+03  0.2212273E+03
+  0.2198703E+03  0.2185166E+03  0.2171668E+03  0.2158212E+03  0.2144804E+03
+  0.2131447E+03  0.2118145E+03  0.2104900E+03  0.2091716E+03  0.2078595E+03
+  0.2065538E+03  0.2052549E+03  0.2039627E+03  0.2026774E+03  0.2013994E+03
+  0.2001284E+03  0.1988647E+03  0.1976083E+03  0.1963592E+03  0.1951176E+03
+  0.1938833E+03  0.1926565E+03  0.1914371E+03  0.1902252E+03  0.1890208E+03
+  0.1878237E+03  0.1866340E+03  0.1854518E+03  0.1842768E+03  0.1831093E+03
+  0.1819491E+03  0.1807961E+03  0.1796503E+03  0.1785118E+03  0.1773805E+03
+  0.1762562E+03  0.1751391E+03  0.1740290E+03  0.1729260E+03  0.1718299E+03
+  0.1707407E+03  0.1696584E+03  0.1685830E+03  0.1675144E+03  0.1664526E+03
+  0.1653975E+03  0.1643491E+03  0.1633073E+03  0.1622721E+03  0.1612435E+03
+  0.1602213E+03  0.1592057E+03  0.1581965E+03  0.1571937E+03  0.1561973E+03
+  0.1552071E+03  0.1542233E+03  0.1532457E+03  0.1522742E+03  0.1513090E+03
+  0.1503499E+03  0.1493968E+03  0.1484498E+03  0.1475087E+03  0.1465737E+03
+  0.1456445E+03  0.1447213E+03  0.1438039E+03  0.1428924E+03  0.1419866E+03
+  0.1410865E+03  0.1401922E+03  0.1393035E+03  0.1384205E+03  0.1375430E+03
+  0.1366711E+03  0.1358048E+03  0.1349439E+03  0.1340885E+03  0.1332385E+03
+  0.2970271E+03  0.2962245E+03  0.2954188E+03  0.2946096E+03  0.2937967E+03
+  0.2929800E+03  0.2921593E+03  0.2913344E+03  0.2905051E+03  0.2896712E+03
+  0.2888324E+03  0.2879887E+03  0.2871400E+03  0.2862856E+03  0.2854256E+03
+  0.2845596E+03  0.2836874E+03  0.2828086E+03  0.2819234E+03  0.2810310E+03
+  0.2801314E+03  0.2792242E+03  0.2783092E+03  0.2773859E+03  0.2764542E+03
+  0.2755138E+03  0.2745642E+03  0.2736051E+03  0.2726363E+03  0.2716573E+03
+  0.2706678E+03  0.2696676E+03  0.2686563E+03  0.2676335E+03  0.2665989E+03
+  0.2655522E+03  0.2644931E+03  0.2634215E+03  0.2623370E+03  0.2612390E+03
+  0.2601280E+03  0.2590032E+03  0.2578648E+03  0.2567127E+03  0.2555467E+03
+  0.2543670E+03  0.2531735E+03  0.2519664E+03  0.2507459E+03  0.2495122E+03
+  0.2482657E+03  0.2470067E+03  0.2457358E+03  0.2444535E+03  0.2431603E+03
+  0.2418568E+03  0.2405439E+03  0.2392224E+03  0.2378928E+03  0.2365562E+03
+  0.2352133E+03  0.2338652E+03  0.2325125E+03  0.2311561E+03  0.2297970E+03
+  0.2284359E+03  0.2270738E+03  0.2257114E+03  0.2243494E+03  0.2229885E+03
+  0.2216295E+03  0.2202729E+03  0.2189193E+03  0.2175693E+03  0.2162233E+03
+  0.2148819E+03  0.2135453E+03  0.2122140E+03  0.2108884E+03  0.2095686E+03
+  0.2082549E+03  0.2069477E+03  0.2056469E+03  0.2043530E+03  0.2030659E+03
+  0.2017858E+03  0.2005128E+03  0.1992471E+03  0.1979886E+03  0.1967374E+03
+  0.1954936E+03  0.1942572E+03  0.1930282E+03  0.1918066E+03  0.1905925E+03
+  0.1893858E+03  0.1881865E+03  0.1869947E+03  0.1858102E+03  0.1846330E+03
+  0.1834633E+03  0.1823008E+03  0.1811457E+03  0.1799977E+03  0.1788570E+03
+  0.1777235E+03  0.1765971E+03  0.1754778E+03  0.1743656E+03  0.1732605E+03
+  0.1721623E+03  0.1710710E+03  0.1699866E+03  0.1689091E+03  0.1678385E+03
+  0.1667746E+03  0.1657174E+03  0.1646670E+03  0.1636232E+03  0.1625860E+03
+  0.1615554E+03  0.1605313E+03  0.1595137E+03  0.1585025E+03  0.1574978E+03
+  0.1564994E+03  0.1555074E+03  0.1545216E+03  0.1535421E+03  0.1525688E+03
+  0.1516017E+03  0.1506407E+03  0.1496858E+03  0.1487369E+03  0.1477941E+03
+  0.1468572E+03  0.1459263E+03  0.1450013E+03  0.1440821E+03  0.1431688E+03
+  0.1422612E+03  0.1413595E+03  0.1404634E+03  0.1395730E+03  0.1386882E+03
+  0.1378091E+03  0.1369355E+03  0.1360675E+03  0.1352050E+03  0.1343479E+03
+  0.2976893E+03  0.2968954E+03  0.2960984E+03  0.2952982E+03  0.2944946E+03
+  0.2936875E+03  0.2928766E+03  0.2920619E+03  0.2912430E+03  0.2904198E+03
+  0.2895921E+03  0.2887598E+03  0.2879224E+03  0.2870804E+03  0.2862325E+03
+  0.2853795E+03  0.2845205E+03  0.2836555E+03  0.2827842E+03  0.2819062E+03
+  0.2810214E+03  0.2801296E+03  0.2792303E+03  0.2783233E+03  0.2774082E+03
+  0.2764851E+03  0.2755532E+03  0.2746123E+03  0.2736621E+03  0.2727025E+03
+  0.2717328E+03  0.2707528E+03  0.2697622E+03  0.2687607E+03  0.2677479E+03
+  0.2667234E+03  0.2656870E+03  0.2646384E+03  0.2635773E+03  0.2625032E+03
+  0.2614162E+03  0.2603159E+03  0.2592021E+03  0.2580746E+03  0.2569333E+03
+  0.2557782E+03  0.2546092E+03  0.2534264E+03  0.2522299E+03  0.2510198E+03
+  0.2497963E+03  0.2485597E+03  0.2473104E+03  0.2460488E+03  0.2447754E+03
+  0.2434907E+03  0.2421954E+03  0.2408902E+03  0.2395758E+03  0.2382529E+03
+  0.2369225E+03  0.2355853E+03  0.2342422E+03  0.2328941E+03  0.2315418E+03
+  0.2301862E+03  0.2288283E+03  0.2274688E+03  0.2261085E+03  0.2247482E+03
+  0.2233887E+03  0.2220306E+03  0.2206747E+03  0.2193214E+03  0.2179714E+03
+  0.2166251E+03  0.2152831E+03  0.2139458E+03  0.2126136E+03  0.2112868E+03
+  0.2099657E+03  0.2086507E+03  0.2073418E+03  0.2060394E+03  0.2047437E+03
+  0.2034548E+03  0.2021728E+03  0.2008978E+03  0.1996301E+03  0.1983695E+03
+  0.1971162E+03  0.1958703E+03  0.1946317E+03  0.1934005E+03  0.1921768E+03
+  0.1909604E+03  0.1897515E+03  0.1885500E+03  0.1873559E+03  0.1861692E+03
+  0.1849899E+03  0.1838179E+03  0.1826532E+03  0.1814959E+03  0.1803458E+03
+  0.1792029E+03  0.1780672E+03  0.1769386E+03  0.1758172E+03  0.1747029E+03
+  0.1735956E+03  0.1724952E+03  0.1714019E+03  0.1703154E+03  0.1692359E+03
+  0.1681631E+03  0.1670972E+03  0.1660380E+03  0.1649855E+03  0.1639397E+03
+  0.1629005E+03  0.1618679E+03  0.1608418E+03  0.1598223E+03  0.1588092E+03
+  0.1578025E+03  0.1568022E+03  0.1558082E+03  0.1548205E+03  0.1538391E+03
+  0.1528640E+03  0.1518949E+03  0.1509321E+03  0.1499754E+03  0.1490247E+03
+  0.1480800E+03  0.1471413E+03  0.1462086E+03  0.1452818E+03  0.1443608E+03
+  0.1434457E+03  0.1425364E+03  0.1416329E+03  0.1407351E+03  0.1398430E+03
+  0.1389565E+03  0.1380757E+03  0.1372004E+03  0.1363307E+03  0.1354665E+03
+  0.2983355E+03  0.2975495E+03  0.2967610E+03  0.2959695E+03  0.2951747E+03
+  0.2943766E+03  0.2935751E+03  0.2927698E+03  0.2919611E+03  0.2911481E+03
+  0.2903310E+03  0.2895095E+03  0.2886833E+03  0.2878524E+03  0.2870168E+03
+  0.2861757E+03  0.2853294E+03  0.2844773E+03  0.2836192E+03  0.2827552E+03
+  0.2818845E+03  0.2810071E+03  0.2801230E+03  0.2792315E+03  0.2783324E+03
+  0.2774257E+03  0.2765107E+03  0.2755872E+03  0.2746550E+03  0.2737137E+03
+  0.2727630E+03  0.2718025E+03  0.2708316E+03  0.2698508E+03  0.2688589E+03
+  0.2678559E+03  0.2668415E+03  0.2658152E+03  0.2647770E+03  0.2637263E+03
+  0.2626629E+03  0.2615866E+03  0.2604970E+03  0.2593940E+03  0.2582774E+03
+  0.2571471E+03  0.2560029E+03  0.2548449E+03  0.2536727E+03  0.2524869E+03
+  0.2512872E+03  0.2500741E+03  0.2488475E+03  0.2476080E+03  0.2463560E+03
+  0.2450917E+03  0.2438159E+03  0.2425289E+03  0.2412317E+03  0.2399246E+03
+  0.2386088E+03  0.2372848E+03  0.2359535E+03  0.2346158E+03  0.2332726E+03
+  0.2319247E+03  0.2305730E+03  0.2292185E+03  0.2278618E+03  0.2265040E+03
+  0.2251457E+03  0.2237877E+03  0.2224308E+03  0.2210756E+03  0.2197228E+03
+  0.2183729E+03  0.2170265E+03  0.2156841E+03  0.2143462E+03  0.2130131E+03
+  0.2116853E+03  0.2103630E+03  0.2090466E+03  0.2077362E+03  0.2064323E+03
+  0.2051348E+03  0.2038441E+03  0.2025602E+03  0.2012833E+03  0.2000135E+03
+  0.1987510E+03  0.1974956E+03  0.1962475E+03  0.1950068E+03  0.1937735E+03
+  0.1925475E+03  0.1913289E+03  0.1901178E+03  0.1889141E+03  0.1877178E+03
+  0.1865289E+03  0.1853474E+03  0.1841732E+03  0.1830063E+03  0.1818468E+03
+  0.1806944E+03  0.1795494E+03  0.1784115E+03  0.1772808E+03  0.1761573E+03
+  0.1750408E+03  0.1739313E+03  0.1728289E+03  0.1717334E+03  0.1706449E+03
+  0.1695632E+03  0.1684884E+03  0.1674204E+03  0.1663592E+03  0.1653046E+03
+  0.1642568E+03  0.1632156E+03  0.1621810E+03  0.1611529E+03  0.1601314E+03
+  0.1591163E+03  0.1581077E+03  0.1571055E+03  0.1561096E+03  0.1551200E+03
+  0.1541367E+03  0.1531597E+03  0.1521888E+03  0.1512241E+03  0.1502655E+03
+  0.1493129E+03  0.1483664E+03  0.1474259E+03  0.1464914E+03  0.1455628E+03
+  0.1446401E+03  0.1437232E+03  0.1428122E+03  0.1419069E+03  0.1410073E+03
+  0.1401135E+03  0.1392253E+03  0.1383428E+03  0.1374658E+03  0.1365944E+03
+  0.2989657E+03  0.2981877E+03  0.2974071E+03  0.2966238E+03  0.2958374E+03
+  0.2950481E+03  0.2942556E+03  0.2934595E+03  0.2926600E+03  0.2918569E+03
+  0.2910499E+03  0.2902387E+03  0.2894233E+03  0.2886033E+03  0.2877786E+03
+  0.2869494E+03  0.2861150E+03  0.2852750E+03  0.2844299E+03  0.2835788E+03
+  0.2827219E+03  0.2818584E+03  0.2809884E+03  0.2801117E+03  0.2792279E+03
+  0.2783366E+03  0.2774379E+03  0.2765310E+03  0.2756159E+03  0.2746924E+03
+  0.2737597E+03  0.2728178E+03  0.2718663E+03  0.2709051E+03  0.2699334E+03
+  0.2689511E+03  0.2679578E+03  0.2669534E+03  0.2659373E+03  0.2649093E+03
+  0.2638688E+03  0.2628159E+03  0.2617501E+03  0.2606714E+03  0.2595792E+03
+  0.2584735E+03  0.2573540E+03  0.2562207E+03  0.2550735E+03  0.2539123E+03
+  0.2527372E+03  0.2515482E+03  0.2503454E+03  0.2491292E+03  0.2478996E+03
+  0.2466572E+03  0.2454023E+03  0.2441355E+03  0.2428572E+03  0.2415680E+03
+  0.2402689E+03  0.2389602E+03  0.2376430E+03  0.2363180E+03  0.2349860E+03
+  0.2336479E+03  0.2323047E+03  0.2309572E+03  0.2296063E+03  0.2282528E+03
+  0.2268976E+03  0.2255415E+03  0.2241854E+03  0.2228298E+03  0.2214756E+03
+  0.2201234E+03  0.2187739E+03  0.2174275E+03  0.2160849E+03  0.2147464E+03
+  0.2134126E+03  0.2120838E+03  0.2107604E+03  0.2094427E+03  0.2081310E+03
+  0.2068254E+03  0.2055263E+03  0.2042339E+03  0.2029482E+03  0.2016693E+03
+  0.2003976E+03  0.1991330E+03  0.1978755E+03  0.1966254E+03  0.1953825E+03
+  0.1941470E+03  0.1929189E+03  0.1916982E+03  0.1904848E+03  0.1892789E+03
+  0.1880804E+03  0.1868893E+03  0.1857055E+03  0.1845291E+03  0.1833601E+03
+  0.1821983E+03  0.1810438E+03  0.1798966E+03  0.1787565E+03  0.1776237E+03
+  0.1764979E+03  0.1753793E+03  0.1742677E+03  0.1731632E+03  0.1720656E+03
+  0.1709750E+03  0.1698912E+03  0.1688143E+03  0.1677443E+03  0.1666810E+03
+  0.1656244E+03  0.1645746E+03  0.1635313E+03  0.1624947E+03  0.1614647E+03
+  0.1604412E+03  0.1594241E+03  0.1584136E+03  0.1574094E+03  0.1564116E+03
+  0.1554201E+03  0.1544349E+03  0.1534559E+03  0.1524832E+03  0.1515166E+03
+  0.1505561E+03  0.1496018E+03  0.1486534E+03  0.1477112E+03  0.1467748E+03
+  0.1458444E+03  0.1449199E+03  0.1440013E+03  0.1430884E+03  0.1421814E+03
+  0.1412801E+03  0.1403845E+03  0.1394946E+03  0.1386104E+03  0.1377318E+03
+  0.2995810E+03  0.2988104E+03  0.2980375E+03  0.2972619E+03  0.2964836E+03
+  0.2957026E+03  0.2949185E+03  0.2941314E+03  0.2933409E+03  0.2925470E+03
+  0.2917495E+03  0.2909481E+03  0.2901428E+03  0.2893334E+03  0.2885196E+03
+  0.2877014E+03  0.2868780E+03  0.2860502E+03  0.2852169E+03  0.2843785E+03
+  0.2835342E+03  0.2826841E+03  0.2818278E+03  0.2809651E+03  0.2800959E+03
+  0.2792196E+03  0.2783362E+03  0.2774452E+03  0.2765464E+03  0.2756396E+03
+  0.2747243E+03  0.2738003E+03  0.2728671E+03  0.2719246E+03  0.2709724E+03
+  0.2700100E+03  0.2690372E+03  0.2680537E+03  0.2670589E+03  0.2660527E+03
+  0.2650348E+03  0.2640048E+03  0.2629622E+03  0.2619072E+03  0.2608391E+03
+  0.2597577E+03  0.2586628E+03  0.2575541E+03  0.2564318E+03  0.2552955E+03
+  0.2541451E+03  0.2529808E+03  0.2518024E+03  0.2506103E+03  0.2494044E+03
+  0.2481850E+03  0.2469524E+03  0.2457071E+03  0.2444495E+03  0.2431801E+03
+  0.2418995E+03  0.2406082E+03  0.2393071E+03  0.2379969E+03  0.2366784E+03
+  0.2353524E+03  0.2340200E+03  0.2326817E+03  0.2313386E+03  0.2299916E+03
+  0.2286415E+03  0.2272893E+03  0.2259357E+03  0.2245815E+03  0.2232275E+03
+  0.2218746E+03  0.2205232E+03  0.2191741E+03  0.2178280E+03  0.2164852E+03
+  0.2151464E+03  0.2138120E+03  0.2124823E+03  0.2111579E+03  0.2098390E+03
+  0.2085259E+03  0.2072189E+03  0.2059182E+03  0.2046240E+03  0.2033365E+03
+  0.2020559E+03  0.2007822E+03  0.1995155E+03  0.1982560E+03  0.1970038E+03
+  0.1957588E+03  0.1945211E+03  0.1932909E+03  0.1920680E+03  0.1908525E+03
+  0.1896444E+03  0.1884436E+03  0.1872503E+03  0.1860644E+03  0.1848857E+03
+  0.1837145E+03  0.1825505E+03  0.1813938E+03  0.1802444E+03  0.1791022E+03
+  0.1779671E+03  0.1768392E+03  0.1757185E+03  0.1746048E+03  0.1734981E+03
+  0.1723984E+03  0.1713056E+03  0.1702198E+03  0.1691409E+03  0.1680687E+03
+  0.1670034E+03  0.1659448E+03  0.1648929E+03  0.1638476E+03  0.1628091E+03
+  0.1617770E+03  0.1607515E+03  0.1597325E+03  0.1587200E+03  0.1577139E+03
+  0.1567142E+03  0.1557207E+03  0.1547336E+03  0.1537528E+03  0.1527781E+03
+  0.1518097E+03  0.1508474E+03  0.1498912E+03  0.1489410E+03  0.1479969E+03
+  0.1470587E+03  0.1461265E+03  0.1452002E+03  0.1442798E+03  0.1433652E+03
+  0.1424564E+03  0.1415534E+03  0.1406561E+03  0.1397645E+03  0.1388785E+03
+  0.3001818E+03  0.2994183E+03  0.2986526E+03  0.2978847E+03  0.2971142E+03
+  0.2963410E+03  0.2955651E+03  0.2947862E+03  0.2940044E+03  0.2932194E+03
+  0.2924310E+03  0.2916389E+03  0.2908434E+03  0.2900438E+03  0.2892401E+03
+  0.2884325E+03  0.2876203E+03  0.2868036E+03  0.2859818E+03  0.2851549E+03
+  0.2843232E+03  0.2834855E+03  0.2826422E+03  0.2817931E+03  0.2809374E+03
+  0.2800756E+03  0.2792067E+03  0.2783310E+03  0.2774478E+03  0.2765568E+03
+  0.2756582E+03  0.2747511E+03  0.2738355E+03  0.2729111E+03  0.2719774E+03
+  0.2710341E+03  0.2700809E+03  0.2691176E+03  0.2681435E+03  0.2671586E+03
+  0.2661623E+03  0.2651543E+03  0.2641345E+03  0.2631024E+03  0.2620577E+03
+  0.2610002E+03  0.2599296E+03  0.2588453E+03  0.2577477E+03  0.2566361E+03
+  0.2555107E+03  0.2543713E+03  0.2532178E+03  0.2520503E+03  0.2508687E+03
+  0.2496733E+03  0.2484641E+03  0.2472417E+03  0.2460061E+03  0.2447579E+03
+  0.2434977E+03  0.2422256E+03  0.2409427E+03  0.2396494E+03  0.2383465E+03
+  0.2370349E+03  0.2357153E+03  0.2343885E+03  0.2330555E+03  0.2317171E+03
+  0.2303744E+03  0.2290280E+03  0.2276790E+03  0.2263281E+03  0.2249761E+03
+  0.2236241E+03  0.2222725E+03  0.2209221E+03  0.2195738E+03  0.2182279E+03
+  0.2168852E+03  0.2155461E+03  0.2142112E+03  0.2128809E+03  0.2115555E+03
+  0.2102355E+03  0.2089211E+03  0.2076127E+03  0.2063105E+03  0.2050146E+03
+  0.2037254E+03  0.2024429E+03  0.2011673E+03  0.1998987E+03  0.1986372E+03
+  0.1973829E+03  0.1961358E+03  0.1948961E+03  0.1936636E+03  0.1924385E+03
+  0.1912208E+03  0.1900105E+03  0.1888076E+03  0.1876121E+03  0.1864239E+03
+  0.1852431E+03  0.1840696E+03  0.1829035E+03  0.1817446E+03  0.1805930E+03
+  0.1794486E+03  0.1783114E+03  0.1771813E+03  0.1760584E+03  0.1749425E+03
+  0.1738337E+03  0.1727319E+03  0.1716371E+03  0.1705491E+03  0.1694681E+03
+  0.1683939E+03  0.1673265E+03  0.1662659E+03  0.1652119E+03  0.1641647E+03
+  0.1631241E+03  0.1620900E+03  0.1610626E+03  0.1600416E+03  0.1590271E+03
+  0.1580191E+03  0.1570174E+03  0.1560220E+03  0.1550330E+03  0.1540503E+03
+  0.1530737E+03  0.1521034E+03  0.1511393E+03  0.1501812E+03  0.1492292E+03
+  0.1482832E+03  0.1473433E+03  0.1464093E+03  0.1454812E+03  0.1445590E+03
+  0.1436426E+03  0.1427321E+03  0.1418273E+03  0.1409283E+03  0.1400349E+03
+  0.3007687E+03  0.3000117E+03  0.2992534E+03  0.2984927E+03  0.2977292E+03
+  0.2969637E+03  0.2961956E+03  0.2954248E+03  0.2946511E+03  0.2938745E+03
+  0.2930948E+03  0.2923118E+03  0.2915255E+03  0.2907354E+03  0.2899415E+03
+  0.2891436E+03  0.2883418E+03  0.2875357E+03  0.2867250E+03  0.2859096E+03
+  0.2850892E+03  0.2842637E+03  0.2834328E+03  0.2825964E+03  0.2817540E+03
+  0.2809055E+03  0.2800508E+03  0.2791892E+03  0.2783210E+03  0.2774454E+03
+  0.2765625E+03  0.2756717E+03  0.2747728E+03  0.2738656E+03  0.2729496E+03
+  0.2720246E+03  0.2710902E+03  0.2701460E+03  0.2691919E+03  0.2682273E+03
+  0.2672519E+03  0.2662653E+03  0.2652675E+03  0.2642578E+03  0.2632358E+03
+  0.2622015E+03  0.2611545E+03  0.2600944E+03  0.2590211E+03  0.2579342E+03
+  0.2568336E+03  0.2557191E+03  0.2545906E+03  0.2534480E+03  0.2522913E+03
+  0.2511204E+03  0.2499355E+03  0.2487369E+03  0.2475245E+03  0.2462990E+03
+  0.2450605E+03  0.2438094E+03  0.2425464E+03  0.2412719E+03  0.2399868E+03
+  0.2386915E+03  0.2373870E+03  0.2360740E+03  0.2347533E+03  0.2334259E+03
+  0.2320925E+03  0.2307542E+03  0.2294119E+03  0.2280663E+03  0.2267184E+03
+  0.2253690E+03  0.2240189E+03  0.2226690E+03  0.2213199E+03  0.2199724E+03
+  0.2186270E+03  0.2172845E+03  0.2159454E+03  0.2146101E+03  0.2132792E+03
+  0.2119530E+03  0.2106320E+03  0.2093164E+03  0.2080067E+03  0.2067029E+03
+  0.2054055E+03  0.2041146E+03  0.2028303E+03  0.2015528E+03  0.2002823E+03
+  0.1990188E+03  0.1977625E+03  0.1965134E+03  0.1952714E+03  0.1940369E+03
+  0.1928097E+03  0.1915898E+03  0.1903773E+03  0.1891722E+03  0.1879744E+03
+  0.1867840E+03  0.1856010E+03  0.1844254E+03  0.1832570E+03  0.1820959E+03
+  0.1809421E+03  0.1797955E+03  0.1786562E+03  0.1775240E+03  0.1763989E+03
+  0.1752809E+03  0.1741699E+03  0.1730660E+03  0.1719691E+03  0.1708790E+03
+  0.1697959E+03  0.1687196E+03  0.1676501E+03  0.1665875E+03  0.1655315E+03
+  0.1644822E+03  0.1634396E+03  0.1624036E+03  0.1613741E+03  0.1603512E+03
+  0.1593347E+03  0.1583247E+03  0.1573211E+03  0.1563239E+03  0.1553329E+03
+  0.1543483E+03  0.1533699E+03  0.1523977E+03  0.1514316E+03  0.1504717E+03
+  0.1495179E+03  0.1485701E+03  0.1476283E+03  0.1466925E+03  0.1457626E+03
+  0.1448386E+03  0.1439205E+03  0.1430082E+03  0.1421017E+03  0.1412009E+03
+  0.3013422E+03  0.3005921E+03  0.2998403E+03  0.2990859E+03  0.2983299E+03
+  0.2975716E+03  0.2968108E+03  0.2960478E+03  0.2952818E+03  0.2945133E+03
+  0.2937419E+03  0.2929673E+03  0.2921896E+03  0.2914086E+03  0.2906241E+03
+  0.2898362E+03  0.2890440E+03  0.2882477E+03  0.2874477E+03  0.2866430E+03
+  0.2858337E+03  0.2850199E+03  0.2842006E+03  0.2833762E+03  0.2825464E+03
+  0.2817108E+03  0.2808693E+03  0.2800217E+03  0.2791673E+03  0.2783065E+03
+  0.2774384E+03  0.2765633E+03  0.2756803E+03  0.2747894E+03  0.2738904E+03
+  0.2729828E+03  0.2720664E+03  0.2711408E+03  0.2702056E+03  0.2692605E+03
+  0.2683052E+03  0.2673392E+03  0.2663626E+03  0.2653743E+03  0.2643745E+03
+  0.2633629E+03  0.2623387E+03  0.2613023E+03  0.2602527E+03  0.2591902E+03
+  0.2581141E+03  0.2570243E+03  0.2559206E+03  0.2548031E+03  0.2536714E+03
+  0.2525256E+03  0.2513655E+03  0.2501913E+03  0.2490032E+03  0.2478012E+03
+  0.2465857E+03  0.2453570E+03  0.2441154E+03  0.2428616E+03  0.2415959E+03
+  0.2403190E+03  0.2390317E+03  0.2377345E+03  0.2364285E+03  0.2351142E+03
+  0.2337926E+03  0.2324647E+03  0.2311312E+03  0.2297930E+03  0.2284512E+03
+  0.2271066E+03  0.2257600E+03  0.2244122E+03  0.2230641E+03  0.2217165E+03
+  0.2203700E+03  0.2190254E+03  0.2176833E+03  0.2163441E+03  0.2150087E+03
+  0.2136773E+03  0.2123504E+03  0.2110285E+03  0.2097118E+03  0.2084008E+03
+  0.2070957E+03  0.2057968E+03  0.2045041E+03  0.2032181E+03  0.2019388E+03
+  0.2006664E+03  0.1994010E+03  0.1981426E+03  0.1968914E+03  0.1956474E+03
+  0.1944107E+03  0.1931813E+03  0.1919593E+03  0.1907447E+03  0.1895373E+03
+  0.1883374E+03  0.1871449E+03  0.1859596E+03  0.1847817E+03  0.1836112E+03
+  0.1824479E+03  0.1812919E+03  0.1801432E+03  0.1790016E+03  0.1778672E+03
+  0.1767400E+03  0.1756199E+03  0.1745068E+03  0.1734007E+03  0.1723017E+03
+  0.1712095E+03  0.1701243E+03  0.1690460E+03  0.1679744E+03  0.1669097E+03
+  0.1658517E+03  0.1648004E+03  0.1637558E+03  0.1627177E+03  0.1616863E+03
+  0.1606614E+03  0.1596430E+03  0.1586310E+03  0.1576255E+03  0.1566263E+03
+  0.1556334E+03  0.1546469E+03  0.1536665E+03  0.1526925E+03  0.1517245E+03
+  0.1507628E+03  0.1498071E+03  0.1488575E+03  0.1479139E+03  0.1469763E+03
+  0.1460446E+03  0.1451188E+03  0.1441989E+03  0.1432848E+03  0.1423765E+03
+  0.3019030E+03  0.3011588E+03  0.3004132E+03  0.2996656E+03  0.2989163E+03
+  0.2981650E+03  0.2974112E+03  0.2966555E+03  0.2958972E+03  0.2951363E+03
+  0.2943727E+03  0.2936064E+03  0.2928372E+03  0.2920648E+03  0.2912890E+03
+  0.2905099E+03  0.2897273E+03  0.2889410E+03  0.2881508E+03  0.2873563E+03
+  0.2865575E+03  0.2857542E+03  0.2849465E+03  0.2841336E+03  0.2833159E+03
+  0.2824926E+03  0.2816637E+03  0.2808289E+03  0.2799883E+03  0.2791411E+03
+  0.2782875E+03  0.2774269E+03  0.2765594E+03  0.2756841E+03  0.2748013E+03
+  0.2739103E+03  0.2730110E+03  0.2721030E+03  0.2711859E+03  0.2702596E+03
+  0.2693234E+03  0.2683773E+03  0.2674209E+03  0.2664534E+03  0.2654749E+03
+  0.2644853E+03  0.2634836E+03  0.2624698E+03  0.2614436E+03  0.2604046E+03
+  0.2593525E+03  0.2582872E+03  0.2572083E+03  0.2561156E+03  0.2550089E+03
+  0.2538880E+03  0.2527531E+03  0.2516039E+03  0.2504405E+03  0.2492630E+03
+  0.2480715E+03  0.2468662E+03  0.2456475E+03  0.2444156E+03  0.2431711E+03
+  0.2419144E+03  0.2406462E+03  0.2393670E+03  0.2380776E+03  0.2367786E+03
+  0.2354710E+03  0.2341557E+03  0.2328334E+03  0.2315050E+03  0.2301714E+03
+  0.2288336E+03  0.2274925E+03  0.2261489E+03  0.2248037E+03  0.2234578E+03
+  0.2221118E+03  0.2207666E+03  0.2194229E+03  0.2180813E+03  0.2167424E+03
+  0.2154068E+03  0.2140751E+03  0.2127477E+03  0.2114249E+03  0.2101073E+03
+  0.2087951E+03  0.2074887E+03  0.2061882E+03  0.2048940E+03  0.2036064E+03
+  0.2023252E+03  0.2010510E+03  0.1997836E+03  0.1985232E+03  0.1972700E+03
+  0.1960240E+03  0.1947852E+03  0.1935537E+03  0.1923295E+03  0.1911127E+03
+  0.1899032E+03  0.1887010E+03  0.1875063E+03  0.1863189E+03  0.1851388E+03
+  0.1839660E+03  0.1828006E+03  0.1816424E+03  0.1804914E+03  0.1793477E+03
+  0.1782112E+03  0.1770818E+03  0.1759595E+03  0.1748443E+03  0.1737361E+03
+  0.1726349E+03  0.1715407E+03  0.1704534E+03  0.1693729E+03  0.1682994E+03
+  0.1672326E+03  0.1661725E+03  0.1651192E+03  0.1640725E+03  0.1630325E+03
+  0.1619991E+03  0.1609722E+03  0.1599518E+03  0.1589379E+03  0.1579303E+03
+  0.1569292E+03  0.1559345E+03  0.1549460E+03  0.1539638E+03  0.1529878E+03
+  0.1520181E+03  0.1510544E+03  0.1500969E+03  0.1491454E+03  0.1482000E+03
+  0.1472606E+03  0.1463271E+03  0.1453995E+03  0.1444778E+03  0.1435620E+03
+  0.3024511E+03  0.3017130E+03  0.3009735E+03  0.3002324E+03  0.2994895E+03
+  0.2987444E+03  0.2979978E+03  0.2972487E+03  0.2964976E+03  0.2957441E+03
+  0.2949882E+03  0.2942296E+03  0.2934682E+03  0.2927041E+03  0.2919370E+03
+  0.2911668E+03  0.2903929E+03  0.2896155E+03  0.2888346E+03  0.2880502E+03
+  0.2872617E+03  0.2864688E+03  0.2856715E+03  0.2848695E+03  0.2840631E+03
+  0.2832517E+03  0.2824348E+03  0.2816125E+03  0.2807845E+03  0.2799507E+03
+  0.2791105E+03  0.2782642E+03  0.2774108E+03  0.2765508E+03  0.2756831E+03
+  0.2748081E+03  0.2739251E+03  0.2730340E+03  0.2721345E+03  0.2712259E+03
+  0.2703080E+03  0.2693809E+03  0.2684438E+03  0.2674964E+03  0.2665386E+03
+  0.2655699E+03  0.2645898E+03  0.2635981E+03  0.2625944E+03  0.2615785E+03
+  0.2605498E+03  0.2595084E+03  0.2584537E+03  0.2573855E+03  0.2563036E+03
+  0.2552078E+03  0.2540979E+03  0.2529739E+03  0.2518356E+03  0.2506829E+03
+  0.2495161E+03  0.2483353E+03  0.2471404E+03  0.2459318E+03  0.2447099E+03
+  0.2434748E+03  0.2422275E+03  0.2409680E+03  0.2396973E+03  0.2384158E+03
+  0.2371244E+03  0.2358238E+03  0.2345148E+03  0.2331984E+03  0.2318754E+03
+  0.2305468E+03  0.2292134E+03  0.2278761E+03  0.2265358E+03  0.2251934E+03
+  0.2238498E+03  0.2225057E+03  0.2211620E+03  0.2198194E+03  0.2184785E+03
+  0.2171400E+03  0.2158046E+03  0.2144726E+03  0.2131447E+03  0.2118213E+03
+  0.2105027E+03  0.2091895E+03  0.2078818E+03  0.2065800E+03  0.2052843E+03
+  0.2039949E+03  0.2027121E+03  0.2014360E+03  0.2001667E+03  0.1989045E+03
+  0.1976492E+03  0.1964011E+03  0.1951602E+03  0.1939266E+03  0.1927003E+03
+  0.1914813E+03  0.1902696E+03  0.1890653E+03  0.1878683E+03  0.1866788E+03
+  0.1854965E+03  0.1843215E+03  0.1831539E+03  0.1819935E+03  0.1808404E+03
+  0.1796945E+03  0.1785558E+03  0.1774242E+03  0.1762998E+03  0.1751824E+03
+  0.1740721E+03  0.1729688E+03  0.1718725E+03  0.1707831E+03  0.1697006E+03
+  0.1686249E+03  0.1675560E+03  0.1664940E+03  0.1654386E+03  0.1643899E+03
+  0.1633479E+03  0.1623124E+03  0.1612835E+03  0.1602612E+03  0.1592453E+03
+  0.1582358E+03  0.1572328E+03  0.1562361E+03  0.1552457E+03  0.1542616E+03
+  0.1532838E+03  0.1523121E+03  0.1513466E+03  0.1503873E+03  0.1494339E+03
+  0.1484867E+03  0.1475454E+03  0.1466101E+03  0.1456808E+03  0.1447573E+03
+  0.3029872E+03  0.3022549E+03  0.3015215E+03  0.3007861E+03  0.3000493E+03
+  0.2993106E+03  0.2985704E+03  0.2978282E+03  0.2970839E+03  0.2963376E+03
+  0.2955887E+03  0.2948374E+03  0.2940839E+03  0.2933277E+03  0.2925685E+03
+  0.2918063E+03  0.2910412E+03  0.2902728E+03  0.2895012E+03  0.2887255E+03
+  0.2879466E+03  0.2871637E+03  0.2863767E+03  0.2855853E+03  0.2847893E+03
+  0.2839891E+03  0.2831837E+03  0.2823731E+03  0.2815575E+03  0.2807362E+03
+  0.2799091E+03  0.2790758E+03  0.2782365E+03  0.2773903E+03  0.2765376E+03
+  0.2756775E+03  0.2748102E+03  0.2739351E+03  0.2730520E+03  0.2721605E+03
+  0.2712603E+03  0.2703512E+03  0.2694328E+03  0.2685046E+03  0.2675663E+03
+  0.2666179E+03  0.2656584E+03  0.2646880E+03  0.2637062E+03  0.2627127E+03
+  0.2617070E+03  0.2606888E+03  0.2596577E+03  0.2586136E+03  0.2575561E+03
+  0.2564850E+03  0.2554000E+03  0.2543010E+03  0.2531880E+03  0.2520606E+03
+  0.2509189E+03  0.2497629E+03  0.2485926E+03  0.2474082E+03  0.2462099E+03
+  0.2449980E+03  0.2437728E+03  0.2425347E+03  0.2412845E+03  0.2400223E+03
+  0.2387491E+03  0.2374654E+03  0.2361722E+03  0.2348700E+03  0.2335598E+03
+  0.2322425E+03  0.2309190E+03  0.2295902E+03  0.2282570E+03  0.2269203E+03
+  0.2255810E+03  0.2242400E+03  0.2228981E+03  0.2215561E+03  0.2202148E+03
+  0.2188749E+03  0.2175370E+03  0.2162017E+03  0.2148697E+03  0.2135415E+03
+  0.2122175E+03  0.2108982E+03  0.2095839E+03  0.2082751E+03  0.2069720E+03
+  0.2056748E+03  0.2043839E+03  0.2030994E+03  0.2018215E+03  0.2005504E+03
+  0.1992862E+03  0.1980289E+03  0.1967788E+03  0.1955359E+03  0.1943002E+03
+  0.1930717E+03  0.1918506E+03  0.1906367E+03  0.1894302E+03  0.1882311E+03
+  0.1870393E+03  0.1858548E+03  0.1846777E+03  0.1835079E+03  0.1823453E+03
+  0.1811900E+03  0.1800419E+03  0.1789010E+03  0.1777673E+03  0.1766407E+03
+  0.1755212E+03  0.1744088E+03  0.1733034E+03  0.1722049E+03  0.1711134E+03
+  0.1700288E+03  0.1689511E+03  0.1678802E+03  0.1668160E+03  0.1657586E+03
+  0.1647079E+03  0.1636639E+03  0.1626264E+03  0.1615956E+03  0.1605712E+03
+  0.1595533E+03  0.1585420E+03  0.1575370E+03  0.1565384E+03  0.1555461E+03
+  0.1545601E+03  0.1535803E+03  0.1526068E+03  0.1516394E+03  0.1506782E+03
+  0.1497230E+03  0.1487739E+03  0.1478309E+03  0.1468938E+03  0.1459626E+03
+  0.3035119E+03  0.3027850E+03  0.3020572E+03  0.3013277E+03  0.3005967E+03
+  0.2998644E+03  0.2991304E+03  0.2983941E+03  0.2976567E+03  0.2969169E+03
+  0.2961749E+03  0.2954309E+03  0.2946847E+03  0.2939357E+03  0.2931842E+03
+  0.2924301E+03  0.2916733E+03  0.2909130E+03  0.2901498E+03  0.2893834E+03
+  0.2886138E+03  0.2878398E+03  0.2870625E+03  0.2862812E+03  0.2854957E+03
+  0.2847058E+03  0.2839114E+03  0.2831122E+03  0.2823080E+03  0.2814987E+03
+  0.2806839E+03  0.2798634E+03  0.2790370E+03  0.2782047E+03  0.2773655E+03
+  0.2765201E+03  0.2756674E+03  0.2748077E+03  0.2739402E+03  0.2730651E+03
+  0.2721816E+03  0.2712898E+03  0.2703891E+03  0.2694793E+03  0.2685599E+03
+  0.2676308E+03  0.2666913E+03  0.2657414E+03  0.2647807E+03  0.2638086E+03
+  0.2628248E+03  0.2618290E+03  0.2608210E+03  0.2598004E+03  0.2587668E+03
+  0.2577200E+03  0.2566597E+03  0.2555856E+03  0.2544976E+03  0.2533954E+03
+  0.2522789E+03  0.2511480E+03  0.2500029E+03  0.2488433E+03  0.2476696E+03
+  0.2464817E+03  0.2452800E+03  0.2440648E+03  0.2428364E+03  0.2415953E+03
+  0.2403422E+03  0.2390774E+03  0.2378018E+03  0.2365159E+03  0.2352208E+03
+  0.2339172E+03  0.2326060E+03  0.2312879E+03  0.2299641E+03  0.2286353E+03
+  0.2273024E+03  0.2259665E+03  0.2246284E+03  0.2232889E+03  0.2219489E+03
+  0.2206090E+03  0.2192702E+03  0.2179331E+03  0.2165983E+03  0.2152664E+03
+  0.2139380E+03  0.2126136E+03  0.2112935E+03  0.2099784E+03  0.2086685E+03
+  0.2073641E+03  0.2060656E+03  0.2047731E+03  0.2034870E+03  0.2022074E+03
+  0.2009345E+03  0.1996683E+03  0.1984092E+03  0.1971571E+03  0.1959121E+03
+  0.1946743E+03  0.1934437E+03  0.1922204E+03  0.1910045E+03  0.1897958E+03
+  0.1885945E+03  0.1874005E+03  0.1862139E+03  0.1850345E+03  0.1838625E+03
+  0.1826977E+03  0.1815402E+03  0.1803900E+03  0.1792469E+03  0.1781110E+03
+  0.1769823E+03  0.1758607E+03  0.1747461E+03  0.1736385E+03  0.1725380E+03
+  0.1714444E+03  0.1703577E+03  0.1692779E+03  0.1682049E+03  0.1671387E+03
+  0.1660793E+03  0.1650265E+03  0.1639804E+03  0.1629410E+03  0.1619081E+03
+  0.1608818E+03  0.1598620E+03  0.1588486E+03  0.1578417E+03  0.1568412E+03
+  0.1558470E+03  0.1548591E+03  0.1538774E+03  0.1529020E+03  0.1519327E+03
+  0.1509696E+03  0.1500126E+03  0.1490617E+03  0.1481168E+03  0.1471779E+03
+  0.3040254E+03  0.3033041E+03  0.3025814E+03  0.3018573E+03  0.3011320E+03
+  0.3004055E+03  0.2996770E+03  0.2989473E+03  0.2982160E+03  0.2974827E+03
+  0.2967473E+03  0.2960102E+03  0.2952708E+03  0.2945291E+03  0.2937851E+03
+  0.2930385E+03  0.2922891E+03  0.2915372E+03  0.2907822E+03  0.2900242E+03
+  0.2892627E+03  0.2884984E+03  0.2877302E+03  0.2869583E+03  0.2861826E+03
+  0.2854026E+03  0.2846188E+03  0.2838302E+03  0.2830371E+03  0.2822392E+03
+  0.2814361E+03  0.2806277E+03  0.2798139E+03  0.2789942E+03  0.2781687E+03
+  0.2773365E+03  0.2764982E+03  0.2756527E+03  0.2748006E+03  0.2739408E+03
+  0.2730734E+03  0.2721979E+03  0.2713142E+03  0.2704218E+03  0.2695204E+03
+  0.2686099E+03  0.2676895E+03  0.2667592E+03  0.2658184E+03  0.2648671E+03
+  0.2639044E+03  0.2629306E+03  0.2619449E+03  0.2609471E+03  0.2599368E+03
+  0.2589135E+03  0.2578774E+03  0.2568277E+03  0.2557644E+03  0.2546872E+03
+  0.2535959E+03  0.2524904E+03  0.2513705E+03  0.2502362E+03  0.2490875E+03
+  0.2479244E+03  0.2467471E+03  0.2455557E+03  0.2443506E+03  0.2431320E+03
+  0.2419005E+03  0.2406564E+03  0.2394004E+03  0.2381331E+03  0.2368552E+03
+  0.2355674E+03  0.2342706E+03  0.2329656E+03  0.2316534E+03  0.2303347E+03
+  0.2290106E+03  0.2276820E+03  0.2263497E+03  0.2250147E+03  0.2236779E+03
+  0.2223400E+03  0.2210019E+03  0.2196645E+03  0.2183283E+03  0.2169940E+03
+  0.2156624E+03  0.2143340E+03  0.2130092E+03  0.2116887E+03  0.2103728E+03
+  0.2090619E+03  0.2077564E+03  0.2064565E+03  0.2051626E+03  0.2038750E+03
+  0.2025937E+03  0.2013190E+03  0.2000510E+03  0.1987900E+03  0.1975359E+03
+  0.1962888E+03  0.1950490E+03  0.1938163E+03  0.1925909E+03  0.1913728E+03
+  0.1901620E+03  0.1889585E+03  0.1877623E+03  0.1865735E+03  0.1853920E+03
+  0.1842178E+03  0.1830508E+03  0.1818911E+03  0.1807387E+03  0.1795935E+03
+  0.1784554E+03  0.1773245E+03  0.1762007E+03  0.1750840E+03  0.1739744E+03
+  0.1728717E+03  0.1717760E+03  0.1706872E+03  0.1696053E+03  0.1685302E+03
+  0.1674620E+03  0.1664005E+03  0.1653457E+03  0.1642976E+03  0.1632562E+03
+  0.1622213E+03  0.1611930E+03  0.1601712E+03  0.1591559E+03  0.1581470E+03
+  0.1571445E+03  0.1561484E+03  0.1551586E+03  0.1541751E+03  0.1531978E+03
+  0.1522266E+03  0.1512617E+03  0.1503028E+03  0.1493501E+03  0.1484034E+03
+  0.3045285E+03  0.3038120E+03  0.3030945E+03  0.3023757E+03  0.3016561E+03
+  0.3009348E+03  0.3002123E+03  0.2994883E+03  0.2987628E+03  0.2980355E+03
+  0.2973069E+03  0.2965761E+03  0.2958431E+03  0.2951085E+03  0.2943715E+03
+  0.2936319E+03  0.2928901E+03  0.2921460E+03  0.2913986E+03  0.2906486E+03
+  0.2898958E+03  0.2891397E+03  0.2883803E+03  0.2876176E+03  0.2868512E+03
+  0.2860809E+03  0.2853068E+03  0.2845284E+03  0.2837458E+03  0.2829586E+03
+  0.2821667E+03  0.2813699E+03  0.2805678E+03  0.2797603E+03  0.2789474E+03
+  0.2781286E+03  0.2773033E+03  0.2764721E+03  0.2756337E+03  0.2747889E+03
+  0.2739367E+03  0.2730769E+03  0.2722094E+03  0.2713337E+03  0.2704494E+03
+  0.2695565E+03  0.2686544E+03  0.2677427E+03  0.2668214E+03  0.2658898E+03
+  0.2649478E+03  0.2639948E+03  0.2630305E+03  0.2620546E+03  0.2610668E+03
+  0.2600666E+03  0.2590539E+03  0.2580282E+03  0.2569891E+03  0.2559365E+03
+  0.2548702E+03  0.2537898E+03  0.2526953E+03  0.2515863E+03  0.2504629E+03
+  0.2493250E+03  0.2481727E+03  0.2470061E+03  0.2458251E+03  0.2446302E+03
+  0.2434217E+03  0.2421998E+03  0.2409651E+03  0.2397180E+03  0.2384593E+03
+  0.2371895E+03  0.2359094E+03  0.2346198E+03  0.2333214E+03  0.2320152E+03
+  0.2307021E+03  0.2293830E+03  0.2280588E+03  0.2267304E+03  0.2253988E+03
+  0.2240649E+03  0.2227295E+03  0.2213934E+03  0.2200575E+03  0.2187225E+03
+  0.2173891E+03  0.2160579E+03  0.2147296E+03  0.2134047E+03  0.2120837E+03
+  0.2107671E+03  0.2094554E+03  0.2081488E+03  0.2068477E+03  0.2055524E+03
+  0.2042633E+03  0.2029803E+03  0.2017039E+03  0.2004342E+03  0.1991712E+03
+  0.1979152E+03  0.1966662E+03  0.1954243E+03  0.1941895E+03  0.1929620E+03
+  0.1917418E+03  0.1905288E+03  0.1893232E+03  0.1881248E+03  0.1869338E+03
+  0.1857501E+03  0.1845737E+03  0.1834045E+03  0.1822427E+03  0.1810881E+03
+  0.1799407E+03  0.1788005E+03  0.1776674E+03  0.1765415E+03  0.1754226E+03
+  0.1743108E+03  0.1732060E+03  0.1721082E+03  0.1710173E+03  0.1699333E+03
+  0.1688562E+03  0.1677859E+03  0.1667224E+03  0.1656656E+03  0.1646154E+03
+  0.1635720E+03  0.1625351E+03  0.1615048E+03  0.1604811E+03  0.1594638E+03
+  0.1584530E+03  0.1574485E+03  0.1564505E+03  0.1554588E+03  0.1544733E+03
+  0.1534941E+03  0.1525211E+03  0.1515543E+03  0.1505936E+03  0.1496390E+03
+  0.3050211E+03  0.3043095E+03  0.3035968E+03  0.3028830E+03  0.3021688E+03
+  0.3014527E+03  0.3007356E+03  0.3000173E+03  0.2992975E+03  0.2985759E+03
+  0.2978533E+03  0.2971288E+03  0.2964024E+03  0.2956741E+03  0.2949438E+03
+  0.2942113E+03  0.2934765E+03  0.2927394E+03  0.2919998E+03  0.2912575E+03
+  0.2905125E+03  0.2897643E+03  0.2890137E+03  0.2882596E+03  0.2875020E+03
+  0.2867410E+03  0.2859762E+03  0.2852076E+03  0.2844347E+03  0.2836580E+03
+  0.2828768E+03  0.2820909E+03  0.2813000E+03  0.2805042E+03  0.2797032E+03
+  0.2788968E+03  0.2780845E+03  0.2772661E+03  0.2764417E+03  0.2756104E+03
+  0.2747729E+03  0.2739280E+03  0.2730758E+03  0.2722160E+03  0.2713480E+03
+  0.2704721E+03  0.2695874E+03  0.2686936E+03  0.2677909E+03  0.2668781E+03
+  0.2659556E+03  0.2650227E+03  0.2640789E+03  0.2631243E+03  0.2621583E+03
+  0.2611804E+03  0.2601904E+03  0.2591878E+03  0.2581725E+03  0.2571440E+03
+  0.2561021E+03  0.2550465E+03  0.2539770E+03  0.2528933E+03  0.2517953E+03
+  0.2506828E+03  0.2495559E+03  0.2484144E+03  0.2472584E+03  0.2460881E+03
+  0.2449037E+03  0.2437052E+03  0.2424933E+03  0.2412681E+03  0.2400303E+03
+  0.2387803E+03  0.2375189E+03  0.2362466E+03  0.2349644E+03  0.2336730E+03
+  0.2323732E+03  0.2310659E+03  0.2297521E+03  0.2284326E+03  0.2271085E+03
+  0.2257806E+03  0.2244499E+03  0.2231172E+03  0.2217833E+03  0.2204492E+03
+  0.2191156E+03  0.2177831E+03  0.2164526E+03  0.2151245E+03  0.2137997E+03
+  0.2124784E+03  0.2111613E+03  0.2098488E+03  0.2085412E+03  0.2072390E+03
+  0.2059425E+03  0.2046518E+03  0.2033673E+03  0.2020893E+03  0.2008178E+03
+  0.1995529E+03  0.1982950E+03  0.1970440E+03  0.1958001E+03  0.1945633E+03
+  0.1933337E+03  0.1921113E+03  0.1908963E+03  0.1896884E+03  0.1884879E+03
+  0.1872947E+03  0.1861088E+03  0.1849302E+03  0.1837589E+03  0.1825949E+03
+  0.1814381E+03  0.1802885E+03  0.1791461E+03  0.1780109E+03  0.1768828E+03
+  0.1757618E+03  0.1746479E+03  0.1735410E+03  0.1724411E+03  0.1713481E+03
+  0.1702621E+03  0.1691828E+03  0.1681104E+03  0.1670449E+03  0.1659860E+03
+  0.1649338E+03  0.1638884E+03  0.1628495E+03  0.1618172E+03  0.1607915E+03
+  0.1597722E+03  0.1587595E+03  0.1577531E+03  0.1567531E+03  0.1557595E+03
+  0.1547721E+03  0.1537910E+03  0.1528161E+03  0.1518474E+03  0.1508849E+03
+  0.3055036E+03  0.3047968E+03  0.3040886E+03  0.3033801E+03  0.3026703E+03
+  0.3019595E+03  0.3012477E+03  0.3005348E+03  0.2998205E+03  0.2991047E+03
+  0.2983877E+03  0.2976689E+03  0.2969490E+03  0.2962270E+03  0.2955028E+03
+  0.2947769E+03  0.2940491E+03  0.2933188E+03  0.2925864E+03  0.2918516E+03
+  0.2911139E+03  0.2903739E+03  0.2896310E+03  0.2888849E+03  0.2881359E+03
+  0.2873835E+03  0.2866277E+03  0.2858683E+03  0.2851053E+03  0.2843383E+03
+  0.2835670E+03  0.2827915E+03  0.2820115E+03  0.2812268E+03  0.2804370E+03
+  0.2796423E+03  0.2788422E+03  0.2780365E+03  0.2772248E+03  0.2764073E+03
+  0.2755829E+03  0.2747525E+03  0.2739149E+03  0.2730701E+03  0.2722179E+03
+  0.2713579E+03  0.2704897E+03  0.2696132E+03  0.2687277E+03  0.2678334E+03
+  0.2669294E+03  0.2660157E+03  0.2650919E+03  0.2641576E+03  0.2632124E+03
+  0.2622559E+03  0.2612878E+03  0.2603077E+03  0.2593154E+03  0.2583104E+03
+  0.2572924E+03  0.2562611E+03  0.2552162E+03  0.2541575E+03  0.2530847E+03
+  0.2519975E+03  0.2508960E+03  0.2497800E+03  0.2486494E+03  0.2475043E+03
+  0.2463447E+03  0.2451707E+03  0.2439825E+03  0.2427807E+03  0.2415652E+03
+  0.2403369E+03  0.2390959E+03  0.2378431E+03  0.2365791E+03  0.2353045E+03
+  0.2340203E+03  0.2327272E+03  0.2314261E+03  0.2301179E+03  0.2288035E+03
+  0.2274839E+03  0.2261600E+03  0.2248327E+03  0.2235029E+03  0.2221716E+03
+  0.2208395E+03  0.2195075E+03  0.2181762E+03  0.2168464E+03  0.2155189E+03
+  0.2141941E+03  0.2128728E+03  0.2115553E+03  0.2102421E+03  0.2089337E+03
+  0.2076304E+03  0.2063326E+03  0.2050406E+03  0.2037547E+03  0.2024750E+03
+  0.2012017E+03  0.1999352E+03  0.1986753E+03  0.1974224E+03  0.1961765E+03
+  0.1949377E+03  0.1937060E+03  0.1924815E+03  0.1912643E+03  0.1900544E+03
+  0.1888517E+03  0.1876563E+03  0.1864682E+03  0.1852875E+03  0.1841140E+03
+  0.1829477E+03  0.1817888E+03  0.1806370E+03  0.1794925E+03  0.1783551E+03
+  0.1772249E+03  0.1761017E+03  0.1749857E+03  0.1738766E+03  0.1727746E+03
+  0.1716795E+03  0.1705914E+03  0.1695101E+03  0.1684356E+03  0.1673680E+03
+  0.1663071E+03  0.1652529E+03  0.1642054E+03  0.1631645E+03  0.1621302E+03
+  0.1611025E+03  0.1600813E+03  0.1590666E+03  0.1580583E+03  0.1570563E+03
+  0.1560608E+03  0.1550715E+03  0.1540885E+03  0.1531118E+03  0.1521412E+03
+  0.3059766E+03  0.3052743E+03  0.3045706E+03  0.3038666E+03  0.3031618E+03
+  0.3024558E+03  0.3017490E+03  0.3010413E+03  0.3003321E+03  0.2996221E+03
+  0.2989103E+03  0.2981974E+03  0.2974829E+03  0.2967669E+03  0.2960490E+03
+  0.2953295E+03  0.2946081E+03  0.2938846E+03  0.2931592E+03  0.2924310E+03
+  0.2917009E+03  0.2909683E+03  0.2902325E+03  0.2894947E+03  0.2887538E+03
+  0.2880096E+03  0.2872625E+03  0.2865118E+03  0.2857578E+03  0.2850000E+03
+  0.2842384E+03  0.2834728E+03  0.2827031E+03  0.2819288E+03  0.2811501E+03
+  0.2803664E+03  0.2795779E+03  0.2787841E+03  0.2779845E+03  0.2771796E+03
+  0.2763688E+03  0.2755513E+03  0.2747278E+03  0.2738975E+03  0.2730600E+03
+  0.2722154E+03  0.2713631E+03  0.2705026E+03  0.2696341E+03  0.2687570E+03
+  0.2678708E+03  0.2669757E+03  0.2660705E+03  0.2651558E+03  0.2642304E+03
+  0.2632945E+03  0.2623476E+03  0.2613892E+03  0.2604190E+03  0.2594367E+03
+  0.2584419E+03  0.2574343E+03  0.2564135E+03  0.2553792E+03  0.2543313E+03
+  0.2532693E+03  0.2521932E+03  0.2511026E+03  0.2499975E+03  0.2488779E+03
+  0.2477436E+03  0.2465947E+03  0.2454314E+03  0.2442537E+03  0.2430619E+03
+  0.2418565E+03  0.2406377E+03  0.2394060E+03  0.2381621E+03  0.2369064E+03
+  0.2356400E+03  0.2343633E+03  0.2330771E+03  0.2317825E+03  0.2304801E+03
+  0.2291712E+03  0.2278563E+03  0.2265367E+03  0.2252132E+03  0.2238866E+03
+  0.2225581E+03  0.2212282E+03  0.2198980E+03  0.2185681E+03  0.2172395E+03
+  0.2159125E+03  0.2145881E+03  0.2132667E+03  0.2119489E+03  0.2106352E+03
+  0.2093261E+03  0.2080218E+03  0.2067229E+03  0.2054297E+03  0.2041423E+03
+  0.2028610E+03  0.2015862E+03  0.2003178E+03  0.1990561E+03  0.1978013E+03
+  0.1965534E+03  0.1953126E+03  0.1940789E+03  0.1928523E+03  0.1916329E+03
+  0.1904209E+03  0.1892161E+03  0.1880185E+03  0.1868283E+03  0.1856453E+03
+  0.1844697E+03  0.1833013E+03  0.1821401E+03  0.1809862E+03  0.1798395E+03
+  0.1786999E+03  0.1775676E+03  0.1764423E+03  0.1753241E+03  0.1742129E+03
+  0.1731088E+03  0.1720116E+03  0.1709213E+03  0.1698380E+03  0.1687614E+03
+  0.1676917E+03  0.1666288E+03  0.1655726E+03  0.1645230E+03  0.1634801E+03
+  0.1624439E+03  0.1614142E+03  0.1603910E+03  0.1593743E+03  0.1583640E+03
+  0.1573602E+03  0.1563627E+03  0.1553715E+03  0.1543866E+03  0.1534079E+03
+  0.3064403E+03  0.3057421E+03  0.3050430E+03  0.3043433E+03  0.3036431E+03
+  0.3029418E+03  0.3022397E+03  0.3015370E+03  0.3008330E+03  0.3001282E+03
+  0.2994218E+03  0.2987141E+03  0.2980052E+03  0.2972948E+03  0.2965831E+03
+  0.2958697E+03  0.2951542E+03  0.2944371E+03  0.2937180E+03  0.2929968E+03
+  0.2922735E+03  0.2915477E+03  0.2908196E+03  0.2900892E+03  0.2893559E+03
+  0.2886198E+03  0.2878807E+03  0.2871384E+03  0.2863931E+03  0.2856443E+03
+  0.2848919E+03  0.2841356E+03  0.2833755E+03  0.2826114E+03  0.2818430E+03
+  0.2810699E+03  0.2802924E+03  0.2795099E+03  0.2787223E+03  0.2779291E+03
+  0.2771306E+03  0.2763264E+03  0.2755157E+03  0.2746991E+03  0.2738758E+03
+  0.2730454E+03  0.2722082E+03  0.2713635E+03  0.2705107E+03  0.2696500E+03
+  0.2687810E+03  0.2679030E+03  0.2670163E+03  0.2661200E+03  0.2652137E+03
+  0.2642977E+03  0.2633710E+03  0.2624333E+03  0.2614846E+03  0.2605242E+03
+  0.2595519E+03  0.2585671E+03  0.2575698E+03  0.2565595E+03  0.2555358E+03
+  0.2544986E+03  0.2534473E+03  0.2523821E+03  0.2513025E+03  0.2502084E+03
+  0.2490997E+03  0.2479763E+03  0.2468382E+03  0.2456855E+03  0.2445184E+03
+  0.2433371E+03  0.2421417E+03  0.2409328E+03  0.2397105E+03  0.2384757E+03
+  0.2372288E+03  0.2359705E+03  0.2347015E+03  0.2334226E+03  0.2321348E+03
+  0.2308387E+03  0.2295353E+03  0.2282257E+03  0.2269106E+03  0.2255912E+03
+  0.2242681E+03  0.2229426E+03  0.2216152E+03  0.2202871E+03  0.2189589E+03
+  0.2176314E+03  0.2163053E+03  0.2149814E+03  0.2136601E+03  0.2123422E+03
+  0.2110282E+03  0.2097184E+03  0.2084133E+03  0.2071134E+03  0.2058189E+03
+  0.2045301E+03  0.2032474E+03  0.2019709E+03  0.2007008E+03  0.1994374E+03
+  0.1981807E+03  0.1969309E+03  0.1956881E+03  0.1944523E+03  0.1932237E+03
+  0.1920023E+03  0.1907880E+03  0.1895811E+03  0.1883814E+03  0.1871890E+03
+  0.1860039E+03  0.1848260E+03  0.1836554E+03  0.1824921E+03  0.1813360E+03
+  0.1801871E+03  0.1790454E+03  0.1779109E+03  0.1767834E+03  0.1756631E+03
+  0.1745498E+03  0.1734436E+03  0.1723442E+03  0.1712519E+03  0.1701665E+03
+  0.1690879E+03  0.1680161E+03  0.1669511E+03  0.1658928E+03  0.1648413E+03
+  0.1637964E+03  0.1627581E+03  0.1617264E+03  0.1607012E+03  0.1596826E+03
+  0.1586704E+03  0.1576646E+03  0.1566651E+03  0.1556721E+03  0.1546852E+03
+  0.3068949E+03  0.3062008E+03  0.3055060E+03  0.3048105E+03  0.3041147E+03
+  0.3034179E+03  0.3027204E+03  0.3020226E+03  0.3013232E+03  0.3006235E+03
+  0.2999220E+03  0.2992198E+03  0.2985163E+03  0.2978111E+03  0.2971050E+03
+  0.2963975E+03  0.2956879E+03  0.2949770E+03  0.2942640E+03  0.2935495E+03
+  0.2928329E+03  0.2921136E+03  0.2913926E+03  0.2906690E+03  0.2899431E+03
+  0.2892147E+03  0.2884833E+03  0.2877492E+03  0.2870120E+03  0.2862716E+03
+  0.2855278E+03  0.2847807E+03  0.2840297E+03  0.2832754E+03  0.2825168E+03
+  0.2817538E+03  0.2809866E+03  0.2802149E+03  0.2794383E+03  0.2786566E+03
+  0.2778699E+03  0.2770778E+03  0.2762801E+03  0.2754761E+03  0.2746662E+03
+  0.2738499E+03  0.2730266E+03  0.2721966E+03  0.2713593E+03  0.2705142E+03
+  0.2696613E+03  0.2688002E+03  0.2679305E+03  0.2670518E+03  0.2661643E+03
+  0.2652667E+03  0.2643594E+03  0.2634418E+03  0.2625135E+03  0.2615742E+03
+  0.2606234E+03  0.2596609E+03  0.2586862E+03  0.2576991E+03  0.2566991E+03
+  0.2556859E+03  0.2546593E+03  0.2536188E+03  0.2525644E+03  0.2514957E+03
+  0.2504125E+03  0.2493148E+03  0.2482023E+03  0.2470751E+03  0.2459332E+03
+  0.2447768E+03  0.2436059E+03  0.2424207E+03  0.2412217E+03  0.2400093E+03
+  0.2387837E+03  0.2375458E+03  0.2362960E+03  0.2350351E+03  0.2337638E+03
+  0.2324830E+03  0.2311933E+03  0.2298960E+03  0.2285918E+03  0.2272816E+03
+  0.2259664E+03  0.2246473E+03  0.2233249E+03  0.2220005E+03  0.2206746E+03
+  0.2193482E+03  0.2180222E+03  0.2166972E+03  0.2153739E+03  0.2140530E+03
+  0.2127352E+03  0.2114208E+03  0.2101105E+03  0.2088047E+03  0.2075038E+03
+  0.2062082E+03  0.2049182E+03  0.2036340E+03  0.2023560E+03  0.2010843E+03
+  0.1998191E+03  0.1985605E+03  0.1973088E+03  0.1960641E+03  0.1948263E+03
+  0.1935956E+03  0.1923721E+03  0.1911558E+03  0.1899467E+03  0.1887449E+03
+  0.1875503E+03  0.1863630E+03  0.1851830E+03  0.1840102E+03  0.1828448E+03
+  0.1816865E+03  0.1805354E+03  0.1793916E+03  0.1782549E+03  0.1771253E+03
+  0.1760028E+03  0.1748874E+03  0.1737790E+03  0.1726776E+03  0.1715831E+03
+  0.1704956E+03  0.1694149E+03  0.1683411E+03  0.1672740E+03  0.1662137E+03
+  0.1651601E+03  0.1641132E+03  0.1630730E+03  0.1620392E+03  0.1610121E+03
+  0.1599915E+03  0.1589773E+03  0.1579696E+03  0.1569682E+03  0.1559732E+03
+  0.3073409E+03  0.3066503E+03  0.3059601E+03  0.3052687E+03  0.3045771E+03
+  0.3038846E+03  0.3031917E+03  0.3024984E+03  0.3018034E+03  0.3011083E+03
+  0.3004117E+03  0.2997146E+03  0.2990161E+03  0.2983166E+03  0.2976158E+03
+  0.2969134E+03  0.2962097E+03  0.2955046E+03  0.2947976E+03  0.2940891E+03
+  0.2933786E+03  0.2926663E+03  0.2919518E+03  0.2912349E+03  0.2905162E+03
+  0.2897948E+03  0.2890710E+03  0.2883445E+03  0.2876151E+03  0.2868829E+03
+  0.2861474E+03  0.2854089E+03  0.2846669E+03  0.2839212E+03  0.2831719E+03
+  0.2824188E+03  0.2816615E+03  0.2809000E+03  0.2801340E+03  0.2793632E+03
+  0.2785878E+03  0.2778074E+03  0.2770215E+03  0.2762300E+03  0.2754325E+03
+  0.2746294E+03  0.2738199E+03  0.2730036E+03  0.2721807E+03  0.2713508E+03
+  0.2705131E+03  0.2696678E+03  0.2688147E+03  0.2679531E+03  0.2670822E+03
+  0.2662030E+03  0.2653142E+03  0.2644157E+03  0.2635070E+03  0.2625878E+03
+  0.2616579E+03  0.2607167E+03  0.2597639E+03  0.2587991E+03  0.2578220E+03
+  0.2568322E+03  0.2558294E+03  0.2548133E+03  0.2537836E+03  0.2527399E+03
+  0.2516821E+03  0.2506098E+03  0.2495231E+03  0.2484216E+03  0.2473053E+03
+  0.2461744E+03  0.2450286E+03  0.2438683E+03  0.2426936E+03  0.2415047E+03
+  0.2403021E+03  0.2390862E+03  0.2378574E+03  0.2366163E+03  0.2353637E+03
+  0.2341003E+03  0.2328268E+03  0.2315441E+03  0.2302530E+03  0.2289544E+03
+  0.2276495E+03  0.2263391E+03  0.2250238E+03  0.2237051E+03  0.2223837E+03
+  0.2210604E+03  0.2197361E+03  0.2184117E+03  0.2170880E+03  0.2157656E+03
+  0.2144452E+03  0.2131275E+03  0.2118131E+03  0.2105025E+03  0.2091960E+03
+  0.2078943E+03  0.2065977E+03  0.2053064E+03  0.2040209E+03  0.2027414E+03
+  0.2014680E+03  0.2002012E+03  0.1989409E+03  0.1976873E+03  0.1964406E+03
+  0.1952008E+03  0.1939681E+03  0.1927426E+03  0.1915241E+03  0.1903129E+03
+  0.1891090E+03  0.1879123E+03  0.1867228E+03  0.1855406E+03  0.1843657E+03
+  0.1831980E+03  0.1820376E+03  0.1808844E+03  0.1797384E+03  0.1785995E+03
+  0.1774678E+03  0.1763431E+03  0.1752256E+03  0.1741151E+03  0.1730115E+03
+  0.1719150E+03  0.1708254E+03  0.1697426E+03  0.1686667E+03  0.1675976E+03
+  0.1665352E+03  0.1654796E+03  0.1644307E+03  0.1633884E+03  0.1623527E+03
+  0.1613236E+03  0.1603009E+03  0.1592848E+03  0.1582751E+03  0.1572718E+03
+  0.3077788E+03  0.3070919E+03  0.3064050E+03  0.3057179E+03  0.3050303E+03
+  0.3043423E+03  0.3036534E+03  0.3029641E+03  0.3022738E+03  0.3015832E+03
+  0.3008919E+03  0.3001991E+03  0.2995057E+03  0.2988110E+03  0.2981155E+03
+  0.2974183E+03  0.2967200E+03  0.2960205E+03  0.2953192E+03  0.2946166E+03
+  0.2939121E+03  0.2932062E+03  0.2924980E+03  0.2917876E+03  0.2910756E+03
+  0.2903608E+03  0.2896443E+03  0.2889249E+03  0.2882032E+03  0.2874787E+03
+  0.2867512E+03  0.2860208E+03  0.2852872E+03  0.2845502E+03  0.2838098E+03
+  0.2830657E+03  0.2823180E+03  0.2815663E+03  0.2808103E+03  0.2800498E+03
+  0.2792851E+03  0.2785156E+03  0.2777411E+03  0.2769613E+03  0.2761759E+03
+  0.2753854E+03  0.2745887E+03  0.2737859E+03  0.2729766E+03  0.2721607E+03
+  0.2713380E+03  0.2705076E+03  0.2696698E+03  0.2688242E+03  0.2679706E+03
+  0.2671082E+03  0.2662370E+03  0.2653568E+03  0.2644666E+03  0.2635669E+03
+  0.2626570E+03  0.2617360E+03  0.2608042E+03  0.2598610E+03  0.2589060E+03
+  0.2579389E+03  0.2569593E+03  0.2559668E+03  0.2549612E+03  0.2539420E+03
+  0.2529091E+03  0.2518621E+03  0.2508008E+03  0.2497249E+03  0.2486343E+03
+  0.2475291E+03  0.2464090E+03  0.2452740E+03  0.2441244E+03  0.2429602E+03
+  0.2417817E+03  0.2405891E+03  0.2393829E+03  0.2381635E+03  0.2369315E+03
+  0.2356875E+03  0.2344321E+03  0.2331663E+03  0.2318906E+03  0.2306061E+03
+  0.2293137E+03  0.2280142E+03  0.2267086E+03  0.2253979E+03  0.2240830E+03
+  0.2227649E+03  0.2214445E+03  0.2201226E+03  0.2188000E+03  0.2174778E+03
+  0.2161564E+03  0.2148368E+03  0.2135194E+03  0.2122050E+03  0.2108942E+03
+  0.2095873E+03  0.2082848E+03  0.2069872E+03  0.2056949E+03  0.2044081E+03
+  0.2031272E+03  0.2018523E+03  0.2005838E+03  0.1993217E+03  0.1980663E+03
+  0.1968177E+03  0.1955760E+03  0.1943413E+03  0.1931137E+03  0.1918932E+03
+  0.1906799E+03  0.1894738E+03  0.1882749E+03  0.1870833E+03  0.1858990E+03
+  0.1847219E+03  0.1835520E+03  0.1823895E+03  0.1812341E+03  0.1800859E+03
+  0.1789449E+03  0.1778110E+03  0.1766842E+03  0.1755645E+03  0.1744519E+03
+  0.1733462E+03  0.1722476E+03  0.1711558E+03  0.1700710E+03  0.1689930E+03
+  0.1679218E+03  0.1668574E+03  0.1657998E+03  0.1647488E+03  0.1637045E+03
+  0.1626668E+03  0.1616357E+03  0.1606111E+03  0.1595930E+03  0.1585814E+03
+  0.3082078E+03  0.3075247E+03  0.3068419E+03  0.3061585E+03  0.3054746E+03
+  0.3047906E+03  0.3041060E+03  0.3034208E+03  0.3027349E+03  0.3020488E+03
+  0.3013615E+03  0.3006735E+03  0.2999850E+03  0.2992951E+03  0.2986044E+03
+  0.2979124E+03  0.2972192E+03  0.2965251E+03  0.2958292E+03  0.2951323E+03
+  0.2944336E+03  0.2937333E+03  0.2930312E+03  0.2923275E+03  0.2916216E+03
+  0.2909135E+03  0.2902039E+03  0.2894915E+03  0.2887769E+03  0.2880595E+03
+  0.2873399E+03  0.2866169E+03  0.2858913E+03  0.2851627E+03  0.2844306E+03
+  0.2836957E+03  0.2829569E+03  0.2822144E+03  0.2814679E+03  0.2807174E+03
+  0.2799627E+03  0.2792036E+03  0.2784400E+03  0.2776714E+03  0.2768977E+03
+  0.2761186E+03  0.2753342E+03  0.2745441E+03  0.2737479E+03  0.2729453E+03
+  0.2721364E+03  0.2713207E+03  0.2704977E+03  0.2696673E+03  0.2688293E+03
+  0.2679833E+03  0.2671289E+03  0.2662659E+03  0.2653938E+03  0.2645125E+03
+  0.2636215E+03  0.2627200E+03  0.2618083E+03  0.2608859E+03  0.2599521E+03
+  0.2590068E+03  0.2580496E+03  0.2570801E+03  0.2560978E+03  0.2551026E+03
+  0.2540940E+03  0.2530717E+03  0.2520354E+03  0.2509849E+03  0.2499199E+03
+  0.2488404E+03  0.2477461E+03  0.2466369E+03  0.2455129E+03  0.2443740E+03
+  0.2432204E+03  0.2420523E+03  0.2408700E+03  0.2396735E+03  0.2384639E+03
+  0.2372411E+03  0.2360058E+03  0.2347590E+03  0.2335010E+03  0.2322328E+03
+  0.2309552E+03  0.2296691E+03  0.2283754E+03  0.2270750E+03  0.2257691E+03
+  0.2244583E+03  0.2231438E+03  0.2218265E+03  0.2205071E+03  0.2191868E+03
+  0.2178662E+03  0.2165461E+03  0.2152274E+03  0.2139106E+03  0.2125964E+03
+  0.2112854E+03  0.2099781E+03  0.2086751E+03  0.2073767E+03  0.2060833E+03
+  0.2047954E+03  0.2035131E+03  0.2022367E+03  0.2009666E+03  0.1997029E+03
+  0.1984457E+03  0.1971952E+03  0.1959516E+03  0.1947149E+03  0.1934853E+03
+  0.1922627E+03  0.1910473E+03  0.1898391E+03  0.1886381E+03  0.1874444E+03
+  0.1862579E+03  0.1850786E+03  0.1839066E+03  0.1827419E+03  0.1815843E+03
+  0.1804339E+03  0.1792908E+03  0.1781547E+03  0.1770258E+03  0.1759040E+03
+  0.1747892E+03  0.1736815E+03  0.1725807E+03  0.1714868E+03  0.1703999E+03
+  0.1693199E+03  0.1682466E+03  0.1671802E+03  0.1661205E+03  0.1650675E+03
+  0.1640212E+03  0.1629815E+03  0.1619484E+03  0.1609218E+03  0.1599017E+03
+  0.3086291E+03  0.3079499E+03  0.3072703E+03  0.3065905E+03  0.3059104E+03
+  0.3052306E+03  0.3045495E+03  0.3038688E+03  0.3031870E+03  0.3025047E+03
+  0.3018221E+03  0.3011383E+03  0.3004542E+03  0.2997690E+03  0.2990833E+03
+  0.2983961E+03  0.2977081E+03  0.2970188E+03  0.2963284E+03  0.2956366E+03
+  0.2949433E+03  0.2942489E+03  0.2935526E+03  0.2928550E+03  0.2921552E+03
+  0.2914533E+03  0.2907500E+03  0.2900444E+03  0.2893365E+03  0.2886263E+03
+  0.2879137E+03  0.2871983E+03  0.2864807E+03  0.2857596E+03  0.2850358E+03
+  0.2843089E+03  0.2835786E+03  0.2828449E+03  0.2821077E+03  0.2813666E+03
+  0.2806215E+03  0.2798724E+03  0.2791189E+03  0.2783609E+03  0.2775982E+03
+  0.2768303E+03  0.2760577E+03  0.2752796E+03  0.2744958E+03  0.2737060E+03
+  0.2729101E+03  0.2721080E+03  0.2712993E+03  0.2704834E+03  0.2696605E+03
+  0.2688297E+03  0.2679914E+03  0.2671451E+03  0.2662899E+03  0.2654260E+03
+  0.2645530E+03  0.2636702E+03  0.2627778E+03  0.2618753E+03  0.2609619E+03
+  0.2600375E+03  0.2591018E+03  0.2581543E+03  0.2571946E+03  0.2562225E+03
+  0.2552374E+03  0.2542392E+03  0.2532275E+03  0.2522019E+03  0.2511622E+03
+  0.2501084E+03  0.2490398E+03  0.2479564E+03  0.2468582E+03  0.2457451E+03
+  0.2446171E+03  0.2434742E+03  0.2423166E+03  0.2411446E+03  0.2399585E+03
+  0.2387584E+03  0.2375451E+03  0.2363190E+03  0.2350807E+03  0.2338309E+03
+  0.2325704E+03  0.2313000E+03  0.2300205E+03  0.2287330E+03  0.2274382E+03
+  0.2261371E+03  0.2248309E+03  0.2235203E+03  0.2222063E+03  0.2208899E+03
+  0.2195719E+03  0.2182532E+03  0.2169347E+03  0.2156170E+03  0.2143010E+03
+  0.2129872E+03  0.2116762E+03  0.2103688E+03  0.2090652E+03  0.2077661E+03
+  0.2064718E+03  0.2051828E+03  0.2038992E+03  0.2026215E+03  0.2013498E+03
+  0.2000844E+03  0.1988255E+03  0.1975732E+03  0.1963277E+03  0.1950891E+03
+  0.1938574E+03  0.1926328E+03  0.1914154E+03  0.1902050E+03  0.1890020E+03
+  0.1878061E+03  0.1866174E+03  0.1854360E+03  0.1842618E+03  0.1830949E+03
+  0.1819352E+03  0.1807827E+03  0.1796373E+03  0.1784991E+03  0.1773681E+03
+  0.1762441E+03  0.1751272E+03  0.1740173E+03  0.1729144E+03  0.1718185E+03
+  0.1707295E+03  0.1696474E+03  0.1685721E+03  0.1675036E+03  0.1664418E+03
+  0.1653868E+03  0.1643384E+03  0.1632967E+03  0.1622616E+03  0.1612331E+03
+  0.3090429E+03  0.3083672E+03  0.3076909E+03  0.3070149E+03  0.3063383E+03
+  0.3056617E+03  0.3049852E+03  0.3043076E+03  0.3036301E+03  0.3029518E+03
+  0.3022733E+03  0.3015938E+03  0.3009141E+03  0.3002333E+03  0.2995521E+03
+  0.2988696E+03  0.2981863E+03  0.2975021E+03  0.2968166E+03  0.2961301E+03
+  0.2954421E+03  0.2947531E+03  0.2940622E+03  0.2933703E+03  0.2926764E+03
+  0.2919808E+03  0.2912838E+03  0.2905842E+03  0.2898829E+03  0.2891794E+03
+  0.2884737E+03  0.2877654E+03  0.2870549E+03  0.2863414E+03  0.2856252E+03
+  0.2849063E+03  0.2841842E+03  0.2834587E+03  0.2827303E+03  0.2819985E+03
+  0.2812624E+03  0.2805227E+03  0.2797789E+03  0.2790310E+03  0.2782785E+03
+  0.2775217E+03  0.2767600E+03  0.2759932E+03  0.2752213E+03  0.2744437E+03
+  0.2736602E+03  0.2728711E+03  0.2720756E+03  0.2712738E+03  0.2704649E+03
+  0.2696492E+03  0.2688257E+03  0.2679949E+03  0.2671562E+03  0.2663091E+03
+  0.2654533E+03  0.2645884E+03  0.2637143E+03  0.2628306E+03  0.2619366E+03
+  0.2610323E+03  0.2601172E+03  0.2591909E+03  0.2582531E+03  0.2573033E+03
+  0.2563411E+03  0.2553663E+03  0.2543784E+03  0.2533771E+03  0.2523622E+03
+  0.2513333E+03  0.2502901E+03  0.2492324E+03  0.2481600E+03  0.2470728E+03
+  0.2459707E+03  0.2448536E+03  0.2437214E+03  0.2425746E+03  0.2414131E+03
+  0.2402371E+03  0.2390471E+03  0.2378435E+03  0.2366266E+03  0.2353972E+03
+  0.2341559E+03  0.2329034E+03  0.2316404E+03  0.2303679E+03  0.2290868E+03
+  0.2277979E+03  0.2265021E+03  0.2252006E+03  0.2238942E+03  0.2225839E+03
+  0.2212706E+03  0.2199553E+03  0.2186388E+03  0.2173220E+03  0.2160056E+03
+  0.2146905E+03  0.2133773E+03  0.2120666E+03  0.2107590E+03  0.2094552E+03
+  0.2081554E+03  0.2068603E+03  0.2055702E+03  0.2042855E+03  0.2030064E+03
+  0.2017333E+03  0.2004663E+03  0.1992057E+03  0.1979516E+03  0.1967043E+03
+  0.1954637E+03  0.1942301E+03  0.1930035E+03  0.1917840E+03  0.1905716E+03
+  0.1893664E+03  0.1881684E+03  0.1869776E+03  0.1857941E+03  0.1846177E+03
+  0.1834486E+03  0.1822867E+03  0.1811320E+03  0.1799846E+03  0.1788442E+03
+  0.1777110E+03  0.1765849E+03  0.1754658E+03  0.1743539E+03  0.1732489E+03
+  0.1721508E+03  0.1710597E+03  0.1699755E+03  0.1688981E+03  0.1678276E+03
+  0.1667638E+03  0.1657067E+03  0.1646563E+03  0.1636126E+03  0.1625755E+03
+  0.3094497E+03  0.3087765E+03  0.3081042E+03  0.3074310E+03  0.3067583E+03
+  0.3060850E+03  0.3054122E+03  0.3047383E+03  0.3040648E+03  0.3033904E+03
+  0.3027159E+03  0.3020405E+03  0.3013649E+03  0.3006886E+03  0.3000112E+03
+  0.2993336E+03  0.2986547E+03  0.2979753E+03  0.2972946E+03  0.2966130E+03
+  0.2959302E+03  0.2952462E+03  0.2945608E+03  0.2938742E+03  0.2931860E+03
+  0.2924962E+03  0.2918050E+03  0.2911116E+03  0.2904164E+03  0.2897193E+03
+  0.2890202E+03  0.2883186E+03  0.2876151E+03  0.2869088E+03  0.2862002E+03
+  0.2854886E+03  0.2847744E+03  0.2840572E+03  0.2833367E+03  0.2826131E+03
+  0.2818863E+03  0.2811555E+03  0.2804210E+03  0.2796826E+03  0.2789400E+03
+  0.2781934E+03  0.2774421E+03  0.2766862E+03  0.2759254E+03  0.2751593E+03
+  0.2743880E+03  0.2736109E+03  0.2728282E+03  0.2720394E+03  0.2712441E+03
+  0.2704423E+03  0.2696336E+03  0.2688174E+03  0.2679940E+03  0.2671628E+03
+  0.2663236E+03  0.2654757E+03  0.2646190E+03  0.2637534E+03  0.2628777E+03
+  0.2619926E+03  0.2610973E+03  0.2601913E+03  0.2592744E+03  0.2583459E+03
+  0.2574057E+03  0.2564537E+03  0.2554890E+03  0.2545113E+03  0.2535205E+03
+  0.2525161E+03  0.2514978E+03  0.2504654E+03  0.2494186E+03  0.2483571E+03
+  0.2472808E+03  0.2461897E+03  0.2450835E+03  0.2439623E+03  0.2428262E+03
+  0.2416752E+03  0.2405096E+03  0.2393298E+03  0.2381359E+03  0.2369287E+03
+  0.2357084E+03  0.2344758E+03  0.2332315E+03  0.2319763E+03  0.2307111E+03
+  0.2294366E+03  0.2281539E+03  0.2268638E+03  0.2255673E+03  0.2242654E+03
+  0.2229591E+03  0.2216492E+03  0.2203368E+03  0.2190228E+03  0.2177079E+03
+  0.2163931E+03  0.2150791E+03  0.2137666E+03  0.2124563E+03  0.2111488E+03
+  0.2098448E+03  0.2085446E+03  0.2072488E+03  0.2059578E+03  0.2046719E+03
+  0.2033916E+03  0.2021171E+03  0.2008485E+03  0.1995863E+03  0.1983305E+03
+  0.1970813E+03  0.1958389E+03  0.1946033E+03  0.1933748E+03  0.1921532E+03
+  0.1909388E+03  0.1897314E+03  0.1885313E+03  0.1873384E+03  0.1861527E+03
+  0.1849742E+03  0.1838030E+03  0.1826389E+03  0.1814821E+03  0.1803324E+03
+  0.1791899E+03  0.1780546E+03  0.1769263E+03  0.1758051E+03  0.1746910E+03
+  0.1735839E+03  0.1724837E+03  0.1713906E+03  0.1703042E+03  0.1692248E+03
+  0.1681522E+03  0.1670863E+03  0.1660272E+03  0.1649748E+03  0.1639291E+03
+  0.3098485E+03  0.3091789E+03  0.3085098E+03  0.3078398E+03  0.3071705E+03
+  0.3065005E+03  0.3058311E+03  0.3051610E+03  0.3044910E+03  0.3038206E+03
+  0.3031495E+03  0.3024784E+03  0.3018066E+03  0.3011346E+03  0.3004614E+03
+  0.2997882E+03  0.2991136E+03  0.2984388E+03  0.2977626E+03  0.2970858E+03
+  0.2964078E+03  0.2957289E+03  0.2950484E+03  0.2943672E+03  0.2936842E+03
+  0.2930000E+03  0.2923144E+03  0.2916265E+03  0.2909376E+03  0.2902467E+03
+  0.2895538E+03  0.2888588E+03  0.2881618E+03  0.2874625E+03  0.2867608E+03
+  0.2860563E+03  0.2853496E+03  0.2846400E+03  0.2839276E+03  0.2832120E+03
+  0.2824933E+03  0.2817711E+03  0.2810457E+03  0.2803165E+03  0.2795833E+03
+  0.2788463E+03  0.2781050E+03  0.2773594E+03  0.2766091E+03  0.2758541E+03
+  0.2750941E+03  0.2743286E+03  0.2735580E+03  0.2727816E+03  0.2719993E+03
+  0.2712106E+03  0.2704156E+03  0.2696140E+03  0.2688048E+03  0.2679885E+03
+  0.2671648E+03  0.2663332E+03  0.2654932E+03  0.2646446E+03  0.2637870E+03
+  0.2629201E+03  0.2620436E+03  0.2611569E+03  0.2602598E+03  0.2593521E+03
+  0.2584331E+03  0.2575025E+03  0.2565601E+03  0.2556052E+03  0.2546376E+03
+  0.2536571E+03  0.2526633E+03  0.2516558E+03  0.2506341E+03  0.2495981E+03
+  0.2485475E+03  0.2474822E+03  0.2464020E+03  0.2453068E+03  0.2441965E+03
+  0.2430712E+03  0.2419310E+03  0.2407759E+03  0.2396062E+03  0.2384226E+03
+  0.2372250E+03  0.2360140E+03  0.2347904E+03  0.2335546E+03  0.2323075E+03
+  0.2310498E+03  0.2297824E+03  0.2285061E+03  0.2272220E+03  0.2259308E+03
+  0.2246338E+03  0.2233316E+03  0.2220255E+03  0.2207163E+03  0.2194050E+03
+  0.2180923E+03  0.2167793E+03  0.2154666E+03  0.2141550E+03  0.2128453E+03
+  0.2115381E+03  0.2102339E+03  0.2089335E+03  0.2076371E+03  0.2063453E+03
+  0.2050585E+03  0.2037769E+03  0.2025010E+03  0.2012311E+03  0.1999673E+03
+  0.1987098E+03  0.1974588E+03  0.1962146E+03  0.1949771E+03  0.1937466E+03
+  0.1925230E+03  0.1913065E+03  0.1900971E+03  0.1888949E+03  0.1876998E+03
+  0.1865120E+03  0.1853314E+03  0.1841579E+03  0.1829918E+03  0.1818327E+03
+  0.1806809E+03  0.1795363E+03  0.1783988E+03  0.1772684E+03  0.1761451E+03
+  0.1750288E+03  0.1739196E+03  0.1728173E+03  0.1717220E+03  0.1706336E+03
+  0.1695521E+03  0.1684774E+03  0.1674095E+03  0.1663484E+03  0.1652939E+03
+  0.3102406E+03  0.3095744E+03  0.3089076E+03  0.3082416E+03  0.3075750E+03
+  0.3069088E+03  0.3062424E+03  0.3055762E+03  0.3049091E+03  0.3042425E+03
+  0.3035751E+03  0.3029078E+03  0.3022399E+03  0.3015717E+03  0.3009025E+03
+  0.3002334E+03  0.2995633E+03  0.2988926E+03  0.2982210E+03  0.2975490E+03
+  0.2968754E+03  0.2962010E+03  0.2955260E+03  0.2948492E+03  0.2941719E+03
+  0.2934926E+03  0.2928126E+03  0.2921302E+03  0.2914474E+03  0.2907619E+03
+  0.2900750E+03  0.2893863E+03  0.2886956E+03  0.2880028E+03  0.2873078E+03
+  0.2866104E+03  0.2859106E+03  0.2852084E+03  0.2845034E+03  0.2837957E+03
+  0.2830848E+03  0.2823710E+03  0.2816538E+03  0.2809333E+03  0.2802090E+03
+  0.2794812E+03  0.2787494E+03  0.2780136E+03  0.2772734E+03  0.2765288E+03
+  0.2757792E+03  0.2750252E+03  0.2742660E+03  0.2735015E+03  0.2727313E+03
+  0.2719552E+03  0.2711733E+03  0.2703850E+03  0.2695901E+03  0.2687881E+03
+  0.2679789E+03  0.2671627E+03  0.2663382E+03  0.2655062E+03  0.2646654E+03
+  0.2638159E+03  0.2629574E+03  0.2620890E+03  0.2612112E+03  0.2603230E+03
+  0.2594242E+03  0.2585144E+03  0.2575933E+03  0.2566607E+03  0.2557157E+03
+  0.2547582E+03  0.2537878E+03  0.2528042E+03  0.2518071E+03  0.2507961E+03
+  0.2497708E+03  0.2487314E+03  0.2476770E+03  0.2466078E+03  0.2455235E+03
+  0.2444242E+03  0.2433098E+03  0.2421803E+03  0.2410358E+03  0.2398769E+03
+  0.2387032E+03  0.2375155E+03  0.2363141E+03  0.2350996E+03  0.2338727E+03
+  0.2326339E+03  0.2313840E+03  0.2301239E+03  0.2288544E+03  0.2275765E+03
+  0.2262911E+03  0.2249990E+03  0.2237015E+03  0.2223994E+03  0.2210937E+03
+  0.2197852E+03  0.2184751E+03  0.2171640E+03  0.2158529E+03  0.2145425E+03
+  0.2132336E+03  0.2119268E+03  0.2106227E+03  0.2093221E+03  0.2080252E+03
+  0.2067327E+03  0.2054450E+03  0.2041624E+03  0.2028853E+03  0.2016139E+03
+  0.2003485E+03  0.1990895E+03  0.1978368E+03  0.1965907E+03  0.1953514E+03
+  0.1941189E+03  0.1928933E+03  0.1916748E+03  0.1904633E+03  0.1892590E+03
+  0.1880619E+03  0.1868719E+03  0.1856891E+03  0.1845136E+03  0.1833452E+03
+  0.1821841E+03  0.1810301E+03  0.1798833E+03  0.1787436E+03  0.1776111E+03
+  0.1764856E+03  0.1753673E+03  0.1742559E+03  0.1731515E+03  0.1720541E+03
+  0.1709637E+03  0.1698800E+03  0.1688033E+03  0.1677333E+03  0.1666701E+03
+  0.3106259E+03  0.3099627E+03  0.3092991E+03  0.3086358E+03  0.3079726E+03
+  0.3073096E+03  0.3066460E+03  0.3059833E+03  0.3053198E+03  0.3046565E+03
+  0.3039929E+03  0.3033293E+03  0.3026648E+03  0.3020003E+03  0.3013354E+03
+  0.3006698E+03  0.3000041E+03  0.2993374E+03  0.2986702E+03  0.2980021E+03
+  0.2973334E+03  0.2966637E+03  0.2959932E+03  0.2953214E+03  0.2946487E+03
+  0.2939748E+03  0.2932996E+03  0.2926230E+03  0.2919451E+03  0.2912656E+03
+  0.2905845E+03  0.2899016E+03  0.2892169E+03  0.2885303E+03  0.2878421E+03
+  0.2871511E+03  0.2864580E+03  0.2857626E+03  0.2850649E+03  0.2843646E+03
+  0.2836613E+03  0.2829551E+03  0.2822460E+03  0.2815337E+03  0.2808182E+03
+  0.2800990E+03  0.2793761E+03  0.2786495E+03  0.2779190E+03  0.2771843E+03
+  0.2764452E+03  0.2757017E+03  0.2749533E+03  0.2742000E+03  0.2734413E+03
+  0.2726774E+03  0.2719077E+03  0.2711321E+03  0.2703505E+03  0.2695624E+03
+  0.2687673E+03  0.2679653E+03  0.2671561E+03  0.2663392E+03  0.2655145E+03
+  0.2646816E+03  0.2638399E+03  0.2629893E+03  0.2621296E+03  0.2612602E+03
+  0.2603808E+03  0.2594909E+03  0.2585904E+03  0.2576786E+03  0.2567552E+03
+  0.2558199E+03  0.2548725E+03  0.2539124E+03  0.2529391E+03  0.2519524E+03
+  0.2509519E+03  0.2499374E+03  0.2489085E+03  0.2478650E+03  0.2468068E+03
+  0.2457337E+03  0.2446453E+03  0.2435419E+03  0.2424232E+03  0.2412895E+03
+  0.2401409E+03  0.2389777E+03  0.2378001E+03  0.2366085E+03  0.2354035E+03
+  0.2341855E+03  0.2329553E+03  0.2317135E+03  0.2304610E+03  0.2291987E+03
+  0.2279272E+03  0.2266477E+03  0.2253613E+03  0.2240685E+03  0.2227707E+03
+  0.2214688E+03  0.2201636E+03  0.2188561E+03  0.2175473E+03  0.2162380E+03
+  0.2149289E+03  0.2136209E+03  0.2123148E+03  0.2110110E+03  0.2097103E+03
+  0.2084132E+03  0.2071201E+03  0.2058316E+03  0.2045480E+03  0.2032697E+03
+  0.2019970E+03  0.2007302E+03  0.1994695E+03  0.1982151E+03  0.1969673E+03
+  0.1957261E+03  0.1944917E+03  0.1932642E+03  0.1920436E+03  0.1908301E+03
+  0.1896238E+03  0.1884245E+03  0.1872324E+03  0.1860475E+03  0.1848698E+03
+  0.1836993E+03  0.1825360E+03  0.1813799E+03  0.1802309E+03  0.1790891E+03
+  0.1779544E+03  0.1768269E+03  0.1757063E+03  0.1745928E+03  0.1734864E+03
+  0.1723869E+03  0.1712943E+03  0.1702086E+03  0.1691298E+03  0.1680578E+03
+  0.3110053E+03  0.3103439E+03  0.3096838E+03  0.3090231E+03  0.3083634E+03
+  0.3077029E+03  0.3070431E+03  0.3063829E+03  0.3057230E+03  0.3050628E+03
+  0.3044029E+03  0.3037424E+03  0.3030819E+03  0.3024209E+03  0.3017597E+03
+  0.3010978E+03  0.3004361E+03  0.2997735E+03  0.2991106E+03  0.2984465E+03
+  0.2977822E+03  0.2971168E+03  0.2964508E+03  0.2957836E+03  0.2951156E+03
+  0.2944466E+03  0.2937764E+03  0.2931049E+03  0.2924321E+03  0.2917581E+03
+  0.2910825E+03  0.2904052E+03  0.2897263E+03  0.2890457E+03  0.2883635E+03
+  0.2876791E+03  0.2869923E+03  0.2863036E+03  0.2856126E+03  0.2849189E+03
+  0.2842232E+03  0.2835243E+03  0.2828229E+03  0.2821186E+03  0.2814111E+03
+  0.2807004E+03  0.2799863E+03  0.2792686E+03  0.2785471E+03  0.2778219E+03
+  0.2770926E+03  0.2763587E+03  0.2756208E+03  0.2748782E+03  0.2741306E+03
+  0.2733780E+03  0.2726200E+03  0.2718565E+03  0.2710873E+03  0.2703121E+03
+  0.2695305E+03  0.2687421E+03  0.2679473E+03  0.2671452E+03  0.2663356E+03
+  0.2655183E+03  0.2646929E+03  0.2638592E+03  0.2630167E+03  0.2621653E+03
+  0.2613041E+03  0.2604333E+03  0.2595522E+03  0.2586606E+03  0.2577580E+03
+  0.2568443E+03  0.2559186E+03  0.2549808E+03  0.2540305E+03  0.2530673E+03
+  0.2520911E+03  0.2511014E+03  0.2500974E+03  0.2490793E+03  0.2480467E+03
+  0.2469993E+03  0.2459371E+03  0.2448598E+03  0.2437673E+03  0.2426597E+03
+  0.2415367E+03  0.2403988E+03  0.2392460E+03  0.2380785E+03  0.2368970E+03
+  0.2357016E+03  0.2344929E+03  0.2332715E+03  0.2320381E+03  0.2307935E+03
+  0.2295385E+03  0.2282739E+03  0.2270008E+03  0.2257200E+03  0.2244325E+03
+  0.2231392E+03  0.2218414E+03  0.2205397E+03  0.2192352E+03  0.2179289E+03
+  0.2166216E+03  0.2153141E+03  0.2140074E+03  0.2127020E+03  0.2113986E+03
+  0.2100981E+03  0.2088007E+03  0.2075072E+03  0.2062180E+03  0.2049336E+03
+  0.2036542E+03  0.2023802E+03  0.2011120E+03  0.1998499E+03  0.1985939E+03
+  0.1973443E+03  0.1961013E+03  0.1948650E+03  0.1936356E+03  0.1924131E+03
+  0.1911975E+03  0.1899891E+03  0.1887877E+03  0.1875936E+03  0.1864065E+03
+  0.1852267E+03  0.1840541E+03  0.1828886E+03  0.1817303E+03  0.1805792E+03
+  0.1794353E+03  0.1782985E+03  0.1771687E+03  0.1760461E+03  0.1749305E+03
+  0.1738219E+03  0.1727202E+03  0.1716256E+03  0.1705378E+03  0.1694569E+03
+  0.3113774E+03  0.3107196E+03  0.3100614E+03  0.3094043E+03  0.3087465E+03
+  0.3080897E+03  0.3074327E+03  0.3067760E+03  0.3061193E+03  0.3054621E+03
+  0.3048053E+03  0.3041483E+03  0.3034911E+03  0.3028333E+03  0.3021763E+03
+  0.3015179E+03  0.3008599E+03  0.3002011E+03  0.2995420E+03  0.2988820E+03
+  0.2982218E+03  0.2975608E+03  0.2968992E+03  0.2962363E+03  0.2955730E+03
+  0.2949084E+03  0.2942430E+03  0.2935764E+03  0.2929087E+03  0.2922396E+03
+  0.2915694E+03  0.2908976E+03  0.2902243E+03  0.2895494E+03  0.2888727E+03
+  0.2881942E+03  0.2875138E+03  0.2868316E+03  0.2861470E+03  0.2854602E+03
+  0.2847713E+03  0.2840799E+03  0.2833856E+03  0.2826887E+03  0.2819888E+03
+  0.2812863E+03  0.2805802E+03  0.2798709E+03  0.2791583E+03  0.2784420E+03
+  0.2777219E+03  0.2769977E+03  0.2762695E+03  0.2755369E+03  0.2747999E+03
+  0.2740579E+03  0.2733112E+03  0.2725591E+03  0.2718018E+03  0.2710388E+03
+  0.2702700E+03  0.2694948E+03  0.2687132E+03  0.2679253E+03  0.2671301E+03
+  0.2663277E+03  0.2655177E+03  0.2646999E+03  0.2638737E+03  0.2630393E+03
+  0.2621957E+03  0.2613431E+03  0.2604806E+03  0.2596082E+03  0.2587255E+03
+  0.2578321E+03  0.2569274E+03  0.2560111E+03  0.2550834E+03  0.2541430E+03
+  0.2531898E+03  0.2522237E+03  0.2512440E+03  0.2502507E+03  0.2492436E+03
+  0.2482218E+03  0.2471853E+03  0.2461340E+03  0.2450676E+03  0.2439862E+03
+  0.2428894E+03  0.2417775E+03  0.2406502E+03  0.2395080E+03  0.2383511E+03
+  0.2371796E+03  0.2359940E+03  0.2347947E+03  0.2335824E+03  0.2323578E+03
+  0.2311213E+03  0.2298739E+03  0.2286165E+03  0.2273500E+03  0.2260752E+03
+  0.2247932E+03  0.2235049E+03  0.2222113E+03  0.2209135E+03  0.2196123E+03
+  0.2183088E+03  0.2170037E+03  0.2156981E+03  0.2143927E+03  0.2130883E+03
+  0.2117856E+03  0.2104853E+03  0.2091879E+03  0.2078941E+03  0.2066044E+03
+  0.2053191E+03  0.2040388E+03  0.2027637E+03  0.2014942E+03  0.2002305E+03
+  0.1989730E+03  0.1977217E+03  0.1964770E+03  0.1952389E+03  0.1940075E+03
+  0.1927830E+03  0.1915655E+03  0.1903550E+03  0.1891516E+03  0.1879553E+03
+  0.1867662E+03  0.1855842E+03  0.1844094E+03  0.1832418E+03  0.1820814E+03
+  0.1809282E+03  0.1797821E+03  0.1786431E+03  0.1775112E+03  0.1763864E+03
+  0.1752687E+03  0.1741580E+03  0.1730543E+03  0.1719575E+03  0.1708676E+03
+  0.3117440E+03  0.3110881E+03  0.3104333E+03  0.3097787E+03  0.3091238E+03
+  0.3084697E+03  0.3078155E+03  0.3071615E+03  0.3065078E+03  0.3058542E+03
+  0.3052001E+03  0.3045467E+03  0.3038926E+03  0.3032388E+03  0.3025845E+03
+  0.3019302E+03  0.3012754E+03  0.3006205E+03  0.2999649E+03  0.2993093E+03
+  0.2986527E+03  0.2979958E+03  0.2973382E+03  0.2966800E+03  0.2960210E+03
+  0.2953604E+03  0.2947000E+03  0.2940380E+03  0.2933752E+03  0.2927109E+03
+  0.2920457E+03  0.2913790E+03  0.2907111E+03  0.2900416E+03  0.2893707E+03
+  0.2886978E+03  0.2880236E+03  0.2873472E+03  0.2866689E+03  0.2859886E+03
+  0.2853062E+03  0.2846214E+03  0.2839342E+03  0.2832444E+03  0.2825517E+03
+  0.2818567E+03  0.2811586E+03  0.2804576E+03  0.2797531E+03  0.2790452E+03
+  0.2783337E+03  0.2776189E+03  0.2769001E+03  0.2761771E+03  0.2754500E+03
+  0.2747184E+03  0.2739819E+03  0.2732410E+03  0.2724950E+03  0.2717436E+03
+  0.2709868E+03  0.2702241E+03  0.2694553E+03  0.2686803E+03  0.2678991E+03
+  0.2671109E+03  0.2663156E+03  0.2655128E+03  0.2647024E+03  0.2638839E+03
+  0.2630570E+03  0.2622213E+03  0.2613770E+03  0.2605229E+03  0.2596591E+03
+  0.2587851E+03  0.2579005E+03  0.2570052E+03  0.2560984E+03  0.2551798E+03
+  0.2542490E+03  0.2533061E+03  0.2523503E+03  0.2513809E+03  0.2503980E+03
+  0.2494012E+03  0.2483901E+03  0.2473647E+03  0.2463243E+03  0.2452689E+03
+  0.2441984E+03  0.2431127E+03  0.2420116E+03  0.2408954E+03  0.2397638E+03
+  0.2386173E+03  0.2374561E+03  0.2362805E+03  0.2350909E+03  0.2338879E+03
+  0.2326721E+03  0.2314441E+03  0.2302048E+03  0.2289548E+03  0.2276952E+03
+  0.2264268E+03  0.2251505E+03  0.2238675E+03  0.2225785E+03  0.2212848E+03
+  0.2199872E+03  0.2186867E+03  0.2173842E+03  0.2160806E+03  0.2147769E+03
+  0.2134737E+03  0.2121718E+03  0.2108719E+03  0.2095747E+03  0.2082807E+03
+  0.2069906E+03  0.2057047E+03  0.2044234E+03  0.2031472E+03  0.2018765E+03
+  0.2006115E+03  0.1993524E+03  0.1980995E+03  0.1968530E+03  0.1956131E+03
+  0.1943799E+03  0.1931535E+03  0.1919340E+03  0.1907215E+03  0.1895160E+03
+  0.1883177E+03  0.1871264E+03  0.1859424E+03  0.1847654E+03  0.1835957E+03
+  0.1824331E+03  0.1812777E+03  0.1801295E+03  0.1789884E+03  0.1778544E+03
+  0.1767275E+03  0.1756076E+03  0.1744948E+03  0.1733889E+03  0.1722900E+03
+  0.3121037E+03  0.3114512E+03  0.3107985E+03  0.3101461E+03  0.3094948E+03
+  0.3088430E+03  0.3081920E+03  0.3075406E+03  0.3068899E+03  0.3062391E+03
+  0.3055885E+03  0.3049375E+03  0.3042870E+03  0.3036365E+03  0.3029855E+03
+  0.3023349E+03  0.3016833E+03  0.3010320E+03  0.3003799E+03  0.2997280E+03
+  0.2990753E+03  0.2984222E+03  0.2977685E+03  0.2971144E+03  0.2964595E+03
+  0.2958038E+03  0.2951473E+03  0.2944900E+03  0.2938313E+03  0.2931720E+03
+  0.2925120E+03  0.2918502E+03  0.2911874E+03  0.2905230E+03  0.2898575E+03
+  0.2891901E+03  0.2885214E+03  0.2878508E+03  0.2871786E+03  0.2865045E+03
+  0.2858279E+03  0.2851498E+03  0.2844693E+03  0.2837866E+03  0.2831012E+03
+  0.2824131E+03  0.2817224E+03  0.2810289E+03  0.2803324E+03  0.2796328E+03
+  0.2789297E+03  0.2782234E+03  0.2775134E+03  0.2767995E+03  0.2760818E+03
+  0.2753599E+03  0.2746337E+03  0.2739031E+03  0.2731678E+03  0.2724274E+03
+  0.2716820E+03  0.2709312E+03  0.2701747E+03  0.2694123E+03  0.2686437E+03
+  0.2678692E+03  0.2670877E+03  0.2662993E+03  0.2655037E+03  0.2647005E+03
+  0.2638895E+03  0.2630703E+03  0.2622426E+03  0.2614059E+03  0.2605602E+03
+  0.2597046E+03  0.2588393E+03  0.2579637E+03  0.2570772E+03  0.2561795E+03
+  0.2552708E+03  0.2543497E+03  0.2534163E+03  0.2524702E+03  0.2515114E+03
+  0.2505391E+03  0.2495527E+03  0.2485523E+03  0.2475375E+03  0.2465079E+03
+  0.2454637E+03  0.2444042E+03  0.2433294E+03  0.2422393E+03  0.2411339E+03
+  0.2400133E+03  0.2388773E+03  0.2377265E+03  0.2365611E+03  0.2353814E+03
+  0.2341880E+03  0.2329812E+03  0.2317620E+03  0.2305309E+03  0.2292887E+03
+  0.2280362E+03  0.2267745E+03  0.2255043E+03  0.2242268E+03  0.2229429E+03
+  0.2216535E+03  0.2203598E+03  0.2190626E+03  0.2177629E+03  0.2164617E+03
+  0.2151598E+03  0.2138579E+03  0.2125571E+03  0.2112578E+03  0.2099609E+03
+  0.2086670E+03  0.2073765E+03  0.2060900E+03  0.2048080E+03  0.2035309E+03
+  0.2022590E+03  0.2009926E+03  0.1997321E+03  0.1984777E+03  0.1972295E+03
+  0.1959879E+03  0.1947528E+03  0.1935245E+03  0.1923031E+03  0.1910885E+03
+  0.1898810E+03  0.1886806E+03  0.1874873E+03  0.1863011E+03  0.1851221E+03
+  0.1839502E+03  0.1827855E+03  0.1816280E+03  0.1804776E+03  0.1793343E+03
+  0.1781982E+03  0.1770691E+03  0.1759471E+03  0.1748322E+03  0.1737242E+03
+  0.3124586E+03  0.3118080E+03  0.3111579E+03  0.3105085E+03  0.3098590E+03
+  0.3092102E+03  0.3085615E+03  0.3079134E+03  0.3072655E+03  0.3066171E+03
+  0.3059699E+03  0.3053219E+03  0.3046746E+03  0.3040268E+03  0.3033795E+03
+  0.3027314E+03  0.3020839E+03  0.3014356E+03  0.3007878E+03  0.3001389E+03
+  0.2994899E+03  0.2988406E+03  0.2981907E+03  0.2975405E+03  0.2968895E+03
+  0.2962381E+03  0.2955857E+03  0.2949327E+03  0.2942787E+03  0.2936238E+03
+  0.2929681E+03  0.2923113E+03  0.2916534E+03  0.2909940E+03  0.2903336E+03
+  0.2896715E+03  0.2890083E+03  0.2883431E+03  0.2876766E+03  0.2870083E+03
+  0.2863380E+03  0.2856660E+03  0.2849919E+03  0.2843154E+03  0.2836364E+03
+  0.2829557E+03  0.2822717E+03  0.2815858E+03  0.2808969E+03  0.2802049E+03
+  0.2795098E+03  0.2788117E+03  0.2781102E+03  0.2774052E+03  0.2766964E+03
+  0.2759838E+03  0.2752672E+03  0.2745464E+03  0.2738212E+03  0.2730913E+03
+  0.2723570E+03  0.2716171E+03  0.2708722E+03  0.2701218E+03  0.2693656E+03
+  0.2686034E+03  0.2678354E+03  0.2670606E+03  0.2662790E+03  0.2654903E+03
+  0.2646943E+03  0.2638908E+03  0.2630790E+03  0.2622589E+03  0.2614301E+03
+  0.2605925E+03  0.2597454E+03  0.2588885E+03  0.2580215E+03  0.2571438E+03
+  0.2562556E+03  0.2553557E+03  0.2544443E+03  0.2535207E+03  0.2525848E+03
+  0.2516357E+03  0.2506733E+03  0.2496977E+03  0.2487080E+03  0.2477039E+03
+  0.2466852E+03  0.2456517E+03  0.2446033E+03  0.2435395E+03  0.2424604E+03
+  0.2413660E+03  0.2402560E+03  0.2391310E+03  0.2379908E+03  0.2368356E+03
+  0.2356660E+03  0.2344823E+03  0.2332850E+03  0.2320747E+03  0.2308521E+03
+  0.2296178E+03  0.2283729E+03  0.2271181E+03  0.2258544E+03  0.2245827E+03
+  0.2233041E+03  0.2220195E+03  0.2207299E+03  0.2194362E+03  0.2181396E+03
+  0.2168410E+03  0.2155412E+03  0.2142410E+03  0.2129414E+03  0.2116430E+03
+  0.2103465E+03  0.2090528E+03  0.2077621E+03  0.2064752E+03  0.2051926E+03
+  0.2039146E+03  0.2026416E+03  0.2013741E+03  0.2001122E+03  0.1988562E+03
+  0.1976065E+03  0.1963631E+03  0.1951262E+03  0.1938960E+03  0.1926727E+03
+  0.1914562E+03  0.1902467E+03  0.1890442E+03  0.1878488E+03  0.1866605E+03
+  0.1854793E+03  0.1843053E+03  0.1831385E+03  0.1819788E+03  0.1808263E+03
+  0.1796809E+03  0.1785426E+03  0.1774114E+03  0.1762873E+03  0.1751702E+03
+  0.3128071E+03  0.3121589E+03  0.3115114E+03  0.3108642E+03  0.3102178E+03
+  0.3095710E+03  0.3089251E+03  0.3082799E+03  0.3076342E+03  0.3069896E+03
+  0.3063443E+03  0.3056997E+03  0.3050549E+03  0.3044106E+03  0.3037659E+03
+  0.3031212E+03  0.3024767E+03  0.3018320E+03  0.3011873E+03  0.3005420E+03
+  0.2998965E+03  0.2992505E+03  0.2986049E+03  0.2979580E+03  0.2973111E+03
+  0.2966635E+03  0.2960150E+03  0.2953665E+03  0.2947167E+03  0.2940664E+03
+  0.2934148E+03  0.2927626E+03  0.2921093E+03  0.2914551E+03  0.2907995E+03
+  0.2901423E+03  0.2894843E+03  0.2888244E+03  0.2881634E+03  0.2875005E+03
+  0.2868360E+03  0.2861699E+03  0.2855016E+03  0.2848315E+03  0.2841594E+03
+  0.2834851E+03  0.2828081E+03  0.2821289E+03  0.2814473E+03  0.2807625E+03
+  0.2800750E+03  0.2793848E+03  0.2786912E+03  0.2779944E+03  0.2772940E+03
+  0.2765905E+03  0.2758830E+03  0.2751715E+03  0.2744560E+03  0.2737361E+03
+  0.2730118E+03  0.2722828E+03  0.2715489E+03  0.2708099E+03  0.2700655E+03
+  0.2693154E+03  0.2685595E+03  0.2677978E+03  0.2670295E+03  0.2662547E+03
+  0.2654729E+03  0.2646840E+03  0.2638877E+03  0.2630832E+03  0.2622709E+03
+  0.2614498E+03  0.2606200E+03  0.2597811E+03  0.2589326E+03  0.2580739E+03
+  0.2572054E+03  0.2563258E+03  0.2554353E+03  0.2545333E+03  0.2536191E+03
+  0.2526929E+03  0.2517540E+03  0.2508020E+03  0.2498364E+03  0.2488571E+03
+  0.2478639E+03  0.2468560E+03  0.2458333E+03  0.2447957E+03  0.2437431E+03
+  0.2426750E+03  0.2415915E+03  0.2404926E+03  0.2393783E+03  0.2382486E+03
+  0.2371041E+03  0.2359446E+03  0.2347709E+03  0.2335831E+03  0.2323820E+03
+  0.2311681E+03  0.2299423E+03  0.2287052E+03  0.2274576E+03  0.2262006E+03
+  0.2249351E+03  0.2236620E+03  0.2223825E+03  0.2210973E+03  0.2198076E+03
+  0.2185144E+03  0.2172186E+03  0.2159210E+03  0.2146228E+03  0.2133246E+03
+  0.2120272E+03  0.2107315E+03  0.2094380E+03  0.2081474E+03  0.2068602E+03
+  0.2055770E+03  0.2042982E+03  0.2030243E+03  0.2017556E+03  0.2004924E+03
+  0.1992350E+03  0.1979837E+03  0.1967386E+03  0.1955000E+03  0.1942680E+03
+  0.1930427E+03  0.1918243E+03  0.1906128E+03  0.1894083E+03  0.1882108E+03
+  0.1870204E+03  0.1858372E+03  0.1846611E+03  0.1834921E+03  0.1823303E+03
+  0.1811756E+03  0.1800281E+03  0.1788877E+03  0.1777543E+03  0.1766281E+03
+  0.3131504E+03  0.3125046E+03  0.3118590E+03  0.3112147E+03  0.3105700E+03
+  0.3099263E+03  0.3092831E+03  0.3086396E+03  0.3079973E+03  0.3073546E+03
+  0.3067126E+03  0.3060706E+03  0.3054288E+03  0.3047875E+03  0.3041456E+03
+  0.3035043E+03  0.3028625E+03  0.3022212E+03  0.3015793E+03  0.3009377E+03
+  0.3002956E+03  0.2996530E+03  0.2990109E+03  0.2983677E+03  0.2977245E+03
+  0.2970807E+03  0.2964365E+03  0.2957914E+03  0.2951460E+03  0.2944995E+03
+  0.2938525E+03  0.2932048E+03  0.2925558E+03  0.2919060E+03  0.2912550E+03
+  0.2906030E+03  0.2899500E+03  0.2892951E+03  0.2886395E+03  0.2879818E+03
+  0.2873231E+03  0.2866624E+03  0.2859998E+03  0.2853359E+03  0.2846699E+03
+  0.2840015E+03  0.2833312E+03  0.2826585E+03  0.2819833E+03  0.2813060E+03
+  0.2806261E+03  0.2799431E+03  0.2792573E+03  0.2785683E+03  0.2778763E+03
+  0.2771809E+03  0.2764820E+03  0.2757794E+03  0.2750730E+03  0.2743626E+03
+  0.2736482E+03  0.2729292E+03  0.2722058E+03  0.2714776E+03  0.2707443E+03
+  0.2700058E+03  0.2692617E+03  0.2685121E+03  0.2677566E+03  0.2669948E+03
+  0.2662265E+03  0.2654515E+03  0.2646694E+03  0.2638802E+03  0.2630831E+03
+  0.2622781E+03  0.2614651E+03  0.2606429E+03  0.2598118E+03  0.2589716E+03
+  0.2581216E+03  0.2572614E+03  0.2563911E+03  0.2555093E+03  0.2546165E+03
+  0.2537119E+03  0.2527954E+03  0.2518661E+03  0.2509243E+03  0.2499692E+03
+  0.2490002E+03  0.2480173E+03  0.2470203E+03  0.2460085E+03  0.2449818E+03
+  0.2439400E+03  0.2428830E+03  0.2418104E+03  0.2407225E+03  0.2396191E+03
+  0.2385003E+03  0.2373663E+03  0.2362171E+03  0.2350536E+03  0.2338756E+03
+  0.2326840E+03  0.2314791E+03  0.2302617E+03  0.2290327E+03  0.2277927E+03
+  0.2265428E+03  0.2252838E+03  0.2240166E+03  0.2227423E+03  0.2214619E+03
+  0.2201764E+03  0.2188868E+03  0.2175941E+03  0.2162993E+03  0.2150031E+03
+  0.2137066E+03  0.2124105E+03  0.2111156E+03  0.2098226E+03  0.2085321E+03
+  0.2072448E+03  0.2059612E+03  0.2046818E+03  0.2034070E+03  0.2021372E+03
+  0.2008728E+03  0.1996141E+03  0.1983612E+03  0.1971146E+03  0.1958743E+03
+  0.1946405E+03  0.1934133E+03  0.1921930E+03  0.1909795E+03  0.1897730E+03
+  0.1885734E+03  0.1873810E+03  0.1861957E+03  0.1850174E+03  0.1838464E+03
+  0.1826824E+03  0.1815256E+03  0.1803759E+03  0.1792334E+03  0.1780979E+03
+  0.3134879E+03  0.3128444E+03  0.3122015E+03  0.3115587E+03  0.3109171E+03
+  0.3102758E+03  0.3096345E+03  0.3089943E+03  0.3083537E+03  0.3077141E+03
+  0.3070745E+03  0.3064355E+03  0.3057964E+03  0.3051576E+03  0.3045187E+03
+  0.3038800E+03  0.3032418E+03  0.3026031E+03  0.3019646E+03  0.3013264E+03
+  0.3006873E+03  0.3000485E+03  0.2994093E+03  0.2987702E+03  0.2981299E+03
+  0.2974900E+03  0.2968494E+03  0.2962082E+03  0.2955669E+03  0.2949243E+03
+  0.2942814E+03  0.2936377E+03  0.2929928E+03  0.2923480E+03  0.2917013E+03
+  0.2910540E+03  0.2904054E+03  0.2897557E+03  0.2891048E+03  0.2884525E+03
+  0.2877991E+03  0.2871436E+03  0.2864869E+03  0.2858284E+03  0.2851682E+03
+  0.2845058E+03  0.2838417E+03  0.2831756E+03  0.2825071E+03  0.2818364E+03
+  0.2811631E+03  0.2804872E+03  0.2798087E+03  0.2791274E+03  0.2784431E+03
+  0.2777556E+03  0.2770651E+03  0.2763710E+03  0.2756734E+03  0.2749721E+03
+  0.2742668E+03  0.2735575E+03  0.2728439E+03  0.2721259E+03  0.2714032E+03
+  0.2706757E+03  0.2699431E+03  0.2692049E+03  0.2684613E+03  0.2677117E+03
+  0.2669563E+03  0.2661946E+03  0.2654263E+03  0.2646510E+03  0.2638688E+03
+  0.2630788E+03  0.2622809E+03  0.2614755E+03  0.2606611E+03  0.2598381E+03
+  0.2590059E+03  0.2581643E+03  0.2573126E+03  0.2564506E+03  0.2555780E+03
+  0.2546943E+03  0.2537990E+03  0.2528921E+03  0.2519729E+03  0.2510407E+03
+  0.2500956E+03  0.2491371E+03  0.2481647E+03  0.2471781E+03  0.2461770E+03
+  0.2451614E+03  0.2441305E+03  0.2430844E+03  0.2420230E+03  0.2409462E+03
+  0.2398536E+03  0.2387456E+03  0.2376223E+03  0.2364838E+03  0.2353303E+03
+  0.2341624E+03  0.2329803E+03  0.2317847E+03  0.2305762E+03  0.2293555E+03
+  0.2281235E+03  0.2268808E+03  0.2256286E+03  0.2243676E+03  0.2230990E+03
+  0.2218237E+03  0.2205427E+03  0.2192570E+03  0.2179678E+03  0.2166758E+03
+  0.2153820E+03  0.2140874E+03  0.2127927E+03  0.2114989E+03  0.2102066E+03
+  0.2089164E+03  0.2076292E+03  0.2063453E+03  0.2050654E+03  0.2037898E+03
+  0.2025191E+03  0.2012536E+03  0.1999935E+03  0.1987393E+03  0.1974910E+03
+  0.1962490E+03  0.1950135E+03  0.1937845E+03  0.1925623E+03  0.1913468E+03
+  0.1901383E+03  0.1889368E+03  0.1877423E+03  0.1865548E+03  0.1853745E+03
+  0.1842013E+03  0.1830352E+03  0.1818763E+03  0.1807245E+03  0.1795798E+03
+  0.3138205E+03  0.3131791E+03  0.3125380E+03  0.3118984E+03  0.3112584E+03
+  0.3106193E+03  0.3099809E+03  0.3093425E+03  0.3087050E+03  0.3080672E+03
+  0.3074305E+03  0.3067943E+03  0.3061576E+03  0.3055215E+03  0.3048855E+03
+  0.3042497E+03  0.3036142E+03  0.3029786E+03  0.3023435E+03  0.3017075E+03
+  0.3010721E+03  0.3004362E+03  0.2998004E+03  0.2991643E+03  0.2985278E+03
+  0.2978913E+03  0.2972543E+03  0.2966171E+03  0.2959790E+03  0.2953407E+03
+  0.2947018E+03  0.2940620E+03  0.2934217E+03  0.2927804E+03  0.2921385E+03
+  0.2914957E+03  0.2908515E+03  0.2902067E+03  0.2895603E+03  0.2889127E+03
+  0.2882644E+03  0.2876142E+03  0.2869630E+03  0.2863098E+03  0.2856549E+03
+  0.2849984E+03  0.2843405E+03  0.2836804E+03  0.2830181E+03  0.2823534E+03
+  0.2816867E+03  0.2810179E+03  0.2803465E+03  0.2796724E+03  0.2789953E+03
+  0.2783156E+03  0.2776328E+03  0.2769467E+03  0.2762573E+03  0.2755647E+03
+  0.2748683E+03  0.2741682E+03  0.2734639E+03  0.2727558E+03  0.2720428E+03
+  0.2713256E+03  0.2706035E+03  0.2698766E+03  0.2691444E+03  0.2684067E+03
+  0.2676637E+03  0.2669141E+03  0.2661589E+03  0.2653971E+03  0.2646284E+03
+  0.2638532E+03  0.2630704E+03  0.2622798E+03  0.2614815E+03  0.2606749E+03
+  0.2598593E+03  0.2590353E+03  0.2582016E+03  0.2573585E+03  0.2565049E+03
+  0.2556413E+03  0.2547664E+03  0.2538806E+03  0.2529831E+03  0.2520732E+03
+  0.2511510E+03  0.2502160E+03  0.2492675E+03  0.2483056E+03  0.2473297E+03
+  0.2463392E+03  0.2453342E+03  0.2443144E+03  0.2432793E+03  0.2422289E+03
+  0.2411630E+03  0.2400815E+03  0.2389844E+03  0.2378719E+03  0.2367440E+03
+  0.2356009E+03  0.2344432E+03  0.2332709E+03  0.2320849E+03  0.2308854E+03
+  0.2296734E+03  0.2284494E+03  0.2272144E+03  0.2259693E+03  0.2247149E+03
+  0.2234522E+03  0.2221822E+03  0.2209061E+03  0.2196247E+03  0.2183391E+03
+  0.2170502E+03  0.2157591E+03  0.2144666E+03  0.2131737E+03  0.2118811E+03
+  0.2105897E+03  0.2093000E+03  0.2080130E+03  0.2067290E+03  0.2054486E+03
+  0.2041725E+03  0.2029009E+03  0.2016343E+03  0.2003730E+03  0.1991174E+03
+  0.1978677E+03  0.1966241E+03  0.1953868E+03  0.1941561E+03  0.1929320E+03
+  0.1917146E+03  0.1905041E+03  0.1893006E+03  0.1881040E+03  0.1869145E+03
+  0.1857321E+03  0.1845568E+03  0.1833886E+03  0.1822276E+03  0.1810736E+03
+  0.3141481E+03  0.3135089E+03  0.3128702E+03  0.3122318E+03  0.3115943E+03
+  0.3109576E+03  0.3103210E+03  0.3096855E+03  0.3090501E+03  0.3084149E+03
+  0.3077809E+03  0.3071463E+03  0.3065129E+03  0.3058790E+03  0.3052459E+03
+  0.3046131E+03  0.3039799E+03  0.3033476E+03  0.3027147E+03  0.3020822E+03
+  0.3014498E+03  0.3008171E+03  0.3001846E+03  0.2995515E+03  0.2989186E+03
+  0.2982850E+03  0.2976519E+03  0.2970179E+03  0.2963835E+03  0.2957490E+03
+  0.2951137E+03  0.2944779E+03  0.2938414E+03  0.2932043E+03  0.2925666E+03
+  0.2919277E+03  0.2912882E+03  0.2906477E+03  0.2900061E+03  0.2893637E+03
+  0.2887196E+03  0.2880746E+03  0.2874283E+03  0.2867802E+03  0.2861312E+03
+  0.2854802E+03  0.2848279E+03  0.2841734E+03  0.2835168E+03  0.2828586E+03
+  0.2821984E+03  0.2815357E+03  0.2808711E+03  0.2802035E+03  0.2795338E+03
+  0.2788613E+03  0.2781858E+03  0.2775075E+03  0.2768262E+03  0.2761416E+03
+  0.2754535E+03  0.2747619E+03  0.2740666E+03  0.2733676E+03  0.2726645E+03
+  0.2719570E+03  0.2712451E+03  0.2705285E+03  0.2698069E+03  0.2690807E+03
+  0.2683490E+03  0.2676117E+03  0.2668689E+03  0.2661196E+03  0.2653641E+03
+  0.2646022E+03  0.2638336E+03  0.2630577E+03  0.2622743E+03  0.2614831E+03
+  0.2606840E+03  0.2598763E+03  0.2590599E+03  0.2582345E+03  0.2573994E+03
+  0.2565545E+03  0.2556993E+03  0.2548335E+03  0.2539567E+03  0.2530683E+03
+  0.2521680E+03  0.2512555E+03  0.2503304E+03  0.2493923E+03  0.2484403E+03
+  0.2474749E+03  0.2464952E+03  0.2455009E+03  0.2444917E+03  0.2434677E+03
+  0.2424282E+03  0.2413733E+03  0.2403028E+03  0.2392169E+03  0.2381152E+03
+  0.2369979E+03  0.2358655E+03  0.2347180E+03  0.2335558E+03  0.2323794E+03
+  0.2311892E+03  0.2299861E+03  0.2287706E+03  0.2275435E+03  0.2263057E+03
+  0.2250582E+03  0.2238018E+03  0.2225375E+03  0.2212665E+03  0.2199896E+03
+  0.2187080E+03  0.2174226E+03  0.2161344E+03  0.2148443E+03  0.2135533E+03
+  0.2122622E+03  0.2109718E+03  0.2096830E+03  0.2083962E+03  0.2071122E+03
+  0.2058317E+03  0.2045550E+03  0.2032826E+03  0.2020151E+03  0.2007527E+03
+  0.1994958E+03  0.1982446E+03  0.1969995E+03  0.1957606E+03  0.1945281E+03
+  0.1933021E+03  0.1920829E+03  0.1908705E+03  0.1896649E+03  0.1884664E+03
+  0.1872748E+03  0.1860903E+03  0.1849129E+03  0.1837426E+03  0.1825794E+03
+  0.3144706E+03  0.3138331E+03  0.3131963E+03  0.3125606E+03  0.3119251E+03
+  0.3112902E+03  0.3106564E+03  0.3100224E+03  0.3093898E+03  0.3087573E+03
+  0.3081248E+03  0.3074932E+03  0.3068618E+03  0.3062308E+03  0.3056004E+03
+  0.3049701E+03  0.3043398E+03  0.3037099E+03  0.3030800E+03  0.3024505E+03
+  0.3018207E+03  0.3011914E+03  0.3005616E+03  0.2999321E+03  0.2993021E+03
+  0.2986717E+03  0.2980417E+03  0.2974110E+03  0.2967805E+03  0.2961492E+03
+  0.2955176E+03  0.2948860E+03  0.2942530E+03  0.2936200E+03  0.2929861E+03
+  0.2923513E+03  0.2917163E+03  0.2910798E+03  0.2904427E+03  0.2898046E+03
+  0.2891653E+03  0.2885251E+03  0.2878833E+03  0.2872405E+03  0.2865965E+03
+  0.2859507E+03  0.2853036E+03  0.2846546E+03  0.2840040E+03  0.2833520E+03
+  0.2826975E+03  0.2820411E+03  0.2813824E+03  0.2807218E+03  0.2800587E+03
+  0.2793931E+03  0.2787245E+03  0.2780539E+03  0.2773799E+03  0.2767032E+03
+  0.2760232E+03  0.2753399E+03  0.2746530E+03  0.2739628E+03  0.2732686E+03
+  0.2725705E+03  0.2718682E+03  0.2711616E+03  0.2704505E+03  0.2697345E+03
+  0.2690138E+03  0.2682878E+03  0.2675565E+03  0.2668196E+03  0.2660768E+03
+  0.2653275E+03  0.2645721E+03  0.2638102E+03  0.2630411E+03  0.2622646E+03
+  0.2614806E+03  0.2606888E+03  0.2598887E+03  0.2590800E+03  0.2582625E+03
+  0.2574352E+03  0.2565990E+03  0.2557523E+03  0.2548953E+03  0.2540272E+03
+  0.2531480E+03  0.2522572E+03  0.2513542E+03  0.2504388E+03  0.2495106E+03
+  0.2485692E+03  0.2476138E+03  0.2466446E+03  0.2456611E+03  0.2446627E+03
+  0.2436495E+03  0.2426210E+03  0.2415772E+03  0.2405177E+03  0.2394427E+03
+  0.2383519E+03  0.2372456E+03  0.2361237E+03  0.2349866E+03  0.2338347E+03
+  0.2326682E+03  0.2314875E+03  0.2302935E+03  0.2290867E+03  0.2278678E+03
+  0.2266378E+03  0.2253974E+03  0.2241476E+03  0.2228893E+03  0.2216237E+03
+  0.2203517E+03  0.2190744E+03  0.2177927E+03  0.2165077E+03  0.2152203E+03
+  0.2139315E+03  0.2126421E+03  0.2113531E+03  0.2100650E+03  0.2087788E+03
+  0.2074951E+03  0.2062144E+03  0.2049373E+03  0.2036643E+03  0.2023959E+03
+  0.2011325E+03  0.1998744E+03  0.1986218E+03  0.1973752E+03  0.1961347E+03
+  0.1949005E+03  0.1936728E+03  0.1924517E+03  0.1912374E+03  0.1900299E+03
+  0.1888293E+03  0.1876357E+03  0.1864491E+03  0.1852696E+03  0.1840972E+03
+  0.3147881E+03  0.3141526E+03  0.3135178E+03  0.3128837E+03  0.3122507E+03
+  0.3116180E+03  0.3109859E+03  0.3103548E+03  0.3097237E+03  0.3090932E+03
+  0.3084637E+03  0.3078343E+03  0.3072055E+03  0.3065770E+03  0.3059487E+03
+  0.3053212E+03  0.3046935E+03  0.3040662E+03  0.3034393E+03  0.3028120E+03
+  0.3021855E+03  0.3015584E+03  0.3009320E+03  0.3003055E+03  0.2996783E+03
+  0.2990516E+03  0.2984244E+03  0.2977974E+03  0.2971699E+03  0.2965420E+03
+  0.2959142E+03  0.2952855E+03  0.2946565E+03  0.2940271E+03  0.2933971E+03
+  0.2927666E+03  0.2921353E+03  0.2915032E+03  0.2908705E+03  0.2902363E+03
+  0.2896019E+03  0.2889659E+03  0.2883290E+03  0.2876911E+03  0.2870517E+03
+  0.2864109E+03  0.2857691E+03  0.2851255E+03  0.2844804E+03  0.2838337E+03
+  0.2831848E+03  0.2825345E+03  0.2818820E+03  0.2812275E+03  0.2805711E+03
+  0.2799117E+03  0.2792504E+03  0.2785864E+03  0.2779198E+03  0.2772503E+03
+  0.2765779E+03  0.2759024E+03  0.2752236E+03  0.2745418E+03  0.2738563E+03
+  0.2731671E+03  0.2724738E+03  0.2717768E+03  0.2710755E+03  0.2703697E+03
+  0.2696591E+03  0.2689436E+03  0.2682235E+03  0.2674980E+03  0.2667671E+03
+  0.2660302E+03  0.2652872E+03  0.2645382E+03  0.2637829E+03  0.2630205E+03
+  0.2622509E+03  0.2614739E+03  0.2606894E+03  0.2598966E+03  0.2590955E+03
+  0.2582857E+03  0.2574669E+03  0.2566382E+03  0.2558000E+03  0.2549516E+03
+  0.2540925E+03  0.2532223E+03  0.2523406E+03  0.2514471E+03  0.2505415E+03
+  0.2496231E+03  0.2486916E+03  0.2477468E+03  0.2467878E+03  0.2458147E+03
+  0.2448273E+03  0.2438248E+03  0.2428074E+03  0.2417745E+03  0.2407261E+03
+  0.2396620E+03  0.2385822E+03  0.2374868E+03  0.2363757E+03  0.2352493E+03
+  0.2341076E+03  0.2329511E+03  0.2317803E+03  0.2305956E+03  0.2293977E+03
+  0.2281874E+03  0.2269653E+03  0.2257323E+03  0.2244894E+03  0.2232375E+03
+  0.2219776E+03  0.2207108E+03  0.2194380E+03  0.2181604E+03  0.2168789E+03
+  0.2155944E+03  0.2143081E+03  0.2130207E+03  0.2117331E+03  0.2104462E+03
+  0.2091607E+03  0.2078773E+03  0.2065966E+03  0.2053194E+03  0.2040459E+03
+  0.2027767E+03  0.2015124E+03  0.2002531E+03  0.1989993E+03  0.1977512E+03
+  0.1965092E+03  0.1952733E+03  0.1940439E+03  0.1928209E+03  0.1916047E+03
+  0.1903953E+03  0.1891927E+03  0.1879971E+03  0.1868085E+03  0.1856269E+03
+  0.3151007E+03  0.3144673E+03  0.3138347E+03  0.3132028E+03  0.3125714E+03
+  0.3119409E+03  0.3113111E+03  0.3106812E+03  0.3100530E+03  0.3094247E+03
+  0.3087971E+03  0.3081703E+03  0.3075434E+03  0.3069172E+03  0.3062919E+03
+  0.3056663E+03  0.3050415E+03  0.3044165E+03  0.3037917E+03  0.3031677E+03
+  0.3025434E+03  0.3019198E+03  0.3012957E+03  0.3006718E+03  0.3000481E+03
+  0.2994242E+03  0.2988004E+03  0.2981764E+03  0.2975519E+03  0.2969279E+03
+  0.2963029E+03  0.2956778E+03  0.2950528E+03  0.2944266E+03  0.2938003E+03
+  0.2931736E+03  0.2925460E+03  0.2919182E+03  0.2912891E+03  0.2906595E+03
+  0.2900292E+03  0.2893975E+03  0.2887652E+03  0.2881318E+03  0.2874969E+03
+  0.2868615E+03  0.2862242E+03  0.2855857E+03  0.2849460E+03  0.2843044E+03
+  0.2836612E+03  0.2830165E+03  0.2823699E+03  0.2817213E+03  0.2810705E+03
+  0.2804181E+03  0.2797630E+03  0.2791058E+03  0.2784460E+03  0.2777836E+03
+  0.2771183E+03  0.2764504E+03  0.2757795E+03  0.2751054E+03  0.2744279E+03
+  0.2737471E+03  0.2730625E+03  0.2723746E+03  0.2716824E+03  0.2709861E+03
+  0.2702856E+03  0.2695806E+03  0.2688709E+03  0.2681561E+03  0.2674362E+03
+  0.2667112E+03  0.2659804E+03  0.2652436E+03  0.2645008E+03  0.2637519E+03
+  0.2629960E+03  0.2622332E+03  0.2614631E+03  0.2606855E+03  0.2599002E+03
+  0.2591066E+03  0.2583044E+03  0.2574934E+03  0.2566730E+03  0.2558430E+03
+  0.2550029E+03  0.2541524E+03  0.2532912E+03  0.2524186E+03  0.2515345E+03
+  0.2506384E+03  0.2497297E+03  0.2488083E+03  0.2478732E+03  0.2469248E+03
+  0.2459623E+03  0.2449852E+03  0.2439938E+03  0.2429871E+03  0.2419653E+03
+  0.2409280E+03  0.2398749E+03  0.2388061E+03  0.2377216E+03  0.2366215E+03
+  0.2355056E+03  0.2343744E+03  0.2332283E+03  0.2320673E+03  0.2308922E+03
+  0.2297035E+03  0.2285019E+03  0.2272880E+03  0.2260628E+03  0.2248271E+03
+  0.2235818E+03  0.2223280E+03  0.2210668E+03  0.2197989E+03  0.2185256E+03
+  0.2172478E+03  0.2159666E+03  0.2146830E+03  0.2133978E+03  0.2121120E+03
+  0.2108264E+03  0.2095418E+03  0.2082589E+03  0.2069785E+03  0.2057011E+03
+  0.2044272E+03  0.2031575E+03  0.2018922E+03  0.2006320E+03  0.1993769E+03
+  0.1981275E+03  0.1968840E+03  0.1956465E+03  0.1944154E+03  0.1931907E+03
+  0.1919726E+03  0.1907613E+03  0.1895567E+03  0.1883591E+03  0.1871685E+03
+  0.3154095E+03  0.3147774E+03  0.3141463E+03  0.3135166E+03  0.3128871E+03
+  0.3122584E+03  0.3116304E+03  0.3110033E+03  0.3103764E+03  0.3097506E+03
+  0.3091255E+03  0.3085001E+03  0.3078756E+03  0.3072524E+03  0.3066284E+03
+  0.3060059E+03  0.3053832E+03  0.3047609E+03  0.3041389E+03  0.3035172E+03
+  0.3028957E+03  0.3022744E+03  0.3016532E+03  0.3010323E+03  0.3004113E+03
+  0.2997904E+03  0.2991697E+03  0.2985485E+03  0.2979274E+03  0.2973063E+03
+  0.2966844E+03  0.2960628E+03  0.2954408E+03  0.2948187E+03  0.2941957E+03
+  0.2935725E+03  0.2929489E+03  0.2923246E+03  0.2916996E+03  0.2910741E+03
+  0.2904475E+03  0.2898203E+03  0.2891926E+03  0.2885631E+03  0.2879331E+03
+  0.2873020E+03  0.2866693E+03  0.2860358E+03  0.2854011E+03  0.2847645E+03
+  0.2841266E+03  0.2834874E+03  0.2828465E+03  0.2822034E+03  0.2815588E+03
+  0.2809121E+03  0.2802632E+03  0.2796124E+03  0.2789592E+03  0.2783034E+03
+  0.2776452E+03  0.2769845E+03  0.2763208E+03  0.2756541E+03  0.2749846E+03
+  0.2743118E+03  0.2736357E+03  0.2729561E+03  0.2722728E+03  0.2715856E+03
+  0.2708944E+03  0.2701988E+03  0.2694991E+03  0.2687947E+03  0.2680858E+03
+  0.2673714E+03  0.2666519E+03  0.2659272E+03  0.2651965E+03  0.2644598E+03
+  0.2637170E+03  0.2629676E+03  0.2622116E+03  0.2614482E+03  0.2606779E+03
+  0.2598996E+03  0.2591133E+03  0.2583186E+03  0.2575153E+03  0.2567029E+03
+  0.2558810E+03  0.2550495E+03  0.2542074E+03  0.2533550E+03  0.2524914E+03
+  0.2516164E+03  0.2507296E+03  0.2498306E+03  0.2489188E+03  0.2479942E+03
+  0.2470556E+03  0.2461037E+03  0.2451372E+03  0.2441562E+03  0.2431605E+03
+  0.2421495E+03  0.2411232E+03  0.2400812E+03  0.2390234E+03  0.2379499E+03
+  0.2368607E+03  0.2357557E+03  0.2346352E+03  0.2334993E+03  0.2323485E+03
+  0.2311832E+03  0.2300039E+03  0.2288113E+03  0.2276060E+03  0.2263887E+03
+  0.2251606E+03  0.2239223E+03  0.2226750E+03  0.2214194E+03  0.2201567E+03
+  0.2188881E+03  0.2176144E+03  0.2163367E+03  0.2150560E+03  0.2137733E+03
+  0.2124895E+03  0.2112054E+03  0.2099220E+03  0.2086398E+03  0.2073598E+03
+  0.2060824E+03  0.2048083E+03  0.2035381E+03  0.2022721E+03  0.2010109E+03
+  0.1997548E+03  0.1985041E+03  0.1972591E+03  0.1960201E+03  0.1947873E+03
+  0.1935609E+03  0.1923410E+03  0.1911278E+03  0.1899213E+03  0.1887217E+03
+  0.3157130E+03  0.3150834E+03  0.3144542E+03  0.3138255E+03  0.3131980E+03
+  0.3125716E+03  0.3119454E+03  0.3113199E+03  0.3106958E+03  0.3100717E+03
+  0.3094480E+03  0.3088256E+03  0.3082034E+03  0.3075814E+03  0.3069606E+03
+  0.3063394E+03  0.3057195E+03  0.3050998E+03  0.3044800E+03  0.3038611E+03
+  0.3032421E+03  0.3026230E+03  0.3020051E+03  0.3013864E+03  0.3007679E+03
+  0.3001503E+03  0.2995319E+03  0.2989139E+03  0.2982960E+03  0.2976775E+03
+  0.2970594E+03  0.2964408E+03  0.2958221E+03  0.2952031E+03  0.2945836E+03
+  0.2939640E+03  0.2933439E+03  0.2927231E+03  0.2921021E+03  0.2914801E+03
+  0.2908577E+03  0.2902348E+03  0.2896105E+03  0.2889857E+03  0.2883603E+03
+  0.2877330E+03  0.2871052E+03  0.2864765E+03  0.2858466E+03  0.2852146E+03
+  0.2845821E+03  0.2839478E+03  0.2833122E+03  0.2826746E+03  0.2820356E+03
+  0.2813945E+03  0.2807517E+03  0.2801068E+03  0.2794598E+03  0.2788106E+03
+  0.2781588E+03  0.2775050E+03  0.2768482E+03  0.2761890E+03  0.2755269E+03
+  0.2748616E+03  0.2741934E+03  0.2735219E+03  0.2728470E+03  0.2721683E+03
+  0.2714861E+03  0.2708000E+03  0.2701095E+03  0.2694148E+03  0.2687157E+03
+  0.2680120E+03  0.2673034E+03  0.2665895E+03  0.2658704E+03  0.2651461E+03
+  0.2644153E+03  0.2636785E+03  0.2629357E+03  0.2621861E+03  0.2614295E+03
+  0.2606660E+03  0.2598948E+03  0.2591157E+03  0.2583283E+03  0.2575327E+03
+  0.2567282E+03  0.2559142E+03  0.2550906E+03  0.2542573E+03  0.2534134E+03
+  0.2525587E+03  0.2516927E+03  0.2508154E+03  0.2499256E+03  0.2490238E+03
+  0.2481087E+03  0.2471807E+03  0.2462386E+03  0.2452830E+03  0.2443125E+03
+  0.2433275E+03  0.2423275E+03  0.2413119E+03  0.2402809E+03  0.2392343E+03
+  0.2381719E+03  0.2370936E+03  0.2359994E+03  0.2348896E+03  0.2337643E+03
+  0.2326238E+03  0.2314684E+03  0.2302988E+03  0.2291154E+03  0.2279189E+03
+  0.2267100E+03  0.2254897E+03  0.2242586E+03  0.2230179E+03  0.2217685E+03
+  0.2205115E+03  0.2192477E+03  0.2179784E+03  0.2167045E+03  0.2154271E+03
+  0.2141471E+03  0.2128655E+03  0.2115833E+03  0.2103011E+03  0.2090199E+03
+  0.2077404E+03  0.2064633E+03  0.2051891E+03  0.2039185E+03  0.2026519E+03
+  0.2013899E+03  0.2001327E+03  0.1988808E+03  0.1976345E+03  0.1963940E+03
+  0.1951596E+03  0.1939315E+03  0.1927098E+03  0.1914948E+03  0.1902864E+03
+  0.3160123E+03  0.3153843E+03  0.3147570E+03  0.3141306E+03  0.3135045E+03
+  0.3128797E+03  0.3122556E+03  0.3116322E+03  0.3110094E+03  0.3103876E+03
+  0.3097663E+03  0.3091454E+03  0.3085257E+03  0.3079062E+03  0.3072867E+03
+  0.3066685E+03  0.3060503E+03  0.3054329E+03  0.3048157E+03  0.3041989E+03
+  0.3035821E+03  0.3029664E+03  0.3023499E+03  0.3017346E+03  0.3011190E+03
+  0.3005036E+03  0.2998883E+03  0.2992732E+03  0.2986578E+03  0.2980425E+03
+  0.2974273E+03  0.2968117E+03  0.2961964E+03  0.2955803E+03  0.2949644E+03
+  0.2943481E+03  0.2937313E+03  0.2931143E+03  0.2924967E+03  0.2918784E+03
+  0.2912599E+03  0.2906405E+03  0.2900204E+03  0.2893999E+03  0.2887782E+03
+  0.2881554E+03  0.2875325E+03  0.2869079E+03  0.2862822E+03  0.2856557E+03
+  0.2850273E+03  0.2843982E+03  0.2837674E+03  0.2831351E+03  0.2825017E+03
+  0.2818661E+03  0.2812288E+03  0.2805897E+03  0.2799486E+03  0.2793055E+03
+  0.2786603E+03  0.2780127E+03  0.2773627E+03  0.2767102E+03  0.2760550E+03
+  0.2753972E+03  0.2747365E+03  0.2740726E+03  0.2734057E+03  0.2727354E+03
+  0.2720614E+03  0.2713839E+03  0.2707026E+03  0.2700173E+03  0.2693279E+03
+  0.2686339E+03  0.2679355E+03  0.2672324E+03  0.2665242E+03  0.2658106E+03
+  0.2650917E+03  0.2643676E+03  0.2636367E+03  0.2629001E+03  0.2621570E+03
+  0.2614069E+03  0.2606502E+03  0.2598860E+03  0.2591140E+03  0.2583341E+03
+  0.2575455E+03  0.2567487E+03  0.2559427E+03  0.2551273E+03  0.2543020E+03
+  0.2534667E+03  0.2526208E+03  0.2517638E+03  0.2508954E+03  0.2500151E+03
+  0.2491227E+03  0.2482177E+03  0.2472994E+03  0.2463678E+03  0.2454220E+03
+  0.2444625E+03  0.2434880E+03  0.2424988E+03  0.2414942E+03  0.2404743E+03
+  0.2394388E+03  0.2383874E+03  0.2373199E+03  0.2362368E+03  0.2351378E+03
+  0.2340231E+03  0.2328931E+03  0.2317478E+03  0.2305880E+03  0.2294141E+03
+  0.2282267E+03  0.2270264E+03  0.2258141E+03  0.2245906E+03  0.2233569E+03
+  0.2221140E+03  0.2208627E+03  0.2196043E+03  0.2183396E+03  0.2170699E+03
+  0.2157960E+03  0.2145190E+03  0.2132400E+03  0.2119597E+03  0.2106792E+03
+  0.2093991E+03  0.2081204E+03  0.2068436E+03  0.2055695E+03  0.2042987E+03
+  0.2030316E+03  0.2017688E+03  0.2005107E+03  0.1992577E+03  0.1980101E+03
+  0.1967682E+03  0.1955323E+03  0.1943025E+03  0.1930791E+03  0.1918622E+03
+  0.3163077E+03  0.3156807E+03  0.3150552E+03  0.3144307E+03  0.3138067E+03
+  0.3131835E+03  0.3125612E+03  0.3119397E+03  0.3113191E+03  0.3106985E+03
+  0.3100795E+03  0.3094609E+03  0.3088427E+03  0.3082252E+03  0.3076084E+03
+  0.3069920E+03  0.3063760E+03  0.3057608E+03  0.3051458E+03  0.3045313E+03
+  0.3039175E+03  0.3033031E+03  0.3026901E+03  0.3020770E+03  0.3014637E+03
+  0.3008512E+03  0.3002383E+03  0.2996259E+03  0.2990135E+03  0.2984009E+03
+  0.2977886E+03  0.2971762E+03  0.2965635E+03  0.2959512E+03  0.2953382E+03
+  0.2947248E+03  0.2941117E+03  0.2934978E+03  0.2928837E+03  0.2922693E+03
+  0.2916541E+03  0.2910384E+03  0.2904225E+03  0.2898054E+03  0.2891876E+03
+  0.2885696E+03  0.2879503E+03  0.2873296E+03  0.2867089E+03  0.2860867E+03
+  0.2854632E+03  0.2848386E+03  0.2842126E+03  0.2835854E+03  0.2829572E+03
+  0.2823264E+03  0.2816948E+03  0.2810613E+03  0.2804259E+03  0.2797885E+03
+  0.2791497E+03  0.2785082E+03  0.2778645E+03  0.2772186E+03  0.2765702E+03
+  0.2759193E+03  0.2752656E+03  0.2746091E+03  0.2739497E+03  0.2732873E+03
+  0.2726213E+03  0.2719521E+03  0.2712796E+03  0.2706029E+03  0.2699225E+03
+  0.2692381E+03  0.2685496E+03  0.2678561E+03  0.2671585E+03  0.2664557E+03
+  0.2657478E+03  0.2650345E+03  0.2643160E+03  0.2635914E+03  0.2628611E+03
+  0.2621242E+03  0.2613806E+03  0.2606305E+03  0.2598730E+03  0.2591081E+03
+  0.2583354E+03  0.2575544E+03  0.2567647E+03  0.2559668E+03  0.2551592E+03
+  0.2543421E+03  0.2535153E+03  0.2526777E+03  0.2518295E+03  0.2509701E+03
+  0.2500991E+03  0.2492160E+03  0.2483207E+03  0.2474125E+03  0.2464907E+03
+  0.2455555E+03  0.2446059E+03  0.2436424E+03  0.2426637E+03  0.2416701E+03
+  0.2406611E+03  0.2396364E+03  0.2385961E+03  0.2375400E+03  0.2364677E+03
+  0.2353796E+03  0.2342757E+03  0.2331562E+03  0.2320213E+03  0.2308716E+03
+  0.2297073E+03  0.2285292E+03  0.2273378E+03  0.2261338E+03  0.2249183E+03
+  0.2236918E+03  0.2224556E+03  0.2212106E+03  0.2199577E+03  0.2186980E+03
+  0.2174327E+03  0.2161627E+03  0.2148890E+03  0.2136127E+03  0.2123347E+03
+  0.2110559E+03  0.2097773E+03  0.2084995E+03  0.2072233E+03  0.2059494E+03
+  0.2046785E+03  0.2034111E+03  0.2021477E+03  0.2008887E+03  0.1996347E+03
+  0.1983859E+03  0.1971427E+03  0.1959053E+03  0.1946739E+03  0.1934488E+03
+  0.3165989E+03  0.3159736E+03  0.3153493E+03  0.3147262E+03  0.3141041E+03
+  0.3134830E+03  0.3128623E+03  0.3122425E+03  0.3116233E+03  0.3110055E+03
+  0.3103882E+03  0.3097708E+03  0.3091550E+03  0.3085395E+03  0.3079247E+03
+  0.3073105E+03  0.3066969E+03  0.3060834E+03  0.3054710E+03  0.3048587E+03
+  0.3042465E+03  0.3036353E+03  0.3030241E+03  0.3024133E+03  0.3018029E+03
+  0.3011926E+03  0.3005826E+03  0.2999726E+03  0.2993629E+03  0.2987535E+03
+  0.2981440E+03  0.2975340E+03  0.2969245E+03  0.2963148E+03  0.2957047E+03
+  0.2950950E+03  0.2944847E+03  0.2938741E+03  0.2932637E+03  0.2926523E+03
+  0.2920406E+03  0.2914289E+03  0.2908161E+03  0.2902028E+03  0.2895892E+03
+  0.2889748E+03  0.2883593E+03  0.2877437E+03  0.2871267E+03  0.2865085E+03
+  0.2858894E+03  0.2852697E+03  0.2846482E+03  0.2840257E+03  0.2834025E+03
+  0.2827771E+03  0.2821504E+03  0.2815222E+03  0.2808922E+03  0.2802603E+03
+  0.2796271E+03  0.2789917E+03  0.2783541E+03  0.2777145E+03  0.2770725E+03
+  0.2764282E+03  0.2757813E+03  0.2751319E+03  0.2744795E+03  0.2738244E+03
+  0.2731665E+03  0.2725052E+03  0.2718405E+03  0.2711725E+03  0.2705007E+03
+  0.2698250E+03  0.2691456E+03  0.2684620E+03  0.2677742E+03  0.2670813E+03
+  0.2663843E+03  0.2656818E+03  0.2649742E+03  0.2642614E+03  0.2635430E+03
+  0.2628185E+03  0.2620879E+03  0.2613507E+03  0.2606070E+03  0.2598563E+03
+  0.2590982E+03  0.2583325E+03  0.2575589E+03  0.2567767E+03  0.2559860E+03
+  0.2551864E+03  0.2543773E+03  0.2535586E+03  0.2527296E+03  0.2518901E+03
+  0.2510393E+03  0.2501776E+03  0.2493039E+03  0.2484182E+03  0.2475194E+03
+  0.2466078E+03  0.2456826E+03  0.2447436E+03  0.2437905E+03  0.2428226E+03
+  0.2418396E+03  0.2408415E+03  0.2398279E+03  0.2387986E+03  0.2377534E+03
+  0.2366922E+03  0.2356151E+03  0.2345220E+03  0.2334132E+03  0.2322889E+03
+  0.2311492E+03  0.2299949E+03  0.2288262E+03  0.2276439E+03  0.2264486E+03
+  0.2252412E+03  0.2240224E+03  0.2227932E+03  0.2215547E+03  0.2203077E+03
+  0.2190534E+03  0.2177928E+03  0.2165269E+03  0.2152569E+03  0.2139836E+03
+  0.2127081E+03  0.2114314E+03  0.2101543E+03  0.2088776E+03  0.2076022E+03
+  0.2063288E+03  0.2050579E+03  0.2037903E+03  0.2025264E+03  0.2012668E+03
+  0.2000118E+03  0.1987619E+03  0.1975174E+03  0.1962786E+03  0.1950457E+03
+  0.3168859E+03  0.3162622E+03  0.3156398E+03  0.3150183E+03  0.3143974E+03
+  0.3137777E+03  0.3131589E+03  0.3125410E+03  0.3119236E+03  0.3113070E+03
+  0.3106920E+03  0.3100770E+03  0.3094625E+03  0.3088487E+03  0.3082362E+03
+  0.3076240E+03  0.3070121E+03  0.3064012E+03  0.3057904E+03  0.3051803E+03
+  0.3045711E+03  0.3039615E+03  0.3033528E+03  0.3027445E+03  0.3021361E+03
+  0.3015287E+03  0.3009211E+03  0.3003135E+03  0.2997066E+03  0.2990996E+03
+  0.2984925E+03  0.2978856E+03  0.2972786E+03  0.2966721E+03  0.2960652E+03
+  0.2954580E+03  0.2948509E+03  0.2942438E+03  0.2936362E+03  0.2930281E+03
+  0.2924203E+03  0.2918114E+03  0.2912024E+03  0.2905932E+03  0.2899828E+03
+  0.2893718E+03  0.2887609E+03  0.2881486E+03  0.2875354E+03  0.2869218E+03
+  0.2863074E+03  0.2856916E+03  0.2850750E+03  0.2844570E+03  0.2838379E+03
+  0.2832174E+03  0.2825958E+03  0.2819729E+03  0.2813481E+03  0.2807217E+03
+  0.2800937E+03  0.2794638E+03  0.2788322E+03  0.2781986E+03  0.2775627E+03
+  0.2769245E+03  0.2762842E+03  0.2756415E+03  0.2749962E+03  0.2743481E+03
+  0.2736973E+03  0.2730435E+03  0.2723868E+03  0.2717267E+03  0.2710629E+03
+  0.2703958E+03  0.2697253E+03  0.2690504E+03  0.2683719E+03  0.2676891E+03
+  0.2670016E+03  0.2663095E+03  0.2656128E+03  0.2649109E+03  0.2642034E+03
+  0.2634911E+03  0.2627725E+03  0.2620482E+03  0.2613172E+03  0.2605799E+03
+  0.2598357E+03  0.2590844E+03  0.2583256E+03  0.2575591E+03  0.2567842E+03
+  0.2560010E+03  0.2552090E+03  0.2544078E+03  0.2535972E+03  0.2527765E+03
+  0.2519455E+03  0.2511038E+03  0.2502506E+03  0.2493862E+03  0.2485097E+03
+  0.2476209E+03  0.2467189E+03  0.2458038E+03  0.2448750E+03  0.2439321E+03
+  0.2429749E+03  0.2420027E+03  0.2410155E+03  0.2400128E+03  0.2389944E+03
+  0.2379604E+03  0.2369103E+03  0.2358441E+03  0.2347620E+03  0.2336640E+03
+  0.2325502E+03  0.2314209E+03  0.2302766E+03  0.2291177E+03  0.2279447E+03
+  0.2267584E+03  0.2255594E+03  0.2243485E+03  0.2231268E+03  0.2218950E+03
+  0.2206543E+03  0.2194055E+03  0.2181500E+03  0.2168885E+03  0.2156224E+03
+  0.2143524E+03  0.2130798E+03  0.2118053E+03  0.2105300E+03  0.2092548E+03
+  0.2079803E+03  0.2067075E+03  0.2054369E+03  0.2041692E+03  0.2029050E+03
+  0.2016447E+03  0.2003889E+03  0.1991380E+03  0.1978923E+03  0.1966521E+03
+  0.3171682E+03  0.3165469E+03  0.3159259E+03  0.3153057E+03  0.3146868E+03
+  0.3140685E+03  0.3134512E+03  0.3128349E+03  0.3122197E+03  0.3116051E+03
+  0.3109906E+03  0.3103778E+03  0.3097657E+03  0.3091538E+03  0.3085429E+03
+  0.3079328E+03  0.3073231E+03  0.3067139E+03  0.3061053E+03  0.3054974E+03
+  0.3048898E+03  0.3042831E+03  0.3036761E+03  0.3030698E+03  0.3024645E+03
+  0.3018586E+03  0.3012536E+03  0.3006491E+03  0.3000442E+03  0.2994397E+03
+  0.2988357E+03  0.2982311E+03  0.2976269E+03  0.2970231E+03  0.2964190E+03
+  0.2958149E+03  0.2952108E+03  0.2946064E+03  0.2940020E+03  0.2933973E+03
+  0.2927923E+03  0.2921869E+03  0.2915817E+03  0.2909752E+03  0.2903686E+03
+  0.2897618E+03  0.2891539E+03  0.2885454E+03  0.2879367E+03  0.2873269E+03
+  0.2867163E+03  0.2861048E+03  0.2854924E+03  0.2848788E+03  0.2842644E+03
+  0.2836483E+03  0.2830313E+03  0.2824134E+03  0.2817935E+03  0.2811723E+03
+  0.2805497E+03  0.2799250E+03  0.2792994E+03  0.2786713E+03  0.2780411E+03
+  0.2774091E+03  0.2767749E+03  0.2761385E+03  0.2754998E+03  0.2748585E+03
+  0.2742147E+03  0.2735680E+03  0.2729185E+03  0.2722659E+03  0.2716104E+03
+  0.2709513E+03  0.2702887E+03  0.2696228E+03  0.2689531E+03  0.2682792E+03
+  0.2676013E+03  0.2669192E+03  0.2662322E+03  0.2655406E+03  0.2648446E+03
+  0.2641426E+03  0.2634358E+03  0.2627233E+03  0.2620047E+03  0.2612803E+03
+  0.2605491E+03  0.2598113E+03  0.2590666E+03  0.2583147E+03  0.2575552E+03
+  0.2567874E+03  0.2560116E+03  0.2552272E+03  0.2544340E+03  0.2536310E+03
+  0.2528186E+03  0.2519959E+03  0.2511627E+03  0.2503187E+03  0.2494632E+03
+  0.2485959E+03  0.2477164E+03  0.2468243E+03  0.2459191E+03  0.2450003E+03
+  0.2440679E+03  0.2431209E+03  0.2421595E+03  0.2411830E+03  0.2401912E+03
+  0.2391840E+03  0.2381608E+03  0.2371218E+03  0.2360667E+03  0.2349956E+03
+  0.2339084E+03  0.2328053E+03  0.2316866E+03  0.2305525E+03  0.2294036E+03
+  0.2282402E+03  0.2270629E+03  0.2258727E+03  0.2246700E+03  0.2234559E+03
+  0.2222312E+03  0.2209971E+03  0.2197543E+03  0.2185041E+03  0.2172474E+03
+  0.2159854E+03  0.2147192E+03  0.2134496E+03  0.2121777E+03  0.2109044E+03
+  0.2096308E+03  0.2083575E+03  0.2070854E+03  0.2058153E+03  0.2045476E+03
+  0.2032832E+03  0.2020225E+03  0.2007660E+03  0.1995142E+03  0.1982673E+03
+  0.3174477E+03  0.3168271E+03  0.3162078E+03  0.3155891E+03  0.3149721E+03
+  0.3143554E+03  0.3137397E+03  0.3131248E+03  0.3125110E+03  0.3118983E+03
+  0.3112863E+03  0.3106743E+03  0.3100641E+03  0.3094543E+03  0.3088452E+03
+  0.3082367E+03  0.3076290E+03  0.3070221E+03  0.3064149E+03  0.3058093E+03
+  0.3052039E+03  0.3045989E+03  0.3039946E+03  0.3033908E+03  0.3027870E+03
+  0.3021839E+03  0.3015811E+03  0.3009783E+03  0.3003763E+03  0.2997744E+03
+  0.2991724E+03  0.2985709E+03  0.2979697E+03  0.2973681E+03  0.2967668E+03
+  0.2961657E+03  0.2955642E+03  0.2949627E+03  0.2943612E+03  0.2937595E+03
+  0.2931577E+03  0.2925557E+03  0.2919530E+03  0.2913504E+03  0.2907477E+03
+  0.2901437E+03  0.2895394E+03  0.2889350E+03  0.2883296E+03  0.2877237E+03
+  0.2871168E+03  0.2865095E+03  0.2859012E+03  0.2852918E+03  0.2846818E+03
+  0.2840701E+03  0.2834576E+03  0.2828446E+03  0.2822292E+03  0.2816130E+03
+  0.2809954E+03  0.2803761E+03  0.2797553E+03  0.2791329E+03  0.2785083E+03
+  0.2778821E+03  0.2772539E+03  0.2766236E+03  0.2759910E+03  0.2753563E+03
+  0.2747190E+03  0.2740791E+03  0.2734366E+03  0.2727914E+03  0.2721433E+03
+  0.2714918E+03  0.2708371E+03  0.2701794E+03  0.2695178E+03  0.2688528E+03
+  0.2681840E+03  0.2675110E+03  0.2668336E+03  0.2661522E+03  0.2654658E+03
+  0.2647749E+03  0.2640789E+03  0.2633774E+03  0.2626706E+03  0.2619580E+03
+  0.2612394E+03  0.2605148E+03  0.2597832E+03  0.2590450E+03  0.2582998E+03
+  0.2575472E+03  0.2567866E+03  0.2560180E+03  0.2552410E+03  0.2544552E+03
+  0.2536602E+03  0.2528558E+03  0.2520415E+03  0.2512167E+03  0.2503813E+03
+  0.2495347E+03  0.2486766E+03  0.2478064E+03  0.2469239E+03  0.2460284E+03
+  0.2451200E+03  0.2441973E+03  0.2432610E+03  0.2423100E+03  0.2413443E+03
+  0.2403634E+03  0.2393669E+03  0.2383550E+03  0.2373269E+03  0.2362829E+03
+  0.2352228E+03  0.2341465E+03  0.2330543E+03  0.2319462E+03  0.2308226E+03
+  0.2296836E+03  0.2285300E+03  0.2273622E+03  0.2261809E+03  0.2249867E+03
+  0.2237806E+03  0.2225633E+03  0.2213360E+03  0.2200996E+03  0.2188550E+03
+  0.2176035E+03  0.2163459E+03  0.2150836E+03  0.2138173E+03  0.2125483E+03
+  0.2112774E+03  0.2100056E+03  0.2087337E+03  0.2074626E+03  0.2061930E+03
+  0.2049257E+03  0.2036612E+03  0.2024001E+03  0.2011431E+03  0.1998904E+03
+  0.3177231E+03  0.3171039E+03  0.3164858E+03  0.3158689E+03  0.3152529E+03
+  0.3146383E+03  0.3140239E+03  0.3134109E+03  0.3127985E+03  0.3121872E+03
+  0.3115768E+03  0.3109674E+03  0.3103580E+03  0.3097498E+03  0.3091430E+03
+  0.3085363E+03  0.3079302E+03  0.3073249E+03  0.3067206E+03  0.3061164E+03
+  0.3055128E+03  0.3049101E+03  0.3043076E+03  0.3037058E+03  0.3031046E+03
+  0.3025036E+03  0.3019026E+03  0.3013027E+03  0.3007028E+03  0.3001031E+03
+  0.2995040E+03  0.2989050E+03  0.2983059E+03  0.2977071E+03  0.2971085E+03
+  0.2965099E+03  0.2959113E+03  0.2953129E+03  0.2947139E+03  0.2941154E+03
+  0.2935165E+03  0.2929173E+03  0.2923183E+03  0.2917186E+03  0.2911186E+03
+  0.2905183E+03  0.2899178E+03  0.2893167E+03  0.2887149E+03  0.2881127E+03
+  0.2875098E+03  0.2869060E+03  0.2863017E+03  0.2856966E+03  0.2850905E+03
+  0.2844833E+03  0.2838752E+03  0.2832661E+03  0.2826556E+03  0.2820441E+03
+  0.2814312E+03  0.2808169E+03  0.2802012E+03  0.2795840E+03  0.2789648E+03
+  0.2783440E+03  0.2777214E+03  0.2770970E+03  0.2764704E+03  0.2758416E+03
+  0.2752108E+03  0.2745775E+03  0.2739417E+03  0.2733035E+03  0.2726621E+03
+  0.2720182E+03  0.2713712E+03  0.2707211E+03  0.2700677E+03  0.2694108E+03
+  0.2687503E+03  0.2680861E+03  0.2674181E+03  0.2667457E+03  0.2660692E+03
+  0.2653883E+03  0.2647021E+03  0.2640118E+03  0.2633158E+03  0.2626146E+03
+  0.2619080E+03  0.2611954E+03  0.2604769E+03  0.2597516E+03  0.2590199E+03
+  0.2582812E+03  0.2575352E+03  0.2567816E+03  0.2560201E+03  0.2552505E+03
+  0.2544722E+03  0.2536849E+03  0.2528884E+03  0.2520821E+03  0.2512659E+03
+  0.2504389E+03  0.2496011E+03  0.2487519E+03  0.2478911E+03  0.2470180E+03
+  0.2461321E+03  0.2452331E+03  0.2443211E+03  0.2433947E+03  0.2424543E+03
+  0.2414993E+03  0.2405291E+03  0.2395435E+03  0.2385425E+03  0.2375255E+03
+  0.2364926E+03  0.2354435E+03  0.2343783E+03  0.2332970E+03  0.2321997E+03
+  0.2310864E+03  0.2299579E+03  0.2288143E+03  0.2276561E+03  0.2264839E+03
+  0.2252986E+03  0.2241006E+03  0.2228912E+03  0.2216709E+03  0.2204411E+03
+  0.2192026E+03  0.2179564E+03  0.2167037E+03  0.2154455E+03  0.2141830E+03
+  0.2129170E+03  0.2116487E+03  0.2103790E+03  0.2091087E+03  0.2078388E+03
+  0.2065700E+03  0.2053031E+03  0.2040387E+03  0.2027775E+03  0.2015199E+03
+  0.3179943E+03  0.3173770E+03  0.3167603E+03  0.3161448E+03  0.3155302E+03
+  0.3149166E+03  0.3143040E+03  0.3136926E+03  0.3130822E+03  0.3124723E+03
+  0.3118633E+03  0.3112552E+03  0.3106482E+03  0.3100416E+03  0.3094358E+03
+  0.3088313E+03  0.3082275E+03  0.3076238E+03  0.3070206E+03  0.3064189E+03
+  0.3058176E+03  0.3052163E+03  0.3046164E+03  0.3040167E+03  0.3034169E+03
+  0.3028186E+03  0.3022201E+03  0.3016216E+03  0.3010242E+03  0.3004270E+03
+  0.2998297E+03  0.2992331E+03  0.2986370E+03  0.2980403E+03  0.2974441E+03
+  0.2968485E+03  0.2962524E+03  0.2956566E+03  0.2950606E+03  0.2944646E+03
+  0.2938686E+03  0.2932730E+03  0.2926766E+03  0.2920798E+03  0.2914832E+03
+  0.2908863E+03  0.2902887E+03  0.2896909E+03  0.2890928E+03  0.2884942E+03
+  0.2878949E+03  0.2872947E+03  0.2866944E+03  0.2860928E+03  0.2854907E+03
+  0.2848881E+03  0.2842839E+03  0.2836790E+03  0.2830730E+03  0.2824658E+03
+  0.2818578E+03  0.2812480E+03  0.2806374E+03  0.2800250E+03  0.2794109E+03
+  0.2787955E+03  0.2781782E+03  0.2775596E+03  0.2769384E+03  0.2763155E+03
+  0.2756908E+03  0.2750636E+03  0.2744342E+03  0.2738024E+03  0.2731680E+03
+  0.2725311E+03  0.2718914E+03  0.2712484E+03  0.2706027E+03  0.2699538E+03
+  0.2693014E+03  0.2686456E+03  0.2679859E+03  0.2673225E+03  0.2666553E+03
+  0.2659835E+03  0.2653078E+03  0.2646271E+03  0.2639418E+03  0.2632516E+03
+  0.2625558E+03  0.2618549E+03  0.2611481E+03  0.2604354E+03  0.2597165E+03
+  0.2589910E+03  0.2582589E+03  0.2575197E+03  0.2567727E+03  0.2560182E+03
+  0.2552557E+03  0.2544849E+03  0.2537052E+03  0.2529164E+03  0.2521181E+03
+  0.2513099E+03  0.2504916E+03  0.2496624E+03  0.2488222E+03  0.2479702E+03
+  0.2471065E+03  0.2462301E+03  0.2453413E+03  0.2444388E+03  0.2435227E+03
+  0.2425927E+03  0.2416480E+03  0.2406885E+03  0.2397139E+03  0.2387237E+03
+  0.2377178E+03  0.2366959E+03  0.2356579E+03  0.2346037E+03  0.2335334E+03
+  0.2324468E+03  0.2313444E+03  0.2302262E+03  0.2290928E+03  0.2279444E+03
+  0.2267817E+03  0.2256053E+03  0.2244159E+03  0.2232145E+03  0.2220018E+03
+  0.2207787E+03  0.2195466E+03  0.2183062E+03  0.2170586E+03  0.2158050E+03
+  0.2145463E+03  0.2132838E+03  0.2120184E+03  0.2107510E+03  0.2094826E+03
+  0.2082141E+03  0.2069463E+03  0.2056800E+03  0.2044159E+03  0.2031546E+03
+  0.3182625E+03  0.3176460E+03  0.3170309E+03  0.3164169E+03  0.3158037E+03
+  0.3151916E+03  0.3145804E+03  0.3139705E+03  0.3133615E+03  0.3127534E+03
+  0.3121458E+03  0.3115393E+03  0.3109337E+03  0.3103293E+03  0.3097254E+03
+  0.3091220E+03  0.3085197E+03  0.3079180E+03  0.3073174E+03  0.3067166E+03
+  0.3061174E+03  0.3055185E+03  0.3049198E+03  0.3043221E+03  0.3037248E+03
+  0.3031279E+03  0.3025316E+03  0.3019357E+03  0.3013401E+03  0.3007452E+03
+  0.3001506E+03  0.2995562E+03  0.2989620E+03  0.2983683E+03  0.2977749E+03
+  0.2971811E+03  0.2965879E+03  0.2959946E+03  0.2954012E+03  0.2948079E+03
+  0.2942150E+03  0.2936214E+03  0.2930280E+03  0.2924348E+03  0.2918411E+03
+  0.2912469E+03  0.2906529E+03  0.2900585E+03  0.2894633E+03  0.2888681E+03
+  0.2882723E+03  0.2876761E+03  0.2870789E+03  0.2864814E+03  0.2858831E+03
+  0.2852842E+03  0.2846841E+03  0.2840833E+03  0.2834812E+03  0.2828784E+03
+  0.2822751E+03  0.2816699E+03  0.2810639E+03  0.2804561E+03  0.2798471E+03
+  0.2792367E+03  0.2786245E+03  0.2780109E+03  0.2773955E+03  0.2767783E+03
+  0.2761593E+03  0.2755379E+03  0.2749147E+03  0.2742891E+03  0.2736612E+03
+  0.2730308E+03  0.2723978E+03  0.2717622E+03  0.2711237E+03  0.2704818E+03
+  0.2698375E+03  0.2691897E+03  0.2685382E+03  0.2678835E+03  0.2672246E+03
+  0.2665622E+03  0.2658955E+03  0.2652242E+03  0.2645491E+03  0.2638690E+03
+  0.2631840E+03  0.2624940E+03  0.2617985E+03  0.2610975E+03  0.2603906E+03
+  0.2596778E+03  0.2589586E+03  0.2582328E+03  0.2574999E+03  0.2567598E+03
+  0.2560123E+03  0.2552568E+03  0.2544932E+03  0.2537211E+03  0.2529399E+03
+  0.2521495E+03  0.2513495E+03  0.2505392E+03  0.2497184E+03  0.2488871E+03
+  0.2480440E+03  0.2471894E+03  0.2463226E+03  0.2454431E+03  0.2445507E+03
+  0.2436448E+03  0.2427246E+03  0.2417906E+03  0.2408417E+03  0.2398777E+03
+  0.2388984E+03  0.2379035E+03  0.2368927E+03  0.2358657E+03  0.2348227E+03
+  0.2337632E+03  0.2326877E+03  0.2315961E+03  0.2304886E+03  0.2293653E+03
+  0.2282270E+03  0.2270739E+03  0.2259067E+03  0.2247262E+03  0.2235331E+03
+  0.2223281E+03  0.2211125E+03  0.2198869E+03  0.2186525E+03  0.2174103E+03
+  0.2161616E+03  0.2149072E+03  0.2136484E+03  0.2123860E+03  0.2111213E+03
+  0.2098550E+03  0.2085881E+03  0.2073215E+03  0.2060560E+03  0.2047924E+03
+  0.3185270E+03  0.3179120E+03  0.3172978E+03  0.3166854E+03  0.3160738E+03
+  0.3154631E+03  0.3148531E+03  0.3142444E+03  0.3136367E+03  0.3130298E+03
+  0.3124246E+03  0.3118196E+03  0.3112155E+03  0.3106120E+03  0.3100097E+03
+  0.3094087E+03  0.3088081E+03  0.3082080E+03  0.3076091E+03  0.3070104E+03
+  0.3064126E+03  0.3058153E+03  0.3052188E+03  0.3046230E+03  0.3040275E+03
+  0.3034329E+03  0.3028388E+03  0.3022449E+03  0.3016516E+03  0.3010586E+03
+  0.3004659E+03  0.2998740E+03  0.2992821E+03  0.2986906E+03  0.2980991E+03
+  0.2975082E+03  0.2969174E+03  0.2963266E+03  0.2957361E+03  0.2951455E+03
+  0.2945546E+03  0.2939645E+03  0.2933739E+03  0.2927831E+03  0.2921923E+03
+  0.2916016E+03  0.2910105E+03  0.2904188E+03  0.2898272E+03  0.2892352E+03
+  0.2886427E+03  0.2880497E+03  0.2874563E+03  0.2868624E+03  0.2862676E+03
+  0.2856723E+03  0.2850766E+03  0.2844794E+03  0.2838816E+03  0.2832831E+03
+  0.2826834E+03  0.2820827E+03  0.2814810E+03  0.2808779E+03  0.2802736E+03
+  0.2796680E+03  0.2790607E+03  0.2784523E+03  0.2778423E+03  0.2772303E+03
+  0.2766169E+03  0.2760011E+03  0.2753836E+03  0.2747639E+03  0.2741423E+03
+  0.2735184E+03  0.2728917E+03  0.2722627E+03  0.2716313E+03  0.2709965E+03
+  0.2703594E+03  0.2697191E+03  0.2690757E+03  0.2684286E+03  0.2677782E+03
+  0.2671244E+03  0.2664663E+03  0.2658047E+03  0.2651385E+03  0.2644684E+03
+  0.2637935E+03  0.2631134E+03  0.2624290E+03  0.2617391E+03  0.2610437E+03
+  0.2603426E+03  0.2596358E+03  0.2589225E+03  0.2582032E+03  0.2574767E+03
+  0.2567432E+03  0.2560024E+03  0.2552539E+03  0.2544973E+03  0.2537325E+03
+  0.2529590E+03  0.2521763E+03  0.2513840E+03  0.2505819E+03  0.2497697E+03
+  0.2489467E+03  0.2481127E+03  0.2472671E+03  0.2464095E+03  0.2455395E+03
+  0.2446567E+03  0.2437606E+03  0.2428509E+03  0.2419271E+03  0.2409886E+03
+  0.2400352E+03  0.2390669E+03  0.2380828E+03  0.2370830E+03  0.2360672E+03
+  0.2350351E+03  0.2339868E+03  0.2329223E+03  0.2318416E+03  0.2307445E+03
+  0.2296320E+03  0.2285037E+03  0.2273605E+03  0.2262029E+03  0.2250314E+03
+  0.2238468E+03  0.2226500E+03  0.2214418E+03  0.2202232E+03  0.2189952E+03
+  0.2177588E+03  0.2165152E+03  0.2152655E+03  0.2140106E+03  0.2127517E+03
+  0.2114898E+03  0.2102259E+03  0.2089609E+03  0.2076958E+03  0.2064312E+03
+  0.3187878E+03  0.3181745E+03  0.3175619E+03  0.3169501E+03  0.3163396E+03
+  0.3157304E+03  0.3151222E+03  0.3145148E+03  0.3139087E+03  0.3133034E+03
+  0.3126990E+03  0.3120958E+03  0.3114934E+03  0.3108917E+03  0.3102911E+03
+  0.3096909E+03  0.3090922E+03  0.3084939E+03  0.3078962E+03  0.3072992E+03
+  0.3067038E+03  0.3061082E+03  0.3055135E+03  0.3049196E+03  0.3043263E+03
+  0.3037331E+03  0.3031406E+03  0.3025493E+03  0.3019579E+03  0.3013667E+03
+  0.3007765E+03  0.3001868E+03  0.2995969E+03  0.2990078E+03  0.2984185E+03
+  0.2978299E+03  0.2972413E+03  0.2966533E+03  0.2960650E+03  0.2954769E+03
+  0.2948891E+03  0.2943015E+03  0.2937131E+03  0.2931256E+03  0.2925376E+03
+  0.2919493E+03  0.2913611E+03  0.2907729E+03  0.2901845E+03  0.2895953E+03
+  0.2890060E+03  0.2884164E+03  0.2878266E+03  0.2872356E+03  0.2866443E+03
+  0.2860530E+03  0.2854608E+03  0.2848673E+03  0.2842737E+03  0.2836788E+03
+  0.2830834E+03  0.2824870E+03  0.2818893E+03  0.2812910E+03  0.2806909E+03
+  0.2800901E+03  0.2794873E+03  0.2788839E+03  0.2782789E+03  0.2776721E+03
+  0.2770635E+03  0.2764534E+03  0.2758414E+03  0.2752275E+03  0.2746118E+03
+  0.2739938E+03  0.2733734E+03  0.2727509E+03  0.2721257E+03  0.2714983E+03
+  0.2708682E+03  0.2702346E+03  0.2695987E+03  0.2689593E+03  0.2683171E+03
+  0.2676710E+03  0.2670214E+03  0.2663685E+03  0.2657113E+03  0.2650502E+03
+  0.2643845E+03  0.2637151E+03  0.2630404E+03  0.2623610E+03  0.2616768E+03
+  0.2609868E+03  0.2602915E+03  0.2595905E+03  0.2588833E+03  0.2581698E+03
+  0.2574499E+03  0.2567228E+03  0.2559886E+03  0.2552470E+03  0.2544974E+03
+  0.2537397E+03  0.2529736E+03  0.2521986E+03  0.2514142E+03  0.2506202E+03
+  0.2498161E+03  0.2490016E+03  0.2481761E+03  0.2473394E+03  0.2464910E+03
+  0.2456303E+03  0.2447572E+03  0.2438710E+03  0.2429709E+03  0.2420573E+03
+  0.2411294E+03  0.2401868E+03  0.2392290E+03  0.2382558E+03  0.2372670E+03
+  0.2362621E+03  0.2352412E+03  0.2342040E+03  0.2331505E+03  0.2320804E+03
+  0.2309944E+03  0.2298923E+03  0.2287747E+03  0.2276415E+03  0.2264935E+03
+  0.2253314E+03  0.2241557E+03  0.2229672E+03  0.2217668E+03  0.2205555E+03
+  0.2193342E+03  0.2181039E+03  0.2168658E+03  0.2156209E+03  0.2143703E+03
+  0.2131152E+03  0.2118564E+03  0.2105951E+03  0.2093323E+03  0.2080688E+03
+  0.3190461E+03  0.3184332E+03  0.3178218E+03  0.3172119E+03  0.3166027E+03
+  0.3159946E+03  0.3153873E+03  0.3147815E+03  0.3141768E+03  0.3135729E+03
+  0.3129699E+03  0.3123680E+03  0.3117667E+03  0.3111672E+03  0.3105679E+03
+  0.3099693E+03  0.3093719E+03  0.3087757E+03  0.3081794E+03  0.3075843E+03
+  0.3069904E+03  0.3063967E+03  0.3058038E+03  0.3052112E+03  0.3046196E+03
+  0.3040291E+03  0.3034381E+03  0.3028485E+03  0.3022594E+03  0.3016707E+03
+  0.3010822E+03  0.3004943E+03  0.2999067E+03  0.2993194E+03  0.2987329E+03
+  0.2981466E+03  0.2975602E+03  0.2969742E+03  0.2963887E+03  0.2958031E+03
+  0.2952177E+03  0.2946321E+03  0.2940472E+03  0.2934615E+03  0.2928764E+03
+  0.2922915E+03  0.2917061E+03  0.2911204E+03  0.2905345E+03  0.2899490E+03
+  0.2893628E+03  0.2887762E+03  0.2881894E+03  0.2876021E+03  0.2870145E+03
+  0.2864262E+03  0.2858373E+03  0.2852480E+03  0.2846578E+03  0.2840668E+03
+  0.2834753E+03  0.2828830E+03  0.2822892E+03  0.2816949E+03  0.2810995E+03
+  0.2805031E+03  0.2799051E+03  0.2793059E+03  0.2787056E+03  0.2781036E+03
+  0.2775004E+03  0.2768952E+03  0.2762887E+03  0.2756803E+03  0.2750702E+03
+  0.2744578E+03  0.2738435E+03  0.2732270E+03  0.2726080E+03  0.2719871E+03
+  0.2713633E+03  0.2707368E+03  0.2701081E+03  0.2694761E+03  0.2688411E+03
+  0.2682029E+03  0.2675617E+03  0.2669164E+03  0.2662679E+03  0.2656154E+03
+  0.2649591E+03  0.2642989E+03  0.2636337E+03  0.2629645E+03  0.2622905E+03
+  0.2616111E+03  0.2609269E+03  0.2602374E+03  0.2595417E+03  0.2588406E+03
+  0.2581332E+03  0.2574194E+03  0.2566988E+03  0.2559711E+03  0.2552361E+03
+  0.2544935E+03  0.2537429E+03  0.2529840E+03  0.2522163E+03  0.2514396E+03
+  0.2506537E+03  0.2498577E+03  0.2490515E+03  0.2482345E+03  0.2474066E+03
+  0.2465671E+03  0.2457157E+03  0.2448519E+03  0.2439752E+03  0.2430854E+03
+  0.2421819E+03  0.2412641E+03  0.2403319E+03  0.2393847E+03  0.2384224E+03
+  0.2374445E+03  0.2364507E+03  0.2354408E+03  0.2344148E+03  0.2333721E+03
+  0.2323133E+03  0.2312382E+03  0.2301468E+03  0.2290395E+03  0.2279167E+03
+  0.2267786E+03  0.2256260E+03  0.2244594E+03  0.2232795E+03  0.2220873E+03
+  0.2208835E+03  0.2196692E+03  0.2184454E+03  0.2172131E+03  0.2159734E+03
+  0.2147275E+03  0.2134763E+03  0.2122210E+03  0.2109627E+03  0.2097022E+03
+  0.3193003E+03  0.3186888E+03  0.3180786E+03  0.3174695E+03  0.3168615E+03
+  0.3162549E+03  0.3156494E+03  0.3150446E+03  0.3144410E+03  0.3138389E+03
+  0.3132371E+03  0.3126365E+03  0.3120369E+03  0.3114385E+03  0.3108409E+03
+  0.3102442E+03  0.3096482E+03  0.3090529E+03  0.3084586E+03  0.3078654E+03
+  0.3072729E+03  0.3066806E+03  0.3060892E+03  0.3054993E+03  0.3049089E+03
+  0.3043201E+03  0.3037317E+03  0.3031434E+03  0.3025561E+03  0.3019691E+03
+  0.3013830E+03  0.3007970E+03  0.3002115E+03  0.2996267E+03  0.2990420E+03
+  0.2984576E+03  0.2978739E+03  0.2972900E+03  0.2967067E+03  0.2961234E+03
+  0.2955406E+03  0.2949577E+03  0.2943749E+03  0.2937923E+03  0.2932098E+03
+  0.2926268E+03  0.2920445E+03  0.2914619E+03  0.2908790E+03  0.2902960E+03
+  0.2897128E+03  0.2891297E+03  0.2885459E+03  0.2879616E+03  0.2873770E+03
+  0.2867922E+03  0.2862070E+03  0.2856207E+03  0.2850342E+03  0.2844471E+03
+  0.2838593E+03  0.2832707E+03  0.2826810E+03  0.2820907E+03  0.2814993E+03
+  0.2809070E+03  0.2803135E+03  0.2797190E+03  0.2791231E+03  0.2785256E+03
+  0.2779274E+03  0.2773272E+03  0.2767259E+03  0.2761227E+03  0.2755180E+03
+  0.2749110E+03  0.2743023E+03  0.2736918E+03  0.2730788E+03  0.2724638E+03
+  0.2718463E+03  0.2712267E+03  0.2706043E+03  0.2699794E+03  0.2693515E+03
+  0.2687207E+03  0.2680869E+03  0.2674496E+03  0.2668094E+03  0.2661649E+03
+  0.2655174E+03  0.2648654E+03  0.2642101E+03  0.2635503E+03  0.2628857E+03
+  0.2622170E+03  0.2615430E+03  0.2608640E+03  0.2601798E+03  0.2594901E+03
+  0.2587947E+03  0.2580930E+03  0.2573855E+03  0.2566712E+03  0.2559499E+03
+  0.2552215E+03  0.2544856E+03  0.2537420E+03  0.2529902E+03  0.2522300E+03
+  0.2514608E+03  0.2506823E+03  0.2498944E+03  0.2490963E+03  0.2482880E+03
+  0.2474687E+03  0.2466380E+03  0.2457957E+03  0.2449414E+03  0.2440741E+03
+  0.2431940E+03  0.2423003E+03  0.2413928E+03  0.2404710E+03  0.2395344E+03
+  0.2385828E+03  0.2376157E+03  0.2366329E+03  0.2356340E+03  0.2346189E+03
+  0.2335875E+03  0.2325398E+03  0.2314757E+03  0.2303951E+03  0.2292983E+03
+  0.2281859E+03  0.2270580E+03  0.2259151E+03  0.2247578E+03  0.2235869E+03
+  0.2224030E+03  0.2212072E+03  0.2200002E+03  0.2187831E+03  0.2175569E+03
+  0.2163228E+03  0.2150818E+03  0.2138350E+03  0.2125834E+03  0.2113282E+03
+  0.3195515E+03  0.3189412E+03  0.3183321E+03  0.3177245E+03  0.3171178E+03
+  0.3165120E+03  0.3159077E+03  0.3153046E+03  0.3147021E+03  0.3141010E+03
+  0.3135009E+03  0.3129019E+03  0.3123036E+03  0.3117065E+03  0.3111101E+03
+  0.3105146E+03  0.3099203E+03  0.3093270E+03  0.3087339E+03  0.3081422E+03
+  0.3075513E+03  0.3069609E+03  0.3063715E+03  0.3057821E+03  0.3051945E+03
+  0.3046072E+03  0.3040201E+03  0.3034340E+03  0.3028485E+03  0.3022633E+03
+  0.3016790E+03  0.3010952E+03  0.3005120E+03  0.2999285E+03  0.2993460E+03
+  0.2987641E+03  0.2981820E+03  0.2976008E+03  0.2970198E+03  0.2964388E+03
+  0.2958580E+03  0.2952775E+03  0.2946973E+03  0.2941172E+03  0.2935371E+03
+  0.2929572E+03  0.2923773E+03  0.2917969E+03  0.2912169E+03  0.2906372E+03
+  0.2900567E+03  0.2894759E+03  0.2888953E+03  0.2883146E+03  0.2877332E+03
+  0.2871513E+03  0.2865693E+03  0.2859866E+03  0.2854036E+03  0.2848200E+03
+  0.2842356E+03  0.2836508E+03  0.2830651E+03  0.2824783E+03  0.2818912E+03
+  0.2813026E+03  0.2807136E+03  0.2801232E+03  0.2795316E+03  0.2789389E+03
+  0.2783452E+03  0.2777497E+03  0.2771530E+03  0.2765549E+03  0.2759553E+03
+  0.2753538E+03  0.2747505E+03  0.2741454E+03  0.2735381E+03  0.2729290E+03
+  0.2723177E+03  0.2717043E+03  0.2710880E+03  0.2704698E+03  0.2698488E+03
+  0.2692249E+03  0.2685984E+03  0.2679685E+03  0.2673358E+03  0.2666993E+03
+  0.2660602E+03  0.2654167E+03  0.2647698E+03  0.2641187E+03  0.2634639E+03
+  0.2628044E+03  0.2621402E+03  0.2614719E+03  0.2607981E+03  0.2601193E+03
+  0.2594354E+03  0.2587456E+03  0.2580499E+03  0.2573482E+03  0.2566400E+03
+  0.2559251E+03  0.2552032E+03  0.2544740E+03  0.2537372E+03  0.2529924E+03
+  0.2522393E+03  0.2514776E+03  0.2507068E+03  0.2499266E+03  0.2491367E+03
+  0.2483364E+03  0.2475256E+03  0.2467037E+03  0.2458704E+03  0.2450251E+03
+  0.2441672E+03  0.2432969E+03  0.2424132E+03  0.2415157E+03  0.2406040E+03
+  0.2396779E+03  0.2387369E+03  0.2377806E+03  0.2368087E+03  0.2358208E+03
+  0.2348168E+03  0.2337966E+03  0.2327599E+03  0.2317066E+03  0.2306370E+03
+  0.2295511E+03  0.2284493E+03  0.2273315E+03  0.2261987E+03  0.2250509E+03
+  0.2238892E+03  0.2227140E+03  0.2215263E+03  0.2203269E+03  0.2191169E+03
+  0.2178972E+03  0.2166689E+03  0.2154331E+03  0.2141910E+03  0.2129435E+03
+  0.3197993E+03  0.3191903E+03  0.3185823E+03  0.3179757E+03  0.3173701E+03
+  0.3167660E+03  0.3161627E+03  0.3155605E+03  0.3149597E+03  0.3143598E+03
+  0.3137607E+03  0.3131629E+03  0.3125663E+03  0.3119706E+03  0.3113759E+03
+  0.3107817E+03  0.3101886E+03  0.3095967E+03  0.3090057E+03  0.3084149E+03
+  0.3078254E+03  0.3072368E+03  0.3066491E+03  0.3060614E+03  0.3054754E+03
+  0.3048897E+03  0.3043047E+03  0.3037200E+03  0.3031365E+03  0.3025534E+03
+  0.3019707E+03  0.3013887E+03  0.3008071E+03  0.3002264E+03  0.2996454E+03
+  0.2990653E+03  0.2984859E+03  0.2979066E+03  0.2973275E+03  0.2967488E+03
+  0.2961705E+03  0.2955923E+03  0.2950144E+03  0.2944368E+03  0.2938591E+03
+  0.2932815E+03  0.2927037E+03  0.2921268E+03  0.2915492E+03  0.2909717E+03
+  0.2903942E+03  0.2898168E+03  0.2892388E+03  0.2886607E+03  0.2880823E+03
+  0.2875038E+03  0.2869248E+03  0.2863456E+03  0.2857657E+03  0.2851854E+03
+  0.2846047E+03  0.2840230E+03  0.2834411E+03  0.2828582E+03  0.2822747E+03
+  0.2816902E+03  0.2811049E+03  0.2805188E+03  0.2799316E+03  0.2793430E+03
+  0.2787540E+03  0.2781631E+03  0.2775710E+03  0.2769777E+03  0.2763827E+03
+  0.2757864E+03  0.2751881E+03  0.2745881E+03  0.2739866E+03  0.2733832E+03
+  0.2727775E+03  0.2721700E+03  0.2715599E+03  0.2709481E+03  0.2703331E+03
+  0.2697164E+03  0.2690963E+03  0.2684739E+03  0.2678482E+03  0.2672196E+03
+  0.2665881E+03  0.2659526E+03  0.2653140E+03  0.2646714E+03  0.2640254E+03
+  0.2633746E+03  0.2627204E+03  0.2620616E+03  0.2613978E+03  0.2607295E+03
+  0.2600560E+03  0.2593774E+03  0.2586933E+03  0.2580035E+03  0.2573074E+03
+  0.2566055E+03  0.2558968E+03  0.2551812E+03  0.2544585E+03  0.2537284E+03
+  0.2529906E+03  0.2522447E+03  0.2514900E+03  0.2507266E+03  0.2499542E+03
+  0.2491722E+03  0.2483802E+03  0.2475779E+03  0.2467644E+03  0.2459398E+03
+  0.2451035E+03  0.2442551E+03  0.2433941E+03  0.2425199E+03  0.2416325E+03
+  0.2407309E+03  0.2398154E+03  0.2388848E+03  0.2379392E+03  0.2369781E+03
+  0.2360012E+03  0.2350083E+03  0.2339991E+03  0.2329734E+03  0.2319312E+03
+  0.2308726E+03  0.2297977E+03  0.2287064E+03  0.2275993E+03  0.2264764E+03
+  0.2253385E+03  0.2241861E+03  0.2230199E+03  0.2218407E+03  0.2206493E+03
+  0.2194466E+03  0.2182337E+03  0.2170116E+03  0.2157814E+03  0.2145442E+03
+  0.3200440E+03  0.3194363E+03  0.3188294E+03  0.3182239E+03  0.3176196E+03
+  0.3170165E+03  0.3164142E+03  0.3158132E+03  0.3152135E+03  0.3146149E+03
+  0.3140175E+03  0.3134208E+03  0.3128253E+03  0.3122308E+03  0.3116376E+03
+  0.3110449E+03  0.3104532E+03  0.3098625E+03  0.3092728E+03  0.3086845E+03
+  0.3080963E+03  0.3075090E+03  0.3069227E+03  0.3063373E+03  0.3057524E+03
+  0.3051679E+03  0.3045846E+03  0.3040023E+03  0.3034203E+03  0.3028387E+03
+  0.3022580E+03  0.3016780E+03  0.3010983E+03  0.3005187E+03  0.2999407E+03
+  0.2993625E+03  0.2987845E+03  0.2982075E+03  0.2976305E+03  0.2970539E+03
+  0.2964777E+03  0.2959018E+03  0.2953263E+03  0.2947506E+03  0.2941754E+03
+  0.2936006E+03  0.2930254E+03  0.2924505E+03  0.2918756E+03  0.2913011E+03
+  0.2907262E+03  0.2901510E+03  0.2895759E+03  0.2890007E+03  0.2884254E+03
+  0.2878501E+03  0.2872738E+03  0.2866976E+03  0.2861211E+03  0.2855441E+03
+  0.2849664E+03  0.2843884E+03  0.2838102E+03  0.2832304E+03  0.2826509E+03
+  0.2820701E+03  0.2814885E+03  0.2809063E+03  0.2803232E+03  0.2797390E+03
+  0.2791537E+03  0.2785674E+03  0.2779795E+03  0.2773909E+03  0.2768006E+03
+  0.2762089E+03  0.2756158E+03  0.2750211E+03  0.2744247E+03  0.2738265E+03
+  0.2732265E+03  0.2726247E+03  0.2720204E+03  0.2714145E+03  0.2708061E+03
+  0.2701954E+03  0.2695820E+03  0.2689663E+03  0.2683476E+03  0.2677261E+03
+  0.2671015E+03  0.2664740E+03  0.2658430E+03  0.2652088E+03  0.2645706E+03
+  0.2639292E+03  0.2632837E+03  0.2626336E+03  0.2619798E+03  0.2613212E+03
+  0.2606580E+03  0.2599901E+03  0.2593166E+03  0.2586378E+03  0.2579539E+03
+  0.2572637E+03  0.2565674E+03  0.2558649E+03  0.2551556E+03  0.2544393E+03
+  0.2537159E+03  0.2529851E+03  0.2522458E+03  0.2514986E+03  0.2507427E+03
+  0.2499778E+03  0.2492034E+03  0.2484193E+03  0.2476251E+03  0.2468201E+03
+  0.2460042E+03  0.2451767E+03  0.2443376E+03  0.2434859E+03  0.2426215E+03
+  0.2417438E+03  0.2408523E+03  0.2399467E+03  0.2390268E+03  0.2380915E+03
+  0.2371413E+03  0.2361753E+03  0.2351934E+03  0.2341951E+03  0.2331806E+03
+  0.2321496E+03  0.2311021E+03  0.2300381E+03  0.2289575E+03  0.2278610E+03
+  0.2267485E+03  0.2256205E+03  0.2244778E+03  0.2233208E+03  0.2221503E+03
+  0.2209671E+03  0.2197720E+03  0.2185663E+03  0.2173507E+03  0.2161263E+03
+  0.3202856E+03  0.3196789E+03  0.3190735E+03  0.3184689E+03  0.3178657E+03
+  0.3172638E+03  0.3166631E+03  0.3160629E+03  0.3154644E+03  0.3148669E+03
+  0.3142706E+03  0.3136752E+03  0.3130813E+03  0.3124879E+03  0.3118958E+03
+  0.3113049E+03  0.3107148E+03  0.3101251E+03  0.3095367E+03  0.3089495E+03
+  0.3083633E+03  0.3077775E+03  0.3071926E+03  0.3066083E+03  0.3060253E+03
+  0.3054427E+03  0.3048611E+03  0.3042798E+03  0.3037000E+03  0.3031199E+03
+  0.3025408E+03  0.3019626E+03  0.3013848E+03  0.3008074E+03  0.3002305E+03
+  0.2996545E+03  0.2990788E+03  0.2985036E+03  0.2979285E+03  0.2973542E+03
+  0.2967804E+03  0.2962062E+03  0.2956327E+03  0.2950598E+03  0.2944867E+03
+  0.2939139E+03  0.2933413E+03  0.2927689E+03  0.2921967E+03  0.2916241E+03
+  0.2910518E+03  0.2904798E+03  0.2899074E+03  0.2893348E+03  0.2887622E+03
+  0.2881893E+03  0.2876165E+03  0.2870435E+03  0.2864697E+03  0.2858957E+03
+  0.2853216E+03  0.2847472E+03  0.2841714E+03  0.2835958E+03  0.2830193E+03
+  0.2824424E+03  0.2818643E+03  0.2812861E+03  0.2807065E+03  0.2801266E+03
+  0.2795453E+03  0.2789631E+03  0.2783796E+03  0.2777952E+03  0.2772093E+03
+  0.2766226E+03  0.2760340E+03  0.2754442E+03  0.2748528E+03  0.2742599E+03
+  0.2736650E+03  0.2730686E+03  0.2724700E+03  0.2718698E+03  0.2712672E+03
+  0.2706625E+03  0.2700555E+03  0.2694461E+03  0.2688339E+03  0.2682195E+03
+  0.2676018E+03  0.2669815E+03  0.2663579E+03  0.2657315E+03  0.2651014E+03
+  0.2644680E+03  0.2638307E+03  0.2631897E+03  0.2625448E+03  0.2618955E+03
+  0.2612421E+03  0.2605835E+03  0.2599207E+03  0.2592529E+03  0.2585796E+03
+  0.2579010E+03  0.2572166E+03  0.2565262E+03  0.2558297E+03  0.2551267E+03
+  0.2544165E+03  0.2536996E+03  0.2529754E+03  0.2522431E+03  0.2515029E+03
+  0.2507542E+03  0.2499968E+03  0.2492301E+03  0.2484538E+03  0.2476676E+03
+  0.2468710E+03  0.2460636E+03  0.2452450E+03  0.2444146E+03  0.2435722E+03
+  0.2427170E+03  0.2418490E+03  0.2409676E+03  0.2400722E+03  0.2391624E+03
+  0.2382379E+03  0.2372983E+03  0.2363430E+03  0.2353720E+03  0.2343849E+03
+  0.2333816E+03  0.2323617E+03  0.2313251E+03  0.2302720E+03  0.2292025E+03
+  0.2281164E+03  0.2270145E+03  0.2258969E+03  0.2247639E+03  0.2236163E+03
+  0.2224548E+03  0.2212801E+03  0.2200930E+03  0.2188947E+03  0.2176859E+03
+  0.3205251E+03  0.3199188E+03  0.3193144E+03  0.3187111E+03  0.3181088E+03
+  0.3175078E+03  0.3169078E+03  0.3163096E+03  0.3157119E+03  0.3151158E+03
+  0.3145205E+03  0.3139266E+03  0.3133334E+03  0.3127418E+03  0.3121510E+03
+  0.3115609E+03  0.3109721E+03  0.3103846E+03  0.3097975E+03  0.3092114E+03
+  0.3086263E+03  0.3080421E+03  0.3074590E+03  0.3068762E+03  0.3062945E+03
+  0.3057133E+03  0.3051334E+03  0.3045541E+03  0.3039749E+03  0.3033968E+03
+  0.3028199E+03  0.3022431E+03  0.3016670E+03  0.3010917E+03  0.3005168E+03
+  0.2999421E+03  0.2993681E+03  0.2987951E+03  0.2982223E+03  0.2976497E+03
+  0.2970778E+03  0.2965062E+03  0.2959347E+03  0.2953636E+03  0.2947929E+03
+  0.2942224E+03  0.2936522E+03  0.2930818E+03  0.2925119E+03  0.2919421E+03
+  0.2913725E+03  0.2908026E+03  0.2902327E+03  0.2896631E+03  0.2890932E+03
+  0.2885231E+03  0.2879529E+03  0.2873826E+03  0.2868122E+03  0.2862412E+03
+  0.2856698E+03  0.2850983E+03  0.2845263E+03  0.2839539E+03  0.2833806E+03
+  0.2828076E+03  0.2822328E+03  0.2816582E+03  0.2810824E+03  0.2805060E+03
+  0.2799288E+03  0.2793505E+03  0.2787712E+03  0.2781912E+03  0.2776096E+03
+  0.2770269E+03  0.2764432E+03  0.2758579E+03  0.2752713E+03  0.2746832E+03
+  0.2740935E+03  0.2735023E+03  0.2729090E+03  0.2723142E+03  0.2717171E+03
+  0.2711185E+03  0.2705172E+03  0.2699140E+03  0.2693081E+03  0.2687002E+03
+  0.2680891E+03  0.2674758E+03  0.2668592E+03  0.2662402E+03  0.2656176E+03
+  0.2649919E+03  0.2643628E+03  0.2637302E+03  0.2630937E+03  0.2624532E+03
+  0.2618090E+03  0.2611600E+03  0.2605069E+03  0.2598488E+03  0.2591863E+03
+  0.2585183E+03  0.2578452E+03  0.2571663E+03  0.2564818E+03  0.2557911E+03
+  0.2550941E+03  0.2543903E+03  0.2536796E+03  0.2529620E+03  0.2522364E+03
+  0.2515032E+03  0.2507617E+03  0.2500112E+03  0.2492521E+03  0.2484836E+03
+  0.2477053E+03  0.2469169E+03  0.2461179E+03  0.2453079E+03  0.2444865E+03
+  0.2436531E+03  0.2428076E+03  0.2419491E+03  0.2410772E+03  0.2401917E+03
+  0.2392922E+03  0.2383781E+03  0.2374490E+03  0.2365045E+03  0.2355444E+03
+  0.2345683E+03  0.2335761E+03  0.2325671E+03  0.2315417E+03  0.2304997E+03
+  0.2294411E+03  0.2283660E+03  0.2272745E+03  0.2261672E+03  0.2250444E+03
+  0.2239065E+03  0.2227542E+03  0.2215883E+03  0.2204095E+03  0.2192188E+03
+  0.3207607E+03  0.3201557E+03  0.3195525E+03  0.3189500E+03  0.3183489E+03
+  0.3177490E+03  0.3171505E+03  0.3165531E+03  0.3159566E+03  0.3153612E+03
+  0.3147674E+03  0.3141744E+03  0.3135829E+03  0.3129921E+03  0.3124026E+03
+  0.3118138E+03  0.3112263E+03  0.3106400E+03  0.3100540E+03  0.3094699E+03
+  0.3088856E+03  0.3083029E+03  0.3077212E+03  0.3071402E+03  0.3065598E+03
+  0.3059802E+03  0.3054013E+03  0.3048240E+03  0.3042468E+03  0.3036700E+03
+  0.3030945E+03  0.3025199E+03  0.3019453E+03  0.3013715E+03  0.3007983E+03
+  0.3002261E+03  0.2996541E+03  0.2990821E+03  0.2985112E+03  0.2979411E+03
+  0.2973706E+03  0.2968008E+03  0.2962316E+03  0.2956628E+03  0.2950941E+03
+  0.2945258E+03  0.2939576E+03  0.2933899E+03  0.2928222E+03  0.2922545E+03
+  0.2916872E+03  0.2911198E+03  0.2905528E+03  0.2899855E+03  0.2894182E+03
+  0.2888508E+03  0.2882836E+03  0.2877159E+03  0.2871480E+03  0.2865800E+03
+  0.2860121E+03  0.2854436E+03  0.2848746E+03  0.2843050E+03  0.2837356E+03
+  0.2831650E+03  0.2825944E+03  0.2820229E+03  0.2814507E+03  0.2808777E+03
+  0.2803046E+03  0.2797299E+03  0.2791548E+03  0.2785786E+03  0.2780013E+03
+  0.2774228E+03  0.2768435E+03  0.2762629E+03  0.2756806E+03  0.2750974E+03
+  0.2745125E+03  0.2739262E+03  0.2733380E+03  0.2727484E+03  0.2721567E+03
+  0.2715634E+03  0.2709677E+03  0.2703705E+03  0.2697706E+03  0.2691689E+03
+  0.2685641E+03  0.2679576E+03  0.2673476E+03  0.2667354E+03  0.2661201E+03
+  0.2655018E+03  0.2648803E+03  0.2642556E+03  0.2636274E+03  0.2629951E+03
+  0.2623595E+03  0.2617195E+03  0.2610757E+03  0.2604273E+03  0.2597747E+03
+  0.2591169E+03  0.2584542E+03  0.2577863E+03  0.2571131E+03  0.2564341E+03
+  0.2557494E+03  0.2550582E+03  0.2543605E+03  0.2536561E+03  0.2529447E+03
+  0.2522260E+03  0.2514995E+03  0.2507650E+03  0.2500217E+03  0.2492699E+03
+  0.2485090E+03  0.2477389E+03  0.2469582E+03  0.2461673E+03  0.2453660E+03
+  0.2445530E+03  0.2437287E+03  0.2428922E+03  0.2420432E+03  0.2411811E+03
+  0.2403057E+03  0.2394160E+03  0.2385123E+03  0.2375936E+03  0.2366599E+03
+  0.2357106E+03  0.2347455E+03  0.2337640E+03  0.2327663E+03  0.2317520E+03
+  0.2307210E+03  0.2296735E+03  0.2286093E+03  0.2275287E+03  0.2264317E+03
+  0.2253191E+03  0.2241911E+03  0.2230483E+03  0.2218915E+03  0.2207213E+03
+  0.3209937E+03  0.3203900E+03  0.3197874E+03  0.3191863E+03  0.3185862E+03
+  0.3179874E+03  0.3173896E+03  0.3167934E+03  0.3161978E+03  0.3156042E+03
+  0.3150111E+03  0.3144196E+03  0.3138293E+03  0.3132395E+03  0.3126512E+03
+  0.3120635E+03  0.3114771E+03  0.3108918E+03  0.3103073E+03  0.3097245E+03
+  0.3091418E+03  0.3085606E+03  0.3079797E+03  0.3074003E+03  0.3068215E+03
+  0.3062435E+03  0.3056663E+03  0.3050896E+03  0.3045139E+03  0.3039396E+03
+  0.3033653E+03  0.3027919E+03  0.3022190E+03  0.3016474E+03  0.3010759E+03
+  0.3005049E+03  0.2999347E+03  0.2993651E+03  0.2987961E+03  0.2982270E+03
+  0.2976591E+03  0.2970912E+03  0.2965240E+03  0.2959569E+03  0.2953902E+03
+  0.2948244E+03  0.2942582E+03  0.2936927E+03  0.2931270E+03  0.2925618E+03
+  0.2919971E+03  0.2914319E+03  0.2908672E+03  0.2903023E+03  0.2897377E+03
+  0.2891729E+03  0.2886080E+03  0.2880428E+03  0.2874785E+03  0.2869130E+03
+  0.2863475E+03  0.2857819E+03  0.2852160E+03  0.2846500E+03  0.2840831E+03
+  0.2835160E+03  0.2829489E+03  0.2823804E+03  0.2818120E+03  0.2812426E+03
+  0.2806727E+03  0.2801018E+03  0.2795304E+03  0.2789580E+03  0.2783849E+03
+  0.2778105E+03  0.2772352E+03  0.2766584E+03  0.2760811E+03  0.2755020E+03
+  0.2749219E+03  0.2743401E+03  0.2737570E+03  0.2731722E+03  0.2725858E+03
+  0.2719976E+03  0.2714079E+03  0.2708159E+03  0.2702218E+03  0.2696260E+03
+  0.2690274E+03  0.2684271E+03  0.2678235E+03  0.2672182E+03  0.2666095E+03
+  0.2659983E+03  0.2653840E+03  0.2647666E+03  0.2641462E+03  0.2635220E+03
+  0.2628945E+03  0.2622632E+03  0.2616280E+03  0.2609890E+03  0.2603452E+03
+  0.2596974E+03  0.2590447E+03  0.2583870E+03  0.2577249E+03  0.2570569E+03
+  0.2563835E+03  0.2557042E+03  0.2550190E+03  0.2543275E+03  0.2536291E+03
+  0.2529241E+03  0.2522118E+03  0.2514921E+03  0.2507640E+03  0.2500281E+03
+  0.2492837E+03  0.2485302E+03  0.2477675E+03  0.2469950E+03  0.2462124E+03
+  0.2454192E+03  0.2446150E+03  0.2437993E+03  0.2429719E+03  0.2421322E+03
+  0.2412796E+03  0.2404137E+03  0.2395341E+03  0.2386404E+03  0.2377321E+03
+  0.2368089E+03  0.2358703E+03  0.2349160E+03  0.2339456E+03  0.2329590E+03
+  0.2319559E+03  0.2309361E+03  0.2298997E+03  0.2288464E+03  0.2277764E+03
+  0.2266904E+03  0.2255880E+03  0.2244701E+03  0.2233371E+03  0.2221895E+03
+  0.3212245E+03  0.3206209E+03  0.3200195E+03  0.3194191E+03  0.3188203E+03
+  0.3182223E+03  0.3176261E+03  0.3170307E+03  0.3164363E+03  0.3158435E+03
+  0.3152517E+03  0.3146616E+03  0.3140718E+03  0.3134836E+03  0.3128961E+03
+  0.3123103E+03  0.3117250E+03  0.3111405E+03  0.3105576E+03  0.3099755E+03
+  0.3093945E+03  0.3088144E+03  0.3082354E+03  0.3076567E+03  0.3070795E+03
+  0.3065031E+03  0.3059272E+03  0.3053525E+03  0.3047778E+03  0.3042047E+03
+  0.3036325E+03  0.3030608E+03  0.3024893E+03  0.3019189E+03  0.3013494E+03
+  0.3007802E+03  0.3002115E+03  0.2996437E+03  0.2990763E+03  0.2985096E+03
+  0.2979430E+03  0.2973769E+03  0.2968118E+03  0.2962468E+03  0.2956822E+03
+  0.2951180E+03  0.2945542E+03  0.2939908E+03  0.2934274E+03  0.2928642E+03
+  0.2923012E+03  0.2917389E+03  0.2911766E+03  0.2906139E+03  0.2900518E+03
+  0.2894894E+03  0.2889272E+03  0.2883647E+03  0.2878025E+03  0.2872399E+03
+  0.2866775E+03  0.2861149E+03  0.2855516E+03  0.2849881E+03  0.2844244E+03
+  0.2838607E+03  0.2832962E+03  0.2827315E+03  0.2821661E+03  0.2816002E+03
+  0.2810334E+03  0.2804666E+03  0.2798983E+03  0.2793299E+03  0.2787603E+03
+  0.2781900E+03  0.2776186E+03  0.2770463E+03  0.2764730E+03  0.2758979E+03
+  0.2753224E+03  0.2747451E+03  0.2741668E+03  0.2735866E+03  0.2730054E+03
+  0.2724219E+03  0.2718374E+03  0.2712508E+03  0.2706624E+03  0.2700722E+03
+  0.2694793E+03  0.2688849E+03  0.2682875E+03  0.2676885E+03  0.2670861E+03
+  0.2664819E+03  0.2658744E+03  0.2652641E+03  0.2646510E+03  0.2640345E+03
+  0.2634149E+03  0.2627915E+03  0.2621648E+03  0.2615341E+03  0.2608994E+03
+  0.2602607E+03  0.2596175E+03  0.2589699E+03  0.2583175E+03  0.2576602E+03
+  0.2569980E+03  0.2563297E+03  0.2556560E+03  0.2549769E+03  0.2542910E+03
+  0.2535986E+03  0.2528998E+03  0.2521940E+03  0.2514806E+03  0.2507594E+03
+  0.2500305E+03  0.2492933E+03  0.2485472E+03  0.2477920E+03  0.2470273E+03
+  0.2462524E+03  0.2454674E+03  0.2446717E+03  0.2438650E+03  0.2430463E+03
+  0.2422156E+03  0.2413725E+03  0.2405160E+03  0.2396465E+03  0.2387627E+03
+  0.2378647E+03  0.2369520E+03  0.2360240E+03  0.2350805E+03  0.2341212E+03
+  0.2331456E+03  0.2321534E+03  0.2311447E+03  0.2301193E+03  0.2290771E+03
+  0.2280183E+03  0.2269427E+03  0.2258511E+03  0.2247434E+03  0.2236202E+03
+  0.3214514E+03  0.3208495E+03  0.3202490E+03  0.3196495E+03  0.3190518E+03
+  0.3184547E+03  0.3178591E+03  0.3172652E+03  0.3166719E+03  0.3160800E+03
+  0.3154895E+03  0.3149002E+03  0.3143118E+03  0.3137245E+03  0.3131385E+03
+  0.3125535E+03  0.3119696E+03  0.3113864E+03  0.3108044E+03  0.3102235E+03
+  0.3096438E+03  0.3090647E+03  0.3084873E+03  0.3079100E+03  0.3073340E+03
+  0.3067586E+03  0.3061844E+03  0.3056113E+03  0.3050386E+03  0.3044662E+03
+  0.3038952E+03  0.3033253E+03  0.3027558E+03  0.3021869E+03  0.3016184E+03
+  0.3010509E+03  0.3004844E+03  0.2999181E+03  0.2993523E+03  0.2987871E+03
+  0.2982229E+03  0.2976585E+03  0.2970951E+03  0.2965322E+03  0.2959695E+03
+  0.2954073E+03  0.2948451E+03  0.2942838E+03  0.2937226E+03  0.2931618E+03
+  0.2926010E+03  0.2920405E+03  0.2914801E+03  0.2909204E+03  0.2903606E+03
+  0.2898004E+03  0.2892406E+03  0.2886811E+03  0.2881213E+03  0.2875612E+03
+  0.2870013E+03  0.2864410E+03  0.2858811E+03  0.2853207E+03  0.2847598E+03
+  0.2841984E+03  0.2836375E+03  0.2830756E+03  0.2825135E+03  0.2819511E+03
+  0.2813875E+03  0.2808238E+03  0.2802592E+03  0.2796943E+03  0.2791284E+03
+  0.2785620E+03  0.2779942E+03  0.2774258E+03  0.2768562E+03  0.2762859E+03
+  0.2757143E+03  0.2751417E+03  0.2745676E+03  0.2739919E+03  0.2734154E+03
+  0.2728367E+03  0.2722572E+03  0.2716757E+03  0.2710925E+03  0.2705074E+03
+  0.2699206E+03  0.2693317E+03  0.2687401E+03  0.2681472E+03  0.2675509E+03
+  0.2669531E+03  0.2663521E+03  0.2657488E+03  0.2651425E+03  0.2645333E+03
+  0.2639211E+03  0.2633053E+03  0.2626867E+03  0.2620641E+03  0.2614378E+03
+  0.2608079E+03  0.2601737E+03  0.2595356E+03  0.2588925E+03  0.2582451E+03
+  0.2575929E+03  0.2569356E+03  0.2562729E+03  0.2556051E+03  0.2549310E+03
+  0.2542512E+03  0.2535649E+03  0.2528721E+03  0.2521725E+03  0.2514659E+03
+  0.2507512E+03  0.2500290E+03  0.2492988E+03  0.2485600E+03  0.2478122E+03
+  0.2470548E+03  0.2462880E+03  0.2455112E+03  0.2447234E+03  0.2439252E+03
+  0.2431154E+03  0.2422937E+03  0.2414595E+03  0.2406130E+03  0.2397529E+03
+  0.2388792E+03  0.2379914E+03  0.2370890E+03  0.2361716E+03  0.2352387E+03
+  0.2342902E+03  0.2333255E+03  0.2323446E+03  0.2313469E+03  0.2303326E+03
+  0.2293015E+03  0.2282537E+03  0.2271892E+03  0.2261080E+03  0.2250108E+03
+  0.3216765E+03  0.3210758E+03  0.3204755E+03  0.3198774E+03  0.3192802E+03
+  0.3186845E+03  0.3180895E+03  0.3174969E+03  0.3169049E+03  0.3163135E+03
+  0.3157242E+03  0.3151358E+03  0.3145483E+03  0.3139623E+03  0.3133773E+03
+  0.3127934E+03  0.3122105E+03  0.3116291E+03  0.3110482E+03  0.3104684E+03
+  0.3098897E+03  0.3093121E+03  0.3087353E+03  0.3081602E+03  0.3075853E+03
+  0.3070115E+03  0.3064383E+03  0.3058663E+03  0.3052953E+03  0.3047247E+03
+  0.3041551E+03  0.3035860E+03  0.3030181E+03  0.3024510E+03  0.3018843E+03
+  0.3013182E+03  0.3007532E+03  0.3001885E+03  0.2996246E+03  0.2990610E+03
+  0.2984980E+03  0.2979362E+03  0.2973742E+03  0.2968130E+03  0.2962522E+03
+  0.2956917E+03  0.2951318E+03  0.2945725E+03  0.2940132E+03  0.2934542E+03
+  0.2928959E+03  0.2923378E+03  0.2917794E+03  0.2912215E+03  0.2906636E+03
+  0.2901065E+03  0.2895490E+03  0.2889914E+03  0.2884341E+03  0.2878767E+03
+  0.2873196E+03  0.2867620E+03  0.2862043E+03  0.2856466E+03  0.2850888E+03
+  0.2845309E+03  0.2839722E+03  0.2834134E+03  0.2828546E+03  0.2822947E+03
+  0.2817349E+03  0.2811742E+03  0.2806132E+03  0.2800513E+03  0.2794893E+03
+  0.2789262E+03  0.2783621E+03  0.2777978E+03  0.2772321E+03  0.2766657E+03
+  0.2760980E+03  0.2755295E+03  0.2749597E+03  0.2743887E+03  0.2738164E+03
+  0.2732427E+03  0.2726677E+03  0.2720910E+03  0.2715128E+03  0.2709326E+03
+  0.2703511E+03  0.2697674E+03  0.2691817E+03  0.2685943E+03  0.2680044E+03
+  0.2674124E+03  0.2668180E+03  0.2662210E+03  0.2656214E+03  0.2650190E+03
+  0.2644138E+03  0.2638053E+03  0.2631941E+03  0.2625793E+03  0.2619610E+03
+  0.2613394E+03  0.2607137E+03  0.2600843E+03  0.2594505E+03  0.2588128E+03
+  0.2581701E+03  0.2575230E+03  0.2568708E+03  0.2562135E+03  0.2555509E+03
+  0.2548824E+03  0.2542085E+03  0.2535281E+03  0.2528410E+03  0.2521475E+03
+  0.2514474E+03  0.2507391E+03  0.2500237E+03  0.2493003E+03  0.2485687E+03
+  0.2478278E+03  0.2470782E+03  0.2463190E+03  0.2455502E+03  0.2447709E+03
+  0.2439808E+03  0.2431796E+03  0.2423670E+03  0.2415419E+03  0.2407044E+03
+  0.2398542E+03  0.2389901E+03  0.2381122E+03  0.2372200E+03  0.2363130E+03
+  0.2353908E+03  0.2344530E+03  0.2334992E+03  0.2325294E+03  0.2315429E+03
+  0.2305397E+03  0.2295197E+03  0.2284830E+03  0.2274294E+03  0.2263591E+03
+  0.3218990E+03  0.3212989E+03  0.3207000E+03  0.3201022E+03  0.3195060E+03
+  0.3189113E+03  0.3183179E+03  0.3177255E+03  0.3171341E+03  0.3165443E+03
+  0.3159558E+03  0.3153684E+03  0.3147823E+03  0.3141973E+03  0.3136135E+03
+  0.3130304E+03  0.3124487E+03  0.3118680E+03  0.3112885E+03  0.3107103E+03
+  0.3101331E+03  0.3095563E+03  0.3089808E+03  0.3084063E+03  0.3078330E+03
+  0.3072605E+03  0.3066886E+03  0.3061179E+03  0.3055482E+03  0.3049788E+03
+  0.3044109E+03  0.3038435E+03  0.3032767E+03  0.3027108E+03  0.3021460E+03
+  0.3015817E+03  0.3010179E+03  0.3004548E+03  0.2998923E+03  0.2993309E+03
+  0.2987696E+03  0.2982090E+03  0.2976491E+03  0.2970896E+03  0.2965308E+03
+  0.2959722E+03  0.2954141E+03  0.2948565E+03  0.2942995E+03  0.2937425E+03
+  0.2931858E+03  0.2926297E+03  0.2920736E+03  0.2915182E+03  0.2909623E+03
+  0.2904070E+03  0.2898520E+03  0.2892971E+03  0.2887421E+03  0.2881870E+03
+  0.2876322E+03  0.2870773E+03  0.2865223E+03  0.2859673E+03  0.2854121E+03
+  0.2848563E+03  0.2843008E+03  0.2837451E+03  0.2831887E+03  0.2826324E+03
+  0.2820754E+03  0.2815181E+03  0.2809604E+03  0.2804017E+03  0.2798429E+03
+  0.2792831E+03  0.2787231E+03  0.2781618E+03  0.2776000E+03  0.2770372E+03
+  0.2764738E+03  0.2759091E+03  0.2753431E+03  0.2747768E+03  0.2742083E+03
+  0.2736393E+03  0.2730685E+03  0.2724969E+03  0.2719236E+03  0.2713484E+03
+  0.2707718E+03  0.2701933E+03  0.2696131E+03  0.2690308E+03  0.2684467E+03
+  0.2678605E+03  0.2672717E+03  0.2666812E+03  0.2660879E+03  0.2654918E+03
+  0.2648936E+03  0.2642921E+03  0.2636880E+03  0.2630804E+03  0.2624700E+03
+  0.2618561E+03  0.2612384E+03  0.2606175E+03  0.2599925E+03  0.2593634E+03
+  0.2587302E+03  0.2580925E+03  0.2574502E+03  0.2568029E+03  0.2561510E+03
+  0.2554939E+03  0.2548310E+03  0.2541622E+03  0.2534878E+03  0.2528065E+03
+  0.2521193E+03  0.2514252E+03  0.2507234E+03  0.2500145E+03  0.2492980E+03
+  0.2485730E+03  0.2478395E+03  0.2470974E+03  0.2463458E+03  0.2455847E+03
+  0.2448133E+03  0.2440315E+03  0.2432388E+03  0.2424346E+03  0.2416186E+03
+  0.2407903E+03  0.2399494E+03  0.2390952E+03  0.2382273E+03  0.2373452E+03
+  0.2364485E+03  0.2355368E+03  0.2346097E+03  0.2336668E+03  0.2327078E+03
+  0.2317324E+03  0.2307403E+03  0.2297314E+03  0.2287058E+03  0.2276632E+03
+  0.3221185E+03  0.3215196E+03  0.3209214E+03  0.3203247E+03  0.3197292E+03
+  0.3191355E+03  0.3185429E+03  0.3179514E+03  0.3173614E+03  0.3167725E+03
+  0.3161847E+03  0.3155985E+03  0.3150135E+03  0.3144294E+03  0.3138463E+03
+  0.3132643E+03  0.3126837E+03  0.3121044E+03  0.3115259E+03  0.3109488E+03
+  0.3103725E+03  0.3097974E+03  0.3092233E+03  0.3086495E+03  0.3080773E+03
+  0.3075059E+03  0.3069358E+03  0.3063665E+03  0.3057979E+03  0.3052302E+03
+  0.3046634E+03  0.3040975E+03  0.3035322E+03  0.3029680E+03  0.3024041E+03
+  0.3018411E+03  0.3012791E+03  0.3007178E+03  0.3001568E+03  0.2995963E+03
+  0.2990375E+03  0.2984783E+03  0.2979197E+03  0.2973618E+03  0.2968051E+03
+  0.2962482E+03  0.2956920E+03  0.2951363E+03  0.2945809E+03  0.2940260E+03
+  0.2934716E+03  0.2929171E+03  0.2923633E+03  0.2918095E+03  0.2912563E+03
+  0.2907034E+03  0.2901501E+03  0.2895974E+03  0.2890445E+03  0.2884922E+03
+  0.2879397E+03  0.2873872E+03  0.2868344E+03  0.2862820E+03  0.2857296E+03
+  0.2851767E+03  0.2846240E+03  0.2840704E+03  0.2835175E+03  0.2829638E+03
+  0.2824096E+03  0.2818555E+03  0.2813006E+03  0.2807454E+03  0.2801894E+03
+  0.2796336E+03  0.2790764E+03  0.2785189E+03  0.2779610E+03  0.2774016E+03
+  0.2768417E+03  0.2762808E+03  0.2757191E+03  0.2751563E+03  0.2745925E+03
+  0.2740276E+03  0.2734614E+03  0.2728939E+03  0.2723250E+03  0.2717546E+03
+  0.2711830E+03  0.2706093E+03  0.2700343E+03  0.2694572E+03  0.2688786E+03
+  0.2682978E+03  0.2677148E+03  0.2671300E+03  0.2665427E+03  0.2659532E+03
+  0.2653611E+03  0.2647662E+03  0.2641689E+03  0.2635684E+03  0.2629654E+03
+  0.2623587E+03  0.2617488E+03  0.2611358E+03  0.2605188E+03  0.2598985E+03
+  0.2592739E+03  0.2586453E+03  0.2580125E+03  0.2573751E+03  0.2567329E+03
+  0.2560860E+03  0.2554337E+03  0.2547764E+03  0.2541131E+03  0.2534443E+03
+  0.2527691E+03  0.2520875E+03  0.2513997E+03  0.2507041E+03  0.2500018E+03
+  0.2492920E+03  0.2485735E+03  0.2478473E+03  0.2471124E+03  0.2463684E+03
+  0.2456146E+03  0.2448512E+03  0.2440774E+03  0.2432932E+03  0.2424976E+03
+  0.2416906E+03  0.2408713E+03  0.2400395E+03  0.2391949E+03  0.2383366E+03
+  0.2374645E+03  0.2365780E+03  0.2356766E+03  0.2347602E+03  0.2338281E+03
+  0.2328800E+03  0.2319156E+03  0.2309347E+03  0.2299370E+03  0.2289223E+03
+  0.3223362E+03  0.3217372E+03  0.3211405E+03  0.3205443E+03  0.3199502E+03
+  0.3193571E+03  0.3187653E+03  0.3181750E+03  0.3175855E+03  0.3169979E+03
+  0.3164109E+03  0.3158253E+03  0.3152415E+03  0.3146585E+03  0.3140765E+03
+  0.3134954E+03  0.3129160E+03  0.3123375E+03  0.3117603E+03  0.3111839E+03
+  0.3106090E+03  0.3100350E+03  0.3094619E+03  0.3088900E+03  0.3083192E+03
+  0.3077487E+03  0.3071794E+03  0.3066113E+03  0.3060443E+03  0.3054778E+03
+  0.3049119E+03  0.3043474E+03  0.3037838E+03  0.3032206E+03  0.3026589E+03
+  0.3020971E+03  0.3015365E+03  0.3009766E+03  0.3004174E+03  0.2998589E+03
+  0.2993008E+03  0.2987432E+03  0.2981867E+03  0.2976306E+03  0.2970753E+03
+  0.2965202E+03  0.2959657E+03  0.2954117E+03  0.2948584E+03  0.2943051E+03
+  0.2937524E+03  0.2932003E+03  0.2926483E+03  0.2920965E+03  0.2915453E+03
+  0.2909941E+03  0.2904434E+03  0.2898929E+03  0.2893422E+03  0.2887920E+03
+  0.2882417E+03  0.2876918E+03  0.2871417E+03  0.2865916E+03  0.2860413E+03
+  0.2854912E+03  0.2849410E+03  0.2843908E+03  0.2838399E+03  0.2832889E+03
+  0.2827383E+03  0.2821865E+03  0.2816349E+03  0.2810826E+03  0.2805299E+03
+  0.2799769E+03  0.2794231E+03  0.2788690E+03  0.2783141E+03  0.2777587E+03
+  0.2772020E+03  0.2766451E+03  0.2760873E+03  0.2755282E+03  0.2749684E+03
+  0.2744073E+03  0.2738457E+03  0.2732825E+03  0.2727177E+03  0.2721519E+03
+  0.2715847E+03  0.2710160E+03  0.2704458E+03  0.2698737E+03  0.2693004E+03
+  0.2687246E+03  0.2681475E+03  0.2675680E+03  0.2669865E+03  0.2664029E+03
+  0.2658167E+03  0.2652283E+03  0.2646375E+03  0.2640436E+03  0.2634474E+03
+  0.2628477E+03  0.2622454E+03  0.2616399E+03  0.2610307E+03  0.2604182E+03
+  0.2598021E+03  0.2591820E+03  0.2585580E+03  0.2579299E+03  0.2572974E+03
+  0.2566601E+03  0.2560183E+03  0.2553712E+03  0.2547188E+03  0.2540611E+03
+  0.2533976E+03  0.2527286E+03  0.2520525E+03  0.2513706E+03  0.2506813E+03
+  0.2499854E+03  0.2492821E+03  0.2485704E+03  0.2478510E+03  0.2471233E+03
+  0.2463863E+03  0.2456403E+03  0.2448847E+03  0.2441190E+03  0.2433427E+03
+  0.2425558E+03  0.2417572E+03  0.2409468E+03  0.2401242E+03  0.2392889E+03
+  0.2384403E+03  0.2375781E+03  0.2367017E+03  0.2358107E+03  0.2349046E+03
+  0.2339832E+03  0.2330459E+03  0.2320925E+03  0.2311226E+03  0.2301361E+03
+  0.3225504E+03  0.3219531E+03  0.3213569E+03  0.3207617E+03  0.3201681E+03
+  0.3195757E+03  0.3189850E+03  0.3183953E+03  0.3178072E+03  0.3172203E+03
+  0.3166344E+03  0.3160499E+03  0.3154668E+03  0.3148845E+03  0.3143039E+03
+  0.3137240E+03  0.3131454E+03  0.3125680E+03  0.3119919E+03  0.3114165E+03
+  0.3108429E+03  0.3102697E+03  0.3096978E+03  0.3091273E+03  0.3085569E+03
+  0.3079882E+03  0.3074200E+03  0.3068529E+03  0.3062871E+03  0.3057220E+03
+  0.3051579E+03  0.3045946E+03  0.3040319E+03  0.3034702E+03  0.3029097E+03
+  0.3023496E+03  0.3017906E+03  0.3012318E+03  0.3006742E+03  0.3001172E+03
+  0.2995608E+03  0.2990045E+03  0.2984497E+03  0.2978953E+03  0.2973416E+03
+  0.2967881E+03  0.2962354E+03  0.2956831E+03  0.2951314E+03  0.2945801E+03
+  0.2940292E+03  0.2934785E+03  0.2929286E+03  0.2923792E+03  0.2918297E+03
+  0.2912804E+03  0.2907319E+03  0.2901833E+03  0.2896352E+03  0.2890872E+03
+  0.2885392E+03  0.2879911E+03  0.2874433E+03  0.2868960E+03  0.2863481E+03
+  0.2858003E+03  0.2852524E+03  0.2847043E+03  0.2841565E+03  0.2836086E+03
+  0.2830601E+03  0.2825117E+03  0.2819627E+03  0.2814134E+03  0.2808639E+03
+  0.2803135E+03  0.2797636E+03  0.2792122E+03  0.2786610E+03  0.2781086E+03
+  0.2775556E+03  0.2770021E+03  0.2764477E+03  0.2758925E+03  0.2753367E+03
+  0.2747794E+03  0.2742213E+03  0.2736621E+03  0.2731020E+03  0.2725407E+03
+  0.2719775E+03  0.2714136E+03  0.2708478E+03  0.2702808E+03  0.2697122E+03
+  0.2691416E+03  0.2685697E+03  0.2679951E+03  0.2674194E+03  0.2668415E+03
+  0.2662612E+03  0.2656789E+03  0.2650942E+03  0.2645066E+03  0.2639168E+03
+  0.2633242E+03  0.2627287E+03  0.2621301E+03  0.2615286E+03  0.2609240E+03
+  0.2603154E+03  0.2597034E+03  0.2590882E+03  0.2584684E+03  0.2578449E+03
+  0.2572169E+03  0.2565845E+03  0.2559474E+03  0.2553056E+03  0.2546584E+03
+  0.2540063E+03  0.2533481E+03  0.2526845E+03  0.2520145E+03  0.2513384E+03
+  0.2506554E+03  0.2499654E+03  0.2492686E+03  0.2485634E+03  0.2478510E+03
+  0.2471302E+03  0.2464003E+03  0.2456618E+03  0.2449137E+03  0.2441557E+03
+  0.2433876E+03  0.2426087E+03  0.2418189E+03  0.2410174E+03  0.2402037E+03
+  0.2393776E+03  0.2385386E+03  0.2376860E+03  0.2368195E+03  0.2359389E+03
+  0.2350433E+03  0.2341323E+03  0.2332057E+03  0.2322630E+03  0.2313042E+03
+  0.3227627E+03  0.3221658E+03  0.3215702E+03  0.3209764E+03  0.3203833E+03
+  0.3197926E+03  0.3192024E+03  0.3186134E+03  0.3180262E+03  0.3174403E+03
+  0.3168553E+03  0.3162713E+03  0.3156891E+03  0.3151082E+03  0.3145285E+03
+  0.3139496E+03  0.3133720E+03  0.3127957E+03  0.3122205E+03  0.3116463E+03
+  0.3110732E+03  0.3105013E+03  0.3099308E+03  0.3093607E+03  0.3087922E+03
+  0.3082245E+03  0.3076580E+03  0.3070920E+03  0.3065268E+03  0.3059630E+03
+  0.3054000E+03  0.3048383E+03  0.3042768E+03  0.3037165E+03  0.3031570E+03
+  0.3025987E+03  0.3020406E+03  0.3014839E+03  0.3009271E+03  0.3003714E+03
+  0.2998168E+03  0.2992627E+03  0.2987091E+03  0.2981560E+03  0.2976037E+03
+  0.2970522E+03  0.2965011E+03  0.2959503E+03  0.2954003E+03  0.2948506E+03
+  0.2943019E+03  0.2937531E+03  0.2932049E+03  0.2926573E+03  0.2921097E+03
+  0.2915629E+03  0.2910159E+03  0.2904692E+03  0.2899230E+03  0.2893770E+03
+  0.2888315E+03  0.2882856E+03  0.2877402E+03  0.2871945E+03  0.2866493E+03
+  0.2861039E+03  0.2855590E+03  0.2850133E+03  0.2844680E+03  0.2839220E+03
+  0.2833768E+03  0.2828308E+03  0.2822845E+03  0.2817384E+03  0.2811916E+03
+  0.2806445E+03  0.2800968E+03  0.2795490E+03  0.2790007E+03  0.2784517E+03
+  0.2779023E+03  0.2773520E+03  0.2768011E+03  0.2762498E+03  0.2756969E+03
+  0.2751437E+03  0.2745898E+03  0.2740342E+03  0.2734781E+03  0.2729206E+03
+  0.2723622E+03  0.2718023E+03  0.2712411E+03  0.2706787E+03  0.2701146E+03
+  0.2695492E+03  0.2689819E+03  0.2684128E+03  0.2678423E+03  0.2672697E+03
+  0.2666947E+03  0.2661182E+03  0.2655392E+03  0.2649579E+03  0.2643745E+03
+  0.2637880E+03  0.2631992E+03  0.2626079E+03  0.2620132E+03  0.2614155E+03
+  0.2608145E+03  0.2602106E+03  0.2596029E+03  0.2589916E+03  0.2583766E+03
+  0.2577576E+03  0.2571341E+03  0.2565065E+03  0.2558745E+03  0.2552374E+03
+  0.2545955E+03  0.2539483E+03  0.2532957E+03  0.2526375E+03  0.2519732E+03
+  0.2513027E+03  0.2506258E+03  0.2499420E+03  0.2492515E+03  0.2485528E+03
+  0.2478470E+03  0.2471331E+03  0.2464102E+03  0.2456790E+03  0.2449384E+03
+  0.2441881E+03  0.2434277E+03  0.2426573E+03  0.2418756E+03  0.2410828E+03
+  0.2402780E+03  0.2394611E+03  0.2386313E+03  0.2377884E+03  0.2369317E+03
+  0.2360609E+03  0.2351756E+03  0.2342751E+03  0.2333593E+03  0.2324276E+03
+  0.3229725E+03  0.3223766E+03  0.3217819E+03  0.3211890E+03  0.3205965E+03
+  0.3200063E+03  0.3194170E+03  0.3188288E+03  0.3182428E+03  0.3176576E+03
+  0.3170738E+03  0.3164905E+03  0.3159093E+03  0.3153295E+03  0.3147503E+03
+  0.3141725E+03  0.3135957E+03  0.3130205E+03  0.3124462E+03  0.3118732E+03
+  0.3113012E+03  0.3107301E+03  0.3101604E+03  0.3095919E+03  0.3090241E+03
+  0.3084576E+03  0.3078922E+03  0.3073275E+03  0.3067638E+03  0.3062010E+03
+  0.3056392E+03  0.3050783E+03  0.3045184E+03  0.3039594E+03  0.3034013E+03
+  0.3028439E+03  0.3022875E+03  0.3017320E+03  0.3011772E+03  0.3006229E+03
+  0.3000693E+03  0.2995164E+03  0.2989646E+03  0.2984132E+03  0.2978621E+03
+  0.2973123E+03  0.2967627E+03  0.2962137E+03  0.2956656E+03  0.2951173E+03
+  0.2945702E+03  0.2940235E+03  0.2934772E+03  0.2929312E+03  0.2923853E+03
+  0.2918402E+03  0.2912954E+03  0.2907508E+03  0.2902067E+03  0.2896626E+03
+  0.2891187E+03  0.2885753E+03  0.2880321E+03  0.2874892E+03  0.2869458E+03
+  0.2864024E+03  0.2858597E+03  0.2853167E+03  0.2847738E+03  0.2842308E+03
+  0.2836877E+03  0.2831441E+03  0.2826009E+03  0.2820570E+03  0.2815132E+03
+  0.2809693E+03  0.2804241E+03  0.2798796E+03  0.2793338E+03  0.2787886E+03
+  0.2782420E+03  0.2776950E+03  0.2771478E+03  0.2765993E+03  0.2760503E+03
+  0.2755009E+03  0.2749500E+03  0.2743987E+03  0.2738462E+03  0.2732928E+03
+  0.2727385E+03  0.2721827E+03  0.2716259E+03  0.2710678E+03  0.2705081E+03
+  0.2699475E+03  0.2693848E+03  0.2688207E+03  0.2682550E+03  0.2676877E+03
+  0.2671183E+03  0.2665471E+03  0.2659737E+03  0.2653984E+03  0.2648207E+03
+  0.2642403E+03  0.2636579E+03  0.2630727E+03  0.2624847E+03  0.2618940E+03
+  0.2613005E+03  0.2607039E+03  0.2601035E+03  0.2594999E+03  0.2588932E+03
+  0.2582822E+03  0.2576676E+03  0.2570491E+03  0.2564263E+03  0.2557987E+03
+  0.2551665E+03  0.2545298E+03  0.2538876E+03  0.2532407E+03  0.2525874E+03
+  0.2519291E+03  0.2512639E+03  0.2505930E+03  0.2499151E+03  0.2492308E+03
+  0.2485385E+03  0.2478393E+03  0.2471319E+03  0.2464162E+03  0.2456921E+03
+  0.2449587E+03  0.2442162E+03  0.2434637E+03  0.2427010E+03  0.2419278E+03
+  0.2411431E+03  0.2403473E+03  0.2395393E+03  0.2387186E+03  0.2378852E+03
+  0.2370382E+03  0.2361775E+03  0.2353022E+03  0.2344120E+03  0.2335067E+03
+  0.3231807E+03  0.3225849E+03  0.3219903E+03  0.3213983E+03  0.3208076E+03
+  0.3202176E+03  0.3196290E+03  0.3190419E+03  0.3184569E+03  0.3178724E+03
+  0.3172890E+03  0.3167075E+03  0.3161264E+03  0.3155473E+03  0.3149695E+03
+  0.3143927E+03  0.3138169E+03  0.3132425E+03  0.3126695E+03  0.3120970E+03
+  0.3115264E+03  0.3109565E+03  0.3103877E+03  0.3098198E+03  0.3092533E+03
+  0.3086880E+03  0.3081235E+03  0.3075601E+03  0.3069975E+03  0.3064362E+03
+  0.3058757E+03  0.3053157E+03  0.3047570E+03  0.3041991E+03  0.3036425E+03
+  0.3030865E+03  0.3025311E+03  0.3019767E+03  0.3014229E+03  0.3008703E+03
+  0.3003184E+03  0.2997671E+03  0.2992162E+03  0.2986665E+03  0.2981171E+03
+  0.2975689E+03  0.2970205E+03  0.2964733E+03  0.2959268E+03  0.2953803E+03
+  0.2948347E+03  0.2942892E+03  0.2937447E+03  0.2932007E+03  0.2926570E+03
+  0.2921136E+03  0.2915706E+03  0.2910277E+03  0.2904857E+03  0.2899439E+03
+  0.2894019E+03  0.2888605E+03  0.2883192E+03  0.2877780E+03  0.2872369E+03
+  0.2866966E+03  0.2861557E+03  0.2856153E+03  0.2850742E+03  0.2845335E+03
+  0.2839930E+03  0.2834525E+03  0.2829113E+03  0.2823705E+03  0.2818292E+03
+  0.2812876E+03  0.2807460E+03  0.2802038E+03  0.2796617E+03  0.2791187E+03
+  0.2785752E+03  0.2780318E+03  0.2774872E+03  0.2769426E+03  0.2763970E+03
+  0.2758504E+03  0.2753035E+03  0.2747557E+03  0.2742069E+03  0.2736573E+03
+  0.2731067E+03  0.2725551E+03  0.2720026E+03  0.2714482E+03  0.2708932E+03
+  0.2703367E+03  0.2697788E+03  0.2692197E+03  0.2686584E+03  0.2680958E+03
+  0.2675316E+03  0.2669656E+03  0.2663973E+03  0.2658278E+03  0.2652555E+03
+  0.2646812E+03  0.2641049E+03  0.2635255E+03  0.2629444E+03  0.2623603E+03
+  0.2617735E+03  0.2611834E+03  0.2605907E+03  0.2599948E+03  0.2593954E+03
+  0.2587926E+03  0.2581861E+03  0.2575761E+03  0.2569617E+03  0.2563431E+03
+  0.2557205E+03  0.2550935E+03  0.2544613E+03  0.2538243E+03  0.2531820E+03
+  0.2525347E+03  0.2518816E+03  0.2512224E+03  0.2505571E+03  0.2498852E+03
+  0.2492068E+03  0.2485207E+03  0.2478279E+03  0.2471270E+03  0.2464183E+03
+  0.2457013E+03  0.2449750E+03  0.2442399E+03  0.2434950E+03  0.2427405E+03
+  0.2419750E+03  0.2411991E+03  0.2404116E+03  0.2396123E+03  0.2388008E+03
+  0.2379767E+03  0.2371395E+03  0.2362881E+03  0.2354230E+03  0.2345431E+03
+  0.3233855E+03  0.3227918E+03  0.3221982E+03  0.3216064E+03  0.3210159E+03
+  0.3204271E+03  0.3198392E+03  0.3192526E+03  0.3186677E+03  0.3180848E+03
+  0.3175022E+03  0.3169214E+03  0.3163412E+03  0.3157629E+03  0.3151861E+03
+  0.3146104E+03  0.3140353E+03  0.3134621E+03  0.3128900E+03  0.3123187E+03
+  0.3117485E+03  0.3111797E+03  0.3106123E+03  0.3100453E+03  0.3094799E+03
+  0.3089153E+03  0.3083520E+03  0.3077894E+03  0.3072279E+03  0.3066678E+03
+  0.3061087E+03  0.3055501E+03  0.3049924E+03  0.3044359E+03  0.3038799E+03
+  0.3033255E+03  0.3027713E+03  0.3022184E+03  0.3016656E+03  0.3011147E+03
+  0.3005640E+03  0.3000141E+03  0.2994647E+03  0.2989163E+03  0.2983683E+03
+  0.2978214E+03  0.2972750E+03  0.2967294E+03  0.2961839E+03  0.2956390E+03
+  0.2950954E+03  0.2945518E+03  0.2940088E+03  0.2934661E+03  0.2929242E+03
+  0.2923826E+03  0.2918414E+03  0.2913007E+03  0.2907602E+03  0.2902200E+03
+  0.2896803E+03  0.2891412E+03  0.2886018E+03  0.2880629E+03  0.2875237E+03
+  0.2869852E+03  0.2864467E+03  0.2859084E+03  0.2853700E+03  0.2848319E+03
+  0.2842934E+03  0.2837548E+03  0.2832166E+03  0.2826781E+03  0.2821393E+03
+  0.2816010E+03  0.2810616E+03  0.2805226E+03  0.2799829E+03  0.2794424E+03
+  0.2789025E+03  0.2783615E+03  0.2778203E+03  0.2772786E+03  0.2767364E+03
+  0.2761932E+03  0.2756497E+03  0.2751053E+03  0.2745603E+03  0.2740143E+03
+  0.2734671E+03  0.2729198E+03  0.2723708E+03  0.2718208E+03  0.2712701E+03
+  0.2707175E+03  0.2701641E+03  0.2696092E+03  0.2690526E+03  0.2684952E+03
+  0.2679356E+03  0.2673741E+03  0.2668116E+03  0.2662471E+03  0.2656801E+03
+  0.2651115E+03  0.2645407E+03  0.2639675E+03  0.2633922E+03  0.2628141E+03
+  0.2622338E+03  0.2616506E+03  0.2610650E+03  0.2604758E+03  0.2598838E+03
+  0.2592883E+03  0.2586899E+03  0.2580876E+03  0.2574818E+03  0.2568720E+03
+  0.2562580E+03  0.2556402E+03  0.2550175E+03  0.2543901E+03  0.2537585E+03
+  0.2531212E+03  0.2524790E+03  0.2518311E+03  0.2511774E+03  0.2505176E+03
+  0.2498519E+03  0.2491793E+03  0.2484998E+03  0.2478130E+03  0.2471185E+03
+  0.2464167E+03  0.2457065E+03  0.2449873E+03  0.2442594E+03  0.2435220E+03
+  0.2427749E+03  0.2420178E+03  0.2412499E+03  0.2404708E+03  0.2396803E+03
+  0.2388778E+03  0.2380628E+03  0.2372348E+03  0.2363935E+03  0.2355381E+03
+  0.3235891E+03  0.3229945E+03  0.3224026E+03  0.3218117E+03  0.3212220E+03
+  0.3206332E+03  0.3200469E+03  0.3194610E+03  0.3188771E+03  0.3182941E+03
+  0.3177130E+03  0.3171330E+03  0.3165537E+03  0.3159766E+03  0.3154004E+03
+  0.3148253E+03  0.3142512E+03  0.3136791E+03  0.3131078E+03  0.3125372E+03
+  0.3119684E+03  0.3114005E+03  0.3108335E+03  0.3102682E+03  0.3097034E+03
+  0.3091401E+03  0.3085774E+03  0.3080161E+03  0.3074559E+03  0.3068965E+03
+  0.3063385E+03  0.3057814E+03  0.3052247E+03  0.3046695E+03  0.3041145E+03
+  0.3035612E+03  0.3030086E+03  0.3024567E+03  0.3019058E+03  0.3013554E+03
+  0.3008060E+03  0.3002575E+03  0.2997099E+03  0.2991625E+03  0.2986162E+03
+  0.2980706E+03  0.2975253E+03  0.2969811E+03  0.2964378E+03  0.2958943E+03
+  0.2953519E+03  0.2948102E+03  0.2942690E+03  0.2937280E+03  0.2931875E+03
+  0.2926476E+03  0.2921082E+03  0.2915693E+03  0.2910308E+03  0.2904926E+03
+  0.2899543E+03  0.2894168E+03  0.2888797E+03  0.2883429E+03  0.2878062E+03
+  0.2872696E+03  0.2867329E+03  0.2861965E+03  0.2856606E+03  0.2851249E+03
+  0.2845885E+03  0.2840527E+03  0.2835166E+03  0.2829804E+03  0.2824445E+03
+  0.2819080E+03  0.2813717E+03  0.2808351E+03  0.2802981E+03  0.2797610E+03
+  0.2792232E+03  0.2786855E+03  0.2781473E+03  0.2776086E+03  0.2770696E+03
+  0.2765296E+03  0.2759893E+03  0.2754485E+03  0.2749064E+03  0.2743640E+03
+  0.2738210E+03  0.2732767E+03  0.2727317E+03  0.2721857E+03  0.2716383E+03
+  0.2710903E+03  0.2705408E+03  0.2699901E+03  0.2694385E+03  0.2688850E+03
+  0.2683303E+03  0.2677740E+03  0.2672160E+03  0.2666562E+03  0.2660949E+03
+  0.2655316E+03  0.2649659E+03  0.2643984E+03  0.2638292E+03  0.2632568E+03
+  0.2626828E+03  0.2621061E+03  0.2615264E+03  0.2609439E+03  0.2603591E+03
+  0.2597711E+03  0.2591798E+03  0.2585852E+03  0.2579871E+03  0.2573857E+03
+  0.2567800E+03  0.2561707E+03  0.2555570E+03  0.2549390E+03  0.2543171E+03
+  0.2536897E+03  0.2530577E+03  0.2524207E+03  0.2517780E+03  0.2511297E+03
+  0.2504755E+03  0.2498152E+03  0.2491485E+03  0.2484752E+03  0.2477946E+03
+  0.2471065E+03  0.2464109E+03  0.2457074E+03  0.2449957E+03  0.2442749E+03
+  0.2435449E+03  0.2428054E+03  0.2420560E+03  0.2412961E+03  0.2405253E+03
+  0.2397434E+03  0.2389498E+03  0.2381437E+03  0.2373250E+03  0.2364930E+03
+  0.3237905E+03  0.3231973E+03  0.3226050E+03  0.3220146E+03  0.3214252E+03
+  0.3208380E+03  0.3202515E+03  0.3196671E+03  0.3190841E+03  0.3185019E+03
+  0.3179211E+03  0.3173418E+03  0.3167639E+03  0.3161870E+03  0.3156116E+03
+  0.3150375E+03  0.3144648E+03  0.3138929E+03  0.3133227E+03  0.3127534E+03
+  0.3121852E+03  0.3116182E+03  0.3110524E+03  0.3104879E+03  0.3099247E+03
+  0.3093619E+03  0.3088006E+03  0.3082404E+03  0.3076808E+03  0.3071225E+03
+  0.3065654E+03  0.3060092E+03  0.3054542E+03  0.3048996E+03  0.3043466E+03
+  0.3037939E+03  0.3032422E+03  0.3026915E+03  0.3021423E+03  0.3015932E+03
+  0.3010448E+03  0.3004978E+03  0.2999514E+03  0.2994056E+03  0.2988607E+03
+  0.2983164E+03  0.2977723E+03  0.2972299E+03  0.2966876E+03  0.2961462E+03
+  0.2956051E+03  0.2950647E+03  0.2945247E+03  0.2939858E+03  0.2934471E+03
+  0.2929089E+03  0.2923711E+03  0.2918336E+03  0.2912970E+03  0.2907606E+03
+  0.2902248E+03  0.2896887E+03  0.2891535E+03  0.2886180E+03  0.2880834E+03
+  0.2875490E+03  0.2870146E+03  0.2864804E+03  0.2859466E+03  0.2854124E+03
+  0.2848786E+03  0.2843448E+03  0.2838116E+03  0.2832779E+03  0.2827438E+03
+  0.2822104E+03  0.2816761E+03  0.2811422E+03  0.2806081E+03  0.2800734E+03
+  0.2795388E+03  0.2790038E+03  0.2784680E+03  0.2779326E+03  0.2773963E+03
+  0.2768594E+03  0.2763225E+03  0.2757845E+03  0.2752460E+03  0.2747072E+03
+  0.2741672E+03  0.2736262E+03  0.2730854E+03  0.2725427E+03  0.2719998E+03
+  0.2714554E+03  0.2709097E+03  0.2703632E+03  0.2698155E+03  0.2692662E+03
+  0.2687161E+03  0.2681644E+03  0.2676111E+03  0.2670562E+03  0.2664998E+03
+  0.2659413E+03  0.2653811E+03  0.2648193E+03  0.2642549E+03  0.2636887E+03
+  0.2631204E+03  0.2625495E+03  0.2619764E+03  0.2614005E+03  0.2608219E+03
+  0.2602405E+03  0.2596563E+03  0.2590689E+03  0.2584785E+03  0.2578845E+03
+  0.2572871E+03  0.2566859E+03  0.2560809E+03  0.2554717E+03  0.2548587E+03
+  0.2542408E+03  0.2536186E+03  0.2529915E+03  0.2523592E+03  0.2517219E+03
+  0.2510792E+03  0.2504304E+03  0.2497757E+03  0.2491146E+03  0.2484471E+03
+  0.2477730E+03  0.2470912E+03  0.2464021E+03  0.2457049E+03  0.2449999E+03
+  0.2442861E+03  0.2435634E+03  0.2428315E+03  0.2420898E+03  0.2413378E+03
+  0.2405753E+03  0.2398016E+03  0.2390165E+03  0.2382194E+03  0.2374098E+03
+  0.3239862E+03  0.3233954E+03  0.3228044E+03  0.3222159E+03  0.3216272E+03
+  0.3210397E+03  0.3204544E+03  0.3198711E+03  0.3192885E+03  0.3187070E+03
+  0.3181269E+03  0.3175490E+03  0.3169716E+03  0.3163958E+03  0.3158212E+03
+  0.3152476E+03  0.3146757E+03  0.3141045E+03  0.3135350E+03  0.3129670E+03
+  0.3123997E+03  0.3118340E+03  0.3112688E+03  0.3107053E+03  0.3101425E+03
+  0.3095811E+03  0.3090207E+03  0.3084614E+03  0.3079033E+03  0.3073459E+03
+  0.3067896E+03  0.3062345E+03  0.3056802E+03  0.3051274E+03  0.3045753E+03
+  0.3040238E+03  0.3034734E+03  0.3029238E+03  0.3023754E+03  0.3018278E+03
+  0.3012812E+03  0.3007350E+03  0.3001895E+03  0.2996451E+03  0.2991014E+03
+  0.2985587E+03  0.2980164E+03  0.2974745E+03  0.2969339E+03  0.2963938E+03
+  0.2958549E+03  0.2953160E+03  0.2947773E+03  0.2942396E+03  0.2937025E+03
+  0.2931659E+03  0.2926302E+03  0.2920946E+03  0.2915591E+03  0.2910244E+03
+  0.2904902E+03  0.2899564E+03  0.2894231E+03  0.2888898E+03  0.2883567E+03
+  0.2878239E+03  0.2872916E+03  0.2867596E+03  0.2862280E+03  0.2856961E+03
+  0.2851645E+03  0.2846324E+03  0.2841013E+03  0.2835695E+03  0.2830385E+03
+  0.2825069E+03  0.2819755E+03  0.2814440E+03  0.2809120E+03  0.2803803E+03
+  0.2798483E+03  0.2793159E+03  0.2787833E+03  0.2782502E+03  0.2777169E+03
+  0.2771835E+03  0.2766489E+03  0.2761143E+03  0.2755793E+03  0.2750432E+03
+  0.2745066E+03  0.2739697E+03  0.2734313E+03  0.2728929E+03  0.2723533E+03
+  0.2718122E+03  0.2712708E+03  0.2707283E+03  0.2701844E+03  0.2696394E+03
+  0.2690936E+03  0.2685459E+03  0.2679973E+03  0.2674471E+03  0.2668952E+03
+  0.2663417E+03  0.2657867E+03  0.2652297E+03  0.2646708E+03  0.2641101E+03
+  0.2635473E+03  0.2629821E+03  0.2624146E+03  0.2618449E+03  0.2612727E+03
+  0.2606978E+03  0.2601204E+03  0.2595400E+03  0.2589565E+03  0.2583699E+03
+  0.2577798E+03  0.2571868E+03  0.2565897E+03  0.2559891E+03  0.2553844E+03
+  0.2547755E+03  0.2541622E+03  0.2535452E+03  0.2529226E+03  0.2522955E+03
+  0.2516632E+03  0.2510254E+03  0.2503823E+03  0.2497332E+03  0.2490775E+03
+  0.2484160E+03  0.2477475E+03  0.2470721E+03  0.2463894E+03  0.2456987E+03
+  0.2450005E+03  0.2442936E+03  0.2435781E+03  0.2428534E+03  0.2421189E+03
+  0.2413750E+03  0.2406205E+03  0.2398550E+03  0.2390783E+03  0.2382901E+03
+  0.8999999E+10  0.3235944E+03  0.3230036E+03  0.3224138E+03  0.3218258E+03
+  0.3212402E+03  0.3206551E+03  0.3200728E+03  0.3194904E+03  0.3189099E+03
+  0.3183304E+03  0.3177533E+03  0.3171769E+03  0.3166019E+03  0.3160278E+03
+  0.3154553E+03  0.3148843E+03  0.3143137E+03  0.3137451E+03  0.3131777E+03
+  0.3126116E+03  0.3120465E+03  0.3114825E+03  0.3109200E+03  0.3103581E+03
+  0.3097976E+03  0.3092384E+03  0.3086801E+03  0.3081228E+03  0.3075665E+03
+  0.3070114E+03  0.3064568E+03  0.3059038E+03  0.3053517E+03  0.3048009E+03
+  0.3042506E+03  0.3037017E+03  0.3031530E+03  0.3026057E+03  0.3020590E+03
+  0.3015135E+03  0.3009688E+03  0.3004250E+03  0.2998817E+03  0.2993394E+03
+  0.2987978E+03  0.2982567E+03  0.2977169E+03  0.2971775E+03  0.2966385E+03
+  0.2961002E+03  0.2955630E+03  0.2950264E+03  0.2944904E+03  0.2939549E+03
+  0.2934197E+03  0.2928851E+03  0.2923514E+03  0.2918179E+03  0.2912847E+03
+  0.2907519E+03  0.2902196E+03  0.2896882E+03  0.2891567E+03  0.2886256E+03
+  0.2880951E+03  0.2875647E+03  0.2870341E+03  0.2865043E+03  0.2859745E+03
+  0.2854452E+03  0.2849158E+03  0.2843865E+03  0.2838575E+03  0.2833277E+03
+  0.2827988E+03  0.2822700E+03  0.2817405E+03  0.2812114E+03  0.2806819E+03
+  0.2801522E+03  0.2796225E+03  0.2790925E+03  0.2785622E+03  0.2780318E+03
+  0.2775007E+03  0.2769696E+03  0.2764379E+03  0.2759055E+03  0.2753729E+03
+  0.2748393E+03  0.2743055E+03  0.2737708E+03  0.2732358E+03  0.2726994E+03
+  0.2721623E+03  0.2716245E+03  0.2710855E+03  0.2705460E+03  0.2700049E+03
+  0.2694627E+03  0.2689194E+03  0.2683751E+03  0.2678292E+03  0.2672820E+03
+  0.2667331E+03  0.2661830E+03  0.2656306E+03  0.2650768E+03  0.2645213E+03
+  0.2639634E+03  0.2634040E+03  0.2628425E+03  0.2622787E+03  0.2617124E+03
+  0.2611437E+03  0.2605720E+03  0.2599983E+03  0.2594216E+03  0.2588419E+03
+  0.2582596E+03  0.2576734E+03  0.2570842E+03  0.2564913E+03  0.2558949E+03
+  0.2552945E+03  0.2546901E+03  0.2540820E+03  0.2534687E+03  0.2528513E+03
+  0.2522289E+03  0.2516016E+03  0.2509692E+03  0.2503311E+03  0.2496874E+03
+  0.2490377E+03  0.2483819E+03  0.2477190E+03  0.2470497E+03  0.2463729E+03
+  0.2456890E+03  0.2449973E+03  0.2442971E+03  0.2435887E+03  0.2428711E+03
+  0.2421444E+03  0.2414080E+03  0.2406610E+03  0.2399039E+03  0.2391356E+03
+  0.8999999E+10  0.3237857E+03  0.3231994E+03  0.3226109E+03  0.3220236E+03
+  0.3214381E+03  0.3208542E+03  0.3202716E+03  0.3196906E+03  0.3191102E+03
+  0.3185320E+03  0.3179554E+03  0.3173794E+03  0.3168052E+03  0.3162325E+03
+  0.3156605E+03  0.3150904E+03  0.3145209E+03  0.3139529E+03  0.3133861E+03
+  0.3128206E+03  0.3122565E+03  0.3116935E+03  0.3111319E+03  0.3105708E+03
+  0.3100115E+03  0.3094526E+03  0.3088955E+03  0.3083392E+03  0.3077841E+03
+  0.3072302E+03  0.3066770E+03  0.3061249E+03  0.3055735E+03  0.3050235E+03
+  0.3044745E+03  0.3039267E+03  0.3033792E+03  0.3028329E+03  0.3022880E+03
+  0.3017431E+03  0.3011995E+03  0.3006567E+03  0.3001151E+03  0.2995738E+03
+  0.2990334E+03  0.2984940E+03  0.2979548E+03  0.2974172E+03  0.2968799E+03
+  0.2963434E+03  0.2958068E+03  0.2952715E+03  0.2947367E+03  0.2942032E+03
+  0.2936696E+03  0.2931364E+03  0.2926039E+03  0.2920719E+03  0.2915409E+03
+  0.2910099E+03  0.2904796E+03  0.2899493E+03  0.2894198E+03  0.2888906E+03
+  0.2883616E+03  0.2878332E+03  0.2873049E+03  0.2867766E+03  0.2862487E+03
+  0.2857211E+03  0.2851938E+03  0.2846667E+03  0.2841396E+03  0.2836129E+03
+  0.2830858E+03  0.2825588E+03  0.2820320E+03  0.2815049E+03  0.2809780E+03
+  0.2804512E+03  0.2799237E+03  0.2793964E+03  0.2788689E+03  0.2783406E+03
+  0.2778128E+03  0.2772842E+03  0.2767552E+03  0.2762260E+03  0.2756962E+03
+  0.2751658E+03  0.2746351E+03  0.2741036E+03  0.2735716E+03  0.2730390E+03
+  0.2725052E+03  0.2719709E+03  0.2714358E+03  0.2708995E+03  0.2703623E+03
+  0.2698243E+03  0.2692850E+03  0.2687446E+03  0.2682027E+03  0.2676599E+03
+  0.2671156E+03  0.2665698E+03  0.2660225E+03  0.2654737E+03  0.2649226E+03
+  0.2643703E+03  0.2638162E+03  0.2632598E+03  0.2627011E+03  0.2621407E+03
+  0.2615779E+03  0.2610129E+03  0.2604452E+03  0.2598749E+03  0.2593017E+03
+  0.2587260E+03  0.2581470E+03  0.2575647E+03  0.2569798E+03  0.2563909E+03
+  0.2557986E+03  0.2552029E+03  0.2546027E+03  0.2539985E+03  0.2533903E+03
+  0.2527774E+03  0.2521600E+03  0.2515376E+03  0.2509100E+03  0.2502775E+03
+  0.2496389E+03  0.2489945E+03  0.2483443E+03  0.2476872E+03  0.2470239E+03
+  0.2463536E+03  0.2456756E+03  0.2449905E+03  0.2442969E+03  0.2435954E+03
+  0.2428849E+03  0.2421654E+03  0.2414364E+03  0.2406974E+03  0.2399481E+03
+  0.8999999E+10  0.8999999E+10  0.3233897E+03  0.3228040E+03  0.3222179E+03
+  0.3216338E+03  0.3210503E+03  0.3204682E+03  0.3198882E+03  0.3193093E+03
+  0.3187312E+03  0.3181553E+03  0.3175802E+03  0.3170066E+03  0.3164343E+03
+  0.3158631E+03  0.3152934E+03  0.3147251E+03  0.3141585E+03  0.3135926E+03
+  0.3130279E+03  0.3124643E+03  0.3119025E+03  0.3113410E+03  0.3107811E+03
+  0.3102225E+03  0.3096650E+03  0.3091086E+03  0.3085531E+03  0.3079992E+03
+  0.3074461E+03  0.3068938E+03  0.3063430E+03  0.3057928E+03  0.3052437E+03
+  0.3046957E+03  0.3041487E+03  0.3036024E+03  0.3030576E+03  0.3025135E+03
+  0.3019702E+03  0.3014271E+03  0.3008857E+03  0.3003451E+03  0.2998052E+03
+  0.2992663E+03  0.2987280E+03  0.2981906E+03  0.2976534E+03  0.2971175E+03
+  0.2965822E+03  0.2960478E+03  0.2955135E+03  0.2949803E+03  0.2944477E+03
+  0.2939160E+03  0.2933844E+03  0.2928534E+03  0.2923228E+03  0.2917934E+03
+  0.2912639E+03  0.2907352E+03  0.2902066E+03  0.2896790E+03  0.2891515E+03
+  0.2886239E+03  0.2880973E+03  0.2875709E+03  0.2870447E+03  0.2865190E+03
+  0.2859935E+03  0.2854676E+03  0.2849423E+03  0.2844177E+03  0.2838929E+03
+  0.2833680E+03  0.2828434E+03  0.2823185E+03  0.2817939E+03  0.2812695E+03
+  0.2807444E+03  0.2802199E+03  0.2796946E+03  0.2791696E+03  0.2786444E+03
+  0.2781187E+03  0.2775929E+03  0.2770670E+03  0.2765404E+03  0.2760136E+03
+  0.2754865E+03  0.2749585E+03  0.2744300E+03  0.2739014E+03  0.2733717E+03
+  0.2728413E+03  0.2723105E+03  0.2717789E+03  0.2712459E+03  0.2707126E+03
+  0.2701783E+03  0.2696426E+03  0.2691061E+03  0.2685688E+03  0.2680297E+03
+  0.2674898E+03  0.2669482E+03  0.2664055E+03  0.2658610E+03  0.2653151E+03
+  0.2647676E+03  0.2642182E+03  0.2636667E+03  0.2631140E+03  0.2625584E+03
+  0.2620013E+03  0.2614420E+03  0.2608803E+03  0.2603159E+03  0.2597494E+03
+  0.2591798E+03  0.2586078E+03  0.2580328E+03  0.2574547E+03  0.2568734E+03
+  0.2562887E+03  0.2557005E+03  0.2551085E+03  0.2545127E+03  0.2539133E+03
+  0.2533094E+03  0.2527012E+03  0.2520885E+03  0.2514708E+03  0.2508484E+03
+  0.2502205E+03  0.2495875E+03  0.2489485E+03  0.2483036E+03  0.2476526E+03
+  0.2469949E+03  0.2463305E+03  0.2456588E+03  0.2449800E+03  0.2442931E+03
+  0.2435982E+03  0.2428949E+03  0.2421823E+03  0.2414605E+03  0.2407294E+03
+  0.8999999E+10  0.8999999E+10  0.8999999E+10  0.3230028E+03  0.3224122E+03
+  0.3218277E+03  0.3212447E+03  0.3206636E+03  0.3200836E+03  0.3195050E+03
+  0.3189283E+03  0.3183529E+03  0.3177787E+03  0.3172054E+03  0.3166344E+03
+  0.3160642E+03  0.3154950E+03  0.3149272E+03  0.3143609E+03  0.3137963E+03
+  0.3132323E+03  0.3126699E+03  0.3121087E+03  0.3115485E+03  0.3109892E+03
+  0.3104314E+03  0.3098745E+03  0.3093192E+03  0.3087646E+03  0.3082115E+03
+  0.3076593E+03  0.3071082E+03  0.3065584E+03  0.3060093E+03  0.3054613E+03
+  0.3049145E+03  0.3043682E+03  0.3038229E+03  0.3032789E+03  0.3027357E+03
+  0.3021938E+03  0.3016526E+03  0.3011121E+03  0.3005720E+03  0.3000333E+03
+  0.2994954E+03  0.2989587E+03  0.2984222E+03  0.2978870E+03  0.2973521E+03
+  0.2968178E+03  0.2962849E+03  0.2957524E+03  0.2952206E+03  0.2946889E+03
+  0.2941585E+03  0.2936282E+03  0.2930994E+03  0.2925704E+03  0.2920423E+03
+  0.2915141E+03  0.2909870E+03  0.2904604E+03  0.2899343E+03  0.2894084E+03
+  0.2888829E+03  0.2883580E+03  0.2878331E+03  0.2873086E+03  0.2867843E+03
+  0.2862611E+03  0.2857375E+03  0.2852144E+03  0.2846913E+03  0.2841681E+03
+  0.2836456E+03  0.2831229E+03  0.2826006E+03  0.2820778E+03  0.2815556E+03
+  0.2810333E+03  0.2805105E+03  0.2799879E+03  0.2794655E+03  0.2789425E+03
+  0.2784196E+03  0.2778965E+03  0.2773729E+03  0.2768492E+03  0.2763250E+03
+  0.2758006E+03  0.2752756E+03  0.2747506E+03  0.2742243E+03  0.2736980E+03
+  0.2731712E+03  0.2726433E+03  0.2721147E+03  0.2715858E+03  0.2710557E+03
+  0.2705247E+03  0.2699934E+03  0.2694605E+03  0.2689266E+03  0.2683918E+03
+  0.2678558E+03  0.2673187E+03  0.2667798E+03  0.2662396E+03  0.2656986E+03
+  0.2651553E+03  0.2646107E+03  0.2640648E+03  0.2635168E+03  0.2629666E+03
+  0.2624149E+03  0.2618612E+03  0.2613049E+03  0.2607465E+03  0.2601858E+03
+  0.2596227E+03  0.2590568E+03  0.2584883E+03  0.2579167E+03  0.2573423E+03
+  0.2567653E+03  0.2561843E+03  0.2556001E+03  0.2550124E+03  0.2544214E+03
+  0.2538258E+03  0.2532262E+03  0.2526227E+03  0.2520145E+03  0.2514017E+03
+  0.2507840E+03  0.2501615E+03  0.2495332E+03  0.2488999E+03  0.2482601E+03
+  0.2476148E+03  0.2469631E+03  0.2463042E+03  0.2456385E+03  0.2449661E+03
+  0.2442856E+03  0.2435974E+03  0.2429006E+03  0.2421952E+03  0.2414808E+03
+  0.8999999E+10  0.8999999E+10  0.8999999E+10  0.8999999E+10  0.3226006E+03
+  0.3220179E+03  0.3214376E+03  0.3208557E+03  0.3202767E+03  0.3196991E+03
+  0.3191229E+03  0.3185481E+03  0.3179749E+03  0.3174029E+03  0.3168318E+03
+  0.3162621E+03  0.3156940E+03  0.3151273E+03  0.3145618E+03  0.3139975E+03
+  0.3134343E+03  0.3128728E+03  0.3123120E+03  0.3117529E+03  0.3111947E+03
+  0.3106381E+03  0.3100822E+03  0.3095270E+03  0.3089738E+03  0.3084216E+03
+  0.3078701E+03  0.3073200E+03  0.3067706E+03  0.3062231E+03  0.3056758E+03
+  0.3051302E+03  0.3045849E+03  0.3040409E+03  0.3034977E+03  0.3029555E+03
+  0.3024144E+03  0.3018744E+03  0.3013350E+03  0.3007968E+03  0.3002589E+03
+  0.2997223E+03  0.2991865E+03  0.2986513E+03  0.2981169E+03  0.2975835E+03
+  0.2970509E+03  0.2965189E+03  0.2959874E+03  0.2954569E+03  0.2949273E+03
+  0.2943982E+03  0.2938691E+03  0.2933411E+03  0.2928138E+03  0.2922874E+03
+  0.2917611E+03  0.2912354E+03  0.2907102E+03  0.2901853E+03  0.2896611E+03
+  0.2891372E+03  0.2886144E+03  0.2880912E+03  0.2875688E+03  0.2870462E+03
+  0.2865241E+03  0.2860025E+03  0.2854813E+03  0.2849604E+03  0.2844395E+03
+  0.2839189E+03  0.2833982E+03  0.2828773E+03  0.2823575E+03  0.2818372E+03
+  0.2813168E+03  0.2807967E+03  0.2802765E+03  0.2797560E+03  0.2792357E+03
+  0.2787154E+03  0.2781944E+03  0.2776737E+03  0.2771523E+03  0.2766307E+03
+  0.2761093E+03  0.2755871E+03  0.2750645E+03  0.2745415E+03  0.2740181E+03
+  0.2734941E+03  0.2729694E+03  0.2724445E+03  0.2719185E+03  0.2713918E+03
+  0.2708646E+03  0.2703363E+03  0.2698069E+03  0.2692770E+03  0.2687460E+03
+  0.2682139E+03  0.2676806E+03  0.2671465E+03  0.2666106E+03  0.2660732E+03
+  0.2655347E+03  0.2649950E+03  0.2644532E+03  0.2639097E+03  0.2633649E+03
+  0.2628183E+03  0.2622693E+03  0.2617185E+03  0.2611659E+03  0.2606109E+03
+  0.2600537E+03  0.2594940E+03  0.2589317E+03  0.2583670E+03  0.2577991E+03
+  0.2572287E+03  0.2566551E+03  0.2560782E+03  0.2554980E+03  0.2549141E+03
+  0.2543269E+03  0.2537360E+03  0.2531409E+03  0.2525417E+03  0.2519383E+03
+  0.2513298E+03  0.2507173E+03  0.2500993E+03  0.2494767E+03  0.2488478E+03
+  0.2482139E+03  0.2475738E+03  0.2469276E+03  0.2462746E+03  0.2456152E+03
+  0.2449487E+03  0.2442744E+03  0.2435925E+03  0.2429027E+03  0.2422042E+03
+  0.8999999E+10  0.8999999E+10  0.8999999E+10  0.8999999E+10  0.8999999E+10
+  0.3222098E+03  0.3216255E+03  0.3210467E+03  0.3204680E+03  0.3198916E+03
+  0.3193160E+03  0.3187419E+03  0.3181684E+03  0.3175975E+03  0.3170271E+03
+  0.3164586E+03  0.3158910E+03  0.3153254E+03  0.3147602E+03  0.3141969E+03
+  0.3136345E+03  0.3130734E+03  0.3125137E+03  0.3119552E+03  0.3113979E+03
+  0.3108418E+03  0.3102867E+03  0.3097330E+03  0.3091802E+03  0.3086289E+03
+  0.3080784E+03  0.3075292E+03  0.3069812E+03  0.3064339E+03  0.3058876E+03
+  0.3053432E+03  0.3047990E+03  0.3042560E+03  0.3037139E+03  0.3031725E+03
+  0.3026324E+03  0.3020932E+03  0.3015551E+03  0.3010179E+03  0.3004817E+03
+  0.2999460E+03  0.2994110E+03  0.2988772E+03  0.2983440E+03  0.2978121E+03
+  0.2972803E+03  0.2967499E+03  0.2962194E+03  0.2956901E+03  0.2951619E+03
+  0.2946341E+03  0.2941069E+03  0.2935804E+03  0.2930541E+03  0.2925289E+03
+  0.2920042E+03  0.2914802E+03  0.2909564E+03  0.2904332E+03  0.2899105E+03
+  0.2893884E+03  0.2888665E+03  0.2883455E+03  0.2878247E+03  0.2873041E+03
+  0.2867840E+03  0.2862639E+03  0.2857441E+03  0.2852249E+03  0.2847059E+03
+  0.2841876E+03  0.2836688E+03  0.2831507E+03  0.2826320E+03  0.2821139E+03
+  0.2815959E+03  0.2810776E+03  0.2805594E+03  0.2800417E+03  0.2795236E+03
+  0.2790051E+03  0.2784874E+03  0.2779686E+03  0.2774499E+03  0.2769313E+03
+  0.2764122E+03  0.2758926E+03  0.2753730E+03  0.2748528E+03  0.2743322E+03
+  0.2738112E+03  0.2732897E+03  0.2727676E+03  0.2722447E+03  0.2717218E+03
+  0.2711973E+03  0.2706725E+03  0.2701471E+03  0.2696204E+03  0.2690927E+03
+  0.2685646E+03  0.2680352E+03  0.2675049E+03  0.2669727E+03  0.2664397E+03
+  0.2659059E+03  0.2653701E+03  0.2648329E+03  0.2642942E+03  0.2637541E+03
+  0.2632123E+03  0.2626685E+03  0.2621228E+03  0.2615754E+03  0.2610259E+03
+  0.2604742E+03  0.2599202E+03  0.2593639E+03  0.2588051E+03  0.2582438E+03
+  0.2576797E+03  0.2571129E+03  0.2565429E+03  0.2559700E+03  0.2553937E+03
+  0.2548140E+03  0.2542309E+03  0.2536441E+03  0.2530535E+03  0.2524585E+03
+  0.2518596E+03  0.2512561E+03  0.2506479E+03  0.2500353E+03  0.2494167E+03
+  0.2487936E+03  0.2481647E+03  0.2475300E+03  0.2468892E+03  0.2462420E+03
+  0.2455885E+03  0.2449279E+03  0.2442599E+03  0.2435844E+03  0.2429011E+03
+  0.8999999E+10  0.8999999E+10  0.8999999E+10  0.8999999E+10  0.8999999E+10
+  0.3223920E+03  0.3218184E+03  0.3212359E+03  0.3206581E+03  0.3200815E+03
+  0.3195058E+03  0.3189323E+03  0.3183611E+03  0.3177897E+03  0.3172209E+03
+  0.3166523E+03  0.3160858E+03  0.3155206E+03  0.3149567E+03  0.3143935E+03
+  0.3138326E+03  0.3132721E+03  0.3127131E+03  0.3121553E+03  0.3115984E+03
+  0.3110437E+03  0.3104893E+03  0.3099363E+03  0.3093847E+03  0.3088338E+03
+  0.3082841E+03  0.3077359E+03  0.3071886E+03  0.3066425E+03  0.3060970E+03
+  0.3055532E+03  0.3050099E+03  0.3044685E+03  0.3039274E+03  0.3033873E+03
+  0.3028481E+03  0.3023096E+03  0.3017724E+03  0.3012364E+03  0.3007011E+03
+  0.3001665E+03  0.2996330E+03  0.2991002E+03  0.2985684E+03  0.2980371E+03
+  0.2975068E+03  0.2969777E+03  0.2964486E+03  0.2959206E+03  0.2953932E+03
+  0.2948666E+03  0.2943412E+03  0.2938159E+03  0.2932915E+03  0.2927674E+03
+  0.2922436E+03  0.2917210E+03  0.2911990E+03  0.2906777E+03  0.2901565E+03
+  0.2896359E+03  0.2891154E+03  0.2885959E+03  0.2880764E+03  0.2875577E+03
+  0.2870395E+03  0.2865211E+03  0.2860036E+03  0.2854859E+03  0.2849688E+03
+  0.2844519E+03  0.2839352E+03  0.2834187E+03  0.2829025E+03  0.2823863E+03
+  0.2818700E+03  0.2813543E+03  0.2808386E+03  0.2803225E+03  0.2798068E+03
+  0.2792908E+03  0.2787749E+03  0.2782591E+03  0.2777428E+03  0.2772259E+03
+  0.2767097E+03  0.2761928E+03  0.2756756E+03  0.2751584E+03  0.2746409E+03
+  0.2741223E+03  0.2736036E+03  0.2730847E+03  0.2725649E+03  0.2720446E+03
+  0.2715237E+03  0.2710022E+03  0.2704799E+03  0.2699566E+03  0.2694329E+03
+  0.2689081E+03  0.2683822E+03  0.2678554E+03  0.2673278E+03  0.2667988E+03
+  0.2662684E+03  0.2657370E+03  0.2652043E+03  0.2646701E+03  0.2641343E+03
+  0.2635968E+03  0.2630582E+03  0.2625177E+03  0.2619752E+03  0.2614311E+03
+  0.2608845E+03  0.2603360E+03  0.2597857E+03  0.2592325E+03  0.2586771E+03
+  0.2581192E+03  0.2575585E+03  0.2569956E+03  0.2564294E+03  0.2558603E+03
+  0.2552879E+03  0.2547122E+03  0.2541329E+03  0.2535500E+03  0.2529638E+03
+  0.2523733E+03  0.2517785E+03  0.2511796E+03  0.2505762E+03  0.2499677E+03
+  0.2493548E+03  0.2487364E+03  0.2481127E+03  0.2474834E+03  0.2468478E+03
+  0.2462065E+03  0.2455585E+03  0.2449039E+03  0.2442420E+03  0.2435727E+03
+  0.8999999E+10  0.8999999E+10  0.8999999E+10  0.8999999E+10  0.8999999E+10
+  0.8999999E+10  0.3219957E+03  0.3214211E+03  0.3208443E+03  0.3202687E+03
+  0.3196947E+03  0.3191218E+03  0.3185506E+03  0.3179805E+03  0.3174117E+03
+  0.3168443E+03  0.3162787E+03  0.3157137E+03  0.3151507E+03  0.3145882E+03
+  0.3140279E+03  0.3134680E+03  0.3129100E+03  0.3123530E+03  0.3117970E+03
+  0.3112428E+03  0.3106894E+03  0.3101374E+03  0.3095866E+03  0.3090367E+03
+  0.3084883E+03  0.3079402E+03  0.3073940E+03  0.3068483E+03  0.3063043E+03
+  0.3057611E+03  0.3052188E+03  0.3046780E+03  0.3041378E+03  0.3035990E+03
+  0.3030611E+03  0.3025239E+03  0.3019873E+03  0.3014520E+03  0.3009177E+03
+  0.3003843E+03  0.2998524E+03  0.2993205E+03  0.2987896E+03  0.2982596E+03
+  0.2977302E+03  0.2972022E+03  0.2966748E+03  0.2961481E+03  0.2956219E+03
+  0.2950964E+03  0.2945718E+03  0.2940479E+03  0.2935250E+03  0.2930023E+03
+  0.2924807E+03  0.2919591E+03  0.2914380E+03  0.2909180E+03  0.2903985E+03
+  0.2898795E+03  0.2893608E+03  0.2888427E+03  0.2883250E+03  0.2878075E+03
+  0.2872910E+03  0.2867743E+03  0.2862586E+03  0.2857429E+03  0.2852274E+03
+  0.2847122E+03  0.2841974E+03  0.2836828E+03  0.2831684E+03  0.2826542E+03
+  0.2821405E+03  0.2816261E+03  0.2811125E+03  0.2805988E+03  0.2800851E+03
+  0.2795711E+03  0.2790578E+03  0.2785440E+03  0.2780298E+03  0.2775163E+03
+  0.2770021E+03  0.2764874E+03  0.2759734E+03  0.2754585E+03  0.2749431E+03
+  0.2744278E+03  0.2739119E+03  0.2733956E+03  0.2728787E+03  0.2723618E+03
+  0.2718438E+03  0.2713252E+03  0.2708062E+03  0.2702864E+03  0.2697661E+03
+  0.2692446E+03  0.2687223E+03  0.2681992E+03  0.2676752E+03  0.2671496E+03
+  0.2666234E+03  0.2660962E+03  0.2655674E+03  0.2650373E+03  0.2645060E+03
+  0.2639732E+03  0.2634391E+03  0.2629030E+03  0.2623654E+03  0.2618262E+03
+  0.2612849E+03  0.2607416E+03  0.2601963E+03  0.2596490E+03  0.2590991E+03
+  0.2585475E+03  0.2579931E+03  0.2574361E+03  0.2568767E+03  0.2563139E+03
+  0.2557484E+03  0.2551798E+03  0.2546082E+03  0.2540330E+03  0.2534542E+03
+  0.2528719E+03  0.2522857E+03  0.2516955E+03  0.2511006E+03  0.2505020E+03
+  0.2498985E+03  0.2492900E+03  0.2486766E+03  0.2480581E+03  0.2474336E+03
+  0.2468038E+03  0.2461678E+03  0.2455257E+03  0.2448767E+03  0.2442207E+03
+  0.8999999E+10  0.8999999E+10  0.8999999E+10  0.8999999E+10  0.8999999E+10
+  0.8999999E+10  0.8999999E+10  0.3216098E+03  0.3210316E+03  0.3204551E+03
+  0.3198815E+03  0.3193090E+03  0.3187384E+03  0.3181698E+03  0.3176014E+03
+  0.3170342E+03  0.3164689E+03  0.3159052E+03  0.3153423E+03  0.3147809E+03
+  0.3142211E+03  0.3136623E+03  0.3131050E+03  0.3125486E+03  0.3119938E+03
+  0.3114399E+03  0.3108871E+03  0.3103359E+03  0.3097860E+03  0.3092370E+03
+  0.3086890E+03  0.3081424E+03  0.3075968E+03  0.3070524E+03  0.3065092E+03
+  0.3059666E+03  0.3054252E+03  0.3048851E+03  0.3043462E+03  0.3038076E+03
+  0.3032712E+03  0.3027348E+03  0.3021996E+03  0.3016654E+03  0.3011318E+03
+  0.3005995E+03  0.3000680E+03  0.2995380E+03  0.2990082E+03  0.2984794E+03
+  0.2979513E+03  0.2974238E+03  0.2968976E+03  0.2963721E+03  0.2958473E+03
+  0.2953235E+03  0.2947998E+03  0.2942771E+03  0.2937551E+03  0.2932341E+03
+  0.2927137E+03  0.2921937E+03  0.2916741E+03  0.2911553E+03  0.2906373E+03
+  0.2901192E+03  0.2896024E+03  0.2890860E+03  0.2885699E+03  0.2880543E+03
+  0.2875389E+03  0.2870239E+03  0.2865094E+03  0.2859953E+03  0.2854819E+03
+  0.2849686E+03  0.2844557E+03  0.2839431E+03  0.2834303E+03  0.2829178E+03
+  0.2824058E+03  0.2818940E+03  0.2813818E+03  0.2808704E+03  0.2803591E+03
+  0.2798475E+03  0.2793358E+03  0.2788243E+03  0.2783129E+03  0.2778011E+03
+  0.2772891E+03  0.2767775E+03  0.2762652E+03  0.2757530E+03  0.2752407E+03
+  0.2747277E+03  0.2742143E+03  0.2737008E+03  0.2731870E+03  0.2726726E+03
+  0.2721575E+03  0.2716425E+03  0.2711263E+03  0.2706094E+03  0.2700920E+03
+  0.2695742E+03  0.2690556E+03  0.2685357E+03  0.2680150E+03  0.2674936E+03
+  0.2669713E+03  0.2664474E+03  0.2659225E+03  0.2653969E+03  0.2648696E+03
+  0.2643409E+03  0.2638110E+03  0.2632797E+03  0.2627468E+03  0.2622119E+03
+  0.2616756E+03  0.2611375E+03  0.2605975E+03  0.2600553E+03  0.2595112E+03
+  0.2589649E+03  0.2584164E+03  0.2578654E+03  0.2573119E+03  0.2567557E+03
+  0.2561970E+03  0.2556352E+03  0.2550704E+03  0.2545025E+03  0.2539311E+03
+  0.2533563E+03  0.2527778E+03  0.2521961E+03  0.2516101E+03  0.2510200E+03
+  0.2504253E+03  0.2498265E+03  0.2492232E+03  0.2486143E+03  0.2480006E+03
+  0.2473815E+03  0.2467567E+03  0.2461262E+03  0.2454895E+03  0.2448461E+03
+  0.9601257E+03  0.8999999E+10  0.8999999E+10  0.8999999E+10  0.8999999E+10
+  0.8999999E+10  0.8999999E+10  0.3217826E+03  0.3212120E+03  0.3206398E+03
+  0.3200671E+03  0.3194944E+03  0.3189249E+03  0.3183556E+03  0.3177885E+03
+  0.3172225E+03  0.3166573E+03  0.3160941E+03  0.3155325E+03  0.3149719E+03
+  0.3144120E+03  0.3138543E+03  0.3132976E+03  0.3127422E+03  0.3121874E+03
+  0.3116346E+03  0.3110828E+03  0.3105323E+03  0.3099831E+03  0.3094348E+03
+  0.3088878E+03  0.3083420E+03  0.3077973E+03  0.3072536E+03  0.3067110E+03
+  0.3061696E+03  0.3056293E+03  0.3050899E+03  0.3045518E+03  0.3040143E+03
+  0.3034784E+03  0.3029431E+03  0.3024090E+03  0.3018759E+03  0.3013437E+03
+  0.3008123E+03  0.3002818E+03  0.2997523E+03  0.2992235E+03  0.2986957E+03
+  0.2981691E+03  0.2976432E+03  0.2971177E+03  0.2965934E+03  0.2960695E+03
+  0.2955470E+03  0.2950248E+03  0.2945035E+03  0.2939828E+03  0.2934625E+03
+  0.2929433E+03  0.2924248E+03  0.2919068E+03  0.2913894E+03  0.2908727E+03
+  0.2903564E+03  0.2898404E+03  0.2893255E+03  0.2888107E+03  0.2882969E+03
+  0.2877831E+03  0.2872701E+03  0.2867572E+03  0.2862443E+03  0.2857328E+03
+  0.2852211E+03  0.2847098E+03  0.2841987E+03  0.2836882E+03  0.2831778E+03
+  0.2826672E+03  0.2821569E+03  0.2816476E+03  0.2811378E+03  0.2806280E+03
+  0.2801187E+03  0.2796093E+03  0.2790996E+03  0.2785904E+03  0.2780812E+03
+  0.2775717E+03  0.2770617E+03  0.2765526E+03  0.2760425E+03  0.2755322E+03
+  0.2750219E+03  0.2745116E+03  0.2740007E+03  0.2734893E+03  0.2729778E+03
+  0.2724658E+03  0.2719531E+03  0.2714400E+03  0.2709267E+03  0.2704124E+03
+  0.2698973E+03  0.2693819E+03  0.2688656E+03  0.2683485E+03  0.2678302E+03
+  0.2673114E+03  0.2667914E+03  0.2662707E+03  0.2657482E+03  0.2652249E+03
+  0.2647006E+03  0.2641750E+03  0.2636478E+03  0.2631192E+03  0.2625889E+03
+  0.2620574E+03  0.2615239E+03  0.2609890E+03  0.2604521E+03  0.2599131E+03
+  0.2593724E+03  0.2588292E+03  0.2582837E+03  0.2577361E+03  0.2571862E+03
+  0.2566334E+03  0.2560779E+03  0.2555198E+03  0.2549586E+03  0.2543944E+03
+  0.2538272E+03  0.2532566E+03  0.2526821E+03  0.2521042E+03  0.2515225E+03
+  0.2509366E+03  0.2503468E+03  0.2497522E+03  0.2491533E+03  0.2485495E+03
+  0.2479407E+03  0.2473265E+03  0.2467070E+03  0.2460818E+03  0.2454503E+03
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/queue_module.F90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/queue_module.F90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/queue_module.F90	(revision 207)
@@ -0,0 +1,220 @@
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! Module: queue_module
+!
+! Description: This module implements a queue of user-defined data types and 
+!   a set of routines related to the maintenance and manipulation of the queue.
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+MODULE queue_module
+
+   USE module_debug
+
+   type q_data         ! The user-defined datatype to store in the queue
+      integer                :: x, y
+      character (len=128)    :: units, description, stagger
+   end type q_data
+ 
+   type q_item         ! Wrapper for item to be stored in the queue
+      type (q_data)          :: data
+      type (q_item), pointer :: next
+   end type q_item
+ 
+   type queue          ! The queue object, defined by a head and tail pointer
+      type (q_item), pointer :: head, tail
+      integer                :: length
+   end type queue
+ 
+   CONTAINS
+ 
+  
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: q_init
+   ! Purpose: To initialize a queue
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE q_init(q)
+ 
+      implicit none
+  
+      ! Arguments
+      type (queue), intent(inout) :: q
+  
+      NULLIFY(q%head)
+      NULLIFY(q%tail)
+      q%length = 0
+ 
+   END SUBROUTINE q_init
+ 
+ 
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: q_insert
+   ! Purpose: To insert an item in the tail of the queue
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE q_insert(q, qitem)
+    
+      implicit none
+  
+      ! Arguments
+      type (queue), intent(inout) :: q
+      type (q_data), intent(in)   :: qitem
+  
+      ! Local variables
+      type (q_item), pointer      :: newitem
+  
+      allocate(newitem)
+      newitem%data = qitem
+      NULLIFY(newitem%next) 
+      IF (.not.associated(q%tail)) THEN
+         q%head=>newitem
+         q%tail=>newitem
+      ELSE
+         q%tail%next=>newitem
+         q%tail=>newitem
+      END IF
+  
+      q%length = q%length + 1
+ 
+   END SUBROUTINE q_insert
+ 
+ 
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: q_isdata
+   ! Purpose: This function returns FALSE if the queue is empty and TRUE otherwise 
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   function q_isdata(q)
+ 
+      implicit none
+  
+      ! Arguments
+      type (queue), intent(in) :: q
+  
+      ! Local variables
+      logical                  :: q_isdata
+  
+      q_isdata = .false.
+    
+      IF (associated(q%head) .and. (q%length >= 1)) THEN 
+         q_isdata = .true.
+      END IF
+ 
+   END function q_isdata
+ 
+ 
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: q_peek
+   ! Purpose: To return the item in the head of the queue, without
+   !    actually removing the item 
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   function q_peek(q)
+ 
+      implicit none
+  
+      ! Arguments
+      type (queue), intent(in) :: q
+  
+      ! Local variables
+      type (q_data)            :: q_peek
+  
+      IF (associated(q%head)) THEN
+         q_peek = q%head%data 
+      ELSE
+         call mprintf(.true.,ERROR,'q_peek(): Trying to peek at an empty queue')
+      END IF
+ 
+   END function q_peek
+ 
+ 
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: q_length
+   ! Purpose: To return the number of items currently in the queue
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   FUNCTION q_length(q)
+   
+      implicit none
+  
+      ! Arguments
+      type (queue), intent(in) :: q
+  
+      ! Local variables
+    !!type (q_item), pointer   :: cursor
+      integer                  :: q_length      
+  
+      q_length = q%length
+  
+  ! USE THE FOLLOWING TO COUNT THE LENGTH BY ACTUALLY TRAVERSING THE LINKED LIST
+  ! REPRESENTATION OF THE QUEUE
+  !    IF (associated(q%head)) THEN
+  !       q_length = q_length + 1
+  !       cursor=>q%head
+  !       DO WHILE(associated(cursor%next))
+  !         cursor=>cursor%next
+  !         q_length = q_length + 1
+  !       END DO
+  !    END IF
+ 
+   END FUNCTION q_length
+ 
+ 
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: q_remove
+   ! Purpose: To return the item stored at the head of the queue
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   function q_remove(q)
+ 
+      implicit none
+  
+      ! Arguments
+      type (queue), intent(inout) :: q
+  
+      ! Local variables
+      type (q_data)               :: q_remove
+      type (q_item), pointer      :: cursor
+       
+      IF (associated(q%head)) THEN
+         IF (associated(q%head%next)) THEN
+            cursor=>q%head%next
+            q_remove = q%head%data
+            deallocate(q%head)
+            q%head=>cursor
+         ELSE
+            q_remove = q%head%data
+            deallocate(q%head)
+            NULLIFY(q%head)
+            NULLIFY(q%tail)
+         END IF 
+         q%length = q%length - 1
+      ELSE
+         CALL mprintf(.true.,ERROR,'q_remove(): Trying to remove from an empty queue')
+      END IF
+ 
+   END function q_remove
+ 
+ 
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: q_destroy
+   ! Purpose: To free all memory allocated by the queue, thus destroying any 
+   !    items that have not been removed
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE q_destroy(q)
+ 
+      implicit none
+  
+      ! Arguments
+      type (queue), intent(inout) :: q
+  
+      ! Local variables
+      type (q_item), pointer      :: cursor
+  
+      q%length = 0
+  
+      IF (associated(q%head)) THEN
+         DO WHILE(associated(q%head%next))
+            cursor=>q%head
+            q%head=>q%head%next
+            deallocate(cursor)
+         END DO
+         deallocate(q%head)
+      END IF
+ 
+   END SUBROUTINE q_destroy
+
+END MODULE queue_module
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/v5d_module.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/v5d_module.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/v5d_module.f90	(revision 207)
@@ -0,0 +1,300 @@
+MODULE v5d_module
+
+   USE gridinfo_module
+   USE output_module
+   USE map_utils
+   USE misc_definitions_module
+
+
+   CONTAINS
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: v5d_varnames     
+   ! Purpose: Get info about the variables to send to v5d file
+   ! 	      This routine assumes that the user only asked for variables
+   !          that are available. If variables are not available v5d will no 
+   !          be working correctly.
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE v5d_varnames (v5d_nl)
+
+     IMPLICIT NONE
+
+     ! ------ some vis5d stuff, contain MAXVARS,MAXTIMES,MAXROWS,MAXCOLUMNS,MAXLEVELS
+     include 'v5df.h'
+
+     integer, dimension(MAXLEVELS)          :: v5d_nl
+     character (len=4000)                   :: v5d_fields
+     integer                                :: is_there, is_3d
+     character (len=1000)                   :: known_3d_fields
+     character (len=20)                     :: dummy
+
+     
+     known_3d_fields = 'P,PB,QCLOUD,QGRAUP,QICE,QNICE,QRAIN,QSNOW, &
+&QVAPOR,T,TKE,TKE_MYJ,U,V,PH,PHB,W,cape,cin,dbz,height,pressure,rh, &
+&tc,td,theta,tk,umet,vmet,wdir,wspd'
+
+
+     varnames = ' '
+     numvars = 0
+     v5d_fields = plot_these_fields(2:len_trim(plot_these_fields))
+     is_there = INDEX(v5d_fields,",")
+     DO WHILE ( is_there > 1 ) 
+
+       numvars = numvars  + 1
+       varnames(numvars) = v5d_fields(1:is_there-1)
+       dummy = ","//trim(varnames(numvars))//","
+
+       IF ( trim(varnames(numvars)) == 'SH2O'  .OR.  &
+            trim(varnames(numvars)) == 'SMOIS' .OR.  &
+            trim(varnames(numvars)) == 'TSLB'  ) THEN
+         print*,"  WARING:  We cannot deal with field ", trim(varnames(numvars))
+         print*,"           It will be removed from the plot list"
+         is_3d = INDEX(plot_these_fields,trim(dummy))
+         plot_these_fields = plot_these_fields(1:is_3d)//plot_these_fields(is_3d+len_trim(dummy):len_trim(plot_these_fields))
+           
+         varnames(numvars) = ' ' 
+         numvars = numvars - 1
+       ELSE
+         v5d_nl(numvars) = 1
+         is_3d = INDEX(known_3d_fields,trim(varnames(numvars)))
+         IF ( is_3d > 0 ) v5d_nl(numvars) = number_of_zlevs
+       END IF  
+
+       v5d_fields = v5d_fields(is_there+1:len_trim(v5d_fields))
+
+       !!! Check for doubles
+       is_there = INDEX(v5d_fields,trim(dummy))
+       DO WHILE ( is_there /= 0 )
+          v5d_fields = v5d_fields(1:is_there)//v5d_fields(is_there+len_trim(dummy):len_trim(v5d_fields))
+          is_there = INDEX(v5d_fields,trim(dummy))
+        END DO
+
+       is_there = INDEX(v5d_fields,",") 
+
+     END DO
+
+  
+   END SUBROUTINE v5d_varnames
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: v5d_times     
+   ! Purpose: Get info about the variables to send to v5d file
+   ! 	      This routine assumes that the user only asked for variables
+   !          that are available. If variables are not available v5d will no 
+   !          be working correctly.
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE v5d_times (n_times, timestamp, datestamp)
+
+     USE date_pack
+
+     IMPLICIT NONE
+
+     ! ------ some vis5d stuff, contain MAXVARS,MAXTIMES,MAXROWS,MAXCOLUMNS,MAXLEVELS
+     include 'v5df.h'
+
+     integer, dimension(MAXTIMES)           :: timestamp, datestamp
+     character (len=19)                     :: next_date
+     integer                                :: tt, n_times
+     integer                                :: year, month, day, hours, minutes, seconds
+
+
+     datestamp = IMISSING
+     timestamp = IMISSING
+
+     DO tt = 0,n_times
+       CALL geth_newdate(next_date, trim(start_date), tt*interval_seconds)
+
+       read(next_date(1:4),*)   year
+       read(next_date(6:7),*)   month
+       read(next_date(9:10),*)  day
+       read(next_date(12:13),*) hours
+       read(next_date(15:16),*) minutes
+       read(next_date(18:19),*) seconds
+
+
+       timestamp(tt) = hours*10000 + minutes*100 + seconds
+
+       if(month >= 2) day = day+31  ! add january
+       if(month >= 3) day = day+28  ! add february
+       if(month >= 4) day = day+31  ! add march
+       if(month >= 5) day = day+30  ! add april
+       if(month >= 6) day = day+31  ! add may
+       if(month >= 7) day = day+30  ! add june
+       if(month >= 8) day = day+31  ! add july
+       if(month >= 9) day = day+31  ! add august
+       if(month >= 10) day = day+30 ! add september
+       if(month >= 11) day = day+31 ! add october
+       if(month >= 12) day = day+30 ! add november
+       if((month > 2) .and. (mod(year,4) == 0)) day = day+1  ! get leap year day
+
+       datestamp(tt) = (year)*1000 + day
+
+     END DO
+
+   END SUBROUTINE v5d_times
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   ! Name: v5d_proj     
+   ! Purpose: Get map information needed to create v5d output file
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+   SUBROUTINE v5d_proj (date, projection, proj_args)
+
+     USE input_module
+
+     IMPLICIT NONE
+
+     character (len=19)                  :: date
+     integer                             :: projection
+     real, dimension(100)                :: proj_args
+     real                                :: xlat_s, xlat_n, xlon_w, xlon_e, xlat1, xlon1
+     real                                :: xx, yy, temp
+
+     integer                             :: istatus, wrftype
+     real, pointer, dimension(:,:,:)     :: real_array
+     character (len=3)                   :: memorder
+     character (len=128)                 :: cname, stagger
+     character (len=128), dimension(3)   :: dimnames
+     integer, dimension(3)               :: domain_start, domain_end
+     type (proj_info)                    :: projst
+     real                                :: msf
+     real                                :: hemiflag
+     real                                :: pi, degtorad
+
+
+
+     domain_start = 1
+     domain_end(1) = west_east_dim
+     domain_end(2) = south_north_dim
+     domain_end(3) = 1
+     memorder = "XY"
+     stagger = '-'
+     wrftype = 104
+
+     istatus = 0
+     IF ( iprogram .ge. 6 ) THEN
+       CALL read_spec_field(domain_start, domain_end, 'XLAT', wrftype, &
+                            memorder, stagger, dimnames, real_array, date, istatus)
+     ELSE                 
+       CALL read_spec_field(domain_start, domain_end, 'XLAT_M', wrftype, &
+                            memorder, stagger, dimnames, real_array, date, istatus)
+     END IF
+     IF ( istatus == 0) THEN
+       xlat_s = real_array(1,1,1)
+       xlat_n = real_array(1,south_north_dim,1)
+       xlat1  = real_array(1,1,1)
+     END IF
+     istatus = 0
+     IF ( iprogram .ge. 6 ) THEN
+       CALL read_spec_field(domain_start, domain_end, 'XLONG', wrftype, &
+                            memorder, stagger, dimnames, real_array, date, istatus)
+     ELSE                 
+       CALL read_spec_field(domain_start, domain_end, 'XLONG_M', wrftype, &
+                            memorder, stagger, dimnames, real_array, date, istatus)
+     END IF
+     IF ( istatus == 0) THEN
+       xlon_w = real_array(1,south_north_dim,1)
+       xlon_e = real_array(west_east_dim,south_north_dim,1)
+       xlon1  = real_array(1,1,1)
+     END IF
+
+
+
+     IF ( MAP_PROJ == 0 ) THEN        !!! ideal cases
+
+       projection = 0
+       proj_args(1) = 1.
+       proj_args(2) = 1.
+       proj_args(3) = 1.
+       proj_args(4) = 1.
+
+     ELSE IF ( MAP_PROJ == 1 ) then    !!! Lambert
+
+       projection = 2
+
+       IF ( TRUELAT1 < TRUELAT2 ) THEN   !!! truelat1 must be bigger than truelat2
+         temp = TRUELAT1
+         TRUELAT1 = TRUELAT2
+         TRUELAT2 = temp
+       END IF
+
+       CALL make_lambert(xlat_n,xlon_w,xx,yy)
+
+       proj_args(1) = TRUELAT1
+       proj_args(2) = TRUELAT2
+       proj_args(3) = -yy
+       proj_args(4) = -xx
+       proj_args(5) = -STAND_LON
+       proj_args(6) = 0.001*DX
+
+     ELSE IF ( MAP_PROJ == 2 ) THEN   !!! PS
+
+       CALL map_set(PROJ_PS,xlat1,xlon1,DX,STAND_LON,TRUELAT1,TRUELAT2, &
+                    west_east_dim, south_north_dim, projst)
+       projection = 3
+
+       IF (TRUELAT1 .ge. 0.) THEN
+         proj_args(1) = 90.
+         hemiflag = 1.
+       ELSE
+         proj_args(1) = -90.
+         hemiflag = -1.
+       END IF
+       proj_args(2) = -STAND_LON
+       proj_args(3) = float(south_north_dim) - projst%polej
+       proj_args(4) = projst%polei
+       msf  = (1.+hemiflag*sin(projst%TRUELAT1*degtorad))/ &
+              (1.+hemiflag*sin(proj_args(1)*degtorad))
+       proj_args(5) = DX* 0.001/msf
+ 
+     ELSE IF ( MAP_PROJ == 3 ) THEN   !!! Mercator
+
+       projection = 1
+
+       proj_args(1) = xlat_n
+       proj_args(2) = -xlon_w
+       proj_args(3) = (xlon_w - xlon_e) / (west_east_dim - 1)
+       proj_args(4) = (xlat_n - xlat_s) / (south_north_dim - 1)
+
+     END IF
+  
+   END SUBROUTINE v5d_proj
+
+
+  SUBROUTINE make_lambert(xlatn,xlonw,xx,yy)
+
+!  imported from TOVIS5D for MM5
+
+     USE input_module
+
+     real                 :: xlatn, xlonw, xx, yy
+     real                 :: radius, degtorad, alpha
+     real                 :: theta, theta1, theta2, htheta, htheta1, htheta2, cone, dis, rad
+
+     data radius /6371./
+
+!  put map parameters in as defined by vis5d;
+!    south is positive direction, so negative ypole
+
+     pi       = 4.0*atan( 1.0 )
+     degtorad = pi/180.0
+  
+     dis      = 0.001*DX
+  
+     theta    = (90.0-xlatn) * degtorad
+     theta1   = (90.0-TRUELAT1) * degtorad
+     theta2   = (90.0-TRUELAT2) * degtorad
+     htheta   = theta /2.0
+     htheta1  = theta1/2.0
+     htheta2  = theta2/2.0
+     cone     = alog(sin(theta1)/sin(theta2))/alog(tan(htheta1)/tan(htheta2))
+
+     alpha    = cone * (xlonw - STAND_LON) * degtorad
+     rad      = radius * sin(theta1) * (tan(htheta)/tan(htheta1))**cone/cone
+
+     xx       = rad * sin(alpha) / dis
+     yy       = rad * cos(alpha) / dis
+
+  END SUBROUTINE make_lambert
+
+
+END MODULE v5d_module
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/v5df.h
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/v5df.h	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/v5df.h	(revision 207)
@@ -0,0 +1,35 @@
+! v5df.h
+
+! Include file for using v5d functions from FORTRAN programs
+
+
+! Function prototypes.  See the README file for details.  These are
+! the functions you'll want to use for writing v5d file converters.
+
+      integer v5dcreate
+
+      integer v5dcreatesimple
+
+      integer v5dwrite
+
+      integer v5dmcfile
+
+      integer v5dclose
+
+
+! 5-D grid limits, must match those in v5d.h!!!
+      integer MAXVARS, MAXTIMES, MAXROWS, MAXCOLUMNS, MAXLEVELS
+
+      parameter (MAXVARS=100)
+      parameter (MAXTIMES=400)
+      parameter (MAXROWS=400)
+      parameter (MAXCOLUMNS=400)
+      parameter (MAXLEVELS=100)
+
+! Missing values
+      real MISSING
+      integer IMISSING
+
+      parameter (MISSING=1.0E35)
+      parameter (IMISSING=-987654)
+
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/src/wrf_debug.f90
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/src/wrf_debug.f90	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/src/wrf_debug.f90	(revision 207)
@@ -0,0 +1,37 @@
+SUBROUTINE wrf_debug(i, msg)
+
+   implicit none
+   integer :: i
+   character (len=*) msg
+!!   WRITE(6,*) 'WRF_DEBUG:'//msg
+
+END SUBROUTINE wrf_debug
+
+
+SUBROUTINE wrf_message(msg)
+
+   implicit none
+   character (len=*) msg
+   WRITE(6,*) 'WRF_MESSAGE:'//msg
+
+END SUBROUTINE wrf_message
+
+
+SUBROUTINE wrf_error_fatal(msg)
+
+   implicit none
+   character (len=*) msg
+   WRITE(6,*) 'WRF_ERROR_FATAL:'//msg
+   STOP
+
+END SUBROUTINE wrf_error_fatal
+
+
+SUBROUTINE wrf_error_fatal3(msg)
+
+   implicit none
+   character (len=*) msg
+   WRITE(6,*) 'WRF_ERROR_FATAL:'//msg
+   STOP
+
+END SUBROUTINE wrf_error_fatal3
Index: trunk/MESOSCALE_DEV/SRC/ARWpost/temp/bigconvert200
===================================================================
--- trunk/MESOSCALE_DEV/SRC/ARWpost/temp/bigconvert200	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/ARWpost/temp/bigconvert200	(revision 207)
@@ -0,0 +1,9 @@
+#!/bin/csh
+# f.forget
+foreach i ( $* )
+    echo $1
+    set name = `echo $1 | sed -e 's/\./ /' `
+    echo $name[1].png
+   convert -density 200x200 -crop 0x0 $1 $name[1].png
+   shift
+end
Index: trunk/MESOSCALE_DEV/SRC/datesave
===================================================================
--- trunk/MESOSCALE_DEV/SRC/datesave	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/datesave	(revision 207)
@@ -0,0 +1,1 @@
+Mon Jan 24 21:14:16 CET 2011
Index: trunk/MESOSCALE_DEV/SRC/prepare_post
===================================================================
--- trunk/MESOSCALE_DEV/SRC/prepare_post	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/prepare_post	(revision 207)
@@ -0,0 +1,29 @@
+#! /bin/bash
+
+mkdir ARWpost/
+cd ARWpost
+
+ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/clean .
+ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/compile .
+ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/configure .
+ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/arch .
+ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/clean .
+ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/change_bottom* .
+ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/idl/* .
+
+mkdir src
+cd src
+ln -sf $LMDMOD/LMD_MM_MARS/SRC/ARWpost/src/* .
+cd ..
+
+cp $LMDMOD/LMD_MM_MARS/SRC/g95.tar.gz .
+tar xzf g95.tar.gz
+more g95/fix* | sed s+"LIBVIS5D"+"#LIBVIS5D"+g | sed s+"-DV5D"+"#-DV5D"+g >> arch/configure.defaults
+rm -rf g95*
+
+#configure
+#compile
+#change rm *.png in gw.pro
+#save gw.def	
+#modif ps2png	
+#change demo
Index: trunk/MESOSCALE_DEV/SRC/saved
===================================================================
--- trunk/MESOSCALE_DEV/SRC/saved	(revision 207)
+++ trunk/MESOSCALE_DEV/SRC/saved	(revision 207)
@@ -0,0 +1,1378 @@
+BACKUP info:
+--------------
+aslmd
+Mon Jan 24 21:14:10 CET 2011
+--------------
+save/
+save/configure.wrf.backup
+save/configure.wrf_Mars
+save/configure.wrf_MPICH
+save/configure.wrf_regular
+save/wash_away
+save/save_changes
+save/dyn_em_save
+save/external_save
+save/mars_lmd_save
+save/phys_save
+save/Registry_save
+save/share_save
+save/meso_callkeys.h
+save/meso_datafile.h
+save/meso_datafile.h~
+save/mars.sed
+save/configure.defaults.fix64nest
+save/configure.defaults.gfortran64
+save/dyn_em/
+save/dyn_em/diff_module_diffusion_em
+save/dyn_em/diff_module_em
+save/dyn_em/module_em.F
+save/dyn_em/diff_module_initialize_hill2d_x
+save/dyn_em/diff_module_initialize_real
+save/dyn_em/diff_solve_em
+save/dyn_em/diff_start_em
+save/dyn_em/start_em.F
+save/dyn_em/solve_em.F
+save/dyn_em/module_big_step_utilities_em.F
+save/dyn_em/Makefile
+save/dyn_em/module_diffusion_em.F
+save/dyn_em/module_initialize_quarter_ss.F
+save/dyn_em/module_initialize_quarter_ss.F_gcm
+save/dyn_em/module_initialize_quarter_ss.F_ref
+save/dyn_em/diff_Makefile
+save/dyn_em/module_initialize_hill2d_x.F
+save/dyn_em/module_initialize_real.F
+save/dyn_em/module_initialize_real_method1_2interp.F
+save/dyn_em/module_initialize_real_method2_1param1interp.F
+save/dyn_em/diff_module_big_step_utilities_em
+save/call_meso_inifis1.inc
+save/call_meso_inifis2.inc
+save/call_meso_inifis3.inc
+save/call_meso_inifis4.inc
+save/call_meso_inifis.inc
+save/call_meso_physiq1.inc
+save/call_meso_physiq2.inc
+save/call_meso_physiq3.inc
+save/call_meso_physiq4.inc
+save/call_meso_physiq.inc
+save/custom_user.inc
+save/external/
+save/external/esmf_time_f90/
+save/external/esmf_time_f90/diff_ESMF_TimeMgr
+save/external/esmf_time_f90/diff_Meat
+save/external/esmf_time_f90/diff_Test1
+save/external/esmf_time_f90/ESMF_Calendar.F90
+save/external/esmf_time_f90/ESMF_TimeMgr.inc
+save/external/esmf_time_f90/Meat.F90
+save/external/esmf_time_f90/Test1.F90
+save/external/esmf_time_f90/diff_ESMF_Calendar
+save/mars_lmd/
+save/mars_lmd/create_make_gcm
+save/mars_lmd/error_libc
+save/mars_lmd/liste_des_sources_f77
+save/mars_lmd/liste_des_sources_f90
+save/mars_lmd/makefile
+save/mars_lmd/makefile_init
+save/mars_lmd/libf/
+save/mars_lmd/libf/bibio/
+save/mars_lmd/libf/bibio/from36.F
+save/mars_lmd/libf/bibio/ini36.F
+save/mars_lmd/libf/bibio/cvmgp.F
+save/mars_lmd/libf/bibio/cvmgt.F
+save/mars_lmd/libf/bibio/isitor.F
+save/mars_lmd/libf/bibio/lmdstd.h
+save/mars_lmd/libf/bibio/lnblnk.F
+save/mars_lmd/libf/bibio/mywrite.F
+save/mars_lmd/libf/bibio/readcoord.F
+save/mars_lmd/libf/bibio/readstd.F
+save/mars_lmd/libf/bibio/to36.F
+save/mars_lmd/libf/bibio/gather.F
+save/mars_lmd/libf/bibio/writestd.F
+save/mars_lmd/libf/bibio/ilsum.F
+save/mars_lmd/libf/bibio/isamax.F
+save/mars_lmd/libf/bibio/ismax.F
+save/mars_lmd/libf/bibio/ismin.F
+save/mars_lmd/libf/bibio/mxm.F
+save/mars_lmd/libf/bibio/mxva.F
+save/mars_lmd/libf/bibio/mxv.F
+save/mars_lmd/libf/bibio/scatter.F
+save/mars_lmd/libf/bibio/scopy.F
+save/mars_lmd/libf/bibio/scopyi.F
+save/mars_lmd/libf/bibio/sdot.F
+save/mars_lmd/libf/bibio/ssum.F
+save/mars_lmd/libf/bibio/uniplot.F
+save/mars_lmd/libf/bibio/wheneq.F
+save/mars_lmd/libf/bibio/cbrt.F
+save/mars_lmd/libf/bibio/mxva.F_old
+save/mars_lmd/libf/bibio/.svn/
+save/mars_lmd/libf/bibio/.svn/text-base/
+save/mars_lmd/libf/bibio/.svn/text-base/cbrt.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/cvmgp.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/cvmgt.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/from36.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/gather.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/ilsum.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/ini36.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/isamax.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/isitor.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/ismax.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/ismin.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/lmdstd.h.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/lnblnk.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/mxm.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/mxv.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/mxva.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/mxva.F_old.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/mywrite.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/readcoord.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/readstd.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/scatter.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/scopy.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/scopyi.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/sdot.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/ssum.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/to36.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/uniplot.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/wheneq.F.svn-base
+save/mars_lmd/libf/bibio/.svn/text-base/writestd.F.svn-base
+save/mars_lmd/libf/bibio/.svn/prop-base/
+save/mars_lmd/libf/bibio/.svn/props/
+save/mars_lmd/libf/bibio/.svn/tmp/
+save/mars_lmd/libf/bibio/.svn/tmp/text-base/
+save/mars_lmd/libf/bibio/.svn/tmp/prop-base/
+save/mars_lmd/libf/bibio/.svn/tmp/props/
+save/mars_lmd/libf/bibio/.svn/entries
+save/mars_lmd/libf/bibio/.svn/format
+save/mars_lmd/libf/bibio/.svn/all-wcprops
+save/mars_lmd/libf/grid/
+save/mars_lmd/libf/grid/dimension/
+save/mars_lmd/libf/grid/dimension/makdim
+save/mars_lmd/libf/grid/dimension/dimensions.50.t1
+save/mars_lmd/libf/grid/dimension/dimensions.99.t1
+save/mars_lmd/libf/grid/dimension/dimensions.190.t1
+save/mars_lmd/libf/grid/dimension/dimensions.49.t1
+save/mars_lmd/libf/grid/dimension/dimensions.149.t1
+save/mars_lmd/libf/grid/dimension/dimensions.100.t1
+save/mars_lmd/libf/grid/dimension/dimensions.1.t1
+save/mars_lmd/libf/grid/dimension/dimensions.25.t1
+save/mars_lmd/libf/grid/dimension/dimensions.24.t1
+save/mars_lmd/libf/grid/dimension/dimensions.51.t1
+save/mars_lmd/libf/grid/dimension/dimensions.30.t1
+save/mars_lmd/libf/grid/dimension/dimensions.59.t1
+save/mars_lmd/libf/grid/dimension/dimensions.60.t1
+save/mars_lmd/libf/grid/dimension/dimensions.74.t1
+save/mars_lmd/libf/grid/dimension/dimensions.64.t1
+save/mars_lmd/libf/grid/dimension/dimensions.69.t1
+save/mars_lmd/libf/grid/dimension/dimensions.73.t1
+save/mars_lmd/libf/grid/dimension/dimensions.70.t1
+save/mars_lmd/libf/grid/dimension/dimensions.71.t1
+save/mars_lmd/libf/grid/dimension/dimensions.61.t1
+save/mars_lmd/libf/grid/dimension/dimensions.12.t1
+save/mars_lmd/libf/grid/dimension/dimensions.61.t2
+save/mars_lmd/libf/grid/dimension/dimensions.60.t2
+save/mars_lmd/libf/grid/dimension/dimensions.25.t2
+save/mars_lmd/libf/grid/dimension/dimensions.24.t2
+save/mars_lmd/libf/grid/dimension/dimensions.50.t2
+save/mars_lmd/libf/grid/dimension/dimensions.30.t2
+save/mars_lmd/libf/grid/dimension/dimensions.26.t2
+save/mars_lmd/libf/grid/dimension/dimensions.10.t1
+save/mars_lmd/libf/grid/dimension/dimensions.34.t1
+save/mars_lmd/libf/grid/dimension/dimensions.3.t1
+save/mars_lmd/libf/grid/dimension/dimensions.44.t1
+save/mars_lmd/libf/grid/dimension/dimensions.39.t1
+save/mars_lmd/libf/grid/dimension/dimensions.29.t1
+save/mars_lmd/libf/grid/dimension/dimensions.144.t1
+save/mars_lmd/libf/grid/dimension/dimensions.200.t1
+save/mars_lmd/libf/grid/dimension/dimensions.150.t1
+save/mars_lmd/libf/grid/dimension/dimensions.180.t1
+save/mars_lmd/libf/grid/dimension/.svn/
+save/mars_lmd/libf/grid/dimension/.svn/text-base/
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.1.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.10.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.100.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.12.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.144.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.149.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.150.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.180.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.190.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.200.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.24.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.24.t2.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.25.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.25.t2.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.26.t2.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.29.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.3.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.30.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.30.t2.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.34.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.39.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.44.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.49.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.50.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.50.t2.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.51.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.59.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.60.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.60.t2.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.61.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.61.t2.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.64.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.69.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.70.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.71.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.73.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.74.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/dimensions.99.t1.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/text-base/makdim.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/prop-base/
+save/mars_lmd/libf/grid/dimension/.svn/prop-base/makdim.svn-base
+save/mars_lmd/libf/grid/dimension/.svn/props/
+save/mars_lmd/libf/grid/dimension/.svn/tmp/
+save/mars_lmd/libf/grid/dimension/.svn/tmp/text-base/
+save/mars_lmd/libf/grid/dimension/.svn/tmp/prop-base/
+save/mars_lmd/libf/grid/dimension/.svn/tmp/props/
+save/mars_lmd/libf/grid/dimension/.svn/entries
+save/mars_lmd/libf/grid/dimension/.svn/format
+save/mars_lmd/libf/grid/dimension/.svn/all-wcprops
+save/mars_lmd/libf/grid/fxy_new.h
+save/mars_lmd/libf/grid/fxyprim.h
+save/mars_lmd/libf/grid/fxy_reg.h
+save/mars_lmd/libf/grid/fxy_sin.h
+save/mars_lmd/libf/grid/.svn/
+save/mars_lmd/libf/grid/.svn/text-base/
+save/mars_lmd/libf/grid/.svn/text-base/fxy_new.h.svn-base
+save/mars_lmd/libf/grid/.svn/text-base/fxy_reg.h.svn-base
+save/mars_lmd/libf/grid/.svn/text-base/fxy_sin.h.svn-base
+save/mars_lmd/libf/grid/.svn/text-base/fxyprim.h.svn-base
+save/mars_lmd/libf/grid/.svn/prop-base/
+save/mars_lmd/libf/grid/.svn/props/
+save/mars_lmd/libf/grid/.svn/tmp/
+save/mars_lmd/libf/grid/.svn/tmp/text-base/
+save/mars_lmd/libf/grid/.svn/tmp/prop-base/
+save/mars_lmd/libf/grid/.svn/tmp/props/
+save/mars_lmd/libf/grid/.svn/entries
+save/mars_lmd/libf/grid/.svn/format
+save/mars_lmd/libf/grid/.svn/all-wcprops
+save/mars_lmd/libf/phymars/
+save/mars_lmd/libf/phymars/aerave.F
+save/mars_lmd/libf/phymars/aerdata.h
+save/mars_lmd/libf/phymars/aerice.h.005
+save/mars_lmd/libf/phymars/blendrad.F
+save/mars_lmd/libf/phymars/calldrag_noro.F
+save/mars_lmd/libf/phymars/callradite.F
+save/mars_lmd/libf/phymars/callsedim.F
+save/mars_lmd/libf/phymars/callsedim2q.F
+save/mars_lmd/libf/phymars/aerdust.h
+save/mars_lmd/libf/phymars/co2snow.F
+save/mars_lmd/libf/phymars/comcstfi.h
+save/mars_lmd/libf/phymars/comdiurn.h
+save/mars_lmd/libf/phymars/comg1d.h
+save/mars_lmd/libf/phymars/comgeomfi.h
+save/mars_lmd/libf/phymars/watercloud.F
+save/mars_lmd/libf/phymars/sugwd.F
+save/mars_lmd/libf/phymars/comorbit.h
+save/mars_lmd/libf/phymars/lwu.F
+save/mars_lmd/libf/phymars/growthrate.F
+save/mars_lmd/libf/phymars/tabfi.F
+save/mars_lmd/libf/phymars/comsaison.h
+save/mars_lmd/libf/phymars/phyetat0.F
+save/mars_lmd/libf/phymars/convadj.F
+save/mars_lmd/libf/phymars/cvmgp.F
+save/mars_lmd/libf/phymars/cvmgt.F
+save/mars_lmd/libf/phymars/datareadnc.F
+save/mars_lmd/libf/phymars/dedd.F
+save/mars_lmd/libf/phymars/dimradmars.h
+save/mars_lmd/libf/phymars/drag_noro.F
+save/mars_lmd/libf/phymars/dustdevil.F
+save/mars_lmd/libf/phymars/dustlift.F
+save/mars_lmd/libf/phymars/eofdump.F
+save/mars_lmd/libf/phymars/eofdump.h
+save/mars_lmd/libf/phymars/ineofdump.F
+save/mars_lmd/libf/phymars/flusv.F
+save/mars_lmd/libf/phymars/yomlw.h
+save/mars_lmd/libf/phymars/aerice.h.01
+save/mars_lmd/libf/phymars/gwprofil.F
+save/mars_lmd/libf/phymars/gwstress.F
+save/mars_lmd/libf/phymars/lwflux.F
+save/mars_lmd/libf/phymars/lwmain.F
+save/mars_lmd/libf/phymars/ismax.F
+save/mars_lmd/libf/phymars/meso_testphys1d.F
+save/mars_lmd/libf/phymars/iniorbit.F
+save/mars_lmd/libf/phymars/vdifc.F
+save/mars_lmd/libf/phymars/meso_readtesassim.F90
+save/mars_lmd/libf/phymars/wstats.F90
+save/mars_lmd/libf/phymars/lwi.F
+save/mars_lmd/libf/phymars/param_slope_full.F90
+save/mars_lmd/libf/phymars/ismin.F
+save/mars_lmd/libf/phymars/lwxb.F
+save/mars_lmd/libf/phymars/lwb.F
+save/mars_lmd/libf/phymars/lwdiff.F
+save/mars_lmd/libf/phymars/lwxd.F
+save/mars_lmd/libf/phymars/lwxn.F
+save/mars_lmd/libf/phymars/aerice.h.02
+save/mars_lmd/libf/phymars/lwtt.F
+save/mars_lmd/libf/phymars/aerice.h.03
+save/mars_lmd/libf/phymars/aerice.h.04
+save/mars_lmd/libf/phymars/aerice.h.05
+save/mars_lmd/libf/phymars/aerice.h.10
+save/mars_lmd/libf/phymars/mucorr.F
+save/mars_lmd/libf/phymars/mufract.F
+save/mars_lmd/libf/phymars/newcondens.F
+save/mars_lmd/libf/phymars/tracer.h
+save/mars_lmd/libf/phymars/initracer.F
+save/mars_lmd/libf/phymars/watercap.h
+save/mars_lmd/libf/phymars/aerice.h
+save/mars_lmd/libf/phymars/newsedim.F
+save/mars_lmd/libf/phymars/nirco2abs.F
+save/mars_lmd/libf/phymars/nltecool.F
+save/mars_lmd/libf/phymars/aerdust.h.clan91
+save/mars_lmd/libf/phymars/nltedata.h
+save/mars_lmd/libf/phymars/nlteparams.h
+save/mars_lmd/libf/phymars/nlthermeq.F
+save/mars_lmd/libf/phymars/orbite.F
+save/mars_lmd/libf/phymars/orodrag.F
+save/mars_lmd/libf/phymars/orosetup.F
+save/mars_lmd/libf/phymars/fisice.h
+save/mars_lmd/libf/phymars/physdem1.F
+save/mars_lmd/libf/phymars/planete.h
+save/mars_lmd/libf/phymars/profile.F
+save/mars_lmd/libf/phymars/scatter.F
+save/mars_lmd/libf/phymars/scopyi.F
+save/mars_lmd/libf/phymars/soil.F
+save/mars_lmd/libf/phymars/solang.F
+save/mars_lmd/libf/phymars/solarlong.F
+save/mars_lmd/libf/phymars/statto.h
+save/mars_lmd/libf/phymars/suaer.F
+save/mars_lmd/libf/phymars/sulw.F
+save/mars_lmd/libf/phymars/blackl.F
+save/mars_lmd/libf/phymars/vdif_cd.F
+save/mars_lmd/libf/phymars/def_var.F90
+save/mars_lmd/libf/phymars/surfdat.h
+save/mars_lmd/libf/phymars/surfini.F
+save/mars_lmd/libf/phymars/swmain.F
+save/mars_lmd/libf/phymars/swr.F
+save/mars_lmd/libf/phymars/swrayleigh.F
+save/mars_lmd/libf/phymars/uniplot.F
+save/mars_lmd/libf/phymars/vdif_kc.F
+save/mars_lmd/libf/phymars/vlz_fi.F
+save/mars_lmd/libf/phymars/watersat.F
+save/mars_lmd/libf/phymars/callkeys.h
+save/mars_lmd/libf/phymars/writeg1d.F
+save/mars_lmd/libf/phymars/yoegwd.h
+save/mars_lmd/libf/phymars/yomaer.h
+save/mars_lmd/libf/phymars/zerophys.F
+save/mars_lmd/libf/phymars/mkstat.F90
+save/mars_lmd/libf/phymars/inistats.F
+save/mars_lmd/libf/phymars/aerdust.h.ocke97
+save/mars_lmd/libf/phymars/readtesassim.F90
+save/mars_lmd/libf/phymars/multipl.F
+save/mars_lmd/libf/phymars/datafile.h
+save/mars_lmd/libf/phymars/meso_physiq.F
+save/mars_lmd/libf/phymars/meso_writediagfi.F
+save/mars_lmd/libf/phymars/meso_inifis.F
+save/mars_lmd/libf/phymars/meso_dustopacity.F
+save/mars_lmd/libf/phymars/param_slope.F90
+save/mars_lmd/libf/phymars/meso_dimphys.h_ref
+save/mars_lmd/libf/phymars/meso_physiq.F_old
+save/mars_lmd/libf/phymars/meso_physiq.F~
+save/mars_lmd/libf/phymars/slope.h
+save/mars_lmd/libf/phymars/param_slope.F90~
+save/mars_lmd/libf/phymars/param_slope_full.F90~
+save/mars_lmd/libf/phymars/slope.h~
+save/mars_lmd/libf/phymars/callradite.F~
+save/mars_lmd/libf/phymars/vdifc.F~
+save/mars_lmd/libf/phymars/fill_save.inc
+save/mars_lmd/libf/phymars/fill_save_2d.F90
+save/mars_lmd/libf/phymars/wrf_output_2d.h
+save/mars_lmd/libf/phymars/wrf_output_3d.h
+save/mars_lmd/libf/phymars/dimphys.h
+save/mars_lmd/libf/phymars/dimradmars.h~
+save/mars_lmd/libf/phymars/lwu.F~
+save/mars_lmd/libf/phymars/.svn/
+save/mars_lmd/libf/phymars/.svn/text-base/
+save/mars_lmd/libf/phymars/.svn/text-base/aerave.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/aerdata.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/aerdust.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/aerdust.h.clan91.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/aerdust.h.ocke97.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.005.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.01.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.02.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.03.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.04.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.05.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/aerice.h.10.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/blackl.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/blendrad.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/dedd.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/calldrag_noro.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/callkeys.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/callradite.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/callsedim.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/callsedim2q.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/co2snow.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/comcstfi.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/comdiurn.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/comg1d.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/comgeomfi.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/comorbit.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/comsaison.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/convadj.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/cvmgp.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/cvmgt.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/datafile.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/datareadnc.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/def_var.F90.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/dimphys.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/dimradmars.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/drag_noro.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/dustdevil.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/dustlift.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/eofdump.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/eofdump.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/fill_save.inc.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/fill_save_2d.F90.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/fisice.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/flusv.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/growthrate.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/gwprofil.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/gwstress.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/ineofdump.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/iniorbit.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/inistats.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/initracer.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/ismax.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/ismin.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/lwb.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/lwdiff.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/lwflux.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/lwi.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/lwmain.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/lwtt.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/lwu.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/lwxb.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/lwxd.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/lwxn.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/meso_dimphys.h_ref.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/meso_dustopacity.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/meso_inifis.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/meso_physiq.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/meso_physiq.F_old.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/meso_readtesassim.F90.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/meso_testphys1d.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/meso_writediagfi.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/mkstat.F90.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/mucorr.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/mufract.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/multipl.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/newcondens.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/newsedim.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/nirco2abs.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/nltecool.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/nltedata.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/nlteparams.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/nlthermeq.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/orbite.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/orodrag.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/orosetup.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/param_slope.F90.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/param_slope_full.F90.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/phyetat0.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/physdem1.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/planete.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/profile.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/readtesassim.F90.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/scatter.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/scopyi.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/slope.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/soil.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/solang.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/solarlong.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/statto.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/suaer.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/sugwd.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/sulw.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/surfdat.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/surfini.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/swmain.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/swr.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/swrayleigh.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/tabfi.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/tracer.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/uniplot.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/vdif_cd.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/vdif_kc.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/vdifc.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/vlz_fi.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/watercap.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/watercloud.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/watersat.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/wrf_output_2d.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/wrf_output_3d.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/writeg1d.F.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/wstats.F90.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/yoegwd.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/yomaer.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/yomlw.h.svn-base
+save/mars_lmd/libf/phymars/.svn/text-base/zerophys.F.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/
+save/mars_lmd/libf/phymars/.svn/prop-base/aerdata.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/callkeys.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/comcstfi.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/comdiurn.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/comg1d.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/comgeomfi.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/comorbit.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/comsaison.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/datafile.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/dimradmars.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/eofdump.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/meso_dimphys.h_ref.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/nltedata.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/nlteparams.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/planete.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/statto.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/surfdat.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/yoegwd.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/yomaer.h.svn-base
+save/mars_lmd/libf/phymars/.svn/prop-base/yomlw.h.svn-base
+save/mars_lmd/libf/phymars/.svn/props/
+save/mars_lmd/libf/phymars/.svn/tmp/
+save/mars_lmd/libf/phymars/.svn/tmp/text-base/
+save/mars_lmd/libf/phymars/.svn/tmp/prop-base/
+save/mars_lmd/libf/phymars/.svn/tmp/props/
+save/mars_lmd/libf/phymars/.svn/entries
+save/mars_lmd/libf/phymars/.svn/format
+save/mars_lmd/libf/phymars/.svn/all-wcprops
+save/mars_lmd/libf/aeronomars/
+save/mars_lmd/libf/aeronomars/calchim.F
+save/mars_lmd/libf/aeronomars/chemthermos.F
+save/mars_lmd/libf/aeronomars/ch.F
+save/mars_lmd/libf/aeronomars/chimiedata.h
+save/mars_lmd/libf/aeronomars/column.F
+save/mars_lmd/libf/aeronomars/concentrations.F
+save/mars_lmd/libf/aeronomars/conc.h
+save/mars_lmd/libf/aeronomars/conduction.F
+save/mars_lmd/libf/aeronomars/dtridgl.F
+save/mars_lmd/libf/aeronomars/euvheat.F
+save/mars_lmd/libf/aeronomars/flujo.F
+save/mars_lmd/libf/aeronomars/getch.F
+save/mars_lmd/libf/aeronomars/hrtherm.F
+save/mars_lmd/libf/aeronomars/inichim.F
+save/mars_lmd/libf/aeronomars/inichim_newstart.F
+save/mars_lmd/libf/aeronomars/inichim_readcallphys.F
+save/mars_lmd/libf/aeronomars/init_chimie_B.F
+save/mars_lmd/libf/aeronomars/interpfast.F
+save/mars_lmd/libf/aeronomars/intrplf.F
+save/mars_lmd/libf/aeronomars/inv.F
+save/mars_lmd/libf/aeronomars/jthermcalc.F
+save/mars_lmd/libf/aeronomars/moldiffcoeff.F
+save/mars_lmd/libf/aeronomars/moldiff.F
+save/mars_lmd/libf/aeronomars/molvis.F
+save/mars_lmd/libf/aeronomars/paramfoto.F
+save/mars_lmd/libf/aeronomars/param.h
+save/mars_lmd/libf/aeronomars/param_read.F
+save/mars_lmd/libf/aeronomars/param_v3.h
+save/mars_lmd/libf/aeronomars/perosat.F
+save/mars_lmd/libf/aeronomars/phdisrate.F
+save/mars_lmd/libf/aeronomars/photochemist_B.F
+save/mars_lmd/libf/aeronomars/thermosphere.F
+save/mars_lmd/libf/aeronomars/calchim.F~
+save/mars_lmd/libf/aeronomars/conduction.F~
+save/mars_lmd/libf/aeronomars/molvis.F~
+save/mars_lmd/libf/aeronomars/.svn/
+save/mars_lmd/libf/aeronomars/.svn/text-base/
+save/mars_lmd/libf/aeronomars/.svn/text-base/calchim.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/ch.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/chemthermos.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/chimiedata.h.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/column.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/conc.h.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/concentrations.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/conduction.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/dtridgl.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/euvheat.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/flujo.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/getch.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/hrtherm.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/inichim.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/inichim_newstart.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/inichim_readcallphys.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/init_chimie_B.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/interpfast.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/intrplf.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/inv.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/jthermcalc.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/moldiff.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/moldiffcoeff.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/molvis.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/param.h.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/param_read.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/param_v3.h.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/paramfoto.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/perosat.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/phdisrate.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/photochemist_B.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/text-base/thermosphere.F.svn-base
+save/mars_lmd/libf/aeronomars/.svn/prop-base/
+save/mars_lmd/libf/aeronomars/.svn/props/
+save/mars_lmd/libf/aeronomars/.svn/tmp/
+save/mars_lmd/libf/aeronomars/.svn/tmp/text-base/
+save/mars_lmd/libf/aeronomars/.svn/tmp/prop-base/
+save/mars_lmd/libf/aeronomars/.svn/tmp/props/
+save/mars_lmd/libf/aeronomars/.svn/entries
+save/mars_lmd/libf/aeronomars/.svn/format
+save/mars_lmd/libf/aeronomars/.svn/all-wcprops
+save/mars_lmd/libf/dyn3d/
+save/mars_lmd/libf/dyn3d/angtot.h
+save/mars_lmd/libf/dyn3d/clesph0.h
+save/mars_lmd/libf/dyn3d/comav.h
+save/mars_lmd/libf/dyn3d/comconst.h
+save/mars_lmd/libf/dyn3d/comdiss.h
+save/mars_lmd/libf/dyn3d/comdissip.h
+save/mars_lmd/libf/dyn3d/comdissipn.h
+save/mars_lmd/libf/dyn3d/comdissnew.h
+save/mars_lmd/libf/dyn3d/comgeom2.h
+save/mars_lmd/libf/dyn3d/comgeom.h
+save/mars_lmd/libf/dyn3d/comvert.h
+save/mars_lmd/libf/dyn3d/control.h
+save/mars_lmd/libf/dyn3d/description.h
+save/mars_lmd/libf/dyn3d/ener.h
+save/mars_lmd/libf/dyn3d/gradsdef.h
+save/mars_lmd/libf/dyn3d/logic.h
+save/mars_lmd/libf/dyn3d/paramet.h
+save/mars_lmd/libf/dyn3d/para_netcdf.h
+save/mars_lmd/libf/dyn3d/serre.h
+save/mars_lmd/libf/dyn3d/sponge.h
+save/mars_lmd/libf/dyn3d/temps.h
+save/mars_lmd/libf/dyn3d/tracstoke.h
+save/mars_lmd/libf/dyn3d/.svn/
+save/mars_lmd/libf/dyn3d/.svn/text-base/
+save/mars_lmd/libf/dyn3d/.svn/text-base/angtot.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/clesph0.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/comav.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/comconst.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/comdiss.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/comdissip.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/comdissipn.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/comdissnew.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/comgeom.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/comgeom2.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/comvert.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/control.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/description.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/ener.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/gradsdef.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/logic.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/paramet.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/para_netcdf.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/serre.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/sponge.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/temps.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/text-base/tracstoke.h.svn-base
+save/mars_lmd/libf/dyn3d/.svn/prop-base/
+save/mars_lmd/libf/dyn3d/.svn/props/
+save/mars_lmd/libf/dyn3d/.svn/tmp/
+save/mars_lmd/libf/dyn3d/.svn/tmp/text-base/
+save/mars_lmd/libf/dyn3d/.svn/tmp/prop-base/
+save/mars_lmd/libf/dyn3d/.svn/tmp/props/
+save/mars_lmd/libf/dyn3d/.svn/entries
+save/mars_lmd/libf/dyn3d/.svn/format
+save/mars_lmd/libf/dyn3d/.svn/all-wcprops
+save/mars_lmd/libf/must_keep
+save/mars_lmd/libf/zz_not_used/
+save/mars_lmd/libf/zz_not_used/filtrez/
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/Root
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/Repository
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/Entries
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/Tag
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/text-base/
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/text-base/Entries.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/text-base/Repository.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/text-base/Root.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/text-base/Tag.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/prop-base/
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/props/
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/tmp/
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/tmp/text-base/
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/tmp/prop-base/
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/tmp/props/
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/entries
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/format
+save/mars_lmd/libf/zz_not_used/filtrez/CVS/.svn/all-wcprops
+save/mars_lmd/libf/zz_not_used/filtrez/coefils.h
+save/mars_lmd/libf/zz_not_used/filtrez/acc.F
+save/mars_lmd/libf/zz_not_used/filtrez/eigen.F
+save/mars_lmd/libf/zz_not_used/filtrez/eigen_sort.F
+save/mars_lmd/libf/zz_not_used/filtrez/filtreg.F
+save/mars_lmd/libf/zz_not_used/filtrez/inifgn.F
+save/mars_lmd/libf/zz_not_used/filtrez/inifilr.F
+save/mars_lmd/libf/zz_not_used/filtrez/jacobi.F
+save/mars_lmd/libf/zz_not_used/filtrez/parafilt.h
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/acc.F.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/coefils.h.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/eigen.F.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/eigen_sort.F.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/filtreg.F.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/inifgn.F.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/inifilr.F.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/jacobi.F.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/text-base/parafilt.h.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/acc.F.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/coefils.h.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/eigen.F.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/eigen_sort.F.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/filtreg.F.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/inifgn.F.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/inifilr.F.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/jacobi.F.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/prop-base/parafilt.h.svn-base
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/props/
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/tmp/
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/tmp/text-base/
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/tmp/prop-base/
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/tmp/props/
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/entries
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/format
+save/mars_lmd/libf/zz_not_used/filtrez/.svn/all-wcprops
+save/mars_lmd/libf/zz_not_used/dyn3d/
+save/mars_lmd/libf/zz_not_used/dyn3d/LISEZMOI
+save/mars_lmd/libf/zz_not_used/dyn3d/abort_gcm.F
+save/mars_lmd/libf/zz_not_used/dyn3d/addfi.F
+save/mars_lmd/libf/zz_not_used/dyn3d/addit.F
+save/mars_lmd/libf/zz_not_used/dyn3d/adv_h2o.F
+save/mars_lmd/libf/zz_not_used/dyn3d/advect.F
+save/mars_lmd/libf/zz_not_used/dyn3d/amont.F
+save/mars_lmd/libf/zz_not_used/dyn3d/amont_qsat.F
+save/mars_lmd/libf/zz_not_used/dyn3d/angtot.h
+save/mars_lmd/libf/zz_not_used/dyn3d/anldoppler2.F
+save/mars_lmd/libf/zz_not_used/dyn3d/bernoui.F
+save/mars_lmd/libf/zz_not_used/dyn3d/caldyn.F
+save/mars_lmd/libf/zz_not_used/dyn3d/caldyn0.F
+save/mars_lmd/libf/zz_not_used/dyn3d/calfis.F
+save/mars_lmd/libf/zz_not_used/dyn3d/lect_start_archive.F
+save/mars_lmd/libf/zz_not_used/dyn3d/clesph0.h
+save/mars_lmd/libf/zz_not_used/dyn3d/coefpoly.F
+save/mars_lmd/libf/zz_not_used/dyn3d/comav.h
+save/mars_lmd/libf/zz_not_used/dyn3d/comconst.h
+save/mars_lmd/libf/zz_not_used/dyn3d/comdiss.h
+save/mars_lmd/libf/zz_not_used/dyn3d/comdissip.h
+save/mars_lmd/libf/zz_not_used/dyn3d/divgrad22.F
+save/mars_lmd/libf/zz_not_used/dyn3d/comdissipn.h
+save/mars_lmd/libf/zz_not_used/dyn3d/comgeom.h
+save/mars_lmd/libf/zz_not_used/dyn3d/comdissnew.h
+save/mars_lmd/libf/zz_not_used/dyn3d/comgeom2.h
+save/mars_lmd/libf/zz_not_used/dyn3d/comvert.h
+save/mars_lmd/libf/zz_not_used/dyn3d/control.h
+save/mars_lmd/libf/zz_not_used/dyn3d/convflu.F
+save/mars_lmd/libf/zz_not_used/dyn3d/convmas.F
+save/mars_lmd/libf/zz_not_used/dyn3d/coordij.F
+save/mars_lmd/libf/zz_not_used/dyn3d/covcont.F
+save/mars_lmd/libf/zz_not_used/dyn3d/covnat.F
+save/mars_lmd/libf/zz_not_used/dyn3d/disvert.orig
+save/mars_lmd/libf/zz_not_used/dyn3d/defrun_new.F
+save/mars_lmd/libf/zz_not_used/dyn3d/description.h
+save/mars_lmd/libf/zz_not_used/dyn3d/diagadv.F
+save/mars_lmd/libf/zz_not_used/dyn3d/dissip.F
+save/mars_lmd/libf/zz_not_used/dyn3d/disvert.F
+save/mars_lmd/libf/zz_not_used/dyn3d/diverg.F
+save/mars_lmd/libf/zz_not_used/dyn3d/diverg_gam.F
+save/mars_lmd/libf/zz_not_used/dyn3d/divergf.F
+save/mars_lmd/libf/zz_not_used/dyn3d/divergst.F
+save/mars_lmd/libf/zz_not_used/dyn3d/divgrad.F
+save/mars_lmd/libf/zz_not_used/dyn3d/divgrad2.F
+save/mars_lmd/libf/zz_not_used/dyn3d/newstart.F
+save/mars_lmd/libf/zz_not_used/dyn3d/dteta1.F
+save/mars_lmd/libf/zz_not_used/dyn3d/dudv1.F
+save/mars_lmd/libf/zz_not_used/dyn3d/dudv2.F
+save/mars_lmd/libf/zz_not_used/dyn3d/dump2d.F
+save/mars_lmd/libf/zz_not_used/dyn3d/dynetat0.F
+save/mars_lmd/libf/zz_not_used/dyn3d/dynredem.F
+save/mars_lmd/libf/zz_not_used/dyn3d/logic.h
+save/mars_lmd/libf/zz_not_used/dyn3d/ener.h
+save/mars_lmd/libf/zz_not_used/dyn3d/enercin.F
+save/mars_lmd/libf/zz_not_used/dyn3d/exner.F
+save/mars_lmd/libf/zz_not_used/dyn3d/exnerF
+save/mars_lmd/libf/zz_not_used/dyn3d/exner_hyb.F
+save/mars_lmd/libf/zz_not_used/dyn3d/flumass.F
+save/mars_lmd/libf/zz_not_used/dyn3d/fluxstoke.F
+save/mars_lmd/libf/zz_not_used/dyn3d/fxhyp.F
+save/mars_lmd/libf/zz_not_used/dyn3d/fxy.F
+save/mars_lmd/libf/zz_not_used/dyn3d/fxyhyper.F
+save/mars_lmd/libf/zz_not_used/dyn3d/fxysinus.F
+save/mars_lmd/libf/zz_not_used/dyn3d/fyhyp.F
+save/mars_lmd/libf/zz_not_used/dyn3d/gcm.F
+save/mars_lmd/libf/zz_not_used/dyn3d/geopot.F
+save/mars_lmd/libf/zz_not_used/dyn3d/gr_dyn_fi.F
+save/mars_lmd/libf/zz_not_used/dyn3d/gr_fi_dyn.F
+save/mars_lmd/libf/zz_not_used/dyn3d/grad.F
+save/mars_lmd/libf/zz_not_used/dyn3d/grid_noro1.F
+save/mars_lmd/libf/zz_not_used/dyn3d/gr_int_dyn.F
+save/mars_lmd/libf/zz_not_used/dyn3d/gr_u_scal.F
+save/mars_lmd/libf/zz_not_used/dyn3d/gr_v_scal.F
+save/mars_lmd/libf/zz_not_used/dyn3d/gradiv.F
+save/mars_lmd/libf/zz_not_used/dyn3d/gradiv2.F
+save/mars_lmd/libf/zz_not_used/dyn3d/gradsdef.h
+save/mars_lmd/libf/zz_not_used/dyn3d/grid_atob.F
+save/mars_lmd/libf/zz_not_used/dyn3d/grid_noro.F
+save/mars_lmd/libf/zz_not_used/dyn3d/ini_archive.F
+save/mars_lmd/libf/zz_not_used/dyn3d/groupe.F
+save/mars_lmd/libf/zz_not_used/dyn3d/groupeun.F
+save/mars_lmd/libf/zz_not_used/dyn3d/heavyside.F
+save/mars_lmd/libf/zz_not_used/dyn3d/iniav.F
+save/mars_lmd/libf/zz_not_used/dyn3d/iniconst.F
+save/mars_lmd/libf/zz_not_used/dyn3d/inidissip.F
+save/mars_lmd/libf/zz_not_used/dyn3d/inigeom.F
+save/mars_lmd/libf/zz_not_used/dyn3d/inigrads.F
+save/mars_lmd/libf/zz_not_used/dyn3d/iniinterp_h.F
+save/mars_lmd/libf/zz_not_used/dyn3d/initial0.F
+save/mars_lmd/libf/zz_not_used/dyn3d/write_archive.F
+save/mars_lmd/libf/zz_not_used/dyn3d/iniwrite.F
+save/mars_lmd/libf/zz_not_used/dyn3d/integrd.F
+save/mars_lmd/libf/zz_not_used/dyn3d/interp_horiz.F
+save/mars_lmd/libf/zz_not_used/dyn3d/interp_vert.F
+save/mars_lmd/libf/zz_not_used/dyn3d/laplacien.F
+save/mars_lmd/libf/zz_not_used/dyn3d/laplacien_gam.F
+save/mars_lmd/libf/zz_not_used/dyn3d/laplacien_rot.F
+save/mars_lmd/libf/zz_not_used/dyn3d/laplacien_rotgam.F
+save/mars_lmd/libf/zz_not_used/dyn3d/lectflux.F
+save/mars_lmd/libf/zz_not_used/dyn3d/massbar.F
+save/mars_lmd/libf/zz_not_used/dyn3d/massbarxy.F
+save/mars_lmd/libf/zz_not_used/dyn3d/massdair.F
+save/mars_lmd/libf/zz_not_used/dyn3d/minmax.F
+save/mars_lmd/libf/zz_not_used/dyn3d/multipl.F
+save/mars_lmd/libf/zz_not_used/dyn3d/multscal.F
+save/mars_lmd/libf/zz_not_used/dyn3d/netcdf.inc
+save/mars_lmd/libf/zz_not_used/dyn3d/start2archive.F
+save/mars_lmd/libf/zz_not_used/dyn3d/paramet.h
+save/mars_lmd/libf/zz_not_used/dyn3d/nxgrad.F
+save/mars_lmd/libf/zz_not_used/dyn3d/vanleer.F
+save/mars_lmd/libf/zz_not_used/dyn3d/nxgrad_gam.F
+save/mars_lmd/libf/zz_not_used/dyn3d/nxgradst.F
+save/mars_lmd/libf/zz_not_used/dyn3d/nxgraro2.F
+save/mars_lmd/libf/zz_not_used/dyn3d/nxgrarot.F
+save/mars_lmd/libf/zz_not_used/dyn3d/para_netcdf.h
+save/mars_lmd/libf/zz_not_used/dyn3d/pression.F
+save/mars_lmd/libf/zz_not_used/dyn3d/ps_amontF
+save/mars_lmd/libf/zz_not_used/dyn3d/psextbar.F
+save/mars_lmd/libf/zz_not_used/dyn3d/ran1.F
+save/mars_lmd/libf/zz_not_used/dyn3d/rotat_nfil.F
+save/mars_lmd/libf/zz_not_used/dyn3d/rotat.F
+save/mars_lmd/libf/zz_not_used/dyn3d/rotatf.F
+save/mars_lmd/libf/zz_not_used/dyn3d/rotatst.F
+save/mars_lmd/libf/zz_not_used/dyn3d/scal_wind.F
+save/mars_lmd/libf/zz_not_used/dyn3d/serre.h
+save/mars_lmd/libf/zz_not_used/dyn3d/sortvarc.F
+save/mars_lmd/libf/zz_not_used/dyn3d/sortvarc0.F
+save/mars_lmd/libf/zz_not_used/dyn3d/spline.F
+save/mars_lmd/libf/zz_not_used/dyn3d/splint.F
+save/mars_lmd/libf/zz_not_used/dyn3d/sponge.F
+save/mars_lmd/libf/zz_not_used/dyn3d/sponge.h
+save/mars_lmd/libf/zz_not_used/dyn3d/temps.h
+save/mars_lmd/libf/zz_not_used/dyn3d/test_period.F
+save/mars_lmd/libf/zz_not_used/dyn3d/testharm.F
+save/mars_lmd/libf/zz_not_used/dyn3d/tourpot.F
+save/mars_lmd/libf/zz_not_used/dyn3d/traceur.F
+save/mars_lmd/libf/zz_not_used/dyn3d/tracstoke.h
+save/mars_lmd/libf/zz_not_used/dyn3d/tracvl.F
+save/mars_lmd/libf/zz_not_used/dyn3d/vitvert.F
+save/mars_lmd/libf/zz_not_used/dyn3d/vlsplt.F
+save/mars_lmd/libf/zz_not_used/dyn3d/vlspltqs.F
+save/mars_lmd/libf/zz_not_used/dyn3d/wind_scal.F
+save/mars_lmd/libf/zz_not_used/dyn3d/wrgrads.F
+save/mars_lmd/libf/zz_not_used/dyn3d/xvik.F
+save/mars_lmd/libf/zz_not_used/dyn3d/readhead_NC.F
+save/mars_lmd/libf/zz_not_used/dyn3d/anl_stats-diag.F
+save/mars_lmd/libf/zz_not_used/dyn3d/anl_mcdstats.F
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/LISEZMOI.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/abort_gcm.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/addfi.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/addit.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/adv_h2o.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/advect.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/amont.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/amont_qsat.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/angtot.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/anl_mcdstats.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/anl_stats-diag.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/anldoppler2.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/bernoui.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/caldyn.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/caldyn0.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/calfis.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/clesph0.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/coefpoly.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comav.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comconst.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comdiss.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comdissip.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comdissipn.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comdissnew.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comgeom.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comgeom2.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/comvert.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/control.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/convflu.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/convmas.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/coordij.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/covcont.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/covnat.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/ener.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/defrun_new.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/description.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/diagadv.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/dissip.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/disvert.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/disvert.orig.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/diverg.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/diverg_gam.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/divergf.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/divergst.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/divgrad.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/divgrad2.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/divgrad22.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/dteta1.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/dudv1.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/dudv2.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/dump2d.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/dynetat0.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/dynredem.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/enercin.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/exner.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/exnerF.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/exner_hyb.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/flumass.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/fluxstoke.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/fxhyp.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/fxy.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/fxyhyper.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/fxysinus.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/fyhyp.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gcm.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/geopot.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gr_dyn_fi.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gr_fi_dyn.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gr_int_dyn.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gr_u_scal.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gr_v_scal.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/grad.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gradiv.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gradiv2.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/gradsdef.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/grid_atob.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/grid_noro.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/grid_noro1.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/groupe.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/groupeun.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/heavyside.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/ini_archive.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/iniav.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/iniconst.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/inidissip.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/inigeom.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/inigrads.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/iniinterp_h.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/initial0.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/iniwrite.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/integrd.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/interp_horiz.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/interp_vert.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/laplacien.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/laplacien_gam.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/laplacien_rot.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/laplacien_rotgam.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/lect_start_archive.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/lectflux.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/logic.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/massbar.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/massbarxy.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/massdair.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/minmax.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/multipl.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/multscal.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/netcdf.inc.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/newstart.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/nxgrad.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/nxgrad_gam.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/nxgradst.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/nxgraro2.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/nxgrarot.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/para_netcdf.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/paramet.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/pression.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/ps_amontF.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/psextbar.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/ran1.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/readhead_NC.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/rotat.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/rotat_nfil.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/rotatf.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/rotatst.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/scal_wind.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/serre.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/sortvarc.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/sortvarc0.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/spline.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/splint.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/sponge.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/sponge.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/start2archive.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/temps.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/test_period.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/testharm.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/tourpot.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/traceur.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/tracstoke.h.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/tracvl.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/vanleer.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/vitvert.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/vlsplt.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/vlspltqs.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/wind_scal.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/wrgrads.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/write_archive.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/text-base/xvik.F.svn-base
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/prop-base/
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/props/
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/tmp/
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/tmp/text-base/
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/tmp/prop-base/
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/tmp/props/
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/entries
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/format
+save/mars_lmd/libf/zz_not_used/dyn3d/.svn/all-wcprops
+save/mars_lmd/libf/zz_not_used/grid/
+save/mars_lmd/libf/zz_not_used/grid/dimension/
+save/mars_lmd/libf/zz_not_used/grid/dimension/makdim
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.32.t2
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.25.t2
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.32.t2
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.32.t12
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.32.t13
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.32.t14
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.24.25.t2
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.25.t14
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.72.36.32.t2
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.54.t2
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.54.t14
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.32.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/makdim.bak
+save/mars_lmd/libf/zz_not_used/grid/dimension/makdim.moi
+save/mars_lmd/libf/zz_not_used/grid/dimension/makdim.n
+save/mars_lmd/libf/zz_not_used/grid/dimension/makdim.old
+save/mars_lmd/libf/zz_not_used/grid/dimension/makdimphy
+save/mars_lmd/libf/zz_not_used/grid/dimension/makntrac
+save/mars_lmd/libf/zz_not_used/grid/dimension/ntraceur.1
+save/mars_lmd/libf/zz_not_used/grid/dimension/ntraceur.5
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.32.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.325.t2
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.24.25.t14
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.24.32.t14
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.24.32.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.24.25.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.60.t14
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.60.t12
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.32.t14
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.60.t60
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.60.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.25.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.50.t14
+save/mars_lmd/libf/zz_not_used/grid/dimension/makdim~
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.34.60.t14
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.24.t2
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.25.t-p
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.50.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.24.50.t13
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.50.t14
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.t14
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.1.1.32.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.50.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.50.t14
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.t2
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.2.t14
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.32.t15
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.10.48.55.t6
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.50.t15
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.1.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.50.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.64.48.50.t15
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.25.t2
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.25.t15
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.25.t32
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.32.t15
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.32.25.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.32.25.t2
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.16.24.25.t15
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.176.90.18.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.25.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.40.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.201.2.40.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.60.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.30.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.45.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/dimensions.20.t1
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.1.1.32.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.1.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.10.48.55.t6.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.24.25.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.24.25.t14.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.24.25.t15.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.24.25.t2.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.24.32.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.24.32.t14.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.32.25.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.16.32.25.t2.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.2.t14.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.176.90.18.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.20.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.201.2.40.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.25.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.25.t15.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.25.t2.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.25.t32.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.30.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.32.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.32.t14.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.32.t2.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.50.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.50.t13.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.50.t14.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.60.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.60.t12.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.60.t14.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.24.60.t60.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.34.60.t14.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.t14.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.t15.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.32.t2.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.40.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.45.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.50.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.50.t14.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.50.t15.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.60.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.24.t2.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.25.t-p.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.25.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.25.t14.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.25.t2.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.32.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.32.t12.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.32.t13.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.32.t14.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/makdim.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.32.t15.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.32.t2.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.325.t2.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.50.t1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.50.t14.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.50.t15.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.54.t14.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.64.48.54.t2.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/dimensions.72.36.32.t2.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/makdim.bak.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/makdim.moi.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/makdim.n.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/makdim.old.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/makdimphy.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/makntrac.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/ntraceur.1.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/text-base/ntraceur.5.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/prop-base/
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/prop-base/makdim.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/prop-base/makdim.bak.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/prop-base/makdim.moi.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/prop-base/makdim.old.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/prop-base/makdimphy.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/prop-base/makntrac.svn-base
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/props/
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/tmp/
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/tmp/text-base/
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/tmp/prop-base/
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/tmp/props/
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/entries
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/format
+save/mars_lmd/libf/zz_not_used/grid/dimension/.svn/all-wcprops
+save/mars_lmd/libf/zz_not_used/grid/fxy_new.h
+save/mars_lmd/libf/zz_not_used/grid/fxy_reg.h
+save/mars_lmd/libf/zz_not_used/grid/fxy_sin.h
+save/mars_lmd/libf/zz_not_used/grid/fxyprim.h
+save/mars_lmd/libf/zz_not_used/grid/.svn/
+save/mars_lmd/libf/zz_not_used/grid/.svn/text-base/
+save/mars_lmd/libf/zz_not_used/grid/.svn/text-base/fxy_new.h.svn-base
+save/mars_lmd/libf/zz_not_used/grid/.svn/text-base/fxy_reg.h.svn-base
+save/mars_lmd/libf/zz_not_used/grid/.svn/text-base/fxy_sin.h.svn-base
+save/mars_lmd/libf/zz_not_used/grid/.svn/text-base/fxyprim.h.svn-base
+save/mars_lmd/libf/zz_not_used/grid/.svn/prop-base/
+save/mars_lmd/libf/zz_not_used/grid/.svn/props/
+save/mars_lmd/libf/zz_not_used/grid/.svn/tmp/
+save/mars_lmd/libf/zz_not_used/grid/.svn/tmp/text-base/
+save/mars_lmd/libf/zz_not_used/grid/.svn/tmp/prop-base/
+save/mars_lmd/libf/zz_not_used/grid/.svn/tmp/props/
+save/mars_lmd/libf/zz_not_used/grid/.svn/entries
+save/mars_lmd/libf/zz_not_used/grid/.svn/format
+save/mars_lmd/libf/zz_not_used/grid/.svn/all-wcprops
+save/mars_lmd/libf/zz_not_used/.svn/
+save/mars_lmd/libf/zz_not_used/.svn/text-base/
+save/mars_lmd/libf/zz_not_used/.svn/prop-base/
+save/mars_lmd/libf/zz_not_used/.svn/props/
+save/mars_lmd/libf/zz_not_used/.svn/tmp/
+save/mars_lmd/libf/zz_not_used/.svn/tmp/text-base/
+save/mars_lmd/libf/zz_not_used/.svn/tmp/prop-base/
+save/mars_lmd/libf/zz_not_used/.svn/tmp/props/
+save/mars_lmd/libf/zz_not_used/.svn/entries
+save/mars_lmd/libf/zz_not_used/.svn/format
+save/mars_lmd/libf/zz_not_used/.svn/all-wcprops
+save/mars_lmd/libf/duplicate2
+save/mars_lmd/libf/duplicate1
+save/mars_lmd/libf/generate2
+save/mars_lmd/libf/duplicate3
+save/mars_lmd/libf/generate3
+save/mars_lmd/libf/LMDZ.MARS.source.txt
+save/mars_lmd/libf/generate4
+save/mars_lmd/libf/duplicate4
+save/mars_lmd/libf/.svn/
+save/mars_lmd/libf/.svn/text-base/
+save/mars_lmd/libf/.svn/text-base/LMDZ.MARS.source.txt.svn-base
+save/mars_lmd/libf/.svn/text-base/duplicate1.svn-base
+save/mars_lmd/libf/.svn/text-base/duplicate2.svn-base
+save/mars_lmd/libf/.svn/text-base/duplicate3.svn-base
+save/mars_lmd/libf/.svn/text-base/duplicate4.svn-base
+save/mars_lmd/libf/.svn/text-base/generate2.svn-base
+save/mars_lmd/libf/.svn/text-base/generate3.svn-base
+save/mars_lmd/libf/.svn/text-base/generate4.svn-base
+save/mars_lmd/libf/.svn/text-base/must_keep.svn-base
+save/mars_lmd/libf/.svn/prop-base/
+save/mars_lmd/libf/.svn/prop-base/duplicate1.svn-base
+save/mars_lmd/libf/.svn/prop-base/duplicate2.svn-base
+save/mars_lmd/libf/.svn/prop-base/duplicate3.svn-base
+save/mars_lmd/libf/.svn/prop-base/duplicate4.svn-base
+save/mars_lmd/libf/.svn/prop-base/generate2.svn-base
+save/mars_lmd/libf/.svn/prop-base/generate3.svn-base
+save/mars_lmd/libf/.svn/prop-base/generate4.svn-base
+save/mars_lmd/libf/.svn/props/
+save/mars_lmd/libf/.svn/tmp/
+save/mars_lmd/libf/.svn/tmp/text-base/
+save/mars_lmd/libf/.svn/tmp/prop-base/
+save/mars_lmd/libf/.svn/tmp/props/
+save/mars_lmd/libf/.svn/entries
+save/mars_lmd/libf/.svn/format
+save/mars_lmd/libf/.svn/all-wcprops
+save/mars_lmd/libo/
+save/mars_lmd/libo/log_compile_phys
+save/mars_lmd/libo/LINUXfastI._70_t1_reg/
+save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/
+save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/text-base/
+save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/prop-base/
+save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/props/
+save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/tmp/
+save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/tmp/text-base/
+save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/tmp/prop-base/
+save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/tmp/props/
+save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/entries
+save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/format
+save/mars_lmd/libo/LINUXfastI._70_t1_reg/.svn/all-wcprops
+save/mars_lmd/libo/.svn/
+save/mars_lmd/libo/.svn/text-base/
+save/mars_lmd/libo/.svn/text-base/log_compile_phys.svn-base
+save/mars_lmd/libo/.svn/prop-base/
+save/mars_lmd/libo/.svn/props/
+save/mars_lmd/libo/.svn/tmp/
+save/mars_lmd/libo/.svn/tmp/text-base/
+save/mars_lmd/libo/.svn/tmp/prop-base/
+save/mars_lmd/libo/.svn/tmp/props/
+save/mars_lmd/libo/.svn/entries
+save/mars_lmd/libo/.svn/format
+save/mars_lmd/libo/.svn/all-wcprops
+save/mars_lmd/tmp90
+save/mars_lmd/tmp77
+save/mars_lmd/makegcm_g95
+save/mars_lmd/tmp
+save/mars_lmd/makegcm_pgf
+save/mars_lmd/makegcm_mpi
+save/mars_lmd/makegcm_ifort
+save/mars_lmd/makegcm_pgf~
+save/mars_lmd/makegcm_mpifort
+save/mars_lmd/makegcm_mpi~
+save/mars_lmd/makegcm_gnu
+save/mars_lmd/makegcm_mpifort~
+save/mars_lmd/.svn/
+save/mars_lmd/.svn/text-base/
+save/mars_lmd/.svn/text-base/create_make_gcm.svn-base
+save/mars_lmd/.svn/text-base/error_libc.svn-base
+save/mars_lmd/.svn/text-base/liste_des_sources_f77.svn-base
+save/mars_lmd/.svn/text-base/liste_des_sources_f90.svn-base
+save/mars_lmd/.svn/text-base/makefile.svn-base
+save/mars_lmd/.svn/text-base/makefile_init.svn-base
+save/mars_lmd/.svn/text-base/makegcm_g95.svn-base
+save/mars_lmd/.svn/text-base/makegcm_gnu.svn-base
+save/mars_lmd/.svn/text-base/makegcm_ifort.svn-base
+save/mars_lmd/.svn/text-base/makegcm_mpi.svn-base
+save/mars_lmd/.svn/text-base/makegcm_mpifort.svn-base
+save/mars_lmd/.svn/text-base/makegcm_pgf.svn-base
+save/mars_lmd/.svn/text-base/tmp.svn-base
+save/mars_lmd/.svn/text-base/tmp77.svn-base
+save/mars_lmd/.svn/text-base/tmp90.svn-base
+save/mars_lmd/.svn/prop-base/
+save/mars_lmd/.svn/prop-base/create_make_gcm.svn-base
+save/mars_lmd/.svn/prop-base/makegcm_g95.svn-base
+save/mars_lmd/.svn/prop-base/makegcm_gnu.svn-base
+save/mars_lmd/.svn/prop-base/makegcm_ifort.svn-base
+save/mars_lmd/.svn/prop-base/makegcm_mpi.svn-base
+save/mars_lmd/.svn/prop-base/makegcm_mpifort.svn-base
+save/mars_lmd/.svn/prop-base/makegcm_pgf.svn-base
+save/mars_lmd/.svn/props/
+save/mars_lmd/.svn/tmp/
+save/mars_lmd/.svn/tmp/text-base/
+save/mars_lmd/.svn/tmp/prop-base/
+save/mars_lmd/.svn/tmp/props/
+save/mars_lmd/.svn/entries
+save/mars_lmd/.svn/format
+save/mars_lmd/.svn/all-wcprops
+save/phys/
+save/phys/diff_module_physics_init
+save/phys/Makefile
+save/phys/module_physics_init.F
+save/phys/module_lmd_driver.F
+save/phys/diff_module_physics_addtendc
+save/phys/diff_Makefile
+save/phys/module_physics_addtendc.F
+save/Registry/
+save/Registry/diff
+save/Registry/Registry.EM
+save/Registry/Registry.EMref
+save/Registry/Registry.EM_MARS
+save/Registry/Registry.EM_MARS0
+save/Registry/Registry.EM_MARS0~
+save/Registry/Registry.EM_MARS1
+save/Registry/Registry.EM_MARS1_watercycle
+save/Registry/Registry.EM_MARS2
+save/Registry/Registry.EM_dust
+save/Registry/Registry.EM_water
+save/Registry/Registry.bash
+save/share/
+save/share/module_date_time.F
+save/share/diff_module_model_constants
+save/share/module_model_constants.F
+save/share/module_model_constants.F_gcm
+save/share/module_model_constants.F_ref
+save/share/mediation_integrate.F
+save/share/diff_module_date_time
+save/share/diff_mediation_integrate
+save/main/
+save/main/real_em.F
+save/frame/
+save/frame/module_domain.F
Index: trunk/MESOSCALE_DEV/WORK/WRFV2-gfortran-x86_64-2.patch
===================================================================
--- trunk/MESOSCALE_DEV/WORK/WRFV2-gfortran-x86_64-2.patch	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/WRFV2-gfortran-x86_64-2.patch	(revision 207)
@@ -0,0 +1,361 @@
+--- WRFV2.original/arch/configure.defaults	2007-10-05 16:16:41.329127000 +0200
++++ WRFV2/arch/configure.defaults	2008-09-03 20:18:02.656065000 +0200
+@@ -10943,5 +10943,358 @@
+ 	$(RM) $*.b
+ 	$(FC) -c $(PROMOTION) $(FCBASEOPTS) $(MODULE_DIRS) $*.f90
+ 
++###########################################################
++#ARCH    PC Linux x86_64 (IA64 and AMD Opteron), GNU Fortran compiler, DM-Parallel  (RSL, MPICH, Allows nesting)
++#
++DMPARALLEL      =       1
++MAX_PROC        =       1024
++FC              =       mpif90
++LD              =       mpif90
++CC              =       mpicc
++SCC             =       gcc
++SFC             =       gfortran
++RWORDSIZE       =       $(NATIVE_RWORDSIZE)
++PROMOTION       =       
++CFLAGS          =       -DDM_PARALLEL -DWRF_RSL_IO \
++                        -DMAXDOM_MAKE=$(MAX_DOMAINS) -DMAXPROC_MAKE=$(MAX_PROC) -I../external/RSL/RSL \
++                        -DLANDREAD_STUB
++FCOPTIM         =       #-Mipa=fast
++FCDEBUG         =       #-g
++FCBASEOPTS      =       -w $(FCDEBUG) -ffree-form -ffree-line-length-none
++FCFLAGS         =       $(FCOPTIM) $(FCBASEOPTS)
++ARCHFLAGS       =       -DGRIB1 CONFIGURE_GRIB2_FLAG -DINTIO -DWRF_RSL_IO -DRSL -DDM_PARALLEL \
++                        -DIWORDSIZE=4 -DDWORDSIZE=8 -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=4 CONFIGURE_NETCDF_FLAG \
++                        -DLIMIT_ARGS -DLANDREAD_STUB
++# machine-specific flags needed to link in ESMF library (C++ run-time-library, etc.)
++ESMF_LIB_FLAGS  =
++ESMF_IO_LIB     =       ESMFIOLIB
++ESMF_IO_LIB_EXT =       ESMFIOEXTLIB
++INCLUDE_MODULES =       -J../main -I../main -I../external/io_netcdf -I../external/io_int -I../external/esmf_time_f90 \
++                        -I../external -I../frame -I../share -I../phys -I../inc -I../chem
++PERL            =       perl
++REGISTRY        =       Registry
++LIB             =       CONFIGURE_NETCDF_LIB_PATH -L../external/RSL/RSL -lrsl \
++                        -L../external/io_grib1 -lio_grib1 \
++                        CONFIGURE_GRIB2_LIB \
++                        -L../external/io_grib_share -lio_grib_share \
++                        -L../external/io_int -lwrfio_int \
++                        ../frame/module_internal_header_util.o ../frame/pack_utils.o -L../external/esmf_time_f90 -lesmf_time
++LDFLAGS         =       CONFIGURE_LDFLAGS
++ENVCOMPDEFS     =       CONFIGURE_COMPILEFLAGS
++CPP             =       /lib/cpp -C -P -traditional
++POUND_DEF       =       -DNO_RRTM_PHYSICS  -traditional $(COREDEFS) -DNONSTANDARD_SYSTEM -DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN) -DMAX_DOMAINS_F=$(MAX_DOMAINS)
++CPPFLAGS        =       -I$(LIBINCLUDE) -C -P $(ARCHFLAGS) -I../external/RSL/RSL -C -P `cat ../inc/dm_comm_cpp_flags` $(ENVCOMPDEFS) $(POUND_DEF)
++AR              =       ar ru
++M4              =       m4 -B 14000
++RANLIB          =       ranlib
++NETCDFPATH      =       CONFIGURE_NETCDF_PATH
++CC_TOOLS        =       cc
++
++externals : wrf_ioapi_includes CONFIGURE_WRFIO_NF wrfio_grib_share wrfio_grib1 CONFIGURE_WRFIO_GRIB2 ../external/RSL/RSL/librsl.a wrfio_int gen_comms.c module_dm.F esmf_time
++
++gen_comms.c : ../external/RSL/gen_comms.c
++	( /bin/cp ../tools/gen_comms_warning ../tools/gen_comms.c ; \
++	cat ../external/RSL/gen_comms.c >> ../tools/gen_comms.c )
++
++module_dm.F : ../external/RSL/module_dm.F
++	( /bin/cp module_dm_warning module_dm.F ; cat ../external/RSL/module_dm.F >> module_dm.F )
++
++wrfio_nf :
++	( cd ../external/io_netcdf ; \
++	make NETCDFPATH=CONFIGURE_NETCDF_PATH RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(FC) $(PROMOTION) $(FCFLAGS) -w" TRADFLAG="-traditional" )
++
++wrfio_int :
++	( cd ../external/io_int ; \
++	make CC="$(CC)" RANLIB="$(RANLIB)" CPP="$(CPP)" SFC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" FC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" all )
++
++wrfio_grib_share :
++	( cd ../external/io_grib_share ; \
++	make CC="$(SCC)" CFLAGS="$(CFLAGS)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
++
++wrfio_grib1 :
++	( cd ../external/io_grib1 ; \
++	make CC="$(SCC)" CFLAGS="$(CFLAGS)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
++
++wrfio_grib2 :
++	( cd ../external/io_grib2 ; \
++	make CC="$(SCC)" CFLAGS="$(CFLAGS) CONFIGURE_GRIB2_INC" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" FIXED="-Mfixed" archive)
++
++esmf_time :
++	( cd ../external/esmf_time_f90 ; \
++	make FC="$(FC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" RANLIB="$(RANLIB)" CPP="$(CPP) -I../../inc -I. $(POUND_DEF)" )
++
++../external/RSL/RSL/librsl.a :
++	( cd ../external/RSL/RSL ; make CC="$(CC)" FC="$(FC) $(PROMOTION)" MAX_DOMAINS=$(MAX_DOMAINS) MAX_PROC=$(MAX_PROC) LEARN_BCAST=-DLEARN_BCAST linux )
++
++# compile these without high optimization to speed compile
++solve_interface.o : solve_interface.F
++shift_domain_em.o : shift_domain_em.F
++module_io_mm5.o : module_io_mm5.F
++module_si_io.o : module_si_io.F
++module_io_wrf.o : module_io_wrf.F
++module_domain.o : module_domain.F
++module_start.o : module_start.F
++module_initialize.o : module_initialize.F
++module_initialize_b_wave.o : module_initialize_b_wave.F
++module_initialize_hill2d_x.o : module_initialize_hill2d_x.F
++module_initialize_quarter_ss.o : module_initialize_quarter_ss.F
++module_initialize_squall2d_x.o : module_initialize_squall2d_x.F
++module_initialize_squall2d_y.o : module_initialize_squall2d_y.F
++module_initialize_real.o : module_initialize_real.F
++module_dm.o : module_dm.F
++start_domain.o : start_domain.F
++mediation_integrate.o : mediation_integrate.F
++module_configure.o : module_configure.F
++
++solve_interface.o                                              \
++shift_domain_em.o                                              \
++module_io_mm5.o module_si_io.o module_io_wrf.o module_domain.o \
++module_start.o module_initialize.o module_initialize_b_wave.o  \
++module_initialize_hill2d_x.o module_initialize_quarter_ss.o    \
++module_initialize_squall2d_x.o module_initialize_squall2d_y.o  \
++mediation_integrate.o \
++module_configure.o                                             \
++module_initialize_real.o module_dm.o start_domain.o :
++	$(RM) $@
++	$(SED_FTN) $*.F > $*.b
++	$(CPP) -I../inc $(CPPFLAGS) $*.b  > $*.f90
++	$(RM) $*.b
++	$(FC) -c $(PROMOTION) $(FCBASEOPTS) $(MODULE_DIRS) $*.f90
++
++
++###########################################################
++#ARCH    PC Linux x86_64 (IA64 and Opteron), GNU Fortran compiler   (Single-threaded, RSL, Allows nesting)
++#
++DMPARALLEL      =       1
++MAX_PROC        =       1024
++FC              =       gfortran
++LD              =       gfortran
++CC              =       gcc
++SCC		=	$(CC)
++SFC             =       gfortran
++RWORDSIZE       =       $(NATIVE_RWORDSIZE)
++FCOPTIM		=       #-O3 -funroll-loops -ftree-vectorize -ftree-loop-linear
++FCDEBUG		=	#-g
++FCBASEOPTS      =       -w $(FCDEBUG) -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4
++FCFLAGS         =       $(FCOPTIM) $(FCBASEOPTS)
++ARCHFLAGS       =       -DGRIB1 -DINTIO -DWRF_RSL_IO -DRSL -DDM_PARALLEL \
++                        -DIWORDSIZE=4 -DDWORDSIZE=8 -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=4 CONFIGURE_NETCDF_FLAG \
++			-DLIMIT_ARGS -DSTUBMPI
++PROMOTION	=
++CFLAGS          =       -DLANDREADSTUB -DDM_PARALLEL -DWRF_RSL_IO \
++                        -DMAXDOM_MAKE=$(MAX_DOMAINS) -DMAXPROC_MAKE=$(MAX_PROC) -I../external/RSL/RSL $(ARCHFLAGS)
++# machine-specific flags needed to link in ESMF library (C++ run-time-library, etc.)
++ESMF_LIB_FLAGS  =       
++ESMF_IO_LIB     =       ESMFIOLIB
++ESMF_IO_LIB_EXT =       ESMFIOEXTLIB
++INCLUDE_MODULES =       -J../main -I../main -I../external/io_netcdf -I../external/io_int -I../external/esmf_time_f90 \
++                        -I../external -I../frame -I../share -I../phys -I../chem -I../inc
++PERL            =       perl
++REGISTRY        =       Registry
++LIB             =       CONFIGURE_NETCDF_LIB_PATH -L../external/RSL/RSL -lrsl \
++                        -L../external/io_grib1 -lio_grib1 \
++			-L../external/io_int -lwrfio_int \
++			-L../external/io_grib_share -lio_grib_share \
++			../frame/module_internal_header_util.o ../frame/pack_utils.o -L../external/esmf_time_f90 -lesmf_time 
++LDFLAGS         =       $(FCFLAGS) CONFIGURE_LDFLAGS -fconvert=big-endian
++ENVCOMPDEFS	=	CONFIGURE_COMPILEFLAGS
++CPP             =       /lib/cpp -C -P -traditional
++POUND_DEF	=	-DNO_RRTM_PHYSICS  $(COREDEFS) -DNONSTANDARD_SYSTEM -DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN) -DMAX_DOMAINS_F=$(MAX_DOMAINS)
++CPPFLAGS        =       -I$(LIBINCLUDE) -C -P $(ARCHFLAGS) -I../external/RSL/RSL -C -P `cat ../inc/dm_comm_cpp_flags` $(ENVCOMPDEFS) $(POUND_DEF)
++AR              =       ar ru
++M4              =       m4 -B 14000
++RANLIB          =       ranlib
++NETCDFPATH	=	CONFIGURE_NETCDF_PATH
++CC_TOOLS        =       cc
++
++externals : wrf_ioapi_includes CONFIGURE_WRFIO_NF wrfio_grib_share wrfio_grib1 ../external/RSL/RSL/librsl.a wrfio_int gen_comms.c module_dm.F esmf_time
++
++gen_comms.c : ../external/RSL/gen_comms.c
++	( /bin/cp ../tools/gen_comms_warning ../tools/gen_comms.c ; \
++          cat ../external/RSL/gen_comms.c >> ../tools/gen_comms.c )
++
++module_dm.F : ../external/RSL/module_dm.F
++	( /bin/cp module_dm_warning module_dm.F ; cat ../external/RSL/module_dm.F >> module_dm.F )
++
++wrfio_nf : 
++	( cd ../external/io_netcdf ; \
++	  make NETCDFPATH=CONFIGURE_NETCDF_PATH RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(FC) $(PROMOTION) $(FCFLAGS) -w" TRADFLAG="-traditional" )
++
++wrfio_grib_share :
++	( cd ../external/io_grib_share ; \
++          make CC="$(SCC)" CFLAGS="$(CFLAGS)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
++
++wrfio_grib1 :
++	( cd ../external/io_grib1 ; \
++          make CC="$(SCC)" CFLAGS="$(CFLAGS)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
++
++wrfio_grib2 :
++	( cd ../external/io_grib2 ; \
++          make CC="$(SCC)" CFLAGS="$(CFLAGS) CONFIGURE_GRIB2_INC" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" FIXED="-Mfixed" archive)
++
++wrfio_int : 
++	( cd ../external/io_int ; \
++          make CC="$(CC)" RANLIB="$(RANLIB)" CPP="$(CPP)" SFC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" FC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" all )
++
++esmf_time : 
++	( cd ../external/esmf_time_f90 ; \
++	  make FC="$(FC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" RANLIB="$(RANLIB)" CPP="$(CPP) -I../../inc -I. $(POUND_DEF)" )
++
++../external/RSL/RSL/librsl.a :
++	( cd ../external/RSL/RSL ; make CC="$(CC)" CFLAGS='-DSTUBS' FC="$(FC) $(PROMOTION)" FFLAGS='' MAX_DOMAINS=$(MAX_DOMAINS) MAX_PROC=$(MAX_PROC) LEARN_BCAST=-DLEARN_BCAST stub )
++
++# compile these without high optimization to speed compile
++solve_interface.o : solve_interface.F
++shift_domain_em.o : shift_domain_em.F
++module_io_mm5.o : module_io_mm5.F
++module_si_io.o : module_si_io.F
++module_io_wrf.o : module_io_wrf.F
++module_domain.o : module_domain.F
++module_start.o : module_start.F
++module_initialize.o : module_initialize.F
++module_initialize_b_wave.o : module_initialize_b_wave.F
++module_initialize_hill2d_x.o : module_initialize_hill2d_x.F
++module_initialize_quarter_ss.o : module_initialize_quarter_ss.F
++module_initialize_squall2d_x.o : module_initialize_squall2d_x.F
++module_initialize_squall2d_y.o : module_initialize_squall2d_y.F
++module_initialize_real.o : module_initialize_real.F
++module_dm.o : module_dm.F
++start_domain.o : start_domain.F
++mediation_integrate.o : mediation_integrate.F
++module_configure.o : module_configure.F
++
++solve_interface.o                                              \
++shift_domain_em.o                                              \
++module_io_mm5.o module_si_io.o module_io_wrf.o module_domain.o \
++module_start.o module_initialize.o module_initialize_b_wave.o  \
++module_initialize_hill2d_x.o module_initialize_quarter_ss.o    \
++module_initialize_squall2d_x.o module_initialize_squall2d_y.o  \
++module_configure.o                                             \
++mediation_integrate.o \
++module_initialize_real.o module_dm.o start_domain.o :
++	$(RM) $@
++	$(SED_FTN) $*.F > $*.b 
++	$(CPP) -I../inc $(CPPFLAGS) $*.b  > $*.f90
++	$(RM) $*.b
++	$(FC) -c $(PROMOTION) $(FCBASEOPTS) $(MODULE_DIRS) $*.f90
++
++
++###########################################################
++#ARCH     PC Linux x86_64 (IA64 and Opteron), GNU Fortran compiler  DM-Parallel (RSL_LITE, OpenMPI, Allows nesting)
++#
++DMPARALLEL      =       1
++MAX_PROC        =       1024
++FC              =       mpif90
++LD              =       mpif90
++CC              =       mpicc
++SCC		=	gcc
++SFC             =       gfortran
++RWORDSIZE       =       $(NATIVE_RWORDSIZE)
++PROMOTION	=	
++CFLAGS          =       -DDM_PARALLEL \
++                        -DMAXDOM_MAKE=$(MAX_DOMAINS) -DMAXPROC_MAKE=$(MAX_PROC) -I../external/RSL_LITE
++FCOPTIM		=	
++FCDEBUG		=	
++FCBASEOPTS      =       -w $(FCDEBUG) -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4
++FCFLAGS         =       $(FCOPTIM) $(FCBASEOPTS)
++ARCHFLAGS       =       -DGRIB1 CONFIGURE_GRIB2_FLAG -DINTIO -DDM_PARALLEL \
++                        -DIWORDSIZE=4 -DDWORDSIZE=8 -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=4 CONFIGURE_NETCDF_FLAG \
++			-DLIMIT_ARGS -DNMM_NEST=$(WRF_NMM_NEST)
++# machine-specific flags needed to link in ESMF library (C++ run-time-library, etc.)
++ESMF_LIB_FLAGS  =       
++ESMF_IO_LIB     =       ESMFIOLIB
++ESMF_IO_LIB_EXT =       ESMFIOEXTLIB
++INCLUDE_MODULES =       -J../main -I../main -I../external/io_netcdf -I../external/io_int -I../external/esmf_time_f90 \
++                        -I../external -I../frame -I../share -I../phys -I../chem -I../inc
++PERL            =       perl
++REGISTRY        =       Registry
++LIB             =       CONFIGURE_NETCDF_LIB_PATH -L../external/RSL_LITE -lrsl_lite \
++                        -L../external/io_grib1 -lio_grib1 \
++                        CONFIGURE_GRIB2_LIB \
++                        -L../external/io_grib_share -lio_grib_share \
++			-L../external/io_int -lwrfio_int \
++			../frame/module_internal_header_util.o ../frame/pack_utils.o -L../external/esmf_time_f90 -lesmf_time 
++LDFLAGS         =       $(FCFLAGS) CONFIGURE_LDFLAGS -fconvert=big-endian
++ENVCOMPDEFS	=	CONFIGURE_COMPILEFLAGS
++CPP             =       /lib/cpp -C -P -traditional
++POUND_DEF	=	-DNO_RRTM_PHYSICS  -traditional $(COREDEFS) -DNONSTANDARD_SYSTEM -DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN) -DMAX_DOMAINS_F=$(MAX_DOMAINS)
++CPPFLAGS        =       -I$(LIBINCLUDE) -C -P $(ARCHFLAGS) -I../external/RSL_LITE -C -P `cat ../inc/dm_comm_cpp_flags` $(ENVCOMPDEFS) $(POUND_DEF)
++AR              =       ar ru
++M4              =       m4 -B 14000
++RANLIB          =       ranlib
++NETCDFPATH	=	CONFIGURE_NETCDF_PATH
++CC_TOOLS        =       cc
++
++externals : wrf_ioapi_includes CONFIGURE_WRFIO_NF wrfio_grib_share wrfio_grib1 CONFIGURE_WRFIO_GRIB2 ../external/RSL_LITE/librsl_lite.a wrfio_int gen_comms.c module_dm.F esmf_time
++
++gen_comms.c : ../external/RSL_LITE/gen_comms.c
++	( /bin/cp ../tools/gen_comms_warning ../tools/gen_comms.c ; \
++          cat ../external/RSL_LITE/gen_comms.c >> ../tools/gen_comms.c )
++
++module_dm.F : ../external/RSL_LITE/module_dm.F
++	( /bin/cp module_dm_warning module_dm.F ; cat ../external/RSL_LITE/module_dm.F >> module_dm.F )
++
++wrfio_nf : 
++	( cd ../external/io_netcdf ; \
++	  make NETCDFPATH=CONFIGURE_NETCDF_PATH RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(FC) $(PROMOTION) $(FCFLAGS) -w" TRADFLAG="-traditional" )
++
++wrfio_grib_share :
++	( cd ../external/io_grib_share ; \
++          make CC="$(SCC)" CFLAGS="$(CFLAGS)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
++
++wrfio_grib1 :
++	( cd ../external/io_grib1 ; \
++          make CC="$(SCC)" CFLAGS="$(CFLAGS)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
++
++wrfio_grib2 :
++	( cd ../external/io_grib2 ; \
++          make CC="$(SCC)" CFLAGS="$(CFLAGS) CONFIGURE_GRIB2_INC" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" FIXED="-Mfixed" archive)
++
++wrfio_int : 
++	( cd ../external/io_int ; \
++          make CC="$(CC)" RANLIB="$(RANLIB)" CPP="$(CPP)" SFC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" FC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" all )
++
++esmf_time : 
++	( cd ../external/esmf_time_f90 ; \
++	  make FC="$(FC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" RANLIB="$(RANLIB)" CPP="$(CPP) -I../../inc -I. $(POUND_DEF)" )
++
++../external/RSL_LITE/librsl_lite.a :
++	( cd ../external/RSL_LITE ; make CC="$(CC)" FC="$(FC) $(FCFLAGS) $(PROMOTION) -byteswapio" MAX_DOMAINS=$(MAX_DOMAINS) MAX_PROC=$(MAX_PROC) LEARN_BCAST=-DLEARN_BCAST )
++
++# compile these without high optimization to speed compile
++solve_interface.o : solve_interface.F
++shift_domain_em.o : shift_domain_em.F
++module_io_mm5.o : module_io_mm5.F
++module_si_io.o : module_si_io.F
++module_io_wrf.o : module_io_wrf.F
++module_domain.o : module_domain.F
++module_start.o : module_start.F
++module_initialize.o : module_initialize.F
++module_initialize_b_wave.o : module_initialize_b_wave.F
++module_initialize_hill2d_x.o : module_initialize_hill2d_x.F
++module_initialize_quarter_ss.o : module_initialize_quarter_ss.F
++module_initialize_squall2d_x.o : module_initialize_squall2d_x.F
++module_initialize_squall2d_y.o : module_initialize_squall2d_y.F
++module_initialize_real.o : module_initialize_real.F
++module_dm.o : module_dm.F
++start_domain.o : start_domain.F
++mediation_integrate.o : mediation_integrate.F
++module_configure.o : module_configure.F
++
++solve_interface.o                                              \
++shift_domain_em.o                                              \
++module_io_mm5.o module_si_io.o module_io_wrf.o module_domain.o \
++module_start.o module_initialize.o module_initialize_b_wave.o  \
++module_initialize_hill2d_x.o module_initialize_quarter_ss.o    \
++module_initialize_squall2d_x.o module_initialize_squall2d_y.o  \
++module_configure.o                                             \
++mediation_integrate.o \
++module_initialize_real.o module_dm.o start_domain.o :
++	$(RM) $@
++	$(SED_FTN) $*.F > $*.b 
++	$(CPP) -I../inc $(CPPFLAGS) $*.b  > $*.f90
++	$(RM) $*.b
++	$(FC) -c $(PROMOTION) $(FCBASEOPTS) $(MODULE_DIRS) $*.f90
++
+ ##################################################################
+ #ARCH  NULL
Index: trunk/MESOSCALE_DEV/WORK/co2clouds_module_initialize_quarter_ss.F
===================================================================
--- trunk/MESOSCALE_DEV/WORK/co2clouds_module_initialize_quarter_ss.F	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/co2clouds_module_initialize_quarter_ss.F	(revision 207)
@@ -0,0 +1,965 @@
+!IDEAL:MODEL_LAYER:INITIALIZATION
+!
+
+!  This MODULE holds the routines which are used to perform various initializations
+!  for the individual domains.  
+
+!  This MODULE CONTAINS the following routines:
+
+!  initialize_field_test - 1. Set different fields to different constant
+!                             values.  This is only a test.  If the correct
+!                             domain is not found (based upon the "id")
+!                             then a fatal error is issued.               
+
+!-----------------------------------------------------------------------
+
+MODULE module_initialize
+
+   USE module_domain
+   USE module_io_domain
+   USE module_state_description
+   USE module_model_constants
+   USE module_bc
+   USE module_timing
+   USE module_configure
+   USE module_init_utilities
+#ifdef DM_PARALLEL
+   USE module_dm
+#endif
+
+
+CONTAINS
+
+
+!-------------------------------------------------------------------
+! this is a wrapper for the solver-specific init_domain routines.
+! Also dereferences the grid variables and passes them down as arguments.
+! This is crucial, since the lower level routines may do message passing
+! and this will get fouled up on machines that insist on passing down
+! copies of assumed-shape arrays (by passing down as arguments, the 
+! data are treated as assumed-size -- ie. f77 -- arrays and the copying
+! business is avoided).  Fie on the F90 designers.  Fie and a pox.
+
+   SUBROUTINE init_domain ( grid )
+
+   IMPLICIT NONE
+
+   !  Input data.
+   TYPE (domain), POINTER :: grid 
+   !  Local data.
+   INTEGER                :: dyn_opt 
+   INTEGER :: idum1, idum2
+
+   CALL nl_get_dyn_opt( 1, dyn_opt )
+   
+   CALL set_scalar_indices_from_config ( head_grid%id , idum1, idum2 )
+
+   IF (      dyn_opt .eq. 1 &
+        .or. dyn_opt .eq. 2 &
+        .or. dyn_opt .eq. 3 &
+                                       ) THEN
+     CALL init_domain_rk( grid &
+!
+#include <em_actual_new_args.inc>
+!
+                        )
+
+   ELSE
+     WRITE(0,*)' init_domain: unknown or unimplemented dyn_opt = ',dyn_opt
+     CALL wrf_error_fatal ( ' init_domain: unknown or unimplemented dyn_opt ' )
+   ENDIF
+
+   END SUBROUTINE init_domain
+
+!-------------------------------------------------------------------
+
+   SUBROUTINE init_domain_rk ( grid &
+!
+# include <em_dummy_new_args.inc>
+!
+)
+   IMPLICIT NONE
+
+   !  Input data.
+   TYPE (domain), POINTER :: grid
+
+# include <em_dummy_new_decl.inc>
+
+   TYPE (grid_config_rec_type)              :: config_flags
+
+   !  Local data
+   INTEGER                             ::                       &
+                                  ids, ide, jds, jde, kds, kde, &
+                                  ims, ime, jms, jme, kms, kme, &
+                                  its, ite, jts, jte, kts, kte, &
+                                  i, j, k
+
+   ! Local data
+
+   INTEGER, PARAMETER :: nl_max = 1000
+   REAL, DIMENSION(nl_max) :: zk, p_in, theta, rho, u, v, qv, pd_in
+   INTEGER :: nl_in
+
+
+   INTEGER :: icm,jcm, ii, im1, jj, jm1, loop, error, fid, nxc, nyc
+   REAL    :: u_mean,v_mean, f0, p_surf, p_level, qvf, z_at_v, z_at_u
+   REAL    :: z_scale, xrad, yrad, zrad, rad, delt, cof1, cof2
+!   REAL, EXTERNAL :: interp_0
+   REAL    :: hm
+   REAL    :: pi
+
+!  stuff from original initialization that has been dropped from the Registry 
+   REAL    :: vnu, xnu, xnus, dinit0, cbh, p0_temp, t0_temp, zd, zt
+   REAL    :: qvf1, qvf2, pd_surf
+   INTEGER :: it
+   real :: thtmp, ptmp, temp(3)
+
+   LOGICAL :: moisture_init
+   LOGICAL :: stretch_grid, dry_sounding
+
+  INTEGER :: xs , xe , ys , ye
+  REAL :: mtn_ht
+   LOGICAL, EXTERNAL :: wrf_dm_on_monitor
+
+!!MARS
+ REAL :: lon_input, lat_input, alt_input, tsurf_input
+!!MARS
+
+
+#ifdef DM_PARALLEL
+#    include <em_data_calls.inc>
+#endif
+
+
+   SELECT CASE ( model_data_order )
+         CASE ( DATA_ORDER_ZXY )
+   kds = grid%sd31 ; kde = grid%ed31 ;
+   ids = grid%sd32 ; ide = grid%ed32 ;
+   jds = grid%sd33 ; jde = grid%ed33 ;
+
+   kms = grid%sm31 ; kme = grid%em31 ;
+   ims = grid%sm32 ; ime = grid%em32 ;
+   jms = grid%sm33 ; jme = grid%em33 ;
+
+   kts = grid%sp31 ; kte = grid%ep31 ;   ! note that tile is entire patch
+   its = grid%sp32 ; ite = grid%ep32 ;   ! note that tile is entire patch
+   jts = grid%sp33 ; jte = grid%ep33 ;   ! note that tile is entire patch
+         CASE ( DATA_ORDER_XYZ )
+   ids = grid%sd31 ; ide = grid%ed31 ;
+   jds = grid%sd32 ; jde = grid%ed32 ;
+   kds = grid%sd33 ; kde = grid%ed33 ;
+
+   ims = grid%sm31 ; ime = grid%em31 ;
+   jms = grid%sm32 ; jme = grid%em32 ;
+   kms = grid%sm33 ; kme = grid%em33 ;
+
+   its = grid%sp31 ; ite = grid%ep31 ;   ! note that tile is entire patch
+   jts = grid%sp32 ; jte = grid%ep32 ;   ! note that tile is entire patch
+   kts = grid%sp33 ; kte = grid%ep33 ;   ! note that tile is entire patch
+         CASE ( DATA_ORDER_XZY )
+   ids = grid%sd31 ; ide = grid%ed31 ;
+   kds = grid%sd32 ; kde = grid%ed32 ;
+   jds = grid%sd33 ; jde = grid%ed33 ;
+
+   ims = grid%sm31 ; ime = grid%em31 ;
+   kms = grid%sm32 ; kme = grid%em32 ;
+   jms = grid%sm33 ; jme = grid%em33 ;
+
+   its = grid%sp31 ; ite = grid%ep31 ;   ! note that tile is entire patch
+   kts = grid%sp32 ; kte = grid%ep32 ;   ! note that tile is entire patch
+   jts = grid%sp33 ; jte = grid%ep33 ;   ! note that tile is entire patch
+
+   END SELECT
+
+
+   stretch_grid = .true.
+!   stretch_grid = .false.
+
+   delt = 3.
+   delt = 10.
+!   z_scale = .50
+   z_scale = .40
+
+!!!MARS
+!!!MARS
+!  open(unit=16,file='input_vert',form='formatted',status='old')
+!  rewind(16) 
+!  read(16,*) delt, z_scale
+!  write(6,*) 'delt, z_scale are  ', delt, z_scale
+!  close(16)
+!!!MARS
+!!!MARS
+
+   pi = 2.*asin(1.0)
+   write(6,*) ' pi is ',pi
+   nxc = (ide-ids)/2
+   nyc = (jde-jds)/2
+
+   CALL model_to_grid_config_rec ( grid%id , model_config_rec , config_flags )
+
+! here we check to see if the boundary conditions are set properly
+
+   CALL boundary_condition_check( config_flags, bdyzone, error, grid%id )
+
+   moisture_init = .true.
+
+    grid%itimestep=0
+
+#ifdef DM_PARALLEL
+   CALL wrf_dm_bcast_bytes( icm , IWORDSIZE )
+   CALL wrf_dm_bcast_bytes( jcm , IWORDSIZE )
+#endif
+
+    CALL nl_set_mminlu(1, '    ')
+    CALL nl_set_iswater(1,0)
+    CALL nl_set_cen_lat(1,40.)
+    CALL nl_set_cen_lon(1,-105.)
+    CALL nl_set_truelat1(1,0.)
+    CALL nl_set_truelat2(1,0.)
+    CALL nl_set_moad_cen_lat (1,0.)
+    CALL nl_set_stand_lon (1,0.)
+    CALL nl_set_map_proj(1,0)
+
+
+!  here we initialize data we currently is not initialized 
+!  in the input data
+
+    DO j = jts, jte
+      DO i = its, ite
+         grid%msft(i,j)     = 1.
+         grid%msfu(i,j)     = 1.
+         grid%msfv(i,j)     = 1.
+         grid%sina(i,j)     = 0.
+         grid%cosa(i,j)     = 1.
+         grid%e(i,j)        = 0.
+         grid%f(i,j)        = 0.         !! MARS: put coriolis here if needed
+
+      END DO
+   END DO
+
+    DO j = jts, jte
+    DO k = kts, kte
+      DO i = its, ite
+         grid%em_ww(i,k,j)     = 0.
+      END DO
+   END DO
+   END DO
+
+   grid%step_number = 0
+
+! set up the grid
+
+   IF (stretch_grid) THEN ! exponential stretch for eta (nearly constant dz)
+     DO k=1, kde
+      grid%em_znw(k) = (exp(-(k-1)/float(kde-1)/z_scale) - exp(-1./z_scale))/ &
+                                (1.-exp(-1./z_scale))
+     ENDDO
+   ELSE
+     DO k=1, kde
+      grid%em_znw(k) = 1. - float(k-1)/float(kde-1)
+     ENDDO
+   ENDIF
+
+!!MARS
+!!MARS
+  open(unit=12,file='levels',form='formatted',status='old')
+  rewind(12)
+  DO k=1, kde
+  read(12,*) grid%em_znw(k)
+  write(6,*) 'read level ', k,grid%em_znw(k)
+  ENDDO
+  close(12)
+!!MARS
+!!MARS
+  
+
+!   print *, 'coucou'
+!   stop
+
+   DO k=1, kde-1
+    grid%em_dnw(k) = grid%em_znw(k+1) - grid%em_znw(k)
+    grid%em_rdnw(k) = 1./grid%em_dnw(k)
+    grid%em_znu(k) = 0.5*(grid%em_znw(k+1)+grid%em_znw(k))
+   ENDDO
+   DO k=2, kde-1
+    grid%em_dn(k) = 0.5*(grid%em_dnw(k)+grid%em_dnw(k-1))
+    grid%em_rdn(k) = 1./grid%em_dn(k)
+    grid%em_fnp(k) = .5* grid%em_dnw(k  )/grid%em_dn(k)
+    grid%em_fnm(k) = .5* grid%em_dnw(k-1)/grid%em_dn(k)
+   ENDDO
+
+   cof1 = (2.*grid%em_dn(2)+grid%em_dn(3))/(grid%em_dn(2)+grid%em_dn(3))*grid%em_dnw(1)/grid%em_dn(2) 
+   cof2 =     grid%em_dn(2)        /(grid%em_dn(2)+grid%em_dn(3))*grid%em_dnw(1)/grid%em_dn(3) 
+   grid%cf1  = grid%em_fnp(2) + cof1
+   grid%cf2  = grid%em_fnm(2) - cof1 - cof2
+   grid%cf3  = cof2       
+
+   grid%cfn  = (.5*grid%em_dnw(kde-1)+grid%em_dn(kde-1))/grid%em_dn(kde-1)
+   grid%cfn1 = -.5*grid%em_dnw(kde-1)/grid%em_dn(kde-1)
+   grid%rdx = 1./config_flags%dx
+   grid%rdy = 1./config_flags%dy
+
+!  get the sounding from the ascii sounding file, first get dry sounding and 
+!  calculate base state
+
+  dry_sounding = .true.
+  IF ( wrf_dm_on_monitor() ) THEN
+  write(6,*) ' getting dry sounding for base state '
+
+  CALL get_sounding( zk, p_in, pd_in, theta, rho, u, v, qv, dry_sounding, nl_max, nl_in )
+  ENDIF
+  CALL wrf_dm_bcast_real( zk , nl_max )
+  CALL wrf_dm_bcast_real( p_in , nl_max )
+  CALL wrf_dm_bcast_real( pd_in , nl_max )
+  CALL wrf_dm_bcast_real( theta , nl_max )
+  CALL wrf_dm_bcast_real( rho , nl_max )
+  CALL wrf_dm_bcast_real( u , nl_max )
+  CALL wrf_dm_bcast_real( v , nl_max )
+  CALL wrf_dm_bcast_real( qv , nl_max )
+  CALL wrf_dm_bcast_integer ( nl_in , 1 ) 
+
+  write(6,*) ' returned from reading sounding, nl_in is ',nl_in
+
+!  find ptop for the desired ztop (ztop is input from the namelist),
+!  and find surface pressure
+
+  grid%p_top = interp_0( p_in, zk, config_flags%ztop, nl_in )
+
+!!MARS
+!!MARS
+  open(unit=14,file='input_coord',form='formatted',status='old')
+  rewind(14)
+  read(14,*) lon_input
+  read(14,*) lat_input
+  close(14)
+  write(6,*) ' lon is ',lon_input
+  write(6,*) ' lat is ',lat_input
+!!MARS
+!!MARS
+
+!!MARS
+!!MARS
+  open(unit=18,file='input_more',form='formatted',status='old')
+  rewind(18)
+  read(18,*) alt_input, tsurf_input
+  close(18)
+  write(6,*) ' alt is ',alt_input
+  write(6,*) ' tsurf is ',tsurf_input
+!!MARS
+!!MARS
+
+  DO j=jts,jte
+  DO i=its,ite
+!!MARS
+    grid%ht(i,j) = alt_input
+    grid%tsk(i,j) = tsurf_input
+!!MARS
+    grid%xlat(i,j) = lat_input
+    grid%xlong(i,j) = lon_input
+    grid%mars_emiss(i,j)=0.95
+    grid%mars_cice(i,j)=0.
+    grid%slpx(i,j) = 0.
+    grid%slpy(i,j) = 0.
+!!MARS
+  ENDDO
+  ENDDO
+
+!   print *, 'coucou'
+!   stop
+
+
+  xs=ide/2 -3
+  xs=ids   -3
+  xe=xs + 6
+  ys=jde/2 -3
+  ye=ys + 6
+  mtn_ht = 500
+#ifdef MTN
+  DO j=max(ys,jds),min(ye,jde-1)
+  DO i=max(xs,ids),min(xe,ide-1)
+     grid%ht(i,j) = mtn_ht * 0.25 * &
+               ( 1. + COS ( 2*pi/(xe-xs) * ( i-xs ) + pi ) ) * &
+               ( 1. + COS ( 2*pi/(ye-ys) * ( j-ys ) + pi ) )
+  ENDDO
+  ENDDO
+#endif
+#ifdef EW_RIDGE
+  DO j=max(ys,jds),min(ye,jde-1)
+  DO i=ids,ide
+     grid%ht(i,j) = mtn_ht * 0.50 * &
+               ( 1. + COS ( 2*pi/(ye-ys) * ( j-ys ) + pi ) )
+  ENDDO
+  ENDDO
+#endif
+#ifdef NS_RIDGE
+  DO j=jds,jde
+  DO i=max(xs,ids),min(xe,ide-1)
+     grid%ht(i,j) = mtn_ht * 0.50 * &
+               ( 1. + COS ( 2*pi/(xe-xs) * ( i-xs ) + pi ) )
+  ENDDO
+  ENDDO
+#endif
+  DO j=jts,jte
+  DO i=its,ite
+    grid%em_phb(i,1,j) = g * grid%ht(i,j)
+    grid%em_ph0(i,1,j) = g * grid%ht(i,j)
+  ENDDO
+  ENDDO
+
+  DO J = jts, jte
+  DO I = its, ite
+
+    p_surf = interp_0( p_in, zk, grid%em_phb(i,1,j)/g, nl_in )
+    grid%em_mub(i,j) = p_surf-grid%p_top
+
+!  this is dry hydrostatic sounding (base state), so given grid%em_p (coordinate),
+!  interp theta (from interp) and compute 1/rho from eqn. of state
+
+    DO K = 1, kte-1
+      p_level = grid%em_znu(k)*(p_surf - grid%p_top) + grid%p_top
+      grid%em_pb(i,k,j) = p_level
+      grid%em_t_init(i,k,j) = interp_0( theta, p_in, p_level, nl_in ) - t0
+      grid%em_alb(i,k,j) = (r_d/p1000mb)*(grid%em_t_init(i,k,j)+t0)*(grid%em_pb(i,k,j)/p1000mb)**cvpm
+    ENDDO
+
+!  calc hydrostatic balance (alternatively we could interp the geopotential from the
+!  sounding, but this assures that the base state is in exact hydrostatic balance with
+!  respect to the model eqns.
+
+    DO k  = 2,kte
+      grid%em_phb(i,k,j) = grid%em_phb(i,k-1,j) - grid%em_dnw(k-1)*grid%em_mub(i,j)*grid%em_alb(i,k-1,j)
+    ENDDO
+
+  ENDDO
+  ENDDO
+
+  IF ( wrf_dm_on_monitor() ) THEN
+    write(6,*) ' ptop is ',grid%p_top
+    write(6,*) ' base state grid%em_mub(1,1), p_surf is ',grid%em_mub(1,1),grid%em_mub(1,1)+grid%p_top
+  ENDIF
+
+!  calculate full state for each column - this includes moisture.
+
+  write(6,*) ' getting moist sounding for full state '
+  dry_sounding = .false.
+  CALL get_sounding( zk, p_in, pd_in, theta, rho, u, v, qv, dry_sounding, nl_max, nl_in )
+
+  DO J = jts, min(jde-1,jte)
+  DO I = its, min(ide-1,ite)
+
+!  At this point grid%p_top is already set. find the DRY mass in the column 
+!  by interpolating the DRY pressure.  
+
+   pd_surf = interp_0( pd_in, zk, grid%em_phb(i,1,j)/g, nl_in )
+
+!  compute the perturbation mass and the full mass
+
+    grid%em_mu_1(i,j) = pd_surf-grid%p_top - grid%em_mub(i,j)
+    grid%em_mu_2(i,j) = grid%em_mu_1(i,j)
+    grid%em_mu0(i,j) = grid%em_mu_1(i,j) + grid%em_mub(i,j)
+
+! given the dry pressure and coordinate system, interp the potential
+! temperature and qv
+
+    do k=1,kde-1
+
+      p_level = grid%em_znu(k)*(pd_surf - grid%p_top) + grid%p_top
+
+      moist(i,k,j,P_QV) = interp_0( qv, pd_in, p_level, nl_in )
+      grid%em_t_1(i,k,j)          = interp_0( theta, pd_in, p_level, nl_in ) - t0
+      grid%em_t_2(i,k,j)          = grid%em_t_1(i,k,j)
+      
+
+    enddo
+
+!  integrate the hydrostatic equation (from the RHS of the bigstep
+!  vertical momentum equation) down from the top to get grid%em_p.
+!  first from the top of the model to the top pressure
+
+    k = kte-1  ! top level
+
+    qvf1 = 0.5*(moist(i,k,j,P_QV)+moist(i,k,j,P_QV))
+    qvf2 = 1./(1.+qvf1)
+    qvf1 = qvf1*qvf2
+
+!    grid%em_p(i,k,j) = - 0.5*grid%em_mu_1(i,j)/grid%em_rdnw(k)
+    grid%em_p(i,k,j) = - 0.5*(grid%em_mu_1(i,j)+qvf1*grid%em_mub(i,j))/grid%em_rdnw(k)/qvf2
+    qvf = 1. + rvovrd*moist(i,k,j,P_QV)
+    grid%em_alt(i,k,j) = (r_d/p1000mb)*(grid%em_t_1(i,k,j)+t0)*qvf* &
+                (((grid%em_p(i,k,j)+grid%em_pb(i,k,j))/p1000mb)**cvpm)
+    grid%em_al(i,k,j) = grid%em_alt(i,k,j) - grid%em_alb(i,k,j)
+
+!  down the column
+
+    do k=kte-2,1,-1
+      qvf1 = 0.5*(moist(i,k,j,P_QV)+moist(i,k+1,j,P_QV))
+      qvf2 = 1./(1.+qvf1)
+      qvf1 = qvf1*qvf2
+      grid%em_p(i,k,j) = grid%em_p(i,k+1,j) - (grid%em_mu_1(i,j) + qvf1*grid%em_mub(i,j))/qvf2/grid%em_rdn(k+1)
+      qvf = 1. + rvovrd*moist(i,k,j,P_QV)
+      grid%em_alt(i,k,j) = (r_d/p1000mb)*(grid%em_t_1(i,k,j)+t0)*qvf* &
+                  (((grid%em_p(i,k,j)+grid%em_pb(i,k,j))/p1000mb)**cvpm)
+      grid%em_al(i,k,j) = grid%em_alt(i,k,j) - grid%em_alb(i,k,j)
+    enddo
+
+!  this is the hydrostatic equation used in the model after the
+!  small timesteps.  In the model, grid%em_al (inverse density)
+!  is computed from the geopotential.
+
+
+    grid%em_ph_1(i,1,j) = 0.
+    DO k  = 2,kte
+      grid%em_ph_1(i,k,j) = grid%em_ph_1(i,k-1,j) - (1./grid%em_rdnw(k-1))*(       &
+                   (grid%em_mub(i,j)+grid%em_mu_1(i,j))*grid%em_al(i,k-1,j)+ &
+                    grid%em_mu_1(i,j)*grid%em_alb(i,k-1,j)  )
+                                                   
+      grid%em_ph_2(i,k,j) = grid%em_ph_1(i,k,j) 
+      grid%em_ph0(i,k,j) = grid%em_ph_1(i,k,j) + grid%em_phb(i,k,j)
+    ENDDO
+
+    IF ( wrf_dm_on_monitor() ) THEN
+    if((i==2) .and. (j==2)) then
+     write(6,*) ' grid%em_ph_1 calc ',grid%em_ph_1(2,1,2),grid%em_ph_1(2,2,2),&
+                              grid%em_mu_1(2,2)+grid%em_mub(2,2),grid%em_mu_1(2,2), &
+                              grid%em_alb(2,1,2),grid%em_al(1,2,1),grid%em_rdnw(1)
+    endif
+    ENDIF
+
+  ENDDO
+  ENDDO
+
+!#if 0
+
+!  thermal perturbation to kick off convection
+
+  write(6,*) ' nxc, nyc for perturbation ',nxc,nyc
+  write(6,*) ' delt for perturbation ',delt
+
+  DO J = jts, min(jde-1,jte)
+!    yrad = config_flags%dy*float(j-nyc)/10000.
+!! NO FUCKIN' BUBBLE !!
+yrad = 0.
+    DO I = its, min(ide-1,ite)
+!      xrad = config_flags%dx*float(i-nxc)/10000.
+!! NO FUCKIN' BUBBLE !!
+xrad = 0.
+      DO K = 1, kte-1
+
+!  put in preturbation theta (bubble) and recalc density.  note,
+!  the mass in the column is not changing, so when theta changes,
+!  we recompute density and geopotential
+
+!        zrad = 0.5*(grid%em_ph_1(i,k,j)+grid%em_ph_1(i,k+1,j)  &
+!                   +grid%em_phb(i,k,j)+grid%em_phb(i,k+1,j))/g
+!        zrad = (zrad-1500.)/1500.
+!! NO FUCKIN' BUBBLE !!
+zrad = 0.        
+        RAD=SQRT(xrad*xrad+yrad*yrad+zrad*zrad)
+        IF(RAD <= 1.) THEN
+!! NO FUCKIN' BUBBLE !!
+!           grid%em_t_1(i,k,j)=grid%em_t_1(i,k,j)+delt*COS(.5*PI*RAD)**2
+           grid%em_t_2(i,k,j)=grid%em_t_1(i,k,j)
+           qvf = 1. + rvovrd*moist(i,k,j,P_QV)
+           grid%em_alt(i,k,j) = (r_d/p1000mb)*(grid%em_t_1(i,k,j)+t0)*qvf* &
+                        (((grid%em_p(i,k,j)+grid%em_pb(i,k,j))/p1000mb)**cvpm)
+           grid%em_al(i,k,j) = grid%em_alt(i,k,j) - grid%em_alb(i,k,j)
+        ENDIF
+      ENDDO
+
+!  rebalance hydrostatically
+
+      DO k  = 2,kte
+        grid%em_ph_1(i,k,j) = grid%em_ph_1(i,k-1,j) - (1./grid%em_rdnw(k-1))*(       &
+                     (grid%em_mub(i,j)+grid%em_mu_1(i,j))*grid%em_al(i,k-1,j)+ &
+                      grid%em_mu_1(i,j)*grid%em_alb(i,k-1,j)  )
+                                                   
+        grid%em_ph_2(i,k,j) = grid%em_ph_1(i,k,j) 
+        grid%em_ph0(i,k,j) = grid%em_ph_1(i,k,j) + grid%em_phb(i,k,j)
+      ENDDO
+
+    ENDDO
+  ENDDO
+
+!#endif
+
+   IF ( wrf_dm_on_monitor() ) THEN
+   write(6,*) ' grid%em_mu_1 from comp ', grid%em_mu_1(1,1)
+   write(6,*) ' full state sounding from comp, ph, grid%em_p, grid%em_al, grid%em_t_1, qv '
+   do k=1,kde-1
+     write(6,'(i3,1x,5(1x,1pe10.3))') k, grid%em_ph_1(1,k,1)+grid%em_phb(1,k,1), &
+                                      grid%em_p(1,k,1)+grid%em_pb(1,k,1), grid%em_alt(1,k,1), &
+                                      grid%em_t_1(1,k,1)+t0, moist(1,k,1,P_QV)
+   enddo
+
+   write(6,*) ' pert state sounding from comp, grid%em_ph_1, pp, alp, grid%em_t_1, qv '
+   do k=1,kde-1
+     write(6,'(i3,1x,5(1x,1pe10.3))') k, grid%em_ph_1(1,k,1), &
+                                      grid%em_p(1,k,1), grid%em_al(1,k,1), &
+                                      grid%em_t_1(1,k,1), moist(1,k,1,P_QV)
+   enddo
+   ENDIF
+
+! interp v
+
+  DO J = jts, jte
+  DO I = its, min(ide-1,ite)
+
+    IF (j == jds) THEN
+      z_at_v = grid%em_phb(i,1,j)/g
+    ELSE IF (j == jde) THEN
+      z_at_v = grid%em_phb(i,1,j-1)/g
+    ELSE
+      z_at_v = 0.5*(grid%em_phb(i,1,j)+grid%em_phb(i,1,j-1))/g
+    END IF
+    p_surf = interp_0( p_in, zk, z_at_v, nl_in )
+
+    DO K = 1, kte-1
+      p_level = grid%em_znu(k)*(p_surf - grid%p_top) + grid%p_top
+      grid%em_v_1(i,k,j) = interp_0( v, p_in, p_level, nl_in )
+      grid%em_v_2(i,k,j) = grid%em_v_1(i,k,j)
+    ENDDO
+
+  ENDDO
+  ENDDO
+
+! interp u
+
+  DO J = jts, min(jde-1,jte)
+  DO I = its, ite
+
+    IF (i == ids) THEN
+      z_at_u = grid%em_phb(i,1,j)/g
+    ELSE IF (i == ide) THEN
+      z_at_u = grid%em_phb(i-1,1,j)/g
+    ELSE
+      z_at_u = 0.5*(grid%em_phb(i,1,j)+grid%em_phb(i-1,1,j))/g
+    END IF
+
+    p_surf = interp_0( p_in, zk, z_at_u, nl_in )
+
+    DO K = 1, kte-1
+      p_level = grid%em_znu(k)*(p_surf - grid%p_top) + grid%p_top
+      grid%em_u_1(i,k,j) = interp_0( u, p_in, p_level, nl_in )
+      grid%em_u_2(i,k,j) = grid%em_u_1(i,k,j)
+    ENDDO
+
+  ENDDO
+  ENDDO
+
+!  set w
+
+  DO J = jts, min(jde-1,jte)
+  DO K = kts, kte
+  DO I = its, min(ide-1,ite)
+    grid%em_w_1(i,k,j) = 0.
+    grid%em_w_2(i,k,j) = 0.
+  ENDDO
+  ENDDO
+  ENDDO
+
+!  set a few more things
+
+  DO J = jts, min(jde-1,jte)
+  DO K = kts, kte-1
+  DO I = its, min(ide-1,ite)
+    grid%h_diabatic(i,k,j) = 0.
+  ENDDO
+  ENDDO
+  ENDDO
+
+  IF ( wrf_dm_on_monitor() ) THEN
+  DO k=1,kte-1
+    grid%em_t_base(k) = grid%em_t_1(1,k,1)
+    grid%qv_base(k) = moist(1,k,1,P_QV)
+    grid%u_base(k) = grid%em_u_1(1,k,1)
+    grid%v_base(k) = grid%em_v_1(1,k,1)
+    grid%z_base(k) = 0.5*(grid%em_phb(1,k,1)+grid%em_phb(1,k+1,1)+grid%em_ph_1(1,k,1)+grid%em_ph_1(1,k+1,1))/g
+  ENDDO
+  ENDIF
+  CALL wrf_dm_bcast_real( grid%em_t_base , kte )
+  CALL wrf_dm_bcast_real( grid%qv_base , kte )
+  CALL wrf_dm_bcast_real( grid%u_base , kte )
+  CALL wrf_dm_bcast_real( grid%v_base , kte )
+  CALL wrf_dm_bcast_real( grid%z_base , kte )
+
+  DO J = jts, min(jde-1,jte)
+  DO I = its, min(ide-1,ite)
+     thtmp   = grid%em_t_2(i,1,j)+t0
+     ptmp    = grid%em_p(i,1,j)+grid%em_pb(i,1,j)
+     temp(1) = thtmp * (ptmp/p1000mb)**rcp
+     thtmp   = grid%em_t_2(i,2,j)+t0
+     ptmp    = grid%em_p(i,2,j)+grid%em_pb(i,2,j)
+     temp(2) = thtmp * (ptmp/p1000mb)**rcp
+     thtmp   = grid%em_t_2(i,3,j)+t0
+     ptmp    = grid%em_p(i,3,j)+grid%em_pb(i,3,j)
+     temp(3) = thtmp * (ptmp/p1000mb)**rcp
+
+!!MARS
+!     grid%tsk(I,J)=grid%cf1*temp(1)+grid%cf2*temp(2)+grid%cf3*temp(3)
+     grid%tmn(I,J)=grid%tsk(I,J)-0.5
+!!!MARS
+!!TODO: passer la valeur a partir des donnees
+!grid%mars_tsoil(I,:,J)=grid%tsk(I,J)
+!!!MARS
+  ENDDO
+  ENDDO
+
+ END SUBROUTINE init_domain_rk
+
+   SUBROUTINE init_module_initialize
+   END SUBROUTINE init_module_initialize
+
+!---------------------------------------------------------------------
+
+!  test driver for get_sounding
+!
+!      implicit none
+!      integer n
+!      parameter(n = 1000)
+!      real zk(n),p(n),theta(n),rho(n),u(n),v(n),qv(n),pd(n)
+!      logical dry
+!      integer nl,k
+!
+!      dry = .false.
+!      dry = .true.
+!      call get_sounding( zk, p, pd, theta, rho, u, v, qv, dry, n, nl )
+!      write(6,*) ' input levels ',nl
+!      write(6,*) ' sounding '
+!      write(6,*) '  k  height(m)  press (Pa) pd(Pa) theta (K) den(kg/m^3)  u(m/s)     v(m/s)    qv(g/g) '
+!      do k=1,nl
+!        write(6,'(1x,i3,8(1x,1pe10.3))') k, zk(k), p(k), pd(k), theta(k), rho(k), u(k), v(k), qv(k)
+!      enddo
+!      end
+!
+!---------------------------------------------------------------------------
+
+      subroutine get_sounding( zk, p, p_dry, theta, rho, &
+                               u, v, qv, dry, nl_max, nl_in )
+      implicit none
+
+      integer nl_max, nl_in
+      real zk(nl_max), p(nl_max), theta(nl_max), rho(nl_max), &
+           u(nl_max), v(nl_max), qv(nl_max), p_dry(nl_max)
+      logical dry
+
+      integer n
+      parameter(n=1000)
+      logical debug
+      parameter( debug = .true.)
+
+! input sounding data
+
+      real p_surf, th_surf, qv_surf
+      real pi_surf, pi(n)
+      real h_input(n), th_input(n), qv_input(n), u_input(n), v_input(n)
+
+      !! special MARS
+      real r_input(n)
+      real cp_input(n)
+      real cv_input(n)
+      real cvpm_input(n)
+      real pfile_input(n)
+      real t_input(n)
+      real rhofile_input(n)
+      !! special MARS
+
+! diagnostics
+
+      real rho_surf, p_input(n), rho_input(n)
+      real pm_input(n)  !  this are for full moist sounding
+
+! local data
+
+      real p1000mb,cv,cp,r,cvpm,g
+!      parameter (p1000mb = 1.e+05, r = 287, cp = 1003., cv = cp-r, cvpm = -cv/cp, g=9.81 )
+      parameter (p1000mb = 610., r = 192., cp = 844.6, cv = cp-r, cvpm = -cv/cp, g=3.72)
+      integer k, it, nl
+      real qvf, qvf1, dz
+
+!  first, read the sounding
+
+      call read_sounding( p_surf, th_surf, qv_surf, &
+                          h_input, th_input, qv_input, u_input, v_input, r_input, cp_input, pfile_input, t_input, rhofile_input, n, nl, debug )
+
+
+      !! special MARS
+      do k=1,nl
+        cv_input(k) = cp_input(k) - r_input(k)
+        cvpm_input(k) = - cv_input(k) / cp_input(k)
+      enddo
+      !! special MARS
+
+      if(dry) then
+       do k=1,nl
+         qv_input(k) = 0.
+       enddo
+      endif
+
+      if(debug) write(6,*) ' number of input levels = ',nl
+
+        nl_in = nl
+        if(nl_in .gt. nl_max ) then
+          write(6,*) ' too many levels for input arrays ',nl_in,nl_max
+          call wrf_error_fatal ( ' too many levels for input arrays ' )
+        end if
+
+!  compute diagnostics,
+!  first, convert qv(g/kg) to qv(g/g)
+
+      do k=1,nl
+        qv_input(k) = 0.001*qv_input(k)
+      enddo
+
+      p_surf = 100.*p_surf  ! convert to pascals
+      qvf = 1. + rvovrd*qv_input(1) 
+!      rho_surf = 1./((r/p1000mb)*th_surf*qvf*((p_surf/p1000mb)**cvpm))
+!      pi_surf = (p_surf/p1000mb)**(r/cp)
+      rho_surf =  1./((r_input(1)/p1000mb)*th_surf*qvf*((p_surf/p1000mb)**cvpm_input(1)))
+      pi_surf = (p_surf/p1000mb)**(r_input(1)/cp_input(1))
+
+
+      if(debug) then
+        write(6,*) ' surface density is ',rho_surf
+        write(6,*) ' surface pi is      ',pi_surf
+      end if
+
+
+!  integrate moist sounding hydrostatically, starting from the
+!  specified surface pressure
+!  -> first, integrate from surface to lowest level
+
+          qvf = 1. + rvovrd*qv_input(1) 
+          qvf1 = 1. + qv_input(1)
+          rho_input(1) = rho_surf
+          dz = h_input(1)
+          do it=1,10
+!!MARS MARS
+            pm_input(1) = p_surf !&
+!                    - 0.5*dz*(rho_surf+rho_input(1))*g*qvf1
+!            rho_input(1) = 1./((r/p1000mb)*th_input(1)*qvf*((pm_input(1)/p1000mb)**cvpm))
+!! special MARS
+             rho_input(1) = 1./((r_input(1)/p1000mb)*th_input(1)*qvf*((pm_input(1)/p1000mb)**cvpm_input(1)))
+          enddo
+
+! integrate up the column
+
+          do k=2,nl
+            rho_input(k) = rho_input(k-1)
+!            dz = h_input(k)-h_input(k-1)
+! special MARS
+            dz = r_input(k) * t_input(k) * (- p_input(k) + p_input(k-1)) / p_input(k) / g
+!            dz = - cp_input(k) * (- t_input(k) + t_input(k-1)) / g
+            qvf1 = 0.5*(2.+(qv_input(k-1)+qv_input(k)))
+            qvf = 1. + rvovrd*qv_input(k)   ! qv is in g/kg here
+ 
+            do it=1,10
+              pm_input(k) = pm_input(k-1) &
+                      - 0.5*dz*(rho_input(k)+rho_input(k-1))*g*qvf1
+!              rho_input(k) = 1./((r/p1000mb)*th_input(k)*qvf*((pm_input(k)/p1000mb)**cvpm))
+!! special MARS
+              rho_input(k) = 1./((r_input(k)/p1000mb)*th_input(k)*qvf*((pm_input(k)/p1000mb)**cvpm_input(k)))
+              !!
+      print *, p_input(k), pm_input(k), ((r_input(k)/p1000mb)*th_input(k)*qvf*((pm_input(k)/p1000mb)**cvpm_input(k))), k          
+            enddo
+          enddo
+
+!  we have the moist sounding
+
+!  next, compute the dry sounding using p at the highest level from the
+!  moist sounding and integrating down.
+
+        p_input(nl) = pm_input(nl)
+
+          do k=nl-1,1,-1
+            dz = h_input(k+1)-h_input(k)
+            p_input(k) = p_input(k+1) + 0.5*dz*(rho_input(k)+rho_input(k+1))*g
+          enddo
+
+
+        do k=1,nl
+
+          zk(k) = h_input(k)
+          !p(k) = pm_input(k)
+          !p_dry(k) = p_input(k)
+          p(k) = pfile_input(k)
+          p_dry(k) = pfile_input(k)
+          theta(k) = th_input(k)
+          !rho(k) = rho_input(k)
+          rho(k) = rhofile_input(k)
+          u(k) = u_input(k)
+          v(k) = v_input(k)
+          qv(k) = qv_input(k)
+
+        enddo
+
+     if(debug) then
+      write(6,*) ' sounding '
+      write(6,*) '  k  height(m)  press (Pa) pd(Pa) theta (K) den(kg/m^3)  u(m/s)     v(m/s)    qv(g/g) '
+      do k=1,nl
+        write(6,'(1x,i3,8(1x,1pe10.3))') k, zk(k), p(k), p_dry(k), theta(k), rho(k), u(k), v(k), qv(k)
+      enddo
+
+     end if
+
+      end subroutine get_sounding
+
+!-------------------------------------------------------
+
+      subroutine read_sounding( ps,ts,qvs,h,th,qv,u,v,r,cp,p,t,rho,n,nl,debug )
+      implicit none
+      integer n,nl
+      real ps,ts,qvs,h(n),th(n),qv(n),u(n),v(n),r(n),cp(n),p(n),t(n),rho(n) 
+      logical end_of_file
+      logical debug
+
+      integer k
+
+      open(unit=10,file='input_sounding',form='formatted',status='old')
+      rewind(10)
+      read(10,*) ps, ts, qvs
+      if(debug) then
+        write(6,*) ' input sounding surface parameters '
+        write(6,*) ' surface pressure (mb) ',ps
+        write(6,*) ' surface pot. temp (K) ',ts
+        write(6,*) ' surface mixing ratio (g/kg) ',qvs
+      end if
+
+      end_of_file = .false.
+      k = 0
+
+      do while (.not. end_of_file)
+
+        read(10,*,end=100) h(k+1), th(k+1), qv(k+1), u(k+1), v(k+1)
+        k = k+1
+        if(debug) write(6,'(1x,i3,5(1x,e10.3))') k, h(k), th(k), qv(k), u(k), v(k)
+        go to 110
+ 100    end_of_file = .true.
+ 110    continue
+      enddo
+
+
+      !!! special MARS
+      open(unit=11,file='input_therm',form='formatted',status='old')
+      rewind(11)
+      end_of_file = .false.
+      k = 0
+      do while (.not. end_of_file)
+
+        read(11,*,end=101) r(k+1), cp(k+1), p(k+1), rho(k+1), t(k+1) 
+        write(*,*) k, r(k+1), cp(k+1), p(k+1), rho(k+1), t(k+1)
+        k = k+1
+        go to 112
+ 101    end_of_file = .true.
+ 112    continue
+      enddo
+      !!! special MARS
+
+
+
+      nl = k
+
+      close(unit=10,status = 'keep')
+
+      end subroutine read_sounding
+
+END MODULE module_initialize
Index: trunk/MESOSCALE_DEV/WORK/estimations
===================================================================
--- trunk/MESOSCALE_DEV/WORK/estimations	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/estimations	(revision 207)
@@ -0,0 +1,4 @@
+\item (base) 64 bits, 1 processeur, domaine 50x50x50, résolution 7 km, sans traceurs : 0.4 h/jour.
+\item (traceurs) 64 bits, 4 processeurs, domaine 201x201x61, résolution 20km, 2 traceurs : 8 h/jour.
+\item (domaines emboîtés) 64 bits, 4 processeurs, 3 domaines 155x155x61, résolutions 36 km, 9 km, 2 km, sans traceurs : 20 h/jour.
+\item (LES) 64 bits, 1 processeur, domaine 150x150x71, résolution 100 m, sans traceurs :  11 h/h.
Index: trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_ideal.txt
===================================================================
--- trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_ideal.txt	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_ideal.txt	(revision 207)
@@ -0,0 +1,4 @@
+jusque 201 OK avec ideal.exe sequentiel
+ensuite il vaut mieux utiliser
+mpirun -n 4 ideal.exe
+le MP_STACK_SIZE est dans le bashrc
Index: trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_launch.les
===================================================================
--- trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_launch.les	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_launch.les	(revision 207)
@@ -0,0 +1,68 @@
+####################################################################
+# @ job_name		=	LMD_LES_MARS
+# @ job_type            =       MPICH
+# @ total_tasks         =       8
+# @ class               =       AP
+# @ environment         =       real=0;tmpdir=$(job_name).$(jobid).results
+####################################################################
+####################################################################
+####################################################################
+# @ output 		= 	$(job_name).$(jobid)
+# @ error 		= 	$(output)
+# @ blocking 		= 	unlimited
+# @ notification 	= 	never
+# @ queue
+grep "^# @" $0
+set -vx
+####################################################################
+mkdir $LOADL_STEP_INITDIR/${tmpdir}
+cd $LOADL_STEP_INITDIR/${tmpdir}
+####################################################################
+ln -sf $LOADL_STEP_INITDIR/*.exe .
+ln -sf $LOADL_STEP_INITDIR/*.def .
+ln -sf $LOADL_STEP_INITDIR/namelist.* .
+ln -sf $LOADL_STEP_INITDIR/wrfi* .   ### executer sur la frontale
+                                     ### au prealable !!!   
+####################################################################
+if [[ "${real}" == "0" ]]
+then
+  ln -sf $LOADL_STEP_INITDIR/input_* .
+else
+  ln -sf $LOADL_STEP_INITDIR/wrfb* .
+fi
+####################################################################
+declare -x MP_STACK_SIZE=640000000
+mpirun wrf.exe
+####################################################################
+####################################################################
+####################################################################
+
+
+
+####################################################################
+## @ total_tasks =16   ## ne fonctionne pas avec 241 points
+## @ total_tasks =20  ## semble mieux fonctionner... bof
+## @ total_tasks =24  ## il y a un souci a l'interface
+
+
+####################################################################
+####################################################################
+###############NE MARCHE PAS AVEC LES GRANDS DOMAINES ##############
+####################################################################
+####################################################################
+#echo "#! /bin/bash"                        > script
+#echo "ulimit -s unlimited"                >> script
+#echo "./ideal.exe"                        >> script
+#echo "mv rsl.out.0000 ideal_rsl.out.0000" >> script
+#chmod 755 script
+#mpirun ./script
+#\rm script
+####################################################################
+##declare -x MP_STACK_SIZE=64000000
+##mpirun ideal.exe      ### PB: ideal.exe est limite a un moment
+##                      ### mais mpirun ideal.exe donne des instabilites
+##ulimit -s unlimited   ### ne resout pas PB... ok 145 pas ok 201
+##./ideal.exe
+##mpirun "ulimit -s unlimited ; ./ideal.exe"
+##mv rsl.out.0000 ideal_rsl.out.0000
+####################################################################
Index: trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_launch.meso
===================================================================
--- trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_launch.meso	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_launch.meso	(revision 207)
@@ -0,0 +1,30 @@
+# @ job_name=LMD_MM_MARS
+# @ output = $(job_name).$(jobid)
+# @ error = $(output)
+# @ job_type = MPICH
+# @ total_tasks=32
+## @ total_tasks=24
+## @ total_tasks =16
+## @ total_tasks =8
+## @ total_tasks =4
+# @ blocking = unlimited
+# @ class =AP
+## @ class =BP
+## @ class =CP
+# @ environment=tmpdir=$(job_name).$(jobid).results
+# @ notification = never
+# @ queue
+grep "^# @" $0
+set -vx
+####################################################################
+mkdir $LOADL_STEP_INITDIR/${tmpdir}
+cd $LOADL_STEP_INITDIR/${tmpdir}
+####################################################################
+ln -sf  $LOADL_STEP_INITDIR/*.def      .
+ln -sf  $LOADL_STEP_INITDIR/wrfb*      .
+ln -sf  $LOADL_STEP_INITDIR/wrfi*      .
+ln -sf  $LOADL_STEP_INITDIR/namelist*  .
+declare -x MP_STACK_SIZE=64000000 
+ln -sf /san/home/spiga/trunk//mesoscale/LMD_MM_MARS/newphys_mpifort_64/wrf_x241_y241_z61_d1_t4_p32.exe wrf.exe
+mpirun wrf.exe
+####################################################################
Index: trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_launch.meso.ideal.mpich
===================================================================
--- trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_launch.meso.ideal.mpich	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_launch.meso.ideal.mpich	(revision 207)
@@ -0,0 +1,32 @@
+# @ job_name=GW_MARS
+# @ output = $(job_name).$(jobid)
+# @ error = $(output)
+# @ job_type = MPICH
+# @ total_tasks =24
+## @ total_tasks =16
+## @ total_tasks =8
+## @ total_tasks =4
+# @ blocking = unlimited
+# @ class =AP
+## @ class =BP
+## @ class =CP
+# @ environment=tmpdir=$(job_name).$(jobid).results
+# @ queue
+grep "^# @" $0
+set -vx
+####################################################################
+mkdir $LOADL_STEP_INITDIR/${tmpdir}
+\rm GW_MARS_last
+cd $LOADL_STEP_INITDIR
+ln -sf ${tmpdir} GW_MARS_last
+cd ${tmpdir}
+####################################################################
+cp      $LOADL_STEP_INITDIR/*.def      .
+cp      $LOADL_STEP_INITDIR/wrf*       .
+cp      $LOADL_STEP_INITDIR/namelist*  .
+cp      $LOADL_STEP_INITDIR/levels     .
+cp      $LOADL_STEP_INITDIR/input_*    .
+cp      $LOADL_STEP_INITDIR/ze_hill    .
+declare -x MP_STACK_SIZE=64000000
+mpirun /san/home/spiga/trunk//mesoscale//LMD_MM_MARS/mpifort_64/wrf_x121_y121_z181_d1_t1_p24.exe
+####################################################################
Index: trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_launch.meso.ideal.seq
===================================================================
--- trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_launch.meso.ideal.seq	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/gnome.sav/gnome_launch.meso.ideal.seq	(revision 207)
@@ -0,0 +1,24 @@
+# @ job_name=GW_MARS
+# @ output = $(job_name).$(jobid)
+# @ error = $(output)
+# @ job_type = serial
+# @ class = A
+# @ environment=tmpdir=$(job_name).$(jobid).results
+## @ resources = ConsumableCpus(1)ConsumableMemory(24gb)
+# @ queue
+grep "^# @" $0
+set -vx
+####################################################################
+mkdir $LOADL_STEP_INITDIR/${tmpdir}
+cd $LOADL_STEP_INITDIR/${tmpdir}
+####################################################################
+ln -sf  $LOADL_STEP_INITDIR/*.exe      .
+cp      $LOADL_STEP_INITDIR/*.def      .
+#cp      $LOADL_STEP_INITDIR/wrf*       .
+cp      $LOADL_STEP_INITDIR/namelist*  .
+cp      $LOADL_STEP_INITDIR/levels     .
+cp      $LOADL_STEP_INITDIR/input_*    .
+cp      $LOADL_STEP_INITDIR/ze_hill    .
+./ideal.exe > log_ideal 
+./wrf.exe > log_wrf
+####################################################################
Index: trunk/MESOSCALE_DEV/WORK/gnu_64.configure
===================================================================
--- trunk/MESOSCALE_DEV/WORK/gnu_64.configure	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/gnu_64.configure	(revision 207)
@@ -0,0 +1,4 @@
+  14.  PC Linux x86_64 (IA64 and AMD Opteron), GNU Fortran compiler, DM-Parallel  (RSL, MPICH, Allows nesting)
+  15.  PC Linux x86_64 (IA64 and Opteron), GNU Fortran compiler   (Single-threaded, RSL, Allows nesting)
+  16.  PC Linux x86_64 (IA64 and Opteron), GNU Fortran compiler  DM-Parallel (RSL_LITE, OpenMPI, Allows nesting)
+
Index: trunk/MESOSCALE_DEV/WORK/gnu_64.configure.wrf
===================================================================
--- trunk/MESOSCALE_DEV/WORK/gnu_64.configure.wrf	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/gnu_64.configure.wrf	(revision 207)
@@ -0,0 +1,256 @@
+# configure.wrf
+#
+# This file was automatically generated by the configure script in the
+# top level directory. You may make changes to the settings in this
+# file but be aware they will be overwritten each time you run configure.
+# Ordinarily, it is necessary to run configure once, when the code is
+# first installed.
+#
+# To permanently change options, change the settings for your platform
+# in the file arch/configure.defaults then rerun configure.
+#
+SHELL           =       /bin/sh
+DEVTOP          =       `pwd`
+LIBINCLUDE      =       .
+.SUFFIXES: .F .i .o .f90 .c
+
+#### Get core settings from environment (set in compile script)
+#### Note to add a core, this has to be added to.
+
+COREDEFS = -DEM_CORE=$(WRF_EM_CORE) \
+           -DNMM_CORE=$(WRF_NMM_CORE) -DNMM_MAX_DIM=2600 \
+	   -DCOAMPS_CORE=$(WRF_COAMPS_CORE) \
+           -DEXP_CORE=$(WRF_EXP_CORE)
+
+#### Single location for defining total number of domains.  You need
+#### at least 1 + 2*(number of total nests).  For example, 1 coarse
+#### grid + three fine grids = 1 + 2(3) = 7, so MAX_DOMAINS=7.
+
+MAX_DOMAINS	=	21
+
+#### DM buffer length for the configuration flags.
+
+CONFIG_BUF_LEN	=	16384
+
+
+##############################################################################
+#### The settings in this section are defaults that may be overridden by the 
+#### architecture-specific settings in the next section.  
+##############################################################################
+
+##############################################################################
+#### NOTE:  Do not modify these default values here.  To override these 
+####        values, make changes after "Architecture specific settings".  
+##############################################################################
+
+#### Native size (in bytes) of Fortran REAL data type on this architecture ####
+#### Note:  to change real wordsize (for example, to promote REALs from 
+####        4-byte to 8-byte), modify the definition of RWORDSIZE in the 
+####        section following "Architecture specific settings".  Do not 
+####        change NATIVE_RWORDSIZE as is it architecture-specific.  
+NATIVE_RWORDSIZE = 4
+
+#### Default sed command and script for Fortran source files ####
+SED_FTN = sed -f ../arch/standard.sed
+
+# Hack to work around $(PWD) not changing during OSF1 build.  
+# $(IO_GRIB_SHARE_DIR) is reset during the OSF1 build only.  
+IO_GRIB_SHARE_DIR = 
+
+#### ESMF switches                 ####
+#### These are set up by Config.pl ####
+# switch to use separately installed ESMF library for coupling:  1==true
+ESMF_COUPLING       = 0
+# select dependences on module_utility.o
+ESMF_MOD_DEPENDENCE = ../external/esmf_time_f90/module_utility.o
+# select -I options for separately installed ESMF library, if present
+ESMF_MOD_INC        = 
+# select -I options for external/io_esmf vs. external/esmf_time_f90
+ESMF_IO_INC         = -I../external/esmf_time_f90
+# select cpp token for external/io_esmf vs. external/esmf_time_f90
+ESMF_IO_DEFS        = 
+# select build target for external/io_esmf vs. external/esmf_time_f90
+ESMF_TARGET         = esmf_time
+
+##############################################################################
+
+
+#### Architecture specific settings ####
+
+# Settings for PC Linux x86_64 (IA64 and Opteron), GNU Fortran compiler   (Single-threaded, RSL, Allows nesting)
+#
+DMPARALLEL      =       1
+MAX_PROC        =       1024
+FC              =       gfortran
+LD              =       gfortran
+CC              =       gcc -DFSEEKO64_OK 
+SCC		=	$(CC)
+SFC             =       gfortran
+RWORDSIZE       =       $(NATIVE_RWORDSIZE)
+FCOPTIM		=       #-O3 -funroll-loops #-ftree-vectorize -ftree-loop-linear
+FCDEBUG		=	#-g
+FCBASEOPTS      =       -fno-second-underscore -w $(FCDEBUG) -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4
+FCFLAGS         =       $(FCOPTIM) $(FCBASEOPTS)
+ARCHFLAGS       =       -DGRIB1 -DINTIO -DWRF_RSL_IO -DRSL -DDM_PARALLEL \
+                        -DIWORDSIZE=4 -DDWORDSIZE=8 -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=4 -DNETCDF \
+			-DLIMIT_ARGS -DSTUBMPI
+PROMOTION	=
+CFLAGS          =       -DLANDREADSTUB -DDM_PARALLEL -DWRF_RSL_IO \
+                        -DMAXDOM_MAKE=$(MAX_DOMAINS) -DMAXPROC_MAKE=$(MAX_PROC) -I../external/RSL/RSL $(ARCHFLAGS)
+# machine-specific flags needed to link in ESMF library (C++ run-time-library, etc.)
+ESMF_LIB_FLAGS  =       
+ESMF_IO_LIB     =       -L../external/esmf_time_f90 -lesmf_time
+ESMF_IO_LIB_EXT =       -L../../external/esmf_time_f90 -lesmf_time
+INCLUDE_MODULES =       -J../main -I../main -I../external/io_netcdf -I../external/io_int -I../external/esmf_time_f90 \
+                        -I../external -I../frame -I../share -I../phys -I../chem -I../inc
+PERL            =       perl
+REGISTRY        =       Registry
+LIB             =       -L../external/io_netcdf -lwrfio_nf -L/donnees/aslmd/MODELES/NETCDF/gfortran_64/netcdf-3.6.1//lib -lnetcdf -L../external/RSL/RSL -lrsl \
+                        -L../external/io_grib1 -lio_grib1 \
+			-L../external/io_int -lwrfio_int \
+			-L../external/io_grib_share -lio_grib_share \
+			../frame/module_internal_header_util.o ../frame/pack_utils.o -L../external/esmf_time_f90 -lesmf_time -L../mars_lmd/libo -llmd /donnees/aslmd/MODELES/NETCDF/gfortran_64/netcdf-3.6.1//lib/libnetcdf.a 
+LDFLAGS         =       $(FCFLAGS)  -fconvert=big-endian
+ENVCOMPDEFS	=	
+WRF_CHEM	=	0 
+CPP             =       /lib/cpp -C -P -traditional
+POUND_DEF	=	-DNO_RRTM_PHYSICS  $(COREDEFS) -DNONSTANDARD_SYSTEM -DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN) -DMAX_DOMAINS_F=$(MAX_DOMAINS)
+CPPFLAGS        =       -I$(LIBINCLUDE) -C -P $(ARCHFLAGS) -I../external/RSL/RSL -C -P `cat ../inc/dm_comm_cpp_flags` $(ENVCOMPDEFS) $(POUND_DEF)
+AR              =       ar ru
+M4              =       m4 -B 14000
+RANLIB          =       ranlib
+NETCDFPATH	=	/donnees/aslmd/MODELES/NETCDF/gfortran_64/netcdf-3.6.1/
+CC_TOOLS        =       cc
+
+externals : wrf_ioapi_includes wrfio_nf wrfio_grib_share wrfio_grib1 ../external/RSL/RSL/librsl.a wrfio_int gen_comms.c module_dm.F esmf_time
+
+gen_comms.c : ../external/RSL/gen_comms.c
+	( /bin/cp ../tools/gen_comms_warning ../tools/gen_comms.c ; \
+          cat ../external/RSL/gen_comms.c >> ../tools/gen_comms.c )
+
+module_dm.F : ../external/RSL/module_dm.F
+	( /bin/cp module_dm_warning module_dm.F ; cat ../external/RSL/module_dm.F >> module_dm.F )
+
+wrfio_nf : 
+	( cd ../external/io_netcdf ; \
+	  make NETCDFPATH=/donnees/aslmd/MODELES/NETCDF/gfortran_64/netcdf-3.6.1/ RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(FC) $(PROMOTION) $(FCFLAGS) -w" TRADFLAG="-traditional" )
+
+wrfio_grib_share :
+	( cd ../external/io_grib_share ; \
+          make CC="$(SCC)" CFLAGS="$(CFLAGS)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
+
+wrfio_grib1 :
+	( cd ../external/io_grib1 ; \
+          make CC="$(SCC)" CFLAGS="$(CFLAGS)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" archive)
+
+wrfio_grib2 :
+	( cd ../external/io_grib2 ; \
+          make CC="$(SCC)" CFLAGS="$(CFLAGS) " RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)" FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" FIXED="-Mfixed" archive)
+
+wrfio_int : 
+	( cd ../external/io_int ; \
+          make CC="$(CC)" RANLIB="$(RANLIB)" CPP="$(CPP)" SFC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" FC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS) -w" TRADFLAG="-traditional" all )
+
+esmf_time : 
+	( cd ../external/esmf_time_f90 ; \
+	  make FC="$(FC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" RANLIB="$(RANLIB)" CPP="$(CPP) -I../../inc -I. $(POUND_DEF)" )
+
+../external/RSL/RSL/librsl.a :
+	( cd ../external/RSL/RSL ; make CC="$(CC)" CFLAGS='-DSTUBS' FC="$(FC) $(PROMOTION)" FFLAGS='' MAX_DOMAINS=$(MAX_DOMAINS) MAX_PROC=$(MAX_PROC) LEARN_BCAST=-DLEARN_BCAST stub )
+
+# compile these without high optimization to speed compile
+solve_interface.o : solve_interface.F
+shift_domain_em.o : shift_domain_em.F
+module_io_mm5.o : module_io_mm5.F
+module_si_io.o : module_si_io.F
+module_io_wrf.o : module_io_wrf.F
+module_domain.o : module_domain.F
+module_start.o : module_start.F
+module_initialize.o : module_initialize.F
+module_initialize_b_wave.o : module_initialize_b_wave.F
+module_initialize_hill2d_x.o : module_initialize_hill2d_x.F
+module_initialize_quarter_ss.o : module_initialize_quarter_ss.F
+module_initialize_squall2d_x.o : module_initialize_squall2d_x.F
+module_initialize_squall2d_y.o : module_initialize_squall2d_y.F
+module_initialize_real.o : module_initialize_real.F
+module_dm.o : module_dm.F
+start_domain.o : start_domain.F
+mediation_integrate.o : mediation_integrate.F
+module_configure.o : module_configure.F
+
+solve_interface.o                                              \
+shift_domain_em.o                                              \
+module_io_mm5.o module_si_io.o module_io_wrf.o module_domain.o \
+module_start.o module_initialize.o module_initialize_b_wave.o  \
+module_initialize_hill2d_x.o module_initialize_quarter_ss.o    \
+module_initialize_squall2d_x.o module_initialize_squall2d_y.o  \
+module_configure.o                                             \
+mediation_integrate.o \
+module_initialize_real.o module_dm.o start_domain.o :
+	$(RM) $@
+	$(SED_FTN) $*.F > $*.b 
+	$(CPP) -I../inc $(CPPFLAGS) $*.b  > $*.f90
+	$(RM) $*.b
+	$(FC) -c $(PROMOTION) $(FCBASEOPTS) $(MODULE_DIRS) $*.f90
+
+
+###########################################################
+
+# These sub-directory builds are identical across all architectures
+wrfio_esmf :
+	( cd ../external/io_esmf ; \
+	make FC="$(FC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS) $(ESMF_MOD_INC)" RANLIB="$(RANLIB)" CPP="$(CPP) $(POUND_DEF) " )
+
+
+#
+#	Macros, these should be generic for all machines
+
+LN	=	ln -sf
+MAKE	=	make -i -r
+RM	= 	rm -f
+
+#	There is probably no reason to modify these rules
+
+wrf_ioapi_includes :
+	( cd ../external/ioapi_share ; \
+	$(MAKE) NATIVE_RWORDSIZE="$(NATIVE_RWORDSIZE)" RWORDSIZE="$(RWORDSIZE)" )
+
+.F.i:
+	$(RM) $@
+	$(CPP) -I../inc $(CPPFLAGS) $*.F > $@
+	mv $*.i $(DEVTOP)/pick/$*.f90
+	cp $*.F $(DEVTOP)/pick
+
+.F.o:
+	$(RM) $@
+	$(SED_FTN) $*.F > $*.b 
+	$(CPP) -I../inc $(CPPFLAGS) $*.b  > $*.f90
+	$(RM) $*.b
+	$(FC) -c $(FCFLAGS) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $*.f90
+#PGI	if [ ! -e $@ ] ; then \
+#PGI	sleep 10 ; $(FC) -c $(FCFLAGS) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $*.f90 ; \
+#PGI	fi
+#PGI	if [ ! -e $@ ] ; then \
+#PGI	sleep 10 ; $(FC) -c $(FCFLAGS) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $*.f90 ; \
+#PGI	fi
+
+.F.f90:
+	$(RM) $@
+	$(SED_FTN) $*.F > $*.b 
+	$(CPP) -I../inc $(CPPFLAGS) $*.b  > $@
+	$(RM) $*.b
+
+.f90.o:
+	$(RM) $@
+	$(FC) -c $(FCFLAGS) $(PROMOTION) $(FCSUFFIX) $*.f90
+#PGI	if [ ! -e $@ ] ; then \
+#PGI	sleep 10 ; $(FC) -c $(FCFLAGS) $(PROMOTION) $(FCSUFFIX) $*.f90 ; \
+#PGI	fi
+#PGI	if [ ! -e $@ ] ; then \
+#PGI	sleep 10 ; $(FC) -c $(FCFLAGS) $(PROMOTION) $(FCSUFFIX) $*.f90 ; \
+#PGI	fi
+
+.c.o:
+	$(RM) $@
+	$(CC) -c $(CFLAGS) $*.c
+
Index: trunk/MESOSCALE_DEV/WORK/gnu_64_single.txt
===================================================================
--- trunk/MESOSCALE_DEV/WORK/gnu_64_single.txt	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/gnu_64_single.txt	(revision 207)
@@ -0,0 +1,53 @@
+gnu simple en 64 bits sur huchard, etc...
+-------------------
+
+choix 99 de makemeso pour le moment
+
+
+**** segmentation fault dans le cas de la montagne 2D ****
+
+
+
+autre possibilite: essayer les librairies NETCDF4.0 d'Ehouarn
+
+
+essai sans O3
+NB: on a juste a modifier SRC/WRFV2/configure.defaults.gfortran64
+>>> NE REGLE PAS LE PB
+
+
+IL Y A UN PROBLEME AVEC LES VALEURS CALCULEES...
+ou: Floating exception sur auric
+
+
+../mars_lmd/libo/liblmd.a(physdem1.o): In function `physdem1_':
+physdem1.F:(.text+0x6bb): undefined reference to `nf_put_var_real_'
+physdem1.F:(.text+0x74a): undefined reference to `nf_put_var_real_'
+physdem1.F:(.text+0x7d9): undefined reference to `nf_put_var_real_'
+physdem1.F:(.text+0x868): undefined reference to `nf_put_var_real_'
+physdem1.F:(.text+0x8f7): undefined reference to `nf_put_var_real_'
+../mars_lmd/libo/liblmd.a(physdem1.o):physdem1.F:(.text+0x986): more undefined
+references to `nf_put_var_real_' follow
+../mars_lmd/libo/liblmd.a(meso_readtesassim.o): In function
+`meso_readtesassim_':
+meso_readtesassim.F90:(.text+0x1224): undefined reference to
+`nf_get_var_real_'
+meso_readtesassim.F90:(.text+0x14cc): undefined reference to
+`nf_get_var_real_'
+meso_readtesassim.F90:(.text+0x179a): undefined reference to
+`nf_get_var_real_'
+meso_readtesassim.F90:(.text+0x17dd): undefined reference to
+`nf_get_var_real_'
+../mars_lmd/libo/liblmd.a(readtesassim.o): In function `readtesassim_':
+readtesassim.F90:(.text+0x11ec): undefined reference to `nf_get_var_real_'
+../mars_lmd/libo/liblmd.a(readtesassim.o):readtesassim.F90:(.text+0x121b):
+more undefined references to `nf_get_var_real_' follow
+collect2: ld returned 1 exit status
+make[1]: [em_wrf] Error 1 (ignored)
+
+
+>>>> corrige en ajoutant dans makemeso
+
+                       sed s+"-L../mars_lmd/libo -llmd"+"-L../mars_lmd/libo
+-llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah
+configure.wrf ;;
Index: trunk/MESOSCALE_DEV/WORK/notes/changer_pouss
===================================================================
--- trunk/MESOSCALE_DEV/WORK/notes/changer_pouss	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/notes/changer_pouss	(revision 207)
@@ -0,0 +1,5 @@
+suaer.F90
+readtesassim.F90
+callkeys.h
+
+info: callradite
Index: trunk/MESOSCALE_DEV/WORK/notes/gfortran
===================================================================
--- trunk/MESOSCALE_DEV/WORK/notes/gfortran	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/notes/gfortran	(revision 207)
@@ -0,0 +1,1 @@
+https://bi.offis.de/wisent/tiki-index.php?page=WRF-gFortran
Index: trunk/MESOSCALE_DEV/WORK/notes/info.launch_compil
===================================================================
--- trunk/MESOSCALE_DEV/WORK/notes/info.launch_compil	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/notes/info.launch_compil	(revision 207)
@@ -0,0 +1,1 @@
+makemeso < mpi_64/makemeso_x61_y61_z61_d1_t1_p1 > /u/aslmd/lancer_compil.txt &
Index: trunk/MESOSCALE_DEV/WORK/notes/makemeso_bak
===================================================================
--- trunk/MESOSCALE_DEV/WORK/notes/makemeso_bak	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/notes/makemeso_bak	(revision 207)
@@ -0,0 +1,458 @@
+#! /bin/bash
+
+
+##################################
+# makemeso allows you to compile # 
+# WRF with modified LMD physics  #
+##################################
+
+##############################
+# Author: A. Spiga           #
+# New version : October 2008 #
+# Last update : January 2009 #
+##############################
+
+#############################
+# Use:    
+#
+# makemeso                   ## basic use (real configuration)
+#
+# makemeso -d                ## no compilation, just check the name of the compile folder
+#
+# makemeso -c real           ## real-case mode [default]
+# makemeso -c convection     ## idealized mode: convective cell
+#
+# makemeso < last            ## basic use + skip questions [! script must have been executed at least once]
+# makemeso -r < last         ## basic use + skip questions + only known config
+# makemeso -nr < last        ## basic use + skip questions + only known config + no LMD phys recompile
+#
+# makemeso -j                ## just compile the LMD physics
+#
+# makemeso -g                ## debug mode
+#
+# makemeso -h                ## display options
+#
+#############################
+
+
+# todo: netcdf support
+
+
+##############################################################################################
+##############################################################################################
+##############################################################################################
+##############################################################################################
+
+donotcompile=0
+donotallow=0
+config='real'
+donotcompilephys=0
+justphys=0
+debug=0
+while getopts "drc:njhg" options; do
+  case $options in
+   d ) donotcompile=1;;     ## just to check the compile folder
+   r ) donotallow=1;;       ## allow only known config (useful with 'makemeso < last')
+   c ) config="${OPTARG}";; ## idealized cases
+   n ) donotcompilephys=1;; ## do not recompile physics
+   j ) justphys=1;;         ## just compile LMD physics
+   g ) debug=1;;            ## debug mode
+   h ) echo "
+# Use:    
+#
+# makemeso                   ## basic use (real configuration)
+#
+# makemeso -d                ## no compilation, just check the name of the compile folder
+#
+# makemeso -c real           ## real-case mode [default]
+# makemeso -c convection     ## idealized mode: convective cell
+#
+# makemeso < last            ## basic use + skip questions [! script must have been executed at least once]
+# makemeso -r < last         ## basic use + skip questions + only known config
+# makemeso -nr < last        ## basic use + skip questions + only known config + no LMD phys recompile
+#
+# makemeso -j                ## just compile the LMD physics
+#
+# makemeso -g                ## debug mode
+#
+# makemeso -h                ## display options
+" ; exit ;;
+  esac
+done   
+
+#--------------
+# talk w/ user
+#--------------
+  echo '****************************************'
+  echo 'Welcome.'
+  echo '****************************************'
+  # computer
+  uname -a | grep x86_64 > /dev/null
+  if [[ "$?" == 0 ]]
+  then
+    machine='64'
+  else
+    machine='32'
+  fi
+  # compilator
+  echo '>>>' supported compiler options are 1. pgf90, 2. g95, 3. mpi+pgf90 - your choice ? ; read reply
+  case ${reply} in
+    1) compilo='pgf' ; numproc=1 ;;
+    2) compilo='g95' ; numproc=1 ;;
+    3) compilo='mpi'
+       if [[ "${WHERE_MPI}" = "" ]] 
+       then
+         echo Please initialize the variable WHERE_MPI in your environnement
+         exit
+       fi 
+       echo '>>>' how many processors ? 1, 2, 4, 6, 8, 12, 16 ; read numproc ;;
+    *) echo not supported by this script ; exit ;;
+  esac
+  # dimensions
+  if [ ${donotcompile} -eq 0 ]
+  then	  
+  echo '>>>' grid points in longitude ? ; read lon 
+  echo '>>>' grid points in latitude ? ; read lat 
+  echo '>>>' number of vertical levels ? ; read level 
+  fi
+  echo '>>>' number of domains ? ; read dom 
+
+###PB lecture dom si < last
+
+    case ${dom} in
+       1) single='_single' ;;
+       *) single='_nest' ;;
+    esac
+      if [[ "${compilo}" = "mpi" ]]
+      then
+           single=''
+      fi
+      testflag=''
+####
+#testflag='_test'
+####
+    conf_wrf="${compilo}_${machine}${single}${testflag}"
+    \rm what_folder 2> /dev/null
+    echo ${conf_wrf} > what_folder
+         if [ ${donotcompile} -eq 1 ]
+         then
+            #\rm what_folder 2> /dev/null
+            #echo '**********************' 
+            #echo '*** Your folder is ...'
+            #echo '**********************'
+            #echo ${conf_wrf} | tee what_folder
+            #cat what_folder
+            #echo ${conf_wrf} > what_folder
+	    #echo ${reply} > what_compilo
+	    #echo ${numproc} > what_numproc
+            exit
+         fi
+  echo '>>>' number of tracers ? ; read tra 
+         if [ ${tra} -eq 0 ]
+         then 
+	    tra=1	 
+         fi
+  # folder
+  mkdir ${conf_wrf} 2> /dev/null
+  if [[ "$?" == 0 ]]
+  then
+    echo new folder ... link sources
+    ./copy_model
+    mv WRFV2 ${conf_wrf}/
+    cd ${conf_wrf}/WRFV2
+    cd Registry ; Registry.bash ; cd .. 
+  else
+    cd ${conf_wrf}/WRFV2 
+    echo '>>>' did you modify anything in the Registry or clean ? y for yes, any key for no ; read answer
+    case ${answer} in
+      y) cd Registry ; mv Registry Registry.bak ; Registry.bash ; cd .. ;;
+      *) answer='no' ;;
+    esac 
+  fi
+  # summary
+  echo '**********************' 
+  echo '*** Your folder is ...'
+  echo '**********************'
+  echo ${conf_wrf} 
+  echo '**********************'
+  echo '****************************************'
+  echo so ...
+  echo your computer is ${machine} bits
+  echo ${compilo} is your compiler
+       if [[ "${compilo}" = "mpi" ]]
+       then
+         echo MPICH is in ${WHERE_MPI}
+       fi
+  echo you will use ${numproc} processors
+  echo you have ${lon} x points
+  echo '         '${lat} y points
+  echo '         '${level} z points
+  echo '         '${dom} domains
+  echo '         '${tra} tracers
+  echo '****************************************'
+  # save answer
+  \rm last 2> /dev/null
+  touch last
+  echo ${reply} >> last
+     if [[ "${compilo}" = "mpi" ]]
+     then
+     echo ${numproc} >> last
+     fi
+  echo ${lon} >> last
+  echo ${lat} >> last
+  echo ${level} >> last
+  echo ${dom} >> last
+  echo ${tra} >> last
+  echo ${answer} >> last
+
+
+#------------
+# log files
+#------------
+  \rm log_compile 2> /dev/null
+  \rm log_error 2> /dev/null
+
+#-----------------
+# configure WRF
+#-----------------
+  mv configure.wrf configure.wrf.bak 2> /dev/null
+  ########################
+  case ${conf_wrf} in
+                     # PGF90, 32 bits, no nesting
+     pgf_32_single)  echo 1 | configure > log_compile 2> log_error ;;
+                     # PGF90, 32 bits, nesting
+     pgf_32_nest)    echo 2 | configure > log_compile 2> log_error ;;
+                     # PGF90, 64 bits, no nesting
+     pgf_64_single)  echo 1 | configure > log_compile 2> log_error ;;
+                     # PGF90, 64 bits, nesting
+     pgf_64_nest)    cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
+		     echo 4 | configure > log_compile 2> log_error ;;
+                     # G95, 32 bits, no nesting
+     g95_32_single)  echo 13 | configure > log_compile 2> log_error ;; 
+                     # MPICH, 64 bits, no nesting / nesting
+     mpi_64)         cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
+                     echo 3 | configure > log_compile 2> log_error 
+                     sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g > yeah
+#| sed s+"fastsse"+"fast"+g > yeah
+                     mv -f yeah configure.wrf ;; 
+                     # MPICH, 64 bits, OK with periodic BC but no positive definite
+     mpi_64_test)    cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
+                     echo 2 | configure > log_compile 2> log_error
+                     sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g > yeah
+                     mv -f yeah configure.wrf ;;
+                     # ANYTHING ELSE
+     *)              echo NO PRESETS ...
+                     if [ ${donotallow} -eq 0 ]  
+                     then
+                       configure 
+                     else
+                       # problem when an input file is used
+                       echo 'please cd to '$PWD' and type ./configure'  
+		       exit	
+                     fi ;;
+  esac
+  ########################
+  sed -f mars.sed configure.wrf > yeah
+  mv -f yeah configure.wrf
+
+  if [ ${debug} -ne 0 ]
+  then
+    echo 'DEBUG DEBUG DEBUG DEBUG'
+    sed s+"#-g"+"-g"+g configure.wrf > yeah
+    mv -f yeah configure.wrf
+  fi
+
+##################################################
+# compile physics
+##################################################
+if [ ${donotcompilephys} -eq 0 ]
+then
+
+  cd mars_lmd/
+
+  # required size
+  #----------------
+  case ${numproc} in
+    1) physx=$(expr ${lon} - 1)
+       physy=$(expr ${lat} - 1)
+       physz=$(expr ${level} - 1) ;;
+    2) physx=$(expr ${lon} - 1)
+       physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 2)
+       physz=$(expr ${level} - 1) ;;
+    4) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 2)
+       physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 2)
+       physz=$(expr ${level} - 1) ;;
+    6) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 2)
+       physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 3)
+       physz=$(expr ${level} - 1) ;;
+    8) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 2)
+       physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 4)
+       physz=$(expr ${level} - 1) ;;
+    12) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 3)
+        physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 4)
+        physz=$(expr ${level} - 1) ;;
+    16) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 4)
+        physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 4)
+        physz=$(expr ${level} - 1) ;;
+    *) echo not supported ; exit
+  esac
+
+  # change this if you change num_soil_layers in WRF
+  # -- default is 10
+  soilsize=10
+
+  # GCM environment variables
+  #--------------------------
+  export LMDGCM=$PWD
+  export LIBOGCM=$PWD/libo
+
+  # generate the appropriate dimphys
+  #---------------------------------
+  cd libf/phymars
+  \rm dimphys.h 2> /dev/null
+  physize=$(expr ${physx} \* ${physy})
+  sed s/--xsize--/${physx}/g meso_dimphys.h_ref | sed s/--ysize--/${physy}/g | sed s/--physize--/${physize}/g | sed s/--zsize--/${physz}/g | sed s/--soilsize--/${soilsize}/g > dimphys.h
+  #head -15 dimphys.h
+  cd ../..
+
+  # prepare for nesting
+  #---------------------
+  cd libf
+  duplicate${dom} 2> /dev/null
+  cd ..
+
+  # compile physics
+  #-------------------------- 
+  \rm libf/grid/dimensions.h 2> /dev/null
+  \rm -rf libo/* 2> /dev/null
+  echo 1. compiling LMD physics ...
+  echo compilation info in: 
+  echo $PWD/libo/log_compile_phys
+  if [ ${debug} -ne 0 ]
+  then
+    echo 'DEBUG DEBUG DEBUG DEBUG'
+    nohup makegcm_${compilo} -debug -t ${tra} -p mars -d ${physz} meso_testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys 
+  else
+    nohup makegcm_${compilo} -t ${tra} -p mars -d ${physz} meso_testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
+  fi
+  echo ... done
+        # clean the duplicate routines
+        cd libf
+        duplicate1 2> /dev/null
+        cd ..
+
+  # merge LMD executables in one lib
+  #--------------------------------------
+  cd libo
+  mkdir temp
+  #cp -f LINUXfastI._${physz}_t${tra}_reg/*.a temp
+  cp -f LINUX*/*.a temp
+  cd temp
+  ar x libbibio.a
+  ar x libphymars.a
+  ar x libaeronomars.a
+  \rm *.a
+  ar r liblmd.a *
+  cp -f liblmd.a ..
+  cd ..
+  \rm -r temp
+  nm liblmd.a > liblmd_content
+  # finish merge
+  cd ..
+
+  # save a copy 
+  #--------------
+  cp -f libo/liblmd.a libo/liblmd.a_${lon}_${lat}_${level}_${dom}_${tra} 
+  echo '****************************************'
+
+  # ok
+  #----
+  cd ..
+
+  # manage nest includes in module_lmd_driver.F
+  #---- 
+  cp call_meso_inifis$dom.inc call_meso_inifis.inc
+  cp call_meso_physiq$dom.inc call_meso_physiq.inc
+
+
+fi
+##################################################
+# END compile physics
+##################################################
+
+#------------------
+# compile WRF
+#------------------
+if [ ${justphys} -eq 0 ]
+then
+
+  echo 2. compiling WRF dynamical core ...
+
+  if [[ ! ( -f "call_meso_physiq.inc" ) ]]
+  then
+   echo 'did you compile the physics ? no call_meso_physiq.inc !'
+   exit
+  fi
+
+  # be sure to compile with the most recent physics
+  touch phys/module_lmd_driver.F
+
+  # talk to user
+  echo '>>> YOUR CONFIG IS : '${config}
+  echo '>>> compiling ... this may be long ... <<<'
+  echo check progress in:
+  echo $PWD/log_compile
+  echo check possible errors in:
+  echo $PWD/log_error
+  
+  # compile ...
+  case ${config} in
+    'real')         compile em_real > log_compile 2> log_error 
+                    # save executables  
+                    cd main
+                      if [[ -f wrf.exe ]]
+                      then
+                        echo 'Looks good ! wrf.exe is here...' 
+                      fi
+                    cp -f real.exe ../../real_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
+                    cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
+                    cd ..  ;;
+    'convection')   #mkdir 'test/em_quarter_ss' 2> /dev/null
+                    compile em_quarter_ss > log_compile 2> log_error 
+                    # save executables  
+                    cd main
+                      if [[ -f wrf.exe ]]
+                      then
+                        echo 'Looks good ! wrf.exe is here...' 
+                      fi
+                    cp -f ideal.exe ../../ideal_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
+                    cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
+                    cd ..  ;;
+    *)              echo not supported please use ; echo real convection ; exit ;;
+  esac
+  echo '*******last lines from log_error*********'
+  tail -n 20 log_error
+fi
+
+  # the end
+  echo '****************************************'
+  echo 'done.'
+  echo '****************************************'
+  cp last ../makemeso_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}
+  mv last ../../
+
+  # add here specific messages
+  if [[ "${dom}" != "1" ]]
+  then
+  nest=$(expr ${lon} + 4)
+  echo NB: in namelist.input, please set:
+  echo '
+  max_dom = '$dom'
+  s_we    = 1,1,
+  e_we    = '$lon','$nest',
+  s_sn    = 1,1, 
+  e_sn    = '$lat','$nest',
+  s_vert  = 1,1,
+  e_vert  = '$level','$level','
+  fi
+
Index: trunk/MESOSCALE_DEV/WORK/notes/makemeso_bak2
===================================================================
--- trunk/MESOSCALE_DEV/WORK/notes/makemeso_bak2	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/notes/makemeso_bak2	(revision 207)
@@ -0,0 +1,461 @@
+#! /bin/bash
+
+
+##################################
+# makemeso allows you to compile # 
+# WRF with modified LMD physics  #
+##################################
+
+##############################
+# Author: A. Spiga           #
+# New version : October 2008 #
+# Last update : January 2009 #
+##############################
+
+#############################
+# Use:    
+#
+# makemeso                   ## basic use (real configuration)
+#
+# makemeso -d                ## no compilation, just check the name of the compile folder
+#
+# makemeso -c real           ## real-case mode [default]
+# makemeso -c convection     ## idealized mode: convective cell
+#
+# makemeso < last            ## basic use + skip questions [! script must have been executed at least once]
+# makemeso -r < last         ## basic use + skip questions + only known config
+# makemeso -nr < last        ## basic use + skip questions + only known config + no LMD phys recompile
+#
+# makemeso -j                ## just compile the LMD physics
+#
+# makemeso -g                ## debug mode
+#
+# makemeso -h                ## display options
+#
+#############################
+
+
+# todo: netcdf support
+
+
+##############################################################################################
+##############################################################################################
+##############################################################################################
+##############################################################################################
+
+donotcompile=0
+donotallow=0
+config='real'
+donotcompilephys=0
+justphys=0
+debug=0
+while getopts "drc:njhg" options; do
+  case $options in
+   d ) donotcompile=1;;     ## just to check the compile folder
+   r ) donotallow=1;;       ## allow only known config (useful with 'makemeso < last')
+   c ) config="${OPTARG}";; ## idealized cases
+   n ) donotcompilephys=1;; ## do not recompile physics
+   j ) justphys=1;;         ## just compile LMD physics
+   g ) debug=1;;            ## debug mode
+   h ) echo "
+# Use:    
+#
+# makemeso                   ## basic use (real configuration)
+#
+# makemeso -d                ## no compilation, just check the name of the compile folder
+#
+# makemeso -c real           ## real-case mode [default]
+# makemeso -c convection     ## idealized mode: convective cell
+#
+# makemeso < last            ## basic use + skip questions [! script must have been executed at least once]
+# makemeso -r < last         ## basic use + skip questions + only known config
+# makemeso -nr < last        ## basic use + skip questions + only known config + no LMD phys recompile
+#
+# makemeso -j                ## just compile the LMD physics
+#
+# makemeso -g                ## debug mode
+#
+# makemeso -h                ## display options
+" ; exit ;;
+  esac
+done   
+
+#--------------
+# talk w/ user
+#--------------
+  echo '****************************************'
+  echo 'Welcome.'
+  echo '****************************************'
+  # computer
+  uname -a | grep x86_64 > /dev/null
+  if [[ "$?" == 0 ]]
+  then
+    machine='64'
+  else
+    machine='32'
+  fi
+  # compilator
+  echo '>>>' supported compiler options are 1. pgf90, 2. g95, 3. mpi+pgf90, 4. ifort - your choice ? ; read reply
+  case ${reply} in
+    1) compilo='pgf' ; numproc=1 ;;
+    2) compilo='g95' ; numproc=1 ;;
+    3) compilo='mpi'
+       if [[ "${WHERE_MPI}" = "" ]] 
+       then
+         echo Please initialize the variable WHERE_MPI in your environnement
+         exit
+       fi 
+       echo '>>>' how many processors ? 1, 2, 4, 6, 8, 12, 16 ; read numproc ;;
+    4) compilo='ifort' ; numproc=1 ;;
+    *) echo not supported by this script ; exit ;;
+  esac
+  # dimensions
+  if [ ${donotcompile} -eq 0 ]
+  then	  
+  echo '>>>' grid points in longitude ? ; read lon 
+  echo '>>>' grid points in latitude ? ; read lat 
+  echo '>>>' number of vertical levels ? ; read level 
+  fi
+  echo '>>>' number of domains ? ; read dom 
+
+###PB lecture dom si < last
+
+    case ${dom} in
+       1) single='_single' ;;
+       *) single='_nest' ;;
+    esac
+      if [[ "${compilo}" = "mpi" ]]
+      then
+           single=''
+      fi
+      testflag=''
+####
+#testflag='_test'
+####
+    conf_wrf="${compilo}_${machine}${single}${testflag}"
+    \rm what_folder 2> /dev/null
+    echo ${conf_wrf} > what_folder
+         if [ ${donotcompile} -eq 1 ]
+         then
+            #\rm what_folder 2> /dev/null
+            #echo '**********************' 
+            #echo '*** Your folder is ...'
+            #echo '**********************'
+            #echo ${conf_wrf} | tee what_folder
+            #cat what_folder
+            #echo ${conf_wrf} > what_folder
+	    #echo ${reply} > what_compilo
+	    #echo ${numproc} > what_numproc
+            exit
+         fi
+  echo '>>>' number of tracers ? ; read tra 
+         if [ ${tra} -eq 0 ]
+         then 
+	    tra=1	 
+         fi
+  # folder
+  mkdir ${conf_wrf} 2> /dev/null
+  if [[ "$?" == 0 ]]
+  then
+    echo new folder ... link sources
+    ./copy_model
+    mv WRFV2 ${conf_wrf}/
+    cd ${conf_wrf}/WRFV2
+    cd Registry ; Registry.bash ; cd .. 
+  else
+    cd ${conf_wrf}/WRFV2 
+    echo '>>>' did you modify anything in the Registry or clean ? y for yes, any key for no ; read answer
+    case ${answer} in
+      y) cd Registry ; mv Registry Registry.bak ; Registry.bash ; cd .. ;;
+      *) answer='no' ;;
+    esac 
+  fi
+  # summary
+  echo '**********************' 
+  echo '*** Your folder is ...'
+  echo '**********************'
+  echo ${conf_wrf} 
+  echo '**********************'
+  echo '****************************************'
+  echo so ...
+  echo your computer is ${machine} bits
+  echo ${compilo} is your compiler
+       if [[ "${compilo}" = "mpi" ]]
+       then
+         echo MPICH is in ${WHERE_MPI}
+       fi
+  echo you will use ${numproc} processors
+  echo you have ${lon} x points
+  echo '         '${lat} y points
+  echo '         '${level} z points
+  echo '         '${dom} domains
+  echo '         '${tra} tracers
+  echo '****************************************'
+  # save answer
+  \rm last 2> /dev/null
+  touch last
+  echo ${reply} >> last
+     if [[ "${compilo}" = "mpi" ]]
+     then
+     echo ${numproc} >> last
+     fi
+  echo ${lon} >> last
+  echo ${lat} >> last
+  echo ${level} >> last
+  echo ${dom} >> last
+  echo ${tra} >> last
+  echo ${answer} >> last
+
+
+#------------
+# log files
+#------------
+  \rm log_compile 2> /dev/null
+  \rm log_error 2> /dev/null
+
+#-----------------
+# configure WRF
+#-----------------
+  mv configure.wrf configure.wrf.bak 2> /dev/null
+  ########################
+  case ${conf_wrf} in
+                     # PGF90, 32 bits, no nesting
+     pgf_32_single)    echo 1 | configure > log_compile 2> log_error ;;
+                     # PGF90, 32 bits, nesting
+     pgf_32_nest)      echo 2 | configure > log_compile 2> log_error ;;
+                     # PGF90, 64 bits, no nesting
+     pgf_64_single)    echo 1 | configure > log_compile 2> log_error ;;
+                     # PGF90, 64 bits, nesting
+     pgf_64_nest)      cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
+		       echo 4 | configure > log_compile 2> log_error ;;
+                     # G95, 32 bits, no nesting
+     g95_32_single)    echo 13 | configure > log_compile 2> log_error ;; 
+                     # IFORT, 64 bits, no nesting
+     ifort_64_single)  echo 5 | configure > log_compile 2> log_error ;;
+                     # MPICH, 64 bits, no nesting / nesting
+     mpi_64)           cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
+                       echo 3 | configure > log_compile 2> log_error 
+                       sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g > yeah
+#| sed s+"fastsse"+"fast"+g > yeah
+                       mv -f yeah configure.wrf ;; 
+                     # MPICH, 64 bits, OK with periodic BC but no positive definite
+     mpi_64_test)      cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd ..
+                       echo 2 | configure > log_compile 2> log_error
+                       sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g > yeah
+                       mv -f yeah configure.wrf ;;
+                     # ANYTHING ELSE
+     *)                echo NO PRESETS ...
+                       if [ ${donotallow} -eq 0 ]  
+                       then
+                         configure 
+                       else
+                         # problem when an input file is used
+                         echo 'please cd to '$PWD' and type ./configure'  
+		         exit	
+                       fi ;;
+  esac
+  ########################
+  sed -f mars.sed configure.wrf > yeah
+  mv -f yeah configure.wrf
+
+  if [ ${debug} -ne 0 ]
+  then
+    echo 'DEBUG DEBUG DEBUG DEBUG'
+    sed s+"#-g"+"-g"+g configure.wrf > yeah
+    mv -f yeah configure.wrf
+  fi
+
+##################################################
+# compile physics
+##################################################
+if [ ${donotcompilephys} -eq 0 ]
+then
+
+  cd mars_lmd/
+
+  # required size
+  #----------------
+  case ${numproc} in
+    1) physx=$(expr ${lon} - 1)
+       physy=$(expr ${lat} - 1)
+       physz=$(expr ${level} - 1) ;;
+    2) physx=$(expr ${lon} - 1)
+       physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 2)
+       physz=$(expr ${level} - 1) ;;
+    4) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 2)
+       physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 2)
+       physz=$(expr ${level} - 1) ;;
+    6) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 2)
+       physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 3)
+       physz=$(expr ${level} - 1) ;;
+    8) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 2)
+       physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 4)
+       physz=$(expr ${level} - 1) ;;
+    12) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 3)
+        physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 4)
+        physz=$(expr ${level} - 1) ;;
+    16) physx=$(expr ${lon} - 1) ; physx=$(expr ${physx} \/ 4)
+        physy=$(expr ${lat} - 1) ; physy=$(expr ${physy} \/ 4)
+        physz=$(expr ${level} - 1) ;;
+    *) echo not supported ; exit
+  esac
+
+  # change this if you change num_soil_layers in WRF
+  # -- default is 10
+  soilsize=10
+
+  # GCM environment variables
+  #--------------------------
+  export LMDGCM=$PWD
+  export LIBOGCM=$PWD/libo
+
+  # generate the appropriate dimphys
+  #---------------------------------
+  cd libf/phymars
+  \rm dimphys.h 2> /dev/null
+  physize=$(expr ${physx} \* ${physy})
+  sed s/--xsize--/${physx}/g meso_dimphys.h_ref | sed s/--ysize--/${physy}/g | sed s/--physize--/${physize}/g | sed s/--zsize--/${physz}/g | sed s/--soilsize--/${soilsize}/g > dimphys.h
+  #head -15 dimphys.h
+  cd ../..
+
+  # prepare for nesting
+  #---------------------
+  cd libf
+  duplicate${dom} 2> /dev/null
+  cd ..
+
+  # compile physics
+  #-------------------------- 
+  \rm libf/grid/dimensions.h 2> /dev/null
+  \rm -rf libo/* 2> /dev/null
+  echo 1. compiling LMD physics ...
+  echo compilation info in: 
+  echo $PWD/libo/log_compile_phys
+  if [ ${debug} -ne 0 ]
+  then
+    echo 'DEBUG DEBUG DEBUG DEBUG'
+    nohup makegcm_${compilo} -debug -t ${tra} -p mars -d ${physz} meso_testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys 
+  else
+    nohup makegcm_${compilo} -t ${tra} -p mars -d ${physz} meso_testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
+  fi
+  echo ... done
+        # clean the duplicate routines
+        cd libf
+        duplicate1 2> /dev/null
+        cd ..
+
+  # merge LMD executables in one lib
+  #--------------------------------------
+  cd libo
+  mkdir temp
+  #cp -f LINUXfastI._${physz}_t${tra}_reg/*.a temp
+  cp -f LINUX*/*.a temp
+  cd temp
+  ar x libbibio.a
+  ar x libphymars.a
+  ar x libaeronomars.a
+  \rm *.a
+  ar r liblmd.a *
+  cp -f liblmd.a ..
+  cd ..
+  \rm -r temp
+  nm liblmd.a > liblmd_content
+  # finish merge
+  cd ..
+
+  # save a copy 
+  #--------------
+  cp -f libo/liblmd.a libo/liblmd.a_${lon}_${lat}_${level}_${dom}_${tra} 
+  echo '****************************************'
+
+  # ok
+  #----
+  cd ..
+
+  # manage nest includes in module_lmd_driver.F
+  #---- 
+  cp call_meso_inifis$dom.inc call_meso_inifis.inc
+  cp call_meso_physiq$dom.inc call_meso_physiq.inc
+
+
+fi
+##################################################
+# END compile physics
+##################################################
+
+#------------------
+# compile WRF
+#------------------
+if [ ${justphys} -eq 0 ]
+then
+
+  echo 2. compiling WRF dynamical core ...
+
+  if [[ ! ( -f "call_meso_physiq.inc" ) ]]
+  then
+   echo 'did you compile the physics ? no call_meso_physiq.inc !'
+   exit
+  fi
+
+  # be sure to compile with the most recent physics
+  touch phys/module_lmd_driver.F
+
+  # talk to user
+  echo '>>> YOUR CONFIG IS : '${config}
+  echo '>>> compiling ... this may be long ... <<<'
+  echo check progress in:
+  echo $PWD/log_compile
+  echo check possible errors in:
+  echo $PWD/log_error
+  
+  # compile ...
+  case ${config} in
+    'real')         compile em_real > log_compile 2> log_error 
+                    # save executables  
+                    cd main
+                      if [[ -f wrf.exe ]]
+                      then
+                        echo 'Looks good ! wrf.exe is here...' 
+                      fi
+                    cp -f real.exe ../../real_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
+                    cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
+                    cd ..  ;;
+    'convection')   #mkdir 'test/em_quarter_ss' 2> /dev/null
+                    compile em_quarter_ss > log_compile 2> log_error 
+                    # save executables  
+                    cd main
+                      if [[ -f wrf.exe ]]
+                      then
+                        echo 'Looks good ! wrf.exe is here...' 
+                      fi
+                    cp -f ideal.exe ../../ideal_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
+                    cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe
+                    cd ..  ;;
+    *)              echo not supported please use ; echo real convection ; exit ;;
+  esac
+  echo '*******last lines from log_error*********'
+  tail -n 20 log_error
+fi
+
+  # the end
+  echo '****************************************'
+  echo 'done.'
+  echo '****************************************'
+  cp last ../makemeso_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}
+  mv last ../../
+
+  # add here specific messages
+  if [[ "${dom}" != "1" ]]
+  then
+  nest=$(expr ${lon} + 4)
+  echo NB: in namelist.input, please set:
+  echo '
+  max_dom = '$dom'
+  s_we    = 1,1,
+  e_we    = '$lon','$nest',
+  s_sn    = 1,1, 
+  e_sn    = '$lat','$nest',
+  s_vert  = 1,1,
+  e_vert  = '$level','$level','
+  fi
+
Index: trunk/MESOSCALE_DEV/WORK/notes/module_initialize_real.F
===================================================================
--- trunk/MESOSCALE_DEV/WORK/notes/module_initialize_real.F	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/notes/module_initialize_real.F	(revision 207)
@@ -0,0 +1,5405 @@
+!REAL:MODEL_LAYER:INITIALIZATION
+
+#ifndef VERT_UNIT
+!  This MODULE holds the routines which are used to perform various initializations
+!  for the individual domains, specifically for the Eulerian, mass-based coordinate.
+
+!-----------------------------------------------------------------------
+
+!****MARS: modified May 2007
+
+
+MODULE module_initialize
+
+   USE module_bc
+   USE module_configure
+   USE module_domain
+   USE module_io_domain
+   USE module_model_constants
+   USE module_state_description
+   USE module_timing
+   USE module_soil_pre
+   USE module_date_time
+#ifdef DM_PARALLEL
+   USE module_dm
+#endif
+
+   REAL , SAVE :: p_top_save
+   INTEGER :: internal_time_loop
+
+CONTAINS
+
+!-------------------------------------------------------------------
+
+   SUBROUTINE init_domain ( grid )
+
+      IMPLICIT NONE
+
+      !  Input space and data.  No gridded meteorological data has been stored, though.
+
+!     TYPE (domain), POINTER :: grid 
+      TYPE (domain)          :: grid 
+
+      !  Local data.
+
+      INTEGER :: dyn_opt 
+      INTEGER :: idum1, idum2
+
+      CALL nl_get_dyn_opt ( 1, dyn_opt )
+      
+      CALL set_scalar_indices_from_config ( head_grid%id , idum1, idum2 )
+
+      IF (      dyn_opt .eq. 1 &
+           .or. dyn_opt .eq. 2 &
+           .or. dyn_opt .eq. 3 &
+                                          ) THEN
+        CALL init_domain_rk( grid &
+!
+#include "em_actual_new_args.inc"
+!
+      )
+
+      ELSE
+         WRITE(0,*)' init_domain: unknown or unimplemented dyn_opt = ',dyn_opt
+         CALL wrf_error_fatal ( 'ERROR-dyn_opt-wrong-in-namelist' )
+      ENDIF
+
+   END SUBROUTINE init_domain
+
+!-------------------------------------------------------------------
+
+   SUBROUTINE init_domain_rk ( grid &
+!
+#include "em_dummy_new_args.inc"
+!
+   )
+
+      USE module_optional_si_input
+      IMPLICIT NONE
+
+      !  Input space and data.  No gridded meteorological data has been stored, though.
+
+!     TYPE (domain), POINTER :: grid
+      TYPE (domain)          :: grid
+
+#include "em_dummy_new_decl.inc"
+
+      TYPE (grid_config_rec_type)              :: config_flags
+
+      !  Local domain indices and counters.
+
+      INTEGER :: num_veg_cat , num_soil_top_cat , num_soil_bot_cat
+      INTEGER :: loop , num_seaice_changes
+
+      INTEGER                             ::                       &
+                                     ids, ide, jds, jde, kds, kde, &
+                                     ims, ime, jms, jme, kms, kme, &
+                                     its, ite, jts, jte, kts, kte, &
+                                     ips, ipe, jps, jpe, kps, kpe, &
+                                     i, j, k
+      INTEGER :: ns
+
+      !  Local data
+
+      INTEGER :: error
+      REAL    :: p_surf, p_level
+      REAL    :: cof1, cof2
+      REAL    :: qvf , qvf1 , qvf2 , pd_surf
+      REAL    :: p00 , t00 , a
+      REAL    :: hold_znw
+      LOGICAL :: were_bad
+
+      LOGICAL :: stretch_grid, dry_sounding, debug
+      INTEGER IICOUNT
+
+      REAL :: p_top_requested , temp
+      INTEGER :: num_metgrid_levels
+      REAL , DIMENSION(max_eta) :: eta_levels
+      REAL :: max_dz
+
+!      INTEGER , PARAMETER :: nl_max = 1000
+!      REAL , DIMENSION(nl_max) :: grid%em_dn
+
+integer::oops1,oops2
+
+      REAL    :: zap_close_levels
+      INTEGER :: force_sfc_in_vinterp
+      INTEGER :: interp_type , lagrange_order
+      LOGICAL :: lowest_lev_from_sfc
+      LOGICAL :: we_have_tavgsfc
+
+      INTEGER :: lev500 , loop_count
+      REAL    :: zl , zu , pl , pu , z500 , dz500 , tvsfc , dpmu
+
+!-- Carsel and Parrish [1988]
+        REAL , DIMENSION(100) :: lqmi
+
+
+!****MARS
+      INTEGER :: sizegcm, kold, knew,inew,jnew
+      REAL :: pa, indic, p1, p2, pn
+      REAL, ALLOCATABLE, DIMENSION (:,:,:) :: sig, ap, bp, box
+      REAL :: randnum  
+!****MARS
+
+
+#ifdef DM_PARALLEL
+#    include "em_data_calls.inc"
+#endif
+
+      SELECT CASE ( model_data_order )
+         CASE ( DATA_ORDER_ZXY )
+            kds = grid%sd31 ; kde = grid%ed31 ;
+            ids = grid%sd32 ; ide = grid%ed32 ;
+            jds = grid%sd33 ; jde = grid%ed33 ;
+
+            kms = grid%sm31 ; kme = grid%em31 ;
+            ims = grid%sm32 ; ime = grid%em32 ;
+            jms = grid%sm33 ; jme = grid%em33 ;
+
+            kts = grid%sp31 ; kte = grid%ep31 ;   ! note that tile is entire patch
+            its = grid%sp32 ; ite = grid%ep32 ;   ! note that tile is entire patch
+            jts = grid%sp33 ; jte = grid%ep33 ;   ! note that tile is entire patch
+
+         CASE ( DATA_ORDER_XYZ )
+            ids = grid%sd31 ; ide = grid%ed31 ;
+            jds = grid%sd32 ; jde = grid%ed32 ;
+            kds = grid%sd33 ; kde = grid%ed33 ;
+
+            ims = grid%sm31 ; ime = grid%em31 ;
+            jms = grid%sm32 ; jme = grid%em32 ;
+            kms = grid%sm33 ; kme = grid%em33 ;
+
+            its = grid%sp31 ; ite = grid%ep31 ;   ! note that tile is entire patch
+            jts = grid%sp32 ; jte = grid%ep32 ;   ! note that tile is entire patch
+            kts = grid%sp33 ; kte = grid%ep33 ;   ! note that tile is entire patch
+
+         CASE ( DATA_ORDER_XZY )
+            ids = grid%sd31 ; ide = grid%ed31 ;
+            kds = grid%sd32 ; kde = grid%ed32 ;
+            jds = grid%sd33 ; jde = grid%ed33 ;
+
+            ims = grid%sm31 ; ime = grid%em31 ;
+            kms = grid%sm32 ; kme = grid%em32 ;
+            jms = grid%sm33 ; jme = grid%em33 ;
+
+            its = grid%sp31 ; ite = grid%ep31 ;   ! note that tile is entire patch
+            kts = grid%sp32 ; kte = grid%ep32 ;   ! note that tile is entire patch
+            jts = grid%sp33 ; jte = grid%ep33 ;   ! note that tile is entire patch
+
+      END SELECT
+
+      CALL model_to_grid_config_rec ( grid%id , model_config_rec , config_flags )
+
+      !  Check to see if the boundary conditions are set properly in the namelist file.
+      !  This checks for sufficiency and redundancy.
+
+      CALL boundary_condition_check( config_flags, bdyzone, error, grid%id )
+
+      !  Some sort of "this is the first time" initialization.  Who knows.
+
+      grid%step_number = 0
+      grid%itimestep=0
+
+      !  Pull in the info in the namelist to compare it to the input data.
+
+      grid%real_data_init_type = model_config_rec%real_data_init_type
+   
+      !  To define the base state, we call a USER MODIFIED routine to set the three
+      !  necessary constants:  p00 (sea level pressure, Pa), t00 (sea level temperature, K), 
+      !  and A (temperature difference, from 1000 mb to 300 mb, K).
+   
+      CALL const_module_initialize ( p00 , t00 , a ) 
+
+#if 0
+!KLUDGE, this is for testing only
+if ( flag_metgrid .eq. 1 ) then
+read (20+grid%id) grid%em_ht_gc
+read (20+grid%id) grid%em_xlat_gc
+read (20+grid%id) grid%em_xlong_gc
+read (20+grid%id) msft
+read (20+grid%id) msfu
+read (20+grid%id) msfv
+read (20+grid%id) f
+read (20+grid%id) e
+read (20+grid%id) sina
+read (20+grid%id) cosa
+read (20+grid%id) grid%landmask
+read (20+grid%id) grid%landusef
+read (20+grid%id) grid%soilctop
+read (20+grid%id) grid%soilcbot
+read (20+grid%id) grid%vegcat
+read (20+grid%id) grid%soilcat
+else
+write (20+grid%id) grid%em_ht
+write (20+grid%id) grid%em_xlat
+write (20+grid%id) grid%em_xlong
+write (20+grid%id) msft
+write (20+grid%id) msfu
+write (20+grid%id) msfv
+write (20+grid%id) f
+write (20+grid%id) e
+write (20+grid%id) sina
+write (20+grid%id) cosa
+write (20+grid%id) grid%landmask
+write (20+grid%id) grid%landusef
+write (20+grid%id) grid%soilctop
+write (20+grid%id) grid%soilcbot
+write (20+grid%id) grid%vegcat
+write (20+grid%id) grid%soilcat
+endif
+#endif
+
+
+      !  Is there any vertical interpolation to do?  The "old" data comes in on the correct
+      !  vertical locations already.
+
+      IF ( flag_metgrid .EQ. 1 ) THEN  !   <----- START OF VERTICAL INTERPOLATION PART ---->
+
+         !  Variables that are named differently between SI and WPS.
+
+         DO j = jts, MIN(jte,jde-1)
+           DO i = its, MIN(ite,ide-1)
+!!****MARS: tsk is surface temperature           
+              grid%tsk(i,j) = grid%em_tsk_gc(i,j)
+              grid%tmn(i,j) = grid%em_tmn_gc(i,j)
+              grid%xlat(i,j) = grid%em_xlat_gc(i,j)
+              grid%xlong(i,j) = grid%em_xlong_gc(i,j)
+              grid%ht(i,j) = grid%em_ht_gc(i,j)
+!!****MARS
+              grid%albedo_gcm(i,j) = grid%em_albedo_gcm_gc(i,j)
+              grid%therm_inert(i,j) = grid%em_therm_inert_gc(i,j)
+              grid%slpx(i,j) = grid%em_slpx_gc(i,j)
+              grid%slpy(i,j) = grid%em_slpy_gc(i,j)
+              grid%mars_emiss(i,j)=grid%st000010(i,j)
+              grid%mars_cice(i,j)=grid%st010040(i,j)
+                  !! one more security ... co2ice cannot be negative
+                  IF (grid%mars_cice(i,j) .lt. 0.) grid%mars_cice(i,j)=0.
+
+              DO k = 1, config_flags%num_soil_layers  
+                grid%mars_tsoil(i,k,j)=grid%em_tsoil_gc(i,k,j)
+              ENDDO  
+
+grid%mars_gw(i,1,j)=grid%st040100(i,j)  !!ZMEA
+grid%mars_gw(i,2,j)=grid%st100200(i,j)  !!ZSTD
+grid%mars_gw(i,3,j)=grid%sm000010(i,j)  !!ZSIG
+grid%mars_gw(i,4,j)=grid%sm010040(i,j)  !!ZGAM
+grid%mars_gw(i,5,j)=grid%sm040100(i,j)  !!ZTHE
+
+           END DO
+         END DO
+
+
+!!****MARS
+!!****MARS
+!! User-defined constants initialisations
+!! defined by the namelist entries
+!!	init_TI : fixed value for thermal inertia
+!!	init_AL : fixed value for albedo
+!!	init_U : fixed value for zonal wind
+!!	init_V : fixed value for meridional wind 
+!!	init_WX & init_WY : fixed wind profile taken at these coordinates
+!!      init_MU : multiply zonal wind by a constant
+!!      init_MV : multiply meridional wind by a constant
+!!	init_LES : LES mode (LOGICAL)
+
+IF (config_flags%init_TI .ne. 0.) THEN
+
+    !DO j = jts, MIN(jte,jde-1)
+    !DO i = its, MIN(ite,ide-1)
+    !	grid%therm_inert(i,j) = config_flags%init_TI 
+    !ENDDO
+    !ENDDO
+  grid%therm_inert = grid%therm_inert*0. + config_flags%init_TI 
+  print *, 'constant thermal inertia ', config_flags%init_TI
+
+ENDIF
+
+IF (config_flags%init_AL .ne. 0.) THEN
+
+  grid%albedo_gcm = grid%albedo_gcm*0. + config_flags%init_AL
+  print *, 'constant albedo ', config_flags%init_AL
+
+ENDIF
+
+IF (config_flags%init_U .ne. 0.) THEN
+
+  grid%em_u_gc = grid%em_u_gc*0. + config_flags%init_U
+  print *, 'constant zonal wind ', config_flags%init_U
+
+ENDIF
+
+IF (config_flags%init_V .ne. 0.) THEN
+
+  grid%em_v_gc = grid%em_v_gc*0. + config_flags%init_V
+  print *, 'constant meridional wind ', config_flags%init_V
+
+ENDIF
+
+IF ( (config_flags%init_WX .ne. 0) .and. (config_flags%init_WY .ne. 0) )  THEN
+
+  DO j = jts, MIN(jte,jde-1)
+  DO i = its, MIN(ite,ide-1)
+	grid%em_u_gc(i,:,j)=grid%em_u_gc(config_flags%init_WX,:,config_flags%init_WY)	! zonal wind
+	grid%em_v_gc(i,:,j)=grid%em_v_gc(config_flags%init_WX,:,config_flags%init_WY)	! meridional wind
+  ENDDO
+  ENDDO
+  !! FIX for the STAGGERED SPECIFICITY
+  grid%em_u_gc(MIN(ite,ide-1)+1,:,:)=grid%em_u_gc(MIN(ite,ide-1),:,:)
+  grid%em_v_gc(:,:,MIN(jte,jde-1)+1)=grid%em_v_gc(:,:,MIN(jte,jde-1))	
+
+  !! CHECK
+  print *, 'wind profile'
+  print *, 'took at ...', config_flags%init_WX, config_flags%init_WY 
+  print *, '--zonal'
+  print *, grid%em_u_gc(config_flags%init_WX,:,config_flags%init_WY)
+  print *, '--meridional'
+  print *, grid%em_v_gc(config_flags%init_WX,:,config_flags%init_WY)
+
+ENDIF
+
+IF (config_flags%init_MU .ne. 0.) THEN
+
+  grid%em_u_gc = grid%em_u_gc*config_flags%init_MU
+  print *, 'multiply zonal wind ', config_flags%init_MU
+
+ENDIF
+
+IF (config_flags%init_MV .ne. 0.) THEN
+
+  grid%em_v_gc = grid%em_v_gc*config_flags%init_MV
+  print *, 'multiply meridional wind ', config_flags%init_MV
+
+ENDIF
+
+IF (config_flags%init_LES) THEN
+
+	print *, '*** LES MODE ***'
+	print *, 'setting uniform values and profiles'
+        print *, 'u', grid%em_u_gc(its+1,:,jts+1)
+        print *, 'v', grid%em_v_gc(its+1,:,jts+1)
+        print *, 't', grid%em_t_gc(its+1,:,jts+1)
+        print *, 'p', grid%em_rh_gc(its+1,:,jts+1)
+        print *, 'geop', grid%em_ght_gc(its+1,:,jts+1)
+        print *, 'albedo', grid%albedo_gcm(its+1,jts+1)
+        print *, 'thermal inertia', grid%therm_inert(its+1,jts+1)
+        print *, 'topography', grid%ht(its+1,jts+1)
+        print *, 'toposoil', grid%toposoil(its+1,jts+1)
+        print *, 'surface temperature', grid%tsk(its+1,jts+1)
+        print *, 'surface pressure', grid%psfc(its+1,jts+1), grid%em_psfc_gc(its+1,jts+1)
+
+        DO j = jts, MIN(jte,jde-1)
+         DO i = its, MIN(ite,ide-1)
+                grid%em_u_gc(i,:,j)=grid%em_u_gc(its+1,:,jts+1)
+                grid%em_v_gc(i,:,j)=grid%em_v_gc(its+1,:,jts+1)
+                grid%em_t_gc(i,:,j)=grid%em_t_gc(its+1,:,jts+1)
+                grid%em_rh_gc(i,:,j)=grid%em_rh_gc(its+1,:,jts+1)
+                grid%em_ght_gc(i,:,j) = grid%em_ght_gc(its+1,:,jts+1)
+grid%albedo_gcm(i,j) = grid%albedo_gcm(its+1,jts+1)
+grid%therm_inert(i,j) = grid%therm_inert(its+1,jts+1)
+                grid%ht(i,j) = grid%ht(its+1,jts+1)
+                grid%toposoil(i,j) = grid%toposoil(its+1,jts+1)
+                grid%tsk(i,j) = grid%tsk(its+1,jts+1)
+                grid%psfc(i,j) = grid%psfc(its+1,jts+1)
+                grid%em_psfc_gc(i,j) = grid%em_psfc_gc(its+1,jts+1)
+grid%slpx(i,j) = 0.
+grid%slpy(i,j) = 0.
+grid%mars_emiss(i,j) = 0.95
+grid%mars_cice(i,j) = 0.
+grid%mars_tsoil(i,:,j)=grid%mars_tsoil(its+1,:,jts+1)
+
+
+!! T.Michaels trick to break symmetry
+CALL RANDOM_NUMBER(randnum)
+grid%em_t_gc(i,1,j)=grid%em_t_gc(its+1,1,jts+1) + 0.1*2.*(0.5-randnum)
+CALL RANDOM_NUMBER(randnum)
+grid%em_t_gc(i,2,j)=grid%em_t_gc(its+1,2,jts+1) + 0.1*2.*(0.5-randnum)
+!CALL RANDOM_NUMBER(randnum)
+!grid%em_t_gc(i,3,j)=grid%em_t_gc(its+1,3,jts+1) + 0.1*2.*(0.5-randnum)
+!CALL RANDOM_NUMBER(randnum)
+!grid%em_t_gc(i,4,j)=grid%em_t_gc(its+1,4,jts+1) + 0.1*2.*(0.5-randnum)
+!CALL RANDOM_NUMBER(randnum)
+!grid%em_t_gc(i,5,j)=grid%em_t_gc(its+1,5,jts+1) + 0.1*2.*(0.5-randnum)
+
+
+         ENDDO
+         ENDDO
+
+ENDIF
+
+
+
+!!!!!!!!!!!!!!!!!!!
+!!! READ PROFILE !!
+!!!!!!!!!!!!!!!!!!!
+!
+!open(unit=10,file='input_sounding',form='formatted',status='old')
+!rewind(10)
+!read(10,*) grid%em_u_gc(1,:,1)
+!!****MARS
+!!
+!! case with idealized topography
+!!
+!!CALL ideal_topo ( grid%ht , 2000., 6., &
+!CALL ideal_topo ( grid%ht , 2000., 3., &
+!           ids , ide , jds , jde , kds , kde , &
+!           ims , ime , jms , jme , kms , kme , &
+!           its , ite , jts , jte , kts , kte )
+!!****MARS
+
+
+
+
+         !  If we have any input low-res surface pressure, we store it.
+
+!!****MARS
+!!fix pour être certain d'être avec les bons flag
+print *,flag_psfc
+print *,flag_soilhgt
+print *,flag_metgrid
+
+flag_psfc=1
+flag_soilhgt=1
+flag_metgrid=1
+!!**** TODO: trouver quand même pourquoi ça donne 0 :)
+pa=999999.
+!!****MARS
+
+         IF ( flag_psfc .EQ. 1 ) THEN
+            DO j = jts, MIN(jte,jde-1)
+              DO i = its, MIN(ite,ide-1)
+                 grid%em_psfc_gc(i,j) = grid%psfc(i,j)
+!!!****MARS: em_p_gc is only a way to count vertical levels in WPS :)
+!!!****MARS: is filled here with real pressure levels
+grid%em_p_gc(i,:,j) = grid%em_rh_gc(i,:,j)
+!!!****MARS
+                 grid%em_p_gc(i,1,j) = grid%psfc(i,j)
+!!!****MARS
+IF (pa .gt. grid%em_p_gc(i,1,j)) pa=grid%em_p_gc(i,1,j)
+!!!****MARS
+              END DO
+            END DO
+         END IF
+print *, 'found minimum pressure (Pa) :',pa
+
+
+!!!!****MARS
+!!!!****MARS
+!!!! define new hybrid coordinate levels
+!!!! with transition level between sigma and pressure
+!!!! lower than input data
+!
+!
+!        !--get vertical size of the GCM input array
+!        sizegcm=SIZE(grid%em_rh_gc(1,:,1))
+!        ALLOCATE(sig(MIN(ite,ide-1)-its+1,sizegcm, MIN(jte,jde-1)-jts+1))
+!        ALLOCATE(ap(MIN(ite,ide-1)-its+1,sizegcm, MIN(jte,jde-1)-jts+1))
+!        ALLOCATE(bp(MIN(ite,ide-1)-its+1,sizegcm, MIN(jte,jde-1)-jts+1))
+!        !ALLOCATE(box(MIN(ite,ide-1)-its+1,sizegcm, MIN(jte,jde-1)-jts+1))
+!
+!
+!
+!        !--define sigma levels, 
+!        !--then derive new sigma levels, and new pressure levels
+!        DO j = jts, MIN(jte,jde-1)
+!          DO i = its, MIN(ite,ide-1)
+!
+!                ! old sigma levels
+!                sig(i,:,j)=grid%em_p_gc(i,:,j)/grid%em_psfc_gc(i,j)
+!!                sig(i,:,j)=grid%em_p_gc(20,:,20)/grid%em_psfc_gc(20,20)
+!                ! new pressure levels
+!                ! - pressure_new = ap_new + bp_new * ps_gcm
+!                ! - bp_new is converging more rapidly than bp
+!                !   ... while conserving the same structure near the surface
+!                !
+!                ! NB: grid%zap_close_levels ne sert pas dans vert_interp_old :)
+!                ! NB: peut donc servir pour préciser une constante reelle
+!                ! NB: qui permet de rehausser la zone de transition
+!                !
+!                bp(i,:,j)=sqrt(sqrt(exp(1.-1./(sig(i,:,j)**4))))
+!                ap(i,:,j)=pa*exp(-grid%zap_close_levels/10.)*(sig(i,:,j)-bp(i,:,j))
+!                grid%em_rh_gc(i,:,j)=ap(i,:,j)+bp(i,:,j)*grid%em_psfc_gc(i,j)
+!
+!                ! avoid extrapolation at the top 
+!                ! -- the last level is thus unsignificant
+!                grid%em_p_gc(i,sizegcm,j)=grid%em_p_gc(i,sizegcm,j)/100.
+!!                grid%em_p_gc(i,sizegcm,j)=grid%em_p_gc(i,sizegcm,j)/10000.
+!
+!          ENDDO
+!        ENDDO
+!
+!
+!
+!
+!        !-- check that the biggest differences are higher
+!        print *, 'sigma levels'
+!        print *, sig(its+1,:,jts+1)
+!        print *, 'old pressure levels'
+!        print *, grid%em_p_gc(its+1,:,jts+1)
+!        print *, 'new pressure levels'
+!        print *, grid%em_rh_gc(its+1,:,jts+1)
+!
+!!print *, 't_gc', SIZE(grid%em_t_gc(1,:,1))
+!!print *, 'p_gc', SIZE(grid%em_p_gc(1,:,1))
+!!print *, 't_2', SIZE(grid%em_t_2(1,:,1))
+!!print *, 'rh_gc', SIZE(grid%em_rh_gc(1,:,1))
+!
+!
+!!--------
+!!-- interpolate on the new pressure levels
+!!--------
+!
+!        DO j = jts, MIN(jte,jde-1)
+!          DO i = its, MIN(ite,ide-1)
+!
+!DO knew = 1,sizegcm     ! loop on each level of the new grid
+!
+!        DO kold = 1,sizegcm-1   ! find the two enclosing levels
+!
+!                ! indic becomes negative when the two levels are found
+!                indic=(grid%em_p_gc(i,kold,j)-grid%em_rh_gc(i,knew,j))&
+!                        *(grid%em_p_gc(i,kold+1,j)-grid%em_rh_gc(i,knew,j))
+!
+!                ! 1. the two levels are found - define p1,p2,pn and exit the loop
+!                IF (indic < 0.) THEN 
+!                        !IF ((i == its) .AND. (j == jts)) THEN   !just a check
+!                        !        print *, 'new level', grid%em_rh_gc(i,knew,j)
+!                        !        print *, 'interp levels', grid%em_p_gc(i,kold,j), &
+!                        !                grid%em_p_gc(i,kold+1,j)
+!                        !ENDIF
+!                p1 = ALOG(grid%em_p_gc(i,kold,j))
+!                p2 = ALOG(grid%em_p_gc(i,kold+1,j))
+!                pn = ALOG(grid%em_rh_gc(i,knew,j))
+!                EXIT
+!
+!                ! 2. must handle the case (usually close to the surface) 
+!                ! of similar new/old levels - then exit with the right kold value
+!                ELSE IF (1-abs(grid%em_rh_gc(i,knew,j)/grid%em_p_gc(i,kold,j)) .lt. 1e-8) THEN
+!                        !print *,grid%em_p_gc(i,kold,j),grid%em_rh_gc(i,knew,j)  
+!                EXIT
+!                ELSE IF (1-abs(grid%em_rh_gc(i,knew,j)/grid%em_p_gc(i,kold+1,j)) .lt. 1e-8) THEN
+!                        !print *,grid%em_p_gc(i,kold+1,j),grid%em_rh_gc(i,knew,j)
+!                        kold=kold+1
+!                EXIT
+!
+!                ! 3. continue looping if the two levels are not found ....
+!                ENDIF 
+!        ENDDO
+!
+!        ! this is an initialization, useful for case 2 (and erased just below if case 1)
+!        grid%em_t_2(i,knew,j)= grid%em_t_gc(i,kold,j)
+!        grid%em_u_2(i,knew,j)= grid%em_u_gc(i,kold,j)
+!        grid%em_v_2(i,knew,j)= grid%em_v_gc(i,kold,j)
+!
+!        ! case 1: OK, in the previous loop, the two levels were found, and stored in p1 and p2
+!        ! ... thus interpolation can be performed
+!        IF (indic < 0.) THEN
+!        grid%em_t_2(i,knew,j)= ( grid%em_t_gc(i,kold,j) * ( p2 - pn )   + &
+!                                 grid%em_t_gc(i,kold+1,j) * ( pn - p1 ) ) / &
+!                                 ( p2 - p1 )
+!        grid%em_u_2(i,knew,j)= ( grid%em_u_gc(i,kold,j) * ( p2 - pn )   + &
+!                                 grid%em_u_gc(i,kold+1,j) * ( pn - p1 ) ) / &
+!                                 ( p2 - p1 )
+!        grid%em_v_2(i,knew,j)= ( grid%em_v_gc(i,kold,j) * ( p2 - pn )   + &
+!                                 grid%em_v_gc(i,kold+1,j) * ( pn - p1 ) ) / &
+!                                 ( p2 - p1 )
+!        ENDIF
+!
+!
+!ENDDO
+!
+!          ENDDO
+!        ENDDO
+!grid%em_u_2(MIN(ite,ide-1)+1,:,:)=grid%em_u_2(MIN(ite,ide-1),:,:)
+!grid%em_v_2(:,:,MIN(jte,jde-1)+1)=grid%em_v_2(:,:,MIN(jte,jde-1))
+!!--------
+!!-- end - interpolate on the new pressure levels
+!!--------
+
+
+!        !-- interpolate on the new pressure levels
+!        CALL vert_interp_old ( grid%em_t_gc , &         ! --- interpolate this field
+!                               grid%em_p_gc, &          ! --- with coordinates
+!                               grid%em_t_2, &           ! --- to obtain the new field
+!                               grid%em_rh_gc, &         ! --- on coordinates
+!                               sizegcm, &
+!                               'T', &           ! --- no staggering (will be done later)
+!                               2, &             ! --- log p interpolation   
+!                               1, &             ! --- (0) lagrange_order
+!                               .false., &       ! --- (0) lowest_lev_from_sfc
+!                               0., &            ! --- (0) zap_close_levels
+!                               0, &             ! --- (0) force_sfc_in_vinterp
+!                               ids , ide , jds , jde , kds , kde , &
+!                               ims , ime , jms , jme , kms , kme , &
+!                               its , ite , jts , jte , kts , kte )
+!        CALL vert_interp_old ( grid%em_u_gc , &         ! --- interpolate this field
+!                               grid%em_p_gc, &          ! --- with coordinates
+!                               grid%em_u_2 , &          ! --- to obtain the new field
+!                               grid%em_rh_gc, &         ! --- on coordinates
+!                               sizegcm, &
+!                               'U', &           ! --- no staggering (will be done later)
+!                               2, &             ! --- log p interpolation
+!                               1, &             ! --- (0) lagrange_order
+!                               .false., &       ! --- (0) lowest_lev_from_sfc
+!                               0., &            ! --- (0) zap_close_levels
+!                               0, &             ! --- (0) force_sfc_in_vinterp
+!                               ids , ide , jds , jde , kds , kde , &
+!                               ims , ime , jms , jme , kms , kme , &
+!                               its , ite , jts , jte , kts , kte )
+!        CALL vert_interp_old ( grid%em_v_gc , &         ! --- interpolate this field
+!                               grid%em_p_gc, &          ! --- with coordinates
+!                               grid%em_v_2 , &          ! --- to obtain the new field
+!                               grid%em_rh_gc, &         ! --- on coordinates
+!                               sizegcm, &
+!                               'V', &           ! --- no staggering (will be done later)
+!                               2, &             ! --- log p interpolation
+!                               1, &             ! --- (0) lagrange_order
+!                               .false., &       ! --- (0) lowest_lev_from_sfc
+!                               0., &            ! --- (0) zap_close_levels
+!                               0, &             ! --- (0) force_sfc_in_vinterp
+!                               !ids , ide , jds , jde , kds , sizegcm , &
+!                               !ims , ime , jms , jme , kms , sizegcm , &
+!                               !its , ite , jts , jte , kts , sizegcm )
+!                               ids , ide , jds , jde , kds , kde , &
+!                               ims , ime , jms , jme , kms , kme , &
+!                               its , ite , jts , jte , kts , kte )
+!
+!
+!        !-- save the new field and the new pressure coordinates
+!        !-- these will be regarded now as the inputs from the GCM
+!        grid%em_t_gc=grid%em_t_2
+!        grid%em_t_2(:,:,:)=0.
+!        grid%em_u_gc=grid%em_u_2
+!        grid%em_u_2(:,:,:)=0.
+!        grid%em_v_gc=grid%em_v_2
+!        grid%em_v_2(:,:,:)=0.
+!        grid%em_p_gc=grid%em_rh_gc      
+!        grid%em_rh_gc(:,:,:)=0.
+!!!!****MARS
+!!!****MARS
+
+
+
+
+         !  If we have the low-resolution surface elevation, stick that in the
+         !  "input" locations of the 3d height.  We still have the "hi-res" topo
+         !  stuck in the grid%em_ht array.  The grid%landmask if test is required as some sources
+         !  have ZERO elevation over water (thank you very much).
+
+         IF ( flag_soilhgt .EQ. 1) THEN
+            DO j = jts, MIN(jte,jde-1)
+               DO i = its, MIN(ite,ide-1)
+                  IF ( grid%landmask(i,j) .GT. 0.5 ) THEN
+                     grid%em_ght_gc(i,1,j) = grid%toposoil(i,j)
+                     grid%em_ht_gc(i,j)= grid%toposoil(i,j)
+                  END IF
+               END DO
+           END DO
+         END IF
+
+         !  Assign surface fields with original input values.  If this is hybrid data, 
+         !  the values are not exactly representative.  However - this is only for
+         !  plotting purposes and such at the 0h of the forecast, so we are not all that
+         !  worried.
+
+!****MARS
+!         DO j = jts, min(jde-1,jte)
+!            DO i = its, min(ide,ite)
+!               grid%u10(i,j)=grid%em_u_gc(i,1,j)
+!            END DO
+!         END DO
+!   
+!         DO j = jts, min(jde,jte)
+!            DO i = its, min(ide-1,ite)
+!               grid%v10(i,j)=grid%em_v_gc(i,1,j)
+!            END DO
+!         END DO
+!****MARS   
+
+!         DO j = jts, min(jde-1,jte)
+!            DO i = its, min(ide-1,ite)
+!               grid%t2(i,j)=grid%em_t_gc(i,1,j)
+!            END DO
+!         END DO
+
+  
+         !  The number of vertical levels in the input data.  There is no staggering for
+         !  different variables.
+   
+         num_metgrid_levels = grid%num_metgrid_levels
+
+         !  The requested ptop for real data cases.
+
+         p_top_requested = grid%p_top_requested
+
+         !  Compute the top pressure, grid%p_top.  For isobaric data, this is just the
+         !  top level.  For the generalized vertical coordinate data, we find the
+         !  max pressure on the top level.  We have to be careful of two things:
+         !  1) the value has to be communicated, 2) the value can not increase
+         !  at subsequent times from the initial value.
+
+         IF ( internal_time_loop .EQ. 1 ) THEN
+
+                CALL find_p_top ( grid%em_p_gc , grid%p_top , &
+                              ids , ide , jds , jde , 1   , num_metgrid_levels , &
+                              ims , ime , jms , jme , 1   , num_metgrid_levels , &
+                              its , ite , jts , jte , 1   , num_metgrid_levels )
+
+!! ^---- equivalent to:
+!!grid%ptop=MINVAL(grid%em_p_gc(:,:,:))
+
+
+
+!!!!obsolete
+!print *,'ptop GCM',grid%em_rh_gc(2,1,2)
+!IF (grid%em_rh_gc(2,1,2) == 0) THEN
+!        print *,'ptop cannot be 0' 
+!        stop        
+!ENDIF  
+!grid%p_top=grid%em_rh_gc(2,1,2)
+!!!!obsolete
+
+
+#ifdef DM_PARALLEL
+            grid%p_top = wrf_dm_max_real ( grid%p_top )
+#endif
+
+            !  Compare the requested grid%p_top with the value available from the input data.
+
+               print *,'p_top_requested = ',p_top_requested
+               print *,'allowable grid%p_top in data   = ',grid%p_top
+            IF ( p_top_requested .LT. grid%p_top ) THEN   
+               CALL wrf_error_fatal ( 'p_top_requested < grid%p_top possible from data' )
+            END IF
+
+            !  The grid%p_top valus is the max of what is available from the data and the
+            !  requested value.  We have already compared <, so grid%p_top is directly set to
+            !  the value in the namelist.
+
+            grid%p_top = p_top_requested
+
+            !  For subsequent times, we have to remember what the grid%p_top for the first
+            !  time was.  Why?  If we have a generalized vert coordinate, the grid%p_top value
+            !  could fluctuate.
+
+            p_top_save = grid%p_top
+
+         ELSE
+            CALL find_p_top ( grid%em_p_gc , grid%p_top , &
+                              ids , ide , jds , jde , 1   , num_metgrid_levels , &
+                              ims , ime , jms , jme , 1   , num_metgrid_levels , &
+                              its , ite , jts , jte , 1   , num_metgrid_levels )
+
+#ifdef DM_PARALLEL
+            grid%p_top = wrf_dm_max_real ( grid%p_top )
+#endif
+            IF ( grid%p_top .GT. p_top_save ) THEN
+               print *,'grid%p_top from last time period = ',p_top_save
+               print *,'grid%p_top from this time period = ',grid%p_top
+               CALL wrf_error_fatal ( 'grid%p_top > previous value' )
+            END IF
+            grid%p_top = p_top_save
+         ENDIF
+
+
+!****MARS
+!****MARS
+print *,'ptop GCM', grid%p_top
+print *,'sample: pressure at its jts'
+print *,grid%em_p_gc(its,:,jts)
+!****MARS
+!****MARS
+
+  
+
+!****MARS: useless 
+!****MARS: 
+!         !  Get the monthly values interpolated to the current date for the traditional monthly
+!         !  fields of green-ness fraction and background albedo.
+!   
+!         CALL monthly_interp_to_date ( grid%em_greenfrac , current_date , grid%vegfra , &
+!                                       ids , ide , jds , jde , kds , kde , &
+!                                       ims , ime , jms , jme , kms , kme , &
+!                                       its , ite , jts , jte , kts , kte )
+!  
+!         CALL monthly_interp_to_date ( grid%em_albedo12m , current_date , grid%albbck , &
+!                                       ids , ide , jds , jde , kds , kde , &
+!                                       ims , ime , jms , jme , kms , kme , &
+!                                       its , ite , jts , jte , kts , kte )
+!   
+!         !  Get the min/max of each i,j for the monthly green-ness fraction.
+!   
+!         CALL monthly_min_max ( grid%em_greenfrac , grid%shdmin , grid%shdmax , &
+!                                ids , ide , jds , jde , kds , kde , &
+!                                ims , ime , jms , jme , kms , kme , &
+!                                its , ite , jts , jte , kts , kte )
+!
+!          !  The model expects the green-ness values in percent, not fraction.
+!
+!         DO j = jts, MIN(jte,jde-1)
+!           DO i = its, MIN(ite,ide-1)
+!              grid%vegfra(i,j) = grid%vegfra(i,j) * 100.
+!              grid%shdmax(i,j) = grid%shdmax(i,j) * 100.
+!              grid%shdmin(i,j) = grid%shdmin(i,j) * 100.
+!           END DO
+!         END DO
+!
+!         !  The model expects the albedo fields as a fraction, not a percent.  Set the
+!         !  water values to 8%.
+!
+!         DO j = jts, MIN(jte,jde-1)
+!           DO i = its, MIN(ite,ide-1)   
+!		grid%albbck(i,j) = grid%albbck(i,j) / 100.
+!              grid%snoalb(i,j) = grid%snoalb(i,j) / 100.
+!              IF ( grid%landmask(i,j) .LT. 0.5 ) THEN
+!                 grid%albbck(i,j) = 0.08
+!                 grid%snoalb(i,j) = 0.08
+!              END IF
+!           END DO
+!         END DO
+!!****MARS:
+!!****MARS: useless 
+
+
+ 
+
+!!****MARS:  
+!         !  Compute the mixing ratio from the input relative humidity.
+!   
+!         IF ( flag_qv .NE. 1 ) THEN
+!            CALL rh_to_mxrat (grid%em_rh_gc, grid%em_t_gc, grid%em_p_gc, grid%em_qv_gc , .TRUE. , &
+!                              ids , ide , jds , jde , 1   , num_metgrid_levels , &
+!                              ims , ime , jms , jme , 1   , num_metgrid_levels , &
+!                              its , ite , jts , jte , 1   , num_metgrid_levels )
+!         END IF
+!!****MARS:
+!!grid%em_rh_gc are GCM equivalent eta_levels
+!!****MARS
+
+
+
+
+         !  Two ways to get the surface pressure.  1) If we have the low-res input surface
+         !  pressure and the low-res topography, then we can do a simple hydrostatic
+         !  relation.  2) Otherwise we compute the surface pressure from the sea-level
+         !  pressure.
+         !  Note that on output, grid%em_psfc is now hi-res.  The low-res surface pressure and 
+         !  elevation are grid%em_psfc_gc and grid%em_ht_gc (same as grid%em_ght_gc(k=1)).
+
+!!****MARS: switch off this option 
+!!****MARS: --> cf sfcprs2 and geopotential function at 500mb
+!         IF ( config_flags%adjust_heights ) THEN
+!            we_have_tavgsfc = ( flag_tavgsfc == 1 ) 
+!         ELSE
+!            we_have_tavgsfc = .FALSE.
+!         END IF
+!****MARS:
+we_have_tavgsfc = .FALSE.
+
+
+
+!****MARS: hi-res psfc is done if the flag 'sfcp_to_sfcp' is active (recommended)
+         IF ( ( flag_psfc .EQ. 1 ) .AND. ( flag_soilhgt .EQ. 1 ) .AND. &
+              ( config_flags%sfcp_to_sfcp ) ) THEN
+            print *,'compute psfc from hi-res topography'
+            CALL sfcprs2(grid%em_t_gc, grid%em_qv_gc, grid%em_ght_gc, grid%em_psfc_gc, grid%ht, &
+                         grid%em_tavgsfc, grid%em_p_gc, grid%psfc, we_have_tavgsfc, &
+                         ids , ide , jds , jde , 1   , num_metgrid_levels , &
+                         ims , ime , jms , jme , 1   , num_metgrid_levels , &
+                         its , ite , jts , jte , 1   , num_metgrid_levels )
+                         !****MARS: here, in reality, grid%em_p_gc is not used
+
+!****MARS: no sea-level pressure inputs possible
+!         ELSE
+!            CALL sfcprs (grid%em_t_gc, grid%em_qv_gc, grid%em_ght_gc, grid%em_pslv_gc, grid%ht, &
+!                         grid%em_tavgsfc, grid%em_p_gc, grid%psfc, we_have_tavgsfc, &
+!                         ids , ide , jds , jde , 1   , num_metgrid_levels , &
+!                         ims , ime , jms , jme , 1   , num_metgrid_levels , &
+!                         its , ite , jts , jte , 1   , num_metgrid_levels )
+!****MARS: no sea-level pressure inputs possible
+
+ 
+            !  If we have no input surface pressure, we'd better stick something in there.
+
+            IF ( flag_psfc .NE. 1 ) THEN
+               DO j = jts, MIN(jte,jde-1)
+                 DO i = its, MIN(ite,ide-1)
+                    grid%em_psfc_gc(i,j) = grid%psfc(i,j)
+                    grid%em_p_gc(i,1,j) = grid%psfc(i,j)
+                 END DO
+               END DO
+            END IF
+
+         END IF
+
+
+!!!****MARS: 
+!!!****MARS: old stuff
+!!! grid%em_p_gc is needed ... so it is computed from eta_gcm
+!
+!print *,'computing pressure levels for input data...'
+!
+!        !! pressure is computed from eta_gcm and hi-res topography
+!        DO j = jts, MIN(jte,jde-1)
+!        DO i = its, MIN(ite,ide-1)  
+!!!psfc ou em_psfc_gc ? em_psfc_gc, sinon c'est faux et déclenche instabilités 
+!grid%em_p_gc(i,:,j)=grid%em_rh_gc(i,:,j)*(grid%em_psfc_gc(i,j)-grid%em_rh_gc(2,1,2))+grid%em_rh_gc(2,1,2)
+!grid%em_p_gc(i,1,j)=grid%em_psfc_gc(i,j)
+!
+!
+!        END DO
+!        END DO
+!!
+!!****MARS: 
+
+
+
+         !!  Integrate the mixing ratio to get the vapor pressure.
+         !
+         !CALL integ_moist ( grid%em_qv_gc , grid%em_p_gc , grid%em_pd_gc , grid%em_t_gc , grid%em_ght_gc , grid%em_intq_gc , &
+         !                   ids , ide , jds , jde , 1   , num_metgrid_levels , &
+         !                   ims , ime , jms , jme , 1   , num_metgrid_levels , &
+         !                   its , ite , jts , jte , 1   , num_metgrid_levels )
+
+
+!!****MARS
+!!****MARS
+!! and now, convert the GCM sigma levels into WRF sigma levels using hi-res surface pressure 
+!!DO j = jts , MIN ( jde-1 , jte )
+!!DO i = its , MIN (ide-1 , ite )
+!!
+!!   grid%em_pd_gc(i,:,j)=ap(i,:,j)+bp(i,:,j)*grid%psfc(i,j)
+!!
+!!END DO
+!!END DO
+
+
+!--get vertical size of the GCM input array and allocate new stuff
+sizegcm=SIZE(grid%em_rh_gc(1,:,1))
+ALLOCATE(sig(MIN(ite,ide-1)-its+1,sizegcm, MIN(jte,jde-1)-jts+1))
+!ALLOCATE(ap(MIN(ite,ide-1)-its+1,sizegcm, MIN(jte,jde-1)-jts+1))
+ALLOCATE(bp(MIN(ite,ide-1)-its+1,sizegcm, MIN(jte,jde-1)-jts+1))
+
+DO j = jts , MIN ( jde-1 , jte )
+DO i = its , MIN (ide-1 , ite )
+
+!!! Define old sigma levels for each column
+        sig(i,:,j)=grid%em_p_gc(i,:,j)/grid%em_psfc_gc(i,j)
+
+!!! Compute new sigma levels from old sigma levels with GCM (low-res) and WRF (hi-res) surface pressure 
+!!!                        (dimlevs,sigma_gcm, ps_gcm,                ps_hr,         sigma_hr)
+        CALL build_sigma_hr(sizegcm,sig(i,:,j),grid%em_psfc_gc(i,j),grid%psfc(i,j),bp(i,:,j))
+
+!!! Calculate new pressure levels
+        grid%em_pd_gc(i,:,j)=bp(i,:,j)*grid%psfc(i,j)
+
+END DO
+END DO
+
+DEALLOCATE(sig)
+DEALLOCATE(bp)
+
+
+!!****MARS
+!grid%em_pd_gc=grid%em_p_gc
+!!****MARS
+
+
+
+   
+         !!  Compute the difference between the dry, total surface pressure (input) and the 
+         !!  dry top pressure (constant).
+         !
+         !CALL p_dts ( grid%em_mu0 , grid%em_intq_gc , grid%psfc , grid%p_top , &
+         !             ids , ide , jds , jde , 1   , num_metgrid_levels , &
+         !             ims , ime , jms , jme , 1   , num_metgrid_levels , &
+         !             its , ite , jts , jte , 1   , num_metgrid_levels )
+
+!!****MARS
+DO j = jts , MIN ( jde-1 , jte )
+DO i = its , MIN (ide-1 , ite )
+
+   grid%em_mu0(i,j) = grid%psfc(i,j) - grid%p_top
+
+END DO
+END DO
+!!****MARS
+
+   
+         !!  Compute the dry, hydrostatic surface pressure.
+         !
+         !CALL p_dhs ( grid%em_pdhs , grid%ht , p00 , t00 , a , &
+         !             ids , ide , jds , jde , kds , kde , &
+         !             ims , ime , jms , jme , kms , kme , &
+         !             its , ite , jts , jte , kts , kte )
+!!****MARS: voir remarques dans la routine
+!!****MARS: dry hydrostatic pressure comes from the GCM ...
+!        DO j = jts , MIN ( jde-1 , jte )
+!        DO i = its , MIN (ide-1 , ite )
+!              grid%em_pdhs(i,j) = grid%psfc(i,j)
+!        END DO
+!      	 END DO
+!!****MARS: em_pdhs ne sert qu'ici !         
+
+   
+         !  Compute the eta levels if not defined already.
+
+!!TODO: pb when ptop<1Pa
+         
+         IF ( grid%em_znw(1) .NE. 1.0 ) THEN
+   
+            eta_levels(1:kde) = model_config_rec%eta_levels(1:kde)
+            max_dz            = model_config_rec%max_dz
+
+!!****MARS
+IF (grid%force_sfc_in_vinterp == 0) grid%force_sfc_in_vinterp = 8
+!!default choice
+!!****MARS
+
+            CALL compute_eta ( grid%em_znw , &
+                               eta_levels , max_eta , max_dz , &
+grid%force_sfc_in_vinterp, &    !!ne sert pas par ailleurs
+                               grid%p_top , g , p00 , cvpm , a , r_d , cp , t00 , p1000mb , t0 , &
+                               ids , ide , jds , jde , kds , kde , &
+                               ims , ime , jms , jme , kms , kme , &
+                               its , ite , jts , jte , kts , kte )
+         END IF
+   
+         !  The input field is temperature, we want potential temp.
+!****MARS: here em_p_gc is really needed ! 
+         CALL t_to_theta ( grid%em_t_gc , grid%em_p_gc , p00 , &
+                           ids , ide , jds , jde , 1   , num_metgrid_levels , &
+                           ims , ime , jms , jme , 1   , num_metgrid_levels , &
+                           its , ite , jts , jte , 1   , num_metgrid_levels )
+   
+
+
+         !  On the eta surfaces, compute the dry pressure = mu eta, stored in 
+         !  grid%em_pb, since it is a pressure, and we don't need another kms:kme 3d
+         !  array floating around.  The grid%em_pb array is re-computed as the base pressure
+         !  later after the vertical interpolations are complete.
+         CALL p_dry ( grid%em_mu0 , grid%em_znw , grid%p_top , grid%em_pb , &
+                      ids , ide , jds , jde , kds , kde , &
+                      ims , ime , jms , jme , kms , kme , &
+                      its , ite , jts , jte , kts , kte )
+
+print *, 'test sample' 
+print *, grid%em_pb(its+10,:,jts+10)
+print *, 'test sample 2' 
+print *, grid%em_pb(its,:,jts)
+
+
+!****MARS
+!****MARS: old stuff
+!****MARS
+!!! and now eta levels from the GCM are computed with the WRF ptop and GCM psfc
+!!! and em_pb is filled with WRF eta levels to prepare interpolation
+!print *,'computing eta levels for input data...'
+!        DO j = jts, MIN(jte,jde-1)
+!        DO i = its, MIN(ite,ide-1)
+!
+!!grid%em_psfc_gc: pb en haut!!!!
+!!!!valeurs plus grandes que 1 et extrapolation
+!!grid%em_p_gc(i,:,j)=(grid%em_p_gc(i,:,j)-grid%p_top)/(grid%psfc(i,j)-grid%p_top)
+!!!!utile si l'on est proche de la surface, mais pb plus haut !
+!grid%em_p_gc(i,:,j)=(grid%em_p_gc(i,:,j)-grid%p_top)/(grid%em_psfc_gc(i,j)-grid%p_top)
+!grid%em_pb(i,:,j)=grid%em_znw(:)
+!
+!!
+!!!!manage negative values
+!!DO k=1,num_metgrid_levels
+!!        grid%em_p_gc(i,k,j)=MAX(0.,grid%em_p_gc(i,k,j))
+!!END DO
+!!
+!
+!        END DO
+!        END DO
+!!
+!!print *,'sample: eta GCM at its jts'
+!!print *,grid%em_p_gc(its,:,jts)
+!!print *,'sample: eta WRF at its jts'
+!!print *,grid%em_pb(its,:,jts)
+!!
+!!print *,grid%em_p_gc(:,2,:)
+!!print *, 'yeah yeah'
+!!grid%em_pd_gc(:,:,:)=grid%em_p_gc(:,:,:)
+!!
+!****MARS
+!****MARS: old stuff
+!****MARS
+
+
+
+
+         !  All of the vertical interpolations are done in dry-pressure space.  The
+         !  input data has had the moisture removed (grid%em_pd_gc).  The target levels (grid%em_pb)
+         !  had the vapor pressure removed from the surface pressure, then they were
+         !  scaled by the eta levels.
+
+         interp_type = grid%interp_type
+         lagrange_order = grid%lagrange_order
+         lowest_lev_from_sfc = grid%lowest_lev_from_sfc
+         zap_close_levels = grid%zap_close_levels
+         force_sfc_in_vinterp = grid%force_sfc_in_vinterp
+
+         !!****MARS: normalement c'est vert_interp
+         !!****MARS: mais les résultats sont trop discontinus > retour à une
+         !!****MARS: interpolation plus classique
+         CALL vert_interp_old ( grid%em_qv_gc , grid%em_pd_gc , moist(:,:,:,P_QV) , grid%em_pb , &
+                            num_metgrid_levels , 'Q' , &
+                            interp_type , lagrange_order , lowest_lev_from_sfc , &
+                            zap_close_levels , force_sfc_in_vinterp , &
+                            ids , ide , jds , jde , kds , kde , &
+                            ims , ime , jms , jme , kms , kme , &
+                            its , ite , jts , jte , kts , kte )
+ 
+         !!****MARS: normalement c'est vert_interp
+         CALL vert_interp_old ( grid%em_t_gc , grid%em_pd_gc , grid%em_t_2               , grid%em_pb , &
+                            num_metgrid_levels , 'T' , &
+                            interp_type , lagrange_order , lowest_lev_from_sfc , &
+                            zap_close_levels , force_sfc_in_vinterp , &
+                            ids , ide , jds , jde , kds , kde , &
+                            ims , ime , jms , jme , kms , kme , &
+                            its , ite , jts , jte , kts , kte )
+
+if (config_flags%mars == 1) then
+!if (size(scalar(0,0,0,:)) > 2) then
+!! autre possibilite: activer les flags dans metgrid.tbl
+!!
+!! pour l'instant les indices sont indiqués en dur en attendant plus souple
+!!
+!!
+
+        print *, '**** WATER CYCLE ON ****' 
+        !print *, size(scalar(0,0,0,:)), P_QH2O, P_QH2O_ICE
+
+        
+        !!****MARS: initialization for water cycle
+        !!****MARS:
+        !!****MARS: -- note that -real.F was modified to include GCM QH2O boundary conditions
+        !!****MARS: 		 -qvapor was not used to avoid any terrestrial calculations in WRF unsuitable for Mars
+        !!****MARS:		 -any change and/or modification of variables has to be recorded in the Registry
+        !!****MARS:
+        !CALL vert_interp_old ( grid%em_hv_gc , grid%em_pd_gc , scalar(:,:,:,P_QH2O) , grid%em_pb , &
+        CALL vert_interp_old ( grid%em_hv_gc , grid%em_pd_gc , scalar(:,:,:,2) , grid%em_pb , &
+                                    num_metgrid_levels , 'Q' , &
+                                    interp_type , lagrange_order , lowest_lev_from_sfc , &
+                                    zap_close_levels , force_sfc_in_vinterp , &
+                                    ids , ide , jds , jde , kds , kde , &
+                                    ims , ime , jms , jme , kms , kme , &
+                                    its , ite , jts , jte , kts , kte )
+        !CALL vert_interp_old ( grid%em_hi_gc , grid%em_pd_gc , scalar(:,:,:,P_QH2O_ICE) , grid%em_pb , &
+        CALL vert_interp_old ( grid%em_hi_gc , grid%em_pd_gc , scalar(:,:,:,3) , grid%em_pb , &
+                                    num_metgrid_levels , 'Q' , &
+                                    interp_type , lagrange_order , lowest_lev_from_sfc , &
+                                    zap_close_levels , force_sfc_in_vinterp , &
+                                    ids , ide , jds , jde , kds , kde , &
+                                    ims , ime , jms , jme , kms , kme , &
+                                    its , ite , jts , jte , kts , kte )
+        !!****MARS:
+
+endif
+
+#if 0
+         !  Uncomment the Registry entries to activate these.  This adds
+         !  noticeably to the allocated space for the model.
+
+         IF ( flag_qr .EQ. 1 ) THEN
+            DO im = PARAM_FIRST_SCALAR, num_3d_m
+               IF ( im .EQ. P_QR ) THEN
+                  CALL vert_interp_old ( qr_gc , grid%em_pd_gc , moist(:,:,:,P_QR) , grid%em_pb , &
+                                     num_metgrid_levels , 'Q' , &
+                                     interp_type , lagrange_order , lowest_lev_from_sfc , &
+                                     zap_close_levels , force_sfc_in_vinterp , &
+                                     ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte )
+               END IF
+            END DO
+         END IF
+    
+         IF ( flag_qc .EQ. 1 ) THEN
+            DO im = PARAM_FIRST_SCALAR, num_3d_m
+               IF ( im .EQ. P_QC ) THEN
+                  CALL vert_interp_old ( qc_gc , grid%em_pd_gc , moist(:,:,:,P_QC) , grid%em_pb , &
+                                     num_metgrid_levels , 'Q' , &
+                                     interp_type , lagrange_order , lowest_lev_from_sfc , &
+                                     zap_close_levels , force_sfc_in_vinterp , &
+                                     ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte )
+               END IF
+            END DO
+         END IF
+   
+         IF ( flag_qi .EQ. 1 ) THEN
+            DO im = PARAM_FIRST_SCALAR, num_3d_m
+               IF ( im .EQ. P_QI ) THEN
+                  CALL vert_interp_old ( qi_gc , grid%em_pd_gc , moist(:,:,:,P_QI) , grid%em_pb , &
+                                     num_metgrid_levels , 'Q' , &
+                                     interp_type , lagrange_order , lowest_lev_from_sfc , &
+                                     zap_close_levels , force_sfc_in_vinterp , &
+                                     ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte )
+               END IF
+            END DO
+         END IF
+   
+         IF ( flag_qs .EQ. 1 ) THEN
+            DO im = PARAM_FIRST_SCALAR, num_3d_m
+               IF ( im .EQ. P_QS ) THEN
+                  CALL vert_interp_old ( qs_gc , grid%em_pd_gc , moist(:,:,:,P_QS) , grid%em_pb , &
+                                     num_metgrid_levels , 'Q' , &
+                                     interp_type , lagrange_order , lowest_lev_from_sfc , &
+                                     zap_close_levels , force_sfc_in_vinterp , &
+                                     ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte )
+               END IF
+            END DO
+         END IF
+   
+         IF ( flag_qg .EQ. 1 ) THEN
+            DO im = PARAM_FIRST_SCALAR, num_3d_m
+               IF ( im .EQ. P_QG ) THEN
+                  CALL vert_interp_old ( qg_gc , grid%em_pd_gc , moist(:,:,:,P_QG) , grid%em_pb , &
+                                     num_metgrid_levels , 'Q' , &
+                                     interp_type , lagrange_order , lowest_lev_from_sfc , &
+                                     zap_close_levels , force_sfc_in_vinterp , &
+                                     ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte )
+               END IF
+            END DO
+         END IF
+#endif
+   
+#ifdef DM_PARALLEL
+         ips = its ; ipe = ite ; jps = jts ; jpe = jte ; kps = kts ; kpe = kte
+
+         !  For the U and V vertical interpolation, we need the pressure defined
+         !  at both the locations for the horizontal momentum, which we get by
+         !  averaging two pressure values (i and i-1 for U, j and j-1 for V).  The
+         !  pressure field on input (grid%em_pd_gc) and the pressure of the new coordinate
+         !  (grid%em_pb) are both communicated with an 8 stencil.
+
+#   include "HALO_EM_VINTERP_UV_1.inc"
+#endif
+
+        !!****MARS: normalement c'est vert_interp
+        CALL vert_interp_old ( grid%em_u_gc , grid%em_pd_gc , grid%em_u_2, grid%em_pb , &
+                            num_metgrid_levels , 'U' , &
+                            interp_type , lagrange_order , lowest_lev_from_sfc , &
+                            zap_close_levels , force_sfc_in_vinterp , &
+                            ids , ide , jds , jde , kds , kde , &
+                            ims , ime , jms , jme , kms , kme , &
+                            its , ite , jts , jte , kts , kte )
+        !!****MARS: normalement c'est vert_interp   
+        CALL vert_interp_old ( grid%em_v_gc , grid%em_pd_gc , grid%em_v_2, grid%em_pb , &
+                        num_metgrid_levels , 'V' , &
+                            interp_type , lagrange_order , lowest_lev_from_sfc , &
+                            zap_close_levels , force_sfc_in_vinterp , &
+                            ids , ide , jds , jde , kds , kde , &
+                            ims , ime , jms , jme , kms , kme , &
+                            its , ite , jts , jte , kts , kte )
+
+
+!!****MARS
+!!****MARS
+!!
+!! old obsolete method
+!! -------------------
+!!
+!!! and now eta levels from the GCM are computed with the WRF ptop and GCM psfc
+!!! and em_pb is filled with WRF eta levels to prepare interpolation
+!print *,'computing eta levels for input data...'
+!
+!        DO j = jts, MIN(jte,jde-1)
+!        DO i = its, MIN(ite,ide-1)
+!
+!!       grid%em_psfc_gc: pb en haut!!!!
+!!!!valeurs plus grandes que 1 et extrapolation
+!!       grid%em_p_gc(i,:,j)=(grid%em_p_gc(i,:,j)-grid%p_top)/(grid%psfc(i,j)-grid%p_top)
+!!!!utile si l'on est proche de la surface, mais pb plus haut !
+!grid%em_pd_gc(i,:,j)=(grid%em_p_gc(i,:,j)-grid%p_top)/(grid%em_psfc_gc(i,j)-grid%p_top)
+!grid%em_pb(i,:,j)=grid%em_znw(:)
+!
+!!
+!!!!manage negative values
+!!DO k=1,num_metgrid_levels
+!!        grid%em_p_gc(i,k,j)=MAX(0.,grid%em_p_gc(i,k,j))
+!!END DO
+!!
+!
+!        END DO
+!        END DO
+!
+!print *,'sample: eta GCM at its jts'
+!print *,grid%em_pd_gc(its,:,jts)
+!print *,'sample: eta WRF at its jts'
+!print *,grid%em_pb(its,:,jts)
+!!
+!!!****MARS
+!
+!
+!
+!!!!****MARS
+!!!!
+!!!!grid%force_sfc_in_vinterp ne sert pas dans vert_interp_old :)
+!!!!peut donc servir pour préciser le nombre de niveaux
+!!!!pris à partir de l'interpolation eta
+!
+!IF (grid%force_sfc_in_vinterp .NE. 0) THEN
+!
+!         !!!save in an array that is now unused
+!         !!!the previously performed pressure interpolation
+!         grid%em_qv_gc(:,:,:)=grid%em_t_2(:,:,:)
+!
+!
+!         !!!perform interpolation on eta levels
+!         print *, 'interpolate on eta levels for near-surface fields' 
+!         CALL vert_interp_old ( grid%em_t_gc , grid%em_pd_gc , grid%em_t_2, grid%em_pb , &
+!                            num_metgrid_levels , 'T' , &
+!                            interp_type , lagrange_order , lowest_lev_from_sfc ,&
+!                            zap_close_levels , force_sfc_in_vinterp , &
+!                            ids , ide , jds , jde , kds , kde , &
+!                            ims , ime , jms , jme , kms , kme , &
+!                            its , ite , jts , jte , kts , kte )
+!
+!         !!!take the first layers from the eta interpolation
+!         print *, 'the first ', &
+!                grid%force_sfc_in_vinterp, &
+!                'layers will be taken from eta interpolation'
+!         grid%em_qv_gc(:,1:grid%force_sfc_in_vinterp,:)=grid%em_t_2(:,1:grid%force_sfc_in_vinterp,:)
+!
+!         !!!fix the possible little discontinuity at the limit
+!         !!!between the two interpolation methods
+!         grid%em_qv_gc(:,grid%force_sfc_in_vinterp+1,:)=  &
+!                0.5*(grid%em_t_2(:,grid%force_sfc_in_vinterp,:) + &     !!eta interpolation below
+!                        grid%em_qv_gc(:,grid%force_sfc_in_vinterp+2,:))  !!pressure interpolation above
+!         
+!
+!         !!!assign the final result in t_2
+!         grid%em_t_2(:,:,:)=grid%em_qv_gc(:,:,:)
+!         grid%em_qv_gc(:,:,:)=0.
+!
+!
+!ELSE
+!
+!
+!ENDIF
+!!****MARS
+!!****MARS
+
+
+      END IF     !   <----- END OF VERTICAL INTERPOLATION PART ---->
+
+
+
+!****MARS: no need
+!      !  Protect against bad grid%em_tsk values over water by supplying grid%sst (if it is 
+!      !  available, and if the grid%sst is reasonable).
+!
+!      DO j = jts, MIN(jde-1,jte)
+!         DO i = its, MIN(ide-1,ite)
+!            IF ( ( grid%landmask(i,j) .LT. 0.5 ) .AND. ( flag_sst .EQ. 1 ) .AND. &
+!                 ( grid%sst(i,j) .GT. 200. ) .AND. ( grid%sst(i,j) .LT. 350. ) ) THEN
+!               grid%tsk(i,j) = grid%sst(i,j)
+!            ENDIF            
+!         END DO
+!      END DO
+!
+!      !  Save the grid%em_tsk field for later use in the sea ice surface temperature
+!      !  for the Noah LSM scheme.
+!
+!       DO j = jts, MIN(jte,jde-1)
+!         DO i = its, MIN(ite,ide-1)
+!            grid%tsk_save(i,j) = grid%tsk(i,j)
+!         END DO
+!      END DO
+!
+!!****MARS: no need
+!      !  Take the data from the input file and store it in the variables that
+!      !  use the WRF naming and ordering conventions.
+!
+!       DO j = jts, MIN(jte,jde-1)
+!         DO i = its, MIN(ite,ide-1)
+!            IF ( grid%snow(i,j) .GE. 10. ) then
+!               grid%snowc(i,j) = 1.
+!            ELSE
+!               grid%snowc(i,j) = 0.0
+!            END IF
+!         END DO
+!      END DO
+!
+!      !  Set flag integers for presence of snowh and soilw fields
+!
+!      grid%ifndsnowh = flag_snowh
+!      IF (num_sw_levels_input .GE. 1) THEN
+!         grid%ifndsoilw = 1
+!      ELSE
+!         grid%ifndsoilw = 0
+!      END IF
+!
+!****MARS: no need
+!      !  We require input data for the various LSM schemes.
+!
+!      enough_data : SELECT CASE ( model_config_rec%sf_surface_physics(grid%id) )
+!
+!         CASE (LSMSCHEME)
+!            IF ( num_st_levels_input .LT. 2 ) THEN
+!               CALL wrf_error_fatal ( 'Not enough soil temperature data for Noah LSM scheme.')
+!            END IF
+!
+!         CASE (RUCLSMSCHEME)
+!            IF ( num_st_levels_input .LT. 2 ) THEN
+!               CALL wrf_error_fatal ( 'Not enough soil temperature data for RUC LSM scheme.')
+!            END IF
+!
+!      END SELECT enough_data
+!
+!      !  For sf_surface_physics = 1, we want to use close to a 30 cm value
+!      !  for the bottom level of the soil temps.
+!
+!      fix_bottom_level_for_temp : SELECT CASE ( model_config_rec%sf_surface_physics(grid%id) )
+!
+!         CASE (SLABSCHEME)
+!            IF      ( flag_tavgsfc  .EQ. 1 ) THEN
+!               DO j = jts , MIN(jde-1,jte)
+!                  DO i = its , MIN(ide-1,ite)
+!                     grid%tmn(i,j) = grid%em_tavgsfc(i,j)
+!                  END DO
+!               END DO
+!            ELSE IF ( flag_st010040 .EQ. 1 ) THEN
+!               DO j = jts , MIN(jde-1,jte)
+!                  DO i = its , MIN(ide-1,ite)
+!                     grid%tmn(i,j) = grid%st010040(i,j)
+!                  END DO
+!               END DO
+!            ELSE IF ( flag_st000010 .EQ. 1 ) THEN
+!               DO j = jts , MIN(jde-1,jte)
+!                  DO i = its , MIN(ide-1,ite)
+!                     grid%tmn(i,j) = grid%st000010(i,j)
+!                  END DO
+!               END DO
+!            ELSE IF ( flag_soilt020 .EQ. 1 ) THEN
+!               DO j = jts , MIN(jde-1,jte)
+!                  DO i = its , MIN(ide-1,ite)
+!                     grid%tmn(i,j) = grid%soilt020(i,j)
+!                  END DO
+!               END DO
+!            ELSE IF ( flag_st007028 .EQ. 1 ) THEN
+!               DO j = jts , MIN(jde-1,jte)
+!                  DO i = its , MIN(ide-1,ite)
+!                     grid%tmn(i,j) = grid%st007028(i,j)
+!                  END DO
+!               END DO
+!            ELSE
+!               CALL wrf_debug ( 0 , 'No 10-40 cm, 0-10 cm, 7-28, or 20 cm soil temperature data for grid%em_tmn')
+!               CALL wrf_debug ( 0 , 'Using 1 degree static annual mean temps' )
+!            END IF
+!
+!         CASE (LSMSCHEME)
+!
+!         CASE (RUCLSMSCHEME)
+!
+!      END SELECT fix_bottom_level_for_temp
+!
+!      !  Adjustments for the seaice field PRIOR to the grid%tslb computations.  This is
+!      !  is for the 5-layer scheme.
+!
+!      num_veg_cat      = SIZE ( grid%landusef , DIM=2 )
+!      num_soil_top_cat = SIZE ( grid%soilctop , DIM=2 )
+!      num_soil_bot_cat = SIZE ( grid%soilcbot , DIM=2 )
+!      CALL nl_get_seaice_threshold ( grid%id , grid%seaice_threshold ) 
+!      CALL nl_get_isice ( grid%id , grid%isice )
+!      CALL nl_get_iswater ( grid%id , grid%iswater )
+!      CALL adjust_for_seaice_pre ( grid%xice , grid%landmask , grid%tsk , grid%ivgtyp , grid%vegcat , grid%lu_index , &
+!                                   grid%xland , grid%landusef , grid%isltyp , grid%soilcat , grid%soilctop , &
+!                                   grid%soilcbot , grid%tmn , &
+!                                   grid%seaice_threshold , &
+!                                   num_veg_cat , num_soil_top_cat , num_soil_bot_cat , &
+!                                   grid%iswater , grid%isice , &
+!                                   model_config_rec%sf_surface_physics(grid%id) , & 
+!                                   ids , ide , jds , jde , kds , kde , & 
+!                                   ims , ime , jms , jme , kms , kme , & 
+!                                   its , ite , jts , jte , kts , kte ) 
+!
+!      !  surface_input_source=1 => use data from static file (fractional category as input)
+!      !  surface_input_source=2 => use data from grib file (dominant category as input)
+!  
+!      IF ( config_flags%surface_input_source .EQ. 1 ) THEN
+!         grid%vegcat (its,jts) = 0
+!         grid%soilcat(its,jts) = 0
+!      END IF
+!
+!      !  Generate the vegetation and soil category information from the fractional input
+!      !  data, or use the existing dominant category fields if they exist.
+!
+!      IF ( ( grid%soilcat(its,jts) .LT. 0.5 ) .AND. ( grid%vegcat(its,jts) .LT. 0.5 ) ) THEN
+!
+!         num_veg_cat      = SIZE ( grid%landusef , DIM=2 )
+!         num_soil_top_cat = SIZE ( grid%soilctop , DIM=2 )
+!         num_soil_bot_cat = SIZE ( grid%soilcbot , DIM=2 )
+!   
+!         CALL process_percent_cat_new ( grid%landmask , &               
+!                                    grid%landusef , grid%soilctop , grid%soilcbot , &
+!                                    grid%isltyp , grid%ivgtyp , &
+!                                    num_veg_cat , num_soil_top_cat , num_soil_bot_cat , &
+!                                    ids , ide , jds , jde , kds , kde , &
+!                                    ims , ime , jms , jme , kms , kme , &
+!                                    its , ite , jts , jte , kts , kte , &
+!                                    model_config_rec%iswater(grid%id) )
+!
+!         !  Make all the veg/soil parms the same so as not to confuse the developer.
+!
+!         DO j = jts , MIN(jde-1,jte)
+!            DO i = its , MIN(ide-1,ite)
+!               grid%vegcat(i,j)  = grid%ivgtyp(i,j)
+!               grid%soilcat(i,j) = grid%isltyp(i,j)
+!            END DO
+!         END DO
+!
+!      ELSE
+!
+!         !  Do we have dominant soil and veg data from the input already?
+!   
+!         IF ( grid%soilcat(its,jts) .GT. 0.5 ) THEN
+!            DO j = jts, MIN(jde-1,jte)
+!               DO i = its, MIN(ide-1,ite)
+!                  grid%isltyp(i,j) = NINT( grid%soilcat(i,j) )
+!               END DO
+!            END DO
+!         END IF
+!         IF ( grid%vegcat(its,jts) .GT. 0.5 ) THEN
+!            DO j = jts, MIN(jde-1,jte)
+!               DO i = its, MIN(ide-1,ite)
+!                  grid%ivgtyp(i,j) = NINT( grid%vegcat(i,j) )
+!               END DO
+!            END DO
+!         END IF
+!
+!      END IF
+!         
+!      !  Land use assignment.
+!
+!      DO j = jts, MIN(jde-1,jte)
+!         DO i = its, MIN(ide-1,ite)
+!            grid%lu_index(i,j) = grid%ivgtyp(i,j)
+!            IF ( grid%lu_index(i,j) .NE. model_config_rec%iswater(grid%id) ) THEN
+!               grid%landmask(i,j) = 1
+!               grid%xland(i,j)    = 1
+!            ELSE
+!               grid%landmask(i,j) = 0
+!               grid%xland(i,j)    = 2
+!            END IF
+!         END DO
+!      END DO
+!
+!      !  Adjust the various soil temperature values depending on the difference in
+!      !  in elevation between the current model's elevation and the incoming data's
+!      !  orography.
+!         
+!      IF ( flag_soilhgt .EQ. 1 ) THEN
+!         adjust_soil : SELECT CASE ( model_config_rec%sf_surface_physics(grid%id) )
+!
+!            CASE ( SLABSCHEME , LSMSCHEME , RUCLSMSCHEME )
+!               CALL adjust_soil_temp_new ( grid%tmn , model_config_rec%sf_surface_physics(grid%id) , &
+!                                           grid%tsk , grid%ht , grid%toposoil , grid%landmask , flag_soilhgt , &
+!                                           grid%st000010 , grid%st010040 , grid%st040100 , grid%st100200 , grid%st010200 , &
+!                                           flag_st000010 , flag_st010040 , flag_st040100 , flag_st100200 , flag_st010200 , &
+!                                           grid%st000007 , grid%st007028 , grid%st028100 , grid%st100255 , &
+!                                           flag_st000007 , flag_st007028 , flag_st028100 , flag_st100255 , &
+!                                           grid%soilt000 , grid%soilt005 , grid%soilt020 , grid%soilt040 , grid%soilt160 , &
+!                                           grid%soilt300 , &
+!                                           flag_soilt000 , flag_soilt005 , flag_soilt020 , flag_soilt040 , &
+!                                           flag_soilt160 , flag_soilt300 , &
+!                                           ids , ide , jds , jde , kds , kde , &
+!                                           ims , ime , jms , jme , kms , kme , &
+!                                           its , ite , jts , jte , kts , kte )
+!
+!         END SELECT adjust_soil
+!      END IF
+!
+!      !  Fix grid%em_tmn and grid%em_tsk.
+!
+!      fix_tsk_tmn : SELECT CASE ( model_config_rec%sf_surface_physics(grid%id) )
+!
+!         CASE ( SLABSCHEME , LSMSCHEME , RUCLSMSCHEME )
+!            DO j = jts, MIN(jde-1,jte)
+!               DO i = its, MIN(ide-1,ite)
+!                  IF ( ( grid%landmask(i,j) .LT. 0.5 ) .AND. ( flag_sst .EQ. 1 ) .AND. &
+!                       ( grid%sst(i,j) .GT. 240. ) .AND. ( grid%sst(i,j) .LT. 350. ) ) THEN
+!                     grid%tmn(i,j) = grid%sst(i,j)
+!                     grid%tsk(i,j) = grid%sst(i,j)
+!                  ELSE IF ( grid%landmask(i,j) .LT. 0.5 ) THEN
+!                     grid%tmn(i,j) = grid%tsk(i,j)
+!                  END IF
+!               END DO
+!            END DO
+!      END SELECT fix_tsk_tmn
+!    
+!      !  Is the grid%em_tsk reasonable?
+!
+
+
+!!**** MARS
+         DO j = jts, MIN(jde-1,jte)
+            DO i = its, MIN(ide-1,ite)
+                !!grid%tsk(i,j)=200
+                grid%tmn(i,j)=0  
+                grid%sst(i,j)=0  !!no use on Mars!!
+                grid%tslb(i,:,j)=0  !!tslb is 3D field 
+               END DO
+            END DO
+!!**** MARS
+
+!      IF ( internal_time_loop .NE. 1 ) THEN
+!         DO j = jts, MIN(jde-1,jte)
+!            DO i = its, MIN(ide-1,ite)
+!               IF ( grid%tsk(i,j) .LT. 170 .or. grid%tsk(i,j) .GT. 400. ) THEN
+!                  grid%tsk(i,j) = grid%em_t_2(i,1,j)
+!               END IF
+!            END DO
+!         END DO
+!      ELSE
+!         DO j = jts, MIN(jde-1,jte)
+!            DO i = its, MIN(ide-1,ite)
+!               IF ( grid%tsk(i,j) .LT. 170 .or. grid%tsk(i,j) .GT. 400. ) THEN
+!                  print *,'error in the grid%em_tsk'
+!                  print *,'i,j=',i,j
+!                  print *,'grid%landmask=',grid%landmask(i,j)
+!                  print *,'grid%tsk, grid%sst, grid%tmn=',grid%tsk(i,j),grid%sst(i,j),grid%tmn(i,j)
+!                  if(grid%tmn(i,j).gt.170. .and. grid%tmn(i,j).lt.400.)then
+!                     grid%tsk(i,j)=grid%tmn(i,j)
+!                  else if(grid%sst(i,j).gt.170. .and. grid%sst(i,j).lt.400.)then
+!                     grid%tsk(i,j)=grid%sst(i,j)
+!                  else
+!                     CALL wrf_error_fatal ( 'grid%em_tsk unreasonable' )
+!                  end if
+!               END IF
+!            END DO
+!         END DO
+!      END IF
+!
+!      !  Is the grid%em_tmn reasonable?
+!
+!      DO j = jts, MIN(jde-1,jte)
+!         DO i = its, MIN(ide-1,ite)
+!            IF ( ( ( grid%tmn(i,j) .LT. 170. ) .OR. ( grid%tmn(i,j) .GT. 400. ) ) &
+!               .AND. ( grid%landmask(i,j) .GT. 0.5 ) ) THEN
+!               IF ( model_config_rec%sf_surface_physics(grid%id) .NE. LSMSCHEME ) THEN
+!                  print *,'error in the grid%em_tmn'
+!                  print *,'i,j=',i,j
+!                  print *,'grid%landmask=',grid%landmask(i,j)
+!                  print *,'grid%tsk, grid%sst, grid%tmn=',grid%tsk(i,j),grid%sst(i,j),grid%tmn(i,j)
+!               END IF
+!
+!               if(grid%tsk(i,j).gt.170. .and. grid%tsk(i,j).lt.400.)then
+!                  grid%tmn(i,j)=grid%tsk(i,j)
+!               else if(grid%sst(i,j).gt.170. .and. grid%sst(i,j).lt.400.)then
+!                  grid%tmn(i,j)=grid%sst(i,j)
+!               else
+!                  CALL wrf_error_fatal ( 'grid%em_tmn unreasonable' )
+!               endif
+!            END IF
+!         END DO
+!      END DO
+!   
+!      interpolate_soil_tmw : SELECT CASE ( model_config_rec%sf_surface_physics(grid%id) )
+!
+!         CASE ( SLABSCHEME , LSMSCHEME , RUCLSMSCHEME )
+!            CALL process_soil_real ( grid%tsk , grid%tmn , &
+!                                  grid%landmask , grid%sst , &
+!                                  st_input , sm_input , sw_input , st_levels_input , sm_levels_input , sw_levels_input , &
+!                                  grid%zs , grid%dzs , grid%tslb , grid%smois , grid%sh2o , &
+!                                  flag_sst , flag_soilt000, flag_soilm000, &
+!                                  ids , ide , jds , jde , kds , kde , &
+!                                  ims , ime , jms , jme , kms , kme , &
+!                                  its , ite , jts , jte , kts , kte , &
+!                                  model_config_rec%sf_surface_physics(grid%id) , &
+!                                  model_config_rec%num_soil_layers , &
+!                                  model_config_rec%real_data_init_type , &
+!                                  num_st_levels_input , num_sm_levels_input , num_sw_levels_input , &
+!                                  num_st_levels_alloc , num_sm_levels_alloc , num_sw_levels_alloc )
+!
+!      END SELECT interpolate_soil_tmw
+!
+!      !  Minimum soil values, residual, from RUC LSM scheme.  For input from Noah and using
+!      !  RUC LSM scheme, this must be subtracted from the input total soil moisture.  For
+!      !  input RUC data and using the Noah LSM scheme, this value must be added to the soil
+!      !  moisture input.
+!
+!      lqmi(1:num_soil_top_cat) = &
+!      (/0.045, 0.057, 0.065, 0.067, 0.034, 0.078, 0.10,     &
+!        0.089, 0.095, 0.10,  0.070, 0.068, 0.078, 0.0,      &
+!        0.004, 0.065 /)
+!!       0.004, 0.065, 0.020, 0.004, 0.008 /)  !  has extra levels for playa, lava, and white sand
+!
+!      !  At the initial time we care about values of soil moisture and temperature, other times are
+!      !  ignored by the model, so we ignore them, too.  
+!
+!      IF ( domain_ClockIsStartTime(grid) ) THEN
+!         account_for_zero_soil_moisture : SELECT CASE ( model_config_rec%sf_surface_physics(grid%id) )
+!   
+!            CASE ( LSMSCHEME )
+!               iicount = 0
+!               IF      ( FLAG_SM000010 .EQ. 1 ) THEN
+!                  DO j = jts, MIN(jde-1,jte)
+!                     DO i = its, MIN(ide-1,ite)
+!                        IF ( (grid%landmask(i,j).gt.0.5) .and. ( grid%tslb(i,1,j) .gt. 200 ) .and. &
+!                             ( grid%tslb(i,1,j) .lt. 400 ) .and. ( grid%smois(i,1,j) .lt. 0.005 ) ) then
+!                           print *,'Noah -> Noah: bad soil moisture at i,j = ',i,j,grid%smois(i,:,j)
+!                           iicount = iicount + 1
+!                           grid%smois(i,:,j) = 0.005
+!                        END IF
+!                     END DO
+!                  END DO
+!                  IF ( iicount .GT. 0 ) THEN
+!                     print *,'Noah -> Noah: total number of small soil moisture locations = ',iicount
+!                  END IF
+!               ELSE IF ( FLAG_SOILM000 .EQ. 1 ) THEN
+!                  DO j = jts, MIN(jde-1,jte)
+!                     DO i = its, MIN(ide-1,ite)
+!                        grid%smois(i,:,j) = grid%smois(i,:,j) + lqmi(grid%isltyp(i,j))
+!                     END DO
+!                  END DO
+!                  DO j = jts, MIN(jde-1,jte)
+!                     DO i = its, MIN(ide-1,ite)
+!                        IF ( (grid%landmask(i,j).gt.0.5) .and. ( grid%tslb(i,1,j) .gt. 200 ) .and. &
+!                             ( grid%tslb(i,1,j) .lt. 400 ) .and. ( grid%smois(i,1,j) .lt. 0.005 ) ) then
+!                           print *,'RUC -> Noah: bad soil moisture at i,j = ',i,j,grid%smois(i,:,j)
+!                           iicount = iicount + 1
+!                           grid%smois(i,:,j) = 0.005
+!                        END IF
+!                     END DO
+!                  END DO
+!                  IF ( iicount .GT. 0 ) THEN
+!                     print *,'RUC -> Noah: total number of small soil moisture locations = ',iicount
+!                  END IF
+!               END IF
+!   
+!            CASE ( RUCLSMSCHEME )
+!               iicount = 0
+!               IF      ( FLAG_SM000010 .EQ. 1 ) THEN
+!                  DO j = jts, MIN(jde-1,jte)
+!                     DO i = its, MIN(ide-1,ite)
+!                        grid%smois(i,:,j) = MAX ( grid%smois(i,:,j) - lqmi(grid%isltyp(i,j)) , 0. )
+!                     END DO
+!                  END DO
+!               ELSE IF ( FLAG_SOILM000 .EQ. 1 ) THEN
+!                  ! no op
+!               END IF
+!   
+!         END SELECT account_for_zero_soil_moisture
+!      END IF
+!
+!      !  Is the grid%tslb reasonable?
+!
+!      IF ( internal_time_loop .NE. 1 ) THEN
+!         DO j = jts, MIN(jde-1,jte)
+!            DO ns = 1 , model_config_rec%num_soil_layers
+!               DO i = its, MIN(ide-1,ite)
+!                  IF ( grid%tslb(i,ns,j) .LT. 170 .or. grid%tslb(i,ns,j) .GT. 400. ) THEN
+!                     grid%tslb(i,ns,j) = grid%em_t_2(i,1,j)
+!                     grid%smois(i,ns,j) = 0.3
+!                  END IF
+!               END DO
+!            END DO
+!         END DO
+!      ELSE
+!         DO j = jts, MIN(jde-1,jte)
+!            DO i = its, MIN(ide-1,ite)
+!               IF ( ( ( grid%tslb(i,1,j) .LT. 170. ) .OR. ( grid%tslb(i,1,j) .GT. 400. ) ) .AND. &
+!                       ( grid%landmask(i,j) .GT. 0.5 ) ) THEN
+!                     IF ( ( model_config_rec%sf_surface_physics(grid%id) .NE. LSMSCHEME    ) .AND. &
+!                          ( model_config_rec%sf_surface_physics(grid%id) .NE. RUCLSMSCHEME ) ) THEN
+!                        print *,'error in the grid%tslb'
+!                        print *,'i,j=',i,j
+!                        print *,'grid%landmask=',grid%landmask(i,j)
+!                        print *,'grid%tsk, grid%sst, grid%tmn=',grid%tsk(i,j),grid%sst(i,j),grid%tmn(i,j)
+!                        print *,'grid%tslb = ',grid%tslb(i,:,j)
+!                        print *,'old grid%smois = ',grid%smois(i,:,j)
+!                        grid%smois(i,1,j) = 0.3
+!                        grid%smois(i,2,j) = 0.3
+!                        grid%smois(i,3,j) = 0.3
+!                        grid%smois(i,4,j) = 0.3
+!                     END IF
+!   
+!                     IF ( (grid%tsk(i,j).GT.170. .AND. grid%tsk(i,j).LT.400.) .AND. &
+!                          (grid%tmn(i,j).GT.170. .AND. grid%tmn(i,j).LT.400.) ) THEN
+!                        fake_soil_temp : SELECT CASE ( model_config_rec%sf_surface_physics(grid%id) )
+!                           CASE ( SLABSCHEME )
+!                              DO ns = 1 , model_config_rec%num_soil_layers
+!                                 grid%tslb(i,ns,j) = ( grid%tsk(i,j)*(3.0 - grid%zs(ns)) + &
+!                                                       grid%tmn(i,j)*(0.0 - grid%zs(ns)) ) /(3.0 - 0.0)
+!                              END DO
+!                           CASE ( LSMSCHEME , RUCLSMSCHEME )
+!                              CALL wrf_error_fatal ( 'Assigning constant soil moisture, bad idea')
+!                              DO ns = 1 , model_config_rec%num_soil_layers
+!                                 grid%tslb(i,ns,j) = ( grid%tsk(i,j)*(3.0 - grid%zs(ns)) + &
+!                                                       grid%tmn(i,j)*(0.0 - grid%zs(ns)) ) /(3.0 - 0.0)
+!                              END DO
+!                        END SELECT fake_soil_temp
+!                     else if(grid%tsk(i,j).gt.170. .and. grid%tsk(i,j).lt.400.)then
+!                        CALL wrf_error_fatal ( 'grid%tslb unreasonable 1' )
+!                        DO ns = 1 , model_config_rec%num_soil_layers
+!                           grid%tslb(i,ns,j)=grid%tsk(i,j)
+!                        END DO
+!                     else if(grid%sst(i,j).gt.170. .and. grid%sst(i,j).lt.400.)then
+!                        CALL wrf_error_fatal ( 'grid%tslb unreasonable 2' )
+!                        DO ns = 1 , model_config_rec%num_soil_layers
+!                           grid%tslb(i,ns,j)=grid%sst(i,j)
+!                        END DO
+!                     else if(grid%tmn(i,j).gt.170. .and. grid%tmn(i,j).lt.400.)then
+!                        CALL wrf_error_fatal ( 'grid%tslb unreasonable 3' )
+!                        DO ns = 1 , model_config_rec%num_soil_layers
+!                           grid%tslb(i,ns,j)=grid%tmn(i,j)
+!                        END DO
+!                     else
+!                        CALL wrf_error_fatal ( 'grid%tslb unreasonable 4' )
+!                     endif
+!               END IF
+!            END DO
+!         END DO
+!      END IF
+!
+!      !  Adjustments for the seaice field AFTER the grid%tslb computations.  This is
+!      !  is for the Noah LSM scheme.
+!
+!      num_veg_cat      = SIZE ( grid%landusef , DIM=2 )
+!      num_soil_top_cat = SIZE ( grid%soilctop , DIM=2 )
+!      num_soil_bot_cat = SIZE ( grid%soilcbot , DIM=2 )
+!      CALL nl_get_seaice_threshold ( grid%id , grid%seaice_threshold ) 
+!      CALL nl_get_isice ( grid%id , grid%isice )
+!      CALL nl_get_iswater ( grid%id , grid%iswater )
+!      CALL adjust_for_seaice_post ( grid%xice , grid%landmask , grid%tsk , grid%tsk_save , &
+!                                    grid%ivgtyp , grid%vegcat , grid%lu_index , &
+!                                    grid%xland , grid%landusef , grid%isltyp , grid%soilcat ,  &
+!                                    grid%soilctop , &
+!                                    grid%soilcbot , grid%tmn , grid%vegfra , &
+!                                    grid%tslb , grid%smois , grid%sh2o , &
+!                                    grid%seaice_threshold , &
+!                                    num_veg_cat , num_soil_top_cat , num_soil_bot_cat , &
+!                                    model_config_rec%num_soil_layers , &
+!                                    grid%iswater , grid%isice , &
+!                                    model_config_rec%sf_surface_physics(grid%id) , & 
+!                                    ids , ide , jds , jde , kds , kde , & 
+!                                    ims , ime , jms , jme , kms , kme , & 
+!                                    its , ite , jts , jte , kts , kte ) 
+!
+!      !  Let us make sure (again) that the grid%landmask and the veg/soil categories match.
+!
+!oops1=0
+!oops2=0
+!      DO j = jts, MIN(jde-1,jte)
+!         DO i = its, MIN(ide-1,ite)
+!            IF ( ( ( grid%landmask(i,j) .LT. 0.5 ) .AND. &
+!                   ( grid%ivgtyp(i,j) .NE. config_flags%iswater .OR. grid%isltyp(i,j) .NE. 14 ) ) .OR. &
+!                 ( ( grid%landmask(i,j) .GT. 0.5 ) .AND. &
+!                   ( grid%ivgtyp(i,j) .EQ. config_flags%iswater .OR. grid%isltyp(i,j) .EQ. 14 ) ) ) THEN
+!               IF ( grid%tslb(i,1,j) .GT. 1. ) THEN
+!oops1=oops1+1
+!                  grid%ivgtyp(i,j) = 5
+!                  grid%isltyp(i,j) = 8
+!                  grid%landmask(i,j) = 1
+!                  grid%xland(i,j) = 1
+!               ELSE IF ( grid%sst(i,j) .GT. 1. ) THEN
+!oops2=oops2+1
+!                  grid%ivgtyp(i,j) = config_flags%iswater
+!                  grid%isltyp(i,j) = 14
+!                  grid%landmask(i,j) = 0
+!                  grid%xland(i,j) = 2
+!               ELSE
+!                  print *,'the grid%landmask and soil/veg cats do not match'
+!                  print *,'i,j=',i,j
+!                  print *,'grid%landmask=',grid%landmask(i,j)
+!                  print *,'grid%ivgtyp=',grid%ivgtyp(i,j)
+!                  print *,'grid%isltyp=',grid%isltyp(i,j)
+!                  print *,'iswater=', config_flags%iswater
+!                  print *,'grid%tslb=',grid%tslb(i,:,j)
+!                  print *,'grid%sst=',grid%sst(i,j)
+!                  CALL wrf_error_fatal ( 'mismatch_landmask_ivgtyp' )
+!               END IF
+!            END IF
+!         END DO
+!      END DO
+!if (oops1.gt.0) then
+!print *,'points artificially set to land : ',oops1
+!endif
+!if(oops2.gt.0) then
+!print *,'points artificially set to water: ',oops2
+!endif
+!! fill grid%sst array with grid%em_tsk if missing in real input (needed for time-varying grid%sst in wrf)
+!      DO j = jts, MIN(jde-1,jte)
+!         DO i = its, MIN(ide-1,ite)
+!           IF ( flag_sst .NE. 1 ) THEN
+!             grid%sst(i,j) = grid%tsk(i,j)
+!           ENDIF
+!         END DO
+!      END DO
+
+
+      !  From the full level data, we can get the half levels, reciprocals, and layer
+      !  thicknesses.  These are all defined at half level locations, so one less level.
+      !  We allow the vertical coordinate to *accidently* come in upside down.  We want
+      !  the first full level to be the ground surface.
+
+      !  Check whether grid%em_znw (full level) data are truly full levels. If not, we need to adjust them
+      !  to be full levels.
+      !  in this test, we check if grid%em_znw(1) is neither 0 nor 1 (within a tolerance of 10**-5)
+
+      were_bad = .false.
+      IF ( ( (grid%em_znw(1).LT.(1-1.E-5) ) .OR. ( grid%em_znw(1).GT.(1+1.E-5) ) ).AND. &
+           ( (grid%em_znw(1).LT.(0-1.E-5) ) .OR. ( grid%em_znw(1).GT.(0+1.E-5) ) ) ) THEN
+         were_bad = .true.
+         print *,'Your grid%em_znw input values are probably half-levels. '
+         print *,grid%em_znw
+         print *,'WRF expects grid%em_znw values to be full levels. '
+         print *,'Adjusting now to full levels...'
+         !  We want to ignore the first value if it's negative
+         IF (grid%em_znw(1).LT.0) THEN
+            grid%em_znw(1)=0
+         END IF
+         DO k=2,kde
+            grid%em_znw(k)=2*grid%em_znw(k)-grid%em_znw(k-1)
+         END DO
+      END IF
+
+      !  Let's check our changes
+
+      IF ( ( ( grid%em_znw(1) .LT. (1-1.E-5) ) .OR. ( grid%em_znw(1) .GT. (1+1.E-5) ) ).AND. &
+           ( ( grid%em_znw(1) .LT. (0-1.E-5) ) .OR. ( grid%em_znw(1) .GT. (0+1.E-5) ) ) ) THEN
+         print *,'The input grid%em_znw height values were half-levels or erroneous. '
+         print *,'Attempts to treat the values as half-levels and change them '
+         print *,'to valid full levels failed.'
+         CALL wrf_error_fatal("bad grid%em_znw values from input files")
+      ELSE IF ( were_bad ) THEN
+         print *,'...adjusted. grid%em_znw array now contains full eta level values. '
+      ENDIF
+
+      IF ( grid%em_znw(1) .LT. grid%em_znw(kde) ) THEN
+         DO k=1, kde/2
+            hold_znw = grid%em_znw(k)
+            grid%em_znw(k)=grid%em_znw(kde+1-k)
+            grid%em_znw(kde+1-k)=hold_znw
+         END DO
+      END IF
+
+      DO k=1, kde-1
+         grid%em_dnw(k) = grid%em_znw(k+1) - grid%em_znw(k)
+         grid%em_rdnw(k) = 1./grid%em_dnw(k)
+         grid%em_znu(k) = 0.5*(grid%em_znw(k+1)+grid%em_znw(k))
+      END DO
+
+      !  Now the same sort of computations with the half eta levels, even ANOTHER
+      !  level less than the one above.
+
+      DO k=2, kde-1
+         grid%em_dn(k) = 0.5*(grid%em_dnw(k)+grid%em_dnw(k-1))
+         grid%em_rdn(k) = 1./grid%em_dn(k)
+         grid%em_fnp(k) = .5* grid%em_dnw(k  )/grid%em_dn(k)
+         grid%em_fnm(k) = .5* grid%em_dnw(k-1)/grid%em_dn(k)
+      END DO
+
+      !  Scads of vertical coefficients.
+
+      cof1 = (2.*grid%em_dn(2)+grid%em_dn(3))/(grid%em_dn(2)+grid%em_dn(3))*grid%em_dnw(1)/grid%em_dn(2) 
+      cof2 =     grid%em_dn(2)        /(grid%em_dn(2)+grid%em_dn(3))*grid%em_dnw(1)/grid%em_dn(3) 
+
+      grid%cf1  = grid%em_fnp(2) + cof1
+      grid%cf2  = grid%em_fnm(2) - cof1 - cof2
+      grid%cf3  = cof2       
+
+      grid%cfn  = (.5*grid%em_dnw(kde-1)+grid%em_dn(kde-1))/grid%em_dn(kde-1)
+      grid%cfn1 = -.5*grid%em_dnw(kde-1)/grid%em_dn(kde-1)
+
+      !  Inverse grid distances.
+
+      grid%rdx = 1./config_flags%dx
+      grid%rdy = 1./config_flags%dy
+
+      !  Some of the many weird geopotential initializations that we'll see today: grid%em_ph0 is total, 
+      !  and grid%em_ph_2 is a perturbation from the base state geopotential.  We set the base geopotential 
+      !  at the lowest level to terrain elevation * gravity.
+
+      DO j=jts,jte
+         DO i=its,ite
+            grid%em_ph0(i,1,j) = grid%ht(i,j) * g
+            grid%em_ph_2(i,1,j) = 0.
+         END DO
+      END DO
+
+      !  Base state potential temperature and inverse density (alpha = 1/rho) from
+      !  the half eta levels and the base-profile surface pressure.  Compute 1/rho 
+      !  from equation of state.  The potential temperature is a perturbation from t0.
+
+      DO j = jts, MIN(jte,jde-1)
+         DO i = its, MIN(ite,ide-1)
+
+
+!****MARS         
+!TODO: etudier si une meilleure formule n'existe pas pour Mars
+!TODO: mais il s'agit juste d'un etat de base ...
+!****MARS
+            !  Base state pressure is a function of eta level and terrain, only, plus
+            !  the hand full of constants: p00 (sea level pressure, Pa), t00 (sea level
+            !  temperature, K), and A (temperature difference, from 1000 mb to 300 mb, K).
+
+!!****MARS
+!!ici il s'agit de definir un etat de base, de reference
+!!- on ne peut prendre le profil de temperature du modele
+!!  qui conduit a des instabilites
+!!      grid%em_t_init(i,k,j)=grid%em_t_2(i,k,j) - t0 est a eviter donc.
+!!- pour la pression de surface, aucune information
+!!  sur un profil de temperature variable et non equilibre
+!!  ne doit transparaitre
+!!      p_surf = grid%psfc(i,j) pourquoi pas ... mais t y est utilisee ...
+!!
+!!>> l'etat de base ne doit dependre "geographiquement" que de la topographie
+!!
+!!****MARS
+            p_surf = p00 * EXP ( -t00/a + ( (t00/a)**2 - 2.*g*grid%ht(i,j)/a/r_d ) **0.5 ) 
+
+            DO k = 1, kte-1
+               grid%em_php(i,k,j) = grid%em_znw(k)*(p_surf - grid%p_top) + grid%p_top ! temporary, full lev base pressure
+               grid%em_pb(i,k,j) = grid%em_znu(k)*(p_surf - grid%p_top) + grid%p_top
+!              temp = MAX ( 200., t00 + A*LOG(grid%em_pb(i,k,j)/p00) )
+               temp =             t00 + A*LOG(grid%em_pb(i,k,j)/p00)
+               grid%em_t_init(i,k,j) = temp*(p00/grid%em_pb(i,k,j))**(r_d/cp) - t0
+               grid%em_alb(i,k,j) = (r_d/p1000mb)*(grid%em_t_init(i,k,j)+t0)*(grid%em_pb(i,k,j)/p1000mb)**cvpm
+            END DO
+       
+            !  Base state mu is defined as base state surface pressure minus grid%p_top
+
+            grid%em_mub(i,j) = p_surf - grid%p_top
+       
+            !  Dry surface pressure is defined as the following (this mu is from the input file
+            !  computed from the dry pressure).  Here the dry pressure is just reconstituted.
+
+            pd_surf = grid%em_mu0(i,j) + grid%p_top
+
+            !  Integrate base geopotential, starting at terrain elevation.  This assures that 
+            !  the base state is in exact hydrostatic balance with respect to the model equations.
+            !  This field is on full levels.
+
+            grid%em_phb(i,1,j) = grid%ht(i,j) * g
+            DO k  = 2,kte
+               grid%em_phb(i,k,j) = grid%em_phb(i,k-1,j) - grid%em_dnw(k-1)*grid%em_mub(i,j)*grid%em_alb(i,k-1,j)
+            END DO
+         END DO
+      END DO
+
+      !  Fill in the outer rows and columns to allow us to be sloppy.
+
+      IF ( ite .EQ. ide ) THEN
+      i = ide
+      DO j = jts, MIN(jde-1,jte)
+         grid%em_mub(i,j) = grid%em_mub(i-1,j)
+         grid%em_mu_2(i,j) = grid%em_mu_2(i-1,j)
+         DO k = 1, kte-1
+            grid%em_pb(i,k,j) = grid%em_pb(i-1,k,j)
+            grid%em_t_init(i,k,j) = grid%em_t_init(i-1,k,j)
+            grid%em_alb(i,k,j) = grid%em_alb(i-1,k,j)
+         END DO
+         DO k = 1, kte
+            grid%em_phb(i,k,j) = grid%em_phb(i-1,k,j)
+         END DO
+      END DO
+      END IF
+
+      IF ( jte .EQ. jde ) THEN
+      j = jde
+      DO i = its, ite
+         grid%em_mub(i,j) = grid%em_mub(i,j-1)
+         grid%em_mu_2(i,j) = grid%em_mu_2(i,j-1)
+         DO k = 1, kte-1
+            grid%em_pb(i,k,j) = grid%em_pb(i,k,j-1)
+            grid%em_t_init(i,k,j) = grid%em_t_init(i,k,j-1)
+            grid%em_alb(i,k,j) = grid%em_alb(i,k,j-1)
+         END DO
+         DO k = 1, kte
+            grid%em_phb(i,k,j) = grid%em_phb(i,k,j-1)
+         END DO
+      END DO
+      END IF
+       
+      !  Compute the perturbation dry pressure (grid%em_mub + grid%em_mu_2 + ptop = dry grid%em_psfc).
+
+      DO j = jts, min(jde-1,jte)
+         DO i = its, min(ide-1,ite)
+            grid%em_mu_2(i,j) = grid%em_mu0(i,j) - grid%em_mub(i,j)
+         END DO
+      END DO
+
+      !  Fill in the outer rows and columns to allow us to be sloppy.
+
+      IF ( ite .EQ. ide ) THEN
+      i = ide
+      DO j = jts, MIN(jde-1,jte)
+         grid%em_mu_2(i,j) = grid%em_mu_2(i-1,j)
+      END DO
+      END IF
+
+      IF ( jte .EQ. jde ) THEN
+      j = jde
+      DO i = its, ite
+         grid%em_mu_2(i,j) = grid%em_mu_2(i,j-1)
+      END DO
+      END IF
+
+      lev500 = 0 
+      DO j = jts, min(jde-1,jte)
+         DO i = its, min(ide-1,ite)
+
+            !  Assign the potential temperature (perturbation from t0) and qv on all the mass
+            !  point locations.
+
+            DO k =  1 , kde-1
+               grid%em_t_2(i,k,j)          = grid%em_t_2(i,k,j) - t0
+            END DO
+
+!!---------------------------------------------------------------
+!!****MARS: no 500mb adjustment needed
+!!****MARS: must keep however the hydrostatic equation integration performed in this loop !
+!!****MARS: the DO WHILE loop is deactivated, since we will always be in the case
+!!****MARS: ... of "ELSE dpmu = 0."
+!!---------------------------------------------------------------
+!            dpmu = 10001.
+!            loop_count = 0
+!
+!            DO WHILE ( ( ABS(dpmu) .GT. 10. ) .AND. &
+!                       ( loop_count .LT. 5 ) )  
+!
+!               loop_count = loop_count + 1
+      
+               !  Integrate the hydrostatic equation (from the RHS of the bigstep vertical momentum 
+               !  equation) down from the top to get the pressure perturbation.  First get the pressure
+               !  perturbation, moisture, and inverse density (total and perturbation) at the top-most level.
+         
+               k = kte-1
+         
+               qvf1 = 0.5*(moist(i,k,j,P_QV)+moist(i,k,j,P_QV))
+               qvf2 = 1./(1.+qvf1)
+               qvf1 = qvf1*qvf2
+         
+               grid%em_p(i,k,j) = - 0.5*(grid%em_mu_2(i,j)+qvf1*grid%em_mub(i,j))/grid%em_rdnw(k)/qvf2
+               qvf = 1. + rvovrd*moist(i,k,j,P_QV)
+               grid%em_alt(i,k,j) = (r_d/p1000mb)*(grid%em_t_2(i,k,j)+t0)*qvf&
+                                 *(((grid%em_p(i,k,j)+grid%em_pb(i,k,j))/p1000mb)**cvpm)
+               grid%em_al(i,k,j) = grid%em_alt(i,k,j) - grid%em_alb(i,k,j)
+         
+               !  Now, integrate down the column to compute the pressure perturbation, and diagnose the two
+               !  inverse density fields (total and perturbation).
+         
+                DO k=kte-2,1,-1
+                  qvf1 = 0.5*(moist(i,k,j,P_QV)+moist(i,k+1,j,P_QV))
+                  qvf2 = 1./(1.+qvf1)
+                  qvf1 = qvf1*qvf2
+                  grid%em_p(i,k,j) = grid%em_p(i,k+1,j) - (grid%em_mu_2(i,j) + qvf1*grid%em_mub(i,j))/qvf2/grid%em_rdn(k+1)
+                  qvf = 1. + rvovrd*moist(i,k,j,P_QV)
+                  grid%em_alt(i,k,j) = (r_d/p1000mb)*(grid%em_t_2(i,k,j)+t0)*qvf* &
+                              (((grid%em_p(i,k,j)+grid%em_pb(i,k,j))/p1000mb)**cvpm)
+                  grid%em_al(i,k,j) = grid%em_alt(i,k,j) - grid%em_alb(i,k,j)
+               END DO
+         
+               !  This is the hydrostatic equation used in the model after the small timesteps.  In 
+               !  the model, grid%em_al (inverse density) is computed from the geopotential.
+         
+               DO k  = 2,kte
+                  grid%em_ph_2(i,k,j) = grid%em_ph_2(i,k-1,j) - &
+                                grid%em_dnw(k-1) * ( (grid%em_mub(i,j)+grid%em_mu_2(i,j))*grid%em_al(i,k-1,j) &
+                              + grid%em_mu_2(i,j)*grid%em_alb(i,k-1,j) )
+                  grid%em_ph0(i,k,j) = grid%em_ph_2(i,k,j) + grid%em_phb(i,k,j)
+               END DO
+
+!               !  Adjust the column pressure so that the computed 500 mb height is close to the
+!               !  input value (of course, not when we are doing hybrid input).
+!   
+!               IF ( ( flag_metgrid .EQ. 1 ) .AND. ( i .EQ. its ) .AND. ( j .EQ. jts ) ) THEN
+!                  DO k = 1 , num_metgrid_levels
+!                     IF ( ABS ( grid%em_p_gc(i,k,j) - 50000. ) .LT. 1. ) THEN
+!                        lev500 = k
+!                        EXIT
+!                     END IF
+!                  END DO
+!               END IF
+!           
+!               !  We only do the adjustment of height if we have the input data on pressure
+!               !  surfaces, and folks have asked to do this option.
+!   
+!               IF ( ( flag_metgrid .EQ. 1 ) .AND. &
+!                    ( config_flags%adjust_heights ) .AND. &
+!                    ( lev500 .NE. 0 ) ) THEN
+!   
+!                  DO k = 2 , kte-1
+!      
+!                     !  Get the pressures on the full eta levels (grid%em_php is defined above as 
+!                     !  the full-lev base pressure, an easy array to use for 3d space).
+!      
+!                     pl = grid%em_php(i,k  ,j) + &
+!                          ( grid%em_p(i,k-1  ,j) * ( grid%em_znw(k    ) - grid%em_znu(k  ) ) + &             
+!                            grid%em_p(i,k    ,j) * ( grid%em_znu(k-1  ) - grid%em_znw(k  ) ) ) / &
+!                          ( grid%em_znu(k-1  ) - grid%em_znu(k  ) )
+!                     pu = grid%em_php(i,k+1,j) + &
+!                          ( grid%em_p(i,k-1+1,j) * ( grid%em_znw(k  +1) - grid%em_znu(k+1) ) + &             
+!                            grid%em_p(i,k  +1,j) * ( grid%em_znu(k-1+1) - grid%em_znw(k+1) ) ) / &
+!                          ( grid%em_znu(k-1+1) - grid%em_znu(k+1) )
+!                   
+!                     !  If these pressure levels trap 500 mb, use them to interpolate
+!                     !  to the 500 mb level of the computed height.
+!!**** PB on MARS .... ?       
+!                     IF ( ( pl .GE. 50000. ) .AND. ( pu .LT. 50000. ) ) THEN
+!                        zl = ( grid%em_ph_2(i,k  ,j) + grid%em_phb(i,k  ,j) ) / g
+!                        zu = ( grid%em_ph_2(i,k+1,j) + grid%em_phb(i,k+1,j) ) / g
+!      
+!                        z500 = ( zl * ( LOG(50000.) - LOG(pu    ) ) + &
+!                                 zu * ( LOG(pl    ) - LOG(50000.) ) ) / &
+!                               ( LOG(pl) - LOG(pu) ) 
+!!                       z500 = ( zl * (    (50000.) -    (pu    ) ) + &
+!!                                zu * (    (pl    ) -    (50000.) ) ) / &
+!!                              (    (pl) -    (pu) ) 
+!      
+!                        !  Compute the difference of the 500 mb heights (computed minus input), and
+!                        !  then the change in grid%em_mu_2.  The grid%em_php is still full-levels, base pressure.
+!      
+!                        dz500 = z500 - grid%em_ght_gc(i,lev500,j)
+!                        tvsfc = ((grid%em_t_2(i,1,j)+t0)*((grid%em_p(i,1,j)+grid%em_php(i,1,j))/p1000mb)**(r_d/cp)) * &
+!                                (1.+0.6*moist(i,1,j,P_QV))
+!                        dpmu = ( grid%em_php(i,1,j) + grid%em_p(i,1,j) ) * EXP ( g * dz500 / ( r_d * tvsfc ) )
+!                        dpmu = dpmu - ( grid%em_php(i,1,j) + grid%em_p(i,1,j) )
+!                        grid%em_mu_2(i,j) = grid%em_mu_2(i,j) - dpmu
+!                        EXIT
+!                     END IF
+!      
+!                  END DO
+!               ELSE
+!                  dpmu = 0.
+!               END IF
+!
+!            END DO
+       
+         END DO
+      END DO
+
+!!****MARS: we use WPS
+!
+!      !  If this is data from the SI, then we probably do not have the original
+!      !  surface data laying around.  Note that these are all the lowest levels
+!      !  of the respective 3d arrays.  For surface pressure, we assume that the
+!      !  vertical gradient of grid%em_p prime is zilch.  This is not all that important.
+!      !  These are filled in so that the various plotting routines have something
+!      !  to play with at the initial time for the model.
+!
+!      IF ( flag_metgrid .NE. 1 ) THEN
+!         DO j = jts, min(jde-1,jte)
+!            DO i = its, min(ide,ite)
+!               grid%u10(i,j)=grid%em_u_2(i,1,j)
+!            END DO
+!         END DO
+!   
+!         DO j = jts, min(jde,jte)
+!            DO i = its, min(ide-1,ite)
+!               grid%v10(i,j)=grid%em_v_2(i,1,j)
+!            END DO
+!         END DO
+!
+!         DO j = jts, min(jde-1,jte)
+!            DO i = its, min(ide-1,ite)
+!               p_surf = p00 * EXP ( -t00/a + ( (t00/a)**2 - 2.*g*grid%ht(i,j)/a/r_d ) **0.5 ) 
+!               grid%psfc(i,j)=p_surf + grid%em_p(i,1,j)
+!               grid%q2(i,j)=moist(i,1,j,P_QV)
+!               grid%th2(i,j)=grid%em_t_2(i,1,j)+300.
+!               grid%t2(i,j)=grid%th2(i,j)*(((grid%em_p(i,1,j)+grid%em_pb(i,1,j))/p00)**(r_d/cp))
+!            END DO
+!         END DO
+!
+!      !  If this data is from WPS, then we have previously assigned the surface
+!      !  data for u, v, and t.  If we have an input qv, welp, we assigned that one,
+!      !  too.  Now we pick up the left overs, and if RH came in - we assign the 
+!      !  mixing ratio.
+!
+!      ELSE IF ( flag_metgrid .EQ. 1 ) THEN
+!
+!!****MARS: we use WPS
+
+         DO j = jts, min(jde-1,jte)
+            DO i = its, min(ide-1,ite)
+                p_surf = p00 * EXP ( -t00/a + ( (t00/a)**2 - 2.*g*grid%ht(i,j)/a/r_d ) **0.5 ) 
+                ! recompute the value of surface pressure as calculated by sfcprs2
+                grid%psfc(i,j)=p_surf + grid%em_p(i,1,j)
+                !!grid%th2 is used for other purpose
+                !grid%th2(i,j)=grid%t2(i,j)*(p00/(grid%em_p(i,1,j)+grid%em_pb(i,1,j)))**(r_d/cp)
+                grid%th2(i,j)=0.        !!TODO TODO TODO - waiting for an input
+            END DO
+         END DO
+
+!!NB: q2 is used for other purpose ...
+         !IF ( flag_qv .NE. 1 ) THEN
+         !   DO j = jts, min(jde-1,jte)
+         !      DO i = its, min(ide-1,ite)
+         !         grid%q2(i,j)=moist(i,1,j,P_QV)
+         !      END DO
+         !   END DO
+         !END IF
+!!NB: q2 is used for other purpose ...
+
+
+!      END IF
+
+!!!!MARS
+!!!!
+!!!! useful for history files @ first step
+!!!!
+grid%em_phtot = grid%em_ph0
+grid%em_ptot  = grid%em_p + grid%em_pb
+!!!!
+!!!!MARS
+
+      ips = its ; ipe = ite ; jps = jts ; jpe = jte ; kps = kts ; kpe = kte
+#ifdef DM_PARALLEL
+#   include "HALO_EM_INIT_1.inc"
+#   include "HALO_EM_INIT_2.inc"
+#   include "HALO_EM_INIT_3.inc"
+#   include "HALO_EM_INIT_4.inc"
+#   include "HALO_EM_INIT_5.inc"
+#endif
+
+      RETURN
+
+   END SUBROUTINE init_domain_rk
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE const_module_initialize ( p00 , t00 , a ) 
+      USE module_configure
+      IMPLICIT NONE
+      !  For the real-data-cases only.
+      REAL , INTENT(OUT) :: p00 , t00 , a
+      CALL nl_get_base_pres  ( 1 , p00 )
+      CALL nl_get_base_temp  ( 1 , t00 )
+      CALL nl_get_base_lapse ( 1 , a   )
+   END SUBROUTINE const_module_initialize
+
+!-------------------------------------------------------------------
+
+   SUBROUTINE rebalance_driver ( grid ) 
+
+      IMPLICIT NONE
+
+      TYPE (domain)          :: grid 
+
+      CALL rebalance( grid &
+!
+#include "em_actual_new_args.inc"
+!
+      )
+
+   END SUBROUTINE rebalance_driver
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE rebalance ( grid  &
+!
+#include "em_dummy_new_args.inc"
+!
+                        )
+      IMPLICIT NONE
+
+      TYPE (domain)          :: grid
+
+#include "em_dummy_new_decl.inc"
+
+      TYPE (grid_config_rec_type)              :: config_flags
+
+      REAL :: p_surf ,  pd_surf, p_surf_int , pb_int , ht_hold
+      REAL :: qvf , qvf1 , qvf2
+      REAL :: p00 , t00 , a
+      REAL , DIMENSION(:,:,:) , ALLOCATABLE :: t_init_int
+
+      !  Local domain indices and counters.
+
+      INTEGER :: num_veg_cat , num_soil_top_cat , num_soil_bot_cat
+
+      INTEGER                             ::                       &
+                                     ids, ide, jds, jde, kds, kde, &
+                                     ims, ime, jms, jme, kms, kme, &
+                                     its, ite, jts, jte, kts, kte, &
+                                     ips, ipe, jps, jpe, kps, kpe, &
+                                     i, j, k
+
+#ifdef DM_PARALLEL
+#    include "em_data_calls.inc"
+#endif
+
+      SELECT CASE ( model_data_order )
+         CASE ( DATA_ORDER_ZXY )
+            kds = grid%sd31 ; kde = grid%ed31 ;
+            ids = grid%sd32 ; ide = grid%ed32 ;
+            jds = grid%sd33 ; jde = grid%ed33 ;
+
+            kms = grid%sm31 ; kme = grid%em31 ;
+            ims = grid%sm32 ; ime = grid%em32 ;
+            jms = grid%sm33 ; jme = grid%em33 ;
+
+            kts = grid%sp31 ; kte = grid%ep31 ;   ! note that tile is entire patch
+            its = grid%sp32 ; ite = grid%ep32 ;   ! note that tile is entire patch
+            jts = grid%sp33 ; jte = grid%ep33 ;   ! note that tile is entire patch
+
+         CASE ( DATA_ORDER_XYZ )
+            ids = grid%sd31 ; ide = grid%ed31 ;
+            jds = grid%sd32 ; jde = grid%ed32 ;
+            kds = grid%sd33 ; kde = grid%ed33 ;
+
+            ims = grid%sm31 ; ime = grid%em31 ;
+            jms = grid%sm32 ; jme = grid%em32 ;
+            kms = grid%sm33 ; kme = grid%em33 ;
+
+            its = grid%sp31 ; ite = grid%ep31 ;   ! note that tile is entire patch
+            jts = grid%sp32 ; jte = grid%ep32 ;   ! note that tile is entire patch
+            kts = grid%sp33 ; kte = grid%ep33 ;   ! note that tile is entire patch
+
+         CASE ( DATA_ORDER_XZY )
+            ids = grid%sd31 ; ide = grid%ed31 ;
+            kds = grid%sd32 ; kde = grid%ed32 ;
+            jds = grid%sd33 ; jde = grid%ed33 ;
+
+            ims = grid%sm31 ; ime = grid%em31 ;
+            kms = grid%sm32 ; kme = grid%em32 ;
+            jms = grid%sm33 ; jme = grid%em33 ;
+
+            its = grid%sp31 ; ite = grid%ep31 ;   ! note that tile is entire patch
+            kts = grid%sp32 ; kte = grid%ep32 ;   ! note that tile is entire patch
+            jts = grid%sp33 ; jte = grid%ep33 ;   ! note that tile is entire patch
+
+      END SELECT
+
+      ALLOCATE ( t_init_int(ims:ime,kms:kme,jms:jme) )
+
+      !  Some of the many weird geopotential initializations that we'll see today: grid%em_ph0 is total, 
+      !  and grid%em_ph_2 is a perturbation from the base state geopotential.  We set the base geopotential 
+      !  at the lowest level to terrain elevation * gravity.
+
+      DO j=jts,jte
+         DO i=its,ite
+            grid%em_ph0(i,1,j) = grid%ht_fine(i,j) * g
+            grid%em_ph_2(i,1,j) = 0.
+         END DO
+      END DO
+      
+      !  To define the base state, we call a USER MODIFIED routine to set the three
+      !  necessary constants:  p00 (sea level pressure, Pa), t00 (sea level temperature, K), 
+      !  and A (temperature difference, from 1000 mb to 300 mb, K).
+
+      CALL const_module_initialize ( p00 , t00 , a ) 
+
+      !  Base state potential temperature and inverse density (alpha = 1/rho) from
+      !  the half eta levels and the base-profile surface pressure.  Compute 1/rho 
+      !  from equation of state.  The potential temperature is a perturbation from t0.
+
+      DO j = jts, MIN(jte,jde-1)
+         DO i = its, MIN(ite,ide-1)
+
+            !  Base state pressure is a function of eta level and terrain, only, plus
+            !  the hand full of constants: p00 (sea level pressure, Pa), t00 (sea level
+            !  temperature, K), and A (temperature difference, from 1000 mb to 300 mb, K).
+            !  The fine grid terrain is ht_fine, the interpolated is grid%em_ht.
+
+            p_surf     = p00 * EXP ( -t00/a + ( (t00/a)**2 - 2.*g*grid%ht_fine(i,j)/a/r_d ) **0.5 ) 
+            p_surf_int = p00 * EXP ( -t00/a + ( (t00/a)**2 - 2.*g*grid%ht(i,j)     /a/r_d ) **0.5 ) 
+
+            DO k = 1, kte-1
+               grid%em_pb(i,k,j) = grid%em_znu(k)*(p_surf     - grid%p_top) + grid%p_top
+               pb_int    = grid%em_znu(k)*(p_surf_int - grid%p_top) + grid%p_top
+               grid%em_t_init(i,k,j)    = (t00 + A*LOG(grid%em_pb(i,k,j)/p00))*(p00/grid%em_pb(i,k,j))**(r_d/cp) - t0
+               t_init_int(i,k,j)= (t00 + A*LOG(pb_int   /p00))*(p00/pb_int   )**(r_d/cp) - t0
+               grid%em_alb(i,k,j) = (r_d/p1000mb)*(grid%em_t_init(i,k,j)+t0)*(grid%em_pb(i,k,j)/p1000mb)**cvpm
+            END DO
+       
+            !  Base state mu is defined as base state surface pressure minus grid%p_top
+
+            grid%em_mub(i,j) = p_surf - grid%p_top
+       
+            !  Dry surface pressure is defined as the following (this mu is from the input file
+            !  computed from the dry pressure).  Here the dry pressure is just reconstituted.
+
+            pd_surf = ( grid%em_mub(i,j) + grid%em_mu_2(i,j) ) + grid%p_top
+       
+            !  Integrate base geopotential, starting at terrain elevation.  This assures that 
+            !  the base state is in exact hydrostatic balance with respect to the model equations.
+            !  This field is on full levels.
+
+            grid%em_phb(i,1,j) = grid%ht_fine(i,j) * g
+            DO k  = 2,kte
+               grid%em_phb(i,k,j) = grid%em_phb(i,k-1,j) - grid%em_dnw(k-1)*grid%em_mub(i,j)*grid%em_alb(i,k-1,j)
+            END DO
+         END DO
+      END DO
+
+      !  Replace interpolated terrain with fine grid values.
+
+      DO j = jts, MIN(jte,jde-1)
+         DO i = its, MIN(ite,ide-1)
+            grid%ht(i,j) = grid%ht_fine(i,j)
+         END DO
+      END DO
+
+      !  Perturbation fields.
+
+      DO j = jts, min(jde-1,jte)
+         DO i = its, min(ide-1,ite)
+
+            !  The potential temperature is THETAnest = THETAinterp + ( TBARnest - TBARinterp)
+
+            DO k =  1 , kde-1
+               grid%em_t_2(i,k,j) = grid%em_t_2(i,k,j) + ( grid%em_t_init(i,k,j) - t_init_int(i,k,j) ) 
+            END DO
+      
+            !  Integrate the hydrostatic equation (from the RHS of the bigstep vertical momentum 
+            !  equation) down from the top to get the pressure perturbation.  First get the pressure
+            !  perturbation, moisture, and inverse density (total and perturbation) at the top-most level.
+      
+            k = kte-1
+      
+            qvf1 = 0.5*(moist(i,k,j,P_QV)+moist(i,k,j,P_QV))
+            qvf2 = 1./(1.+qvf1)
+            qvf1 = qvf1*qvf2
+      
+            grid%em_p(i,k,j) = - 0.5*(grid%em_mu_2(i,j)+qvf1*grid%em_mub(i,j))/grid%em_rdnw(k)/qvf2
+            qvf = 1. + rvovrd*moist(i,k,j,P_QV)
+            grid%em_alt(i,k,j) = (r_d/p1000mb)*(grid%em_t_2(i,k,j)+t0)*qvf* &
+                                 (((grid%em_p(i,k,j)+grid%em_pb(i,k,j))/p1000mb)**cvpm)
+            grid%em_al(i,k,j) = grid%em_alt(i,k,j) - grid%em_alb(i,k,j)
+      
+            !  Now, integrate down the column to compute the pressure perturbation, and diagnose the two
+            !  inverse density fields (total and perturbation).
+      
+            DO k=kte-2,1,-1
+               qvf1 = 0.5*(moist(i,k,j,P_QV)+moist(i,k+1,j,P_QV))
+               qvf2 = 1./(1.+qvf1)
+               qvf1 = qvf1*qvf2
+               grid%em_p(i,k,j) = grid%em_p(i,k+1,j) - (grid%em_mu_2(i,j) + qvf1*grid%em_mub(i,j))/qvf2/grid%em_rdn(k+1)
+               qvf = 1. + rvovrd*moist(i,k,j,P_QV)
+               grid%em_alt(i,k,j) = (r_d/p1000mb)*(grid%em_t_2(i,k,j)+t0)*qvf* &
+                           (((grid%em_p(i,k,j)+grid%em_pb(i,k,j))/p1000mb)**cvpm)
+               grid%em_al(i,k,j) = grid%em_alt(i,k,j) - grid%em_alb(i,k,j)
+            END DO
+      
+            !  This is the hydrostatic equation used in the model after the small timesteps.  In 
+            !  the model, grid%em_al (inverse density) is computed from the geopotential.
+      
+            DO k  = 2,kte
+               grid%em_ph_2(i,k,j) = grid%em_ph_2(i,k-1,j) - &
+                             grid%em_dnw(k-1) * ( (grid%em_mub(i,j)+grid%em_mu_2(i,j))*grid%em_al(i,k-1,j) &
+                           + grid%em_mu_2(i,j)*grid%em_alb(i,k-1,j) )
+               grid%em_ph0(i,k,j) = grid%em_ph_2(i,k,j) + grid%em_phb(i,k,j)
+            END DO
+       
+         END DO
+      END DO
+
+      DEALLOCATE ( t_init_int ) 
+
+      ips = its ; ipe = ite ; jps = jts ; jpe = jte ; kps = kts ; kpe = kte
+#ifdef DM_PARALLEL
+#   include "HALO_EM_INIT_1.inc"
+#   include "HALO_EM_INIT_2.inc"
+#   include "HALO_EM_INIT_3.inc"
+#   include "HALO_EM_INIT_4.inc"
+#   include "HALO_EM_INIT_5.inc"
+#endif
+   END SUBROUTINE rebalance
+
+!---------------------------------------------------------------------
+
+   RECURSIVE SUBROUTINE find_my_parent ( grid_ptr_in , grid_ptr_out , id_i_am , id_wanted , found_the_id )
+
+      USE module_domain
+
+      TYPE(domain) , POINTER :: grid_ptr_in , grid_ptr_out
+      TYPE(domain) , POINTER :: grid_ptr_sibling
+      INTEGER :: id_wanted , id_i_am
+      LOGICAL :: found_the_id
+
+      found_the_id = .FALSE.
+      grid_ptr_sibling => grid_ptr_in
+      DO WHILE ( ASSOCIATED ( grid_ptr_sibling ) )
+
+         IF ( grid_ptr_sibling%grid_id .EQ. id_wanted ) THEN
+            found_the_id = .TRUE.
+            grid_ptr_out => grid_ptr_sibling
+            RETURN
+         ELSE IF ( grid_ptr_sibling%num_nests .GT. 0 ) THEN
+            grid_ptr_sibling => grid_ptr_sibling%nests(1)%ptr
+            CALL find_my_parent ( grid_ptr_sibling , grid_ptr_out , id_i_am , id_wanted , found_the_id )
+         ELSE
+            grid_ptr_sibling => grid_ptr_sibling%sibling
+         END IF
+
+      END DO
+
+   END SUBROUTINE find_my_parent
+
+#endif
+
+!---------------------------------------------------------------------
+
+#ifdef VERT_UNIT
+
+!This is a main program for a small unit test for the vertical interpolation.
+
+program vint
+
+   implicit none 
+
+   integer , parameter :: ij = 3
+   integer , parameter :: keta = 30
+   integer , parameter :: kgen =20 
+
+   integer :: ids , ide , jds , jde , kds , kde , &
+              ims , ime , jms , jme , kms , kme , &
+              its , ite , jts , jte , kts , kte
+
+   integer :: generic
+
+   real , dimension(1:ij,kgen,1:ij) :: fo , po
+   real , dimension(1:ij,1:keta,1:ij) :: fn_calc , fn_interp , pn
+
+   integer, parameter :: interp_type          = 1 ! 2
+!  integer, parameter :: lagrange_order       = 2 ! 1
+   integer            :: lagrange_order
+   logical, parameter :: lowest_lev_from_sfc  = .FALSE. ! .TRUE.
+   real   , parameter :: zap_close_levels     = 500. ! 100.
+   integer, parameter :: force_sfc_in_vinterp = 0 ! 6
+
+   integer :: k 
+
+   ids = 1 ; ide = ij ; jds = 1 ; jde = ij ; kds = 1 ; kde = keta
+   ims = 1 ; ime = ij ; jms = 1 ; jme = ij ; kms = 1 ; kme = keta
+   its = 1 ; ite = ij ; jts = 1 ; jte = ij ; kts = 1 ; kte = keta
+
+   generic = kgen
+
+   print *,' '
+   print *,'------------------------------------'
+   print *,'UNIT TEST FOR VERTICAL INTERPOLATION'
+   print *,'------------------------------------'
+   print *,' '
+   do lagrange_order = 1 , 2
+      print *,' '
+      print *,'------------------------------------'
+      print *,'Lagrange Order = ',lagrange_order
+      print *,'------------------------------------'
+      print *,' '
+      call fillitup ( fo , po , fn_calc , pn , &
+                    ids , ide , jds , jde , kds , kde , &
+                    ims , ime , jms , jme , kms , kme , &
+                    its , ite , jts , jte , kts , kte , &
+                    generic , lagrange_order )
+   
+      print *,' ' 
+      print *,'Level   Pressure     Field'
+      print *,'          (Pa)      (generic)'
+      print *,'------------------------------------'
+      print *,' ' 
+      do k = 1 , generic
+      write (*,fmt='(i2,2x,f12.3,1x,g15.8)' ) &
+         k,po(2,k,2),fo(2,k,2)
+      end do
+      print *,' '
+   
+      call vert_interp ( fo , po , fn_interp , pn , &
+                         generic , 'T' , &
+                         interp_type , lagrange_order , lowest_lev_from_sfc , &
+                         zap_close_levels , force_sfc_in_vinterp , &
+                         ids , ide , jds , jde , kds , kde , &
+                         ims , ime , jms , jme , kms , kme , &
+                         its , ite , jts , jte , kts , kte )
+   
+      print *,'Multi-Order Interpolator'
+      print *,'------------------------------------'
+      print *,' '
+      print *,'Level  Pressure      Field           Field         Field'
+      print *,'         (Pa)        Calc            Interp        Diff'
+      print *,'------------------------------------'
+      print *,' '
+      do k = kts , kte-1
+      write (*,fmt='(i2,2x,f12.3,1x,3(g15.7))' ) &
+         k,pn(2,k,2),fn_calc(2,k,2),fn_interp(2,k,2),fn_calc(2,k,2)-fn_interp(2,k,2)
+      end do
+   
+      call vert_interp_old ( fo , po , fn_interp , pn , &
+                         generic , 'T' , &
+                         interp_type , lagrange_order , lowest_lev_from_sfc , &
+                         zap_close_levels , force_sfc_in_vinterp , &
+                         ids , ide , jds , jde , kds , kde , &
+                         ims , ime , jms , jme , kms , kme , &
+                         its , ite , jts , jte , kts , kte )
+   
+      print *,'Linear Interpolator'
+      print *,'------------------------------------'
+      print *,' '
+      print *,'Level  Pressure      Field           Field         Field'
+      print *,'         (Pa)        Calc            Interp        Diff'
+      print *,'------------------------------------'
+      print *,' '
+      do k = kts , kte-1
+      write (*,fmt='(i2,2x,f12.3,1x,3(g15.7))' ) &
+         k,pn(2,k,2),fn_calc(2,k,2),fn_interp(2,k,2),fn_calc(2,k,2)-fn_interp(2,k,2)
+      end do
+   end do
+
+end program vint
+
+subroutine wrf_error_fatal (string)
+   character (len=*) :: string
+   print *,string
+   stop
+end subroutine wrf_error_fatal
+
+subroutine fillitup ( fo , po , fn , pn , &
+                    ids , ide , jds , jde , kds , kde , &
+                    ims , ime , jms , jme , kms , kme , &
+                    its , ite , jts , jte , kts , kte , &
+                    generic , lagrange_order )
+
+   implicit none
+
+   integer , intent(in) :: ids , ide , jds , jde , kds , kde , &
+              ims , ime , jms , jme , kms , kme , &
+              its , ite , jts , jte , kts , kte
+
+   integer , intent(in) :: generic , lagrange_order
+
+   real , dimension(ims:ime,generic,jms:jme) , intent(out) :: fo , po
+   real , dimension(ims:ime,kms:kme,jms:jme) , intent(out) :: fn , pn
+
+   integer :: i , j , k
+   
+   real , parameter :: piov2 = 3.14159265358 / 2.
+
+   k = 1
+   do j = jts , jte
+   do i = its , ite
+      po(i,k,j) = 102000.
+   end do
+   end do
+   
+   do k = 2 , generic
+   do j = jts , jte
+   do i = its , ite
+      po(i,k,j) = ( 5000. * ( 1 - (k-1) ) + 100000. * ( (k-1) - (generic-1) ) ) / (1. - real(generic-1) )
+   end do
+   end do
+   end do
+
+   if ( lagrange_order .eq. 1 ) then
+      do k = 1 , generic
+      do j = jts , jte
+      do i = its , ite
+         fo(i,k,j) = po(i,k,j)
+!        fo(i,k,j) = sin(po(i,k,j) * piov2 / 102000. )
+      end do
+      end do
+      end do
+   else if ( lagrange_order .eq. 2 ) then
+      do k = 1 , generic
+      do j = jts , jte
+      do i = its , ite
+         fo(i,k,j) = (((po(i,k,j)-5000.)/102000.)*((102000.-po(i,k,j))/102000.))*102000.
+!        fo(i,k,j) = sin(po(i,k,j) * piov2 / 102000. )
+      end do
+      end do
+      end do
+   end if
+
+!!!!!!!!!!!!
+   
+   do k = kts , kte
+   do j = jts , jte
+   do i = its , ite
+      pn(i,k,j) = ( 5000. * ( 0 - (k-1) ) + 102000. * ( (k-1) - (kte-1) ) ) / (-1. *  real(kte-1) )
+   end do
+   end do
+   end do
+   
+   do k = kts , kte-1
+   do j = jts , jte
+   do i = its , ite
+      pn(i,k,j) = ( pn(i,k,j) + pn(i,k+1,j) ) /2.
+   end do
+   end do
+   end do
+
+
+   if ( lagrange_order .eq. 1 ) then
+      do k = kts , kte-1
+      do j = jts , jte
+      do i = its , ite
+         fn(i,k,j) = pn(i,k,j)
+!        fn(i,k,j) = sin(pn(i,k,j) * piov2 / 102000. )
+      end do
+      end do
+      end do
+   else if ( lagrange_order .eq. 2 ) then
+      do k = kts , kte-1
+      do j = jts , jte
+      do i = its , ite
+         fn(i,k,j) = (((pn(i,k,j)-5000.)/102000.)*((102000.-pn(i,k,j))/102000.))*102000.
+!        fn(i,k,j) = sin(pn(i,k,j) * piov2 / 102000. )
+      end do
+      end do
+      end do
+   end if
+
+end subroutine fillitup
+
+#endif
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE vert_interp ( fo , po , fnew , pnu , &
+                            generic , var_type , &
+                            interp_type , lagrange_order , lowest_lev_from_sfc , &
+                            zap_close_levels , force_sfc_in_vinterp , &
+                            ids , ide , jds , jde , kds , kde , &
+                            ims , ime , jms , jme , kms , kme , &
+                            its , ite , jts , jte , kts , kte )
+
+   !  Vertically interpolate the new field.  The original field on the original
+   !  pressure levels is provided, and the new pressure surfaces to interpolate to.
+   
+      IMPLICIT NONE
+
+      INTEGER , INTENT(IN)        :: interp_type , lagrange_order
+      LOGICAL , INTENT(IN)        :: lowest_lev_from_sfc
+      REAL    , INTENT(IN)        :: zap_close_levels
+      INTEGER , INTENT(IN)        :: force_sfc_in_vinterp
+      INTEGER , INTENT(IN)        :: ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte
+      INTEGER , INTENT(IN)        :: generic
+
+      CHARACTER (LEN=1) :: var_type 
+
+      REAL , DIMENSION(ims:ime,generic,jms:jme) , INTENT(IN)     :: fo , po
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme) , INTENT(IN)     :: pnu
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme) , INTENT(OUT)    :: fnew
+
+      REAL , DIMENSION(ims:ime,generic,jms:jme)                  :: forig , porig
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme)                  :: pnew
+
+      !  Local vars
+
+      INTEGER :: i , j , k , ko , kn , k1 , k2 , ko_1 , ko_2 , knext
+      INTEGER :: istart , iend , jstart , jend , kstart , kend 
+      INTEGER , DIMENSION(ims:ime,kms:kme        )               :: k_above , k_below
+      INTEGER , DIMENSION(ims:ime                )               :: ks
+      INTEGER , DIMENSION(ims:ime                )               :: ko_above_sfc
+      INTEGER :: count , zap , kst
+
+      LOGICAL :: any_below_ground
+
+      REAL :: p1 , p2 , pn, hold
+      REAL , DIMENSION(1:generic) :: ordered_porig , ordered_forig
+      REAL , DIMENSION(kts:kte) :: ordered_pnew , ordered_fnew
+
+!****MARS
+!big problems ... discontinuity in the interpolated fields ...
+print *, '25/05/2007: decided to use simple linear interpolations'
+print *, 'use that one at your own risk'
+!stop
+!****MARS
+
+
+      !  Horiontal loop bounds for different variable types.
+
+      IF      ( var_type .EQ. 'U' ) THEN
+         istart = its
+         iend   = ite
+         jstart = jts
+         jend   = MIN(jde-1,jte)
+         kstart = kts
+         kend   = kte-1
+         DO j = jstart,jend
+            DO k = 1,generic
+               DO i = MAX(ids+1,its) , MIN(ide-1,ite)
+                  porig(i,k,j) = ( po(i,k,j) + po(i-1,k,j) ) * 0.5
+               END DO
+            END DO
+            IF ( ids .EQ. its ) THEN
+               DO k = 1,generic
+                  porig(its,k,j) =  po(its,k,j)
+               END DO
+            END IF
+            IF ( ide .EQ. ite ) THEN
+               DO k = 1,generic
+                  porig(ite,k,j) =  po(ite-1,k,j)
+               END DO
+            END IF
+
+            DO k = kstart,kend
+               DO i = MAX(ids+1,its) , MIN(ide-1,ite)
+                  pnew(i,k,j) = ( pnu(i,k,j) + pnu(i-1,k,j) ) * 0.5
+               END DO
+            END DO
+            IF ( ids .EQ. its ) THEN
+               DO k = kstart,kend
+                  pnew(its,k,j) =  pnu(its,k,j)
+               END DO
+            END IF
+            IF ( ide .EQ. ite ) THEN
+               DO k = kstart,kend
+                  pnew(ite,k,j) =  pnu(ite-1,k,j)
+               END DO
+            END IF
+         END DO
+      ELSE IF ( var_type .EQ. 'V' ) THEN
+         istart = its
+         iend   = MIN(ide-1,ite)
+         jstart = jts
+         jend   = jte
+         kstart = kts
+         kend   = kte-1
+         DO i = istart,iend
+            DO k = 1,generic
+               DO j = MAX(jds+1,jts) , MIN(jde-1,jte)
+                  porig(i,k,j) = ( po(i,k,j) + po(i,k,j-1) ) * 0.5
+               END DO
+            END DO
+            IF ( jds .EQ. jts ) THEN
+               DO k = 1,generic
+                  porig(i,k,jts) =  po(i,k,jts)
+               END DO
+            END IF
+            IF ( jde .EQ. jte ) THEN
+               DO k = 1,generic
+                  porig(i,k,jte) =  po(i,k,jte-1)
+               END DO
+            END IF
+
+            DO k = kstart,kend
+               DO j = MAX(jds+1,jts) , MIN(jde-1,jte)
+                  pnew(i,k,j) = ( pnu(i,k,j) + pnu(i,k,j-1) ) * 0.5
+               END DO
+            END DO
+            IF ( jds .EQ. jts ) THEN
+               DO k = kstart,kend
+                  pnew(i,k,jts) =  pnu(i,k,jts)
+               END DO
+            END IF
+            IF ( jde .EQ. jte ) THEN
+              DO k = kstart,kend
+                  pnew(i,k,jte) =  pnu(i,k,jte-1)
+               END DO
+            END IF
+         END DO
+      ELSE IF ( ( var_type .EQ. 'W' ) .OR.  ( var_type .EQ. 'Z' ) ) THEN
+         istart = its
+         iend   = MIN(ide-1,ite)
+         jstart = jts
+         jend   = MIN(jde-1,jte)
+         kstart = kts
+         kend   = kte
+         DO j = jstart,jend
+            DO k = 1,generic
+               DO i = istart,iend
+                  porig(i,k,j) = po(i,k,j)
+               END DO
+            END DO
+
+            DO k = kstart,kend
+               DO i = istart,iend
+                  pnew(i,k,j) = pnu(i,k,j)
+               END DO
+            END DO
+         END DO
+      ELSE IF ( ( var_type .EQ. 'T' ) .OR. ( var_type .EQ. 'Q' ) ) THEN
+         istart = its
+         iend   = MIN(ide-1,ite)
+         jstart = jts
+         jend   = MIN(jde-1,jte)
+         kstart = kts
+         kend   = kte-1
+         DO j = jstart,jend
+            DO k = 1,generic
+               DO i = istart,iend
+                  porig(i,k,j) = po(i,k,j)
+               END DO
+            END DO
+
+            DO k = kstart,kend
+               DO i = istart,iend
+                  pnew(i,k,j) = pnu(i,k,j)
+               END DO
+            END DO
+         END DO
+      ELSE
+         istart = its
+         iend   = MIN(ide-1,ite)
+         jstart = jts
+         jend   = MIN(jde-1,jte)
+         kstart = kts
+         kend   = kte-1
+         DO j = jstart,jend
+            DO k = 1,generic
+               DO i = istart,iend
+                  porig(i,k,j) = po(i,k,j)
+               END DO
+            END DO
+
+            DO k = kstart,kend
+               DO i = istart,iend
+                  pnew(i,k,j) = pnu(i,k,j)
+               END DO
+            END DO
+         END DO
+      END IF
+
+      DO j = jstart , jend
+
+         !  The lowest level is the surface.  Levels 2 through "generic" are supposed to
+         !  be "bottom-up".  Flip if they are not.  This is based on the input pressure 
+         !  array.
+
+         IF      ( porig(its,2,j) .LT. porig(its,generic,j) ) THEN
+            DO kn = 2 , ( generic + 1 ) / 2
+               DO i = istart , iend
+                  hold                    = porig(i,kn,j) 
+                  porig(i,kn,j)           = porig(i,generic+2-kn,j)
+                  porig(i,generic+2-kn,j) = hold
+                  forig(i,kn,j)           = fo   (i,generic+2-kn,j)
+                  forig(i,generic+2-kn,j) = fo   (i,kn,j)
+               END DO
+               DO i = istart , iend
+                  forig(i,1,j)           = fo   (i,1,j)
+               END DO
+            END DO
+         ELSE
+            DO kn = 1 , generic
+               DO i = istart , iend
+                  forig(i,kn,j)          = fo   (i,kn,j)
+               END DO
+            END DO
+         END IF
+    
+         !  Skip all of the levels below ground in the original data based upon the surface pressure.
+         !  The ko_above_sfc is the index in the pressure array that is above the surface.  If there
+         !  are no levels underground, this is index = 2.  The remaining levels are eligible for use
+         !  in the vertical interpolation.
+   
+         DO i = istart , iend
+            ko_above_sfc(i) = -1
+         END DO
+         DO ko = kstart+1 , kend
+            DO i = istart , iend
+               IF ( ko_above_sfc(i) .EQ. -1 ) THEN
+                  IF ( porig(i,1,j) .GT. porig(i,ko,j) ) THEN
+                     ko_above_sfc(i) = ko
+                  END IF
+               END IF
+            END DO
+         END DO
+
+         !  Piece together columns of the original input data.  Pass the vertical columns to
+         !  the iterpolator.
+
+         DO i = istart , iend
+
+            !  If the surface value is in the middle of the array, three steps: 1) do the
+            !  values below the ground (this is just to catch the occasional value that is
+            !  inconsistently below the surface based on input data), 2) do the surface level, then 
+            !  3) add in the levels that are above the surface.  For the levels next to the surface,
+            !  we check to remove any levels that are "too close".  When building the column of input
+            !  pressures, we also attend to the request for forcing the surface analysis to be used
+            !  in a few lower eta-levels.
+
+            !  How many levels have we skipped in the input column.
+
+            zap = 0
+
+            !  Fill in the column from up to the level just below the surface with the input
+            !  presssure and the input field (orig or old, which ever).  For an isobaric input
+            !  file, this data is isobaric.
+
+            IF (  ko_above_sfc(i) .GT. 2 ) THEN
+               count = 1
+               DO ko = 2 , ko_above_sfc(i)-1
+                  ordered_porig(count) = porig(i,ko,j)
+                  ordered_forig(count) = forig(i,ko,j)
+                  count = count + 1
+               END DO
+
+               !  Make sure the pressure just below the surface is not "too close", this
+               !  will cause havoc with the higher order interpolators.  In case of a "too close"
+               !  instance, we toss out the offending level (NOT the surface one) by simply
+               !  decrementing the accumulating loop counter.
+
+               IF ( ordered_porig(count-1) - porig(i,1,j) .LT. zap_close_levels ) THEN
+                  count = count -1
+                  zap = 1
+               END IF
+
+               !  Add in the surface values.
+   
+               ordered_porig(count) = porig(i,1,j)
+               ordered_forig(count) = forig(i,1,j)
+               count = count + 1
+
+               !  A usual way to do the vertical interpolation is to pay more attention to the 
+               !  surface data.  Why?  Well it has about 20x the density as the upper air, so we 
+               !  hope the analysis is better there.  We more strongly use this data by artificially
+               !  tossing out levels above the surface that are beneath a certain number of prescribed
+               !  eta levels at this (i,j).  The "zap" value is how many levels of input we are 
+               !  removing, which is used to tell the interpolator how many valid values are in 
+               !  the column.  The "count" value is the increment to the index of levels, and is
+               !  only used for assignments.
+
+               IF ( force_sfc_in_vinterp .GT. 0 ) THEN
+
+                  !  Get the pressure at the eta level.  We want to remove all input pressure levels
+                  !  between the level above the surface to the pressure at this eta surface.  That 
+                  !  forces the surface value to be used through the selected eta level.  Keep track
+                  !  of two things: the level to use above the eta levels, and how many levels we are
+                  !  skipping.
+
+                  knext = ko_above_sfc(i)
+                  find_level : DO ko = ko_above_sfc(i) , generic
+                     IF ( porig(i,ko,j) .LE. pnew(i,force_sfc_in_vinterp,j) ) THEN
+                        knext = ko
+                        exit find_level
+                     ELSE
+                        zap = zap + 1
+                     END IF
+                  END DO find_level
+
+               !  No request for special interpolation, so we just assign the next level to use
+               !  above the surface as, ta da, the first level above the surface.  I know, wow.
+
+               ELSE
+                  knext = ko_above_sfc(i)
+               END IF
+
+               !  One more time, make sure the pressure just above the surface is not "too close", this
+               !  will cause havoc with the higher order interpolators.  In case of a "too close"
+               !  instance, we toss out the offending level above the surface (NOT the surface one) by simply
+               !  incrementing the loop counter.  Here, count-1 is the surface level and knext is either
+               !  the next level up OR it is the level above the prescribed number of eta surfaces.
+
+               IF ( ordered_porig(count-1) - porig(i,knext,j) .LT. zap_close_levels ) THEN
+                  kst = knext+1
+                  zap = zap + 1
+               ELSE
+                  kst = knext
+               END IF
+   
+               DO ko = kst , generic
+                  ordered_porig(count) = porig(i,ko,j)
+                  ordered_forig(count) = forig(i,ko,j)
+                  count = count + 1
+               END DO
+
+            !  This is easy, the surface is the lowest level, just stick them in, in this order.  OK,
+            !  there are a couple of subtleties.  We have to check for that special interpolation that
+            !  skips some input levels so that the surface is used for the lowest few eta levels.  Also,
+            !  we must macke sure that we still do not have levels that are "too close" together.
+            
+            ELSE
+        
+               !  Initialize no input levels have yet been removed from consideration.
+
+               zap = 0
+
+               !  The surface is the lowest level, so it gets set right away to location 1.
+
+               ordered_porig(1) = porig(i,1,j)
+               ordered_forig(1) = forig(i,1,j)
+
+               !  We start filling in the array at loc 2, as in just above the level we just stored.
+
+               count = 2
+
+               !  Are we forcing the interpolator to skip valid input levels so that the
+               !  surface data is used through more levels?  Essentially as above.
+
+               IF ( force_sfc_in_vinterp .GT. 0 ) THEN
+                  knext = 2
+                  find_level2: DO ko = 2 , generic
+                     IF ( porig(i,ko,j) .LE. pnew(i,force_sfc_in_vinterp,j) ) THEN
+                        knext = ko
+                        exit find_level2
+                     ELSE
+                        zap = zap + 1
+                     END IF
+                  END DO find_level2
+               ELSE
+                  knext = 2
+               END IF
+
+               !  Fill in the data above the surface.  The "knext" index is either the one
+               !  just above the surface OR it is the index associated with the level that
+               !  is just above the pressure at this (i,j) of the top eta level that is to
+               !  be directly impacted with the surface level in interpolation.
+
+               DO ko = knext , generic
+                  IF ( ordered_porig(count-1) - porig(i,ko,j) .LT. zap_close_levels ) THEN
+                     zap = zap + 1
+                     CYCLE
+                  END IF
+                  ordered_porig(count) = porig(i,ko,j)
+                  ordered_forig(count) = forig(i,ko,j)
+                  count = count + 1
+               END DO
+
+            END IF
+
+            !  Now get the column of the "new" pressure data.  So, this one is easy.
+
+            DO kn = kstart , kend
+               ordered_pnew(kn) = pnew(i,kn,j)
+            END DO
+
+            !  The polynomials are either in pressure or LOG(pressure).
+
+            IF ( interp_type .EQ. 1 ) THEN
+               CALL lagrange_setup ( var_type , &
+                   ordered_porig                 , ordered_forig , generic-zap   , lagrange_order , &
+                   ordered_pnew                  , ordered_fnew  , kend-kstart+1 ,i,j)
+            ELSE
+               CALL lagrange_setup ( var_type , &
+               LOG(ordered_porig(1:generic-zap)) , ordered_forig , generic-zap   , lagrange_order , &
+               LOG(ordered_pnew(kstart:kend))    , ordered_fnew  , kend-kstart+1 ,i,j)
+            END IF
+
+            !  Save the computed data.
+
+            DO kn = kstart , kend
+               fnew(i,kn,j) = ordered_fnew(kn)
+            END DO
+
+            !  There may have been a request to have the surface data from the input field
+            !  to be assigned as to the lowest eta level.  This assumes thin layers (usually
+            !  the isobaric original field has the surface from 2-m T and RH, and 10-m U and V).
+
+            IF ( lowest_lev_from_sfc ) THEN
+               fnew(i,1,j) = forig(i,ko_above_sfc(i)-1,j)
+            END IF
+
+         END DO
+
+      END DO
+
+   END SUBROUTINE vert_interp
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE vert_interp_old ( forig , po , fnew , pnu , &
+                            generic , var_type , &
+                            interp_type , lagrange_order , lowest_lev_from_sfc , &
+                            zap_close_levels , force_sfc_in_vinterp , &
+                            ids , ide , jds , jde , kds , kde , &
+                            ims , ime , jms , jme , kms , kme , &
+                            its , ite , jts , jte , kts , kte )
+
+   !  Vertically interpolate the new field.  The original field on the original
+   !  pressure levels is provided, and the new pressure surfaces to interpolate to.
+   
+      IMPLICIT NONE
+
+      INTEGER , INTENT(IN)        :: interp_type , lagrange_order
+      LOGICAL , INTENT(IN)        :: lowest_lev_from_sfc
+      REAL    , INTENT(IN)        :: zap_close_levels
+      INTEGER , INTENT(IN)        :: force_sfc_in_vinterp
+      INTEGER , INTENT(IN)        :: ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte
+      INTEGER , INTENT(IN)        :: generic
+
+      CHARACTER (LEN=1) :: var_type 
+
+!      REAL , DIMENSION(ims:ime,generic,jms:jme) , INTENT(IN)     :: forig , po
+!****MARS
+!error with g95 and warning with pgf90
+      REAL , DIMENSION(ims:ime,generic,jms:jme) , INTENT(IN)     :: po
+      REAL , DIMENSION(ims:ime,generic,jms:jme) , INTENT(INOUT)  :: forig
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme) , INTENT(IN)     :: pnu
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme) , INTENT(OUT)    :: fnew
+
+      REAL , DIMENSION(ims:ime,generic,jms:jme)                  :: porig
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme)                  :: pnew
+
+      !  Local vars
+
+      INTEGER :: i , j , k , ko , kn , k1 , k2 , ko_1 , ko_2
+      INTEGER :: istart , iend , jstart , jend , kstart , kend 
+      INTEGER , DIMENSION(ims:ime,kms:kme        )               :: k_above , k_below
+      INTEGER , DIMENSION(ims:ime                )               :: ks
+      INTEGER , DIMENSION(ims:ime                )               :: ko_above_sfc
+
+      LOGICAL :: any_below_ground
+
+      REAL :: p1 , p2 , pn
+!****MARS
+integer vert_extrap
+integer kn_save
+vert_extrap = 0
+kn_save = 0
+!****MARS
+
+      !  Horizontal loop bounds for different variable types.
+
+      IF      ( var_type .EQ. 'U' ) THEN
+         istart = its
+         iend   = ite
+         jstart = jts
+         jend   = MIN(jde-1,jte)
+         kstart = kts
+         kend   = kte-1
+         DO j = jstart,jend
+            DO k = 1,generic
+               DO i = MAX(ids+1,its) , MIN(ide-1,ite)
+                  porig(i,k,j) = ( po(i,k,j) + po(i-1,k,j) ) * 0.5
+               END DO
+            END DO
+            IF ( ids .EQ. its ) THEN
+               DO k = 1,generic
+                  porig(its,k,j) =  po(its,k,j)
+               END DO
+            END IF
+            IF ( ide .EQ. ite ) THEN
+               DO k = 1,generic
+                  porig(ite,k,j) =  po(ite-1,k,j)
+               END DO
+            END IF
+
+            DO k = kstart,kend
+               DO i = MAX(ids+1,its) , MIN(ide-1,ite)
+                  pnew(i,k,j) = ( pnu(i,k,j) + pnu(i-1,k,j) ) * 0.5
+               END DO
+            END DO
+            IF ( ids .EQ. its ) THEN
+               DO k = kstart,kend
+                  pnew(its,k,j) =  pnu(its,k,j)
+               END DO
+            END IF
+            IF ( ide .EQ. ite ) THEN
+               DO k = kstart,kend
+                  pnew(ite,k,j) =  pnu(ite-1,k,j)
+               END DO
+            END IF
+         END DO
+      ELSE IF ( var_type .EQ. 'V' ) THEN
+         istart = its
+         iend   = MIN(ide-1,ite)
+         jstart = jts
+         jend   = jte
+         kstart = kts
+         kend   = kte-1
+         DO i = istart,iend
+            DO k = 1,generic
+               DO j = MAX(jds+1,jts) , MIN(jde-1,jte)
+                  porig(i,k,j) = ( po(i,k,j) + po(i,k,j-1) ) * 0.5
+               END DO
+            END DO
+            IF ( jds .EQ. jts ) THEN
+               DO k = 1,generic
+                  porig(i,k,jts) =  po(i,k,jts)
+               END DO
+            END IF
+            IF ( jde .EQ. jte ) THEN
+               DO k = 1,generic
+                  porig(i,k,jte) =  po(i,k,jte-1)
+               END DO
+            END IF
+
+            DO k = kstart,kend
+               DO j = MAX(jds+1,jts) , MIN(jde-1,jte)
+                  pnew(i,k,j) = ( pnu(i,k,j) + pnu(i,k,j-1) ) * 0.5
+               END DO
+            END DO
+            IF ( jds .EQ. jts ) THEN
+               DO k = kstart,kend
+                  pnew(i,k,jts) =  pnu(i,k,jts)
+               END DO
+            END IF
+            IF ( jde .EQ. jte ) THEN
+              DO k = kstart,kend
+                  pnew(i,k,jte) =  pnu(i,k,jte-1)
+               END DO
+            END IF
+         END DO
+      ELSE IF ( ( var_type .EQ. 'W' ) .OR.  ( var_type .EQ. 'Z' ) ) THEN
+         istart = its
+         iend   = MIN(ide-1,ite)
+         jstart = jts
+         jend   = MIN(jde-1,jte)
+         kstart = kts
+         kend   = kte
+         DO j = jstart,jend
+            DO k = 1,generic
+               DO i = istart,iend
+                  porig(i,k,j) = po(i,k,j)
+               END DO
+            END DO
+
+            DO k = kstart,kend
+               DO i = istart,iend
+                  pnew(i,k,j) = pnu(i,k,j)
+               END DO
+            END DO
+         END DO
+      ELSE IF ( ( var_type .EQ. 'T' ) .OR. ( var_type .EQ. 'Q' ) ) THEN
+         istart = its
+         iend   = MIN(ide-1,ite)
+         jstart = jts
+         jend   = MIN(jde-1,jte)
+         kstart = kts
+         kend   = kte-1
+         DO j = jstart,jend
+            DO k = 1,generic
+               DO i = istart,iend
+                  porig(i,k,j) = po(i,k,j)
+               END DO
+            END DO
+
+            DO k = kstart,kend
+               DO i = istart,iend
+                  pnew(i,k,j) = pnu(i,k,j)
+               END DO
+            END DO
+         END DO
+      ELSE
+         istart = its
+         iend   = MIN(ide-1,ite)
+         jstart = jts
+         jend   = MIN(jde-1,jte)
+         kstart = kts
+         kend   = kte-1
+         DO j = jstart,jend
+            DO k = 1,generic
+               DO i = istart,iend
+                  porig(i,k,j) = po(i,k,j)
+               END DO
+            END DO
+
+            DO k = kstart,kend
+               DO i = istart,iend
+                  pnew(i,k,j) = pnu(i,k,j)
+               END DO
+            END DO
+         END DO
+      END IF
+
+
+      DO j = jstart , jend
+    
+         !  Skip all of the levels below ground in the original data based upon the surface pressure.
+         !  The ko_above_sfc is the index in the pressure array that is above the surface.  If there
+         !  are no levels underground, this is index = 2.  The remaining levels are eligible for use
+         !  in the vertical interpolation.
+   
+         DO i = istart , iend
+            ko_above_sfc(i) = -1
+         END DO
+         DO ko = kstart+1 , kend
+            DO i = istart , iend
+
+               IF ( ko_above_sfc(i) .EQ. -1 ) THEN
+                  IF ( porig(i,1,j) .GT. porig(i,ko,j) ) THEN
+                     ko_above_sfc(i) = ko
+!!****MARS
+!!old stuff
+!!
+!! Pressure level may be OK, however data from the diagfi is possibly missing
+!IF (forig(i,ko,j) .EQ. -1.0e+30) THEN
+!        ko_above_sfc(i) = -1
+!END IF
+!        !! Once the right start level is found, check that it is OK
+!        !! >> first column should be 1e30 or so, second column should be a realistic value
+!        !IF ( ko_above_sfc(i) .NE. -1 ) THEN
+!        !        print *, 'verif', forig(i,ko-1,j), forig(i,ko,j), forig(i,ko+1,j), ko
+!        !END IF
+!!
+!!****MARS
+                  END IF
+               END IF
+
+            END DO
+         END DO
+
+         !  Initialize interpolation location.  These are the levels in the original pressure
+         !  data that are physically below and above the targeted new pressure level.
+   
+         DO kn = kts , kte
+            DO i = its , ite
+               k_above(i,kn) = -1
+               k_below(i,kn) = -2
+            END DO
+         END DO
+    
+         !  Starting location is no lower than previous found location.  This is for O(n logn)
+         !  and not O(n^2), where n is the number of vertical levels to search.
+   
+         DO i = its , ite
+            ks(i) = 1
+         END DO
+
+         !  Find trapping layer for interpolation.  The kn index runs through all of the "new"
+         !  levels of data.
+   
+         DO kn = kstart , kend
+
+            DO i = istart , iend
+
+               !  For each "new" level (kn), we search to find the trapping levels in the "orig"
+               !  data.  Most of the time, the "new" levels are the eta surfaces, and the "orig"
+               !  levels are the input pressure levels.
+
+               found_trap_above : DO ko = ks(i) , generic-1
+
+                  !  Because we can have levels in the interpolation that are not valid,
+                  !  let's toss out any candidate orig pressure values that are below ground
+                  !  based on the surface pressure.  If the level =1, then this IS the surface
+                  !  level, so we HAVE to keep that one, but maybe not the ones above.  If the
+                  !  level (ks) is NOT=1, then we have to just CYCLE our loop to find a legit
+                  !  below-pressure value.  If we are not below ground, then we choose two
+                  !  neighboring levels to test whether they surround the new pressure level.
+
+                  !  The input trapping levels that we are trying is the surface and the first valid
+                  !  level above the surface.
+
+                  IF      ( ( ko .LT. ko_above_sfc(i) ) .AND. ( ko .EQ. 1 ) ) THEN
+                     ko_1 = ko
+                     ko_2 = ko_above_sfc(i)
+!!****MARS
+!!old remark: the possible issue is fixed later in the code ...
+!!****MARS
+     
+                  !  The "below" level is underground, cycle until we get to a valid pressure
+                  !  above ground.
+ 
+                  ELSE IF ( ( ko .LT. ko_above_sfc(i) ) .AND. ( ko .NE. 1 ) ) THEN
+                     CYCLE found_trap_above
+
+                  !  The "below" level is above the surface, so we are in the clear to test these
+                  !  two levels out.
+
+                  ELSE
+                     ko_1 = ko
+                     ko_2 = ko+1
+
+                  END IF
+
+
+                  !  The test of the candidate levels: "below" has to have a larger pressure, and
+                  !  "above" has to have a smaller pressure. 
+
+                  !  OK, we found the correct two surrounding levels.  The locations are saved for use in the
+                  !  interpolation.
+
+                  IF      ( ( porig(i,ko_1,j) .GE. pnew(i,kn,j) ) .AND. &
+                            ( porig(i,ko_2,j) .LT. pnew(i,kn,j) ) ) THEN
+                     k_above(i,kn) = ko_2
+                     k_below(i,kn) = ko_1
+                     ks(i) = ko_1
+                     EXIT found_trap_above
+
+                  !  What do we do is we need to extrapolate the data underground?  This happens when the
+                  !  lowest pressure that we have is physically "above" the new target pressure.  Our
+                  !  actions depend on the type of variable we are interpolating.
+
+                  ELSE IF   ( porig(i,1,j) .LT. pnew(i,kn,j) ) THEN
+!!****MARS
+!!old stuff
+!!check: values are usually quite close
+!print *,porig(i,1,j),pnew(i,kn,j)
+!!****MARS
+
+                     !  For horizontal winds and moisture, we keep a constant value under ground.
+
+                     IF      ( ( var_type .EQ. 'U' ) .OR. &
+                               ( var_type .EQ. 'V' ) .OR. &
+                               ( var_type .EQ. 'Q' ) ) THEN
+                        k_above(i,kn) = 1
+                        ks(i) = 1
+
+                     !  For temperature and height, we extrapolate the data.  Hopefully, we are not
+                     !  extrapolating too far.  For pressure level input, the eta levels are always
+                     !  contained within the surface to p_top levels, so no extrapolation is ever
+                     !  required.  
+
+                     ELSE IF ( ( var_type .EQ. 'Z' ) .OR. &
+                               ( var_type .EQ. 'T' ) ) THEN
+                        k_above(i,kn) = ko_above_sfc(i)
+                        k_below(i,kn) = 1
+                        ks(i) = 1
+!!!****MARS
+!!old stuff
+!k_above(i,kn) = 1
+!ks(i) = 1
+!!!"Hopefully, we are not extrapolating too far"
+!!!>> true on Mars ?? 
+!!!****MARS
+
+                     !  Just a catch all right now.
+
+                     ELSE
+                        k_above(i,kn) = 1
+                        ks(i) = 1
+                     END IF
+
+                     EXIT found_trap_above
+
+                  !  The other extrapolation that might be required is when we are going above the
+                  !  top level of the input data.  Usually this means we chose a P_PTOP value that
+                  !  was inappropriate, and we should stop and let someone fix this mess.  
+
+                  ELSE IF   ( porig(i,generic,j) .GT. pnew(i,kn,j) ) THEN
+                     print *,'data is too high, try a lower p_top'
+                     print *,'pnew=',pnew(i,kn,j),'i',i,'j',j,'kn',kn
+                        print *,'pnew=',pnew(i,:,j)
+                     print *,'porig=',porig(i,:,j)
+                     CALL wrf_error_fatal ('requested p_top is higher than input data, lower p_top')
+
+                  END IF
+               END DO found_trap_above
+            END DO
+         END DO
+
+         !  Linear vertical interpolation.
+
+         DO kn = kstart , kend
+            DO i = istart , iend
+               IF ( k_above(i,kn) .EQ. 1 ) THEN
+!!!****MARS
+!!old stuff
+!!!ne doit pas arriver avec la temperature si l'on definit bien le champ au sol
+!IF (forig(i,1,j) .EQ. -1.0e+30) THEN
+!        print *,'no data here - surface - var is ...',var_type,i,j,1
+!        print *,'setting to first level with data...',ko_above_sfc(i),porig(i,ko_above_sfc(i),j)
+!        forig(i,1,j) = forig(i,ko_above_sfc(i),j)
+!        !IF      ( ( var_type .EQ. 'U' ) .OR. &
+!        !    ( var_type .EQ. 'V' ) .OR. &
+!        !    ( var_type .EQ. 'Q' ) ) THEN
+!        !    print *,'zero wind at the ground'
+!        !    forig(i,1,j) = 0
+!        !ENDIF
+!               IF (forig(i,1,j) .EQ. -1.0e+30) THEN
+!                print *,'well ... are you sure ?'
+!                stop
+!                ENDIF
+!END IF
+!!!****MARS
+                  fnew(i,kn,j) = forig(i,1,j)
+               ELSE
+                  k2 = MAX ( k_above(i,kn) , 2)
+                  k1 = MAX ( k_below(i,kn) , 1)
+                  IF ( k1 .EQ. k2 ) THEN
+                     CALL wrf_error_fatal ( 'identical values in the interp, bad for divisions' )
+                  END IF
+!!!****MARS
+!!old stuff
+!IF (forig(i,k2,j) .EQ. -1.0e+30) THEN
+!        print *,'no data here - level above - you_d better stop',i,j,k2
+!        stop        
+!END IF
+!IF (forig(i,k1,j) .EQ. -1.0e+30) THEN
+!        print *,'no data here - level below - var is ...',var_type,i,j,k1
+!        print *,'setting to first level with data...',ko_above_sfc(i),porig(i,ko_above_sfc(i),j)
+!        forig(i,k1,j) = forig(i,ko_above_sfc(i),j)
+!        !!!VERIFIER QUE LA TEMPERATURE AU SOL N'EST PAS CONCERNEE
+!        !!!(montagnes=sources locales de chaleur)
+!        !!!normalement, pas de souci, et lors de l'exécution rien ne s'affiche
+!END IF
+!!!****MARS
+                  IF      ( interp_type .EQ. 1 ) THEN
+                     p1 = porig(i,k1,j)
+                     p2 = porig(i,k2,j)
+                     pn = pnew(i,kn,j)  
+                  ELSE IF ( interp_type .EQ. 2 ) THEN
+                     p1 = ALOG(porig(i,k1,j))
+                     p2 = ALOG(porig(i,k2,j))
+                     pn = ALOG(pnew(i,kn,j))
+                  END IF
+                  IF ( ( p1-pn) * (p2-pn) > 0. ) THEN
+!                    CALL wrf_error_fatal ( 'both trapping pressures are on the same side of the new pressure' )
+!                    CALL wrf_debug ( 0 , 'both trapping pressures are on the same side of the new pressure' )
+!!!****MARS
+vert_extrap = vert_extrap + 1
+!print *, 'extrapolate', pnew(i,kn,j)-porig(i,k1,j), 'for WRF level', kn
+IF (kn_save < kn) kn_save=kn
+!!!****MARS
+                  END IF
+                  fnew(i,kn,j) = ( forig(i,k1,j) * ( p2 - pn )   + &
+                                   forig(i,k2,j) * ( pn - p1 ) ) / &
+                                   ( p2 - p1 )
+               END IF 
+            END DO
+         END DO
+
+         search_below_ground : DO kn = kstart , kend
+            any_below_ground = .FALSE.
+            DO i = istart , iend
+               IF ( k_above(i,kn) .EQ. 1 ) THEN 
+                  fnew(i,kn,j) = forig(i,1,j)
+                  any_below_ground = .TRUE.
+               END IF
+            END DO
+            IF ( .NOT. any_below_ground ) THEN
+               EXIT search_below_ground
+            END IF
+         END DO search_below_ground
+
+         !  There may have been a request to have the surface data from the input field
+         !  to be assigned as to the lowest eta level.  This assumes thin layers (usually
+         !  the isobaric original field has the surface from 2-m T and RH, and 10-m U and V).
+
+
+         DO i = istart , iend
+            IF ( lowest_lev_from_sfc ) THEN
+               fnew(i,1,j) = forig(i,ko_above_sfc(i),j)
+            END IF
+         END DO
+
+      END DO
+print *,'VERT EXTRAP = ', vert_extrap
+print *,'finished with ... ', var_type
+print *,'max WRF eta level where extrap. occurs: ',kn_save
+
+   END SUBROUTINE vert_interp_old
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE lagrange_setup ( var_type , all_x , all_y , all_dim , n , target_x , target_y , target_dim ,i,j)
+
+      !  We call a Lagrange polynomial interpolator.  The parallel concerns are put off as this
+      !  is initially set up for vertical use.  The purpose is an input column of pressure (all_x),
+      !  and the associated pressure level data (all_y).  These are assumed to be sorted (ascending
+      !  or descending, no matter).  The locations to be interpolated to are the pressures in
+      !  target_x, probably the new vertical coordinate values.  The field that is output is the
+      !  target_y, which is defined at the target_x location.  Mostly we expect to be 2nd order
+      !  overlapping polynomials, with only a single 2nd order method near the top and bottom.
+      !  When n=1, this is linear; when n=2, this is a second order interpolator.
+
+      IMPLICIT NONE
+
+      CHARACTER (LEN=1) :: var_type
+      INTEGER , INTENT(IN) :: all_dim , n , target_dim
+      REAL, DIMENSION(all_dim) , INTENT(IN) :: all_x , all_y
+      REAL , DIMENSION(target_dim) , INTENT(IN) :: target_x
+      REAL , DIMENSION(target_dim) , INTENT(OUT) :: target_y
+
+      !  Brought in for debug purposes, all of the computations are in a single column.
+
+      INTEGER , INTENT(IN) :: i,j
+
+      !  Local vars
+
+      REAL , DIMENSION(n+1) :: x , y 
+      REAL :: target_y_1 , target_y_2
+      LOGICAL :: found_loc
+      INTEGER :: loop , loc_center_left , loc_center_right , ist , iend , target_loop
+
+
+      IF ( all_dim .LT. n+1 ) THEN
+print *,'all_dim = ',all_dim
+print *,'order = ',n
+print *,'i,j = ',i,j
+print *,'p array = ',all_x
+print *,'f array = ',all_y
+print *,'p target= ',target_x
+         CALL wrf_error_fatal ( 'troubles, the interpolating order is too large for this few input values' )
+      END IF
+
+      IF ( n .LT. 1 ) THEN
+         CALL wrf_error_fatal ( 'pal, linear is about as low as we go' )
+      END IF
+
+      !  Loop over the list of target x and y values.
+
+      DO target_loop = 1 , target_dim
+
+         !  Find the two trapping x values, and keep the indices.
+   
+         found_loc = .FALSE.
+         find_trap : DO loop = 1 , all_dim -1
+            IF ( ( target_x(target_loop) - all_x(loop) ) * ( target_x(target_loop) - all_x(loop+1) ) .LE. 0.0 ) THEN
+               loc_center_left  = loop
+               loc_center_right = loop+1
+               found_loc = .TRUE.
+!****MARS: check if no errors here
+!print *,'interpolating ... ',var_type
+!       print *,'i,j = ',i,j
+!       print *,'target pressure and value = ',target_x(target_loop),target_y(target_loop)
+!       DO loop = 1 , all_dim
+!         print *,'column of pressure and value = ',all_x(loop),all_y(loop)
+!       END DO
+!END IF  
+!****MARS
+               EXIT find_trap
+            END IF
+         END DO find_trap
+   
+         IF ( ( .NOT. found_loc ) .AND. ( target_x(target_loop) .GT. all_x(1) ) ) THEN
+            IF ( var_type .EQ. 'T' ) THEN
+write(6,fmt='(A,2i5,2f11.3)') &
+' --> extrapolating TEMPERATURE near sfc: i,j,psfc, p target = ',&
+i,j,all_x(1),target_x(target_loop)
+               target_y(target_loop) = ( all_y(1) * ( target_x(target_loop) - all_x(2) ) + &
+                                         all_y(2) * ( all_x(1) - target_x(target_loop) ) ) / &
+                                       ( all_x(1) - all_x(2) ) 
+            ELSE 
+!write(6,fmt='(A,2i5,2f11.3)') &
+!' --> extrapolating zero gradient near sfc: i,j,psfc, p target = ',&
+!i,j,all_x(1),target_x(target_loop)
+               target_y(target_loop) = all_y(1)
+            END IF
+            CYCLE
+         ELSE IF ( .NOT. found_loc ) THEN
+!****MARS: normally, no errors here (otherwise, keep this part commented ?)
+            print *, var_type
+            print *,'i,j = ',i,j
+            print *,'target pressure and value = ',target_x(target_loop),target_y(target_loop)
+            DO loop = 1 , all_dim
+               print *,'column of pressure and value = ',all_x(loop),all_y(loop)
+            END DO
+           CALL wrf_error_fatal ( 'troubles, could not find trapping x locations' )
+!****MARS: end of 'keep this part commented'
+         END IF
+   
+         !  Even or odd order?  We can put the value in the middle if this is
+         !  an odd order interpolator.  For the even guys, we'll do it twice
+         !  and shift the range one index, then get an average.
+   
+         IF      ( MOD(n,2) .NE. 0 ) THEN
+            IF ( ( loc_center_left -(((n+1)/2)-1) .GE.       1 ) .AND. &
+                 ( loc_center_right+(((n+1)/2)-1) .LE. all_dim ) ) THEN
+               ist  = loc_center_left -(((n+1)/2)-1)
+               iend = iend + n
+               CALL lagrange_interp ( all_x(ist:iend) , all_y(ist:iend) , n , target_x(target_loop) , target_y(target_loop) )
+            ELSE
+               IF ( .NOT. found_loc ) THEN
+                  CALL wrf_error_fatal ( 'I doubt this will happen, I will only do 2nd order for now' )
+               END IF
+            END IF
+   
+         ELSE IF ( MOD(n,2) .EQ. 0 ) THEN
+            IF      ( ( loc_center_left -(((n  )/2)-1) .GE.       1 ) .AND. &
+                      ( loc_center_right+(((n  )/2)  ) .LE. all_dim ) .AND. &
+                      ( loc_center_left -(((n  )/2)  ) .GE.       1 ) .AND. &
+                      ( loc_center_right+(((n  )/2)-1) .LE. all_dim ) ) THEN
+               ist  = loc_center_left -(((n  )/2)-1)
+               iend = ist + n
+               CALL lagrange_interp ( all_x(ist:iend) , all_y(ist:iend) , n , target_x(target_loop) , target_y_1              )
+               ist  = loc_center_left -(((n  )/2)  )
+               iend = ist + n
+               CALL lagrange_interp ( all_x(ist:iend) , all_y(ist:iend) , n , target_x(target_loop) , target_y_2              )
+               target_y(target_loop) = ( target_y_1 + target_y_2 ) * 0.5
+   
+            ELSE IF ( ( loc_center_left -(((n  )/2)-1) .GE.       1 ) .AND. &
+                      ( loc_center_right+(((n  )/2)  ) .LE. all_dim ) ) THEN
+               ist  = loc_center_left -(((n  )/2)-1)
+               iend = ist + n
+               CALL lagrange_interp ( all_x(ist:iend) , all_y(ist:iend) , n , target_x(target_loop) , target_y(target_loop)   )
+            ELSE IF ( ( loc_center_left -(((n  )/2)  ) .GE.       1 ) .AND. &
+                      ( loc_center_right+(((n  )/2)-1) .LE. all_dim ) ) THEN
+               ist  = loc_center_left -(((n  )/2)  )
+               iend = ist + n
+               CALL lagrange_interp ( all_x(ist:iend) , all_y(ist:iend) , n , target_x(target_loop) , target_y(target_loop)   )
+            ELSE
+               CALL wrf_error_fatal ( 'unauthorized area, you should not be here' )
+            END IF
+               
+         END IF
+
+      END DO
+
+   END SUBROUTINE lagrange_setup 
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE lagrange_interp ( x , y , n , target_x , target_y )
+
+      !  Interpolation using Lagrange polynomials.
+      !  P(x) = f(x0)Ln0(x) + ... + f(xn)Lnn(x)
+      !  where Lnk(x) = (x -x0)(x -x1)...(x -xk-1)(x -xk+1)...(x -xn)
+      !                 ---------------------------------------------
+      !                 (xk-x0)(xk-x1)...(xk-xk-1)(xk-xk+1)...(xk-xn)
+
+      IMPLICIT NONE
+
+      INTEGER , INTENT(IN) :: n
+      REAL , DIMENSION(0:n) , INTENT(IN) :: x , y
+      REAL , INTENT(IN) :: target_x
+
+      REAL , INTENT(OUT) :: target_y
+
+      !  Local vars
+
+      INTEGER :: i , k
+      REAL :: numer , denom , Px
+      REAL , DIMENSION(0:n) :: Ln
+
+      Px = 0.
+      DO i = 0 , n
+         numer = 1.         
+         denom = 1.         
+         DO k = 0 , n
+            IF ( k .EQ. i ) CYCLE
+            numer = numer * ( target_x  - x(k) )
+            denom = denom * ( x(i)  - x(k) )
+         END DO
+         Ln(i) = y(i) * numer / denom
+         Px = Px + Ln(i)
+      END DO
+      target_y = Px
+
+   END SUBROUTINE lagrange_interp
+
+#ifndef VERT_UNIT
+!---------------------------------------------------------------------
+
+   SUBROUTINE p_dry ( mu0 , eta , pdht , pdry , &
+                             ids , ide , jds , jde , kds , kde , &
+                             ims , ime , jms , jme , kms , kme , &
+                             its , ite , jts , jte , kts , kte )
+
+   !  Compute reference pressure and the reference mu.
+   
+      IMPLICIT NONE
+
+      INTEGER , INTENT(IN)        :: ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte
+
+      REAL , DIMENSION(ims:ime,        jms:jme) , INTENT(IN)     :: mu0
+      REAL , DIMENSION(        kms:kme        ) , INTENT(IN)     :: eta
+      REAL                                                       :: pdht
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme) , INTENT(OUT)    :: pdry
+
+      !  Local vars
+
+      INTEGER :: i , j , k 
+      REAL , DIMENSION(        kms:kme        )                  :: eta_h
+
+      DO k = kts , kte-1
+         eta_h(k) = ( eta(k) + eta(k+1) ) * 0.5
+      END DO
+
+      DO j = jts , MIN ( jde-1 , jte )
+         DO k = kts , kte-1
+            DO i = its , MIN (ide-1 , ite )
+                  pdry(i,k,j) = eta_h(k) * mu0(i,j) + pdht
+            END DO
+         END DO
+      END DO
+
+   END SUBROUTINE p_dry
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE p_dts ( pdts , intq , psfc , p_top , &
+                      ids , ide , jds , jde , kds , kde , &
+                      ims , ime , jms , jme , kms , kme , &
+                      its , ite , jts , jte , kts , kte )
+
+   !  Compute difference between the dry, total surface pressure and the top pressure.
+   
+      IMPLICIT NONE
+
+      INTEGER , INTENT(IN)        :: ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte
+
+      REAL , INTENT(IN) :: p_top
+      REAL , DIMENSION(ims:ime,jms:jme) , INTENT(IN)     :: psfc
+      REAL , DIMENSION(ims:ime,jms:jme) , INTENT(IN)     :: intq
+      REAL , DIMENSION(ims:ime,jms:jme) , INTENT(OUT)    :: pdts
+
+      !  Local vars
+
+      INTEGER :: i , j , k 
+
+      DO j = jts , MIN ( jde-1 , jte )
+         DO i = its , MIN (ide-1 , ite )
+               pdts(i,j) = psfc(i,j) - intq(i,j) - p_top
+         END DO
+      END DO
+
+   END SUBROUTINE p_dts
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE p_dhs ( pdhs , ht , p0 , t0 , a , &
+                      ids , ide , jds , jde , kds , kde , &
+                      ims , ime , jms , jme , kms , kme , &
+                      its , ite , jts , jte , kts , kte )
+
+   !  Compute dry, hydrostatic surface pressure.
+   
+      IMPLICIT NONE
+
+      INTEGER , INTENT(IN)        :: ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte
+
+      REAL , DIMENSION(ims:ime,        jms:jme) , INTENT(IN)     :: ht
+      REAL , DIMENSION(ims:ime,        jms:jme) , INTENT(OUT)    :: pdhs
+
+      REAL , INTENT(IN) :: p0 , t0 , a
+
+      !  Local vars
+
+      INTEGER :: i , j , k 
+!****MARS ....
+      REAL , PARAMETER :: Rd = 192.
+      REAL , PARAMETER :: g  =   3.72
+print *,'compute dry, hydrostatic surface pressure'
+!****MARS ....
+
+      DO j = jts , MIN ( jde-1 , jte )
+         DO i = its , MIN (ide-1 , ite )
+               pdhs(i,j) = p0 * EXP ( -t0/a + SQRT ( (t0/a)**2 - 2. * g * ht(i,j)/(a * Rd) ) )
+         END DO
+      END DO
+
+!****MARS
+!****MARS cette formule est-elle juste sur Mars ?
+!****MARS >> a premiere vue, ne donne pas de resultats absurdes
+!****TODO: il y a peut etre meilleur !
+!****MARS
+
+!print *,pdhs
+!stop
+
+
+   END SUBROUTINE p_dhs
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE find_p_top ( p , p_top , &
+                           ids , ide , jds , jde , kds , kde , &
+                           ims , ime , jms , jme , kms , kme , &
+                           its , ite , jts , jte , kts , kte )
+
+   !  Find the largest pressure in the top level.  This is our p_top.  We are
+   !  assuming that the top level is the location where the pressure is a minimum
+   !  for each column.  In cases where the top surface is not isobaric, a 
+   !  communicated value must be shared in the calling routine.  Also in cases
+   !  where the top surface is not isobaric, care must be taken that the new
+   !  maximum pressure is not greater than the previous value.  This test is
+   !  also handled in the calling routine.
+
+      IMPLICIT NONE
+
+      INTEGER , INTENT(IN)        :: ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte
+
+      REAL :: p_top
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme) , INTENT(IN) :: p
+
+      !  Local vars
+
+      INTEGER :: i , j , k, min_lev
+
+      i = its
+      j = jts
+      p_top = p(i,2,j)
+      min_lev = 2
+      DO k = 2 , kte
+         IF ( p_top .GT. p(i,k,j) ) THEN
+            p_top = p(i,k,j)
+            min_lev = k
+         END IF
+      END DO
+
+      k = min_lev
+      p_top = p(its,k,jts)
+      DO j = jts , MIN ( jde-1 , jte )
+         DO i = its , MIN (ide-1 , ite )
+            p_top = MAX ( p_top , p(i,k,j) )
+         END DO
+      END DO
+
+   END SUBROUTINE find_p_top
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE t_to_theta ( t , p , p00 , &
+                      ids , ide , jds , jde , kds , kde , &
+                      ims , ime , jms , jme , kms , kme , &
+                      its , ite , jts , jte , kts , kte )
+
+   !  Compute dry, hydrostatic surface pressure.
+   
+      IMPLICIT NONE
+
+      INTEGER , INTENT(IN)        :: ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte
+
+      REAL , INTENT(IN) :: p00
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme) , INTENT(IN)     :: p
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme) , INTENT(INOUT)  :: t
+
+      !  Local vars
+
+      INTEGER :: i , j , k 
+!****MARS 
+      REAL , PARAMETER :: Rd = 192.
+      REAL , PARAMETER :: Cp = 844.6
+!****MARS
+      
+      DO j = jts , MIN ( jde-1 , jte )
+         DO k = kts , kte
+            DO i = its , MIN (ide-1 , ite )
+               t(i,k,j) = t(i,k,j) * ( p00 / p(i,k,j) ) ** (Rd / Cp)
+            END DO
+         END DO
+      END DO
+
+   END SUBROUTINE t_to_theta
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE integ_moist ( q_in , p_in , pd_out , t_in , ght_in , intq , &
+                            ids , ide , jds , jde , kds , kde , &
+                            ims , ime , jms , jme , kms , kme , &
+                            its , ite , jts , jte , kts , kte )
+
+   !  Integrate the moisture field vertically.  Mostly used to get the total
+   !  vapor pressure, which can be subtracted from the total pressure to get
+   !  the dry pressure.
+   
+      IMPLICIT NONE
+
+      INTEGER , INTENT(IN)        :: ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte
+
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme) , INTENT(IN)     :: q_in , p_in , t_in , ght_in
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme) , INTENT(OUT)    :: pd_out
+      REAL , DIMENSION(ims:ime,        jms:jme) , INTENT(OUT)    :: intq
+
+      !  Local vars
+
+      INTEGER :: i , j , k 
+      INTEGER , DIMENSION(ims:ime) :: level_above_sfc
+      REAL , DIMENSION(ims:ime,jms:jme) :: psfc , tsfc , qsfc, zsfc
+      REAL , DIMENSION(ims:ime,kms:kme) :: q , p , t , ght, pd
+
+      REAL :: rhobar , qbar , dz
+      REAL :: p1 , p2 , t1 , t2 , q1 , q2 , z1, z2
+  
+      LOGICAL :: upside_down
+
+!****MARS
+      REAL , PARAMETER :: Rd = 192.
+      REAL , PARAMETER :: g  =   3.72
+!****MARS
+      
+
+      !  Get a surface value, always the first level of a 3d field.
+
+      DO j = jts , MIN ( jde-1 , jte )
+         DO i = its , MIN (ide-1 , ite )
+            psfc(i,j) = p_in(i,kts,j)
+            tsfc(i,j) = t_in(i,kts,j)
+            qsfc(i,j) = q_in(i,kts,j)
+            zsfc(i,j) = ght_in(i,kts,j)
+         END DO
+      END DO
+
+      IF ( p_in(its,kts+1,jts) .LT. p_in(its,kte,jts) ) THEN
+         upside_down = .TRUE.
+      ELSE
+         upside_down = .FALSE.
+      END IF
+
+      DO j = jts , MIN ( jde-1 , jte )
+
+         !  Initialize the integrated quantity of moisture to zero.
+
+         DO i = its , MIN (ide-1 , ite )
+            intq(i,j) = 0.
+         END DO
+
+         IF ( upside_down ) THEN
+            DO i = its , MIN (ide-1 , ite )
+               p(i,kts) = p_in(i,kts,j)
+               t(i,kts) = t_in(i,kts,j)
+               q(i,kts) = q_in(i,kts,j)
+               ght(i,kts) = ght_in(i,kts,j)
+               DO k = kts+1,kte
+                  p(i,k) = p_in(i,kte+2-k,j)
+                  t(i,k) = t_in(i,kte+2-k,j)
+                  q(i,k) = q_in(i,kte+2-k,j)
+                  ght(i,k) = ght_in(i,kte+2-k,j)
+               END DO
+            END DO
+         ELSE
+            DO i = its , MIN (ide-1 , ite )
+               DO k = kts,kte
+                  p(i,k) = p_in(i,k      ,j)
+                  t(i,k) = t_in(i,k      ,j)
+                  q(i,k) = q_in(i,k      ,j)
+                  ght(i,k) = ght_in(i,k      ,j)
+               END DO
+            END DO
+         END IF
+
+         !  Find the first level above the ground.  If all of the levels are above ground, such as
+         !  a terrain following lower coordinate, then the first level above ground is index #2.
+
+         DO i = its , MIN (ide-1 , ite )
+            level_above_sfc(i) = -1
+            IF ( p(i,kts+1) .LT. psfc(i,j) ) THEN
+               level_above_sfc(i) = kts+1
+            ELSE
+               find_k : DO k = kts+1,kte-1
+                  IF ( ( p(i,k  )-psfc(i,j) .GE. 0. ) .AND. &
+                       ( p(i,k+1)-psfc(i,j) .LT. 0. ) ) THEN 
+                     level_above_sfc(i) = k+1
+                     EXIT find_k
+                  END IF
+               END DO find_k
+               IF ( level_above_sfc(i) .EQ. -1 ) THEN
+print *,'i,j = ',i,j
+print *,'p = ',p(i,:)
+print *,'p sfc = ',psfc(i,j)
+                  CALL wrf_error_fatal ( 'Could not find level above ground')
+               END IF
+            END IF
+         END DO
+
+         DO i = its , MIN (ide-1 , ite )
+
+            !  Account for the moisture above the ground.
+
+            pd(i,kte) = p(i,kte)
+            DO k = kte-1,level_above_sfc(i),-1
+                  rhobar = ( p(i,k  ) / ( Rd * t(i,k  ) ) + &
+                             p(i,k+1) / ( Rd * t(i,k+1) ) ) * 0.5
+                  qbar   = ( q(i,k  ) + q(i,k+1) ) * 0.5
+                  dz     = ght(i,k+1) - ght(i,k)
+                  intq(i,j) = intq(i,j) + g * qbar * rhobar / (1. + qbar) * dz
+                  pd(i,k) = p(i,k) - intq(i,j)
+            END DO
+
+            !  Account for the moisture between the surface and the first level up.
+
+            IF ( ( p(i,level_above_sfc(i)-1)-psfc(i,j) .GE. 0. ) .AND. &
+                 ( p(i,level_above_sfc(i)  )-psfc(i,j) .LT. 0. ) .AND. &
+                 ( level_above_sfc(i) .GT. kts ) ) THEN
+               p1 = psfc(i,j)
+               p2 = p(i,level_above_sfc(i))
+               t1 = tsfc(i,j)
+               t2 = t(i,level_above_sfc(i))
+               q1 = qsfc(i,j)
+               q2 = q(i,level_above_sfc(i))
+               z1 = zsfc(i,j)
+               z2 = ght(i,level_above_sfc(i))
+               rhobar = ( p1 / ( Rd * t1 ) + &
+                          p2 / ( Rd * t2 ) ) * 0.5
+               qbar   = ( q1 + q2 ) * 0.5
+               dz     = z2 - z1
+               IF ( dz .GT. 0.1 ) THEN
+                  intq(i,j) = intq(i,j) + g * qbar * rhobar / (1. + qbar) * dz
+               END IF
+              
+               !  Fix the underground values.
+
+               DO k = level_above_sfc(i)-1,kts+1,-1
+                  pd(i,k) = p(i,k) - intq(i,j)
+               END DO
+            END IF
+            pd(i,kts) = psfc(i,j) - intq(i,j)
+
+         END DO
+
+         IF ( upside_down ) THEN
+            DO i = its , MIN (ide-1 , ite )
+               pd_out(i,kts,j) = pd(i,kts)
+               DO k = kts+1,kte
+                  pd_out(i,kte+2-k,j) = pd(i,k)
+               END DO
+            END DO
+         ELSE
+            DO i = its , MIN (ide-1 , ite )
+               DO k = kts,kte
+                  pd_out(i,k,j) = pd(i,k)
+               END DO
+            END DO
+         END IF
+
+      END DO
+
+
+!!!****MARS: no water vapor pressure
+!!    DO k = level_above_sfc(i)-1,kts+1,-1
+!!         pd(i,k) = p(i,k)
+!!    END DO
+!!    pd(i,kts) = psfc(i,j)
+!!!****MARS
+
+
+   END SUBROUTINE integ_moist
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE rh_to_mxrat (rh, t, p, q , wrt_liquid , &
+                           ids , ide , jds , jde , kds , kde , &
+                           ims , ime , jms , jme , kms , kme , &
+                           its , ite , jts , jte , kts , kte )
+   
+      IMPLICIT NONE
+
+      INTEGER , INTENT(IN)        :: ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte
+
+      LOGICAL , INTENT(IN)        :: wrt_liquid
+
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme) , INTENT(IN)     :: p , t
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme) , INTENT(INOUT)  :: rh
+      REAL , DIMENSION(ims:ime,kms:kme,jms:jme) , INTENT(OUT)    :: q
+
+      !  Local vars
+
+      INTEGER                     :: i , j , k 
+
+      REAL                        :: ew , q1 , t1
+!****MARS ....  regler si besoin ....
+!****MARS
+      REAL,         PARAMETER     :: T_REF       = 0.0
+      REAL,         PARAMETER     :: MW_AIR      = 28.966
+      REAL,         PARAMETER     :: MW_VAP      = 18.0152
+
+      REAL,         PARAMETER     :: A0       = 6.107799961
+      REAL,         PARAMETER     :: A1       = 4.436518521e-01
+      REAL,         PARAMETER     :: A2       = 1.428945805e-02
+      REAL,         PARAMETER     :: A3       = 2.650648471e-04
+      REAL,         PARAMETER     :: A4       = 3.031240396e-06
+      REAL,         PARAMETER     :: A5       = 2.034080948e-08
+      REAL,         PARAMETER     :: A6       = 6.136820929e-11
+
+      REAL,         PARAMETER     :: ES0 = 6.1121
+
+      REAL,         PARAMETER     :: C1       = 9.09718
+      REAL,         PARAMETER     :: C2       = 3.56654
+      REAL,         PARAMETER     :: C3       = 0.876793
+      REAL,         PARAMETER     :: EIS      = 6.1071
+      REAL                        :: RHS
+      REAL,         PARAMETER     :: TF       = 273.16
+      REAL                        :: TK
+
+      REAL                        :: ES
+      REAL                        :: QS
+      REAL,         PARAMETER     :: EPS         = 0.622
+      REAL,         PARAMETER     :: SVP1        = 0.6112
+      REAL,         PARAMETER     :: SVP2        = 17.67
+      REAL,         PARAMETER     :: SVP3        = 29.65
+      REAL,         PARAMETER     :: SVPT0       = 273.15
+!****MARS
+!****MARS
+
+
+      !  This subroutine computes mixing ratio (q, kg/kg) from basic variables
+      !  pressure (p, Pa), temperature (t, K) and relative humidity (rh, 1-100%).
+      !  The reference temperature (t_ref, C) is used to describe the temperature 
+      !  at which the liquid and ice phase change occurs.
+
+      DO j = jts , MIN ( jde-1 , jte )
+         DO k = kts , kte
+            DO i = its , MIN (ide-1 , ite )
+                  rh(i,k,j) = MIN ( MAX ( rh(i,k,j) ,  1. ) , 100. ) 
+            END DO
+         END DO
+      END DO
+
+      IF ( wrt_liquid ) THEN
+         DO j = jts , MIN ( jde-1 , jte )
+            DO k = kts , kte
+               DO i = its , MIN (ide-1 , ite )
+                  es=svp1*10.*EXP(svp2*(t(i,k,j)-svpt0)/(t(i,k,j)-svp3))
+                  qs=eps*es/(p(i,k,j)/100.-es)
+                  q(i,k,j)=MAX(.01*rh(i,k,j)*qs,0.0)
+               END DO
+            END DO
+         END DO
+
+      ELSE
+         DO j = jts , MIN ( jde-1 , jte )
+            DO k = kts , kte
+               DO i = its , MIN (ide-1 , ite )
+
+                  t1 = t(i,k,j) - 273.16
+
+                  !  Obviously dry.
+
+                  IF ( t1 .lt. -200. ) THEN
+                     q(i,k,j) = 0
+
+                  ELSE
+
+                     !  First compute the ambient vapor pressure of water
+
+                     IF ( ( t1 .GE. t_ref ) .AND. ( t1 .GE. -47.) ) THEN    ! liq phase ESLO
+                        ew = a0 + t1 * (a1 + t1 * (a2 + t1 * (a3 + t1 * (a4 + t1 * (a5 + t1 * a6)))))
+
+                     ELSE IF ( ( t1 .GE. t_ref ) .AND. ( t1 .LT. -47. ) ) then !liq phas poor ES
+                        ew = es0 * exp(17.67 * t1 / ( t1 + 243.5))
+
+                     ELSE
+                        tk = t(i,k,j)
+                        rhs = -c1 * (tf / tk - 1.) - c2 * alog10(tf / tk) +  &
+                               c3 * (1. - tk / tf) +      alog10(eis)
+                        ew = 10. ** rhs
+
+                     END IF
+
+                     !  Now sat vap pres obtained compute local vapor pressure
+  
+                     ew = MAX ( ew , 0. ) * rh(i,k,j) * 0.01
+
+                     !  Now compute the specific humidity using the partial vapor
+                     !  pressures of water vapor (ew) and dry air (p-ew).  The
+                     !  constants assume that the pressure is in hPa, so we divide
+                     !  the pressures by 100.
+
+                     q1 = mw_vap * ew
+                     q1 = q1 / (q1 + mw_air * (p(i,k,j)/100. - ew))
+
+                     q(i,k,j) = q1 / (1. - q1 )
+
+                  END IF
+
+               END DO
+            END DO
+         END DO
+
+      END IF
+
+!!****MARS
+!!TODO: change once tracers are activated ?
+!q=0.
+!!****MARS
+
+   END SUBROUTINE rh_to_mxrat
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE compute_eta ( znw , &
+                           eta_levels , max_eta , max_dz , &
+fixedpbl, &
+                           p_top , g , p00 , cvpm , a , r_d , cp , t00 , p1000mb , t0 , &
+                           ids , ide , jds , jde , kds , kde , &
+                           ims , ime , jms , jme , kms , kme , &
+                           its , ite , jts , jte , kts , kte )
+   
+      !  Compute eta levels, either using given values from the namelist (hardly
+      !  a computation, yep, I know), or assuming a constant dz above the PBL,
+      !  knowing p_top and the number of eta levels.
+
+      IMPLICIT NONE
+
+      INTEGER , INTENT(IN)        :: ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte
+      REAL , INTENT(IN)           :: max_dz
+      REAL , INTENT(IN)           :: p_top , g , p00 , cvpm , a , r_d , cp , t00 , p1000mb , t0
+      INTEGER , INTENT(IN)        :: max_eta
+      REAL , DIMENSION (max_eta) , INTENT(IN)  :: eta_levels
+
+      REAL , DIMENSION (kts:kte) , INTENT(OUT) :: znw
+
+      !  Local vars
+
+      INTEGER :: k 
+      REAL :: mub , t_init , p_surf , pb, ztop, ztop_pbl , dz , temp
+      REAL , DIMENSION(kts:kte) :: dnw
+
+      INTEGER , PARAMETER :: prac_levels = 17
+      INTEGER :: loop , loop1
+      REAL , DIMENSION(prac_levels) :: znw_prac , znu_prac , dnw_prac
+      REAL , DIMENSION(kts:kte) :: alb , phb
+
+
+!****MARS      
+!****MARS
+INTEGER :: fixedpbl   ! usually, 8 first layers are fixed
+                    ! change this parameter if the top is very
+                    ! low     
+print *, 'check Mars: p_top , g , p00 , cvpm , a , r_d , cp , t00 , p1000mb , t0' 
+print *, p_top , g , p00 , cvpm , a , r_d , cp , t00 , p1000mb , t0
+!-----solution alternative: definir dans la namelist les niveaux verticaux
+!****MARS
+!****MARS
+
+
+      !  Gee, do the eta levels come in from the namelist?
+
+      IF ( ABS(eta_levels(1)+1.) .GT. 0.0000001 ) THEN
+
+         IF ( ( ABS(eta_levels(1  )-1.) .LT. 0.0000001 ) .AND. &
+              ( ABS(eta_levels(kde)-0.) .LT. 0.0000001 ) ) THEN
+            DO k = kds+1 , kde-1
+               znw(k) = eta_levels(k)
+            END DO
+            znw(  1) = 1.
+            znw(kde) = 0.
+
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+p_surf=p00
+print *, 'prescribed levels'
+DO k = 1, kde
+	pb = znw(k) * (p_surf - p_top) + p_top
+	print *, 'level', k, &
+		 ', pressure (Pa)', pb, &
+		 ', logp height (m)', -10000.*log(pb/p00) 
+END DO
+!mub = p_surf - p_top
+!DO k = 1, kde-1
+!    pb = (znw(k)+znw(k+1))*0.5 * (p_surf - p_top) + p_top
+!    !temp = MAX ( 200., t00 + A*LOG(pb/p00) )
+!    temp =             t00 + A*LOG(pb/p00)
+!    t_init = temp*(p00/pb)**(r_d/cp) - t0
+!    alb(k) = (r_d/p1000mb)*(t_init+t0)*(pb/p1000mb)**cvpm
+!END DO
+!phb(1) = 0.
+!DO k  = 2,kde
+!    phb(k) = phb(k-1) - (znw(k)-znw(k-1)) * mub*alb(k-1)
+!END DO
+!ztop = phb(kde)/g
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+
+
+         ELSE
+            CALL wrf_error_fatal ( 'First eta level should be 1.0 and the last 0.0 in namelist' )
+         END IF
+
+      !  Compute eta levels assuming a constant delta z above the PBL.
+
+      ELSE
+
+         !  Compute top of the atmosphere with some silly levels.  We just want to
+         !  integrate to get a reasonable value for ztop.  We use the planned PBL-esque
+         !  levels, and then just coarse resolution above that.  We know p_top, and we
+         !  have the base state vars.
+
+         p_surf = p00 
+
+!         znw_prac = (/ 1.000 , 0.993 , 0.983 , 0.970 , 0.954 , 0.934 , 0.909 , &
+!                       0.88 , 0.8 , 0.7 , 0.6 , 0.5 , 0.4 , 0.3 , 0.2 , 0.1 , 0.0 /)
+
+!****MARS
+!****MARS
+! on Mars, this is important to correctly resolve the surface
+! -- levels were changed to get closer to the surface
+! -- values were chosen as done typically in LMD GCM simulations
+!TODO: better repartition ?
+
+!        znw_prac = (/ 1.000 , &
+!                        0.9999 , & !1m
+!                        0.9995 , & !5m
+!                        0.9980 , & !20m
+!                        0.9950 , & !55m
+!                        0.9850 , & !166m
+!                        0.9550 , & !504m  0.9700 , & !334m  0.9400 , & !676m
+!                        0.9000 , &
+!                        0.8 , 0.7 , 0.6 , 0.5 , 0.4 , 0.3 , 0.2 , 0.1 , 0.0 /)
+
+
+!        znw_prac = (/ 1.000 , &         
+!                        0.9995 , &      !5m
+!                        0.9980 , &      !20m
+!                        0.9950 , &      !55m
+!                        0.9850 , &      !166m
+!                        0.9700 , &      !334m
+!                        0.9400 , &      !676m
+!                        0.9000 , &
+!                        0.8 , 0.7 , 0.6 , 0.5 , 0.4 , 0.3 , 0.2 , 0.1 , 0.0 /)
+
+
+        znw_prac = (/ 1.000 , &         
+                        0.9985 , &      !15m
+                        0.9960 , &      !45m
+                        0.9900 , &      !100m
+                        0.9700 , &      !334m
+                        0.9400 , &      !676m
+                        0.9000 , &
+                        0.85, &
+                        0.8 , 0.7 , 0.6 , 0.5 , 0.4 , 0.3 , 0.2 , 0.1 , 0.0 /)
+
+
+!****MARS
+!****MARS
+
+
+         DO k = 1 , prac_levels - 1
+            znu_prac(k) = ( znw_prac(k) + znw_prac(k+1) ) * 0.5
+            dnw_prac(k) = znw_prac(k+1) - znw_prac(k)
+         END DO
+
+         DO k = 1, prac_levels-1
+            pb = znu_prac(k)*(p_surf - p_top) + p_top
+!           temp = MAX ( 200., t00 + A*LOG(pb/p00) )
+            temp =             t00 + A*LOG(pb/p00)
+            t_init = temp*(p00/pb)**(r_d/cp) - t0
+            alb(k) = (r_d/p1000mb)*(t_init+t0)*(pb/p1000mb)**cvpm
+         END DO
+       
+         !  Base state mu is defined as base state surface pressure minus p_top
+
+         mub = p_surf - p_top
+       
+         !  Integrate base geopotential, starting at terrain elevation.
+
+         phb(1) = 0.
+         DO k  = 2,prac_levels
+               phb(k) = phb(k-1) - dnw_prac(k-1)*mub*alb(k-1)
+         END DO
+
+         !  So, now we know the model top in meters.  Get the average depth above the PBL
+         !  of each of the remaining levels.  We are going for a constant delta z thickness.
+
+         ztop     = phb(prac_levels) / g
+         ztop_pbl = phb(fixedpbl) / g
+         dz = ( ztop - ztop_pbl ) / REAL ( kde - fixedpbl )
+
+         !  Standard levels near the surface so no one gets in trouble.
+         DO k = 1 , fixedpbl
+            znw(k) = znw_prac(k)
+         END DO
+
+         !  Using d phb(k)/ d eta(k) = -mub * alb(k), eqn 2.9 
+         !  Skamarock et al, NCAR TN 468.  Use full levels, so
+         !  use twice the thickness.
+
+         DO k = fixedpbl, kte-1
+            pb = znw(k) * (p_surf - p_top) + p_top
+!           temp = MAX ( 200., t00 + A*LOG(pb/p00) )
+            temp =             t00 + A*LOG(pb/p00)
+            t_init = temp*(p00/pb)**(r_d/cp) - t0
+            alb(k) = (r_d/p1000mb)*(t_init+t0)*(pb/p1000mb)**cvpm
+            znw(k+1) = znw(k) - dz*g / ( mub*alb(k) )
+         END DO
+         znw(kte) = 0.000
+
+         !  There is some iteration.  We want the top level, ztop, to be
+         !  consistent with the delta z, and we want the half level values
+         !  to be consistent with the eta levels.  The inner loop to 10 gets
+         !  the eta levels very accurately, but has a residual at the top, due
+         !  to dz changing.  We reset dz five times, and then things seem OK.
+
+
+         DO loop1 = 1 , 5
+            DO loop = 1 , 10
+               DO k = fixedpbl, kte-1
+                  pb = (znw(k)+znw(k+1))*0.5 * (p_surf - p_top) + p_top
+!                 temp = MAX ( 200., t00 + A*LOG(pb/p00) )
+                  temp =             t00 + A*LOG(pb/p00)
+                  t_init = temp*(p00/pb)**(r_d/cp) - t0
+                  alb(k) = (r_d/p1000mb)*(t_init+t0)*(pb/p1000mb)**cvpm
+                  znw(k+1) = znw(k) - dz*g / ( mub*alb(k) )
+!!****MARS
+!!attention 'base_lapse' ne doit pas etre trop grand
+!!sinon ... des NaN car temperatures negatives en haut
+!IF ( ( loop1 .EQ. 5 ) .AND. ( loop .EQ. 10 ) ) THEN
+!	IF (k .EQ. 8) THEN
+!		print *, 'p,t,z,k'
+!	END IF
+!	print *,  pb,temp,znw(k+1),k 
+!END IF
+!****MARS
+               END DO
+               IF ( ( loop1 .EQ. 5 ) .AND. ( loop .EQ. 10 ) ) THEN
+                  print *,'Converged znw(kte) should be 0.0 = ',znw(kte)
+               END IF
+               znw(kte) = 0.000
+            END DO
+
+            !  Here is where we check the eta levels values we just computed.
+
+            DO k = 1, kde-1
+               pb = (znw(k)+znw(k+1))*0.5 * (p_surf - p_top) + p_top
+!              temp = MAX ( 200., t00 + A*LOG(pb/p00) )
+               temp =             t00 + A*LOG(pb/p00)
+               t_init = temp*(p00/pb)**(r_d/cp) - t0
+               alb(k) = (r_d/p1000mb)*(t_init+t0)*(pb/p1000mb)**cvpm
+            END DO
+
+            phb(1) = 0.
+            DO k  = 2,kde
+                  phb(k) = phb(k-1) - (znw(k)-znw(k-1)) * mub*alb(k-1)
+            END DO
+
+            !  Reset the model top and the dz, and iterate.
+
+            ztop = phb(kde)/g
+            ztop_pbl = phb(fixedpbl)/g
+            dz = ( ztop - ztop_pbl ) / REAL ( kde - fixedpbl ) 
+         END DO
+
+
+! ****MARS
+
+print *, 'eta_levels= ', znw
+
+
+! Display the computed levels
+print *,'WRF levels are:'
+print *,'z (m)            = ',phb(1)/g
+do k = 2 ,kte
+print *,'z (m) and dz (m) = ',phb(k)/g,(phb(k)-phb(k-1))/g
+
+
+                !! little check of the repartition
+                if (k>2) then
+                if ((phb(k)-2.*phb(k-1)+phb(k-2))/g < -1.e-2) then
+                        print *, 'problem on the repartition' 
+                        print *, '>> try to decrease force_sfc_in_vinterp (<8)'
+                        print *, '>> or increase model top (i.e. lower ptop)'
+                        print *,  (phb(k)-2.*phb(k-1)+phb(k-2))/g
+                        stop
+                endif
+                endif
+end do
+! ****MARS
+
+
+         IF ( dz .GT. max_dz ) THEN
+print *,'z (m)            = ',phb(1)/g
+do k = 2 ,kte
+print *,'z (m) and dz (m) = ',phb(k)/g,(phb(k)-phb(k-1))/g
+end do
+print *,'dz (m) above fixed eta levels = ',dz
+print *,'namelist max_dz (m) = ',max_dz
+print *,'namelist p_top (Pa) = ',p_top
+            CALL wrf_debug ( 0, 'You need one of three things:' )
+            CALL wrf_debug ( 0, '1) More eta levels to reduce the dz: e_vert' )
+            CALL wrf_debug ( 0, '2) A lower p_top so your total height is reduced: p_top_requested')
+            CALL wrf_debug ( 0, '3) Increase the maximum allowable eta thickness: max_dz')
+            CALL wrf_debug ( 0, 'All are namelist options')
+            CALL wrf_error_fatal ( 'dz above fixed eta levels is too large')
+         END IF
+
+      END IF
+
+   END SUBROUTINE compute_eta
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE monthly_min_max ( field_in , field_min , field_max , &
+                      ids , ide , jds , jde , kds , kde , &
+                      ims , ime , jms , jme , kms , kme , &
+                      its , ite , jts , jte , kts , kte )
+
+   !  Plow through each month, find the max, min values for each i,j.
+   
+      IMPLICIT NONE
+
+      INTEGER , INTENT(IN)        :: ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte
+
+      REAL , DIMENSION(ims:ime,12,jms:jme) , INTENT(IN)  :: field_in
+      REAL , DIMENSION(ims:ime,   jms:jme) , INTENT(OUT) :: field_min , field_max
+
+      !  Local vars
+
+      INTEGER :: i , j , l
+      REAL :: minner , maxxer
+
+      DO j = jts , MIN(jde-1,jte)
+         DO i = its , MIN(ide-1,ite)
+            minner = field_in(i,1,j)
+            maxxer = field_in(i,1,j)
+            DO l = 2 , 12
+               IF ( field_in(i,l,j) .LT. minner ) THEN
+                  minner = field_in(i,l,j)
+               END IF
+               IF ( field_in(i,l,j) .GT. maxxer ) THEN
+                  maxxer = field_in(i,l,j)
+               END IF
+            END DO
+            field_min(i,j) = minner
+            field_max(i,j) = maxxer
+         END DO
+      END DO
+   
+   END SUBROUTINE monthly_min_max
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE monthly_interp_to_date ( field_in , date_str , field_out , &
+                      ids , ide , jds , jde , kds , kde , &
+                      ims , ime , jms , jme , kms , kme , &
+                      its , ite , jts , jte , kts , kte )
+
+   !  Linrarly in time interpolate data to a current valid time.  The data is
+   !  assumed to come in "monthly", valid at the 15th of every month.
+   
+      IMPLICIT NONE
+
+      INTEGER , INTENT(IN)        :: ids , ide , jds , jde , kds , kde , &
+                                     ims , ime , jms , jme , kms , kme , &
+                                     its , ite , jts , jte , kts , kte
+
+      CHARACTER (LEN=24) , INTENT(IN) :: date_str
+      REAL , DIMENSION(ims:ime,12,jms:jme) , INTENT(IN)  :: field_in
+      REAL , DIMENSION(ims:ime,   jms:jme) , INTENT(OUT) :: field_out
+
+      !  Local vars
+
+      INTEGER :: i , j , l
+      INTEGER , DIMENSION(0:13) :: middle
+      INTEGER :: target_julyr , target_julday , target_date
+      INTEGER :: julyr , julday , int_month , month1 , month2
+      REAL :: gmt
+      CHARACTER (LEN=4) :: yr
+      CHARACTER (LEN=2) :: mon , day15
+
+
+      WRITE(day15,FMT='(I2.2)') 15
+      DO l = 1 , 12
+         WRITE(mon,FMT='(I2.2)') l
+         CALL get_julgmt ( date_str(1:4)//'-'//mon//'-'//day15//'_'//'00:00:00.0000' , julyr , julday , gmt )
+         middle(l) = julyr*1000 + julday
+      END DO
+
+      l = 0
+      middle(l) = middle( 1) - 31
+
+      l = 13
+      middle(l) = middle(12) + 31
+
+      CALL get_julgmt ( date_str , target_julyr , target_julday , gmt )
+      target_date = target_julyr * 1000 + target_julday
+      find_month : DO l = 0 , 12
+         IF ( ( middle(l) .LT. target_date ) .AND. ( middle(l+1) .GE. target_date ) ) THEN
+            DO j = jts , MIN ( jde-1 , jte )
+               DO i = its , MIN (ide-1 , ite )
+                  int_month = l
+                  IF ( ( int_month .EQ. 0 ) .OR. ( int_month .EQ. 12 ) ) THEN
+                     month1 = 12
+                     month2 =  1
+                  ELSE
+                     month1 = int_month
+                     month2 = month1 + 1
+                  END IF
+                  field_out(i,j) =  ( field_in(i,month2,j) * ( target_date - middle(l)   ) + &
+                                      field_in(i,month1,j) * ( middle(l+1) - target_date ) ) / &
+                                    ( middle(l+1) - middle(l) )
+               END DO
+            END DO
+            EXIT find_month
+         END IF
+      END DO find_month
+
+   END SUBROUTINE monthly_interp_to_date
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE sfcprs (t, q, height, pslv, ter, avgsfct, p, &
+                      psfc, ez_method, &
+                      ids , ide , jds , jde , kds , kde , &
+                      ims , ime , jms , jme , kms , kme , &
+                      its , ite , jts , jte , kts , kte )
+
+
+      !  Computes the surface pressure using the input height,
+      !  temperature and q (already computed from relative
+      !  humidity) on p surfaces.  Sea level pressure is used
+      !  to extrapolate a first guess.
+
+      IMPLICIT NONE
+
+!****MARS
+      REAL , PARAMETER :: Rd = 192.
+      REAL , PARAMETER :: Cp = 844.6
+      REAL, PARAMETER    :: g = 3.72
+      REAL, PARAMETER    :: pconst = 610.
+!****MARS
+      
+!****MARS .... to be changed if used
+      REAL, PARAMETER    :: gamma     = 6.5E-3
+      REAL, PARAMETER    :: TC        = 273.15 + 17.5
+      REAL, PARAMETER    :: gammarg   = gamma * Rd / g
+      REAL, PARAMETER    :: rov2      = Rd / 2.
+!****MARS .... to be changed if used
+
+      INTEGER , INTENT(IN) ::  ids , ide , jds , jde , kds , kde , &
+                               ims , ime , jms , jme , kms , kme , &
+                               its , ite , jts , jte , kts , kte 
+      LOGICAL , INTENT ( IN ) :: ez_method
+
+      REAL , DIMENSION (ims:ime,kms:kme,jms:jme) , INTENT(IN ):: t, q, height, p
+      REAL , DIMENSION (ims:ime,        jms:jme) , INTENT(IN ):: pslv ,  ter, avgsfct 
+      REAL , DIMENSION (ims:ime,        jms:jme) , INTENT(OUT):: psfc
+      
+      INTEGER                     :: i
+      INTEGER                     :: j
+      INTEGER                     :: k
+      INTEGER , DIMENSION (its:ite,jts:jte) :: k500 , k700 , k850
+
+      LOGICAL                     :: l1
+      LOGICAL                     :: l2
+      LOGICAL                     :: l3
+      LOGICAL                     :: OK
+
+      REAL                        :: gamma78     ( its:ite,jts:jte )
+      REAL                        :: gamma57     ( its:ite,jts:jte )
+      REAL                        :: ht          ( its:ite,jts:jte )
+      REAL                        :: p1          ( its:ite,jts:jte )
+      REAL                        :: t1          ( its:ite,jts:jte )
+      REAL                        :: t500        ( its:ite,jts:jte )
+      REAL                        :: t700        ( its:ite,jts:jte )
+      REAL                        :: t850        ( its:ite,jts:jte )
+      REAL                        :: tfixed      ( its:ite,jts:jte )
+      REAL                        :: tsfc        ( its:ite,jts:jte )
+      REAL                        :: tslv        ( its:ite,jts:jte )
+
+      !  We either compute the surface pressure from a time averaged surface temperature
+      !  (what we will call the "easy way"), or we try to remove the diurnal impact on the
+      !  surface temperature (what we will call the "other way").  Both are essentially 
+      !  corrections to a sea level pressure with a high-resolution topography field.
+
+!****MARS ....
+!****MARS .... the mean sea level method is abandoned
+print *, 'no sea level pressure on Mars, please'
+stop
+!****MARS ....
+
+      IF ( ez_method ) THEN
+
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+               psfc(i,j) = pslv(i,j) * ( 1.0 + gamma * ter(i,j) / avgsfct(i,j) ) ** ( - g / ( Rd * gamma ) )
+            END DO
+         END DO
+
+      ELSE
+
+         !  Find the locations of the 850, 700 and 500 mb levels.
+   
+         k850 = 0                              ! find k at: P=850
+         k700 = 0                              !            P=700
+         k500 = 0                              !            P=500
+   
+         i = its
+         j = jts
+         DO k = kts+1 , kte
+            IF      (NINT(p(i,k,j)) .EQ. 85000) THEN
+               k850(i,j) = k
+            ELSE IF (NINT(p(i,k,j)) .EQ. 70000) THEN
+               k700(i,j) = k
+            ELSE IF (NINT(p(i,k,j)) .EQ. 50000) THEN
+               k500(i,j) = k
+            END IF
+         END DO
+   
+         IF ( ( k850(i,j) .EQ. 0 ) .OR. ( k700(i,j) .EQ. 0 ) .OR. ( k500(i,j) .EQ. 0 ) ) THEN
+
+            DO j = jts , MIN(jde-1,jte)
+               DO i = its , MIN(ide-1,ite)
+                  psfc(i,j) = pslv(i,j) * ( 1.0 + gamma * ter(i,j) / t(i,1,j) ) ** ( - g / ( Rd * gamma ) )
+               END DO
+            END DO
+            
+            RETURN
+#if 0
+
+            !  Possibly it is just that we have a generalized vertical coord, so we do not
+            !  have the values exactly.  Do a simple assignment to a close vertical level.
+
+            DO j = jts , MIN(jde-1,jte)
+               DO i = its , MIN(ide-1,ite)
+                  DO k = kts+1 , kte-1
+                     IF ( ( p(i,k,j) - 85000. )  * ( p(i,k+1,j) - 85000. ) .LE. 0.0 ) THEN
+                        k850(i,j) = k
+                     END IF
+                     IF ( ( p(i,k,j) - 70000. )  * ( p(i,k+1,j) - 70000. ) .LE. 0.0 ) THEN
+                        k700(i,j) = k
+                     END IF
+                     IF ( ( p(i,k,j) - 50000. )  * ( p(i,k+1,j) - 50000. ) .LE. 0.0 ) THEN
+                        k500(i,j) = k
+                     END IF
+                  END DO
+               END DO
+            END DO
+
+            !  If we *still* do not have the k levels, punt.  I mean, we did try.
+
+            OK = .TRUE.
+            DO j = jts , MIN(jde-1,jte)
+               DO i = its , MIN(ide-1,ite)
+                  IF ( ( k850(i,j) .EQ. 0 ) .OR. ( k700(i,j) .EQ. 0 ) .OR. ( k500(i,j) .EQ. 0 ) ) THEN
+                     OK = .FALSE.
+                     PRINT '(A)','(i,j) = ',i,j,'  Error in finding p level for 850, 700 or 500 hPa.'
+                     DO K = kts+1 , kte
+                        PRINT '(A,I3,A,F10.2,A)','K = ',k,'  PRESSURE = ',p(i,k,j),' Pa'
+                     END DO
+                     PRINT '(A)','Expected 850, 700, and 500 mb values, at least.'
+                  END IF
+               END DO
+            END DO
+            IF ( .NOT. OK ) THEN
+               CALL wrf_error_fatal ( 'wrong pressure levels' )
+            END IF
+#endif
+
+         !  We are here if the data is isobaric and we found the levels for 850, 700,
+         !  and 500 mb right off the bat.
+
+         ELSE
+            DO j = jts , MIN(jde-1,jte)
+               DO i = its , MIN(ide-1,ite)
+                  k850(i,j) = k850(its,jts)
+                  k700(i,j) = k700(its,jts)
+                  k500(i,j) = k500(its,jts)
+               END DO
+            END DO
+         END IF
+       
+         !  The 850 hPa level of geopotential height is called something special.
+   
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+               ht(i,j) = height(i,k850(i,j),j)
+            END DO
+         END DO
+   
+         !  The variable ht is now -ter/ht(850 hPa).  The plot thickens.
+   
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+               ht(i,j) = -ter(i,j) / ht(i,j)
+            END DO
+         END DO
+   
+         !  Make an isothermal assumption to get a first guess at the surface
+         !  pressure.  This is to tell us which levels to use for the lapse
+         !  rates in a bit.
+   
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+               psfc(i,j) = pslv(i,j) * (pslv(i,j) / p(i,k850(i,j),j)) ** ht(i,j)
+            END DO
+         END DO
+   
+         !  Get a pressure more than pconst Pa above the surface - p1.  The
+         !  p1 is the top of the level that we will use for our lapse rate
+         !  computations.
+   
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+               IF      ( ( psfc(i,j) - 95000. ) .GE. 0. ) THEN
+                  p1(i,j) = 85000.
+               ELSE IF ( ( psfc(i,j) - 70000. ) .GE. 0. ) THEN
+                  p1(i,j) = psfc(i,j) - pconst
+               ELSE
+                  p1(i,j) = 50000.
+               END IF
+            END DO
+         END DO
+   
+         !  Compute virtual temperatures for k850, k700, and k500 layers.  Now
+         !  you see why we wanted Q on pressure levels, it all is beginning   
+         !  to make sense.
+   
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+               t850(i,j) = t(i,k850(i,j),j) * (1. + 0.608 * q(i,k850(i,j),j))
+               t700(i,j) = t(i,k700(i,j),j) * (1. + 0.608 * q(i,k700(i,j),j))
+               t500(i,j) = t(i,k500(i,j),j) * (1. + 0.608 * q(i,k500(i,j),j))
+            END DO
+         END DO
+   
+         !  Compute lapse rates between these three levels.  These are
+         !  environmental values for each (i,j).
+   
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+               gamma78(i,j) = ALOG(t850(i,j) / t700(i,j))  / ALOG (p(i,k850(i,j),j) / p(i,k700(i,j),j) )
+               gamma57(i,j) = ALOG(t700(i,j) / t500(i,j))  / ALOG (p(i,k700(i,j),j) / p(i,k500(i,j),j) )
+            END DO
+         END DO
+   
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+               IF      ( ( psfc(i,j) - 95000. ) .GE. 0. ) THEN
+                  t1(i,j) = t850(i,j)
+               ELSE IF ( ( psfc(i,j) - 85000. ) .GE. 0. ) THEN
+                  t1(i,j) = t700(i,j) * (p1(i,j) / (p(i,k700(i,j),j))) ** gamma78(i,j)
+               ELSE IF ( ( psfc(i,j) - 70000. ) .GE. 0.) THEN 
+                  t1(i,j) = t500(i,j) * (p1(i,j) / (p(i,k500(i,j),j))) ** gamma57(i,j)
+               ELSE
+                  t1(i,j) = t500(i,j)
+               ENDIF
+            END DO 
+         END DO 
+   
+         !  From our temperature way up in the air, we extrapolate down to
+         !  the sea level to get a guess at the sea level temperature.
+   
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+               tslv(i,j) = t1(i,j) * (pslv(i,j) / p1(i,j)) ** gammarg
+            END DO 
+         END DO 
+   
+         !  The new surface temperature is computed from the with new sea level 
+         !  temperature, just using the elevation and a lapse rate.  This lapse 
+         !  rate is -6.5 K/km.
+   
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+               tsfc(i,j) = tslv(i,j) - gamma * ter(i,j)
+            END DO 
+         END DO 
+   
+         !  A small correction to the sea-level temperature, in case it is too warm.
+   
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+               tfixed(i,j) = tc - 0.005 * (tsfc(i,j) - tc) ** 2
+            END DO 
+         END DO 
+   
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+               l1 = tslv(i,j) .LT. tc
+               l2 = tsfc(i,j) .LE. tc
+               l3 = .NOT. l1
+               IF      ( l2 .AND. l3 ) THEN
+                  tslv(i,j) = tc
+               ELSE IF ( ( .NOT. l2 ) .AND. l3 ) THEN
+                  tslv(i,j) = tfixed(i,j)
+               END IF
+            END DO
+         END DO
+   
+         !  Finally, we can get to the surface pressure.
+
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+            p1(i,j) = - ter(i,j) * g / ( rov2 * ( tsfc(i,j) + tslv(i,j) ) )
+            psfc(i,j) = pslv(i,j) * EXP ( p1(i,j) )
+            END DO
+         END DO
+
+      END IF
+
+      !  Surface pressure and sea-level pressure are the same at sea level.
+
+!     DO j = jts , MIN(jde-1,jte)
+!        DO i = its , MIN(ide-1,ite)
+!           IF ( ABS ( ter(i,j) )  .LT. 0.1 ) THEN
+!              psfc(i,j) = pslv(i,j)
+!           END IF
+!        END DO
+!     END DO
+
+   END SUBROUTINE sfcprs
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE sfcprs2(t, q, height, psfc_in, ter, avgsfct, p, &
+                      psfc, ez_method, &
+                      ids , ide , jds , jde , kds , kde , &
+                      ims , ime , jms , jme , kms , kme , &
+                      its , ite , jts , jte , kts , kte )
+
+
+      !  Computes the surface pressure using the input height,
+      !  temperature and q (already computed from relative
+      !  humidity) on p surfaces.  Sea level pressure is used
+      !  to extrapolate a first guess.
+
+      IMPLICIT NONE
+
+!****MARS
+      REAL , PARAMETER :: Rd = 192.
+      REAL, PARAMETER    :: g = 3.72
+!****MARS
+
+      INTEGER , INTENT(IN) ::  ids , ide , jds , jde , kds , kde , &
+                               ims , ime , jms , jme , kms , kme , &
+                               its , ite , jts , jte , kts , kte 
+      LOGICAL , INTENT ( IN ) :: ez_method
+
+      REAL , DIMENSION (ims:ime,kms:kme,jms:jme) , INTENT(IN ):: t, q, height, p
+      REAL , DIMENSION (ims:ime,        jms:jme) , INTENT(IN ):: psfc_in ,  ter, avgsfct 
+      REAL , DIMENSION (ims:ime,        jms:jme) , INTENT(OUT):: psfc
+      
+      INTEGER                     :: i
+      INTEGER                     :: j
+      INTEGER                     :: k
+
+      REAL :: tv_sfc_avg , tv_sfc , del_z
+
+      !  Compute the new surface pressure from the old surface pressure, and a
+      !  known change in elevation at the surface.
+
+
+!****MARS: as is done in MCD/pres0 with the MOLA topography :)
+
+        !!---------
+        !!  del_z = diff in surface topo, lo-res vs hi-res
+        !grid%em_ght_gc - grid%ht
+        !!---------
+        !!* em_ght_gc: surface geopotential height from the GCM 
+        !!* ht: hi-res altimetry
+        !  psfc = psfc_in * exp ( g del_z / (Rd Tv_sfc ) )
+        !!---------
+
+
+      IF ( ez_method ) THEN
+!!
+!!****MARS: 'ez_method' is 'we_have_tavgsfc', hard-coded as false
+!!
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+               tv_sfc_avg = avgsfct(i,j) * (1. + 0.608 * q(i,1,j))
+               del_z = height(i,1,j) - ter(i,j)
+               psfc(i,j) = psfc_in(i,j) * EXP ( g * del_z / ( Rd * tv_sfc_avg ) )
+            END DO
+         END DO
+      ELSE
+!!              
+!!****MARS .... here is what is done for Mars
+!!
+         DO j = jts , MIN(jde-1,jte)
+            DO i = its , MIN(ide-1,ite)
+!               tv_sfc = t(i,1,j) * (1. + 0.608 * q(i,1,j))
+!!****MARS: 0.608 >> nonsense on Mars 
+tv_sfc = t(i,1,j)
+!!****MARS .... changer pour t_1km - 7e couche GCM
+!!****MARS .... spiga et al. (2007)
+tv_sfc = t(i,8,j)
+               del_z = height(i,1,j) - ter(i,j)
+               psfc(i,j) = psfc_in(i,j) * EXP ( g * del_z / ( Rd * tv_sfc     ) )
+!****MARS
+!****MARS .... which temperature is used in the Laplace formula ?
+!!****MARS: hardcoded as 220K (t0)
+!!****MARS: pas une enorme influence
+!psfc(i,j) = psfc_in(i,j) * EXP ( g * del_z / ( Rd * 220 ) )
+
+               
+!	       !****MARS .... check of the altimetry differences
+!	       print *,del_z, tv_sfc
+
+            END DO
+         END DO
+print *, '1 km temperatures - max'         
+print *, MAXVAL(t(:,8,:))         
+      END IF
+
+   END SUBROUTINE sfcprs2
+
+!---------------------------------------------------------------------
+
+   SUBROUTINE init_module_initialize
+   END SUBROUTINE init_module_initialize
+
+!---------------------------------------------------------------------
+   SUBROUTINE constante3(field, field_custom, &
+                      ids , ide , jds , jde , kds , kde , &
+                      ims , ime , jms , jme , kms , kme , &
+                      its , ite , jts , jte , kts , kte )
+
+
+      IMPLICIT NONE
+
+      REAL :: field_custom
+      REAL, DIMENSION (ims:ime,kms:kme,jms:jme), INTENT(INOUT):: field
+      INTEGER , INTENT(IN) ::  ids , ide , jds , jde , kds , kde , &
+                              ims , ime , jms , jme , kms , kme , &
+                              its , ite , jts , jte , kts , kte
+
+
+!!****MARS: set the 3D field to a constant value
+field(:,:,:)=field_custom
+
+  END SUBROUTINE constante3
+!---------------------------------------------------------------------
+   SUBROUTINE constante2(field, field_custom, &
+                      ids , ide , jds , jde , kds , kde , &
+                      ims , ime , jms , jme , kms , kme , &
+                      its , ite , jts , jte , kts , kte )
+
+
+      IMPLICIT NONE
+
+      REAL :: field_custom
+      REAL, DIMENSION (ims:ime,jms:jme), INTENT(INOUT):: field
+      INTEGER , INTENT(IN) ::  ids , ide , jds , jde , kds , kde , &
+                               ims , ime , jms , jme , kms , kme , &
+                               its , ite , jts , jte , kts , kte
+
+
+!!****MARS: set the 3D field to a constant value
+field(:,:)=field_custom
+
+  END SUBROUTINE constante2
+!---------------------------------------------------------------------
+
+      subroutine build_sigma_hr(dimlevs,sigma_gcm,ps_gcm,ps_hr,sigma_hr) !,p_pgcm)
+
+      implicit none
+!      include "constants_mcd.inc"
+
+!---------------------------------------
+! written by E. Millour and F. Forget
+! Mars Climate Database v4.2
+! see DDD page 27 and following
+!---------------------------------------
+
+        INTEGER , INTENT(IN) :: dimlevs
+
+!     inputs
+      real sigma_gcm(dimlevs) ! GCM sigma levels
+      real ps_gcm             ! GCM surface pressure
+      real ps_hr              ! High res surface pressure
+!     outputs
+      real sigma_hr(dimlevs)  ! High res sigma levels
+!      real p_pgcm(dimlevs)    ! high res to GCM pressure ratios
+
+!     local variables
+      integer l
+      real x  ! lower layer compression (-0.9<x<0) or dilatation (0.<x<0.9)
+      real rp     ! surface pressure ratio ps_hr/ps_gcm
+      real deltaz   ! corresponding pseudo-altitude difference (km)
+      real f  ! coefficient f= p_hr / p_gcm
+      real z  ! altitude of transition of p_hr toward p_gcm (km)
+      real p_pgcm(dimlevs)    ! high res to GCM pressure ratios
+
+! 1. Coefficients
+      rp=ps_hr/ps_gcm
+      deltaz=-10.*log(rp)
+      x = min(max(0.12*(abs(deltaz)-1.),0.),0.8)
+      if(deltaz.gt.0) x=-x
+      z=max(deltaz + 3.,3.)
+
+      do l=1,dimlevs
+        f=rp*sigma_gcm(l)**x
+!        f=f+(1-f)*0.5*(1+tanh(6.*(-10.*log(sigma_gcm(l))-z)/z))
+!        sigma_hr(l)=f*sigma_gcm(l)/rp
+        p_pgcm(l)=f+(1-f)*0.5*(1+tanh(6.*(-10.*log(sigma_gcm(l))-z)/z))
+        sigma_hr(l)=p_pgcm(l)*sigma_gcm(l)/rp
+      enddo
+
+      end subroutine build_sigma_hr
+
+
+
+
+
+END MODULE module_initialize
+
+#endif
Index: trunk/MESOSCALE_DEV/WORK/rename
===================================================================
--- trunk/MESOSCALE_DEV/WORK/rename	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/rename	(revision 207)
@@ -0,0 +1,8 @@
+#! /bin/bash
+
+for fich in $(cat ye) ; do
+
+  mv $fich $(echo $fich | tr ":" "z")
+
+done
+
Index: trunk/MESOSCALE_DEV/WORK/timestep
===================================================================
--- trunk/MESOSCALE_DEV/WORK/timestep	(revision 207)
+++ trunk/MESOSCALE_DEV/WORK/timestep	(revision 207)
@@ -0,0 +1,11 @@
+20  25
+20  20
+10  10
+10  25
+5   10
+0.1 0.5
+2   10
+0.5  1
+75  74
+60  74
+250 185  
