This directory contains some prototypes and example of programs
and scripts to generate initial condition files for Venus-DYNAMICO
from a Venus PCM (lon-lat) start_archive file

Preliminary steps and requirements:
----------------------------------
- You must have run a Venus-DYNAMICO simulation (with startphy_file=.false.)
  at the sought horizontal (nbp=...) and vertical (llm=...) resolution
  to have adequate start.nc and startphy.nc files
  called start_icosa_ref.nc and startphy_icosa_ref.nc hereafter
- You will need at start_archive.nc file obtained from a Venus PCM run.
- You need a high resolution topography file, e.g. topo_Thomas_inv_nc4.nc 

- You need some NCO tools to post-process/adapt some of the NetCDF files

In a nutshell:
--------------
1) The input start_archive.nc needs to be converted to NetCDF4 format
   (for compliance with XIOS); you can use "nccopy" for that:
nccopy -k 4 start_archive.nc start_archive_nc4.nc

2) Two Fortran programs, start_archive2icosa.f90 and rearrange_startphy.f90
   will be needed, so you have to compile them
An example "compile" script is provided, which you'll need to adapt to
your own settings to generate executables start_archive2icosa and
rearrange_startphy

3) You should first run "start_archive2icosa". It needs quite a bit of memory
   and cores so you'll probably need to create and submit a job
script "job_start_archive2icosa" is provided as an illutrative example
to adapt to your own system.
To run, "start_archive2icosa" needs:
start_archive_nc4.nc, start_icosa_ref.nc, startphy_icosa_ref.nc,
topo_Thomas_inv_nc4.nc and iodef.xml
You may need to adapt iodef.xml to match variable names in start_icosa_ref.nc
(especially if you have tracers which might have different names)
Upon successful completion, the program will generate two files:
"start_icosa.nc" and "startphy_icosa.nc"

4) Some further tailoring is needed, including a reordering of columns
(via the rearrange_startphy program) and some minor additions.
All this is handled by the icosa_finalize.bash script which should be run
and will generate start.nc and startphy.nc files usable by Venus-DYNAMICO

