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

#source ./Setup.bash

WORK_MOSAIC=/ccc/work/cont003/gen2212/p86mart/MOSAIX
mkdir -p ${WORK_MOSAIC}

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

for ATM in LMD144142 LMD9695 LMD256256 ICO30 ICO40 ICO450 dynamico30 dynamico40 dynamico450
do
    for OCE in ORCA2.3 eORCA1.2 eORCA025 ORCA025 
    do
	Liste=$(ls README_${OCE}x${ATM}.txt *${ATM}*_*${OCE}*.nc *${OCE}*_*${ATM}*.nc  *${ATM}x${OCE}*.nc *${OCE}x${ATM}*.nc 2> /dev/null  )

	if [[ -z ${Liste} ]] ; then
	    echo "${ATM} : ${OCE} : Vide "
	else
	    echo "${ATM} : ${OCE} : ${Liste}"
	    echo "${WORK_MOSAIC}/${OCE}x${ATM}"
	    mkdir -p ${WORK_MOSAIC}/${OCE}x${ATM}
	    mv ${Liste}  ${WORK_MOSAIC}/${OCE}x${ATM}

	fi
	
    done
done
