CCR logo

Nelson Home | UW Home | My UW | Map

click to support CCR

Get the latest on UW-Madison's COVID-19 Response
View updates to campus operations, information, and planning: Learn more

ABOUT
  • About CCR
  • Mission
  • Bryson Scholarship
  • Support CCR
  • Affiliated Institutions
  • Contact
PEOPLE
  • Meet the Director
  • Faculty, Scientists and Researchers
  • Administrators
  • Postdoctoral Scientists
  • Students
  • Affiliates
  • Climate Change Experts
  • Emeritus
NEWS
  • News Archive
  • Research Spotlight
EVENTS
  • CPEP Seminars
  • Climate Change Symposium
  • AOS Colloquium Series
  • Weston Roundtable Series
  • Past Events
CPEP
  • CPEP Seminars
  • Bryson Professors
  • Postdoctoral Fellows and Students
  • Seed Grants
RESEARCH
  • Publications
  • Carbon Cycling
  • Climate Impacts and Vulnerability
  • Climate Dynamics
  • Oceanography and Limnology
  • Past Climates
  • Surface-Atmosphere Feedbacks
RESOURCES
  • Visualization and Tools
  • Data
  • Scripts
  • Facilities and Equipment
  • Climate Jobs
click to toggle subnavRELATED LINKS
RESOURCES
Visualizations and Tools »
Data »
Scripts »
Facilities and Equipment »
Climate Jobs »

NCO

Adding Two-Dimensional ORO to Files Using NCL and NCKS

NCEA | NCRCAT | NCKS | NCDIFF | NCRENAME | NCRCAT | NCDTRND | ORO

If 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 or oro.40x48.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.ncl

It will create a file that contains a two-dimensional (lat,lon) oro field.

Step 3: Use ncks to copy oro from oro.128x128.nc or oro.40x48.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 okay 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: ncdump -h filename.nc  to check the file header information.

click to visit the Nelson website
click to visit Nelson on Facebook click to visit Nelson on Twitter

CONTACT US:


Nelson Institute Center for Climatic Research
University of Wisconsin-Madison
1225 W. Dayton St.
Madison, WI 53706 USA
(608) 262-2839
(608) 263-4190 (FAX)

PARTNERSHIPS



  • Support CCR
  • CCR affiliates
University of Wisconsin Madison logo
Copyright © 2021 The Board of Regents of the University of Wisconsin System. Feedback, questions or accessibility issues: