capgen needs to be able handle blocked data (80 hours)
Many models (e.g., UFS, CAM6) have blocked data structures where each 'block' is a DDT that contains field arrays.
- A task's
horizontal_dimensionis made up of the collection of the field sections from each block. - During the
_runphase, one 'block' is passed to the suite sohorizontal_loop_extentbecomes the number of columns in that object. - During the
_initor_finalphases, schemes expect a flat array containinghorizontal_dimensioncolumns.
capgen needs to support this data model.
To handle module variables (i.e., suite variables), the _init routine must be passed the size of the horizontal extent of each block.
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.
Copied from #386:
capgen needs to be able to correctly create the host cap interfaces, depending on the phase:
init,timestep_init,timestep_final, orfinal:horizontal_dimensionis the total number of columns on the task- On entry, create a flattened version of each field with
horizontal_dimensioncolumns. - On exit, copy the flattened data back to the DDT array for
intent(inout)andintent(out)fields.
run:- For each thread, pass the field array from one element of the DDT array
horizontal_loop_beginis typically1andhorizontal_loop_endis typically the number of field columns in that array element