Fix threading and pe-layout NBFB issues in UCI-chem codes - #69
Conversation
. Fixed array shape pdeldry in lin_strat_chem.F90 that would failed debug mode . Replaced ch4max calculation with a global constant. A tentative fix for NBFB that would otherwise have . Fixed codes for surface emission section in mo_gas_phase_chemdr.F90 that cause round-off NBFB when threading or pe-layout changes [NBFB]
| *pdeldry(:ncol,k)*rga | ||
| tmp(:ncol) = wrk(:ncol,k) + cflx(:ncol,m)*delt/dble(srf_emit_nlayer) | ||
| vmr(:ncol,k,n) = tmp(:ncol)*mbar(:ncol,k)/adv_mass(n)/pdeldry(:ncol,k)/rga | ||
| wrk(i,k) = adv_mass(n)*vmr(i,k,n)/mbar(i,k) & |
There was a problem hiding this comment.
@wlin7 I understand you modification. But I just curious why wrk(:,k) can cause issue. I mean we have a lot fortran code like this
There was a problem hiding this comment.
@keziming , this is explained in more detail on the special meeting note page. (number 25 of the first table there). The problem is not with wrk itself. The problem is, for columns with cflx=0, vmr should not change. But in the old array operation format, via wrk, vmr is converted back and forth. Analytically, the multiplier followed by multiplying the inverse of the multipliers should cancel out. But in floating calculation, the round-off during each arithmetic operation causing the cancellation to be not exact. When threading or pe-layout change, where (in terms of chunks) the cflx=0 columns belong would change, for example, from a chunk with all cflx=0 to a chunk with partially non-zero, the zero cflx column would see NBFB due to the round-off.
jinboxie
left a comment
There was a problem hiding this comment.
This is similar to what we have done. The new commit has no ch4max as fixed.
|
@wlin7 Thank you for this explanation. |
|
Closed and use #70 instead. |
. Fixed array shape pdeldry in lin_strat_chem.F90 that would failed debug mode . Replaced ch4max calculation with a global constant. A tentative fix for NBFB
that would otherwise have
. Fixed codes for surface emission section in mo_gas_phase_chemdr.F90 that
cause round-off NBFB when threading or pe-layout changes
[NBFB]