NTSAVG and NTSDIAG

Discussion of how to use ROMS on different regional and basin scale applications.

Moderators: arango, robertson

Post Reply
Message
Author
ocecept
Posts: 42
Joined: Tue Jan 08, 2008 3:57 pm
Location: Universidade Federal do Ceará
Contact:

NTSAVG and NTSDIAG

#1 Unread post by ocecept »

Dear All:

I set NTSAVG in order to accumulate the output time-averaged and diagnostics data after two years. However, whatever number of NTSAVG is used, the output of average data is always recorded since the first time step every NAVG and filled with zeros.
Then, after NTSAVG (two years in my case) the model starts outputing the "real" average data.

I did some tests and the same occurs in the UPWELLING case.

My question is: That's what I would expect using NTSAVG or the model should be writting the AVERAGE data only after NTSAVG?

The output from diagnostic data (NTSDIA) has the same problem.

That's part of my model setup

Physical Parameters, Grid: 01
=============================

1556280 ntimes Number of timesteps for 3-D equations.
80.000 dt Timestep size (s) for 3-D equations.
30 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.
0 nrrec Number of restart records to read from disk.
F LcycleRST Switch to recycle time-records in restart file.
32400 nRST Number of timesteps between the writing of data
into restart fields.
10800 ninfo Number of timesteps between print of information
to standard output.
45 nSTA Number of timesteps between the writing of data
the stations file.
45 nFLT Number of timesteps between the writing of data
into floats file.
T ldefout Switch to create a new output NetCDF file(s).
10800 nHIS Number of timesteps between the writing fields
into history file.
388800 ndefHIS Number of timesteps between creation of new
history files.
1166400 ntsAVG Starting timestep for the accumulation of output
time-averaged data.
45 nAVG Number of timesteps between the writing of
time-averaged data into averages file.
32400 ndefAVG Number of timesteps between creation of new
time-averaged file.
1166400 ntsDIA Starting timestep for the accumulation of output
time-averaged diagnostics data.
45 nDIA Number of timesteps between the writing of
time-averaged data into diagnostics file.
32400 ndefDIA Number of timesteps between creation of new
diagnostic file.


Thanks a lot.

Carlos Teixeira

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

Re: NTSAVG and NTSDIAG

#2 Unread post by wilkin »

Carlos,

I see your point. Quickly viewing the logic in Nonlinear/output.F, which is the subroutine that calls def_avg to create the averages file, we don't check if time is prior to NTSAVG - so the file is created at initialization no matter what.

The #ifdef AVERAGES block in output.F could be modified to hold off until iic(ng).ge.NTSAVG but I can foresee that we would need to code this carefully to catch instances like when NTSAVG is not a multiple of NAVG, etc., since this is going to create havoc with the multiple file numbering logic. And we need this all to work in reverse for HIS output for the AD and TL codes.

But thanks for bringing it to our attention.

John.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

ocecept
Posts: 42
Joined: Tue Jan 08, 2008 3:57 pm
Location: Universidade Federal do Ceará
Contact:

Re: NTSAVG and NTSDIAG

#3 Unread post by ocecept »

Hi John, thanks for your replay.

I looked into output.F when I got the zeros in my output and realize that the code didn´t check for NTSAVG, but I didn´t know if it was done in elsewhere. Thanks for explaining.
Anyway, since I want the averages results after two years of simulation I think it´s better to run the model for two years whith AVERAGES turned off and then Re-start the model from the last time step with AVERAGES on running the model for two more years.

I thinks that is going to do the job.

Cheers;

Carlos

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

Re: NTSAVG and NTSDIAG

#4 Unread post by arango »

I will check when I get the chance the logic for NTSAVG and NTSDIA to see if I can reproduce this behavior.

I have done this before during spin-up simulations. For example, you can run ROMS for two years without activating AVERAGES or DIAGNOSTICS_*. Make sure that you are saving the restart file at the appropriate time (say, end of year 2). You can even use perfect restart, if so desired. Then, you recompiled the code with AVERAGES and DIAGNOSTICS_* activated and start from the restart file. The restart file becomes your initial conditions. It is that simple. In cases like this I always use NAVG=NDIA and NDEFAVG=NDEFDIA.

Post Reply