The official documentation on downloading and installing the CROCO code can be found on the CROCO website

If you are new to TGCC, see this page for information on how to get an account.

Some parts of the preprocessing are complicated to execute on Irene-Rome due to access restrictions, and they are therefore run on the CLIMERI server spirit.

1. Module environment

To access to all the project directories of your group, you need to do this (replace gen6035 by your project ID):

export PROJECT='gen6035' ## adapt project
module switch dfldatadir/$PROJECT
TMP="${PROJECT^^}_CCCSCRATCHDIR";     export SCRATCHDIR=${!TMP}
TMP="${PROJECT^^}_CCCWORKDIR";        export WORKDIR=${!TMP}
TMP="${PROJECT^^}_CCCSTOREDIR";       export STOREDIR=${!TMP}
TMP="${PROJECT^^}_ALL_CCCHOME";       export SHAREDHOME=${!TMP}
TMP="${PROJECT^^}_ALL_CCCSCRATCHDIR"; export SHAREDSCRATCHDIR=${!TMP}
TMP="${PROJECT^^}_ALL_CCCWORKDIR";    export SHAREDWORKDIR=${!TMP}
TMP="${PROJECT^^}_ALL_CCCSTOREDIR";   export SHAREDSTOREDIR=${!TMP}

This can typically be included in ~/.bashrc.

2. Get the sources

If not already done, create the a models repository on Irene-rome:

mkdir -pv ${WORKDIR}/models

Then, on spirit:

git clone --branch v2.1.0 https://gitlab.inria.fr/croco-ocean/croco.git croco-v2.1.0
git clone --branch v2.1.0 https://gitlab.inria.fr/croco-ocean/croco_tools.git croco_tools-v2.1.0
git clone https://gitlab.inria.fr/croco-ocean/croco_pytools.git croco_pytools-v1.0.3
# change paths and project name in the following lines:
rsync -av --chmod=Dg+s --chown=:gen6035 croco-v2.1.0 jourdain@irene-amd-fr.ccc.cea.fr:/ccc/work/cont003/gen6035/jourdain/models/.
rsync -av --chmod=Dg+s --chown=:gen6035 croco_tools-v2.1.0 jourdain@irene-amd-fr.ccc.cea.fr:/ccc/work/cont003/gen6035/jourdain/models/.
rsync -av --chmod=Dg+s --chown=:gen6035 croco_pytools-v1.0.3 jourdain@irene-amd-fr.ccc.cea.fr:/ccc/work/cont003/gen6035/jourdain/models/.

3. Prepare the running directory for a new configuration

Define the name of your new configuration:

export CONFIG='Saigon_02'
mkdir -pv ${SCRATCHDIR}/run_croco  # where the simulations will be run
cd ${WORKDIR}/models/croco-v2.1.0
vi create_config.bash # change to MY_CONFIG_NAME=Run_${CONFIG}
./create_config.bash

Then, if this is the first time you create a configuration on Irene-rome, download Run_croco_save.tar on your local computer and copy it to Irene-rome in the WORKDIR. Then:

cd $WORKDIR
ls -al Run_croco_save.tar
tar xvf Run_croco_save.tar

Then, for every new configuration:

cd ${SCRATCHDIR}/run_croco/Run_${CONFIG}
cp -p $WORKDIR/Run_croco_save/jobcomp .         # adapted for Irene-rome
cp -p $WORKDIR/Run_croco_save/myenv_mypath.sh . # adapted for Irene-rome
cp -rp $WORKDIR/Run_croco_save/MY_SRC .
vi MY_SRC/cppdefs.h # change configuration name # define SAIGON_LR
                    # undef  AGRIF
                    # undef  AGRIF_2WAY
                    # def or undef OBCs

4. Preprocessing

On spirit, get the datasets required for the preprocessing:

cd /scratchu/njourdain
wget https://data-croco.ifremer.fr/DATASETS/DATASETS_CROCOTOOLS.tar.gz
tar xzf DATASETS_CROCOTOOLS.tar.gz
rsync -av --chmod=Dg+s --chown=:gen6035  DATASETS_CROCOTOOLS jourdain@irene-amd-fr.ccc.cea.fr:/ccc/work/cont003/gen6035/jourdain/.
# new topography:
wget 
rsync -av --chmod=Dg+s --chown=:gen6035 Topo_Mekong_Saigon_merged_3sec_2025_v0.nc jourdain@irene-amd-fr.ccc.cea.fr:/ccc/work/cont003/gen6035/jourdain/DATASETS_CROCOTOOLS/Topo/.
# new tide data:
wget
rsync -av --chmod=Dg+s --chown=:gen6035 TPXO9v5_Mekong.nc jourdain@irene-amd-fr.ccc.cea.fr:/ccc/work/cont003/gen6035/jourdain/DATASETS_CROCOTOOLS/TPXO9/.

Then, on Irene-rome:

cd $SCRATCHDIR/run_croco/Run_${CONFIG}
cp -p $WORKDIR/Run_croco_save/crocotools_param.m
vi crocotools_param.m

To create the grid of the parent domain:

module load matlab
matlab -nodesktop
        >> start
        >> make_grid
                % Do you want to link the GSHHS data coastlines (+ borders and rivers) ? y
                % Do you want to use interactive grid maker ? y
                        # Updated values for Saigon_LR:
                        # xsize = 342
                        # ysize = 312
                        # Rotation = 30
                        # Longitu = 106.75
                        # Latitude = 9.8
                % Do you want to use editmask ? y
                        # turn the part of the Gulf of Thailand into land
        >> exit
ls -al CROCO_FILES/croco_grid.nc