How to run BCON/ICON for more than one month

Hi, everyone. I want to run BCON for seven months. I know I can do it one month by one month. I just want to know that can I do it in one script? I set the run length to 7 months but it seems that it cannot find the whole concentration file from CCTM_CONC which I prepared 7 files monthly. It can only check the first one.

You are correct that BCON cannot concatenate time steps across multiple CCTM_CONC input files in a single execution. However, the BNDY_CONC_1 output file created by BCON is opened in FSUNKN3 mode which allows appending time steps to an existing file.

I am not sure if I understand the structure of your CCTM_CONC and MCIP files correctly, but if you have 7 CCTM_CONC files (with each containing all hours for a given month) and either a corresponding set of MCIP files (or maybe a single set of MCIP files covering all 7 months), you could write your script to

  • loop over the seven months
  • within the loop, set the SDATE, STIME, and RUNLEN environment variables to the appropriate values for that month (commenting them out might also work, but I don’t recall for sure how the code would behave if your input files don’t cover the same time period, e.g. if you had months-long CCTM_CONC files and 7-months-long MCIP files).
  • specify the appropriate CCTM_CONC and MCIP input files within the loop
  • specify the same name for the BNDY_CONC_1 output file within the loop (i.e. don’t change that name while looping over months)
  • call the BCON executable within the loop (i.e. the script will make seven calls to BCON)

If setting up a loop that utilizes month-specific SDATE, STIME, and RUNLEN variables (via arrays or if/then statements) is too complex, you could just manually run the script seven times, each time editing the SDATE, STIME, and RUNLEN variables and pointing to the appropriate CCTM_CONC and MCIP files while not modifying the BNDY_CONC_1 output file name

I will trying to write a loop script. If you can offer me some example, that will be better. Thank you so much!

I don’t have an example script using months-long input files, so I can only provide the general guidance above.

Anyway,it helps a lot. I will give it a try. Thank you Christian.

@cjcoats reminded me that you should be able to use the I/O API File-Set File Lists feature (REAL FILES, PARALLEL FILES, AND "VIRTUAL FILES") to accomplish what you want to do in a single BCON run.

Assuming you have seven monthly CCTM_CONC files with hourly data, you could use

setenv CONC_04 /path/to/file/CCTM_CONC_201204.nc
setenv CONC_05 /path/to/file/CCTM_CONC_201205.nc
setenv CONC_06 /path/to/file/CCTM_CONC_201206.nc
setenv CONC_07 /path/to/file/CCTM_CONC_201207.nc
setenv CONC_08 /path/to/file/CCTM_CONC_201208.nc
setenv CONC_09 /path/to/file/CCTM_CONC_201209.nc
setenv CONC_10 /path/to/file/CCTM_CONC_201210.nc
setenv BNDY_CONC_1  LIST:CONC_04,CONC_05,CONC_06,CONC_07,CONC_08,CONC_09,CONC_10

Thanks, I can use this technique also on icon. Is that right?

If it works for BCON, it should work for ICON, too. But I’m not sure I understand the motivation for creating ICON files for multiple dates - typically would would want to use CCTM_CGRID files rather than files generated by ICON to initialize the CCTM.

The main reason cause my domain and meteorology file. So the ready CCTM_CGRID file cannot work for me.

one weird thing for me here is that BNDT_CONC_1 should be output file right?

I am not sure what you mean by “ready CCTM_CGRID” file. My point was that once you start running your CCTM simulation on your own domain, at the end of that simulation CCTM will create a CCTM_CGRID file for your domain, and you should then use that file rather than a file generated by ICON to restart your simulation. I probably don’t understand the details of how obtained or generated your input files and what you are trying to model, though.

Apologies, my bad. In the list file example above, it should have said

 setenv CTM_CONC_1 LIST:CONC_04,CONC_05,CONC_06,CONC_07,CONC_08,CONC_09,CONC_10

not

setenv BNDY_CONC_1  LIST:CONC_04,CONC_05,CONC_06,CONC_07,CONC_08,CONC_09,CONC_10

You are correct that BNDY_CONC_1 should be used to specify the output file.