Index: /trunk/LMDZ.MARS/README
===================================================================
--- /trunk/LMDZ.MARS/README	(revision 2812)
+++ /trunk/LMDZ.MARS/README	(revision 2813)
@@ -3757,2 +3757,5 @@
 Bug fix in jthermcalc_e107 (wrong indexes used in some computations involving
 NO2 and H2).
+
+== 08/11/2022 == RV
+Update startarchive2icosa repertory for new version of Dynamico
Index: /trunk/LMDZ.MARS/util/startarchive2icosa/README
===================================================================
--- /trunk/LMDZ.MARS/util/startarchive2icosa/README	(revision 2812)
+++ /trunk/LMDZ.MARS/util/startarchive2icosa/README	(revision 2813)
@@ -6,4 +6,5 @@
 Run a dynamico simulation (with startphy_file=false for example) with the desired resolution to get
 start.nc and startfi.nc. These files will be used as reference (rename as *_ref.nc) in the script.
+You can use the files named *_no_start to have an example of callphys etc to run without startfiles
 
 Job_mpi is the file you need to run start_archive2icosa on Occigen
@@ -18,8 +19,8 @@
 --------------
 1) input file start_archive.nc needs some minor adaptations:
-- variable "nivsigs" needs be renamed "sigs" (XIOS requires CF-compliant files)
+- variable "nivsigs" needs be renamed "sigs" (XIOS requires CF-compliant files) (RV: No neeeded anymore)
 ncrename -vnivsigs,sigs start_archive.nc
 - input file start_archive.nc need be converted to NetCDF4 format
-nccopy -k 'netCDF-4' start_archive.nc start_archive_nc4.nc
+nccopy -k 4 start_archive.nc start_archive_nc4.nc
 2) script "compile" can be used to compile main tool start_archive2icosa.f90
    as well as rearrange_startphy.f90
Index: /trunk/LMDZ.MARS/util/startarchive2icosa/callphys.def_no_start
===================================================================
--- /trunk/LMDZ.MARS/util/startarchive2icosa/callphys.def_no_start	(revision 2813)
+++ /trunk/LMDZ.MARS/util/startarchive2icosa/callphys.def_no_start	(revision 2813)
@@ -0,0 +1,175 @@
+##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.
+
+#Directory where external input files are:
+datadir=datadir
+
+## use (read/write) a startfi.nc file? (default=.true.)
+startphy_file = .false.
+surfemis      =0.5
+surfalbedo    =0.5
+
+## 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)
+#  =6 "cold" (low dust) scenario ; =7 "warm" (high dust) scenario
+#  =8 "clim" scenario
+#  =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 = 8
+# 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   = .false.
+# call NLTE radiative schemes ?   matters only if callrad=T
+callnlte = .false.
+# NLTE 15um scheme to use.                                                                           
+# 0-> Old scheme, static oxygen                                                                      
+# 1-> Old scheme, dynamic oxygen                                                                     
+# 2-> New scheme                                                                                     
+nltemodel = 0 
+# call CO2 NIR absorption ?   matters only if callrad=T
+callnirco2 = .false.
+# NIR NLTE correction ? matters only if callnirco2=T                                                 
+nircorr=0
+# call turbulent vertical diffusion ?
+calldifv  = .false.
+# call convective adjustment ?
+calladj  = .false.
+# Thermals
+calltherm = .false.
+callrichsl = .false.
+# call CO2 condensation ?
+callcond =.false.
+# call thermal conduction in the soil ?
+callsoil = .false.
+# call Lott's gravity wave/subgrid topography scheme ?
+calllott  = .false.
+calllott_nonoro  = .false.
+# Impose polar cap surface albedos as observed by TES?
+TESicealbedo = .true.
+## Coefficient for Northern cap albedoes
+TESice_Ncoef=1.6
+## Coefficient for Southern cap albedoes
+TESice_Scoef=1.6
+
+
+## Radiative transfer options :
+## ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# the rad.transfer is computed every "iradia" physical timestep
+iradia    = 1
+# 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 H2O snowfall ?
+scavenging = .false.
+# DUST: Scavenging by instantaneous CO2 snowfall ?
+scavco2cond = .false.
+
+# DUST: freedust ?
+freedust=.false.
+# DUST: dust injection scheme (if >0, use 'dustinjection')
+dustinjection=0
+# DUST: dust injection scheme coefficient
+coeff_injection=0.25
+# DUST: Rocket Dust Storm scheme
+rdstorm=.false.
+# DUST: slpwind scheme
+slpwind = .false.
+
+# DUST/WATERICE: Gravitationnal sedimentation ?
+sedimentation = .false.
+
+
+# WATERICE: Radiatively active transported atmospheric water ice ?
+activice   = .false.
+# WATER: Compute water cycle
+water = .false.
+# WATER: Microphysical scheme for water-ice clouds?
+microphys = .false.
+# WATER: Microphysical time step for water-ice clouds?  (30 by default)
+#imicro = 100
+# WATER: parameter contact
+mteta = 0.95
+# 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.
+# WATER: Water ice albedo ?
+albedo_h2o_ice = 0.35
+# WATER: Water ice thermal inertia
+inert_h2o_ice = 800
+# WATER: Frost thickness threshold for albedo
+frost_albedo_threshold = 0.005
+nuice_sed=0.1
+# PHOTOCHEMISTRY: include chemical species 
+photochem  = .false.
+#WATER: subgrid clouds
+CLFvarying=.false.
+#WATER: subgrid clouds
+CLFfixval=1
+#WATER: naerkind
+naerkind=0
+
+## 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/LMDZ.MARS/util/startarchive2icosa/compile
===================================================================
--- /trunk/LMDZ.MARS/util/startarchive2icosa/compile	(revision 2812)
+++ /trunk/LMDZ.MARS/util/startarchive2icosa/compile	(revision 2813)
@@ -1,12 +1,12 @@
 #!/usr/bin/bash
 
-source /scratch/cnt0027/lmd1167/adelavois/models/code/XIOS/arch.env
-source /scratch/cnt0027/lmd1167/adelavois/models/code/XIOS/arch.path
+source ../../../../../trunk_Dynamico/trunk/XIOS/arch.env
+source ../../../../../trunk_Dynamico/trunk/XIOS/arch.path
 
 mpif90 -g -traceback start_archive2icosa.f90 \
 $NETCDF_INCDIR $NETCDF_LIBDIR $NETCDF_LIB \
 $HDF5_INCDIR $HDF5_LIBDIR $HDF5_LIB \
--I /scratch/cnt0027/lmd1167/adelavois/models/code/XIOS/inc \
--L /scratch/cnt0027/lmd1167/adelavois/models/code/XIOS/lib -lxios -lstdc++ \
+-I ../../../../../trunk_Dynamico/trunk/XIOS/inc \
+-L ../../../../../trunk_Dynamico/trunk/XIOS/lib -lxios -lstdc++ \
 -o start_archive2icosa
 
@@ -14,6 +14,6 @@
 $NETCDF_INCDIR $NETCDF_LIBDIR $NETCDF_LIB \
 $HDF5_INCDIR $HDF5_LIBDIR $HDF5_LIB \
--I /scratch/cnt0027/lmd1167/adelavois/models/code/XIOS/inc \
--L /scratch/cnt0027/lmd1167/adelavois/models/code/XIOS/lib -lxios -lstdc++ \
+-I ../../../../../trunk_Dynamico/trunk/XIOS/inc \
+-L ../../../../../trunk_Dynamico/trunk/XIOS/lib -lxios -lstdc++ \
 -o rearrange_startphy
 
Index: /trunk/LMDZ.MARS/util/startarchive2icosa/icosa_finalize.bash
===================================================================
--- /trunk/LMDZ.MARS/util/startarchive2icosa/icosa_finalize.bash	(revision 2812)
+++ /trunk/LMDZ.MARS/util/startarchive2icosa/icosa_finalize.bash	(revision 2813)
@@ -7,6 +7,7 @@
 # load nco module
 module purge
-source /scratch/cnt0027/lmd1167/adelavois/models/code/XIOS/arch.env
-module load nco/4.7.9-gcc-4.8.5-hdf5-1.8.18-openmpi-2.0.4
+source /scratch/cnt0027/lmd1167/adelavois/models/code/XIOS/arch.env #You have to adapt to your own path
+#module load nco/4.7.9-gcc-4.8.5-hdf5-1.8.18-openmpi-2.0.4 #Example of version of the module needed
+module load nco
 
 #conversion to netcdf 3 in order to rename and add variables, not properly done with netcdf4 files
@@ -24,11 +25,14 @@
 #Temporay soildepth array from Dynamico restartfi
 ncks -A -v soildepth \
-         ../../mars_dynamico_update_basic/startfi_0.nc startphy_nc3.nc
+         ../../mars_dynamico_update_basic/startfi_0.nc startphy_nc3.nc #You have to adapt to your own path
 
-nccopy -k 'netCDF-4' startphy_nc3.nc startfi.nc
+nccopy -k 4 startphy_nc3.nc startfi.nc
 
 #Temporary Time variable from start2archive; should be added with xios
-ncks -A -v Time \
-         start_archive_nc4.nc startfi.nc
+#ncks -A -v Time \
+#         start_archive_nc4.nc startfi.nc
+ncks -O -x -v time_counter startfi.nc startfi.nc_tmp
+ncks -A -v Time start.nc startfi.nc_tmp
+cp startfi.nc_tmp startfi.nc
 
 rearrange_startphy > rearrange_startphy.out 2>&1
@@ -47,4 +51,21 @@
      start_icosa_ref.nc start_icosa.nc
 
+# In the current version of Dynamico, the variable q for tracer is needed but unused.
+# To create this unused variable simply run this short python code
+
+#import numpy as np
+#import netCDF4 as nc
+
+#fn = 'start_icosa.nc'
+#ds = nc.Dataset(fn, 'a', format='NETCDF4')
+#nq = ds.createDimension('nq', 7)
+
+#q = ds.createVariable('q', 'f8', ('nq','lev', 'cell_mesh',))
+#nqq = ds.createVariable('nq', 'f8', ('nq',))
+#q[:,:,:]=0.
+#q.online_operation = "once"
+#q.coordinates = "lat lon"
+#ds.close()
+
 # cleanup
 rm -rf startphy_icosa_nc3.nc startphy_nc3.nc
Index: /trunk/LMDZ.MARS/util/startarchive2icosa/run_icosa.def_no_start
===================================================================
--- /trunk/LMDZ.MARS/util/startarchive2icosa/run_icosa.def_no_start	(revision 2813)
+++ /trunk/LMDZ.MARS/util/startarchive2icosa/run_icosa.def_no_start	(revision 2813)
@@ -0,0 +1,249 @@
+#INCLUDEDEF=saturn_const.def
+
+##mpi_threading_mode=serialized
+#mpi_threading_mode=funneled
+
+#halo_i=0
+#halo_j=1
+# ------------------------------- Mesh ---------------------------------
+
+# Number of subdivision on a main triangle (nbp) : integer (default=40)
+#nbp=160
+nbp=20
+
+# Earth as reference ?
+# nbp                 20  40  80 160
+# T-edge length (km) 500 250 120  60
+
+## sub splitting of main rhombus : integer (default=1)
+#nsplit_i=1
+#nsplit_j=1
+#omp_level_size=1
+###########################################
+## There must be less MPIxOpenMP processes than the 10 x nsplit_i x nsplit_j tiles
+## typically for pure MPI runs, let nproc = 10 x nsplit_i x nsplit_j
+## it is better to have nbp/split >~ 10
+###########################################
+## 10 procs
+nsplit_i=1
+nsplit_j=2
+#### 50 noeuds de 24 processeurs = 1200 procs
+#nsplit_i=10
+#nsplit_j=12
+
+# Number of vertical layer (llm) : integer (default=19)
+#llm=64
+llm=73
+
+# disvert : vertical discretisation : string (default='std') : std, ncar, ncar30l
+#disvert=read_apbp
+disvert=plugin
+
+# optim_it : mesh optimisation : number of iteration : integer (default=0)
+#optim_it=1000
+optim_it=100
+
+# ---------------------------------- Time---------------------------------
+
+## scheme type : string : euler, leapfrog_matsuno, runge_kutta )
+# time_scheme = ARK2.3 (RK 2nd order at 3 levels) | leapfrog_matsuno | ...  
+time_scheme = ARK2.3
+
+## matsuno period : integer ( default=5) Only used for leapfrog_matsuno scheme
+matsuno_period = 10
+
+# timestep : real (default=480s)
+# dt = 92.473958333334
+### attention 3 chiffres significatifs dans XIOS
+# number of dynamical steps per day (instead of dt)
+day_step=960
+
+# advection called every itau_adv time steps : integer (default 2)
+# standard : umax=100m/s vs c=340m/s (ratio 1:3)
+# in JW06 umax=35m/s vs c=340m/s (ratio 1:10)
+itau_adv=3
+
+# number of timestep (default 100) (ignored if run_length is set)
+#itaumax = 10
+
+# run length : real (default=dt*itaumax)
+
+####################################
+
+## 1 martian day
+#run_length = 88775
+#run_length = 887750
+
+## 1 martian year : 59212925s
+## first martian month (61sols):5415275s
+
+# number of days to run
+ndays=1
+
+####################################
+
+##activate IO (default = true)
+#enable_io = false
+
+## output with XIOS (only if compiled with XIOS): true/false (default true)
+#xios_output=false
+
+# output field period (valid XIOS or not) : integer (default none)
+# [should be equal to dt if XIOS dynamical outputs are wanted]
+# [because write_period sets synchronization frequency with XIOS]
+write_period = 92.473958333
+
+
+#itau_write_etat0=380520
+
+# ---------------------------------- Misc --------------------------------
+
+# number of tracer (nqtot) : integer (default 1)
+nqtot=1
+
+# pression value where output is interpolated : real (default=0, no output)
+###out_pression_level=85000
+
+# etat0 : initial state : string (default=jablonowsky06) : 
+# jablonowsky06, academic, ncar
+
+#etat0=start_file
+#etat0_start_file_colocated=true
+
+## -- to cross the 2y limit
+#etat0_start_iteration=0
+#run_length=38052
+
+etat0=isothermal
+etat0_isothermal_temp=200
+
+# start file name (default is start.nc)
+# restart file name (default is restart.nc)
+#start_file_name=start_icosa
+restart_file_name=restart_icosa
+
+#etat0_start_iteration_reset=true
+#etat0_start_iteration=0
+
+##### for one-day run from a profile to create a start
+#etat0=temperature_profile
+#temperature_profile_file=temp_profile.txt
+#run_length=38052
+
+# ------------------------------ Dynamics --------------------------------
+
+# caldyn : computation type for gcm equation : string (default=gcm) : gcm, adv
+caldyn=gcm
+
+# caldyn_conserv : string (default=energy) : energy,enstrophy
+caldyn_conserv=energy
+
+# caldyn_exner : scheme for computing Exner function : string (default=direct) : direct,lmdz
+caldyn_exner=direct
+
+# caldyn_hydrostat : scheme for computing geopotential : string (default=direct) : direct,lmdz
+caldyn_hydrostat=direct
+
+# guided_type : string (default=none) : none, ncar
+guided_type=none
+
+#Sponge layer
+### iflag_sponge=0 for no sponge
+### iflag_sponge=1 for sponge over 4 topmost layers
+### iflag_sponge=2 for sponge from top to ~1% of top layer pressure
+### tau_sponge --> damping frequency at last layer
+### e-5 medium / e-4 strong yet reasonable / e-3 very strong
+### mode_sponge=1 for u,v --> 0
+### mode_sponge=2 for u,v --> zonal mean (NOT IMPLEMENTED)
+### mode_sponge=3 for u,v,h --> zonal mean (NOT IMPLEMENTED)
+#iflag_sponge = 1
+iflag_sponge = 1
+tau_sponge = 1.e-4
+#mode_sponge = 1
+
+
+# ---------------------------------- Dissipation ---------------------------------
+
+# dissipation time graddiv : real (default=5000)
+tau_graddiv = 2000
+
+# number of iteration for graddiv : integer (default=1)
+nitergdiv = 2
+
+# dissipation time nxgradrot (default=5000)
+tau_gradrot = 4000
+
+# number of iteration for nxgradrot : integer (default=1)
+nitergrot=2
+
+# dissipation time divgrad (theta) (default=5000)
+tau_divgrad= 4000
+# number of iteration for divgrad : integer (default=1)
+niterdivgrad=2
+
+# Vertical evolution of the dissipation coefficient
+# vert_prof_dissip_type=legacy
+vert_prof_dissip_type=plugin
+
+# vertical dissipation setup (none|altitude|pressure)
+vert_prof_dissip_setup=altitude
+dissip_fac_mid=3.
+dissip_fac_up=30.
+dissip_startalt=70.
+dissip_deltaz=30.
+
+#Vertical coefficient for dissipation: 1 is for Earth, 2 Mars, 3 Venus, default is basic scheme
+#vert_prof_dissip=2
+#fac_mid=3.
+#fac_up=30.
+#dissip_deltaz=30.
+#startalt=70.
+
+# Rayleigh friction : string (default=none) : none, dcmip2_schaer_noshear, dcmip2_schaer_shear
+rayleigh_friction_type=none
+#rayleigh_friction_type=giant_liu_schneider
+#rayleigh_limlat = 33.
+#rayleigh_friction_tau = 8640000.
+
+# -------------------------------- Physics -------------------------------------
+
+# (itau_physics=160)*(dt=118.9125) --> half a saturn day as physical timestep
+# ---- for some reason (day consistency, physical timestep must be less a day)
+# ---- change also in run.def
+itau_physics=5
+
+# kind of physics : string : none, dcmip (default=none)
+physics=phys_external
+
+## testcase physics for dcmip : INTEGER : 1, 2 (default=1)
+#dcmip_physics=1
+
+# -------------------- parameters for NCAR test cases ------------------------
+
+# NCAR advection test, initial tracer : string ( default='cos_bell')
+# const, slotted_cyl, cos_bell, dbl_cos_bell_q1, dbl_cos_bell_q2, complement, hadley
+ncar_adv_shape=cos_bell
+
+# NCAR advection test, wind field : string (default='deform') : solid, deform, hadley
+ncar_adv_wind=solid
+
+# ncar_T0 : reference temperature for NCAR test cases : real (default=300) 
+# also used by disvert if disvert=ncar
+ncar_T0=300
+
+# ncar_p0 : reference pressure for NCAR test cases : real (default=1e5) 
+# also used by disvert if disvert=ncar
+ncar_p0=1e5
+
+# ncar_disvert_c : exponent for B(eta) : integer (default=1)
+# used by disvert if disvert=ncar
+
+ncar_disvert_c=1
+
+# dcmip 4 testcase : integer (default=1) : 1, 2
+dcmip4_testcase=1
+#-----------------------------------------------------------------------
+
+
+check_conservation = detailed
+itau_check_conserv = 320
Index: /trunk/LMDZ.MARS/util/startarchive2icosa/traceur.def_no_start
===================================================================
--- /trunk/LMDZ.MARS/util/startarchive2icosa/traceur.def_no_start	(revision 2813)
+++ /trunk/LMDZ.MARS/util/startarchive2icosa/traceur.def_no_start	(revision 2813)
@@ -0,0 +1,2 @@
+1
+co2
