Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

[FEATURE REQUEST] Add toggle for calling UPDATE_SUN, UPDATE_RCONST within integrator step #5

Open
yantosca opened this issue Jun 7, 2021 · 5 comments
Assignees
Labels
feature New feature or request

Comments

@yantosca
Copy link
Contributor

yantosca commented Jun 7, 2021

@RolfSander wrote:

Indeed, calling UPDATE_RCONST several times (i.e., once for each KPP substep) is often not necessary. It's good to have the option to switch that off. Maybe this could be implemented via a currently not-used element in the ICNTRL array, e.g.:

IF (ICNTRL(15)==1) THEN
    CALL Update_SUN()
    CALL Update_RCONST()
ENDIF
@yantosca
Copy link
Contributor Author

yantosca commented Jun 7, 2021

@RolfSander, thanks for this. I had removed those calls from the integrator files but this is an easy way to be able to toggle these calls. I'll add this into the next KPP update.

@yantosca yantosca self-assigned this Jun 7, 2021
@yantosca yantosca added the feature New feature or request label Jun 7, 2021
@RolfSander
Copy link

After taking a closer look at these subroutines, I think that Update_SUN is probably never necessary. I guess it would be sufficient to use the ICNTRL(15) switch only for Update_RCONST:

IF (ICNTRL(15)==1) THEN
    CALL Update_RCONST()
ENDIF

yantosca added a commit that referenced this issue Jun 10, 2021
Following Github issue github/KPP #5, we have re-added the calls to
UPDATE_RCONST within all of the Fortran-90 integrators.  These will
only be activated if KPP input parameter ICNTRL(15) = 1.

Normally for GEOS-Chem and other external models, we do the rate updates
outside of KPP for computational expediency.
@yantosca
Copy link
Contributor Author

This is now done in commit e7540d3. All of the F90 integrator modules have this IF statement that can toggle UPDATE_RCONST if the user wishes. This will go into the next KPP version.

I will close out this issue now.

yantosca added a commit that referenced this issue Jun 11, 2021
This commit follows Github issue geoschem/KPP #5.  If the user sets
the ICNTRL(15) slot to 1, then the routine Update_Rconst() will be
called from within the Rosenbrock solver.  Normally this option will
be disabled.

We will modify the other solver files accordingly, but the Rosenbrock
solver is the only one used for GEOS-Chem, so we focus on this one
first.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca
Copy link
Contributor Author

My updates actually broke KPP so I went back to the GC_updates branch and started a new dev branch. In commit 342a4ac I added the call to Update_RCONST if ICNTRL(15)==1 only to the F90 Rosenbrock integrator file (int/rosenbrock.f90) since that is what GEOS-Chem users. As time allows, I'll make the similar edits into the other F90 integrator files.

It was more complex than I thought, I had to pass a logical flag with the value of (ICNTRL(15)==1) that down a few levels from the ros_Integrator routine. Straightforward but I didn't have time to do that for the rest of the code. I'll reopen this issue to denote that this still has to be done for the other integrator files.

@yantosca yantosca reopened this Jun 11, 2021
@RolfSander
Copy link

Hmm, I didn't realize that this would be so complex. An alternative for a quick implementation in the other solvers might be to declare

LOGICAL :: Do_Update_Rates

as a module-wide variable, i.e., before the CONTAINS statement of the module

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants