WRF icon indicating copy to clipboard operation
WRF copied to clipboard

Wrong io stream specified in ndown code

Open sael9740 opened this issue 1 year ago • 1 comments

When attempting to run ndown it was failing with messages like the following:

  ndown_em main: calling open_r_dataset for wrfout_d01_2023-08-02_00:00:00
   NetCDF error: No such file or directory
   NetCDF error in wrf_io.F90, line         1077
-------------- FATAL CALLED ---------------
FATAL CALLED FROM FILE:  <stdin>  LINE:     307
program ndown: error opening wrfout_d01_2023-08-02_00:00:00 for reading ierr=   -1021
-------------------------------------------

This was baffling since the file was clearly there. Note that I specified io_form_auxinput2 = 2 in my namelist. I eventually found that although the debug messages indicated that ndown was trying to open the wrfout_d01_2023-08-02_00:00:00 file it was actually attempting to open the wrfout_d01_2023-08-02_00:00:00_0000 file, which would be the filename for rank 0 if I had set io_form_auxinput2=102. After digging into the code a bit I found that it was specifying DATASET=AUXINPUT1 in the open_r_dataset call:

https://github.com/wrf-model/WRF/blob/3dd1546ba425b5e77d682dd92253738416b3cb0a/main/ndown_em.F#L340

I just happened to have specified io_form_auxinput1 = 102 for this test case, which explains why I ran into this issue.

Changing the DATASET=AUXINPUT1 to DATASET=AUXINPUT2 fixes the issue. I can create a pull request sometime next week for this.

sael9740 avatar Aug 03 '23 03:08 sael9740

Thanks for providing not only the problem but also the solution.

dudhia avatar Aug 03 '23 15:08 dudhia