different restart files

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
fereshteh
Posts: 79
Joined: Sun Dec 30, 2012 2:58 pm
Location: inio:Iranian National Institute for Oceanography

different restart files

#1 Unread post by fereshteh »

Dear
i want to know that it is possible to create separately restart files after every N time steps? And then use nth restart file (for example second restrat file) as a initial file of hot start modelling?
By
LcycleRST == F
NRST ==1920
i just can create one restart file which in it there were written data after NRST time steps.
Cheers
fereshte

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

Re: different restart files

#2 Unread post by arango »

You have LcycleRST = F. This implies that you will have a single restart file with multiple time records (in your case, each record is written every 1920 time-steps). The restart records are not recycled to have the latest two records in the restart file. Therefore, the restart file will grow with each record. You can use any of those records to initialize the model and achieve what you want. Of course, you restart NetCDF file may get really big.

:idea: Alternatively, You can also monitor your solution with a cron script to copy the restart file to different files while the model is running:

Code: Select all

cp ocean_rst.nc saved_rst_0001.nc
...
cp ocean_rst.nc saved_rst_0002.nc
I know of people that have written using cron job scheduling scripts to do similar things.

The restart scheme of ROMS was not designed to create multiple files. But, it that's what you want you can modify the code easily for such a thing. Recall that you can also restart ROMS with a history file. The history files have the multiple file option. However, you cannot use the PERFECT_RESTART option.

:idea: :idea: Users need to be more resourceful if they want to become good ocean modelers.

fereshteh
Posts: 79
Joined: Sun Dec 30, 2012 2:58 pm
Location: inio:Iranian National Institute for Oceanography

Re: different restart files

#3 Unread post by fereshteh »

Dear Arango
i have checked the approach that you said for several times. I run two models: first one cold-start (from 16 to 22t January) which in it:

Code: Select all

Dt=90
Ntimes=7680  %8 days
NRREC=0
LcycleRST=F
NRST=1920 %2 days
Dstart=15.2188
Time_ref=20090101.0
ININAME=initial.nc
and when ever new record was written in restart file i copied it to new file ( while the model is running)
cp restrat.nc restart_01.nc (which contain 18 January's record)
second model (as a hot-start) run for 6 days (18th to 22th Jan):

Code: Select all

Dt=90
Ntimes=7680   %(1920 (2days for restart_01.nc)+5760 (6days))
NRREC=-1
LcycleRST=T
NRST= 3 
Dstart=15.2188
Time_ref=20090101.0
ININAME=restart_01.nc
After comparing first model and second model's results in the same times (e.g 19 to 22 jan)and for same fields, i saw that their result were different :shock: .
Would you please tell me what my fault is?
all the best
fereshte

P.S
both models had same header file and force files. and all flags in ocean.in file of both models were same, expect mentioned flags.

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

Re: different restart files

#4 Unread post by kate »

Did you use the PERFECT_RESTART option? That tells ROMS to write extra fields into the restart file so that it has a better chance of doing what you want. If you did and it still didn't give the same results, then there's something missing from the PERFECT_RESTART code for the options you have chosen.

fereshteh
Posts: 79
Joined: Sun Dec 30, 2012 2:58 pm
Location: inio:Iranian National Institute for Oceanography

Re: different restart files

#5 Unread post by fereshteh »

Dear kate
i use #define perfect_restart but again results are different :evil:
this is my header file:
#define ROMS_MODEL



#define SALINITY
#define SOLVE3D
#define MASKING
#define SPLINES


#define OUT_DOUBLE

/* advection, dissipation, pressure grad, etc. */

#define DJ_GRADPS
#define UV_ADV
#define UV_COR

/*tracer advection*/
#define TS_U3HADVECTION
#define TS_C4VADVECTION
!#define TS_MPDATA
#define NONLIN_EOS


#define UV_QDRAG
#define UV_VIS2
#define MIX_S_UV
#define TS_DIF2
#define MIX_S_TS

/* Boundary Conditions */

#define EASTERN_WALL
#define WESTERN_WALL
#define NORTHERN_WALL
#define SOUTHERN_WALL

/* output stuff */

#define AVERAGES /*writing out time-averaged data */
#define DIAGNOSTICS_UV /*writing out momentum diagnostics */
#define DIAGNOSTICS_TS /*writing out tracer diagnostics */


#undef ANA_GRID
#undef ANA_INITIAL

#undef ANA_SMFLUX
# undef ANA_STFLUX
# undef ANA_SSFLUX
# define ANA_BTFLUX
# define ANA_BSFLUX

/*river*/

#define UV_PSOURCE
#define TS_PSOURCE


/* vertical mixing */
#define GLS_MIXING /*Generic Length-Scale mixing */
#if defined GLS_MIXING
# define KANTHA_CLAYSON
# undef CANUTO_A
# define N2S2_HORAVG
#else
# define ANA_VMIX
#endif

#define PERFECT_RESTART

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

Re: different restart files

#6 Unread post by kate »

I don't see anything particularly odd in your cppdefs file. If you truly need PERFECT_RESTART to work, my favorite way to debug it is to run two debugger instances, saving a restart file after just a few timesteps. One debugger goes from the beginning to step 3 while the second debugger starts from the restart file. Poke around and see what's different.

fereshteh
Posts: 79
Joined: Sun Dec 30, 2012 2:58 pm
Location: inio:Iranian National Institute for Oceanography

Re: different restart files

#7 Unread post by fereshteh »

Dear kate
i have tried your new approach.3-days-long model (16 to 18 jan)from beginning and 5-day-long model (18 to 22 jan) started from the restart file of 3-day-long model.
In first one:

Code: Select all

Dt=90
Ntimes=2880  %3 days
NRREC=0
LcycleRST=F
NRST=960   %1 day
LDEFOUT == T
Dstart=15.2188
Time_ref=20090101.0
ININAME=initial.nc
RSTNAME == ocean_rip_current_rst.nc
in second one:

Code: Select all

Dt=90
Ntimes=7680   %(2880 (3days for restart.nc)+4800+ (5days))
NRREC=-1
LcycleRST=T
NRST= 960
LDEFOUT == T
Dstart=15.2188
Time_ref=20090101.0
ININAME =ocean_rip_current_rst.nc
RSTNAME == ocean_rip_current_rst1.nc
comparing of second model result with 8-long-model ( which were from 16 to 22t January) shows that results are different again :( . It makes me confused :cry:
In attached i put some results of bottom, layer for different steps.
i am worried that after long time those difference increase and effect on hot-start model's results, badly. With regard that i don't have appropriate software equipment to do try-error it for long time modeling ,i become grateful if you have any idea about result tell it to me
I would like to offer my heartfelt appreciation to your patient to help me
Thanks for you patient to help me
cheers
fereshte
P.S
sustr and svstr in all time steps were same in hot and cold run.
Attachments
max difference =.3379
max difference =.3379
dd.jpg (22.98 KiB) Viewed 5084 times
max difference =.224
max difference =.224
cc.jpg (22.69 KiB) Viewed 5085 times
max difference=.042
max difference=.042
bb.jpg (23.18 KiB) Viewed 5085 times
max dirrerence=.097
max dirrerence=.097
aa.jpg (23.16 KiB) Viewed 5085 times

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

Re: different restart files

#8 Unread post by kate »

You've got the idea of doing diffs on the netcdf files. Now try again with 3 timesteps instead of 3 days. Save a restart record after 2 steps, then history records after every step, running only 3-4 steps total.

Post Reply