Bcon 5.3 error with cmaq 5.3.1

Dear all,
I am trying to run bcon 5.3 in cmaq 5.3.1, but I am getting this error:
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0 0x2AE9A90866D7
#1 0x2AE9A9086D1E
#2 0x2AE9A9D3F3FF
#3 0x580B89 in swapn4b at ncx.c:176
#4 0x5845E9 in ncx_getn_float_float at ncx.c:6085
#5 0x5884EF in getNCvx_float_float at putget.c:4093
#6 0x58D1F6 in NC3_get_vara at putget.c:5210
#7 0x57ACA2 in NC_get_vara at var.c:172
#8 0x57D8DE in nc_get_vara_float at var.c:1776
#9 0x5780D1 in nf_get_vara_real_ at fort-varaio.c:142
#10 0x44154C in rdvars_
#11 0x535120 in rdgrdded_
#12 0x431E2B in read3_
#13 0x41A06A in prof_vinterp_
#14 0x418451 in prof_bcout_
#15 0x419AA7 in prof_inbndy_
#16 0x4035EC in MAIN__ at bcon.F:?
Segmentation fault (core dumped)
0.023u 0.049s 0:00.96 6.2% 0+0k 0+8io 0pf+0w
exit ( )
This is the script I ran and the log generated. Thanks a lot!
log.1.txt (7.2 KB)
run_bcon1.csh (5.2 KB)

Your run script and log file show that you are setting MET_BDY_3D_FIN to /home/yaosy/program/cmaq/bulid_cmaq/CMAQ_Project/data/test/20191001/mcip/output/METCRO3D_20191001_d01.nc, i.e. the METCRO3D file instead of the METBDY3D file for the target domain. This leads to a failure in the read function because the program is expecting a file with an I/O API data structure BNDARY3 but encounters a file with data structure GRDDED3

In your run script, please change

   setenv MET_BDY_3D_FIN $CMAQ_HOME/data/$APPL/$GRID_NAME/mcip/output/METCRO3D_${GRID_NAME}_${dom}.nc`\ 

to

   setenv MET_BDY_3D_FIN $CMAQ_HOME/data/$APPL/$GRID_NAME/mcip/output/METBDY3D_${GRID_NAME}_${dom}.nc`\
1 Like

I made a low-level mistake! thanks a lot!
Could you please tell me how you can finger out the problem accorting to those scripts.

I’m glad this fixed the problem.

What pointed to this scripting bug being the underlying reason was that the trace back indicated a memory problem in READ3 which typically only occurs if either the file being read is corrupted or the data structure passed to the read function isn’t sufficient to hold the data being read due to mismatched array sizes.

Since your case uses BCON in its simplest form (just reading profile data), the only I/O API file being read is the file defining the horizontal and vertical boundary file structure of the target domain (MET_BDY_3D_FIN) so the problem had to be related to that file. Looking at how this was defined in the script as METCRO3D pointed to the second reason (mismatched data structure) as being the reason.

1 Like