Hi all,
In ROMS-2.2, is there any option to save output at different time steps in different restart files.
when I take NRREC value as 0 and gave first run's restart file as initial file then it had ran from the last timestep. what NRREC do when I put 1 or -1 or 2 or 3 ? the run is similar for any of the value(1,-1,2,3).
Thanks in advance.
rst files
The bottom of the *.in files have descriptions of the input parameters.For example:
!------------------------------------------------------------------------------
! Input/Output parameters.
!------------------------------------------------------------------------------
!
! NRREC Switch to indicate re-start from a previous solution. Use
! NRREC=0 for new solutions. In a re-start solution, NRREC
! is the time index of the re-start NetCDF file assigned for
! initialization. If NRREC is negative (said NRREC=-1), the
! model will re-start from the most recent time record. That
! is, the initialization record is assigned internally.
! Notice that it is also possible to re-start from a history
! or time-averaged NetCDF files. If a history file is used
! for re-start, it must contains all the necessary primitive
! variables at all levels.
! NRST Number of time-steps between writing of re-start fields.
!
So you can use the NRST field to identify how often the model state is written to the rst file. IF you select Nrrec =0, that is not a restart. The value of nrrec=0 is used for a new solution.
To restart, if you used
#define ANA_INITIAL
then you need to recompile with
#undef ANA_INITIAL
!------------------------------------------------------------------------------
! Input/Output parameters.
!------------------------------------------------------------------------------
!
! NRREC Switch to indicate re-start from a previous solution. Use
! NRREC=0 for new solutions. In a re-start solution, NRREC
! is the time index of the re-start NetCDF file assigned for
! initialization. If NRREC is negative (said NRREC=-1), the
! model will re-start from the most recent time record. That
! is, the initialization record is assigned internally.
! Notice that it is also possible to re-start from a history
! or time-averaged NetCDF files. If a history file is used
! for re-start, it must contains all the necessary primitive
! variables at all levels.
! NRST Number of time-steps between writing of re-start fields.
!
So you can use the NRST field to identify how often the model state is written to the rst file. IF you select Nrrec =0, that is not a restart. The value of nrrec=0 is used for a new solution.
To restart, if you used
#define ANA_INITIAL
then you need to recompile with
#undef ANA_INITIAL
Thank u Warner for ur reply. But I am asking is there any option for saving the output at different time steps in different restart files i.e., roms_rst001.nc,roms_rst002.nc, ........ in ROMS-2.2. This option is there in ROMS-2.1 using NRFRST and I also used it. But now I am asking is it there in ROMS-2.2?
U told that if we switch NRREC to 0 then it is for new solution. But for me when I switched it to 0 only it had restarted the model from the last time step onwards. When I used it to -1 or 1 or 2 or 3 it is not restarting from the last time step. At the same time, I didn't mentioned ANA_INITIAL in my application in cppdefs.h file. Then will it take by default ANA_INITIAL as switched ?
Please clear my doubts.
Thanks in advance.
U told that if we switch NRREC to 0 then it is for new solution. But for me when I switched it to 0 only it had restarted the model from the last time step onwards. When I used it to -1 or 1 or 2 or 3 it is not restarting from the last time step. At the same time, I didn't mentioned ANA_INITIAL in my application in cppdefs.h file. Then will it take by default ANA_INITIAL as switched ?
Please clear my doubts.
Thanks in advance.
monthly restart?
A solution I have seen for this is to set your run to be, for example, one month long, and the do an external script (csh) that copies the rst file into the ini file, moves it to rst_Y1M1 and runs again the code. There is a bacth file in the Roms_tools package that you can use as an example.
Andres
Andres
Reading this thread I get the impression that user nageswararao might be referring to a ROMS version other than the "Rutgers" code to which jcwarner is referring. I have no idea whether all flavours or ROMS handle these things in the same way. I expect not.
The 'history' file options allow a user to write a snapshot of the model every NHIS timesteps with a new file created every NDEFHIS timesteps (thus there are NDEFHIS/NHIS time records per file). A 'history' file contains essentially everything one needs to restart the model (unless you do not request all prognostic variables in the file by setting some Hout logical flags to False) with only the loss of some precision (i.e. loss of perfect restart) because multiple time levels are not included (but RST doesn't do this either).
Parameter NRREC relates to how ROMS behaves in reading the time data in the initial file (ININAME). No matter what you do, you have to name the initial file and it could be a nominally 'restart', 'history', or 'average' file from a previous run. The history file must also be named on input. If a previous run has written, e.g., 4 records to a single history file, and you want to continue appending to this file, then you set NRREC==4 and all is well. ROMS will write the next output to record 5. But you still have to name ININAME, RSTNAME and HISNAME on input. NRREC is only pointing to the record number ININAME. If HISNAME and RSTNAME are the same file (which is allowed) then you need to be intelligent about what you are doing or you will (a) restart from the wrong time record or (b) overwrite your history file. A small amount of systematic experimentation with NHIS, NRST and NRREC will reveal all.
John.
The 'history' file options allow a user to write a snapshot of the model every NHIS timesteps with a new file created every NDEFHIS timesteps (thus there are NDEFHIS/NHIS time records per file). A 'history' file contains essentially everything one needs to restart the model (unless you do not request all prognostic variables in the file by setting some Hout logical flags to False) with only the loss of some precision (i.e. loss of perfect restart) because multiple time levels are not included (but RST doesn't do this either).
Parameter NRREC relates to how ROMS behaves in reading the time data in the initial file (ININAME). No matter what you do, you have to name the initial file and it could be a nominally 'restart', 'history', or 'average' file from a previous run. The history file must also be named on input. If a previous run has written, e.g., 4 records to a single history file, and you want to continue appending to this file, then you set NRREC==4 and all is well. ROMS will write the next output to record 5. But you still have to name ININAME, RSTNAME and HISNAME on input. NRREC is only pointing to the record number ININAME. If HISNAME and RSTNAME are the same file (which is allowed) then you need to be intelligent about what you are doing or you will (a) restart from the wrong time record or (b) overwrite your history file. A small amount of systematic experimentation with NHIS, NRST and NRREC will reveal all.
John.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu
- arango
- Site Admin
- Posts: 1356
- Joined: Wed Feb 26, 2003 4:41 pm
- Location: DMCS, Rutgers University
- Contact:
The multiple file option is only allowed in history and average files output NetCDF files. It does not make sense to have multiple NetCDF option in restart files since we want to have recycling. The restart file is usually saved in double precision and has all the variable need for initialization. We usually set the cycling (LcycleRST) option activated (T). This will mantain the lastest two restart record in file RSTname. The restart fields are saved every NRST time-steps.
Also notice that it NRREC is negative, say NRREC=-1, ROMS will figure out internally what record to read from INIname. It reads the last record in INIname or the record having the greater time (in the case of recycling restart files). This allows production runs that take long time to compute.
Also, it the model blows-up the lastest model state is saved in the restart file. This will help to diagnose the problem sometimes when all the fields are not NaNs.
Please read the Glossary in ROMS standard input file carefully. All the above information is contained there.
Also notice that it NRREC is negative, say NRREC=-1, ROMS will figure out internally what record to read from INIname. It reads the last record in INIname or the record having the greater time (in the case of recycling restart files). This allows production runs that take long time to compute.
Also, it the model blows-up the lastest model state is saved in the restart file. This will help to diagnose the problem sometimes when all the fields are not NaNs.
Please read the Glossary in ROMS standard input file carefully. All the above information is contained there.