Adding Two-Dimensional ORO to Files Using NCL and NCKSIf your model output file does not contain an oro field, you can use NCL and NCO (specifically, NCKS) to add this variable to your file.
- Step 1: Make a backup copy of your data. This is always a smart idea.
- Step 2: Download the appropriate oro file: oro.128x128.nc
Each file has a two-dimensional oro field. If these oro fields are
not appropriate for your data files, you can make your own using NCL.
Download the script oro.ncl. Edit the required
fields (input and output files) and run it at the unix prompt:
ncl < oro.nclIt will create a file that contains a two-dimensional (lat,lon) oro field.
- Step 3: Use ncks to copy oro from oro.128x128.nc
into the desired file.
Say you want to put oro into a file called ha.foam1.5.test.nc. The command to copy oro from oro.40x48.nc to ha.foam1.5.test.nc is (at the unix prompt):
ncks -v oro oro.40x48.nc ha.foam1.5.test.nc
You will be prompted to Overwrite, Append, or Exit the operation. You want to "append" the file, so choose A.
There may be some messages saying that certain file attributes like latitude and longitude have been overwritten. This is OK as long as the oro file and your data file have the same latitudes and longitudes.
Your data files should now contain the "oro" variable.
- Step 4: Do ncdump -h filename.nc to check the file header information.