DSSAT Archives

DSSAT - Crop Models and Applications

DSSAT@LISTSERV.UGA.EDU

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Lyndon Estes <[log in to unmask]>
Reply To:
Lyndon Estes <[log in to unmask]>
Date:
Mon, 7 Jun 2010 22:06:46 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (95 lines)
Hi Kendall,

I don't know if I understand exactly what you are trying to do, but you can
run the Cropping System Model (of which CERES Maize is a part) in batch mode
from command line. After running an experiment through the DSSAT shell, look
in the maize folder:

C:\DSSAT4\Maize

You should see a file called DSSBatch.v4 or something like that.  If you
open this up, you will see something like this:

$BATCH(MAIZE)
!
! Directory    : C:\DSSAT45\maize
! Command Line : C:\DSSAT45\DSCSM045.EXE MZCER045 B DSSBatch.v45
! Crop         : Maize
! Experiment   : UFGA8201.MZX
! ExpNo        : 1
! Debug        : C:\DSSAT45\DSCSM045.EXE MZCER045 " B DSSBatch.v45"
!
@FILEX
TRTNO     RP     SQ     OP     CO
C:\DSSAT45\maize\UFGA8201.MZX                            1        1
0        0       0

Note that the above is for DSSAT4.5 (the version I am using) rather than
DSSAT4, but the basic contents should be the same, I imagine (I don't
currently have it installed, so can't check this).

The line "!Command Line..." references the executable you need to call from
command line, the specific crop model, the mode (B for Batch, S for spatial,
etc.), and the Batch file, and you will see the batch file references the
names of the filex for the specific experiment you wish to run, and the
number of treatments within that experiment. Th filex references the
specific soils, weather data, management variables, etc. that you need to
run the model.  These commands and files give you what need to run the
program from a DOS prompt.

The solution I am going to use is slightly different, but it might be
relevant to you since you wanted to use Matlab.  In my case, I am using R,
and you can use R to run the same experiment using the following lines:

***************************************************************************
workingdir<-"C:/DSSAT45/maize"
# Note that R, even within Windows, uses forward slash in file-paths

setwd(workingdir)

comstring<-'C:/DSSAT45/DSCSM045.EXE B DSSBatch.v45'

system(comstring,intern=FALSE,wait=TRUE)  #Call to run CSM within R

***************************************************************************

Again, note that I am using version 4.5 rather than 4, but it should still
work the same with version 4.

With this approach, you can use R to assemble your Filex and batch files,
feed them into the system call displayed above, and then take the model
output and manipulate it into a format that suits your needs.

I imagine Matlab could be used in a similar fashion to run the model,
manipulate the output etc.

Hope it helps.

Cheers, Lyndon





On Mon, Jun 7, 2010 at 8:17 PM, Kendall DeJonge <[log in to unmask]>wrote:

> About a week ago, I asked about running DSSAT4 (specifically, CERES-Maize)
> using Matlab code, and received no responses.  I have created code to meet
> my needs in VBA and Excel, but I am currently running DSSAT through the GUI
> interface and automated keystrokes from VBA.  It would be much more stable
> and fast if I could simply execute the required files. It would be a great
> help if someone could indicate exactly what files are needed to execute the
> code for CERES-Maize?
>
> Thank you,
>
> --
> Kendall DeJonge, P.E.
> Ph.D. Graduate Student
> Civil and Environmental Engineering
> Colorado State University
>
> "Do.  Or do not.  There is no try."
> -Yoda
>

ATOM RSS1 RSS2