Skip to content

Commit 822321b

Browse files
Includes CCPP scheme dependencies in the build (#282)
Uses updated CCPP-generated data to include scheme dependencies in the CAM-SIMA build. In draft until ESCOMP/atmospheric_physics#102 is merged. --------- Co-authored-by: Jesse Nusbaumer <nusbaume@ucar.edu>
1 parent 376367e commit 822321b

File tree

8 files changed

+36
-34
lines changed

8 files changed

+36
-34
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99
!test/
1010
!.config_files.xml
1111
!docker
12+
!bin/
13+
!.lib/
14+
!.gitmodules

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[submodule "ccpp-framework"]
22
path = ccpp_framework
33
url = https://github.com/NCAR/ccpp-framework
4-
fxtag = 2024-07-11-dev
4+
fxtag = 2024-07-19-dev
55
fxrequired = AlwaysRequired
66
fxDONOTUSEurl = https://github.com/NCAR/ccpp-framework
77
[submodule "mpas"]
@@ -14,7 +14,7 @@
1414
[submodule "ncar-physics"]
1515
path = src/physics/ncar_ccpp
1616
url = https://github.com/ESCOMP/atmospheric_physics
17-
fxtag = atmos_phys0_03_000
17+
fxtag = 098585940ad763be58ebab849bb8eaf325fda42a
1818
fxrequired = AlwaysRequired
1919
fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics
2020
[submodule "ccs_config"]

cime_config/cam_autogen.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,11 @@ def generate_physics_suites(build_cache, preproc_defs, host_name,
615615
ufiles_str = datatable_report(cap_output_file, request, ";")
616616
utility_files = ufiles_str.split(';')
617617
_update_genccpp_dir(utility_files, genccpp_dir)
618+
request = DatatableReport("dependencies")
619+
dep_str = datatable_report(cap_output_file, request, ";")
620+
if len(dep_str) > 0:
621+
dependency_files = dep_str.split(';')
622+
_update_genccpp_dir(dependency_files, genccpp_dir)
618623
##XXgoldyXX: ^ Temporary fix:
619624
# End if
620625

docker/Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# parts of CAM require x86 architecture (gptl, which relies on the rdtsc x86 assembly instruction)
22
# esmf is am image you are expected to have built. Read the README file for instructions
3-
FROM esmf:latest
3+
FROM --platform=linux/amd64 esmf:latest
44

55
###################################################
66
## Install necessary packages
@@ -11,13 +11,18 @@ RUN dnf -y update \
1111
git \
1212
hostname \
1313
m4 \
14-
python \
14+
python39 \
15+
pip \
1516
sudo \
1617
svn \
1718
tree \
1819
vim \
1920
&& dnf clean all
2021

22+
RUN ln -s $(which python3) /usr/bin/python && \
23+
pip install --upgrade pip && \
24+
pip install --upgrade setuptools
25+
2126
###################################################
2227
## Make sure the mpi compilers can be found
2328
###################################################
@@ -50,7 +55,7 @@ USER cam_sima_user
5055
WORKDIR /home/cam_sima_user/CAM-SIMA
5156

5257
# pull the dependencies
53-
RUN ./manage_externals/checkout_externals
58+
RUN ./bin/git-fleximod update
5459

5560
# Copy in the machine information for the container
5661
RUN cp /home/cam_sima_user/CAM-SIMA/docker/config_machines.xml /home/cam_sima_user/CAM-SIMA/ccs_config/machines/
@@ -79,7 +84,7 @@ RUN ./xmlchange STOP_N=5
7984
RUN chmod +x /home/cam_sima_user/CAM-SIMA/docker/ftp_download.sh
8085
RUN /home/cam_sima_user/CAM-SIMA/docker/ftp_download.sh
8186

82-
# # add the snapshot file
87+
# add the snapshot file
8388
RUN echo "ncdata='/home/cam_sima_user/run_heldsuarez_cam6_nt2_bigg_try005.cam.h5.0001-01-01-00000.nc'" >> user_nl_cam
8489

8590
RUN ./case.build

docker/Dockerfile.musica

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# parts of CAM require x86 architecture (gptl, which relies on the rdtsc x86 assembly instruction)
22
# esmf is am image you are expected to have built. Read the README file for instructions
3-
FROM esmf:latest
3+
FROM --platform=linux/amd64 esmf:latest
44

55
###################################################
66
## Install necessary packages
@@ -11,13 +11,18 @@ RUN dnf -y update \
1111
git \
1212
hostname \
1313
m4 \
14-
python \
14+
python39 \
15+
pip \
1516
sudo \
1617
svn \
1718
tree \
1819
vim \
1920
&& dnf clean all
2021

22+
RUN ln -s $(which python3) /usr/bin/python && \
23+
pip install --upgrade pip && \
24+
pip install --upgrade setuptools
25+
2126
###################################################
2227
## Make sure the mpi compilers can be found
2328
###################################################
@@ -36,37 +41,22 @@ RUN cd pnetcdf-1.12.3 && \
3641

3742
ENV FC=gfortran
3843

39-
###################################################
40-
## Build and install json-fortran
41-
###################################################
42-
RUN curl -LO https://github.com/jacobwilliams/json-fortran/archive/8.2.0.tar.gz \
43-
&& tar -zxvf 8.2.0.tar.gz \
44-
&& cd json-fortran-8.2.0 \
45-
&& mkdir build \
46-
&& cd build \
47-
&& cmake -D SKIP_DOC_GEN:BOOL=TRUE .. \
48-
&& make install -j 8
49-
50-
# add a symlink
51-
RUN ln -s /usr/local/jsonfortran-gnu-8.2.0/lib/libjsonfortran.a /usr/local/lib/libjsonfortran.a
52-
5344
###################################################
5445
## Build and install MUSICA
5546
###################################################
5647

57-
RUN git clone https://github.com/NCAR/musica.git
48+
RUN git clone https://github.com/NCAR/musica.git \
49+
&& cd musica \
50+
&& git checkout 2a5eeaac982a3eb80b96d1e2087b91b301d1e748
51+
5852
RUN mkdir /musica/build \
5953
&& cd /musica/build \
60-
&& export JSON_FORTRAN_HOME="/usr/local/jsonfortran-gnu-8.2.0" \
6154
&& cmake \
6255
-D ENABLE_TESTS=OFF \
63-
-D ENABLE_TUVX=OFF \
64-
.. \
56+
-D MUSICA_BUILD_FORTRAN_INTERFACE=ON \
57+
.. \
6558
&& make install -j 8
6659

67-
# add a symlink
68-
RUN ln -s /usr/local/musica-0.3.0/lib64/libmusica.a /usr/local/lib/libmusica.a
69-
7060
###################################################
7161
## Build CAM-SIMA
7262
###################################################
@@ -83,7 +73,7 @@ USER cam_sima_user
8373
WORKDIR /home/cam_sima_user/CAM-SIMA
8474

8575
# pull the dependencies
86-
RUN ./manage_externals/checkout_externals
76+
RUN ./bin/git-fleximod update
8777

8878
# Copy in the machine information for the container
8979
RUN cp /home/cam_sima_user/CAM-SIMA/docker/config_machines.xml /home/cam_sima_user/CAM-SIMA/ccs_config/machines/
@@ -104,7 +94,7 @@ WORKDIR $CASE_NAME
10494
RUN ./case.setup
10595

10696
RUN ./xmlchange CAM_CONFIG_OPTS="--dyn none --physics-suites musica"
107-
RUN ./xmlchange CAM_LINKED_LIBS="-lmusica -ljsonfortran"
97+
RUN ./xmlchange CAM_LINKED_LIBS="-lmusica-fortran -lmusica -lyaml-cpp"
10898
RUN ./xmlchange ROF_NCPL=48
10999
RUN ./xmlchange STOP_OPTION=nsteps
110100
RUN ./xmlchange STOP_N=5

src/control/cam_comp.F90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,6 @@ subroutine cam_register_constituents(cam_runtime_opts)
561561
integer :: errflg
562562
character(len=512) :: errmsg
563563
type(ccpp_constituent_prop_ptr_t), pointer :: const_props(:)
564-
type(ccpp_constituent_properties_t), allocatable, target :: dynamic_constituents(:)
565564
character(len=*), parameter :: subname = 'cam_register_constituents: '
566565

567566
! Initalize error flag and message:

0 commit comments

Comments
 (0)