Skip to content

write.config.* functions duplicate job.sh setup logic — candidate for shared helper #3887

@Anurag-M1

Description

@Anurag-M1

While exploring write.config.BASGRA and write.config.SIPNET as part of
my interest in Project 4 (Standardizing Model Couplers) for GSoC 2026, I
noticed both functions contain identical blocks for:

  1. Loading the job template (template.job)
  2. Building hostsetup from settings$model$prerun and settings$host$prerun
  3. Building hostteardown from settings$model$postrun and settings$host$postrun
  4. Applying common substitutions into job.sh:
    • @HOST_SETUP@, @HOST_TEARDOWN@
    • @SITE_LAT@, @SITE_LON@
    • @START_DATE@, @END_DATE@
    • @OUTDIR@, @RUNDIR@

These could be extracted into a shared helper function (e.g. build_job_sh())
in a common location, reducing duplication and making it easier to add new
models consistently.

Is this a good direction to pursue? Happy to start with a draft implementation
if the team thinks this is worth addressing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions