Skip to content

Introduce MPI-aware structure variables #712

Draft
SeanBryan51 wants to merge 12 commits intomainfrom
add-MPI-aware-structure-variables
Draft

Introduce MPI-aware structure variables #712
SeanBryan51 wants to merge 12 commits intomainfrom
add-MPI-aware-structure-variables

Conversation

@SeanBryan51
Copy link
Collaborator

@SeanBryan51 SeanBryan51 commented Mar 17, 2026

Sub-dividing the grid based on the number of MPI ranks available is key to enabling parallelism in CABLE. This change achieves this by introducing several new local structure variables to describe the grid information local to the current MPI rank. These are mp, mland, land_x, land_y, land_decomp_start, land_decomp_end, patch_decomp_start, patch_decomp_end and landpt. Global structure variables are also introduced to describe the grid of the global simulation domain, irrespective of the current MPI rank, as this information is necessary for deriving several local structure variables and for generating parallel I/O decompositions. These are mland_global, land_x_global, land_y_global, mp_global and landpt_global.

This change also updates constant arrays which are initialised in open_met_file to be stored on the global land grid on each MPI rank. This is required for correctly initialising global structure variables such as landpt_global which is dependent on the latitude and longitude coordinates of each grid cell in the global simulation domain. These variables are:

  • cable_iovars.F90:latitude(mland_global)
  • cable_iovars.F90:longitude(mland_global)
  • cable_iovars.F90:vegtype_metfile(mland_global, nmetpatches)
  • cable_iovars.F90:vegpatch_metfile(mland_global, nmetpatches)
  • cable_iovars.F90:soiltype_metfile(mland_global, nmetpatches)
  • cable_iovars.F90:PrecipScale(mland_global)
  • cable_input.F90:elevation(mland_global)
  • cable_input.F90:avPrecip(mland_global)

Note that for the legacy MPI case, the MPI group used to initialise the structure variables on the master driver will always be a single rank group as the master driver will only perform serial I/O.

This change should go in after #706.

Type of change

Please delete options that are not relevant.

  • New feature
  • New or updated documentation

Checklist

  • The new content is accessible and located in the appropriate section
  • I have checked that links are valid and point to the intended content
  • I have checked my code/text and corrected any misspellings

Testing

  • Are the changes bitwise-compatible with the main branch? If working on an optional feature, are the results bitwise-compatible when this feature is off? If yes, copy benchcab output showing successful completion of the bitwise compatibility tests or equivalent results below this line.

  • Are the changes non bitwise-compatible with the main branch because of a bug fix or a feature being newly implemented or improved? If yes, add the link to the modelevaluation.org analysis versus the main branch or equivalent results below this line.

Please add a reviewer when ready for review.


📚 Documentation preview 📚: https://cable--712.org.readthedocs.build/en/712/

@SeanBryan51 SeanBryan51 changed the title Add mpi aware structure variables Introduce MPI-aware structure variables Mar 17, 2026
@SeanBryan51 SeanBryan51 force-pushed the add-MPI-aware-structure-variables branch from 402b9db to 700c8c4 Compare March 17, 2026 03:25
@SeanBryan51 SeanBryan51 force-pushed the add-MPI-aware-structure-variables branch from 700c8c4 to ec42d55 Compare March 20, 2026 06:41
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.

1 participant