Is OUT_DOUBLE strictly necessary when using PERFECT_RESTART?

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

Moderators: arango, robertson

Post Reply
Message
Author
AlexisEspinosa
Posts: 23
Joined: Fri May 24, 2013 3:05 am
Location: UWA

Is OUT_DOUBLE strictly necessary when using PERFECT_RESTART?

#1 Unread post by AlexisEspinosa »

I definetively want to use PERFECT_RESTART for the continuation of my simulations, but I also would like to save some space from the history files.

What I understand from the PERFECT_RESTART concept is that ROMS saves all the necessary information into the restart file. And I guess that this information is saved with the computer accuracy (double precision anyway) no matter if OUT_DOUBLE is defined or not.

But I have seen that it is a very common practice to set-on this two options at the same time, as if PERFECT_RESTART needs OUT_DOUBLE for working properly. Is this true? Do we need this two options to set-on together?

The problem with this is that the history files with double precision are double-sized or more. My original understanding was that if I don't define OUT_DOUBLE this would not really affect the information contained in the restart file. Which is the real way ROMS behaves?

My prefered option here would be to use only PERFECT_RESTART without OUT_DOUBLE, so that my history files stay small-sized, while still have the information needed for perfect-restarting in the restart file. But not sure if this will work properly. Can someone in the forum clarify this?

Thank you very much

Alexis Espinosa
UWA

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

Re: Is OUT_DOUBLE strictly necessary when using PERFECT_REST

#2 Unread post by kate »

You don't need OUT_DOUBLE. Here's one example of mine:

Code: Select all

#define PERFECT_RESTART
#undef OUT_DOUBLE
#ifndef PERFECT_RESTART
# define RST_SINGLE
#endif

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

Re: Is OUT_DOUBLE strictly necessary when using PERFECT_REST

#3 Unread post by arango »

Yes, the ROMS restart file is always, by default, in double precision since all the computations in ROMS are in double precision. The option RST_SINGLE was added because some users were complaining that the restart file was getting too big in very large applications. The restart file has only two rotating records by default. It really does not make any sense to have PERFECT_RESTART with RST_SINGLE. If the perfect restart NetCDF file is in single precision, you will not longer have a perfect restart for ROMS :!: It just does not make any sense to me.

If you look mod_netcdf.F, you will notice that we have:

Code: Select all

!
!  External data representation for floating-point variables.
!
#ifdef OUT_DOUBLE
      integer, parameter :: NF_FOUT = nf90_double
#else
      integer, parameter :: NF_FOUT = nf90_real
#endif
#ifdef RST_SINGLE
      integer, parameter :: NF_FRST = nf90_real
#else
      integer, parameter :: NF_FRST = nf90_double
#endif
#ifdef DOUBLE_PRECISION
      integer, parameter :: NF_TYPE = nf90_double
#else
      integer, parameter :: NF_TYPE = nf90_real
#endif
The variable NF_FRST is used only for the restart NetCDF file where as NF_FOUT is used for the other output NetCDF files. So you can turn off OUT_DOUBLE and still have a double precision restart NetCDF file, provided that RST_SINGLE is not activated.

The NF_TYPE is used for all the coordinate and metric variables in the output NetCDF files and this is controlled with DOUBLE_PRECISION option, which is always activated by default in ROMS (see globaldefs.h), except in computers with double precision architecture (like CRAY family of computers).

Post Reply