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

[FEATURE REQUEST] Remove duplicate instances of defining nElements #191

Open
msulprizio opened this issue Mar 7, 2024 · 1 comment
Open
Assignees

Comments

@msulprizio
Copy link
Collaborator

Name and Institution (Required)

Name: Melissa Sulprizio
Institution: Harvard

New IMI feature or discussion

We're currently utilizing the code to compute the number of state vector elements in multiple locations, but we should move it into run_imi.sh to compute it just once. The code:

    nElements=$(ncmax StateVector ${RunDirs}/StateVector.nc)
    if "$OptimizeBCs"; then
	nElements=$((nElements+4))
    fi
    if "$OptimizeOH";then
	nElements=$((nElements+1))
    fi

can be found in:

  1. Routine setup_imi within src/components/setup_component/setup.sh
  2. Routine setup_kf within src/components/kalman_component/kalman.sh
  3. Routine reduce_dimension within components/statevector_component/statevector.sh
  4. Routine run_posterior within components/posterior_component/posterior.sh

However, to compute nElements, the state vector file is needed. When creating the state vector file within the IMI, it is currently created by calling create_statevector from within setup_imi. Moving the code for determining nElements out of setup.sh into run_imi.sh right after setup_imi is called would cause issues for routine setup_jacobian which uses nElements to determine how many run directories to create. One way around this is to remove the generation of the state vector file from setup_imi and into run_imi.sh. There may be other potential conflicts too, so we should think about how to do this more carefully.

@msulprizio msulprizio self-assigned this Mar 7, 2024
Copy link

github-actions bot commented Sep 4, 2024

This issue has been automatically marked as stale because it has not had recent activity. If there are no updates within 7 days it will be closed. You can add the "never stale" tag to prevent the issue from closing this issue.

@github-actions github-actions bot added the stale label Sep 4, 2024
@msulprizio msulprizio removed the stale label Sep 5, 2024
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

1 participant