CABLE Library for AM3/ACCESS3#724
Conversation
aaba5ca to
3ef0fed
Compare
|
This now, along with JULES PR #346, access-spack-packages PR #455 and UM PR #148 successfully builds AM3 with CABLE as a library and achieves bitwise compatible results. |
|
@Whyborn Can you please add the benchcab results for bitwise reproducibility? |
ccarouge
left a comment
There was a problem hiding this comment.
A few requests for more explanation and some relatively minor changes.
| spack-manifest-data-path: .github/build-ci/data/standard.json | ||
| # We need to install the compilers manually here because the upstream image is too large to run on GitHub-hosted runners | ||
| spack-compiler-manifest-path: .github/build-ci/compilers/spack.yaml | ||
| access-spack-packages-ref: 1d9acf45c39229ff4e90a9aa49922b1169305476 |
There was a problem hiding this comment.
What is this line doing? Why is it needed now and not before?
There was a problem hiding this comment.
That's to make the CI use the correct version of the spack packages. I should get the spack packages PR merged in first, tag it, then refer to that tag here.
There was a problem hiding this comment.
Why is this file modified for the library work? I would guess we do not compile this for AM3.
There was a problem hiding this comment.
This was intended to be a bit of future proofing, as Sean's MPI slightly modified the land use change code which was referred to by the AM3 code, even if not yet active. We came up with a better solution in this merged PR. I'll remove this change.
There was a problem hiding this comment.
Why are we adding this to science/ when it is only to be used in ESM1.5/1.6? Should the # define ESM15 YES be # define ESM15 NO in the offline repository? Or even, remove that line from the file and deal with it at compilation as usually done for pre-processor flags.
There was a problem hiding this comment.
And why is it part of the AM3 library work?
There was a problem hiding this comment.
Unfortunately the land use code had moved in a bit from the form that is in AM3. The JULES src/science_cable/landuse/landuse3.F90 should be the same as src/science/landuse/landuse3, but it isn't, and the coupling code is written based on the JULES version. A few routine signatures have changed, and I was getting type mismatch errors when I tried to quickly fix it.
I should remove the #ifdef and #def. I think it's best to get this in first, then reconcile the differences between the way this routine is called in the coupling and then remove this file.
| src/science/landuse/landuse3.F90 | ||
| src/science/landuse/landuse_constant.F90 | ||
| src/params/cable_phys_constants_mod.F90 |
There was a problem hiding this comment.
Could we put this back in alphabetical order? And with the correct indentation.
| src/science/casa-cnp/casa_dimension.F90 | ||
| src/science/casa-cnp/casa_feedback.F90 | ||
| src/science/casa-cnp/casa_inout.F90 | ||
| src/science/casa-cnp/casa_param.F90 | ||
| src/science/casa-cnp/casa_phenology.F90 | ||
| src/science/casa-cnp/casa_readbiome.F90 | ||
| src/science/casa-cnp/casa_rplant.F90 | ||
| src/science/casa-cnp/casa_sumcflux.F90 | ||
| src/science/casa-cnp/casa_variable.F90 |
There was a problem hiding this comment.
What happens to all these CASA files for the ESM1.6 library? Were they added but are in fact not needed?
There was a problem hiding this comment.
Unfortunately these are bits that had been rewritten for AM3- the way the derived types are structured is different to offline, see this JULES issue. This is related to the duplicate ALLOCATABLE/POINTER type definitions that I wanted to unify some time back. The AM3 versions of these live in the JULES src/util/casa.
| if (CMAKE_Fortran_COMPILER_ID MATCHES "Intel") | ||
| add_compile_options(-r8 -i8) | ||
| elseif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") | ||
| add_compile_options(-fdefault-real-8 -fdefault-integer-8 -fdefault-double-8) | ||
| else() | ||
| message(STATUS "Cannot compile library with unknown compiler") | ||
| endif() |
There was a problem hiding this comment.
These are the same options for ESM1.6 and ACCESS3. Are we doubling them in case we want to modify them for ACCESS3? I would prefer to put this block under the if(CABLE_LIBRARY) condition directly and have them appear only once. So that it's clearer the only difference between ESM1.6 and ACCESS3 libraries are the sources.
There was a problem hiding this comment.
I think it makes more sense to declare them separately- it makes it clearer, and there may be instances where the flags are not the same and this preempts that.
|
Benchcab output: |
CABLE
Thank you for submitting a pull request to the CABLE Project.
Description
This builds the library for AM3 and future ACCESS3 applications. It requires a rejig of the original library, taking some files out of the default library and including them only in ESM1.6. The intention was that the library would only be the science code, but this is not possible with the current setup.
A summary of things that the science directory depends on, that extends outside the
sciencedirectory that I've identified:sciencedirectory. Each of these have different definitions for each application (offline, ESM1.6, AM3). Logically, there should only be one definition, but I don't think this will happen any time soon. In the mean time, including the type modules insrc/coupled/AM3/control/cable/CM3in the library should be an acceptable solution.cable_surface_types_modmodule also reads the namelist that sets the CABLE surface types. Do the surface types need to be handled in this way? Is there any foreseeable situation where anyone would not use the standard CABLE PFT indexing? If we remove this, it makes things significantly easier. It also does the extra work of defining a bunch of required JULES variables. I think the best solution is go back to hard-coded CABLE PFT indices, see this JULES PR.Testing
📚 Documentation preview 📚: https://cable--724.org.readthedocs.build/en/724/