-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup of integrator files #40
Comments
Thanks @RolfSander, I think it is a good idea to check for consistency between the integrator options. Just the other day I ran into an issue because the GEOS-Chem interface was expecting the Nhnew parameter to be found in the integrator file (which is true if you are using rosenbrock but not if you are using feuler). So that led to a compile time error. There may be other things like that to sort out. If you can take the point on it, that would be great. You may be right, we might not need I think some of the integrators that use It'd be great to merge the rosenbrock options. I'd have to take a look to see if they are the same file but with just different ICNTRL settings. If so we can merge that in. |
Yes, I'll work on this.
I think that's okay because in gen.c we have:
I have renamed them.
Here's a quick overview:
Further differences between the files are:
Merging the Rosenbrock files is certainly worth the effort, but I think |
I removed the trivial differences (whitespace etc.) between I think it should be straightforward to merge Regarding |
@RolfSander , are you not sure about merging rosenblock_split.f90 into rosenbrock.f90? It doesn't seem straightforward. Computationally, I think it's cleaner to keep it separate, since it is driven by different preprocessor output, and I've been religiously avoiding branching statements (if else). |
I see your point @msl3v.
An alternative could be that we insert a placeholder like The reason why I prefer a unified file is that I fear that |
Re. branching: I don't know how much of an impact it would have. Though my understanding is that, using IF (split) THEN the compiler would try to preload Fun_Split in every iteration, which would definitely slow things down if (.not. split). Having KPP overwrite something like _KPPFUNCTION is a great idea! Indeed this approach in general would allow really fine control of the code structure w/o introduction of CPP tags or branching statements. |
OK, then let's use this approach for Fun_Split and Fun!
Yes, we can use this whenever we need to modify something in the |
@RolfSander: I have run into an issue with the radau5.f90 integrator. The function radau90_Rates.f90:133:30:`
133 | k_3rd_jpl_activation(ASSOC) = k_f
| 1
Error: Symbol 'assoc' at (1) has no IMPLICIT type
radau90_Rates.f90:134:31:
134 | k_3rd_jpl_activation(DISSOC) = k_fCA
| 1
Error: Symbol 'dissoc' at (1) has no IMPLICIT type Where are the |
Sorry, somehow the CI-tests don't start when I push into this branch. I hope the fix in gen.c works. |
The C-I tests now work again. Had to change |
I have performed several tests with different integrators and a simple
The decision "repair or remove" may be tough but I prefer not to have |
I have no problem with this. We typically use Rosenbrock and Forward Euler for our simulations. I guess this is a wider question -- should we also go thru the KPP code and remove code_f77.c and all other references to F77 output? |
Removing all references to F77 might be a lot of work. I think it would |
@RolfSander that's fine w/ me. I can add that to the docs. |
OK, thanks! What is your opinion on DVODE, SEULEX, GILLESPIE, and TAU_LEAP (see above)? |
Hi @RolfSander, let me scope out the issues with DVODE & SEULEX. If it's a quick fix I'll push an update. Otherwise we'll remove them. |
Yes, I'd also like to keep GILLESPIE and TAU_LEAP. If the Makefile is
Sounds good. Thanks for checking! |
SEULEX Is OK, it just needed a 'USE KPP_Root_Global` statement at the top of the module. I've managed to fix all the warnings and errors except for: small_strato_Integrator.f90:361:78:
361 | F90(FUN_CHEM,NVAR,VAR,T1,T2,ITASK,ISTATE,OPTIONS,J_FCN=JAC_CHEM)
| 1
Error: There is no specific subroutine for the generic ‘dvode_f90’ at (1
make: *** [Makefile_small_strato:249: small_strato_Integrator.o] Error 1 I think it has to do with the manual INTERFACE declaration for |
Thanks, it's great that you were able to repair SEULEX! Hmm, the Next week, I'll be attending the EGU conference (virtually) and after |
No worries @RolfSander. I will be going to IGC10 in St. Louis in early June so will have to prep for that. At least we got KPP 2.5.0 out which will be something for us to trumptet at IGC10. |
I'm using |
I'm working on @yantosca : In commit b95b4ea, you added this code to
I'm trying to understand what it means. The loop starts with i = VarNr |
There is no separate |
I have to applaud the work you guys are doing. I wish I was more
available to help with this directly. If you need more specific things,
please let me know.
…On 5/22/22 07:01, Rolf Sander wrote:
There is no separate |rosenblock_split| integrator anymore. Instead, you
now just use the command |#FUNCTION SPLIT| and use the normal
|rosenbrock.f90| integrator. It should work fine but please let me know
if you discover any problems. I also adapted the |exponential.f90|
solver but that hasn't been tested yet. There is also a new CI test
(|ros_split|) but for unknown reasons the CI tests don't execute when I
push to the cleanup_int branch, and |ci-manual-testing-script.sh|
doesn't work for me either.
—
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVE2334CK5N7BBTRCH5RKDVLIHZJANCNFSM5V5ZVMXQ>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@RolfSander @yantosca I think the AR-boxmodel can be ingested into the $KPP_HOME/models dir. Would you guys like me to do this? |
Thanks, @msl3v! Maybe you could just try to run Rosenbrock with the SPLIT option on your computer and let me know if it works? If not, I can take care of fixing the problem... |
I don't know the AR-boxmodel. If you think you can put it into a *.def, a *.spc and an *.eqn file in models/, it would certainly be a nice addition to KPP! |
I'm working on ICNTRL consistency amongst the solvers now. As a start, here is a summary table for the f90 solvers:
|
Here is a list of tasks related to ICNTRL:
If you agree, @yantosca and @msl3v, I could work on the first 3 items. Regarding 4 and 5, I'm not sure what to do. Maybe ask Adrian. |
Thanks @RolfSander. Please go ahead with the #1, #2, and #3. I think those are all good updates. I remember looking at the tau_leap and gillespie integrators. Not sure if many of the ICNTRL options apply to them (maybe only ICNTRL(15) would, or ICNTRL(17) if we add it in). We could just add those features in as time allows. |
OK. This is good guidance. I will make the needed changes to feuler.f90
|
Thanks, @msl3v, for updating feuler.f90! I will take care of 1. and 3. I don't know anyone who is actually using tau_leap and gillespie. For |
Hi @RolfSander and @msl3v. I was away for a few days, I won't be able to test the rosenbrock_split code in GEOS-Chem until I get back from IGC10 in mid-June. About the weird for loop, let's comment it out and then see if it doesn't break anything. |
No problem. Enjoy the GEOS-Chem meeting and let's continue when you're back... |
Modified this:
1) IF( ICNTRL(16) .eq. 0 ) Don't even perform the search for negatives.
2) Three ICNTRL(16) options instead of two
0 -> Don't do anything
1 -> Set negative values to zero
2 -> Return
3 -> Stop
Pushed to forwardeuler branch. Pull requesting in a moment.
Bob this will require changing the ICNTRL settings in the carbon cycle
code. ccyclechem_mod.F90.
You could probably do this easily in GCv14.0.0, or I could do it in the
CCycle branch and create a pull request. Your call.
…On 5/23/22 10:41, Rolf Sander wrote:
The solver feuler.f90 uses ICNTRL(1) for verbose error output and
ICNTRL(2) to stop upon negative results. This is incompatible with the
usage in other solvers. I suggest:
a) Use ICNTRL(16) to deal with negative results in a similar way as
rosenbrock.f90 does it now, e.g.:
0 -> don't do anything
1 -> set negative values to zero
2 -> stop.
b) Use ICNTRL(17) to control error output. This is a nice feature that
we could also use in other integrators. Let's use a new index in the
ICNTRL array for this.
|
One of the features I like most about KPP is that you can choose the
most suitable integrator for your problem and even fine-tune it.
However, for me as a non-mathematician, it is also important that the
integrator works out-of-the-box. Therefore I suggest that we check all
int/*.f90 files and either decide to maintain them, or move them into
the int/user_contributed/ directory. For those that we decide to
maintain, I suggest that we look at a couple of issues:
A consistent naming scheme would be good. For example, why do some
files have the prefix
kpp_
? Can we remove that prefix?I'd like to check if [IR]CNTRL and [IR]STATUS are used consistently
between different integrators, as far as possible.
I'd like to check if the error numbers and messages are used
consistently between different integrators, as far as possible.
Do we need the empty file int/none.f90 ?
We have several rosenbrock variants as individual files. Would it be
possible to merge them into one file? Their different features could
be switched on/off via ICNTRL. Well, this is probably more of a
long-term project...
@yantosca, @msl3v: Any comments?
The text was updated successfully, but these errors were encountered: