geoschem / CAM

Community Atmosphere Model
Other
0 stars 0 forks source link

Fixes for compatibility with SE dycore #37

Closed jimmielin closed 2 days ago

jimmielin commented 1 week ago

This is a companion PR to https://github.com/geoschem/geos-chem/pull/2366 -- this must be added to GEOS-Chem first to enable State_Grid%ID and State_Grid%ROOT_ID

Problem cause

CAM_PIO_OPENFILE is a collective operation and on SE grids the assumption that all CPUs have the same # of chunks does not work. This assumption was implicitly made in photolysis_init.

This works for drydep_mod because CAM_PIO_OPENFILE is called by each CPU and not per chunk, but for photolysis_init it is called by chunk because it populates fields in State_Chm.

Fix

This update changes photolysis_init to only run on the first chunk in each CPU. This is made possible by letting GEOS-Chem be aware of which chunk it is running on via State_Grid%ID.