Notice that you can easily edit any of these files and customize them for your application. You can change the file name, dimensions, variables, and attributes. A NetCDF file can be created by just typing:
Code: Select all
ncgen -b my_file.cdl
Code: Select all
'zeta_west' ! Input
'free-surface western boundary condition'
'meter' ! [m]
'zeta_west, scalar, series'
'zeta_time'
'idZbry(iwest)'
'nulvar'
1.0d0
Code: Select all
dimensions:
xi_rho = 66 ;
eta_rho = 194;
zeta_time = 22 ;
...
variables:
double zeta_time(zeta_time) ;
zeta_time:long_name = "free-surface time" ;
zeta_time:units = "days since 2008-01-01 00:00:00" ;
float zeta_east(zeta_time, eta_rho) ;
zeta_east:long_name = "free-surface eastern boundary condition" ;
zeta_east:units = "meter" ;
zeta_east:time = "zeta_time" ;
...
Alternatively, you may have:
Code: Select all
dimensions:
xi_rho = 66 ;
eta_rho = 194;
bry_time = UNLIMITED ; // (22 currently)
...
variables:
double bry_time(bry_time) ;
bry_time:long_name = "open boundary conditions time" ;
bry_time:units = "days since 2008-01-01 00:00:00" ;
float zeta_east(zeta_time, eta_rho) ;
zeta_east:long_name = "free-surface eastern boundary condition" ;
zeta_east:units = "meter" ;
zeta_east:time = "bry_time" ;
...
How ROMS process this information?
If you check any of the ROMS/Utilility/get_*fld*.F routines, you will see the following sequence of checks on any input NetCDF file:
- Inquire about variable associated time dimension by matching the string value of the time attribute that is specified in varinfo.dat. In the above example, it will look for zeta_time.
- If the time dimension and associated time variable are different from the string value specified in varinfo.dat, it resets its name to the one specified in the time attribute of the input NetCDF file.
- If unsuccessful, the input NetCDF file is not CF compliant In this case, ROMS will check if any of dimensions of the variable contain the sub-string time:
Code: Select all
DO i=1,n_vdim IF (INDEX(TRIM(var_Dname(i)),'time').ne.0) THEN Nrec=var_Dsize(i) END IF END DO
- If still unsuccessful, ROMS will issue an error and stop. This indicates that you are clueless about ROMS metadata design and need to check all the available information in this forum and the wiki before building your input NetCDF files.
Code: Select all
IF (got_time.and.(Nrec.eq.0)) THEN IF (Master) WRITE (stdout,10) TRIM(Tname(ifield)), & & TRIM(Vname(1,ifield)), & & TRIM(fname(ifile)) exit_flag=4 RETURN END IF
- Notice that to be CF compliant, the coordinate time variable and its associated time dimension need to have the same name.