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

Unrecognized STDINFO variables prevent DSNOUT from being executed #47

Open
d-diaz opened this issue Oct 17, 2024 · 5 comments
Open

Unrecognized STDINFO variables prevent DSNOUT from being executed #47

d-diaz opened this issue Oct 17, 2024 · 5 comments

Comments

@d-diaz
Copy link

d-diaz commented Oct 17, 2024

I'm noticing a strange error on many simulations when an unrecognized location code or habitat code is populated with STDINFO keyword. Although the .out file gives warning and that default location or habitat code will be used, another error shows up that the DSNOUT keyword was used in the wrong context and was ignored:

DATABASE   DATABASE KEYWORDS:

********   FVS16 ERROR:  KEYWORD ENTERED IS USED IN WRONG CONTEXT AND WAS IGNORED.  RECORDS READ=  20

           DSNOUT DATA BASE CAN NOT BE REDEFINED. DSN FOR OUTPUT REMAINS: FVSOut.db

Here is are an example keyfile with an unrecognized habitat type you could use to reproduce this for the FVSpn variant:

STDIDENT
00162008020503007825141

STANDCN
31352649010690

STDINFO          609     41799
INVYEAR         2008

NOTREES

TIMEINT            0         5
NUMCYCLE           1

DATABASE
DSNOUT
bad_pn_habitat.db
SUMMARY            2
END

PROCESS
STOP

Here is an example keyfile with an unrecognized location code you could use to reproduce this for the FVStt variant:

STDIDENT
00162008020503007825141

STANDCN
31352649010690

STDINFO          404     41790
INVYEAR         2008

NOTREES

TIMEINT            0         5
NUMCYCLE           1

DATABASE
DSNOUT
bad_tt_location.db
SUMMARY            2
END

PROCESS
STOP

If I build FVS using an earlier version (commit b4c0599432f341cb0aa98c9334d03bdba47ebbb0), this error doesn't occur.

It seems like whatever bug is causing this behavior was introduced in commit fdb993b26e27c05093d64481654065aeb94d3f4a.

@DavidLRfs
Copy link
Collaborator

DavidLRfs commented Oct 17, 2024 via email

@d-diaz
Copy link
Author

d-diaz commented Oct 17, 2024

Thanks for the speedy reply, @DavidLRfs! I can confirm that this change resolves the errors I was encountering. Since these changes to errgro.f may require changes by any user with existing templates that may introduce errors or warnings above a call to DSNOUT to continue using FVS the same way, I wanted to ask if there is a way to adjust the changes to errgro.f to support backward-compatability? Would it be possible to cache errors and warnings encountered after the keyfile has been read for a stand before starting to write to DB?

@DavidLRfs
Copy link
Collaborator

DavidLRfs commented Oct 17, 2024 via email

@d-diaz
Copy link
Author

d-diaz commented Oct 17, 2024

Fair enough. Would recommend updating DBSUserGuide and/or FVS Keyword Guide to encourage users to specify DSNOUT above all other keywords because it may be ignored if any warning or error is raised. Probably worth mentioning in Release Notes that this is a potentially breaking change for users with existing keyfiles, but with a known workaround of putting DSNOUT first.

Hopefully the GUI will automatically insert DSNOUT at the top?

@DavidLRfs
Copy link
Collaborator

DavidLRfs commented Oct 17, 2024 via email

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