columncolab / EMC2

Earth Model Column Collabratory
BSD 3-Clause "New" or "Revised" License
10 stars 7 forks source link

Subcolumn generator flips the indices of qc in subcolumns, resulting in wrong output #96

Closed isilber closed 1 year ago

isilber commented 2 years ago

I noticed this issue when running EMC^2 on LES output snapshot (no time dimension) using the microphysics logic (no issue to my knowledge in radiation logic.) I added the automatic addition of a time dimension in one of my recent commits (#7594aac87990a71dce294417b2c0d187ac0a3e78), and this works well, so the issue is not the lack of time dimension in the raw LES output file. The issue only appears when the subcolumn generator is called and is only shown in the qc field. Below are two q_hyd plots: one uses the raw LES output while the second shows the subcolumn q fields after I processed the LES output using EMC^2 with two subcolumns (file and notebook are attached). You can see that the values match as well as the spatial structure in all hydrometeor classes except for qc. raw_LES: LES_out_raw_q

emc2_LES: LES_out_emc2_q

I originally saw that when I ran EMC^2 with N_sub = 1, but since then I have implemented an option to truly automatically skip the subcolumn generator when N_sub = 1 (pull request #95 f7417f1ffa16b565a0010eb081bdc36f4efdb612), and this works well, but this issue would certainly impact similar cases with CRM models for example (e.g., WRF), in which we would use the subcolumn generator. @rcjackson I would appreciate your help on this because based on this analysis the issue is most likely related to the qc treatment block in the 'set_q_n' method, which is only called in the microphysics logic run. I think that since you wrote that block of code, which could use some comments :), it would be much easier for you to address that issue, which could be critical in certain cases. Thanks!

test_les_emc2.zip

isilber commented 1 year ago

This issue is now resolved