It looks like the WRF header is being read before the error message pops up… It’d be useful to know more about your wrfout file. Please use the command “ncdump -h wrfout_filename > output.txt” on your wrfout file and post the output file so I can take a look. Thanks,
Megan
Thanks for providing that. Your wrfout file looks like it has the expected number of output times, so I’m not sure why it’s generating the error…
I noticed your simulation start date is the 28th and your error is generated while trying to run mcip for the 30th. Do you get the same error if you try to run mcip for the 29th? Just trying to rule out anything specific to this file.
Megan
I can’t tell what is wrong either. What is the output of ncdump -k wrfout_filename?
Also, if you do ncdump -vTimes wrfout_filename, you’ll get the same header output as above, followed by the string values of the time stamps. Do those look ok? It should be strings of the format
Times =
"2019-03-01_00:00:00",
"2019-03-01_01:00:00",
...
"2019-03-01_23:00:00" ;
I’m not sure if I’m adding much here, but the initial error message was triggered by an error in executing the function “nf90_inquire_variable” on the WRF output variable, “Times” (line 882 of setup_wrfem.f90 from MCIPv5.1). The “invalid argument” error from netCDF is likely from an error in one of the two inputs to the function: the index that is associated with the netCDF file, and the index that is associated with the WRF output variable, Times, within the netCDF file. Given that several other netCDF functions were successfully executed from the same file, the index associated with the file (subroutine variable “cdfid”) is not the issue. I suspect that the index associated with Times (subroutine variable “id_data”) is the likely culprit here. It would have been acquired through the function “nf90_inq_varid” on line 877.
A big clue to solving this issue is the outcome of the command that @cgnolte suggested to examine the contents of the WRF output variable “Times” using <<ncdump -v Times wrfout_filename>>. If there is nothing listed in Times at the bottom of the scroll (and the contents should be like @cgnolte described), then the WRF output file was not closed properly at the end of the WRF run. In that case, you will be unable to view the contents of the file (other than the header) using standard netCDF tools and commands.
You can also modify and recompile MCIP to try to see the value of “id_data” from line 877 of setup_wrfem.f90. I believe that id_data should be a positive integer (NOT zero, negative, or “very large”).
My best guess from the information in this thread is that the WRF file was not closed properly and none of the data will be readable, aside from the header. Another way to check that is to see if you can visualize the WRF output file using a quick-and-dirty viewer like ncview. If the file exists, has the right size, but cannot be viewed, then that is your answer. You would need to recreate the WRF file.
For more on the netCDF commands that are causing the error in MCIP, see sections 6.8 and 6.9 of NetCDF-Fortran: 6 Variables