This is an old revision of the document!


Reformatting files to AeroCom/HTAP standards

The AeroCom standard is described in the section “submitting to the AeroCom database”. https://wiki.met.no/aerocom/data_submission

Below simple nco commands are listed which can be of help to reformat.

Another set of tools is under development and can be accessed here: https://github.com/metno/aerocom-data-correction-tools

Format can be checked with a CF checker, eg: http://cf-checker.met.no/upload

Just type the command without arguments on a command line

 ncrename -v oldvar,newvar in.nc
 ncatted -a experiment,newvar,a,c,"BASE" in.nc
 ncrename -O -d LATITUDE,y       temp.nc       
 ncap2 -O -s "LOAD_BCPOM[time,x,y]=LOAD_BC+LOAD_POM" ${file} ${file} 
 rm dummy.nc
 ncwa -O -v AERH2O3D_AER   -a z -y ttl     ${file} dummy.nc  
 ncrename -O -v AERH2O3D_AER,AERH2O_AER       dummy.nc 
 ncks -F -A -v AERH2O_AER dummy.nc ${file} 
 ncks -F -A -v AIRE temp.nc ${file}
 ncecat -O $file $file
 ncpdq -O -a time,record $file $file
 ncwa -O -a record $file $file
 ncpdq -O -a time,y,x $file $file
 ncpdq -O -a -z $file $file

from 12 months in one file

 orgfile=MM_${model}.an${an}.mALLYEAR_an.nc 
 ncwa -F -O -a time ${file} ${orgfile}

fom 12 files each containing 1 month

 ncra -F -O  modis_2000??.nc ${yearfile}
 ncecat -O $file $file 
 ncwa -O -a record $file $file 

with interpolated files

 ncpdq -O -a "-y" $file $file 
 file1=aire_1.nc
 ncks -h -F -O -d x,1,180 $file $file1
 file2=aire_2.nc
 ncks -h -F -O -d x,181,360 $file $file2
 ncap -O -s "x[x]=x-360" $file2 $file2
 ncrcat -O $file2 $file1 $file
\rm  $file1 $file2
ncecat -O $file $file 
ncpdq -O -a x,record $file $file 
ncwa -O -a record $file $file 
file1=DD_${model}.an${AN}.mALLYEAR_1.nc
ncks -F -O -d x,1,180 $file $file1
file2=DD_${model}.an${AN}.mALLYEAR_2.nc
ncks -F -O -d x,181,360 $file $file2
ncap -O -s "x[x]=x-360" $file2 $file2

ncrcat -O $file2 $file1 $file
\rm  $file1 $file2	
ncpdq -O -a time,y,x $file $file 
ncatted -O -a missing_value,$var,o,f,0 ${file} 
ncatted -O -a missing_value,$var,o,f,-9999 ${file} 

actually better use attribute _FillValue (see http://nco.sourceforge.net)

  for IMTH in ${MTH[*]} ; do 
file=DD_${model}.an${AN}.m${IMTH}.nc
filemean=DD_${model}.an${AN}.m${IMTH}_m.nc 
ncra -F -O  ${file} ${filemean}
  done
  ncatted -O -a ,,d,, interdummy.nc
  ncatted -h -a ,global,d,, interdummy.nc
  ncatted -h -a missing_value,,d,, interdummy.nc
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • aerocom/faq-reformatting.1490270765.txt.gz
  • Last modified: 2022-05-31 09:23:10
  • (external edit)