#!/bin/ksh 
cdo=/stornext/home/io/bin/cdo-1.8.2/bin/cdo
for var in TMIN TMAX TMED; do 
    i=0
    set -A meses "01" "02" "03" "04" "05" "06" "07" "08" "09" "10" "11" "12"
    for mes in jan feb mar apr may jun jul aug sep oct nov dec; do
       $cdo  setdate,2022-${meses[$i]}-01  $var/SAMeT_CPTEC_${var}_mean_${mes}.nc  $var/tmp.nc
       mv $var/tmp.nc $var/SAMeT_CPTEC_${var}_mean_${mes}.nc
        i=$((i+1))
    done
done
