Skip to content

SIP78 Convert switches to run time options part 3#114

Merged
dlebauer merged 29 commits into
masterfrom
SIP78_convert_switches_to_run_time_options_part_3
Jul 16, 2025
Merged

SIP78 Convert switches to run time options part 3#114
dlebauer merged 29 commits into
masterfrom
SIP78_convert_switches_to_run_time_options_part_3

Conversation

@Alomir

@Alomir Alomir commented Jul 7, 2025

Copy link
Copy Markdown
Collaborator

This PR:

  • converts all remaining compile-time switches to run-time options
  • updates help text
  • adds validation check for conflicting option settings
  • enables all smoke tests
  • removes additional dead code from sipnet.c
  • adds soilBreakdown() required by LITTER_POOL
  • updates src/sipnet/sipnet.in to show all possible options in that file
  • updates cli-options.md
  • updates CHANGELOG.md

Most of the changed lines are from replacing two of the smoke test expected output files. Files of interest for reviewing:

  • docs/*
  • src/*
  • tests/smoke/run_smoke.sh
  • tests/smoke/*/sipnet.in

Note: in that "removes additional dead code" bucket, the following variables/params/functions got trimmed. The TrackerVars get set but are never accessed outside of that. I suspect that these were used by functions/modes that themselves have been removed. I did not remove obsolete params, as I worry that will cause I/O problems with sipnet clients; they have been marked as obsolete in the code.

  • TrackerVars fa, fr, plantWoodC, and LAI
  • functions simpleWaterFlow, transSoilDrainage

@Alomir Alomir marked this pull request as ready for review July 10, 2025 21:49
@Alomir Alomir requested review from dlebauer and infotroph July 10, 2025 21:49
@Alomir Alomir linked an issue Jul 11, 2025 that may be closed by this pull request
Comment thread src/sipnet/sipnet.c
@Alomir Alomir linked an issue Jul 14, 2025 that may be closed by this pull request

@dlebauer dlebauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very impressive PR - this is a major enhancement that will make SIPNET much more user friendly, make it easier to compare different model formulations for both testing and theoretical inquiry.

Regarding obsolete parameters - some of my earlier comments may themselves be obsolete. Based on our Slack conversation, the next steps are to remove:

  • obsolete parameters remove them from the code, and treat them the same as we do for sipnet.in: if we hit a param we don't know about, give a warning and continue on..
  • unused variable soilWetness from .clim file - this will change the format of the weather (.clim) file and require changing the function that reads climate data.

These tasks can be written up in an issue and set to low priority, perhaps labeled 'good first issue'.

When adding to the `long_options` struct in step 3(i), give an int value as the last element of the the new
struct. This is the index that should be used in the `parseCLIArgs()` switch statement for handling the new
option. The int value must be unique among the other case labels.
## Function/Macro Reference

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like a sentence could help orient the reader, e.g. 'When adding a new CLI option, these functions and macros should be used to ...' perhaps also a brief description under each function or macro.

Comment thread src/common/context.h
// For convenience
#define FILENAME_MAXLEN CONTEXT_CHAR_MAXLEN

// 3? Do we need an upper bound?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is reasonable to set an upper bound because this constrains model's structure to what has already been published. I don't think it is necessary to set this bound if the model can scale to >3 pools, but at the same time it isn't a priority at this point, and would be easy enough to change this setting in the future.

Comment thread src/sipnet/sipnet.c

@dlebauer dlebauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested

  • resolve comments
  • create new issue for unused / obsolete params
  • merge #123 (update parameters.md as appropriate)

@Alomir

Alomir commented Jul 15, 2025

Copy link
Copy Markdown
Collaborator Author

Issue created: #124

dlebauer and others added 3 commits July 16, 2025 09:56
…123)

* Update docs/parameters.md to reflect deprecated and obsolete params

* documented run-time arguments
@Alomir Alomir requested review from dlebauer and infotroph July 16, 2025 14:29

@dlebauer dlebauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@dlebauer dlebauer merged commit 0bac82b into master Jul 16, 2025
7 checks passed
@dlebauer dlebauer deleted the SIP78_convert_switches_to_run_time_options_part_3 branch July 16, 2025 15:14
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

Successfully merging this pull request may close these issues.

Convert SIPNET compile-time flags to run-time options

3 participants