This PR fixes a bug related to cloud calculations.
The previous code used argmin to determine the intersection between the T-P profile and a condensation curve. However, this sometimes picks up the minimum value even if it is not at the intersection, as shown in the orange line in the figure.
Therefore, I changed it to searchsorted, which solved the problem. I confirmed that this function is differentiable.
By default, the intersection was found only when the ascending array was input, which is probably physically correct.
This PR fixes a bug related to cloud calculations.
The previous code used
argmin
to determine the intersection between the T-P profile and a condensation curve. However, this sometimes picks up the minimum value even if it is not at the intersection, as shown in the orange line in the figure.Therefore, I changed it to
searchsorted
, which solved the problem. I confirmed that this function is differentiable. By default, the intersection was found only when the ascending array was input, which is probably physically correct.