Issue with .NCS file in EPIC to CMAQ step

I have FEST-C v 1.4 installed on a linux server. Each step appears to run without issue per the log files, but when I get to the EPIC to CMAQ step I get the following error:
Error: Crop ID 41 in NCS file /data/harkey/EPIC/epic/scenarios/2024_12US1/output4CMAQ/app/daily/41.NCS does not match inside RunName crop ID -21
(all the other .NCS files have been read at this point except for 42.NCS)

I tried running everything again but excluding beans (crop ID 41) to see if that was the cause of the error, and got the same error message as above.

The file given in the error message looks like 1824 lines of a repeated header row; and 42.NCS is the same (the other .NCS files either have data or are empty):
RUN NAME, LOCATION NAME, STATISTICAL WEATHER, STATISTICAL WIND, SOIL FILE NAME, OPERATION FILE NAME, LATITUDE, LONGITUDE, SOIL5#, ST, SOIL NAME, TEXTURE, LAYER 1, BD, WILT PT,FIELD C,POROCITY, PH, CATION EX,LAYER 2, BD, WILT PT,FIELD C,POROCITY, PH, CATION EX,

repeated

Am I correct to assume that it’s okay for 6.NCS (other grass) and 23.NCS (rice) to be empty, given Table 2 in the user manual shows them as N/A at the soil mapping step? The only other empty/blank .NCS file is 40.NCS–is this a problem? I didn’t see any issues related to canola in the log files.

What do you recommend that I check? I can’t tell if this error stems from the EPIC run itself or a previous step.

Thank you!

Yes, I believe this is normal. If you delete those repeated headers in those files to make them blank, epic2cmaq will run. I am not sure why this occurs, but I can report that I experience the same issue.

thank you!

I thought maybe this error was related to another issue I was seeing with the first step (solved here: Error with generateBeld4Data / computeGridLandUse_beld4 - #2 by mkharkey ), but I might’ve been too optimistic about how that fix would percolate through the rest of the steps.

At the soil match step, I’m seeing this:
==== Begin soil match run for crop BEANS.
==== Running step 1 …
150.155u 3.568s 2:34.17 99.7% 0+0k 0+1136io 0pf+0w
==== Running step 2 …
forrtl: severe (64): input conversion error, unit 21, file /data/harkey/EPIC/epic/scenarios/2024_12US1/BEANS/NONRISOIL1ST.DAT
Image PC Routine Line Source
SOILMATCH2ND.exe 000000000046902E Unknown Unknown Unknown
SOILMATCH2ND.exe 000000000046822E Unknown Unknown Unknown
SOILMATCH2ND.exe 0000000000447B7A Unknown Unknown Unknown
SOILMATCH2ND.exe 000000000043FD21 Unknown Unknown Unknown
SOILMATCH2ND.exe 000000000043F60E Unknown Unknown Unknown
SOILMATCH2ND.exe 000000000041784E Unknown Unknown Unknown
SOILMATCH2ND.exe 0000000000400CE5 Unknown Unknown Unknown
SOILMATCH2ND.exe 00000000004002FE Unknown Unknown Unknown
SOILMATCH2ND.exe 0000000000473600 Unknown Unknown Unknown
SOILMATCH2ND.exe 00000000004001E9 Unknown Unknown Unknown
0.686u 0.021s 0:00.71 98.5% 0+0k 0+32io 0pf+0w
==== Running step 3 …
0.753u 0.014s 0:00.77 98.7% 0+0k 0+16io 0pf+0w
==== Running step 4 …
0.716u 0.019s 0:00.73 98.6% 0+0k 0+16io 0pf+0w
==== Running step 5 …
0.769u 0.015s 0:00.78 98.7% 0+0k 32+16io 0pf+0w
==== Running step 6 …
0.729u 0.016s 0:00.74 98.6% 0+0k 0+16io 0pf+0w
==== Finished soil match run for crop BEANS.

BEANS/NONRISOIL1ST.DAT contains:
12050002 63 NONRI SOIL1107627711 0 42853
12050002 63 NONRI SOIL1107627711 0 42854
12050002 63 NONRI SOIL1107627711 0 43311
12050002 63 NONRI SOIL1107627711 0 43312
12050002 63 NONRI SOIL1107627711 0 43313
12050001 63 NONRI SOIL1107627711 0 43768
12050005 63 NONRI SOIL1107627711 0 43771
12050005 63 NONRI SOIL1107627711 0 43772
11120101 63 NONRI SOIL1107627711 0 44689
10260009 62 NONRI SOIL********** 0 63066
10260013 62 NONRI SOIL********** 0 63067
10260009 62 NONRI SOIL********** 0 63068
10260009 62 NONRI SOIL********** 0 63069

which is inconsistent with other NONRISOIL1ST.DAT files. Despite the string of asterisks I don’t think it’s a formatting issue, since the number after NONRI SOIL is usually a 3 digit number not a 10 digit number.

Hopefully this helps any future debugging. I really appreciate your response with your experience!

it looks like beans are missing in
/usr/local/festc1.4/epic/common_data/util/soilMatch/NRI-crop-codes-BELD4-codes.prn
(canola appears to be missing too)
Perhaps this is the source of the problem? Would it be correct to add in beans and canola codes per Table 1 in the user manual? Are there code comments for each that need to be added?

Edited to add:

NRI codes are from 2005, so after reading

and

canola is “all other close grown”, same as rye, so I gave it the same code as rye (501Asigned)
beans are listed as “all other veg and truck crops” same as edible beans–it could be code 19, but since edible beans are given code 501Asigned I decided to copy that, and added the following lines to the crop codes file:
60 Canola 60 501Asigned
61Canola_ir 61 501Asigned
62 Beans 62 501Asigned
63Beans_ir 63 501Asigned

--using the edited file in the soil match step led to a clean run of epic2cmaq without having to edit any .NCS files.

A similar error occurs when running EPIC to CMAQ for the spinup, too, so here’s what I did to fix that in case it helps anyone else:

    Error: Crop ID 23 in NCS file /data/harkey/EPIC/epic/scenarios/2024_12US1_test/output4CMAQ/spinup/daily/23.NCS does not match inside RunName crop ID 3:

--crop 23 is rice. I checked the NCS file from the spinup against the same for the EPIC app run, and the latter was blank. So I made blank copies of the 23.NCS and 23.NCD files for the spinup. The same error then came up for crop ID 6 (other irrigated grass), which also had blank .NCS and .NCD files for the EPIC app run. Once these two sets of files were blank EPIC to CMAQ spinup ran cleanly.