error while writing variable: ocean_time into his.nc

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
bingguner
Posts: 1
Joined: Thu Apr 14, 2011 5:56 pm
Location: OUC

error while writing variable: ocean_time into his.nc

#1 Unread post by bingguner »

hello, I encountered an error when trying to run ROMS.
WRT_HIS - error while writing variable: ocean_time
into history NetCDF file for time record: 1

ROMS/TOMS - Output error ............ exit_flag: 3
ERROR: Abnormal termination: NetCDF OUTPUT.
REASON: NetCDF: Not a valid ID
I set the ocean_time value in roms_init.nc input file generated by CDL file as posted below,
time = UNLIMITED ; // (0 currently)
double ocean_time(time) ;
ocean_time:long_name = "time since initialization" ;
ocean_time:units = "seconds since 0000-01-01 00:00:00" ;
ocean_time:calendar = "360.0 days in every year" ;
ocean_time:field = "time, scalar, series" ;
and set ocean_time=1296000, to be 15d 00:00:00, the same time as my initial input conditions. Actually, I firstly set ocean_time=0, then the fowllowing error occured.
GET_CYCLE - starting time for variable: sms_time
is greater than current model time.
TMIN = 15.0000 TDAYS = 0.0000
So I changed the value to 1296000, but bumpped into the current error. Does it because I set a wrong ocean_time value? Or what should I do to make ROMS run?

Thank you very much for your time in advance. Really looking forward to your suggestions.

Johannes
Posts: 7
Joined: Mon Mar 01, 2010 2:11 pm
Location: Norwegian Meteorological Institute
Contact:

Re: error while writing variable: ocean_time into his.nc

#2 Unread post by Johannes »

I guess this is the same problem as I got:
viewtopic.php?f=19&t=2254

in my case id didn't occur because something was wrong with the variable ocean time, but something is wrong with the output file (it is not created, the netcdf output does therefore has a invalid ID). The error occurs while writing ocean_time because it is the first variable written out.

However, the problem remains to be solved. Which ROMS version/revision do you use? I got the error with ROMS 3.4 but not with 3.2. The problem can be bypassed by writing into only on output file (NDEFHS = 0)

tony1230
Posts: 87
Joined: Wed Mar 31, 2010 3:29 pm
Location: SKLEC,ECNU,Shanghai,China

Re: error while writing variable: ocean_time into his.nc

#3 Unread post by tony1230 »

hi
do you wanna run a new simulation from the previous one? and start from 00:00:00 on the 16th day?
i think so from your "15*24*3600=1296000".if so ,you must set the ocean_time from zero.

kjerstild
Posts: 1
Joined: Thu Apr 16, 2009 1:21 am
Location: Norwegian institute for Water research, NIVA

Re: error while writing variable: ocean_time into his.nc

#4 Unread post by kjerstild »

Hi,

I am having the same problem as Johannes regarding creation of the his-file. I am currently using ROMS 3.3 after having other problems trying to use roms 3.5 instead.

Has anyone found a solution to why the history-file is not created when HDEFHIS is not set to zero?

salme.cook
Posts: 1
Joined: Wed Dec 11, 2013 1:51 pm
Location: USGS

Re: error while writing variable: ocean_time into his.nc

#5 Unread post by salme.cook »

I know this post is somewhat old - but found it useful when pursuing my own troubleshooting.

I tried to restart a ROMS+SWAN run and had the same error:

WRT_HIS - error while writing variable: ocean_time
into history NetCDF file for time record: 1

ROMS/TOMS - Output error ............ exit_flag: 3
ERROR: Abnormal termination: NetCDF OUTPUT.
REASON: NetCDF: Not a valid ID

What happened between my original and restart runs was a change in DT from 8s to 2s. I changed the corresponding NRST, NHIS, etc. in by new ocea_restart.in file, but made the mistake of changing the NDEFHIS to the wrong #. Originally, NDEFHIS = 334800; and I changed it to something like NDEFHIS (new) = 1290000. I received the error and tried all kinds of things to solve it.

The problem was that the new NDEFHIS needs to be exactly 334800 * 8/2 or 4x as many time steps as the original. I'm not sure what fat fingers led to the error in my new NDEFHIS, but here we are. The new run worked with NDEFHIS=1296000.

Post Reply