Firstly, I apologize for not replying long ago!
In a sense, there isn't a single location where output variables are populated; rather, different variables are computed at different points in each model time step, and when we write model output files, the memory that holds these variables is passed directly to the PIO library
. The memory that is allocated to each model variable can be referenced through a data structure that we refer to as a "pool" in MPAS, and so I think it would ultimately be simplest to obtain pointers to variables from these pools at the point where we write output streams in the main time step loop. In the mpas_atm_core.F
module, there's a call to mpas_stream_mgr_write
that is responsible for writing model variables to output streams (files), and you could add code around that same point in the timestep.
In case it helps, there are lecture slides about MPAS software infrastructure
that may be helpful in understanding how to access model variables through pools.