Error while using m3interp

Hi @cjcoats, I was wondering if you could check what could have caused the problem with using m3interp to interpolate 6-hr BC files to 3-hr BC files:

 "INFILE" opened as OLD:READ-ONLY
 File name "temp_2_file_with_remaining_time.ncf"
 File type BNDARY3
 Execution ID "????????????????"
 Grid name "12US2_CROSS"
 Dimensions: 246 rows, 396 cols, 34 lays, 53 vbles, 1 cells thick
 NetCDF ID:     65536  opened as READONLY
 Starting date and time  2014002:030000 (3:00:00   Jan. 2, 2014)
 Timestep                          060000 (6:00:00 hh:mm:ss)
 Maximum current record number        37

 If you wish to copy time steps (keeping the output grid the
 same) instead of interpolating them to a new output grid,
 respond "SAME" to the prompt for output grid name.
 Otherwise, give the GRIDDESC name for the output grid.

 Value for PROMPTFLAG not defined;returning default:   TRUE
 Enter output grid name, or "SAME" ["SAME"] >>
 Using default "SAME"
 Value for PROMPTFLAG not defined;returning default:   TRUE
 Enter STARTING DATE for time step sequence [2014002] >>
 Using default   2014002
 Enter STARTING TIME for time step sequence [30000] >>
 Using default     30000
 Enter   TIME STEP   for time step sequence [60000] >>30000
 Using response     30000
 Enter     NRECS     for time step sequence [73] >>
 Using default        73
 Enter name for output data file ["OUTFILE"] >>
 Using default "OUTFILE"

 Value for IOAPI_CHECK_HEADERS not defined;returning default:   FALSE
 Value for IOAPI_OFFSET_64 not defined;returning default:   TRUE
 Value for IOAPI_CFMETA not defined;returning default:   FALSE
 Value for IOAPI_CMAQMETA not defined; returning defaultval ':  'NONE'
 Value for IOAPI_CMAQMETA not defined; returning defaultval ':  'NONE'
 Value for IOAPI_SMOKEMETA not defined; returning defaultval ':  'NONE'
 Value for IOAPI_SMOKEMETA not defined; returning defaultval ':  'NONE'
 Value for IOAPI_TEXTMETA not defined; returning defaultval ':  'NONE'
 Value for IOAPI_TEXTMETA not defined; returning defaultval ':  'NONE'

 "OUTFILE" opened as UNKNOWN(R-W)
 File name "temp_3_file_with_remaining_time_in_3hr_intervals.ncf"
 File type BNDARY3
 Execution ID "????????????????"
 Grid name "12US2_CROSS"
 Dimensions: 246 rows, 396 cols, 34 lays, 53 vbles, 1 cells thick
 NetCDF ID:    131072  opened as READWRITE
 Starting date and time  2014002:030000 (3:00:00   Jan. 2, 2014)
 Timestep                          030000 (3:00:00 hh:mm:ss)
 Maximum current record number         0

 Processing  2014002:030000

 >>--->> WARNING in subroutine M3INTERP:INTERP3
 Size error for NO from INFILE--REQ:3312144 ACT:  43792
 M3WARN:  DTBUF 3:00:00   Jan. 2, 2014  (2014002:030000)

 *** ERROR ABORT in subroutine M3INTERP
 Failure reading variable "NO" from file "INFILE"
 Date and time  3:00:00   Jan. 2, 2014    (2014002:030000)

NO is the first variable in INFILE but I don’t know why it could not be read at the very first timestamp 2014002:30000

Curious.

NSIZE1 = NCOLS1*NROWS1*NLAYS1 is calculated at line 258 of m3interp.f and should be (according to your log) 3312144 at that point, and it is then being used at line 528 without having been changed – but INTERP3 is saying that it is 43792 inside the call at that line. I don’t understand how it could have been corrupted, but it seems to be…

The BC file which I intend to interpolate has PERIM = 1288 and NLAYS = 34, so # of BC CELLS = PERIM*NLAYS=1288*34=43792. The NSIZE1=3312144 is for the 2D gridded file which the BC file ‘surrounds’ on the south, east, north and west.

Congratulations! You’ve found a bug: in the past, m3interp has always been used with gridded files, not with boundary-condition files, so this one has slipped past the testing.

It is now fixed and documented, and the fixes have been uploaded to both the GitHub and the CMAS web-sites.

– Carlie

Thanks for updating! I am getting the same error though, with the new I/O API library installation using github clone!

 Program version:
 $Id:: m3interp.f 166 2020-05-29 15:55:46Z coats               $

 Value for PROMPTFLAG not defined;returning default:   TRUE
 Continue with program? (Y/N) [Y] >>
 Returning default value TRUE for query:
 "Continue with program?"

 Value for PROMPTFLAG not defined;returning default:   TRUE
 Enter name for input synch file, or "NONE" [NONE] >>
 Enter name for input data file [INFILE] >>
 Value for IOAPI_CHECK_HEADERS not defined;returning default:   FALSE

 "INFILE" opened as OLD:READ-ONLY
 File name "temp_2_file_with_remaining_time.ncf"
 File type BNDARY3
 Execution ID "????????????????"
 Grid name "12US2_CROSS"
 Dimensions: 246 rows, 396 cols, 34 lays, 53 vbles, 1 cells thick
 NetCDF ID:     65536  opened as READONLY
 Starting date and time  2014002:030000 (3:00:00   Jan. 2, 2014)
 Timestep                          060000 (6:00:00 hh:mm:ss)
 Maximum current record number        37

 If you wish to copy time steps (keeping the output grid the
 same) instead of interpolating them to a new output grid,
 respond "SAME" to the prompt for output grid name.
 Otherwise, give the GRIDDESC name for the output grid.

 Value for PROMPTFLAG not defined;returning default:   TRUE
 Enter output grid name, or "SAME" ["SAME"] >>
 Using default "SAME"
 Value for PROMPTFLAG not defined;returning default:   TRUE
 Enter STARTING DATE for time step sequence [2014002] >>
 Using default   2014002
 Enter STARTING TIME for time step sequence [30000] >>
 Using default     30000
 Enter   TIME STEP   for time step sequence [60000] >>30000
 Using response     30000
 Enter     NRECS     for time step sequence [73] >>
 Using default        73
 Enter name for output data file ["OUTFILE"] >>
 Using default "OUTFILE"

 Value for IOAPI_CHECK_HEADERS not defined;returning default:   FALSE
 Value for IOAPI_OFFSET_64 not defined;returning default:   TRUE
 Value for IOAPI_CFMETA not defined;returning default:   FALSE
 Value for IOAPI_CMAQMETA not defined; returning defaultval ':  'NONE'
 Value for IOAPI_CMAQMETA not defined; returning defaultval ':  'NONE'
 Value for IOAPI_SMOKEMETA not defined; returning defaultval ':  'NONE'
 Value for IOAPI_SMOKEMETA not defined; returning defaultval ':  'NONE'
 Value for IOAPI_TEXTMETA not defined; returning defaultval ':  'NONE'
 Value for IOAPI_TEXTMETA not defined; returning defaultval ':  'NONE'

 "OUTFILE" opened as UNKNOWN(R-W)
 File name "temp_3_file_with_remaining_time_in_3hr_intervals.ncf"
 File type BNDARY3
 Execution ID "????????????????"
 Grid name "12US2_CROSS"
 Dimensions: 246 rows, 396 cols, 34 lays, 53 vbles, 1 cells thick
 NetCDF ID:    131072  opened as READWRITE
 Starting date and time  2014002:030000 (3:00:00   Jan. 2, 2014)
 Timestep                          030000 (3:00:00 hh:mm:ss)
 Maximum current record number         0

 Processing  2014002:030000

 >>--->> WARNING in subroutine M3INTERP:INTERP3
 Size error for NO from INFILE--REQ:  21896 ACT:  43792
 M3WARN:  DTBUF 3:00:00   Jan. 2, 2014  (2014002:030000)

 *** ERROR ABORT in subroutine M3INTERP
 Failure reading variable "NO" from file "INFILE"
 Date and time  3:00:00   Jan. 2, 2014    (2014002:030000)

I am not sure why the error is showing!

My bad. Quick fix:
Line 264 should have
NSIZE1 = 2*N*NTHIK3D*NLAYS1
and line 333 should have
SIZE = 2*NTHIK3D*( NCOLS3D + NROWS3D + 2*NTHIK3D )
and re-build. Will fix the repositories tomorrow…

Works now - thanks a lot for your prompt answers!