Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
aerocom:faq-reformatting [2014-12-19 12:09:58] michaels |
aerocom:faq-reformatting [2022-05-31 09:29:31] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ATTENTION - THIS WIKI PAGE IS NO LONGER UPDATED - PLEASE GO TO [[http:// | ||
| + | |||
| ====== Reformatting files to AeroCom/ | ====== Reformatting files to AeroCom/ | ||
| + | |||
| + | **Note: these commands cover the elder phase 3 naming scheme, but should nevertheless still usefull** | ||
| + | |||
| + | The AeroCom standard is described in the section " | ||
| + | https:// | ||
| + | |||
| + | Below simple nco commands are listed which can be of help to reformat. | ||
| + | |||
| + | A public set of format correction tools is under development and can be accessed here:\\ | ||
| + | https:// | ||
| ===== How to remind me of nco commands ===== | ===== How to remind me of nco commands ===== | ||
| Line 11: | Line 23: | ||
| ===== Split files per variable | ===== Split files per variable | ||
| - | https:// | + | cdo splitname in.nc |
| Line 26: | Line 38: | ||
| ncks -F -A -v AERH2O_AER dummy.nc ${file} | ncks -F -A -v AERH2O_AER dummy.nc ${file} | ||
| - | ===== concatenate | + | ===== add variable |
| ncks -F -A -v AIRE temp.nc ${file} | ncks -F -A -v AIRE temp.nc ${file} | ||
| - | ===== transpose axis ===== | + | ===== make the time dimension unlimited |
| ncecat -O $file $file | ncecat -O $file $file | ||
| ncpdq -O -a time,record $file $file | ncpdq -O -a time,record $file $file | ||
| Line 45: | Line 57: | ||
| ===== calculate yearly average ===== | ===== calculate yearly average ===== | ||
| fom 12 files each containing 1 month | fom 12 files each containing 1 month | ||
| - | ncra -F -O modis_2000?? | + | ncra -F -O modis_2000?? |
| ===== create record dimension ===== | ===== create record dimension ===== | ||
| ncecat -O $file $file | ncecat -O $file $file | ||
| - | ===== make x unlimited ===== | + | ===== delete |
| - | ncpdq -O -a x,record $file $file | + | |
| - | ===== delete | + | |
| ncwa -O -a record $file $file | ncwa -O -a record $file $file | ||
| - | ===== correct axis ===== | + | ===== turn lat to have right order ===== |
| - | + | with interpolated files | |
| + | ncpdq -O -a " | ||
| + | |||
| + | ===== Shift left and right hemispheres ===== | ||
| file1=aire_1.nc | file1=aire_1.nc | ||
| ncks -h -F -O -d x,1,180 $file $file1 | ncks -h -F -O -d x,1,180 $file $file1 | ||
| - | |||
| file2=aire_2.nc | file2=aire_2.nc | ||
| ncks -h -F -O -d x,181,360 $file $file2 | ncks -h -F -O -d x,181,360 $file $file2 | ||
| Line 69: | Line 79: | ||
| \rm $file1 $file2 | \rm $file1 $file2 | ||
| - | ===== turn lat to be consistent ===== | ||
| - | with interpolated files | ||
| - | ncpdq -O -a " | ||
| - | |||
| - | ===== reorder longitude ===== | ||
| + | ===== Similar reorder of longitude ===== | ||
| ncecat -O $file $file | ncecat -O $file $file | ||
| ncpdq -O -a x,record $file $file | ncpdq -O -a x,record $file $file | ||
| Line 91: | Line 97: | ||
| ncpdq -O -a time,y,x $file $file | ncpdq -O -a time,y,x $file $file | ||
| - | ===== identify | + | ===== missing values ===== |
| ncatted -O -a missing_value, | ncatted -O -a missing_value, | ||
| ncatted -O -a missing_value, | ncatted -O -a missing_value, | ||
| - | actually better use attribute _FillValue | + | actually better use attribute _FillValue |
| Line 106: | Line 112: | ||
| done | done | ||
| - | ===== concatenate monthly mean files ===== | ||
| - | monthfile=DD_${model}.an${AN}.mALLYEAR_m.nc | ||
| - | ncrcat -F -O DD_${model}.an${AN}.m?? | ||
| - | |||
| - | |||
| - | ===== calculate yearly mean file ===== | ||
| - | orgfile=DD_${model}.an${AN}.mALLYEAR_an.nc | ||
| - | ncra -F -O ${monthfile} ${orgfile} | ||
| ===== delete attributes ===== | ===== delete attributes ===== | ||
| Line 119: | Line 117: | ||
| ncatted -h -a ,global,d,, interdummy.nc | ncatted -h -a ,global,d,, interdummy.nc | ||
| ncatted -h -a missing_value,, | ncatted -h -a missing_value,, | ||
| - | |||