#!/bin/ksh -x
cdo=/stornext/home/io/bin/cdo-1.8.2/bin/ncatted
#for var in TMED TMIN TMAX ; do 
for var in TMIN TMAX ; 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 -a units,time,o,c,"minutes since 2022-${meses[$i]}-01 00:00" $var/SAMeT_CPTEC_${var}_mean_${mes}.nc
        i=$((i+1))
    done
done
