Hi, there ![]()
I have been optimize AERO for a while, and my concentration is ISOROPIA.
After some research upon the code and some ISOROPIA-II paper, some questions occurs and these question may become optimize points in time consume performance.
Let me introduce some BACKGROUND i learned from the code and paper first:
1、ISOROPIA treat different cases according to W(1-8),use different ISRP-N-F subroutines.
2、subroutine ISRP-N-F treat different cases according to SULFATE, RH and ion concentrations, use different calc cases( such as CALCAN, CALCBN…), we define them as CALC-CASE subroutines.
3、CALC-CASE call related funcs(we define them as FUNC-CASE funtions latter) in their bisection routine, like CALCA2 will call FUNCA2 to get the F(x) in its bisection routine. The bisection routine has an exit condition of ABS(X2-X1) .LE. EPS*X1
4、In FUNC-CASE functions, there exist an iteration routine to solve the ION balance problem, the ION balance problem rely on the activity coef, so every func will call CALCACT subroutine, which contains activity calculation.
Let take FUNCO7 as example to see the relation of func and activity coef. CMAQ/CCTM/src/aero/aero6/isofwd.f at 93099d8159f50e525120c790df674fe837a57edf · USEPA/CMAQ · GitHub
In line 7441 to 7443, we can found that var A4,A5,A6 rely on the Bromley equation result(GAMA), which is calculated in CALCACT. In the code we can count which GAMA is used in FUNCO7, the result is GAMA(5),GAMA(10),GAMA(11).
THE exit condition in FUNC-CASE functions’ iteration is CALAOU and CALAIN which is updated in CALCACT.
5、CALCACT treat different cases according to W(1-8), to call CALCACT1-4.
different CALCACT-N subroutines update different numbers of GAMA(N), and CALCACT4 update most(From GAMA(1) to GAMA(23)), CALCACT1 update least.
As a test result, I found that if branch goto FUNCO7, CALCACT always call CALCACT4, sometimes call CALCACT1.
As observed before, FUNCO7 only need GAMA(5),GAMA(10),GAMA(11) to update it’s A4,A5,A6.But the code in CALCACT4 calculated all the GAMA(1) - GAMA(23) using inquiry schedule in KMTAB.
Most of background is above. Now we can ask a question:
QUESTION![]()
In case FUNCO7, is all GAMA or G0 need to be updated?
MY opinion
In my opinion, some FUNC-CASEs do exist some redundant calc in the call of CALCACT from the code.
But in theorial, this redundancy need to be proved.
Any opinion wil be appreciated ![]()
Thank you for you reading.