Hello, I am running mcip5.1 using WRF-4.1.5’s output and receive following error:
*** SUBROUTINE: SETUP_WRFEM
*** ERROR INQUIRING ABOUT VAR IN WRF FILE
*** VARIABLE = Times
*** NCF: NetCDF: Invalid argument
*** ERROR ABORT in subroutine SETUP_WRFEM
ABNORMAL TERMINATION IN SETUP_WRFEM
Date and time 0:00:00 March 1, 2019 (2019060:000000)
Error running mcip
file_gd = “/eirun/bio/inputs/mcip/work/daytest/GRIDDESC”
file_mm = “/met/output/201903/era-int.hvc.noah.ysu.wsm6/txe_4km/wrfout_d01_2019-03-01_00:00:00”,
file_geo = “/metrun/run1/bcd/WRF-4.1.5/WPS-4.1/geo_em.d02.nc”
ioform = 1
lpv = 0
lwout = 0
luvbout = 1
mcip_start = “2019-03-01-00:00:00.0000”
mcip_end = “2019-03-01-23:00:00.0000”
intvl = 60
coordnam = “LAM_40N_97W”
grdnam = “TXS_4KM”
btrim = -1
lprt_col = 0
lprt_row = 0
wrf_lc_ref_lat = 40.0
x0 = 26
y0 = 17
ncolsin = 191
nrowsin = 236
May you help with the error.
What compiler are you using? Also, could you provide the entire whole output log instead of just the error message.
Megan thanks for your help!
We used pgi19.10 and NetcdF4.6.2. Attached is the log file.
log.txt (2.3 KB)
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,
output.txt (49.4 KB)
Thanks for looking into it,
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.
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
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