Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

WRF restart run produces multiple outputs

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

jvithana

New member
hi,

Is there a quick way to merge two or more wrfout files in to single file? The runs I had written a file for each restart run and it seems the netcdf file size limit was not exceeded on those files. Not sure why it is doing that, or is there an option in namelist to write a single output regardless of number of restarts?

my data is in

/glade/scratch/jvithana/test7-2km/WRFV4_ivan/test/em_real

Thanks
 
Hi,
To concatenate netcdf files, see this presentation (specifically, the section regarding NCO tools):
https://www2.mmm.ucar.edu/wrf/users/tutorial/202001/werner_data_util_pp.pdf

I'm not exactly sure what you mean by this:
The runs I had written a file for each restart run and it seems the netcdf file size limit was not exceeded on those files. Not sure why it is doing that, or is there an option in namelist to write a single output regardless of number of restarts?

If the NCO tools doesn't help, please explain the situation more clearly. Thanks!
 
Hi,

I need to write output in to a single netcdf file. But for some reason each restart run writes a separate netcdf file. for example,

wrfout_d04_1999-10-14_12:00:00
wrfout_d04_1999-10-14_21:00:00
wrfout_d04_1999-10-15_07:00:00
wrfout_d04_1999-10-15_18:00:00
wrfout_d04_1999-10-16_03:00:00

these are the output files written according to each restart run. I like to write them all in to a single file.
the data are in
/glade/scratch/jvithana/test7-2km/WRFV4_ivan/test/em_real


Thanks for help!!
 
Hi,
There are no wrfout* files for a 1999 date in that directory, and the namelist.input file doesn't reflect that either. Can you point me to the namelist that you are using for your restart run, and the wrfout* files? Thanks.
 
I think the problem is that you still have several wrfout* files in your directory that are from older runs. If you use the command "ls -ls" you can see the dates and times for the wrfout* file write-outs. This is what I see:
Code:
165200 -rw-r--r-- 1 jvithana ncar  169158349 Feb 20 22:54 wrfout_d01_1999-10-14_00:00:00
 127216 -rw-r--r-- 1 jvithana ncar  130268036 Feb 21 19:26 wrfout_d01_1999-10-14_12:00:00
 142704 -rw-r--r-- 1 jvithana ncar  146116857 Feb 22 20:05 wrfout_d01_1999-10-14_21:00:00
 159392 -rw-r--r-- 1 jvithana ncar  163213952 Feb 23 09:33 wrfout_d01_1999-10-15_07:00:00
 131520 -rw-r--r-- 1 jvithana ncar  134675962 Feb 24 19:26 wrfout_d01_1999-10-15_18:00:00
  88640 -rw-r--r-- 1 jvithana ncar   90760481 Mar  1 06:30 wrfout_d01_1999-10-16_03:00:00
  59728 -rw-r--r-- 1 jvithana ncar   61147624 Mar  2 15:48 wrfout_d01_1999-10-16_09:00:00
 790464 -rw-r--r-- 1 jvithana ncar  809423382 Feb 20 22:57 wrfout_d02_1999-10-14_00:00:00
 613328 -rw-r--r-- 1 jvithana ncar  628041183 Feb 21 19:28 wrfout_d02_1999-10-14_12:00:00
 687856 -rw-r--r-- 1 jvithana ncar  704350665 Feb 22 20:08 wrfout_d02_1999-10-14_21:00:00
 769536 -rw-r--r-- 1 jvithana ncar  787991703 Feb 23 09:35 wrfout_d02_1999-10-15_07:00:00
 634992 -rw-r--r-- 1 jvithana ncar  650221261 Feb 24 19:29 wrfout_d02_1999-10-15_18:00:00
 428640 -rw-r--r-- 1 jvithana ncar  438916412 Mar  1 06:33 wrfout_d02_1999-10-16_03:00:00
 288176 -rw-r--r-- 1 jvithana ncar  295088744 Mar  2 15:48 wrfout_d02_1999-10-16_09:00:00
3343072 -rw-r--r-- 1 jvithana ncar 3423295656 Feb 20 22:57 wrfout_d03_1999-10-14_00:00:00
2651824 -rw-r--r-- 1 jvithana ncar 2715454635 Feb 21 19:29 wrfout_d03_1999-10-14_12:00:00
2978848 -rw-r--r-- 1 jvithana ncar 3050331503 Feb 22 20:08 wrfout_d03_1999-10-14_21:00:00
3332032 -rw-r--r-- 1 jvithana ncar 3411998908 Feb 23 09:36 wrfout_d03_1999-10-15_07:00:00
2747984 -rw-r--r-- 1 jvithana ncar 2813933269 Feb 24 19:29 wrfout_d03_1999-10-15_18:00:00
1856000 -rw-r--r-- 1 jvithana ncar 1900536195 Mar  1 06:33 wrfout_d03_1999-10-16_03:00:00
1246096 -rw-r--r-- 1 jvithana ncar 1275991810 Mar  2 15:48 wrfout_d03_1999-10-16_09:00:00
2897280 -rw-r--r-- 1 jvithana ncar 2966801528 Feb 20 22:58 wrfout_d04_1999-10-14_00:00:00.nc
    128 -rw-r--r-- 1 jvithana ncar     115518 Mar 10 12:16 wrfout_d04_1999-10-14_00:00:00.tif
2341536 -rw-r--r-- 1 jvithana ncar 2397726667 Feb 21 19:29 wrfout_d04_1999-10-14_12:00:00.nc
2625248 -rw-r--r-- 1 jvithana ncar 2688249424 Feb 22 20:08 wrfout_d04_1999-10-14_21:00:00.nc
2920960 -rw-r--r-- 1 jvithana ncar 2991051950 Feb 23 09:36 wrfout_d04_1999-10-15_07:00:00.nc
2411648 -rw-r--r-- 1 jvithana ncar 2469512941 Feb 24 19:29 wrfout_d04_1999-10-15_18:00:00.nc
1630160 -rw-r--r-- 1 jvithana ncar 1669270701 Mar  1 06:33 wrfout_d04_1999-10-16_03:00:00.nc
1094512 -rw-r--r-- 1 jvithana ncar 1120777407 Mar  2 15:48 wrfout_d04_1999-10-16_09:00:00.nc

It looks like March 2nd is the most recent date on which you ran a simulation and you only have 4 wrfout* files for that date - all in a single file per domain.
 
Hi,

Sorry for delay in asking. I think the single file you mentioned is not the corrct file. I checked the time steps using ncdump and here are the outputs.


2625248 -rw-r--r-- 1 jvithana ncar 2688249424 Feb 22 20:08 wrfout_d04_1999-10-14_21:00:00.nc
2920960 -rw-r--r-- 1 jvithana ncar 2991051950 Feb 23 09:36 wrfout_d04_1999-10-15_07:00:00.nc
2411648 -rw-r--r-- 1 jvithana ncar 2469512941 Feb 24 19:29 wrfout_d04_1999-10-15_18:00:00.nc
1630160 -rw-r--r-- 1 jvithana ncar 1669270701 Mar 1 06:33 wrfout_d04_1999-10-16_03:00:00.nc
1094512 -rw-r--r-- 1 jvithana ncar 1120777407 Mar 2 15:48 wrfout_d04_1999-10-16_09:00:00.nc

I Like all of these written in to a single file. I am not sure if I enable large file support when I start running these or when I configuring WRF. can it be the problem? I was assuming all those are enabled by default like other modules.

Time steps in output

"1999-10-14_21:00:00",
"1999-10-14_22:00:00",
"1999-10-14_23:00:00",
"1999-10-15_00:00:00",
"1999-10-15_01:00:00",
"1999-10-15_02:00:00",
"1999-10-15_03:00:00",
"1999-10-15_04:00:00",
"1999-10-15_05:00:00",
"1999-10-15_06:00:00"
"1999-10-15_07:00:00",
"1999-10-15_08:00:00",
"1999-10-15_09:00:00",
"1999-10-15_10:00:00",
"1999-10-15_11:00:00",
"1999-10-15_12:00:00",
"1999-10-15_13:00:00",
"1999-10-15_14:00:00",
"1999-10-15_15:00:00",
"1999-10-15_16:00:00",
"1999-10-15_17:00:00"
"1999-10-15_18:00:00",
"1999-10-15_19:00:00",
"1999-10-15_20:00:00",
"1999-10-15_21:00:00",
"1999-10-15_22:00:00",
"1999-10-15_23:00:00",
"1999-10-16_00:00:00",
"1999-10-16_01:00:00",
"1999-10-16_02:00:00"
"1999-10-16_03:00:00",
"1999-10-16_04:00:00",
"1999-10-16_05:00:00",
"1999-10-16_06:00:00",
"1999-10-16_07:00:00",
"1999-10-16_08:00:00"
"1999-10-16_09:00:00",
"1999-10-16_10:00:00",
"1999-10-16_11:00:00",
"1999-10-16_12:00:00"
 
Hi,
So are you saying that you'd like each consecutive restart run to write the new output into the existing file from the previous run?
For example, if you ran an initial run for 24 hours into a single file: wrfout_d01_2020-04-20_00:00:00
then you ran a restart from that time for the next 24 hours (until 2020-04-21_00:00:00),
you would want the new 24 hours of output to be added to the original wrfout_d01_2020-04-20_00:00:00 file, so that the file now has 48 hours of output?
If that's the case, then that's not something that the model is capable of. You would have to write some sort of script to get this to work for you.
 
hi, I'd like to do a follow up for this question. My restart run produces multiple outputs in minutes for a single hour. Same as the on posted by the thread starter. How do I resolve this? Thanks
 
Do you mean that you want wrfout files to be saved in a single file instead of multiple single-time wrfout? If this is the case, you can simply set

frames_per_outfile = 1000, 1000, 1000

This is an example to instruct the model to write 1000 output files to a single wrfout file. You may change the number 1000 to any value you prefer.
 
Apologies for the late response.

I set the frames_per_outfile = 1000, 1000, 1

Supposedly, wrfoutput produces an hourly file, but it produces multiple files for a certain hour. For example,

wrfout_d03_2018-01-01_00:00:00
wrfout_d03_2018-01-01_00:00:07
wrfout_d03_2018-01-01_00:00:15
wrfout_d03_2018-01-02_01:00:02
wrfout_d03_2018-01-02_01:00:10

this usually happens if I use the restart option.
 
Please tell me which version of WRF you are running. If it is an older version (older before V4.0), can you try with the new version like WRFv4.2?
Please also send me your namelist.input to take a look. Thanks.
 
Top