ccpp-framework icon indicating copy to clipboard operation
ccpp-framework copied to clipboard

capgen needs to be able handle blocked data (80 hours)

Open gold2718 opened this issue 5 years ago • 3 comments

Many models (e.g., UFS, CAM6) have blocked data structures where each 'block' is a DDT that contains field arrays.

  • A task's horizontal_dimension is made up of the collection of the field sections from each block.
  • During the _run phase, one 'block' is passed to the suite so horizontal_loop_extent becomes the number of columns in that object.
  • During the _init or _final phases, schemes expect a flat array containing horizontal_dimension columns.

capgen needs to support this data model.

gold2718 avatar Jul 23 '20 16:07 gold2718

To handle module variables (i.e., suite variables), the _init routine must be passed the size of the horizontal extent of each block.

gold2718 avatar Apr 06 '21 22:04 gold2718

If a host model has ccpp_block_number (number of current block), ccpp_block_count (how many blocks are there in total), ccpp_block_sizes (array of length ccpp_block_count that contains the sizes of all blocks), then assume we are dealing with a blocked host model and create the infrastructure to handle blocked data.

gold2718 avatar Apr 06 '21 22:04 gold2718

Copied from #386:

capgen needs to be able to correctly create the host cap interfaces, depending on the phase:

  • init, timestep_init, timestep_final, or final:
    • horizontal_dimension is the total number of columns on the task
    • On entry, create a flattened version of each field with horizontal_dimension columns.
    • On exit, copy the flattened data back to the DDT array for intent(inout) and intent(out) fields.
  • run:
    • For each thread, pass the field array from one element of the DDT array
    • horizontal_loop_begin is typically 1 and horizontal_loop_end is typically the number of field columns in that array element

gold2718 avatar Aug 16 '21 03:08 gold2718