Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run_glm requires that the nml control file be named glm2.nml #118

Open
jsta opened this issue Jul 11, 2017 · 4 comments
Open

run_glm requires that the nml control file be named glm2.nml #118

jsta opened this issue Jul 11, 2017 · 4 comments

Comments

@jsta
Copy link
Member

jsta commented Jul 11, 2017

I am interested in passing an arbitrarily named nml file ( glm2_foo.nml) to run_glm:

run_glm(sim_folder, args = "--nml glm2_foo.nml")

It seems that the GLM executable allows this:

$ glm --help

       ------------------------------------------------
       |  General Lake Model (GLM)   Version 2.0.4    |
       ------------------------------------------------
--help  : show this blurb
--nml <nmlfile> : get parameters from nmlfile
--xdisp : display temp/salt and selected others in x-window
--xdisp <plotsfile> : like --xdisp, but use <plotsfile> instead of plots.nml
--saveall : save plots to png files
--save-all-in-one : save all plots to png file
@jsta jsta changed the title run_glm requires that the nml contol file be named glm2.nml run_glm requires that the nml control file be named glm2.nml Jul 11, 2017
@jsta
Copy link
Member Author

jsta commented Jul 11, 2017

Might be difficult to otherwise validate the nml file without creating a circular dependency with glmtools...

@lawinslow
Copy link
Member

Does this combo work?
run_glm(sim_folder, args = "--nml glm2_foo.nml")

@jsta
Copy link
Member Author

jsta commented Jul 12, 2017

It only works if you also have a "glm2.nml" in the same folder because of the first line in the run_glm source:

if(!file.exists(file.path(sim_folder, 'glm2.nml'))){
    stop('You must have a valid glm2.nml file in your sim_folder: ', sim_folder)
}

@lawinslow
Copy link
Member

Ah, I think we did that to give the user more meaningful feedback. Otherwise they get a 127 return code or something and no other info.

We could add a parameter to that command which then either alters or skips that check. glm_file parameter or something like that. Then it would feed directly in to the paired --nml parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants