File data input for console EPIC (.ops, .sol, .wnd, .wp1)

46 views
Skip to first unread message

Daniel Kurniawan

unread,
Sep 29, 2016, 10:31:24 AM9/29/16
to EPIC / APEX Modeling Forum

I have a question about generating the file input required for console EPIC. If we want to create EPIC run on a specific region using the console EPIC, how do we generate / get all the necessary input files? I am talking about Filename.ops files for operation schedule, Filename.sol for soil data, Filename.wnd for Wind Weather Station data and Filename.wp1 for Weather station data. How can we convert the raw data from USDA / NOAA to those appropriate format?

Please refer to the attached figure for the file data structure of console EPIC that I am refering to

Luca

unread,
Oct 3, 2016, 11:36:14 AM10/3/16
to EPIC / APEX Modeling Forum
Daniel,

When creating new input text files you can use the names you want. I will try to give you an example using the operation file as starting point.
Within the EPIC folder you will find a file called EPICFILE.DAT. That file contains a list of name of files such as: SITECOM.DAT, WPM1US.DATCROPCOM.DAT, TILLCOM.DAT, OPSCOM.DAT, etc.... You can find the corresponding files in the EPIC folder. If you open those files you will see that they are a list of name of other files.
Going back to the example, the OPSCOM.DAT file contains a list of files with the management information. So, if you create a management file and you named that file "corn1.OPC" you must add an entry in the OPSCOM.DAT file with the progressive number and the name corn1.OPC.

To give you a quick overview about how the model works...
1) the model reads the EPICRUN.DAT file, reads the name of your simulation and then it starts reading the input files that you want to use... (for example: SIMULATION_X        3    4    1    3    3    6    4)
2) the firs number is for the site file: the model open the SITECOM.DAT file and looks for the number of the site file (in this case 3)
3) the model reads the name of the file corresponding to the file number 3 and looks for that file in the working direcotry
4) the model opens the file and reads all the information.
5) the process is repeated for all the others input files...

Does it make sense?
Let me know if you need more information.
Luca



Daniel Kurniawan

unread,
Oct 4, 2016, 9:12:25 AM10/4/16
to AgriLifeRese...@googlegroups.com
Hello Luca,

Yes I understand what you are saying. But my question is: how can you create files like corn1.OPC? I understand that we need to add an entry in OPSCOM.DAT file with the progressive number and I think it's pretty simple. But the problem is creating the corn1.OPC with all the information inside about corn operation. The default epic files downloaded from the epic website does not provide us with that too. I know that the manual informed us about the meaning of each columns and what kind of information you should put there. But the manual does not explicitly explain the methodology of generating the input files. So what's the best way to create such files with real-world data if we want to run a simulation for a certain region?

Luca

unread,
Oct 4, 2016, 7:48:16 PM10/4/16
to EPIC / APEX Modeling Forum
I think that the easiest way (or the more user friendly way) to create all the input files required by the model is using the WinEPIC interface. In this way the interface will take care of create the text files placing in the right file and right position all the information provided.
If you want to work directly with the text files you have two options: 1) you can use a tool developed by Dr. Javier Osorio here at the BREC to edit the text files using Excel. You can find the editor at this link. 2) You can work with any text editor and edit directly the text files.

I am not sure I answered your question. If you need more detailed information on the input files don't hesitate to write again and I will be happy to help you.
Luca

Daniel Kurniawan

unread,
Oct 5, 2016, 12:43:30 AM10/5/16
to AgriLifeRese...@googlegroups.com
WinEPIC interface will format its input as a microsoft access database. Is there any easy way to convert microsoft access database into text files like corn1.OPC?

I have actually looked at those editor developed by Dr. Javier Osorio before. However, if we want to create all the inputs for a certain location, then it would be virtually impossible to create the input manually with that method. We would need to create hundreds of files, and each files will have multiple parameters that we need to edit.

So, I was actually looking for a tool that can automatically convert soil / weather database provided by USDA / NOAA to an appropriately formatted epic input. I was looking for a tool that is able to convert soil raw data from USDA to multiple filename.sol files for each soil type, or a tool that is able to convert weather raw data from NOAA to multiple filename.wp1 for each weather station.

I am asking this question because I want to create multiple runs on a region to simulate spatial variation based on spatial data input. So, I will need all the inputs (soil, weather, etc.) for those region. I see that console EPIC is the better way to automate this process than WinEPIC.

I hope my questions make sense. Thank you for your help!

Luca

unread,
Oct 5, 2016, 6:24:43 PM10/5/16
to EPIC / APEX Modeling Forum
Daniel,
Now your question is clear to me.
We don't have a tool that can help you in automatically create the input files starting from a database or any other source of data. What I can suggest you depends by your programming skills. Do you know any programming language or are you familiar with programming?

A little add on to the first part of your previous message. The WinEPIC interface is linked to the Access database were all the input data are added. This is only the first step. Avery time you hit the "RUN" button the interface reads the Access database and create the text files required by the model. You can find all the text files in the folder C:\WinEPIC\EPIC (this is the default directory)

Luca

Daniel Kurniawan

unread,
Oct 5, 2016, 7:04:39 PM10/5/16
to AgriLifeRese...@googlegroups.com
Yes, I can safely say that I am fairly adept at programming, you don't have to worry about my programming skills. I would assume that we would need to write a script to read the data from the database, and write it as a formatted epic input. That's what I am thinking roughly. Can you fill in the details so that I can move in a right direction? What kind of approach would you suggest? I can work with any programming language.

Oh, I just realized that the console epic is embedded inside the WinEPIC folder. This might actually be helpful because I already have the complete data in the form of access database. I would need to find a way to convert those data in the access database to files such as corn1.ops. In the end, I would like to use those file to create an multiple run simultaneously using the console EPIC. However, we need to hit the "RUN" button to create a single text file for specific soil, weather and operation, right? I don't think that this approach is practical since it means that we need to press the "RUN" button multiple times to get all the input files for a certain region.

Luca

unread,
Oct 6, 2016, 6:26:06 PM10/6/16
to AgriLifeRese...@googlegroups.com
Yes, what I was thinking: you will have to write your own program to read the database and write the required input files.
About the programming language if you want to use an Access database you must use a language that is able to read an Access file.

Then, the idea of hitting the RUN button was only to create a first set of data input data in order to have an example of how each file looks like. Keep in mind that EPIC will read some files using a free format and other using a fixed format so, the position (line and column) of each variable in a file can be really important.

To do what you need I would write a program able to:
  • create an EPICRUN.DAT file with a line for each run. Each line will have a different name so the outputs will be saved in different files (the name of the output files is the name used for each run).
  • create the SITECOM, WPM1US, WIND, SOILCOM, OPSCOM, and, WDLSTCOM files automatically assigning different names to the different sites, weathers, etc reading the information from the database.
  • create the corresponding site, weather, and operation files reading the information from the database ad assigning the proper names used in the *.DAT files.

If you can get to this point then you can run the model directly from the console and EPIC will run all the simulation included in the EPICRUN file.


Luca

Daniel Kurniawan

unread,
Oct 6, 2016, 7:39:25 PM10/6/16
to AgriLifeRese...@googlegroups.com
Thank you very much for the information, I really appreciate your helpfulness! I think I have already had a clear idea on how to approach this thanks to you.

One more thing that I want to clarify: So, do you recommend reading the WinEPIC access database to create those files? Right now, I only have the WinEPIC Access Database for Texas Central (default) and Wisconsin (I requested the epic developers few months ago). I might need to request another WinEPIC database to the EPIC developers if I want to run the EPIC model on different region. I would imagine that reading the USDA database directly for soil and the NOAA database for weather will be exponentially harder. But I guess that creating a script that can read USDA and NOAA database and convert it into EPIC input can give a more accurate and up-to-date data and it will be more "robust" (what if the WinEPIC database for a region that I want to model is unavailable?). Do you think that the increased difficulty of reading USDA and NOAA database directly is worth it?

Luca

unread,
Oct 10, 2016, 10:03:33 AM10/10/16
to EPIC / APEX Modeling Forum
Hi Daniel,

Honestly I don't know if reading the data directly from the Access database can be the best solution. It is a possibility for sure. you can explore is there is a way to export data from Access to .csv files and work with the .csv data instead.
Starting with a WinEPIC database you will have some information already inside the database. So, let me know if you need the WinEPIC database for another region.

About the possibility to create the weather and soil files starting from the NOAA and USDA databases, it should be feasible, but I am not familiar with those databases so, I can't give you a honest opinion about the difficulty of using them t create the files required by the model.

Luca
Reply all
Reply to author
Forward
0 new messages