ocean_time in AVG files

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
rtoste
Posts: 11
Joined: Wed Sep 26, 2012 4:20 pm
Location: UFRJ

ocean_time in AVG files

#1 Unread post by rtoste »

Hi
I'm trying to use AVERAGES and AVERAGES_DETIDE (svn 1005) but I found a problem in my output avg file.
The model runs fine and the history and average files are written correctly, except for the ocean_time vector on the avg files.
I'm using:

NTIMES == 105120
DT == 300.0d0

NRREC == 0

LDEFOUT == T
NHIS == 12
NDEFHIS == 8640

NTSAVG == 2880
NAVG == 12
NDEFAVG == 8640

In the first avg file (avg1), the ocean_time is correct. The first 10 days (NTSAVG = 2880) have the same ocean_time and the following indexes increase at each NAVG interval.
But from the first to the second file (avg2), there is a time gap. At avg2, the count starts 10 days after the last ocean_time written in avg1.
It only happens in the second avg file. From the avg3 on, the time increases correctly, and, because of that, my last index in the last avg file (avg13) has an ocean_time value increased in 10 days also.

ocean_time in output avg files:
avg1: ocean_time(720 currently) = 663550200, 663550200, 663550200,... ,665281800 ;
avg2: ocean_time(720 currently) = 666145800, 666149400, 666153000,... ,668734200 ;
avg3: ocean_time(720 currently) = 668737800, 668741400, 668745000,... ,671326200 ;
...
avg13:ocean_time(120 currently) = 694657800, 694661400, 694665000,...,695086200 ;

I think it might be a bug but I'm not sure. Maybe I'm doing something wrong.
Any ideas?

Cheers,
Raquel

User avatar
wilkin
Posts: 918
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: ocean_time in AVG files

#2 Unread post by wilkin »

Code: Select all

! NTSAVG       Starting timestep for the accumulation of output time-averaged
!                data.
You asked ROMS to wait 2880 time steps before beginning the average accumulation, yet you want to output averages every 12 times steps (you have NAVG = 12).

I'm not sure what ROMS does in this situation - it's an unusual approach.

Look closely at your logfile and see where it first calls DEF_AVG and when it writes average records WRT_AVG to check it is behaving, noting that when WRT_AVG is called that is not the time in the average file, because the time is centered on the average interval.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

rtoste
Posts: 11
Joined: Wed Sep 26, 2012 4:20 pm
Location: UFRJ

Re: ocean_time in AVG files

#3 Unread post by rtoste »

Thank you for your answer.

I looked at the logfile and DEF_AVG is called before time step 12 and the average is written just after that (with empty values because NTSAVG is 2880):

Code: Select all

 TIME-STEP YYYY-MM-DD hh:mm:ss.ss  KINETIC_ENRG   POTEN_ENRG    TOTAL_ENRG    NET_VOLUME
                     C => (i,j,k)       Cu            Cv            Cw         Max Speed

         0 2018-01-01 00:00:00.00  2.482270E-03  2.212524E+04  2.212524E+04  1.188229E+16
                     (150,165,09)  1.997233E-02  1.806947E-02  0.000000E+00  8.330668E-01
      DEF_HIS     - creating  history      file, Grid 01: libra_112_his_0001.nc
      WRT_HIS     - wrote history     fields (Index=1,1) in record = 0000001
      DEF_AVG     - creating  average      file, Grid 01: libra_112_avg_0001.nc
        12 2018-01-01 01:00:00.00  2.527031E-03  2.212407E+04  2.212407E+04  1.188169E+16
                     (141,169,40)  3.090817E-02  1.475768E-02  2.485467E+00  1.048596E+00
      WRT_HIS     - wrote history     fields (Index=1,1) in record = 0000002
      WRT_AVG     - wrote averaged    fields             in record = 0000001
      WRT_TIDES   - wrote time-accumulated tide harmonics, Grid 01
        24 2018-01-01 02:00:00.00  2.669912E-03  2.212434E+04  2.212434E+04  1.188174E+16
                     (142,143,40)  2.440835E-02  1.498531E-02  1.628837E+00  9.794401E-01
      WRT_HIS     - wrote history     fields (Index=1,1) in record = 0000003
      WRT_AVG     - wrote averaged    fields             in record = 0000002
      WRT_TIDES   - wrote time-accumulated tide harmonics, Grid 01

When the second avg file is created, it is called between 31-Jan-2018 01:00 and 02:00 but the time written is 10-Feb-2018.

Code: Select all

      8652 2018-01-31 01:00:00.00  1.859013E-03  2.212289E+04  2.212289E+04  1.188065E+16
                     (150,137,23)  1.411136E-04  5.194617E-03  1.331132E-01  8.199735E-01
      DEF_HIS     - creating  history      file, Grid 01: libra_112_his_0002.nc
      WRT_HIS     - wrote history     fields (Index=1,1) in record = 0000001
      DEF_AVG     - creating  average      file, Grid 01: libra_112_avg_0002.nc
      WRT_AVG     - wrote averaged    fields             in record = 0000001
      WRT_TIDES   - wrote time-accumulated tide harmonics, Grid 01
      8664 2018-01-31 02:00:00.00  1.978918E-03  2.212354E+04  2.212354E+04  1.188122E+16
                     (146,124,23)  8.356436E-04  3.050888E-03  1.502170E-01  8.900921E-01
      WRT_HIS     - wrote history     fields (Index=1,1) in record = 0000002
      WRT_AVG     - wrote averaged    fields             in record = 0000002
      WRT_TIDES   - wrote time-accumulated tide harmonics, Grid 01
      


I am using NAVG = 12 at this moment just to compare with instantaneous results in the history file. I'm skipping the first days because I want to exclude them from the tidal analysis.
I also tested with NTSAVG = 1440 (5 days) and the same occurred but with a lag of 5 days between avg1 and avg2.
I see that ocean_time in the average file is different from the one written in the history, but the problem I noticed only appears when the second average file is written.
Here is the time series of zeta extracted from all 13 average and history files, where it can be seen that the error in ocean_time only occurs from the first to the second file.
zeta_avg_his_total.png
Zooming in the beginning of the time series:
zeta_avg_his_zoom.png

User avatar
wilkin
Posts: 918
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: ocean_time in AVG files

#4 Unread post by wilkin »

But it looks like the times in the latter averages files are wrong.

Reassure me it all works if you make NTSAVG = 1, and just discard the first average file is you are worried about it.

In principle, the accumulation of the tidal harmonic fit continues for the duration of the run (that was the plan when we designed this), so the initial transients - not that it looks like you have any - should get overwhelmed by the later data.

I'm not sure that NTSAVG > 1 delays the tide harmonic calculation.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

rtoste
Posts: 11
Joined: Wed Sep 26, 2012 4:20 pm
Location: UFRJ

Re: ocean_time in AVG files

#5 Unread post by rtoste »

Using NTSAVG = 1 the times are correct for all files.

There are some slight differences using NTSAVG = 1 and NTSAVG > 1 in the harmonics file, but as they are not significant I will use it as is.

Thanks for the help, Wilkin

Post Reply