Error when running BCON process of CMAQ v5.3

I want to create Boundary Conditions from BCON profile but have some errors as follows:
Boundary Concentrations from an input BC profile file.
BCs do not vary with time.
Value for BC_PROFILE: ‘/public/model/couple/phd/cmaq/CMAQ-master/PREP/bcon/scripts/BLD_BCON_v53_intel/avprofile_cb6r3m_ae7_kmtbr_hemi2016_v53beta2_m3dry_col051_row068.csv’
Value for BC_PROFILE: ‘/public/model/couple/phd/cmaq/CMAQ-master/PREP/bcon/scripts/BLD_BCON_v53_intel/avprofile_cb6r3m_ae7_kmtbr_hemi2016_v53beta2_m3dry_col051_row068.csv’
Linear vertical interpolation used
*** Error in `/public/model/couple/phd/cmaq/CMAQ-master/PREP/bcon/scripts/BLD_BCON_v53_intel/BCON_v53.exe’: free(): invalid next size (normal): 0x000000000171aa90 ***

I had addressed this question and I comment this:
C Get the layer mid-point heights
VNAME = 'ZH’out
IF ( .NOT. READ3( MET_CRO_3D_FIN, VNAME, ALLAYS3, JDATE, JTIME,
& ZH_OUT ) ) THEN
MSG = 'Could not read layer heights form file ’ // MET_CRO_3D_FIN
CALL M3ERR ( PNAME, JDATE, JTIME, MSG, .TRUE. )
END IF
But these can process in IC program, I don’t know why. Can someone out there explain this? Thanks in advance!

Damm even I am having a similar kind of issue, I have searched all over the

internet and even have posted on number of threads on different forum, no

solution seems to work. I am really frustrated, can anyone of you here help

me resolve this issue, I am very much tired now.

Can you please provide additional details on what you are trying to do. It looks like you are trying to run BCON in profile mode, correct? What year/domain are you trying to create BCs for? Have you tried running in debug mode to see if that provides more information on the issue.

Still waiting for someone to reply to me

Been 11 days still no reply from any community member

Regards, 9apps
cartoon hd

@johnsmith101, please be more specific as to what you are trying to do, the steps you have taken, and the error messages you are getting.

I am also facing some issues with running BCON with CMAQ version 5.3. When I set the “profile” mode using the “avprofile_cb6r3m_ae7_kmtbr_hemi2016_v53beta2_m3dry_col051_row068.csv” file, I am getting a segmentation fault. (The file says that was set up with 44 layers, and my case has 23 - however ICON processor has run successfully with the avprofile_cb6r3m_ae7_kmtbr_hemi2016_v53beta2_m3dry_col051_row068.csv file from the ICON folder)

model BCON_v53.exe;

repo /opt/wrf_cmaq/cmaq/CMAQ_5.3/PREP/bcon/src;

lib_base /opt/wrf_cmaq/cmaq/CMAQ_5.3/lib/x86_64/gcc;

lib_1 ioapi/lib;

lib_2 ioapi/include_files;

lib_4 ioapi/lib;

cpp_flags “”;

f_compiler mpifort;

fstd “-O3 -funroll-loops -finit-character=32 -Wtabs -Wsurprising -march=native -ftree-vectorize -ftree-loop-if-convert -finline-limit=512”;

dbg “-Wall -O0 -g -fcheck=all -ffpe-trap=invalid,zero,overflow -fbacktrace”;

f_flags “-ffixed-form -ffixed-line-length-132 -funroll-loops -finit-character=32”;

f90_flags “-ffree-form -ffree-line-length-none -funroll-loops -finit-character=32”;

link_flags “-fopenmp”;

ioapi “-lioapi”;

netcdf "-lnetcdf ";

netcdff “-lnetcdff”;

// project repository location: /opt/wrf_cmaq/cmaq/CMAQ_5.3/PREP/bcon/src

// required common
Module common;

// options are m3conc
Module m3conc;

// options are profile
Module profile;

setenv GRID_NAME Salvador
setenv GRIDDESC /scratch/ykaore/novo/wet/aqm/katty-cmaq/…/mcip_d03/GRIDDESC
setenv IOAPI_ISPH 20
setenv IOAPI_LOG_WRITE F
setenv IOAPI_OFFSET_64 YES
setenv EXECUTION_ID BCON_v53.exe
setenv BCON_TYPE echo $BCTYPE | tr "[A-Z]" "[a-z]"
tr [A-Z] [a-z]
echo profile
set OUTDIR = /scratch/ykaore/novo/wet/aqm/katty-cmaq/v53_bcon
set DATE = 2015-06-22
set YYYYJJJ = date -ud "${DATE}" +%Y%j
date -ud 2015-06-22 +%Y%j
set YYMMDD = date -ud "${DATE}" +%y%m%d
date -ud 2015-06-22 +%y%m%d
set YYYYMMDD = date -ud "${DATE}" +%Y%m%d
date -ud 2015-06-22 +%Y%m%d
if ( profile == profile ) then
setenv BC_PROFILE /opt/wrf_cmaq/cmaq/CMAQ_5.3/PREP/bcon/scripts/BLD_BCON_v53_gcc/…/…/src/profile/avprofile_cb6r3m_ae7_kmtbr_hemi2016_v53beta2_m3dry_col051_row068.csv
setenv MET_BDY_3D_FIN /scratch/ykaore/novo/wet/aqm/katty-cmaq/…/mcip_d03/METCRO3D_d03.nc
setenv BNDY_CONC_1 /scratch/ykaore/novo/wet/aqm/katty-cmaq/v53_bcon/BCON_v53_Salvador_profile_20150622 -v
endif
if ( ! -d /scratch/ykaore/novo/wet/aqm/katty-cmaq/v53_bcon ) mkdir -p /scratch/ykaore/novo/wet/aqm/katty-cmaq/v53_bcon
ls -l /opt/wrf_cmaq/cmaq/CMAQ_5.3/PREP/bcon/scripts/BLD_BCON_v53_gcc/BCON_v53.exe
-rwxrwxr-x 1 silvano bull 6608192 Oct 16 09:28 /opt/wrf_cmaq/cmaq/CMAQ_5.3/PREP/bcon/scripts/BLD_BCON_v53_gcc/BCON_v53.exe
size /opt/wrf_cmaq/cmaq/CMAQ_5.3/PREP/bcon/scripts/BLD_BCON_v53_gcc/BCON_v53.exe
text data bss dec hex filename
2580384 3714872 6466176 12761432 c2b958 /opt/wrf_cmaq/cmaq/CMAQ_5.3/PREP/bcon/scripts/BLD_BCON_v53_gcc/BCON_v53.exe
unlimit
limit
cputime unlimited
filesize unlimited
datasize unlimited
stacksize unlimited
coredumpsize unlimited
memoryuse unlimited
vmemoryuse unlimited
descriptors 4096
memorylocked unlimited
maxproc 767488
maxlocks unlimited
maxsignal 767488
maxmessage 819200
maxnice 0
maxrtprio 0
maxrttime unlimited
/opt/wrf_cmaq/cmaq/CMAQ_5.3/PREP/bcon/scripts/BLD_BCON_v53_gcc/BCON_v53.exe

 This program uses the EPA-AREAL/MCNC-EnvPgms/BAMS Models-3
 I/O Applications Programming Interface, [I/O API] which is
 built on top of the netCDF I/O library (Copyright 1993, 1996
 University Corporation for Atmospheric Research/Unidata
 Program) and the PVM parallel-programming library (from
 Oak Ridge National Laboratory).
 Copyright (C) 1992-2002 MCNC,
 (C) 1992-2013 Carlie J. Coats, Jr.,
 (C) 2003-2012 Baron Advanced Meteorological Systems, LLC, and
 (C) 2014-2016 UNC Institute for the Environment.
 Released under the GNU LGPL  License, version 2.1.  See URL

     https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html

 for conditions of use.

 ioapi-3.2: $Id: init3.F90 78 2018-01-26 21:27:04Z coats $
 Version with PARMS3.EXT/PARAMETER::MXVARS3= 2048
 netCDF version 4.4.1.1 of Oct 15 2019 16:41:36 $


 EXECUTION_ID: BCON_v53.exe
 Value for BCON_TYPE:  'profile'
 Value for BCON_TYPE:  'profile'
 Value for GRID_NAME:  'Salvador'
 Value for GRID_NAME:  'Salvador'

 File "GRIDDESC" opened for input on unit:  99
 /scratch/ykaore/novo/wet/aqm/katty-cmaq/../mcip_d03/GRIDDESC

 Value for IOAPI_CHECK_HEADERS not defined;returning default:   FALSE

 "MET_BDY_3D_FIN" opened as OLD:READ-ONLY
 File name "/scratch/ykaore/novo/wet/aqm/katty-cmaq/../mcip_d03/METCRO3D_d03.nc"
 File type GRDDED3
 Execution ID "mcip"
 Grid name "Salvador_CROSS"
 Dimensions: 130 rows, 130 cols, 22 lays, 17 vbles
 NetCDF ID:     65536  opened as READONLY
 Starting date and time  2015173:010000 (1:00:00   June 22, 2015)
 Timestep                          010000 (1:00:00 hh:mm:ss)
 Maximum current record number       798

###############################################################################

Input file section

###############################################################################

 Boundary Concentrations from an input BC profile file.
 BCs do not vary with time.
 Value for BC_PROFILE:  '/opt/wrf_cmaq/cmaq/CMAQ_5.3/PREP/bcon/scripts/BLD_BCON_v53_gcc/../../src/profile/avprofile_cb6r3m_ae7_kmtbr_hemi2016_v53beta2_m3dry_col051_row068.csv'
 Value for BC_PROFILE:  '/opt/wrf_cmaq/cmaq/CMAQ_5.3/PREP/bcon/scripts/BLD_BCON_v53_gcc/../../src/profile/avprofile_cb6r3m_ae7_kmtbr_hemi2016_v53beta2_m3dry_col051_row068.csv'
 Linear vertical interpolation used

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0 0x2B351E725697
#1 0x2B351E725CDE
#2 0x2B351F60526F
#3 0x5928BC in swapn4b at ncx.c:?
#4 0x59CFE0 in ncx_getn_float_float
#5 0x5AE95B in getNCvx_float_float at putget.c:?
#6 0x5B51AD in readNCv at putget.c:?
#7 0x5B737C in NC3_get_vara
#8 0x589C91 in NC_get_vara
#9 0x58AFCC in nc_get_vara_float
#10 0x58534A in nf_get_vara_real_
#11 0x44427F in rdvars_
#12 0x537CFA in rdgrdded_
#13 0x43431B in read3_
#14 0x41C61C in prof_vinterp_
#15 0x41A840 in prof_bcout_
#16 0x41C047 in prof_inbndy_
#17 0x403A44 in MAIN__ at bcon.F:?
Segmentation fault (core dumped)
0.007u 0.055s 0:00.12 41.6% 0+0k 0+29952io 0pf+0w
exit ( )

Every time I try running it i do not know what happens it crashes automatically

Any help? vlc vidmate

Hello, I’ve had the same problem.
Is there anyone know how to fix it?

Thanks!!

As a first cut, add -fbacktrace to MFLAGS in Makeinclude.Linux2_x86_64gfortdbg and then compile everything with the resulting flags. That should at least give you the line-numbers at which the seg-fault occurs.

Most probably, there is a problem with the ALLOCATE for the argument to the READ3 call…

I got the message like this:

###############################################################################

Input file section

###############################################################################

 Boundary Concentrations from an input BC profile file.
 BCs do not vary with time.
 Value for BC_PROFILE:  '/raid1/CMAQv5.3.1-gfort/shbook/bcon/BLD_BCON_v531_gcc/avprofile_cb6r3m_ae7_kmtbr_hemi2016_v53beta2_m3dry_col051_row068.csv'
 Value for BC_PROFILE:  '/raid1/CMAQv5.3.1-gfort/shbook/bcon/BLD_BCON_v531_gcc/avprofile_cb6r3m_ae7_kmtbr_hemi2016_v53beta2_m3dry_col051_row068.csv'
 Linear vertical interpolation used

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0 0x7FC7D6932697
#1 0x7FC7D6932CDE
#2 0x7FC7D5C0827F
#3 0x582549 in swapn4b at ncx.c:176
#4 0x585FA9 in ncx_getn_float_float at ncx.c:6085
#5 0x589EAF in getNCvx_float_float at putget.c:4093
#6 0x58EBB6 in NC3_get_vara at putget.c:5210
#7 0x57C662 in NC_get_vara at var.c:172
#8 0x57F29E in nc_get_vara_float at var.c:1776
#9 0x579A91 in nf_get_vara_real_ at fort-varaio.c:142
#10 0x443CDC in rdvars_
#11 0x537000 in rdgrdded_
#12 0x43429B in read3_
#13 0x41C43C in prof_vinterp_ at prof_vinterp.F:162
#14 0x41A660 in prof_bcout_ at prof_bcout.F:279
#15 0x41BE67 in prof_inbndy_ at prof_driver.F:98
#16 0x403864 in MAIN__ at bcon.F:140
Segmentation fault

Thanks for your help, I’ll try to figure out how to fix those scripts.

It would seem most likely that the dimensions for allocating ZH_OUT in “prof_vinterp.F” do not agree with the dimensions on the file MET_BDY_3D_FIN. Are the dimension parameters for this file checked against the ones in HGRD_DEFN.F?

1 Like

Thanks for your reply!
I found out that the route of MET_BDY_3D_FIN in run.bcon script is wrong.
After I fixed that, it finally worked.

1 Like

Hi, Allen,
Could you tell me the way or position you have changed? I have the same problem. I am looking forward to getting reply. Thank you so much!

Yangjun

Hello,
Here’s a part of my script to run bcon module, and my problem was the route of “MET_BDY_3D_FIN” set incorrect.
Maybe you can check your script, or whether mcip running result is correct.

bconv5.3.1-script.txt (769 Bytes)

Allen

Hi Allen,
Thank you for your kind reply. I have solved this problem this morninng. Your information in the forum has inspired me to check the bcon script again and again, and finally it was corrected.
Thank you so much!

yangjun wang
2020-05-07

My question was about when it is used the bcon module using m3conc type. It is just for nested domain or I can use in a single domain? Are this related?? vidmate

You can use the m3conc version of bconc when you are nesting down from a course domain to a domain with finer resolution, or from a larger domain that you are windowing down to a smaller domain (same resolution).
In the latest release of CMAQv5.3.1 the selection of using m3conc (regrid) or profile is a run time option, rather than a compile time option.

Here is a section on BCON provided in the documentation:

#> Set General Parameters for Configuring the Simulation
 set VRSN     = v532                    #> Code Version
 set APPL     = 2016_12SE1              #> Application Name
 set BCTYPE   = regrid                  #> Boundary condition type [profile|regrid]