Double time in avg file

Discussion about modeling ice with ROMS

Moderators: arango, robertson

Post Reply
Message
Author
Pysh
Posts: 30
Joined: Tue Nov 29, 2011 3:51 pm
Location: Hydrometcenter of Russia

Double time in avg file

#1 Unread post by Pysh »

Hi

Strange result for ocean_time variable in avg file. My parameters for output files:

Code: Select all

       1440  ntimes          Number of timesteps for 3-D equations.
     60.000  dt              Timestep size (s) for 3-D equations.
         60  ndtfast         Number of timesteps for 2-D equations between
                               each 3D timestep.
          1  ERstr           Starting ensemble/perturbation run number.
          1  ERend           Ending ensemble/perturbation run number.
         -1  nrrec           Number of restart records to read from disk.
          T  LcycleRST       Switch to recycle time-records in restart file.
        720  nRST            Number of timesteps between the writing of data
                               into restart fields.
          1  ninfo           Number of timesteps between print of information
                               to standard output.
          T  ldefout         Switch to create a new output NetCDF file(s).
        120  nHIS            Number of timesteps between the writing fields
                               into history file.
          0  ntsAVG          Starting timestep for the accumulation of output
                               time-averaged data.
         60  nAVG            Number of timesteps between the writing of
That is experiment for one day with 1 min baroclinic time step with 1 hour time-window for avg file and 2 hours time step for his file. In diagnostic output (below) all is ok.

Code: Select all

     0 55743 00:00:00  1.536418E-03  2.813502E+03  2.813503E+03  7.912394E+13
         (165,320,20)  1.305355E-02  9.021873E-03  0.000000E+00  5.440225E-01
      DEF_HIS   - creating history file: data/out/2011/m07/01/casp_his_20110701.nc
      WRT_HIS   - wrote history  fields (Index=1,1) into time record = 0000001
      DEF_AVG   - creating average file: data/out/2011/m07/01/casp_avg_20110701.nc
      DEF_DIAGS - creating diagnostics file: data/out/2011/m07/01/casp_dia_20110701.nc
     1 55743 00:01:00  1.539989E-03  2.819604E+03  2.819605E+03  7.895267E+13
………………………………………………………………………………………………..
    60 55743 01:00:00  1.559580E-03  2.819596E+03  2.819597E+03  7.895267E+13
         (028,125,20)  0.000000E+00  0.000000E+00  1.299111E+00  5.628528E-01
      WRT_AVG   - wrote averaged fields into time record =             0000001
    61 55743 01:01:00  1.559583E-03  2.819596E+03  2.819597E+03  7.895267E+13
………………………………………………………………………………………………..
   120 55743 02:00:00  1.562745E-03  2.819585E+03  2.819587E+03  7.895268E+13
         (028,125,20)  0.000000E+00  0.000000E+00  1.297757E+00  6.247683E-01
      WRT_HIS   - wrote history  fields (Index=1,1) into time record = 0000002
      WRT_AVG   - wrote averaged fields into time record =             0000002
   121 55743 02:01:00  1.562846E-03  2.819585E+03  2.819587E+03  7.895268E+13
         (028,125,20)  0.000000E+00  0.000000E+00  1.297735E+00  6.255495E-01
   122 55743 02:02:00  1.562947E-03  2.819585E+03  2.819586E+03  7.895268E+13
But, after ncdump ocean_time variable of output avg file there is problem in its values. It is double as normal.
ncdump –v ocean_time casp_avg_20110701 > ocean_time_avg.txt

netcdf casp_avg_20110701 {
dimensions:
xi_rho = 200 ;
xi_u = 199 ;
xi_v = 200 ;
xi_psi = 199 ;
eta_rho = 500 ;
eta_u = 500 ;
eta_v = 499 ;
eta_psi = 499 ;
s_rho = 20 ;
s_w = 21 ;
tracer = 2 ;
boundary = 4 ;
ocean_time = UNLIMITED ; // (24 currently)
…………………………………………………………………………………………..
double ocean_time(ocean_time) ;
ocean_time:long_name = "averaged time since initialization" ;
ocean_time:units = "seconds since 1968-05-23 00:00:00 GMT" ;
ocean_time:calendar = "gregorian" ;
ocean_time:field = "time, scalar, series" ;
…………………………………………………………………………………………….

data:

ocean_time = 4816200600, 4816207800, 4816215000, 4816222200, 4816229400,
4816236600, 4816243800, 4816251000, 4816258200, 4816265400, 4816272600,
4816279800, 4816287000, 4816294200, 4816301400, 4816308600, 4816315800,
4816323000, 4816330200, 4816337400, 4816344600, 4816351800, 4816359000,
4816366200 ;
Problem :
ocean_time (n+1) - ocean_time (n) = 7200 (2 hours). Must be 3600 (1 hour)

For history file there isn't this problem
ncdump –v ocean_time casp_his_20110701 > ocean_time_his.txt

netcdf casp_his_20110701 {
dimensions:
xi_rho = 200 ;
xi_u = 199 ;
xi_v = 200 ;
xi_psi = 199 ;
eta_rho = 500 ;
eta_u = 500 ;
eta_v = 499 ;
eta_psi = 499 ;
N = 20 ;
s_rho = 20 ;
s_w = 21 ;
tracer = 2 ;
boundary = 4 ;
ocean_time = UNLIMITED ; // (13 currently)
………………………………………………………………………………………………….
double ocean_time(ocean_time) ;
ocean_time:long_name = "time since initialization" ;
ocean_time:units = "seconds since 1968-05-23 00:00:00 GMT" ;
ocean_time:calendar = "gregorian" ;
ocean_time:field = "time, scalar, series" ;
…………………………………………………………………………………………………
data:

ocean_time = 4816195200, 4816202400, 4816209600, 4816216800, 4816224000,
4816231200, 4816238400, 4816245600, 4816252800, 4816260000, 4816267200,
4816274400, 4816281600 ;
ocean_time (n+1) - ocean_time (n) = 7200 (2 hours). That is ok.


May be it is due to new file set_avg.F recently modified. I can't catch this bug (if it is bug).

If it is not only my problem, can anybody help me with it?

Thanks.

rduran
Posts: 152
Joined: Fri Jan 08, 2010 7:22 pm
Location: Theiss Research

Re: Double time in avg file

#2 Unread post by rduran »

120 nHIS Number of timesteps between the writing fields
into history file.
0 ntsAVG Starting timestep for the accumulation of output
time-averaged data.
60 nAVG Number of timesteps between the writing of
Well, the diagnostic terms involve a time-integral like the averages files. I usually recommend to have NAVG=NDIA to facilitate computing budgets and fluxes. The history fields are instantaneous Therefore, the time assigned to the time-averaged fields is always at the middle of the time-averaged window. Instantaneous diagnostic terms do not really make much sense. I don't see why you need history fields at the same time as the time-averaged fields. You could have NHIS=NDIA/2, then the time records will be at the same time. Notice that NDIA has to be an even number, so the division by two is exact and an integer number.
viewtopic.php?f=23&t=2376&p=8784&hilit= ... +his#p8784

Pysh
Posts: 30
Joined: Tue Nov 29, 2011 3:51 pm
Location: Hydrometcenter of Russia

Re: Double time in avg file

#3 Unread post by Pysh »

Thank you for reply, duran.

I'v looked messages you recommended, but I believe the problem has remained. My values of NAVG, NHIS, NDIA are not optimal (as is not optimal to run the model step by step with one day period with restarts). It is caused by local circumstances and debugging version of a program. Now I try to output calculated averaged fields with 1 hours step, instantaneous values at approximately middle of each second averaged step for some fields (I have already some problems with those fields) and yet I do not wish to output the integrated fluxes before occurrence of obvious problems because of large sizes of dia files. If necessary I can repeat calculation with a output of dia file owing to frequent writing of restart (with including errors into calculations each day restarting :D )

But, as I believe in this case the values of ocean_time variable in seconds in avg files (my variant) should increase for size 3600 seconds, not for 7200. And I can't understand where is my mistake in the time parameters determinations

Thanks

rduran
Posts: 152
Joined: Fri Jan 08, 2010 7:22 pm
Location: Theiss Research

Re: Double time in avg file

#4 Unread post by rduran »

Did you try navg = 120 and nhis = 120?

Pysh
Posts: 30
Joined: Tue Nov 29, 2011 3:51 pm
Location: Hydrometcenter of Russia

Re: Double time in avg file

#5 Unread post by Pysh »

Not with NAVG = 120, NHIS = 120, but with NAVG = 180, NHIS = 180.

Before substituting of new vertion of set_avg.F
netcdf casp_avg_20111125 {
dimensions:
xi_rho = 200 ;
xi_u = 199 ;
xi_v = 200 ;
xi_psi = 199 ;
eta_rho = 500 ;
eta_u = 500 ;
eta_v = 499 ;
eta_psi = 499 ;
s_rho = 20 ;
s_w = 21 ;
tracer = 2 ;
boundary = 4 ;
ocean_time = UNLIMITED ; // (8 currently)
...............................................................................................
double ocean_time(ocean_time) ;
ocean_time:long_name = "averaged time since initialization" ;
ocean_time:units = "seconds since 1968-05-23 00:00:00 GMT" ;
ocean_time:calendar = "gregorian" ;
ocean_time:field = "time, scalar, series" ;
................................................................................................
data:

ocean_time = 4828901400, 4828912200, 4828923000, 4828933800, 4828944600,
4828955400, 4828966200, 4828977000 ;
It's normal: ocean_time(n+1) - ocean_time(n) = 10800 sec (3 hour)

After substitution of new version of set_avg.F
netcdf casp_avg_20120531 {
dimensions:
xi_rho = 200 ;
xi_u = 199 ;
xi_v = 200 ;
xi_psi = 199 ;
eta_rho = 500 ;
eta_u = 500 ;
eta_v = 499 ;
eta_psi = 499 ;
s_rho = 20 ;
s_w = 21 ;
tracer = 2 ;
boundary = 4 ;
ocean_time = UNLIMITED ; // (8 currently)
.............................................................................................
double ocean_time(ocean_time) ;
ocean_time:long_name = "averaged time since initialization" ;
ocean_time:units = "seconds since 1968-05-23 00:00:00 GMT" ;
ocean_time:calendar = "gregorian" ;
ocean_time:field = "time, scalar, series" ;
..............................................................................................
data:

ocean_time = 4845155400, 4845177000, 4845198600, 4845220200, 4845241800,
4845263400, 4845285000, 4845306600 ;
That is: ocean_time(n+1) - ocean_time(n) = 21600 sec (6 hour) - double of correct value

Thanks

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Double time in avg file

#6 Unread post by kate »

Oops, try again. It looks like fixing the ifdefs on that file exposed some other problems.

Pysh
Posts: 30
Joined: Tue Nov 29, 2011 3:51 pm
Location: Hydrometcenter of Russia

Re: Double time in avg file

#7 Unread post by Pysh »

Thank you, Kate

Bug in time variable in avg-files is now absent.

Coding of a part of the nature will soon demand all natural resources :)

Good luck

Post Reply