missing temp_time

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
turuncu
Posts: 128
Joined: Tue Feb 01, 2005 8:21 pm
Location: Istanbul Technical University (ITU)
Contact:

missing temp_time

#1 Unread post by turuncu »

Hi,

I am trying to run the latest version of the model (revision 923) but i am getting following error

NETCDF_GET_TIME_1D - error while inquiring ID for variable: temp_time
in input file: input/clim/AEGE16_clim_20040701_20040801_MEDINGV_fixed.nc
call from: ROMS/Utility/get_cycle.F
Found Error: 02 Line: 176 Source: ROMS/Utility/get_cycle.F
Found Error: 02 Line: 319 Source: ROMS/Utility/inquiry.F
Found Error: 02 Line: 128 Source: ROMS/Utility/get_3dfld.F
Found Error: 02 Line: 1067 Source: ROMS/Nonlinear/get_data.F
Found Error: 02 Line: 772 Source: ROMS/Nonlinear/initial.F
Found Error: 02 Line: 188 Source: ROMS/Drivers/nl_ocean.h

In this case, i replaced all temp_time as ocean_time in varinfo.dat (i copied it to my run directory and change option VARNAME as ./varinfo.dat in my configuration file) but it does not help. I am generally creating only single time axis (ocean_time) in my input files for simplification. The same setup was working in old version of the model (revision 737). I think that there is a bug in somewhere in the code but i could not find fixed temp_time in the code. There could be an error due to the size mismatch between some internal array that stores the axis name but i am not sure. Please let me know if you have any suggestion.

Regards,

--ufuk

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: missing temp_time

#2 Unread post by arango »

You don't need to do that. One of the great things about NetCDF is that it is self-described. I have mentioned in the past that we need to follow CF convections to guarantee the functionality of metadata and avoid missinterpretation issues in ROMS. I highly recommend users to add the units, time, and coordinates attribute for each NetCDF variable processed by ROMS.

For example, in a 2D variable we need:

Code: Select all

       double my_time(my_time_dim) ;
              my_time:long_name = "my time coordinate";
              my_time:units = "my-time-units since YYYY-MM-DD hh:mm:ss" ;

       double my_lon(my_lat_dim, my_lon_dim) ;
              my_lon:long_name = "my longitude coordinate" ;
              my_lon:units = "degree_east" ;
              my_lon:standard_name = "longitude" ;

       double my_lat(my_lat_dim, my_lon_dim) ;
              my_lat:long_name = "my latitude coordinate" ;
              my_lat:units = "degree_north ;
              my_lat:standard_name = "latitude" ;

       double my_var(my_time_dim, my_lat_dim, my_lon_dim) ;
               my_var:long_name = "my variable long name" ;
               my_var:units = "my variable units" ;
               my_var:coordinates = "my_lon my_lat my_time" ;
               my_var:time = "my_time" ;
In this case, ROMS will first inquire for the associated time variable specified in the time attribute if present. If not, it will check the if the coordinates attribute is available and decode from it. Otherwise, it will use the value specified in varinfo.dat. The associated longitude and latitude coordinates are processed in similar faction when ROMS performs spatial interpolation of forcing fields from different resolutions than the ROMS application grid.

If such attributes are not present, use the matlab/netcdf/nc_attadd.m from the svn repository to add/modify a NetCDF global or variable attribute:

Code: Select all

nc_attadd('my_ncfile.nc', 'time', 'my_time', 'my_var')
nc_attadd('my_ncfile.nc', 'coordinates', 'my_lon, my_lat, my_time', 'my_var')
It is that simple :!: There is not need to recreate or reprocess the NetCDF files. We can have as many attributes that we want for a variable. I use this function very often enhance the metadata of input NetCDF files.

One thing that we need to be aware of when creating/editing NetCDF file is to avoid using any ASCII control characters, CHAR(0) to CHAR(31):

Code: Select all

  Char  Dec  Key  Control Action
  ----------------------------------------------------------------------
  NUL   0    ^@   Null character
  SOH   1    ^A   Start of heading, = console interrupt
  STX   2    ^B   Start of text, maintenance mode on HP console
  ETX   3    ^C   End of text
  EOT   4    ^D   End of transmission, not the same as ETB
  ENQ   5    ^E   Enquiry, goes with ACK; old HP flow control
  ACK   6    ^F   Acknowledge, clears ENQ logon hand
  BEL   7    ^G   Bell, rings the bell...
  BS    8    ^H   Backspace, works on HP terminals/computers
  HT    9    ^I   Horizontal tab, move to next tab stop
  LF    10   ^J   Line Feed
  VT    11   ^K   Vertical tab
  FF    12   ^L   Form Feed, page eject
  CR    13   ^M   Carriage Return
  SO    14   ^N   Shift Out, alternate character set
  SI    15   ^O   Shift In, resume default character set
  DLE   16   ^P   Data link escape
  DC1   17   ^Q   XON, with XOFF to pause listings; ":okay to send".
  DC2   18   ^R   Device control 2, block-mode flow control
  DC3   19   ^S   XOFF, with XON is TERM=18 flow control
  DC4   20   ^T   Device control 4
  NAK   21   ^U   Negative acknowledge
  SYN   22   ^V   Synchronous idle
  ETB   23   ^W   End transmission block, not the same as EOT
  CAN   24   ^X   Cancel line, MPE echoes !!!
  EM    25   ^Y   End of medium, Control-Y interrupt
  SUB   26   ^Z   Substitute
  ESC   27   ^[   Escape, next character is not echoed
  FS    28   ^\   File separator
  GS    29   ^]   Group separator
  RS    30   ^^   Record separator, block-mode terminator
  US    31   ^_   Unit separator
These characters are not visible, so be careful when using scripts and editors. We don't want the NetCDF variables and attributes to have any of these nonvisible characters.

Notice that ROMS now allow the data to be in a different reference time coordinate. This capability was added to the netcdf_get_time routine. For example, the input data can have "days since 1900-01-01 00:00:00" and ROMS time can be "seconds since 2000-01-01 00:00:00". The only contraint is that data is available for the simulation time window.

turuncu
Posts: 128
Joined: Tue Feb 01, 2005 8:21 pm
Location: Istanbul Technical University (ITU)
Contact:

Re: missing temp_time

#3 Unread post by turuncu »

Thanks Hernan. Actually, i am using pyroms mostly to generate input files and i think that the python scripts i used are little bit old and did not add those specific attributes to the variables. Just for others, following shell scrip fix the netcdf files and also the problem.

Code: Select all

#!/bin/bash

lst=`ncdump -c $1 | grep "ocean_time" | awk '{print $2}' | awk -F\( '{print $1}' | grep -v "=" | grep -v "ocean_time"`
for i in $lst
do
  echo $i
  ncatted -O -a time,$i,a,c,"ocean_time" $1
done
BTW, you need to give file name when you run the script.

Post Reply