VAR=TMAX
 /stornext/home/io/bin/cdo-1.8.2/bin/cdo  mergetime $(ls SAMeT_CPTEC_${VAR}_*.nc | sed \
    -e 's/_jan/_01/' \
    -e 's/_feb/_02/' \
    -e 's/_mar/_03/' \
    -e 's/_apr/_04/' \
    -e 's/_may/_05/' \
    -e 's/_jun/_06/' \
    -e 's/_jul/_07/' \
    -e 's/_aug/_08/' \
    -e 's/_sep/_09/' \
    -e 's/_oct/_10/' \
    -e 's/_nov/_11/' \
    -e 's/_dec/_12/' | sort | sed \
    -e 's/_01/_jan/' \
    -e 's/_02/_feb/' \
    -e 's/_03/_mar/' \
    -e 's/_04/_apr/' \
    -e 's/_05/_may/' \
    -e 's/_06/_jun/' \
    -e 's/_07/_jul/' \
    -e 's/_08/_aug/' \
    -e 's/_09/_sep/' \
    -e 's/_10/_oct/' \
    -e 's/_11/_nov/' \
    -e 's/_12/_dec/' ) SAMeT_CPTEC_${VAR}_teste.nc


exit



VAR=TMIN
cdo=/stornext/home/io/bin/cdo-1.8.2/bin/cdo 
mkdir tmp 
for yyyy in $(seq 2000 1 2024); do
  for mm in $(echo "01 02 03 04 05 06 07 08 09 10 11 12") ; do 
    data_cdo=`date   -u -d "${yyyy}${mm}01 00:00 0 day " +"%Y"-"%m"-"%d",00:00""`
    mes=$(LC_TIME=en_US.UTF-8 date -u -d "${yyyy}${mm}01 00:00 0 day" +"%b" | tr 'A-Z' 'a-z')
    $cdo  settaxis,$data_cdo,1month SAMeT_CPTEC_${VAR}_${yyyy}_${mes}.nc tmp/SAMeT_CPTEC_${VAR}_${yyyy}_${mes}.nc
    echo $yyyy$mm $mes
  done
done
