## get test files
for i in  /trd-project4/NS9039K/shared/norcpm/cases/NorESM1-CMIP6/noresm1-cmip6_historical_19500101/noresm1-cmip6_historical_19500101_mem01/ocn/hist/noresm1-cmip6_historical_19500101_mem01.micom.hm.19{81..90}-01.nc
do
    of=$(basename $i)
  ncks -v sst $i ./$of
done

## make a too large scale factor file
ncatted -O -a scale_factor,sst,m,d,0.1 noresm1-cmip6_historical_19500101_mem01.micom.hm.1981-01.nc toolarge_scale_factor.nc

## check the files
for i in noresm1-cmip6_historical_19500101_mem01.micom.hm.1981-01.nc toolarge_scale_factor.nc ; do
    ncdump -h $i | grep scale_factor
done

## control
ncra -F -H -v sst noresm1-cmip6_historical_19500101_mem01.micom.hm.*.nc ctrl_ncra.nc
## test of ncra
ncra -F -H -v sst noresm1-cmip6_historical_19500101_mem01.micom.hm.*.nc toolarge_scale_factor.nc test_ncra.nc
## test of cdo
cdo -b F32 -timavg -select,name=sst noresm1-cmip6_historical_19500101_mem01.micom.hm.*.nc toolarge_scale_factor.nc  test_cdo.nc

## check the value, if it is too much difference, means this method can use directly
cdo infov ctrl_ncra.nc
cdo infov test_ncra.nc
cdo infov test_cdo.nc

