#!/bin/bash
### ===========================================================================
###
##
## SVN information
#  $Author$
#  $Date$
#  $Revision$
#  $Id$
#  $HeadURL$

#source ./Setup.bash

WORK_MOSAIX=/ccc/work/cont003/gen2212/p86mart/MOSAIX

# ============================================================

for ATM in LMD9695 LMD96x95 LMD144142 LMD144x142 LMD256256 LMD256x256 ICO30 ICO40 ICO450 ; 
do
    for OCE in ORCA2.3 eORCA1.2 eORCA025 eORCA025.1
    do
	CplModel=${OCE}x${ATM}
	Liste=$(ls README_${OCE}x${ATM}.txt README_${OCE}x${ATM}_*.txt rmp_*${OCE}_to_*${ATM}_*.nc rmp_*${ATM}_to_*${OCE}_*.nc dia_*${OCE}_to_*${ATM}_*.nc dia_*${ATM}_to_*${OCE}_*.nc ${ATM}_grid_maskFrom_${OCE}_*.nc grids_${OCE}x${ATM}_*.nc masks_${OCE}x${ATM}_*.nc areas_${OCE}x${ATM}_*.nc 2> /dev/null )

	if [[ -z ${Liste} ]] ; then
	    echo "${CplModel} : Vide "
	else
	    echo "${CplModel} : ${Liste}"
	    echo "${WORK_MOSAIX}/${CplModel}"
	    mkdir -p ${WORK_MOSAIX}/${CplModel}
	    mv ${Liste} ${WORK_MOSAIX}/${CplModel}
	fi
    done
    [[ -f Out_${CplModel} ]] && cp Out_${CplModel} ${WORK_MOSAIX}/${CplModel}
done
