Ocean Modeling Discussion

ROMS/TOMS

Search for:
It is currently Fri Nov 24, 2017 1:37 am




Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Author Message
 Post subject: Input NetCDF files
PostPosted: Thu Apr 29, 2004 5:41 am 
Offline
Site Admin
User avatar

Joined: Wed Feb 26, 2003 4:41 pm
Posts: 1014
Location: IMCS, Rutgers University
Recently, I had several inquires about ROMS input NetCDF files. There is a lot of software (old and new) to generate such input files. It is very difficult to write generic programs because it depends on the application. However, there is a very easy way to generate these files using CDL scripts and the NetCDF ncgen program.

The ROMS metadata design is very rich and extensive. See varinfo.dat for a list of all the variables names, units, attributes, associated time variables, and scale factors. This is an user friendly file and variable parameters can be changed very easily. As a matter of fact, some users like to change the long-name attribute to a language other than English to facilitate automatic labeling during plotting. However, for portability I recommend to use the provided field variable name.

Use the following link to download a tar file containing several CDL scripts to construct ROMS input NetCDF files:

http://www.myroms.org/links/roms_cdl.tar.gz

Currently, you can find the following CDL scripts:

Code:
    grd_spherical.cdl        Spherical grid NetCDF file

    ini_hydro.cdl            Initial conditions NetCDF file (hydrodynamics)
    ini_fasham.cdl           Initial conditions NetCDF file (hydrodynamics and biology)
    ini_ecosim.cdl           Initial conditions NetCDF file (hydrodynamics and bio-optics)
    ini_sed.cdl              Initial conditions NetCDF file (hydrodynamics and sediment)

    clm_ts.cdl               Temperature-Salinity climatology NetCDF file

    frc_uvstress.cdl         Forcing NetCDF file (surface momentum stresses)
    frc_fluxclm.cdl          Forcing NetCDF file (climatological heat fluxes variables)
    frc_bulk.cdl             Forcing NetCDF file (atmospheric variable for bulk fluxes)

    frc_rivers.cdl           Forcing NetCDF file (River point/sources)
    frc_tides.cdl            Forcing NetCDF file (tidal elevation and currents)


    bry_limit.cdl            Boundary NetCDF file (various time dimensions)
    bry_unlimit.cdl          Boundary NetCDF file (unlimited time dimensions)


You can easily edit any of these scripts to change NetCDF file name, change dimensions, add and remove variables, and add and modify global attributes. A NetCDF file can be created from a CDL script by typing:

ncgen -b my_file.cdl

On the other hand, a CDL script can be created from a NetCDF file by just typing:

ncdump -h my_file.nc > my_file.cdl

Then, you can use any program to write your data into the created NetCDF file. I usually use the MeXCDF interface of Matlab to write the processed data with just a single command line.

Notice that ROMS now allows for multiple forcing NetCDF files. See ROMS input script.

Good luck, :P


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group