Index: /trunk/UTIL/PYTHON/Intercomparison/1D_sensibility_tool/README
===================================================================
--- /trunk/UTIL/PYTHON/Intercomparison/1D_sensibility_tool/README	(revision 764)
+++ /trunk/UTIL/PYTHON/Intercomparison/1D_sensibility_tool/README	(revision 764)
@@ -0,0 +1,57 @@
+############################
+## probe.sh
+## --------
+## tool to run 1D comparisons of single variables 
+## defined in callphys.def
+## --------
+## Author : A. Colaitis
+############################
+
+##
+
+# IT IS VERY STRONGLY RECOMMENDED TO RUN THIS SCRIPT
+# IN A LOCAL DIRECTORY OF THE PLANETO SERVERS (levan, viccaro, penn, under /home/local_home)
+# AS THE 1D MODEL RUNS HUNDREDS OF TIMES FASTER THAN ON NETWORK DISKS (/u, /planeto, /d..., /san ...)
+
+## Requirements:
+
+# You must have in the same folder as probe.sh:
+# - callphys.def
+# - traceur.def
+# - z2sig.def
+# - run.def
+# - a profile file if you use the corresponding mode in run.def
+# - the executable to test, i.e. testphys1d.e
+
+## Variable definition:
+
+# The variable to be explored must be set to a dummy value in callphys.def 
+eg: tauvis=999
+# The user must change the sed command in probe.sh to replace this value as desired
+eg: 
+sed -e s/'tauvis=999'/'tauvis='${TAU[ $i ]}/g r$i/callphys.def > r$i/callphys.def.tmp ; \mv r$i/callphys.def.tmp r$i/callphys.def
+
+with:
+taus="0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0"
+TAU=($taus)
+
+## Preparation
+
+# The cleaning and creation of directories where the 1D will be run is done by the following command:
+
+./probe.sh prepare
+# (make sure your probe.sh is executable, or type in chmod a+x probe.sh)
+
+## Running the comparisons
+
+# runs are launched with the following command:
+
+./probe.sh run
+
+## Analyse the results
+
+# results are analysed with the following command:
+
+./probe.sh analyse
+# png or eps can be specified as a second argument, eg "./probe.sh analyse eps"
+
Index: /trunk/UTIL/PYTHON/Intercomparison/1D_sensibility_tool/probe.sh
===================================================================
--- /trunk/UTIL/PYTHON/Intercomparison/1D_sensibility_tool/probe.sh	(revision 764)
+++ /trunk/UTIL/PYTHON/Intercomparison/1D_sensibility_tool/probe.sh	(revision 764)
@@ -0,0 +1,61 @@
+#!/bin/bash
+taus="0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0"
+TAU=($taus)
+
+if [ $1 == run ]
+then
+
+for i in 0 1 2 3 4 5 6 7 8 9
+do
+rm -rf r$i
+mkdir r$i
+ln -sf ../run.def r$i/.
+ln -sf ../z2sig.def r$i/.
+ln -sf ../traceur.def r$i/.
+ln -sf ../testphys1d.e r$i/.
+ln -sf ../profile r$i/profile
+cp callphys.def r$i/.
+sed -e s/'tauvis=999'/'tauvis='${TAU[ $i ]}/g r$i/callphys.def > r$i/callphys.def.tmp ; \mv r$i/callphys.def.tmp r$i/callphys.def
+done
+
+for i in 0 1 2 3 4 5 6 7 8 9
+do
+cd r$i/.
+echo 'running case '$i
+./testphys1d.e > a.out
+cd ..
+done
+
+fi
+
+if [ $1 == analyse -o $1 == run ]
+then
+  if [ $2 == eps ]
+  then
+    format='eps'
+  else
+    format='png'
+  fi
+pp.py -f r0/diagfi.nc,r1/diagfi.nc,r2/diagfi.nc,r3/diagfi.nc,r4/diagfi.nc,r5/diagfi.nc,r6/diagfi.nc,r7/diagfi.nc,r8/diagfi.nc,r9/diagfi.nc -v fluxsurf_lw --labels "tau=0.1","tau=0.2","tau=0.3","tau=0.4","tau=0.5","tau=0.6","tau=0.7","tau=0.8","tau=0.9","tau=1.0" --lstyle '-k','--k','-r','--r','-y','--y','-g','--g','-b','--b' -S $format -d -O fluxsurf_lw_taus --title "Incident LW flux at surface"
+pp.py -f r0/diagfi.nc,r1/diagfi.nc,r2/diagfi.nc,r3/diagfi.nc,r4/diagfi.nc,r5/diagfi.nc,r6/diagfi.nc,r7/diagfi.nc,r8/diagfi.nc,r9/diagfi.nc -v fluxsurf_sw --labels "tau=0.1","tau=0.2","tau=0.3","tau=0.4","tau=0.5","tau=0.6","tau=0.7","tau=0.8","tau=0.9","tau=1.0" --lstyle '-k','--k','-r','--r','-y','--y','-g','--g','-b','--b' -S $format -d -O fluxsurf_sw_taus --title "Incident SW flux at surface"
+pp.py -f r0/diagfi.nc,r1/diagfi.nc,r2/diagfi.nc,r3/diagfi.nc,r4/diagfi.nc,r5/diagfi.nc,r6/diagfi.nc,r7/diagfi.nc,r8/diagfi.nc,r9/diagfi.nc -v tsurf --labels "tau=0.1","tau=0.2","tau=0.3","tau=0.4","tau=0.5","tau=0.6","tau=0.7","tau=0.8","tau=0.9","tau=1.0" --lstyle '-k','--k','-r','--r','-y','--y','-g','--g','-b','--b' -S $format -d -O tsurf_taus --title "Surface temperature"
+pp.py -f r0/diagfi.nc,r1/diagfi.nc,r2/diagfi.nc,r3/diagfi.nc,r4/diagfi.nc,r5/diagfi.nc,r6/diagfi.nc,r7/diagfi.nc,r8/diagfi.nc,r9/diagfi.nc -v "rh-1" --labels "tau=0.1","tau=0.2","tau=0.3","tau=0.4","tau=0.5","tau=0.6","tau=0.7","tau=0.8","tau=0.9","tau=1.0" --lstyle '-k','--k','-r','--r','-y','--y','-g','--g','-b','--b' -S $format -d -O invrh_taus --title "Heat aerodyn conductance"
+
+if [ $format == 'png' ]
+then
+  montage fluxsurf_lw_taus_200.png fluxsurf_sw_taus_200.png tsurf_taus_200.png invrh_taus_200.png -mode concatenate -tile 2x2 tau_sensitivity.png
+  \mv fluxsurf_lw_taus_200.png fluxsurf_sw_taus_200.png tsurf_taus_200.png invrh_taus_200.png figures/.
+  \rm fluxsurf_lw_taus.sh fluxsurf_sw_taus.sh tsurf_taus.sh invrh_taus.sh
+  cp tau_sensitivity.png figures/.
+fi
+\rm fluxsurf_lw_taus.sh fluxsurf_sw_taus.sh tsurf_taus.sh invrh_taus.sh
+fi
+
+if [ $1 == clean ]
+then
+
+rm -rf figures
+mkdir figures
+rm -f *.png
+
+fi
Index: /trunk/UTIL/PYTHON/Intercomparison/CDO/Install_pgi.sh
===================================================================
--- /trunk/UTIL/PYTHON/Intercomparison/CDO/Install_pgi.sh	(revision 764)
+++ /trunk/UTIL/PYTHON/Intercomparison/CDO/Install_pgi.sh	(revision 764)
@@ -0,0 +1,16 @@
+#/bin/bash
+touch cdo-current.tar.gz
+rm -rf cdo-current.tar.gz
+wget https://code.zmaw.de/attachments/download/3604/cdo-current.tar.gz --no-check-certificate
+
+touch cdo-1.5.6.1
+rm -rf cdo-1.5.6.1
+tar -xvzf cdo-current.tar.gz
+cd cdo-1.5.6.1 
+
+./configure --with-netcdf=/donnees/emlmd/netcdf64-4.0.1_pgi --prefix=/u/acolmd/san0/cdo/cdo-1.5.6.1 CPPFLAGS="-DNDEBUG -DpgiFortran" CC=pgcc CFLAGS="-O2 -Msignextend -Mipa" CXX=pgCC CXXFLAGS="-O2 -Msignextend -Mipa" FC=pgf90 FFLAGS="-O2 -Mipa"
+
+make
+
+make install
+
Index: /trunk/UTIL/PYTHON/Intercomparison/CDO/README
===================================================================
--- /trunk/UTIL/PYTHON/Intercomparison/CDO/README	(revision 764)
+++ /trunk/UTIL/PYTHON/Intercomparison/CDO/README	(revision 764)
@@ -0,0 +1,2 @@
+# import_binary function in CDO is needed to run the ic.py script. 
+# You can instal the corresponding CDO version by running the Install_pgi script in a directory of your choice.
Index: /trunk/UTIL/PYTHON/Intercomparison/File_conversion/README
===================================================================
--- /trunk/UTIL/PYTHON/Intercomparison/File_conversion/README	(revision 764)
+++ /trunk/UTIL/PYTHON/Intercomparison/File_conversion/README	(revision 764)
@@ -0,0 +1,54 @@
+############################
+## ic.py
+## --------
+## A tool to convert MRAMS mesoscale files to netcdf format
+## and make them compatible with API and planetoplot.py
+## --------
+## Author : A. Colaitis
+############################
+
+************
+# IMPORTANT: the CDO version installed by default at LMD does not handle
+# import_binary operation ! You must install the correct CDO version. See for
+# exemple in $YOUR_SVN/trunk/UTIL/PYTHON/Intercomparison/CDO/ the Install_pgi.sh script that will do it for
+# you. Don't forget to add the corresponding path to you $PATH.
+***********
+
+## SETUP
+# ----------
+
+# The folder containing ic.py must also contain a symbolic link to the binary files you will convert, named "vis", eg:
+
+ln -sf /planeto/acolmd/SwRI_files/mrams/vis vis
+
+# IMPORTANT IMPORTANT IMPORTANT
+# The very first time you run this script, you must create the correct folders. This can be done easily with ic.py --deepclean
+
+
+## USAGE
+# ---------
+
+ic.py -c # clean generated mramsout_XXXX-XX-XX_XX:XX:XX files
+ic.py --deepclean # clean files mentioned above + the figures folder + the
+                  # very long to generate cdo outputs of the binary to netcdf conversion
+ic.py -g # generate everything. If cdo outputs are already present, skip them.
+         # If reformatted mramsout_XXXX-XX-XX_XX:XX:XX files are present, skip them.
+
+# constants to enter manually in ic.py:
+# file names in __main__()
+ outfileatm='holden_ls150-atm-S-'+grid+'.nc' # CDO output filename for atmosphere
+ outfilesfc='holden_ls150-sfc-S-'+grid+'.nc' # CDO output filename for surface
+ infileatm='holden_ls150-atm-S-'+grid+'.ctl' # CDO input filename for atmosphere
+ infilesfc='holden_ls150-sfc-S-'+grid+'.ctl' # CDO input filename for surface
+
+# Simulation and extraction properties in merge_atm_sfc()
+    ls_simu_start=147.  #ls of start simu
+#   NOTE: WE ASSUME THE LT_START IN .CTL FOR MRAMS IS LOCAL TIME OF START AT
+#   LONGITUDE 0 (which seems to be the case for holden)
+    dx=[240000.,80000.,26667,8889] # horizontal resolution of nests
+    dy=dx
+    days=[16,17,18] # Sols the user wants to generate (corresponding to the
+                    # names in the LMD_MMM convention)
+                    # Converted files are by default put in the ./converted_files folder 
+                    # (as well as cdo outputs) original files are by default seeked 
+                    # out in the ./vis folder
Index: /trunk/UTIL/PYTHON/Intercomparison/File_conversion/ic.py
===================================================================
--- /trunk/UTIL/PYTHON/Intercomparison/File_conversion/ic.py	(revision 764)
+++ /trunk/UTIL/PYTHON/Intercomparison/File_conversion/ic.py	(revision 764)
@@ -0,0 +1,271 @@
+#!/u/acolmd/san0/Python/64bits/epd-7.1-2-rh5-x86_64/bin/python
+if __name__ == "__main__":
+    import subprocess
+    import sys
+    from os import system,unlink
+    from glob import glob
+    from optparse import OptionParser 
+    from myplot import errormess
+    from ic import check_file, merge_atm_sfc
+    #############################
+    ### Get options and variables
+    parser = OptionParser()
+    parser.add_option('-g','--generate',  action='store_true',dest='generate',          default=False,help='Generate netcdf files')
+    parser.add_option('-c','--clean',     action='store_true',dest='clean',            default=False,help='Clean mrams_ files')
+    parser.add_option('--deepclean',      action='store_true',dest='deepclean',            default=False,help='Clean everything')
+    (opt,args) = parser.parse_args()
+    if opt.deepclean:
+       for zfile in ['converted_files','figures']:
+           subprocess.call(['touch',zfile],shell=False)
+           subprocess.call(['rm','-rf',zfile],shell=False)
+           subprocess.call(['mkdir',zfile],shell=False)
+    if opt.clean:
+       subprocess.call(['touch','converted_files/mramsout_d_dummy'],shell=False)
+       for f in glob ('converted_files/mramsout_d*'):
+           unlink(f)
+    if opt.generate:
+       opath='./converted_files/'
+       ipath='./vis/'
+#       for grid in ['g1','g2','g3','g4']: ## INDEX 4 OF TEST CASE HOLDEN DOES NOT WORK (CDO ERROR)
+       for grid in ['g1','g2','g3']:
+           outfileatm='holden_ls150-atm-S-'+grid+'.nc'
+           outfilesfc='holden_ls150-sfc-S-'+grid+'.nc'
+           outfilecat='mramsout_d'
+           infileatm='holden_ls150-atm-S-'+grid+'.ctl'
+           infilesfc='holden_ls150-sfc-S-'+grid+'.ctl'
+           print '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'
+           err=check_file(opath+outfileatm)
+           print '=> Begining conversion for File '+infileatm+' -> in -> '+outfileatm
+           if err == 1: subprocess.call(['cdo','-f','nc','import_binary',ipath+infileatm,opath+outfileatm],shell=False)
+           print '=> File '+infileatm+' -> converted in -> '+outfileatm
+           err=check_file(opath+outfilesfc)
+           print '=> Begining conversion for File '+infilesfc+' -> in -> '+outfilesfc
+           if err == 1: subprocess.call(['cdo','-f','nc','import_binary',ipath+infilesfc,opath+outfilesfc],shell=False)
+           print '=> File '+infilesfc+' -> converted in -> '+outfilesfc
+           print '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'
+           print '=> Begining concatenation for Files '+outfilesfc+' and '+outfileatm
+           merge_atm_sfc(opath+outfilesfc,opath+outfileatm,opath+outfilecat)
+           print '=> Files concatenated !'
+           print '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'
+
+#   subprocess.call(cmdstring,shell=False)
+
+# Check if a file is present and readable
+def check_file(filename):
+    from os import path, access, R_OK  # W_OK for write permission. 
+    PATH=filename 
+    if path.exists(PATH) and path.isfile(PATH) and access(PATH, R_OK): 
+       return 0  # file exists and is readable
+    else: 
+       return 1  # file is not present and/or readable
+
+# Find lat lon center of the grid
+def find_center(lon,lat,xlon,xlat):
+    import numpy as np
+    i_lon=0 ; i_lat = 0 ; i_lon2 = 0 ; i_lat2=0
+    if len(lon)%2!=0:i_lon=np.floor(len(lon)/2) # no +1 because arrays start from 0
+    if len(lat)%2!=0:i_lat=np.floor(len(lat)/2) # no +1 because arrays start from 0
+    if i_lon == 0:
+         i_lon=len(lon)/2 -1
+         i_lon2=len(lon)/2
+    if i_lat == 0:
+         i_lat=len(lat)/2 -1
+         i_lat2=len(lat)/2
+    if i_lon2 == 0 and i_lat2 == 0:
+         cen_lon = xlon[i_lat,i_lon]
+         cen_lat = xlat[i_lat,i_lon]
+    if i_lon2 != 0 and i_lat2 != 0:
+         cen_lon = (xlon[i_lat,i_lon] + xlon[i_lat2,i_lon2] + xlon[i_lat,i_lon2] + xlon[i_lat2,i_lon])/4.
+         cen_lat = (xlat[i_lat,i_lon] + xlat[i_lat2,i_lon2] + xlat[i_lat,i_lon2] + xlat[i_lat2,i_lon])/4.
+    if i_lon2 != 0 and i_lat2 == 0:
+         cen_lon = (xlon[i_lat,i_lon] + xlon[i_lat,i_lon2])/2.
+         cen_lon = (xlat[i_lat,i_lon] + xlat[i_lat,i_lon2])/2.
+    if i_lon2 == 0 and i_lat2 != 0:
+         cen_lon = (xlon[i_lat,i_lon] + xlon[i_lat2,i_lon])/2.
+         cen_lon = (xlat[i_lat,i_lon] + xlat[i_lat2,i_lon])/2.
+    return cen_lon,cen_lat
+
+# Merge atm and sfc netcdf. cdo cat does not work for that. (neither does ncecat)
+def merge_atm_sfc(fsfc,fatm,fmerged):
+    from os import system
+    from netCDF4 import Dataset
+    import numpy as np
+    import subprocess
+
+    # Calendar
+    path_calendar='/san0/acolmd/SVN/trunk/MESOSCALE/LMD_MM_MARS/SIMU/calendar'
+    gcm_sol=[]
+    gcm_ls=[]
+    mmm_date=[]
+    calendar = open(path_calendar, 'r')
+    calendar.readline() #get rid of the first line
+    calendar_l=calendar.readlines()
+    for line in calendar_l:
+        s=str.split(line)
+        gcm_sol=np.append(gcm_sol,np.float(s[1]))
+        gcm_ls=np.append(gcm_ls,np.float(s[2]))
+        mmm_date=np.append(mmm_date,s[3])
+    calendar.close()
+    calendar_l=0.
+
+    # Constants
+    grav=3.72
+
+    # Grid properties
+    ls_simu_start=147.  #ls of start simu
+#    lt_start="07:30:00" #local time of start simu at cen_lon # read in .ctl
+#   NOTE: I ASSUME THE LT_START IN .CTL FOR MRAMS IS LOCAL TIME OF START AT LONGITUDE 0
+    dx=[240000.,80000.,26667,8889]
+    dy=dx
+   
+    # Date management
+    idx=np.abs(gcm_ls - ls_simu_start).argmin()
+    date_start=mmm_date[idx]
+    # USER: fill the date you want to analyse:
+    days=[16,17,18]
+
+    # Grid id
+    if 'g1' in fatm:
+        gid=1
+    elif 'g2' in fatm:
+        gid=2
+    elif 'g3' in fatm:
+        gid=3
+    else:
+        gid=4
+
+    # Load datasets   
+    atm=Dataset(fatm) ; sfc=Dataset(fsfc)
+
+    # reconstruct dimensions
+    lon = atm.variables['lon'] ; nlon = len(lon)
+    lat = atm.variables['lat'] ; nlat = len(lat)
+    lev = atm.variables['lev'] ; nlev = len(lev)
+    time = atm.variables['time'] ; ntime = len(time)
+    units_time=time.units[12:len(time.units)]
+
+    # date from mrams file:
+    year_mrams, month_mrams, day_mrams, hour_mrams, minute_mrams, second_mrams = date_to_time(units_time)
+    lt_start = hour_mrams+':'+minute_mrams+':'+second_mrams
+    # or date from calendar with initial Ls:
+    year, month, day, hour, minute, second = date_to_time(date_start,lt_start)
+    dt=(time[1]-time[0])*60.
+    daylength=3600.*24./(dt*60.)
+
+    i=0
+    imax=np.floor(len(time)/daylength)
+    while (i < imax+1):
+        i=i+1
+        dayslab=[int((i-1)*daylength),int(daylength*i)]
+        if i==imax+1: dayslab=[int((i-1)*daylength),len(time)]
+        fmerged_slab=fmerged+'0'+str(gid)+'_'+time_to_date(mmm_date[idx+i-1],lt_start)
+        err=check_file(fmerged_slab)
+        year, month, day, hour, minute, second = date_to_time(mmm_date[idx+i-1],lt_start)
+        if int(day) in days:
+           print '  -->> hyperslab : ',dayslab,' => mramsout_d0'+str(gid)+'_'+time_to_date(mmm_date[idx+i-1],lt_start)
+        else: 
+           err=0
+           print '  -->> hyperslab : ',dayslab,' => mramsout_d0'+str(gid)+'_'+time_to_date(mmm_date[idx+i-1],lt_start)+' --> Skipped'
+        if err == 1:
+            # prepare merged file
+            subprocess.call(['touch',fmerged_slab],shell=False)
+            subprocess.call(['rm','-rf',fmerged_slab],shell=False)
+            merged_file = Dataset(fmerged_slab, 'w', format='NETCDF3_64BIT')
+            merged_file.description = 'MRAMS merged atm and sfc converted (netcdf) file.'
+            ## Dimensions
+            merged_file.createDimension('Time', None)
+            merged_file.createDimension('bottom_top',nlev)
+            merged_file.createDimension('south_north',nlat)
+            merged_file.createDimension('west_east',nlon)
+            merged_file.createDimension('bottom_top_stag',nlev+1) # very important for PHTOT in API
+#            merged_file.createDimension('south_north_stag',nlat+1)
+#            merged_file.createDimension('west_east_stag',nlon+1)
+            ## Variables for dimensions
+            times = merged_file.createVariable('Time', 'f', ('Time',))
+            times[:] = time[dayslab[0]:dayslab[1]]
+            altitudes = merged_file.createVariable('bottom_top', 'f', ('bottom_top',))
+            altitudes[:] = lev[:]
+            latitudes = merged_file.createVariable('south_north', 'f', ('south_north',))
+            latitudes[:] = lat[:]
+            longitudes = merged_file.createVariable('west_east', 'f', ('west_east',))
+            longitudes[:] = lon[:]
+            ## Set attributes
+            setattr(merged_file, 'TITLE', 'OUTPUT FROM MRAMS MODEL')
+            setattr(merged_file, 'START_DATE', time_to_date(mmm_date[idx],lt_start))
+            setattr(merged_file, 'SIMULATION_START_DATE', time_to_date(mmm_date[idx],lt_start))
+            setattr(merged_file, 'WEST-EAST_GRID_DIMENSION', nlon+1)
+            setattr(merged_file, 'SOUTH-NORTH_GRID_DIMENSION', nlat+1)
+            setattr(merged_file, 'BOTTOM-TOP_GRID_DIMENSION', nlev+1)
+            setattr(merged_file, 'DX', np.float(dx[gid-1])) 
+            setattr(merged_file, 'DY', np.float(dy[gid-1]))
+            setattr(merged_file, 'DT', np.float(dt))
+            setattr(merged_file, 'GRID_TYPE', 'C') #
+            setattr(merged_file, 'GRID_ID', gid) 
+            setattr(merged_file, 'PARENT_ID', gid-1) 
+            setattr(merged_file, 'MAP_PROJ', 2) #
+            setattr(merged_file, 'JULYR', year) 
+            setattr(merged_file, 'JULDAY', gcm_sol[idx+i-1])
+            setattr(merged_file, 'WEST-EAST_PATCH_START_UNSTAG' , 1)
+            setattr(merged_file, 'WEST-EAST_PATCH_END_UNSTAG' , nlon)
+            setattr(merged_file, 'WEST-EAST_PATCH_START_STAG' , 1)
+            setattr(merged_file, 'WEST-EAST_PATCH_END_STAG' , nlon) ###
+            setattr(merged_file, 'SOUTH-NORTH_PATCH_START_UNSTAG' , 1)
+            setattr(merged_file, 'SOUTH-NORTH_PATCH_END_UNSTAG' , nlat)
+            setattr(merged_file, 'SOUTH-NORTH_PATCH_START_STAG' , 1)
+            setattr(merged_file, 'SOUTH-NORTH_PATCH_END_STAG' , nlat) ###
+            setattr(merged_file, 'BOTTOM-TOP_PATCH_START_UNSTAG' , 1)
+            setattr(merged_file, 'BOTTOM-TOP_PATCH_END_UNSTAG' , nlev)
+            setattr(merged_file, 'BOTTOM-TOP_PATCH_START_STAG' , 1)
+            setattr(merged_file, 'BOTTOM-TOP_PATCH_END_STAG' , nlev+1)
+            ## Set grid variables
+            xlon = merged_file.createVariable('XLONG', 'f', ('Time','south_north','west_east',))
+            xlat = merged_file.createVariable('XLAT', 'f', ('Time','south_north','west_east',))
+            print '    glon -> XLON' ; xlon[:,:,:] = sfc.variables['glon'][dayslab[0]:dayslab[1],:,:]
+            print '    glat -> XLAT' ; xlat[:,:,:] = sfc.variables['glat'][dayslab[0]:dayslab[1],:,:]
+            cen_lon, cen_lat = find_center(lon,lat,xlon[0,:,:],xlat[0,:,:])
+            setattr(merged_file, 'CEN_LAT', cen_lat)
+            setattr(merged_file, 'CEN_LON', cen_lon)
+            ## Renaming
+            print '    topo -> HGT' ; hgt = merged_file.createVariable('HGT', 'f', ('Time','south_north','west_east',))
+            hgt[:,:,:] =  sfc.variables['topo'][dayslab[0]:dayslab[1],:,:]
+            print '    tempk -> tk' ; tk = merged_file.createVariable('tk', 'f', ('Time','bottom_top','south_north','west_east',))
+            tk[:,:,:,:] = atm.variables['tempk'][dayslab[0]:dayslab[1],:,:,:]
+            print '    press -> PTOT' ; ptot = merged_file.createVariable('PTOT', 'f', ('Time','bottom_top','south_north','west_east',))
+            ptot[:,:,:,:] = atm.variables['press'][dayslab[0]:dayslab[1],:,:,:]
+            u = merged_file.createVariable('U', 'f', ('Time','bottom_top','south_north','west_east',))
+            v = merged_file.createVariable('V', 'f', ('Time','bottom_top','south_north','west_east',))
+            w = merged_file.createVariable('W', 'f', ('Time','bottom_top','south_north','west_east',))
+            print '    u_avg -> U' ; u[:,:,:,:] = atm.variables['u_avg'][dayslab[0]:dayslab[1],:,:,:]
+            print '    v_avg -> V' ; v[:,:,:,:] = atm.variables['v_avg'][dayslab[0]:dayslab[1],:,:,:]
+            print '    w_avg -> W' ; w[:,:,:,:] = atm.variables['w_avg'][dayslab[0]:dayslab[1],:,:,:]
+            tke = merged_file.createVariable('TKE', 'f', ('Time','bottom_top','south_north','west_east',))
+            print '    sgs_tke -> TKE' ; tke[:,:,:,:] = atm.variables['sgs_tke'][dayslab[0]:dayslab[1],:,:,:]
+            tau_dust = merged_file.createVariable('TAU_DUST', 'f', ('Time','south_north','west_east',))
+            print '    dust_sfc_od_vis -> TAU_DUST' ; tau_dust[:,:,:] = atm.variables['dust_sfc_od_vis'][dayslab[0]:dayslab[1],:,:]
+            z_lyrmid_agl = merged_file.createVariable('z_lyrmid_agl', 'f', ('Time','bottom_top','south_north','west_east',))
+            print '    z_lyrmid_agl -> z_lyrmid_agl' ; z_lyrmid_agl[:,:,:,:] = atm.variables['z_lyrmid_agl'][dayslab[0]:dayslab[1],:,:,:]
+            # Compute PHTOT for API
+            print '    Computing PHTOT'
+            phtot = merged_file.createVariable('PHTOT', 'f', ('Time','bottom_top_stag','south_north','west_east',))
+            phtot[:,0:nlev,:,:]=z_lyrmid_agl[:,:,:,:]*grav ; phtot[:,nlev,:,:]=0.
+            for l in np.arange(nlev):
+                phtot[:,l,:,:]=phtot[:,l,:,:] + grav*hgt[:,:,:]
+
+            merged_file.close()
+
+def date_to_time(date,ltstart=None):
+    year=date[0:4]
+    month=date[5:7]
+    day=date[8:10]
+    hour=date[11:13]
+    minute=date[14:16]
+    second=date[17:19]
+    if ltstart is not None:
+       hour=ltstart[0:2]
+       minute=ltstart[3:5]
+       second=ltstart[6:8]
+    return year,month,day,hour,minute,second
+
+def time_to_date(date,ltstart=None):
+    if ltstart is not None: return date[0:11]+ltstart
+    else: return date
Index: /trunk/UTIL/PYTHON/Intercomparison/Plots_MasterScript/Driver_bam.sh
===================================================================
--- /trunk/UTIL/PYTHON/Intercomparison/Plots_MasterScript/Driver_bam.sh	(revision 764)
+++ /trunk/UTIL/PYTHON/Intercomparison/Plots_MasterScript/Driver_bam.sh	(revision 764)
@@ -0,0 +1,36 @@
+#!/bin/bash
+# This script can be used to drive the bam.sh script.
+# It also acts as a description of the different parts of the bam script.
+# Remember to check path to files in bam.sh.
+
+# bam.sh boundaries #
+# generic bounding condition check
+./bam.sh boundaries temp # temperature of outer nest boundaries
+./bam.sh boundaries uv # horizontal winds of outer nest boundaries
+
+# bam.sh sync #
+# Synchronization check using tsurf 
+./bam.sh sync
+
+# bam.sh nests #
+# generic parent to child nest comparisons
+./bam.sh nests power # power spectrum of horizontal winds between nests
+./bam.sh nests histo # histograms of horizontal winds between nests
+
+# bam.sh srlsn3 #
+# generic analysis at the Safe Reference Landing Site (srls) for nest 3 (n3)
+./bam.sh srlsn3 power # power spectrum of horizontal winds between LMD_MMM and MRAMS
+./bam.sh srlsn3 histo # histograms of horizontal winds between LMD_MMM and MRAMS for each descent phase
+./bam.sh srlsn3 series # time-series (1d and 2d) at landing site (winds, temp, hodograph, wind rotation)
+./bam.sh srlsn3 profiles # profiles at landing site
+./bam.sh srlsn3 surface # NOT TESTED YET BECAUSE OF THE LACK OF FIELDS
+
+# bam.sh maps
+# generic analysis of lat/lon maps for nest 3
+./bam.sh maps winds
+./bam.sh maps surface  # NOT TESTED YET BECAUSE OF THE LACK OF FIELDS
+
+# bam.sh variability
+# day-to-day variability, studied with the day before and the day after
+./bam.sh variability histo # histograms of horizontal winds of the 3 days, + comp LMD/MRAMS
+./bam.sh variability density # kernel density estimates of day-to-day differences => standard deviation, mean, kurtosis, skewness
Index: /trunk/UTIL/PYTHON/Intercomparison/Plots_MasterScript/README
===================================================================
--- /trunk/UTIL/PYTHON/Intercomparison/Plots_MasterScript/README	(revision 764)
+++ /trunk/UTIL/PYTHON/Intercomparison/Plots_MasterScript/README	(revision 764)
@@ -0,0 +1,26 @@
+############################
+## bam.sh
+## --------
+## A tool to compare LMD_MMM and MRAMS files
+## --------
+## Author : A. Colaitis
+############################
+
+# Figures are generated using the master script Driver_bam.sh or using
+# directly bam.sh
+# Constants to set in bam.sh before plotting:
+mramsfiles=/home/local_home/colaitis/intercomp_test/converted_files # directory of the converted mrams files using ic.py
+lmdfiles=/planeto/acolmd/SwRI_files/lmd/HOLDEN_nests_mrams # directory of the lmd_mmm files
+lat=-26. # landing site latitude (real one for exomars is different)
+lon=-34.   # landing site longitude (real one for exomars is different)
+filemrams='_2024-06-17_07:30:00' # main sol analyzed for MRAMS
+filemramsa='_2024-06-16_07:30:00' # sol before, for variability analysis, MRAMS
+filemramsb='_2024-06-18_07:30:00' # sol after, for variability analysis, MRAMS
+filelmd='_2024-06-17_06:00:00' # main sol analyzed for LMD
+filelmda='_2024-06-16_06:00:00' # sol before, for variability analysis, LMD_MMM
+filelmdb='_2024-06-18_06:00:00' # sol after, for variability analysis, LMD_MMM
+
+## USAGE
+
+# see Driver_bam.sh to see the different parts composing the bam.sh script. You can call the whole script or parts of it only.
+vi Driver_bam.sh
Index: /trunk/UTIL/PYTHON/Intercomparison/Plots_MasterScript/bam.sh
===================================================================
--- /trunk/UTIL/PYTHON/Intercomparison/Plots_MasterScript/bam.sh	(revision 764)
+++ /trunk/UTIL/PYTHON/Intercomparison/Plots_MasterScript/bam.sh	(revision 764)
@@ -0,0 +1,258 @@
+#!/bin/bash
+
+########## Constants
+mramsfiles=/home/local_home/colaitis/intercomp_test/converted_files
+lmdfiles=/planeto/acolmd/SwRI_files/lmd/HOLDEN_nests_mrams
+lat=-26. # landing site
+lon=-34.   # landing site
+#lon=-7.919998  #central longitude to test synchro
+#lon=0.
+filemrams='_2024-06-17_07:30:00'
+filemramsa='_2024-06-16_07:30:00'
+filemramsb='_2024-06-18_07:30:00'
+filelmd='_2024-06-17_06:00:00'
+filelmda='_2024-06-16_06:00:00'
+filelmdb='_2024-06-18_06:00:00'
+########## ---------
+if [ $1 == boundaries ]
+then
+echo 'Boundaries'
+# ------------------
+if [ $2 == temp ]
+then
+for i in 1 2 3
+do
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d0${i}$filemrams --div 20 --axtime lt --time 12 --redope edge_x1 -v tk --title "West-most T boundary MRAMS Nest $i at 12:00" -O mrams_lat1tbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -c spectral -m 100 -M 250
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d0${i}$filemrams --div 20 --axtime lt --time 12 --redope edge_x2 -v tk --title "East-most T boundary MRAMS Nest $i at 12:00" -O mrams_lat2tbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -N -c spectral -m 100 -M 250
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d0${i}$filemrams --div 20 --axtime lt --time 12 --redope edge_y1 -v tk --title "South-most T boundary MRAMS Nest $i at 12:00" -O mrams_lon1tbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -N -c spectral -m 100 -M 250
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d0${i}$filemrams --div 20 --axtime lt --time 12 --redope edge_y2 -v tk --title "North-most T boundary MRAMS Nest $i at 12:00" -O mrams_lon2tbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -N -c spectral -m 100 -M 250
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d0${i}$filelmd --div 20 --axtime lt --time 12 --redope edge_x1 -v tk --title "West-most T boundary LMD_MMM Nest $i at 12:00" -O lmd_lat1tbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -c spectral -m 100 -M 250
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d0${i}$filelmd --div 20 --axtime lt --time 12 --redope edge_x2 -v tk --title "East-most T boundary LMD_MMM Nest $i at 12:00" -O lmd_lat2tbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -N -c spectral -m 100 -M 250
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d0${i}$filelmd --div 20 --axtime lt --time 12 --redope edge_y1 -v tk --title "South-most T boundary LMD_MMM Nest $i at 12:00" -O lmd_lon1tbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -N -c spectral -m 100 -M 250
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d0${i}$filelmd --div 20 --axtime lt --time 12 --redope edge_y2 -v tk --title "North-most T boundary LMD_MMM Nest $i at 12:00" -O lmd_lon2tbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -N -c spectral -m 100 -M 250
+montage mrams_lat1tbound_d0${i}_200.png mrams_lat2tbound_d0${i}_200.png mrams_lon1tbound_d0${i}_200.png mrams_lon2tbound_d0${i}_200.png lmd_lat1tbound_d0${i}_200.png lmd_lat2tbound_d0${i}_200.png lmd_lon1tbound_d0${i}_200.png lmd_lon2tbound_d0${i}_200.png -mode concatenate -tile 4x2 bounding_d0${i}_temp.png
+rm -rf mrams_lat1tbound_d0${i}_200.png mrams_lat2tbound_d0${i}_200.png mrams_lon1tbound_d0${i}_200.png mrams_lon2tbound_d0${i}_200.png lmd_lat1tbound_d0${i}_200.png lmd_lat2tbound_d0${i}_200.png lmd_lon1tbound_d0${i}_200.png lmd_lon2tbound_d0${i}_200.png mrams_lat1tbound_d0${i}.sh mrams_lat2tbound_d0${i}.sh mrams_lon1tbound_d0${i}.sh mrams_lon2tbound_d0${i}.sh lmd_lat1tbound_d0${i}.sh lmd_lat2tbound_d0${i}.sh lmd_lon1tbound_d0${i}.sh lmd_lon2tbound_d0${i}.sh
+done
+fi
+# ------------------
+if [ $2 == uv ]
+then
+for i in 1 2 3
+do
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d0${i}$filemrams --div 20 --axtime lt --time 12 --redope edge_x1 -v uvmet --title "West-most UV boundary MRAMS Nest $i at 12:00" -O mrams_lat1uvbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -c spectral -m 0 -M 50
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d0${i}$filemrams --div 20 --axtime lt --time 12 --redope edge_x2 -v uvmet --title "East-most UV boundary MRAMS Nest $i at 12:00" -O mrams_lat2uvbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -N -c spectral -m 0 -M 50
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d0${i}$filemrams --div 20 --axtime lt --time 12 --redope edge_y1 -v uvmet --title "South-most UV boundary MRAMS Nest $i at 12:00" -O mrams_lon1uvbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -N -c spectral -m 0 -M 50
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d0${i}$filemrams --div 20 --axtime lt --time 12 --redope edge_y2 -v uvmet --title "North-most UV boundary MRAMS Nest $i at 12:00" -O mrams_lon2uvbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -N -c spectral -m 0 -M 50
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d0${i}$filelmd --div 20 --axtime lt --time 12 --redope edge_x1 -v uvmet --title "West-most UV boundary LMD_MMM Nest $i at 12:00" -O lmd_lat1uvbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -c spectral -m 0 -M 50
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d0${i}$filelmd --div 20 --axtime lt --time 12 --redope edge_x2 -v uvmet --title "East-most UV boundary LMD_MMM Nest $i at 12:00" -O lmd_lat2uvbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -N -c spectral -m 0 -M 50
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d0${i}$filelmd --div 20 --axtime lt --time 12 --redope edge_y1 -v uvmet --title "South-most UV boundary LMD_MMM Nest $i at 12:00" -O lmd_lon1uvbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -N -c spectral -m 0 -M 50
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d0${i}$filelmd --div 20 --axtime lt --time 12 --redope edge_y2 -v uvmet --title "North-most UV boundary LMD_MMM Nest $i at 12:00" -O lmd_lon2uvbound_d0$i -S png -d --res 200 -i 4 -l 0,40,30 -N -c spectral -m 0 -M 50
+montage mrams_lat1uvbound_d0${i}_200.png mrams_lat2uvbound_d0${i}_200.png mrams_lon1uvbound_d0${i}_200.png mrams_lon2uvbound_d0${i}_200.png lmd_lat1uvbound_d0${i}_200.png lmd_lat2uvbound_d0${i}_200.png lmd_lon1uvbound_d0${i}_200.png lmd_lon2uvbound_d0${i}_200.png -mode concatenate -tile 4x2 bounding_d0${i}_uv.png
+rm -rf mrams_lat1uvbound_d0${i}_200.png mrams_lat2uvbound_d0${i}_200.png mrams_lon1uvbound_d0${i}_200.png mrams_lon2uvbound_d0${i}_200.png lmd_lat1uvbound_d0${i}_200.png lmd_lat2uvbound_d0${i}_200.png lmd_lon1uvbound_d0${i}_200.png lmd_lon2uvbound_d0${i}_200.png mrams_lat1uvbound_d0${i}.sh mrams_lat2uvbound_d0${i}.sh mrams_lon1uvbound_d0${i}.sh mrams_lon2uvbound_d0${i}.sh lmd_lat1uvbound_d0${i}.sh lmd_lat2uvbound_d0${i}.sh lmd_lon1uvbound_d0${i}.sh lmd_lon2uvbound_d0${i}.sh
+done
+fi
+# ------------------
+fi
+########## ---------
+if [ $1 == sync ]
+then
+echo 'Synchronization'
+for i in [1,2,3]
+do
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d0${i}$filemrams --div 20 --axtime lt --time 12 -v tsurf --title "Tsurf MRAMS Nest $i at 12:00" -O mrams_tsurf_d0$i -S png -d --res 200 ---proj moll --mark $lon,$lat
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d0${i}$filelmd --div 20 --axtime lt --time 12 -v tsurf --title "Tsurf LMD_MMM Nest $i at 12:00" -O lmd_tsurf_d0$i -S png -d --res 200 --proj moll --mark $lon,$lat
+done
+montage mrams_tsurf_d01_200.png mrams_tsurf_d02_200.png mrams_tsurf_d03_200.png lmd_tsurf_d01_200.png lmd_tsurf_d02_200.png lmd_tsurf_d03_200.png tsurf_sync.png
+rm -f mrams_tsurf_d01_200.png mrams_tsurf_d02_200.png mrams_tsurf_d03_200.png lmd_tsurf_d01_200.png lmd_tsurf_d02_200.png lmd_tsurf_d03_200.png mrams_tsurf_d01_200.sh mrams_tsurf_d02_200.sh mrams_tsurf_d03_200.sh lmd_tsurf_d01_200.sh lmd_tsurf_d02_200.sh lmd_tsurf_d03_200.sh
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd  --lon $lon --lat $lat --axtime lt -v tsurf --ylabel "Surface Temperature" --xlabel "Local time (h)" --title "NEST 3 SYNCHRONIZATION" -O sync_tsurfnest3 -S png -d --res 200 --labels "MRAMS","LMD_MMM" 
+rm -f sync_tsurfnest3.sh
+
+fi
+########## ---------
+
+if [ $1 == nests ]
+then
+echo 'Safe Reference Landing Site'
+
+if [ $2 == power ]
+then
+echo 'Power spectrum'
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d01$filemrams,$mramsfiles/mramsout_d02$filemrams,$mramsfiles/mramsout_d03$filemrams --div 20  --lon $lon --lat $lat --axtime lt --time 8,20 0 -i 4 -l 0.1,10,999 -v uv --analysis fft --logy --logx --xlabel "Wavelength (m)" --ylabel "Spectrum amplitude" --title "MRAMS Nest $i Daytime Power spectrum of horizontal winds at landing site (0-10km AGL)" -O mrams_power_nests -S png -d --res 200 --xmin 10 --xmax 10000 --ymin 1 --ymax 10000 --labels "MRAMS Nest 1","MRAMS Nest 2","MRAMS Nest 3"
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d01$filelmd,$lmdfiles/wrfout_d02$filelmd,$lmdfiles/wrfout_d03$filelmd --div 20  --lon $lon --lat $lat --axtime lt --time 8,20 0 -i 4 -l 0.1,10,999 -v uv --analysis fft --logy --logx --xlabel "Wavelength (m)" --ylabel "Spectrum amplitude" --title "LMD_MMM Nest $i Daytime Power spectrum of horizontal winds at landing site (0-10km AGL)" -O lmd_power_nests -S png -d --res 200 --xmin 10 --xmax 10000 --ymin 1 --ymax 10000 --labels "LMD_MMM Nest 1","LMD_MMM Nest 2","LMD_MMM Nest 3"
+rm -f mrams_power_nests.sh lmd_power_nests.sh
+fi
+
+if [ $2 == histo ]
+then
+echo 'Wind histograms'
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d01$filemrams,$mramsfiles/mramsout_d02$filemrams,$mramsfiles/mramsout_d03$filemrams -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "MRAMS Nest 1","MRAMS Nest 2","MRAMS Nest 3" --title "MRAMS horizontal wind histogram at landing site for all time and altitudes" -d -S png -O mrams_histo2d_nests
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d01$filelmd,$lmdfiles/wrfout_d02$filelmd,$lmdfiles/wrfout_d03$filelmd -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "LMD_MMM Nest 1","LMD_MMM Nest 2","LMD_MMM Nest 3" --title "LMD_MMM horizontal wind histogram at landing site for all time and altitudes" -d -S png -O lmd_histo2d_nests
+rm -f mrams_histo2d_nests.sh lmd_histo2d_nests.sh
+fi
+fi
+
+if [ $1 == srlsn3 ]
+then
+echo 'Safe Reference Landing Site inner nest'
+
+if [ $2 == histo ]
+then
+
+echo 'WARNING'
+echo 'WARNING'
+echo 'WARNING'
+echo 'THOSE HIST ARE FOR ALL TIMES, CHECK THAT SYNCHRONIZATION IS OK OR SPECIFY COMMON LOCAL TIMES'
+echo 'THOSE HIST ARE FOR ALL TIMES, CHECK THAT SYNCHRONIZATION IS OK OR SPECIFY COMMON LOCAL TIMES'
+echo 'THOSE HIST ARE FOR ALL TIMES, CHECK THAT SYNCHRONIZATION IS OK OR SPECIFY COMMON LOCAL TIMES'
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "MRAMS","LMD_MMM" --title "Inner-Nest Horizontal wind histogram at landing site for all time and altitudes" -d -S png -O comp_histo2d_srlsn3 --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)"
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "MRAMS","LMD_MMM" --title "Hor. wind histogram / 10m-600m AGL range: POWERED DESCENT" -d -S png -O comp_histo1d_10m_600m_AGL_srlsn3 --vert 0,10 -i 4 -l 0.01,0.6,20 --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)"
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "MRAMS","LMD_MMM" --title "Hor. wind histogram / 1km-4km AML range: MAIN PARACHUTE DESCENT" -d -S png -O comp_histo1d_1km_4km_AML_srlsn3 --vert 0,20 -i 3 -l 1,4,20 --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)"
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "MRAMS","LMD_MMM" --title "Hor. wind histogram / 4km-10km AML range: DROGUE AND PARACHUTE DEPLOYMENT" -d -S png -O comp_histo1d_4km_10km_AML_srlsn3 --vert 0,20 -i 3 -l 4,10,20 --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)"
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "MRAMS","LMD_MMM" --title "Hor. wind histogram / 10km-40km AML range: DECELERATION PHASE" -d -S png -O comp_histo1d_10km_40km_AML_srlsn3 --vert 0,20 -i 3 -l 10,40,20 --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)"
+montage comp_histo1d_10m_600m_AGL_srlsn3_200.png comp_histo1d_1km_4km_AML_srlsn3_200.png comp_histo1d_4km_10km_AML_srlsn3_200.png comp_histo1d_10km_40km_AML_srlsn3_200.png -mode concatenate -tile 2x2 comp_histo1d_decomposed_srlsn3.png
+rm -f comp_histo2d_srlsn3.sh comp_histo1d_10m_600m_AGL_srlsn3.sh comp_histo1d_1km_4km_AML_srlsn3.sh comp_histo1d_4km_10km_AML_srlsn3.sh comp_histo1d_10km_40km_AML_srlsn3.sh comp_histo1d_10m_600m_AGL_srlsn3_200.png comp_histo1d_1km_4km_AML_srlsn3_200.png comp_histo1d_4km_10km_AML_srlsn3_200.png comp_histo1d_10km_40km_AML_srlsn3_200.png
+
+#/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v tsurf --lon $lon --lat $lat --div 20 --labels "MRAMS","LMD_MMM" --title "Inner-Nest Surface temperature histogram" -d -S png -O comp_histo1d_tsurf_srlsn3
+#rm -f comp_histo1d_tsurf_srlsn3.sh
+fi
+
+if [ $2 == power ]
+then
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd  --lon $lon --lat $lat --axtime lt --time 8,20 0 -i 4 -l 0.1,10,999 -v uv --analysis fft --logy --logx --xlabel "Wavelength (m)" --ylabel "Spectrum amplitude" --title "Inner-Nest Daytime Power spectrum of horizontal winds at landing site (0-10km AGL)" -O comp_power_srlsn3 -S png -d --res 200 --xmin 10 --xmax 10000 --ymin 1 --ymax 10000 --labels "MRAMS","LMD_MMM" 
+rm -f comp_power_srlsn3.sh
+fi
+
+if [ $2 == series ]
+then
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v UV --vert 0 --lon $lon --lat $lat --div 20 --labels "MRAMS","LMD_MMM" --title "Horizontal winds at 10m AGL (final drop and touchdown)" -d -S png -O comp_uv10m_serie_srlsn3 -i 4 -l 0.01 --xlabel "Local time (h)" --axtime lt --ylabel "Horizontal wind speed (m/s)"
+rm -f comp_uv10m_serie_srlsn3.sh
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v tk --vert 0 --lon $lon --lat $lat --div 20 --labels "MRAMS","LMD_MMM" --title "Temperature at 10m AGL (final drop and touchdown)" -d -S png -O comp_temp10m_serie_srlsn3 -i 4 -l 0.01 --xlabel "Local time (h)" --axtime lt --ylabel "Temperature (K)"
+rm -f comp_temp10m_serie_srlsn3.sh
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v UV --lon $lon --lat $lat --div 20 --title "MRAMS","LMD_MMM" -d -S png -O comp_uv_serie2d_srlsn3 -i 4 -l 0.01,40,40 --xlabel "Local time (h)" --axtime lt --ylabel "Altitude above surface (km)" --xmin 5 --xmax 24 -m 0 -M 75
+rm -f comp_uv_serie2d_srlsn3.sh
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v tk --lon $lon --lat $lat --div 20 --title "MRAMS","LMD_MMM" -d -S png -O comp_temp_serie2d_srlsn3 -i 4 -l 0.01,40,40 --xlabel "Local time (h)" --axtime lt --ylabel "Altitude above surface (km)" -m 105 -M 250 -c spectral --xmin 5 --xmax 24
+rm -f comp_temp_serie2d_srlsn3.sh
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v hodograph --vert 0 --lon $lon --lat $lat --div 20 --labels "MRAMS","LMD_MMM" --title "Hodograph of horizontal winds at 10m AGL (final drop and touchdown)" -d -S png -O comp_hodograph_srlsn3 -i 4 -l 0.01 --xlabel "U component (m/s)" --axtime lt --ylabel "V component (m/s)" --xmin -15 --xmax 15 --ymin -15 --ymax 15
+rm -f comp_hodograph_srlsn3.sh
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v hodograph_2 --vert 0 --lon $lon --lat $lat --div 20 --labels "MRAMS","LMD_MMM" --title "Horiztonal winds rotation at 10m AGL (final drop and touchdown)" -d -S png -O comp_hodograph_2_srlsn3 -i 4 -l 0.01 --xlabel "Local Time (h)" --axtime lt --ylabel "Arbitrary wind rotation (degrees)"
+rm -f comp_hodograph_2_srlsn3.sh
+
+fi
+
+if [ $2 == profiles ]
+then
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v UV --lon $lon --lat $lat --div 20 --labels "MRAMS","LMD_MMM" --title "Horizontal winds at LT 13:00" -d -S png -O comp_uv_profile_lt13_srlsn3 -i 4 -l 0.01,40,40 --xlabel "Horizontal wind speed (m/s)" --axtime lt --ylabel "Altitude above surface (km)" --axtime lt --time 13
+rm -f comp_uv_profile_lt13_srlsn3.sh
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v tk --lon $lon --lat $lat --div 20 --labels "MRAMS","LMD_MMM" --title "Temperature serie at LT 13:00" -d -S png -O comp_temp_profile_lt13_srlsn3 -i 4 -l 0.01,40,40 --xlabel "Temperature (K)" --axtime lt --ylabel "Altitude above surface (km)" --axtime lt --time 13
+rm -f comp_temp_profile_lt13_srlsn3.sh
+
+fi
+
+if [ $2 == surface ]
+then
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v PSFC --axtime lt --title "MRAMS Inner Nest surface pressure","LMD_MMM Inner Nest surface pressure" -d -S png -O comp_pressure_srlsn3 --blat -20 --div 20 --res 200 --lon $lon --lat $lat --xlabel "Local Time (h)" --ylabel "Surface Pressure (Pa)"
+rm -f comp_pressure_srlsn3.sh
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v CDU --axtime lt --title "MRAMS Inner Nest surface stress","LMD_MMM Inner Nest surface stress" -d -S png -O comp_surfstress_srlsn3 --blat -20 --div 20 --res 200 --lon $lon --lat $lat --xlabel "Local Time (h)" --ylabel "Surface stress (m/s)"
+rm -f comp_surfstress_srlsn3.sh
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v HFX --axtime lt --title "MRAMS Inner Nest sensib. heat flux ","LMD_MMM Inner Nest sensib. heat flux" -d -S png -O comp_sensibflux_srlsn3 --blat -20 --div 20 --res 200 --lon $lon --lat $lat --xlabel "Local Time (h)" --ylabel "Sensible heat flux (K.m/s)"
+rm -f comp_sensibflux_srlsn3.sh
+
+fi
+
+fi
+
+########## ---------
+
+if [ $1 == maps ]
+then
+
+if [ $2 == winds ]
+then
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams -v UV --axtime lt --time 14 -i 4 -l 0.01 --title "MRAMS horizontal winds at 10m AGL" -d -S png -W --vert 0 -O mrams_winds_10mAGL_maps --proj spstere --blat -20 --div 20 --res 200 -s 5 --mark $lon,$lat
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams  -v UV --axtime lt --time 14 -i 4 -l 0.6 --title "MRAMS horizontal winds at 600m AGL" -d -S png -W --vert 0 -O mrams_winds_600mAGL_maps --proj spstere --blat -20 --div 20 --res 200 -s 5 --mark $lon,$lat
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams  -v UV --axtime lt --time 14 -i 3 -l 1 --title "MRAMS horizontal winds at 1km AML" -d -S png -W --vert 0 -O mrams_winds_1kmAML_maps --proj spstere --blat -20 --div 20 --res 200 -s 5 --mark $lon,$lat
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams  -v UV --axtime lt --time 14 -i 3 -l 4 --title "MRAMS horizontal winds at 4km AML" -d -S png -W --vert 0 -O mrams_winds_4kmAML_maps --proj spstere --blat -20 --div 20 --res 200 -s 5 --mark $lon,$lat
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams -v UV --axtime lt --time 14 -i 3 -l 10 --title "MRAMS horizontal winds at 10km AML" -d -S png -W --vert 0 -O mrams_winds_10kmAML_maps --proj spstere --blat -20 --div 20 --res 200 -s 5 --mark $lon,$lat
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams  -v UV --axtime lt --time 14 -i 3 -l 20 --title "MRAMS horizontal winds at 20km AML" -d -S png -W --vert 0 -O mrams_winds_20kmAML_maps --proj spstere --blat -20 --div 20 --res 200 -s 5 --mark $lon,$lat
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d03$filelmd -v UV --axtime lt --time 14 -i 4 -l 0.01 --title "LMD_MMM horizontal winds at 10m AGL" -d -S png -W --vert 0 -O lmd_winds_10mAGL_maps --proj spstere --blat -20 --div 20 --res 200 -s 5 --mark $lon,$lat
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d03$filelmd  -v UV --axtime lt --time 14 -i 4 -l 0.6 --title "LMD_MMM horizontal winds at 600m AGL" -d -S png -W --vert 0 -O lmd_winds_600mAGL_maps --proj spstere --blat -20 --div 20 --res 200 -s 5 --mark $lon,$lat
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d03$filelmd  -v UV --axtime lt --time 14 -i 3 -l 1 --title "LMD_MMM horizontal winds at 1km AML" -d -S png -W --vert 0 -O lmd_winds_1kmAML_maps --proj spstere --blat -20 --div 20 --res 200 -s 5 --mark $lon,$lat
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d03$filelmd  -v UV --axtime lt --time 14 -i 3 -l 4 --title "LMD_MMM horizontal winds at 4km AML" -d -S png -W --vert 0 -O lmd_winds_4kmAML_maps --proj spstere --blat -20 --div 20 --res 200 -s 5 --mark $lon,$lat
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d03$filelmd -v UV --axtime lt --time 14 -i 3 -l 10 --title "LMD_MMM horizontal winds at 10km AML" -d -S png -W --vert 0 -O lmd_winds_10kmAML_maps --proj spstere --blat -20 --div 20 --res 200 -s 5 --mark $lon,$lat
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d03$filelmd  -v UV --axtime lt --time 14 -i 3 -l 20 --title "LMD_MMM horizontal winds at 20km AML" -d -S png -W --vert 0 -O lmd_winds_20kmAML_maps --proj spstere --blat -20 --div 20 --res 200 -s 5 --mark $lon,$lat
+
+montage mrams_winds_10mAGL_maps_200.png lmd_winds_10mAGL_maps_200.png mrams_winds_600mAGL_maps_200.png lmd_winds_600mAGL_maps_200.png mrams_winds_1kmAML_maps_200.png lmd_winds_1kmAML_maps_200.png -mode concatenate -tile 2x3 comp_winds_maps_10m_1km.png
+montage mrams_winds_4kmAML_maps_200.png lmd_winds_4kmAML_maps_200.png mrams_winds_10kmAML_maps_200.png lmd_winds_10kmAML_maps_200.png mrams_winds_20kmAML_maps_200.png lmd_winds_20kmAML_maps_200.png -mode concatenate -tile 2x3 comp_winds_maps_4km_20km.png
+rm -f mrams_winds_10mAGL_maps.sh lmd_winds_10mAGL_maps_200.png mrams_winds_600mAGL_maps_200.png lmd_winds_600mAGL_maps_200.png mrams_winds_1kmAML_maps_200.png lmd_winds_1kmAML_maps_200.png mrams_winds_4kmAML_maps_200.png lmd_winds_4kmAML_maps_200.png mrams_winds_10kmAML_maps_200.png lmd_winds_10kmAML_maps_200.png mrams_winds_20kmAML_maps_200.png lmd_winds_20kmAML_maps_200.png mrams_winds_10mAGL_maps.sh lmd_winds_10mAGL_maps.sh mrams_winds_600mAGL_maps.sh lmd_winds_600mAGL_maps.sh mrams_winds_1kmAML_maps.sh lmd_winds_1kmAML_maps.sh mrams_winds_4kmAML_maps.sh lmd_winds_4kmAML_maps.sh mrams_winds_10kmAML_maps.sh lmd_winds_10kmAML_maps.sh mrams_winds_20kmAML_maps.sh lmd_winds_20kmAML_maps.sh 
+
+fi
+
+if [ $2 == surface ]
+then
+#/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v PSFC --axtime lt --time 14 --title "MRAMS Inner Nest surface pressure","LMD_MMM Inner Nest surface pressure" -d -S png -O comp_pressure_maps --proj spstere --blat -20 --div 20 --res 200 --mark $lon,$lat
+#rm -f comp_pressure_maps.sh
+#/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v CDU --axtime lt --time 14 --title "MRAMS Inner Nest surface stress","LMD_MMM Inner Nest surface stress" -d -S png -O comp_surfstress_maps --proj spstere --blat -20 --div 20 --res 200 --mark $lon,$lat
+#rm -f comp_surfstress_maps.sh
+#/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemrams,$lmdfiles/wrfout_d03$filelmd -v HFX --axtime lt --time 14 --title "MRAMS Inner Nest sensib. heat flux ","LMD_MMM Inner Nest sensib. heat flux" -d -S png -O comp_sensibflux_maps --proj spstere --blat -20 --div 20 --res 200 --mark $lon,$lat
+#rm -f comp_sensibflux_maps.sh
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d03$filelmd -v HFX --axtime lt --time 14 --title "MRAMS Inner Nest sensib. heat flux ","LMD_MMM Inner Nest sensib. heat flux" --proj spstere --blat -20 --div 20 --mark $lon,$lat
+
+fi
+
+fi
+
+########## ---------
+
+if [ $1 == variability ]
+then
+
+if [ $2 == histo ]
+then
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemramsa,$mramsfiles/mramsout_d03$filemrams,$mramsfiles/mramsout_d03$filemramsb -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "MRAMS day-1","MRAMS day 0","MRAMS day+1" --title "MRAMS Inner-Nest Horizontal wind histogram at landing site for all time and altitudes" -d -S png -O mrams_histo2d_variability --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)" --ymin 0 --ymax 0.05
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemramsa,$mramsfiles/mramsout_d03$filemrams,$mramsfiles/mramsout_d03$filemramsb -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "MRAMS day-1","MRAMS day 0","MRAMS day+1" --title "Hor. wind histogram / 10m-600m AGL range: POWERED DESCENT" -d -S png -O mrams_histo1d_10m_600m_AGL_variability --vert 0,10 -i 4 -l 0.01,0.6,20 --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)"
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemramsa,$mramsfiles/mramsout_d03$filemrams,$mramsfiles/mramsout_d03$filemramsb -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "MRAMS day-1","MRAMS day 0","MRAMS day+1" --title "Hor. wind histogram / 1km-4km AML range: MAIN PARACHUTE DESCENT" -d -S png -O mrams_histo1d_1km_4km_AML_variability --vert 0,20 -i 3 -l 1,4,20 --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)"
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemramsa,$mramsfiles/mramsout_d03$filemrams,$mramsfiles/mramsout_d03$filemramsb -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "MRAMS day-1","MRAMS day 0","MRAMS day+1" --title "Hor. wind histogram / 4km-10km AML range: DROGUE AND PARACHUTE DEPLOYMENT" -d -S png -O mrams_histo1d_4km_10km_AML_variability --vert 0,20 -i 3 -l 4,10,20 --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)"
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemramsa,$mramsfiles/mramsout_d03$filemrams,$mramsfiles/mramsout_d03$filemramsb -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "MRAMS day-1","MRAMS day 0","MRAMS day+1" --title "Hor. wind histogram / 10km-40km AML range: DECELERATION PHASE" -d -S png -O mrams_histo1d_10km_40km_AML_variability --vert 0,20 -i 3 -l 10,40,20 --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)"
+montage mrams_histo1d_10m_600m_AGL_variability_200.png mrams_histo1d_1km_4km_AML_variability_200.png mrams_histo1d_4km_10km_AML_variability_200.png mrams_histo1d_10km_40km_AML_variability_200.png -mode concatenate -tile 2x2 mrams_histo1d_decomposed_variability.png
+rm -f mrams_histo1d_10m_600m_AGL_variability_200.png mrams_histo1d_1km_4km_AML_variability_200.png mrams_histo1d_4km_10km_AML_variability_200.png mrams_histo1d_10km_40km_AML_variability_200.png mrams_histo1d_10m_600m_AGL_variability.sh mrams_histo1d_1km_4km_AML_variability.sh mrams_histo1d_4km_10km_AML_variability.sh mrams_histo1d_10km_40km_AML_variability.sh
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d03$filelmda,$lmdfiles/wrfout_d03$filelmd,$lmdfiles/wrfout_d03$filelmdb -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "LMD_MMM day-1","LMD_MMM day 0","LMD_MMM day+1" --title "LMD_MMM Inner-Nest Horizontal wind histogram at landing site for all time and altitudes" -d -S png -O lmd_histo2d_variability --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)" --ymin 0 --ymax 0.05
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d03$filelmda,$lmdfiles/wrfout_d03$filelmd,$lmdfiles/wrfout_d03$filelmdb -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "LMD_MMM day-1","LMD_MMM day 0","LMD_MMM day+1" --title "Hor. wind histogram / 10m-600m AGL range: POWERED DESCENT" -d -S png -O lmd_histo1d_10m_600m_AGL_variability --vert 0,10 -i 4 -l 0.01,0.6,20 --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)"
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d03$filelmda,$lmdfiles/wrfout_d03$filelmd,$lmdfiles/wrfout_d03$filelmdb -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "LMD_MMM day-1","LMD_MMM day 0","LMD_MMM day+1" --title "Hor. wind histogram / 1km-4km AML range: MAIN PARACHUTE DESCENT" -d -S png -O lmd_histo1d_1km_4km_AML_variability --vert 0,20 -i 3 -l 1,4,20 --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)"
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d03$filelmda,$lmdfiles/wrfout_d03$filelmd,$lmdfiles/wrfout_d03$filelmdb -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "LMD_MMM day-1","LMD_MMM day 0","LMD_MMM day+1" --title "Hor. wind histogram / 4km-10km AML range: DROGUE AND PARACHUTE DEPLOYMENT" -d -S png -O lmd_histo1d_4km_10km_AML_variability --vert 0,20 -i 3 -l 4,10,20 --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)"
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d03$filelmda,$lmdfiles/wrfout_d03$filelmd,$lmdfiles/wrfout_d03$filelmdb -v uv --analysis histo --lon $lon --lat $lat --div 20 --labels "LMD_MMM day-1","LMD_MMM day 0","LMD_MMM day+1" --title "Hor. wind histogram / 10km-40km AML range: DECELERATION PHASE" -d -S png -O lmd_histo1d_10km_40km_AML_variability --vert 0,20 -i 3 -l 10,40,20 --ylabel "Density of probability" --xlabel "Horizontal wind speed (m/s)"
+montage lmd_histo1d_10m_600m_AGL_variability_200.png lmd_histo1d_1km_4km_AML_variability_200.png lmd_histo1d_4km_10km_AML_variability_200.png lmd_histo1d_10km_40km_AML_variability_200.png -mode concatenate -tile 2x2 lmd_histo1d_decomposed_variability.png
+rm -f lmd_histo1d_10m_600m_AGL_variability_200.png lmd_histo1d_1km_4km_AML_variability_200.png lmd_histo1d_4km_10km_AML_variability_200.png lmd_histo1d_10km_40km_AML_variability_200.png lmd_histo1d_10m_600m_AGL_variability.sh lmd_histo1d_1km_4km_AML_variability.sh lmd_histo1d_4km_10km_AML_variability.sh lmd_histo1d_10km_40km_AML_variability.sh
+
+montage mrams_histo2d_variability_200.png lmd_histo2d_variability_200.png -mode concatenate -tile 2x1 comp_histo2d_variability.png
+rm -f mrams_histo2d_variability_200.png lmd_histo2d_variability_200.png mrams_histo2d_variability.sh lmd_histo2d_variability.sh
+fi
+
+if [ $2 == density ]
+then
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemramsa,$mramsfiles/mramsout_d03$filemramsb -v uv --lon $lon --lat $lat --div 60 --labels "dummy","dummy","MRAMS day-1/0","dummy","dummy","MRAMS day+1/0" --title "MRAMS day-to-day horizontal winds variability at Landing Site" -d -S png -O mrams_histodensity_uv_variability --ope - --fref $mramsfiles/mramsout_d03$filemrams  --analysis histodensity --xmin -15 --xmax 15 --ymin 0 --ymax 0.35
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d03$filelmda,$lmdfiles/wrfout_d03$filelmdb -v uv --lon $lon --lat $lat --div 20 --labels "dummy","dummy","LMD_MMM day-1/0","dummy","dummy","LMD_MMM day+1/0" --title "LMD_MMM day-to-day horizontal winds variability at Landing Site" -d -S png -O lmd_histodensity_uv_variability --ope - --fref $lmdfiles/wrfout_d03$filelmd  --analysis histodensity  --xmin -15 --xmax 15 --ymin 0 --ymax 0.35
+montage mrams_histodensity_uv_variability_200.png lmd_histodensity_uv_variability_200.png -mode concatenate -tile 2x1 comp_histodensity_uv_variability.png
+rm -f mrams_histodensity_uv_variability_200.png lmd_histodensity_uv_variability_200.png mrams_histodensity_uv_variability.sh lmd_histodensity_uv_variability.sh
+
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $mramsfiles/mramsout_d03$filemramsa,$mramsfiles/mramsout_d03$filemramsb -v tk --lon $lon --lat $lat --div 200 --labels "dummy","dummy","MRAMS day-1/0","dummy","dummy","MRAMS day+1/0" --title "MRAMS day-to-day temperature variability at Landing Site" -d -S png -O mrams_histodensity_tk_variability --ope - --fref $mramsfiles/mramsout_d03$filemrams --analysis histodensity --xmin -5 --xmax 5 --ymin 0 --ymax 0.8
+/san0/acolmd/SVN/trunk//UTIL/PYTHON/pp.py -f $lmdfiles/wrfout_d03$filelmda,$lmdfiles/wrfout_d03$filelmdb -v tk --lon $lon --lat $lat --div 40 --labels "dummy","dummy","LMD_MMM day-1/0","dummy","dummy","LMD_MMM day+1/0" --title "LMD_MMM day-to-day temperature variability at Landing Site" -d -S png -O lmd_histodensity_tk_variability --ope - --fref $lmdfiles/wrfout_d03$filelmd --analysis histodensity  --xmin -5 --xmax 5 --ymin 0 --ymax 0.8
+montage mrams_histodensity_tk_variability_200.png lmd_histodensity_tk_variability_200.png -mode concatenate -tile 2x1 comp_histodensity_tk_variability.png
+rm -f mrams_histodensity_tk_variability_200.png lmd_histodensity_tk_variability_200.png mrams_histodensity_tk_variability.sh lmd_histodensity_tk_variability.sh 
+fi
+
+fi
