Skip to content
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

LaMEM and FastScape surface processes #28

Closed
wants to merge 1 commit into from

Conversation

liyy1125
Copy link

@liyy1125 liyy1125 commented Oct 29, 2024

This adds surface processes (back) into LaMEM, by coupling it with FastScape, which is a flexible surface processes code (see here for a Julia interface).

Note that 2 version of the FastScape library exist at the moment: a legacy Fortran library and a newer C++ library. As far as we can tell, the C++ version does not yet have the same functionality as the Fortran version, which is why we stick with the older version for the moment.

To use this, you will need to compile a static library of the Fortran version of FastScape in the Fortran version, or link a shared library of FastScape with the path is included in the *.out

new modes of compile:

# make mode=deb all (compile debug version of LaMEM and put in /bin/deb)
# make mode=opt all (compile optimized version of LaMEM and put in /bin/opt)
# make all          (compile optimized version of LaMEM and put in /bin/opt)
# make mode=optFS all (compile optimized version of LaMEM with fastscape and put in /bin/optFS, and don't use FastScape)
# make mode=optFS all surface=SURFACE=1 (compile optimized version of LaMEM with fastscape and put in /bin/optFS, and don't use FastScape)
# make mode=optFS all surface=SURFACE=2 (compile optimized version of LaMEM with fastscape and put in /bin/optFS, and use FastScape)

@boriskaus
Copy link
Contributor

Does this PR replace PR #27? We do not need two versions of FastScape in LaMEM; one is fine. Given that it seems that the fortran version has more functionality currently, I would suggest to focus on that one.

@boriskaus
Copy link
Contributor

also, I don't understand this:

(compile optimized version of LaMEM with fastscape and put in /bin/optFS, and use FastScape)

using or not using FastScape should be specified in the *.dat input file, not at compile time. Or is this not possible?

@liyy1125
Copy link
Author

Does this PR replace PR #27? We do not need two versions of FastScape in LaMEM; one is fine. Given that it seems that the fortran version has more functionality currently, I would suggest to focus on that one.

Yes, I'll focus on the Fortran version, except when the Fortran version is much slower than the Cpp version. I noticed that it was a little slower when using the Fortran version, I'll try to speed it up.

@boriskaus
Copy link
Contributor

Does this PR replace PR #27? We do not need two versions of FastScape in LaMEM; one is fine. Given that it seems that the fortran version has more functionality currently, I would suggest to focus on that one.

Yes, I'll focus on the Fortran version, except when the Fortran version is much slower than the Cpp version. I noticed that it was a little slower when using the Fortran version, I'll try to speed it up.

Ok, in that case I suggest to close PR #27. If the Cpp version of FastScape gets more functionality in the future we can replace that

@liyy1125
Copy link
Author

also, I don't understand this:

(compile optimized version of LaMEM with fastscape and put in /bin/optFS, and use FastScape)

using or not using FastScape should be specified in the *.dat input file, not at compile time. Or is this not possible?

it's possible, I'll try that. I plan to load the parameters of the surface process and surface mode at first, but there are still some bugs so I don't upload it now.

@liyy1125
Copy link
Author

Does this PR replace PR #27? We do not need two versions of FastScape in LaMEM; one is fine. Given that it seems that the fortran version has more functionality currently, I would suggest to focus on that one.

Yes, I'll focus on the Fortran version, except when the Fortran version is much slower than the Cpp version. I noticed that it was a little slower when using the Fortran version, I'll try to speed it up.

Ok, in that case I suggest to close PR #27. If the Cpp version of FastScape gets more functionality in the future we can replace that

OK, I'll close it.

@boriskaus boriskaus changed the title LaMEM with FastScape in fortran version LaMEM and FastScape surface processes Oct 29, 2024
@boriskaus
Copy link
Contributor

also, I don't understand this:

(compile optimized version of LaMEM with fastscape and put in /bin/optFS, and use FastScape)

using or not using FastScape should be specified in the *.dat input file, not at compile time. Or is this not possible?

it's possible, I'll try that. I plan to load the parameters of the surface process and surface mode at first, but there are still some bugs so I don't upload it now.

yes, please do that. I do not like that you have to specify that at compile time. Ideally, you could add this:

 erosion_model      = 3                # erosion model [3-FastScape]

an error message should be given if erosion_model=3 is selected, and the code was not compiled with FastScape support.

You can specify all FastScape parameters in a block such as:

<FastScapeStart>
  kf = 2e-5
  kd = 1e-1
  kfsed = -1.0
<FastScapeEnd>

@liyy1125
Copy link
Author

also, I don't understand this:

(compile optimized version of LaMEM with fastscape and put in /bin/optFS, and use FastScape)

using or not using FastScape should be specified in the *.dat input file, not at compile time. Or is this not possible?

it's possible, I'll try that. I plan to load the parameters of the surface process and surface mode at first, but there are still some bugs so I don't upload it now.

yes, please do that. I do not like that you have to specify that at compile time. Ideally, you could add this:

 erosion_model      = 3                # erosion model [3-FastScape]

an error message should be given if erosion_model=3 is selected, and the code was not compiled with FastScape support.

You can specify all FastScape parameters in a block such as:

<FastScapeStart>
  kf = 2e-5
  kd = 1e-1
  kfsed = -1.0
<FastScapeEnd>

ok, I'll do that

@liyy1125 liyy1125 closed this Nov 4, 2024
@liyy1125 liyy1125 deleted the yl/LaMEM_with_fortran branch November 4, 2024 15:10
@boriskaus
Copy link
Contributor

there is no need to close the PR every time you add new features to the branch; you can simply push the changes to your local branch and it will update this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants