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
Is OUT_DOUBLE strictly necessary when using PERFECT_RESTART?
-
- Posts: 23
- Joined: Fri May 24, 2013 3:05 am
- Location: UWA
Re: Is OUT_DOUBLE strictly necessary when using PERFECT_REST
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
- arango
- Site Admin
- Posts: 1368
- Joined: Wed Feb 26, 2003 4:41 pm
- Location: DMCS, Rutgers University
- Contact:
Re: Is OUT_DOUBLE strictly necessary when using PERFECT_REST
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:
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).
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 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).