Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/RUN/wrf_sounding.sci
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/RUN/wrf_sounding.sci	(revision 258)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/RUN/wrf_sounding.sci	(revision 258)
@@ -0,0 +1,141 @@
+// profile for WRF initialization
+// update: january 2008
+
+
+//// ----------------------------------------------
+//// Allow user to define input parameters
+//// ----------------------------------------------
+//lat=evstr(x_dialog('Latitude (deg)?','20'));
+//lon=evstr(x_dialog('East Longitude (deg)?','0'));
+//l_s=evstr(x_dialog('Aerocentric longitude (deg)?','90'));
+//lt=evstr(x_dialog('Local time ?','12'));
+//
+//alt=evstr(x_dialog('Altitude top (km)?','50'));
+//resol=evstr(x_dialog('Vertical resolution (points)?','100'));
+
+
+[finput]=file('open', 'input_coord', 'old');
+[vinput]=read(finput,6,1);
+
+lon   = vinput(1);
+lat   = vinput(2);
+l_s   = vinput(3);
+lt    = vinput(4);
+alt   = vinput(5);
+resol = vinput(6);
+
+disp(lon)
+disp(lat)
+disp(l_s)
+disp(lt)
+disp(alt)
+disp(resol)
+
+//vert_coord=evstr(x_dialog('Vertical coordinate type (1-4)?','3'));
+vert_coord = 3;
+//dust_scenario=evstr(x_dialog('Dust scenario (1-8)?','3'));
+dust_scenario = 3;
+//hireskey=evstr(x_dialog('High resolution (0-1)?','1'));
+hireskey=1;
+
+
+// create atltitude array at the required resolution
+alt_profile = [0,1,5,10,20,50,100,[linspace(200,alt*1000,resol)]];
+resol=resol+7;
+
+
+
+// MCD profiles
+//// - profils_mcd(Ls,Loct,Lat,Lon,dust,zkey,hireskey,xz)
+//getf('./profils_mcd.sci');
+exec('./profils_mcd.sci');//,7);
+[p,m] = profils_mcd(l_s,lt,lat,lon,dust_scenario,vert_coord,hireskey,alt_profile);
+
+
+// In Scilab arrays have to be initialized 
+utab=ones(max(size(alt_profile)));
+vtab=ones(max(size(alt_profile)));
+ttab=ones(max(size(alt_profile)));
+
+
+// % "-espace occupe- . -precision apres la virgule- -type de nombre-"
+// \n pour passer a la ligne
+
+fid = mtlb_fopen("input_sounding","w")
+fid2= mtlb_fopen("input_more","w")
+fid3= mtlb_fopen("input_therm","w")
+  // pression de surface (1ere couche)
+     ref_p = p(1,1,1)  // equiv. a m(1,1,19)
+     ref_p_mbar = ref_p/100;
+     ref_dummy = 0;
+  // temp_pot de surface (1ere couche)
+     disp(m(1,1,15)); // equiv. a p(1,1,3)
+     //ref_temppot = m(1,1,15)*(610./ref_p)^(1.0/4.4);
+     ref_temppot = m(1,1,15)*(610./ref_p)^(1.0/3.9);
+  // ecriture  	
+     mfprintf(fid,"%10.2f",ref_p_mbar);
+     mfprintf(fid,"%12.2f",ref_temppot);
+     mfprintf(fid,"%12.2f\n",ref_dummy);
+
+  // ecriture du profil
+for i=1:resol
+  dummy=0;
+  pression=p(1,i,1);
+  altitude=m(1,i,2);    // altitude zero MOLA
+  temperature=p(1,i,3);
+  density=p(1,i,2);
+  cp = m(1,i,8);
+  rr = m(1,i,49);
+  rcp = rr / cp ;
+  //temppot=temperature*(610./pression)^rcp;
+  //temppot=temperature*(610./pression)^(1.0/4.4);
+  temppot=temperature*(610./pression)^(1.0/3.9);
+  u=p(1,i,4);
+  v=p(1,i,5);
+
+      mfprintf(fid,"%10.2f",altitude);
+      mfprintf(fid,"%12.2f",temppot);
+      ttab(i)=temppot;
+      mfprintf(fid,"%12.2f",dummy);
+      mfprintf(fid,"%12.2f",u);
+      utab(i)=u;
+      mfprintf(fid,"%12.2f\n",v);
+      vtab(i)=v;
+      mfprintf(fid3,"%12.2f",rr);
+      mfprintf(fid3,"%12.2f",cp);
+      mfprintf(fid3,"%18.6e",pression);
+      mfprintf(fid3,"%18.6e",density);
+      mfprintf(fid3,"%12.2f\n",temperature);
+end
+altimetry=m(1,1,2)
+//altimetry=0. //OK
+surftemp=m(1,1,15)
+mfprintf(fid2,"%10.2f",altimetry);
+mfprintf(fid2,"%10.2f",surftemp);
+
+exit
+
+// Plot 
+alt_profile=alt_profile/1000;
+xset("window",1)
+style = [1,5];
+strf = "111";
+leg = "Zonal@Meridional";
+rect = [0,min([utab,vtab])-5,max(alt_profile),max([utab,vtab])+5]; //BEWARE : xmin ymin xmax ymax
+plot2d([alt_profile',alt_profile'],[utab,vtab],style,strf,leg,rect);
+	// BEWARE : column vector in plot2d
+xtitle("MCD 4.2 wind profiles at longitude "+string(lon)+" deg, latitude "+string(max(lat))+" deg, localtime "+string(lt)+" h, ls "+string(l_s)+" deg","Altitude (km)","Wind (m/s)");
+
+xset("window",2)
+style = [1];
+strf = "111";
+leg = "";
+rect = [0,min(ttab)-5,max(alt_profile),max(ttab)+5]; //BEWARE : xmin ymin xmax ymax
+plot2d(alt_profile',ttab,style,strf,leg,rect);
+	// BEWARE : column vector in plot2d
+xtitle("MCD 4.2 temperature at longitude "+string(lon)+" deg, latitude "+string(max(lat))+" deg, localtime "+string(lt)+" h, ls "+string(l_s)+" deg","Altitude (km)","Temperature (K)");
+
+//exit
+
+
+
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/namelist.input_full
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/namelist.input_full	(revision 255)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/namelist.input_full	(revision 258)
@@ -35,5 +35,5 @@
  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 
+                             !!         NB: decrease this parameter when low p_top_requested
  max_dz = 1500.              !! (p3) Maximal interval (m) between vertical levels
  eta_levels = -1.            !! (p3)  Specify a list of e_vert eta levels
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/namelist.input_les
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/namelist.input_les	(revision 258)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/namelist.input_les	(revision 258)
@@ -0,0 +1,76 @@
+ &time_control
+ run_seconds         = 37000   !! Duration of simulation                       [LES: !=0]  
+ history_interval_s  = 100     !! Frequency of outputs in seconds              [LES: !=0]
+ frames_per_outfile  = 37      !! Size of time dimension in files
+ start_year          = 9999    !! Idealized simulation                         [LES: 9999]
+ end_year            = 9999    !! Idealized simulation                         [LES: 9999]
+ 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
+ ztop                = 12000.  !! Altitude above ground of model top           [LES: !=0]       
+ time_step           = 0       !! Dynamical timestep
+ time_step_fract_num = 3       !! Additional fraction to time_step: numerator
+ time_step_fract_den = 4       !! Additional fraction to time_step: denominator
+ dx                  = 50      !! (p2) Horizontal resolution
+ dy                  = 50      !! (p2) Horizontal resolution (should be equal to dx)
+ e_we                = 145     !! (r)(p2) Number of longitude grid points
+ e_sn                = 145     !! (r)(p2) Number of latitude grid points
+ e_vert              = 201     !! (r)(p2) Number of vertical levels
+ /
+
+ &physics
+ isfflx              = 1       !! 0 : UST/HFX from tke_... namelist values
+                               !! 1 : UST/HFX from LMD physics
+                               !! 2 : UST from LMD / HFX from namelist.input
+ init_TI             = 50.     !! Define constant thermal inertia value        [LES: !=0]
+ init_AL             = 0.3     !! Define constant albedo value                 [LES: !=0]
+ !!
+ !! OPTIONAL
+ !!
+ radt                = 40      !! Ratio between physical and dynamical time step
+ mars                = 0       !! (r)(p2) Configuration of tracers:
+                               !!         0: no tracers, 1: water vapor + ice, 2: dust
+ init_MU             = 0.01    !! (p3) Multiply ini & bdy zonal wind by init_U
+ init_MV             = 0.01    !! (p3) Multiply ini & bdy meridional wind by init_V
+ /
+
+ &dynamics
+ diff_opt            = 2       !! (*d) Diffusion option                        [LES: 2]
+ km_opt              = 2       !! (*d) Eddy coefficient option                 [LES: 2]
+ diff_6th_opt        = 0       !! (*d) Knievel numerical diffusion             [LES: 0]
+ mix_full_fields     = T       !! (*d) Set true if mixing ref + pert profiles  [LES: T]
+ !!
+ !! OPTIONAL
+ !!
+! c_k                   = 0.10     !! Mixing coefficient constant for km_opt=2 [default: 0.15]
+! c_s                   = 0.18     !! Mixing coefficient constant for km_opt=3 [default: 0.25]
+! pd_tke                = T        !! Positive definite advection of tke
+! tke_heat_flux         = 1.       !! Constant surface thermal flux (H/(rho*cp), K m/s)
+! tke_drag_coefficient  = 0.0025,  !! Constant surface drag coefficient (Cd, dimensionless)
+! mix_upper_bound       = 100.     !! Non-dimensional upper limit for diffusion coeffs
+! mix_isotropic         = 1        !! 0=anistropic vertical/horizontal diffusion coeffs, 1=isotropic
+! pert_coriolis         = T        !! Coriolis only acts on wind perturbation (idealized)
+ /
+
+ &bdy_control
+ periodic_x          = T       !! (p3) Periodic boundary conditions over x     [LES: T]
+ periodic_y          = T       !! (p3) Periodic boundary conditions over y     [LES: T]
+ /
+
+ &grib2
+ /
+
+ &fdda
+ /
+
+ &namelist_quilt              !! (*)
+ nio_tasks_per_group = 0,     !! (*)
+ nio_groups = 1,              !! (*)
+ /                            !! (*)
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/namelist.input_nests
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/namelist.input_nests	(revision 258)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/namelist.input_nests	(revision 258)
@@ -0,0 +1,69 @@
+ &time_control
+ start_year         = 2024, 2024, 2024,   !! Any information about dates have to be duplicated for each nest     
+ start_month        =   10,   10,   10,   !! ..
+ start_day          =   03,   03,   03,   !! ..
+ start_hour         =   06,   06,   06,   !! ..
+ end_year           = 2024, 2024, 2024,   !! ..
+ end_month          =   10,   10,   10,   !! ..
+ end_day            =   07,   07,   07,   !! ..
+ end_hour           =   06,   06,   06,   !! ..
+ history_interval   =   37,   37,   37,   !! Any information about model outputs have to be set for each nest   
+ frames_per_outfile =   24,   24,   24,   !! ... NB: could be different for each nest
+ restart            = .false.
+ restart_interval   = 8880
+ io_form_history    = 2
+ io_form_restart    = 2
+ io_form_input      = 2
+ io_form_boundary   = 2
+ debug_level        = 0
+ /
+
+ &domains
+ time_step              =     40    !! This is time_step for the parent nest
+ p_top_requested        =     10     
+ force_sfc_in_vinterp   =      5
+ num_metgrid_levels     =     33
+ max_dom                =      3                !! Set number of nests here   
+ grid_id                =      1,     2,    3,  !! Identify each grid by a number
+ parent_id              =      0,     1,    2,  !! Identify parents for each nested domain
+                                                !! ....(two nested domains can have the same parent)
+ parent_grid_ratio      =      1,     3,    3,  !! "Zooming" ratio between nests. 3 is a good choice.
+  !! WARNING: parent_grid_ratio must divide e_we - s_we plus 1
+ parent_time_step_ratio =      1,     2,    3,  !! Time step ratio between nests.
+ i_parent_start         =      0,    40,   40,  !! \  Those subscripts are used to place the nested
+ j_parent_start         =      0,    40,   40,  !! /  domains with respect to their respective parents. 
+ e_we                   =    117,   121,  121,  !! IMPORTANT: e_we[parent domain] = e_we[child domains] - 4
+ e_sn                   =    117,   121,  121,  !! IMPORTANT: e_sn[parent domain] = e_sn[child domains] - 4
+  !! WARNING: number of processors must divide e_we minus 1 and e_sn minus 1
+ e_vert                 =     61,    61,   61,  !! Vertical levels must be duplicates         
+ dx                     =  63000, 21000, 7000,  !! Compute dx[child] with parent_grid_ratio and dx[parent]
+ dy                     =  63000, 21000, 7000,  !! .... (keep 10^-2 accuracy if result of division is not int)
+ feedback               =      1                !! Set 0 for 1-way nesting / 1 for 2-way nesting
+ smooth_option          =      2                !! We recommend using smooth_option = 2
+ blend_width            =      5                !! We recommend using blend_width = 5
+ /
+
+ &physics
+ /
+
+ &fdda
+ /
+
+ &dynamics
+ tiso = 100. 
+ non_hydrostatic  =   F, F, F,       !! We recommend using hydrostatic integration in all nests
+                                     !! .... (non-hydrostatic nested runs might be unstable)
+ /
+
+ &grib2
+ /
+
+ &bdy_control
+ specified        =   T, F, F,       !! Only the parent domain has specified GCM boundary conditions
+ nested           =   F, T, T,       !! ... the child domains are nested within the parent domain
+ /
+
+ &namelist_quilt
+ nio_tasks_per_group = 0,
+ nio_groups = 1,
+ /
Index: trunk/MESOSCALE/LMD_MM_MARS/SIMU/namelist.wps_nests
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SIMU/namelist.wps_nests	(revision 258)
+++ trunk/MESOSCALE/LMD_MM_MARS/SIMU/namelist.wps_nests	(revision 258)
@@ -0,0 +1,35 @@
+&share				      	
+ wrf_core         = 'ARW'
+ max_dom          = 3   
+ start_date = '2024-10-03_06:00:00','2024-10-03_06:00:00','2024-10-03_06:00:00'   
+ end_date   = '2024-10-07_06:00:00','2024-10-03_06:00:00','2024-10-03_06:00:00'   
+ interval_seconds = 3700 
+ io_form_geogrid  = 2
+ debug_level      = 0
+ opt_output_from_geogrid_path='./'    
+/
+
+&geogrid
+ parent_id         =      0,    1,    2,
+ parent_grid_ratio =      1,    3,    3,                    
+ i_parent_start    =      0,   40,   40,
+ j_parent_start    =      0,   40,   40,
+ e_we              =    117,  121,  121,                    
+ e_sn              =    117,  121,  121,                    
+ dx = 63000,
+ dy = 63000,
+ geog_data_res     = '64ppd', '64ppd', '64ppd'       
+ map_proj = 'lambert',           
+ ref_lat   =  -35.,            
+ ref_lon   =  50.,            
+ truelat1  =  -35.,            
+ truelat2  =  0.0,                
+ stand_lon =  50.,            
+ geog_data_path = './WPS_GEOG',   
+/
+
+&metgrid
+ fg_name = './WPSFEED/LMD'        
+ io_form_metgrid = 2,             
+ opt_output_from_metgrid_path='./WRFFEED/current'  
+/
