Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into update_ug
Browse files Browse the repository at this point in the history
  • Loading branch information
Tracy committed Aug 13, 2024
2 parents f361ab1 + 7ede232 commit 175a84d
Show file tree
Hide file tree
Showing 59 changed files with 5,276 additions and 1,453 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci_test_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [pull_request,workflow_dispatch]

env:
TEST_TAG: dtcenter/ccpp-scm:test
PR_NUMBER: ${{ github.event.number }}

jobs:
docker:
Expand All @@ -22,6 +23,7 @@ jobs:
file: docker/Dockerfile
load: true
tags: ${{ env.TEST_TAG }}
build-args: PR_NUMBER=${{ github.event.number }}
- name: Test
run: |
mkdir $HOME/output
Expand Down
2 changes: 1 addition & 1 deletion contrib/get_all_static_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ for file in "${data_files[@]}"; do
mkdir -p $BASEDIR/scm/data/$file
cd $BASEDIR/scm/data/$file
echo "Retrieving $file"
wget https://github.com/NCAR/ccpp-scm/releases/download/v6.0.0/${file}.tar.gz
wget https://github.com/NCAR/ccpp-scm/releases/download/v7.0.0-beta/${file}.tar.gz
tar -xf ${file}.tar.gz
rm -f ${file}.tar.gz
done
Expand Down
86 changes: 46 additions & 40 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
FROM debian:12
MAINTAINER Michael Kavulich <[email protected]>
LABEL maintainer="Michael Kavulich <[email protected]>"

# Set up base OS environment
# arguments that can be passed in
ARG PR_NUMBER

# Set up base OS environment
RUN apt-get -y update

# Get "essential" tools and libraries
RUN apt-get -y install build-essential \
&& apt-get -y install cmake curl git file gfortran-12 ksh m4 python3 tcsh time wget vim \
&& apt-get -y install cmake cmake-curses-gui curl git file gfortran-12 ksh m4 python3 tcsh time wget vim emacs-nox \
&& apt-get -y install libnetcdf-pnetcdf-19 libnetcdff7 libnetcdf-dev libnetcdff-dev libxml2 \
&& apt-get -y install python3-pip python3.11-venv
&& apt-get -y install python3-pip python3.11-venv python3-netcdf4 \
&& apt-get -y install openmpi-bin libopenmpi-dev
RUN ln -s /usr/bin/python3 /usr/bin/python

MAINTAINER Grant Firl <[email protected]> or Michael Kavulich <[email protected]>
# Set up python needed packages, preferred Docker method is apt-get but
# f90nml can't be installed for debian that way
RUN pip install f90nml --break-system-packages

#Compiler environment variables
ENV CC /usr/bin/gcc
ENV FC /usr/bin/gfortran
ENV CXX /usr/bin/g++
ENV F77 /usr/bin/gfortran
ENV F90 /usr/bin/gfortran
ENV CC=/usr/bin/gcc
ENV FC=/usr/bin/gfortran
ENV CXX=/usr/bin/g++
ENV F77=/usr/bin/gfortran
ENV F90=/usr/bin/gfortran

# Other necessary environment variables
ENV LD_LIBRARY_PATH /usr/lib/
ENV LD_LIBRARY_PATH=/usr/lib/

# Set up unpriviledged user account, set up user home space and make sure user has permissions on all stuff in /comsoftware
RUN groupadd comusers -g 9999 \
Expand All @@ -32,57 +38,63 @@ RUN groupadd comusers -g 9999 \
&& chown -R comuser:comusers /comsoftware \
&& chmod -R 6755 /comsoftware

# Link version-specific aliases (python3 will be created later with virtual environment)
RUN ln -s ~comuser/.venv/bin/python3 /usr/local/bin/python
RUN ln -s /usr/bin/gfortran-12 /usr/bin/gfortran

# all root steps completed above, now continue below as regular userID comuser
USER comuser
WORKDIR /home

# Build NCEP libraries we need for SCM

ENV NCEPLIBS_DIR /comsoftware/nceplibs
ENV NCEPLIBS_DIR=/comsoftware/nceplibs

RUN mkdir -p $NCEPLIBS_DIR/src && cd $NCEPLIBS_DIR/src \
&& git clone -b v2.4.1 --recursive https://github.com/NOAA-EMC/NCEPLIBS-bacio \
&& mkdir NCEPLIBS-bacio/build && cd NCEPLIBS-bacio/build \
&& cmake -DCMAKE_INSTALL_PREFIX=$NCEPLIBS_DIR .. \
&& make VERBOSE=1 \
&& make install
&& make VERBOSE=1 -j \
&& make install

RUN cd $NCEPLIBS_DIR/src \
&& git clone -b v2.3.3 --recursive https://github.com/NOAA-EMC/NCEPLIBS-sp \
&& mkdir NCEPLIBS-sp/build && cd NCEPLIBS-sp/build \
&& cmake -DCMAKE_INSTALL_PREFIX=$NCEPLIBS_DIR .. \
&& make VERBOSE=1 \
&& make VERBOSE=1 -j \
&& make install

RUN cd $NCEPLIBS_DIR/src \
&& git clone -b v2.11.0 --recursive https://github.com/NOAA-EMC/NCEPLIBS-w3emc \
&& mkdir NCEPLIBS-w3emc/build && cd NCEPLIBS-w3emc/build \
&& cmake -DCMAKE_INSTALL_PREFIX=$NCEPLIBS_DIR .. \
&& make VERBOSE=1 \
&& make VERBOSE=1 -j \
&& make install

ENV bacio_ROOT /comsoftware/nceplibs
ENV sp_ROOT /comsoftware/nceplibs
ENV w3emc_ROOT /comsoftware/nceplibs
ENV bacio_ROOT=/comsoftware/nceplibs
ENV sp_ROOT=/comsoftware/nceplibs
ENV w3emc_ROOT=/comsoftware/nceplibs

# Obtain CCPP SCM source code, build code, and download static data
RUN if [ -z "$PR_NUMBER" ]; then \
cd /comsoftware \
&& git clone --recursive -b main https://github.com/NCAR/ccpp-scm; \
else \
cd /comsoftware \
&& git clone https://github.com/NCAR/ccpp-scm \
&& cd ccpp-scm \
&& git fetch origin pull/${PR_NUMBER}/head:test_pr \
&& git checkout test_pr \
&& git submodule update --init --recursive; \
fi

RUN mkdir /comsoftware/ccpp-scm/scm/bin \
&& cd /comsoftware/ccpp-scm/scm/bin \
&& cmake ../src \
&& make -j

# Obtain CCPP SCM source code and static data, build code
RUN cd /comsoftware \
&& git clone --recursive -b main https://github.com/NCAR/ccpp-scm \
&& cd /comsoftware/ccpp-scm/ \
RUN cd /comsoftware/ccpp-scm/ \
&& ./contrib/get_all_static_data.sh \
&& ./contrib/get_thompson_tables.sh \
&& cd /comsoftware/ccpp-scm/scm \
&& mkdir bin \
&& cd bin \
&& cmake ../src \
&& make -j4
&& ./contrib/get_thompson_tables.sh

# The analysis scripts have options for using LaTeX when making figure labels.
# If you would like to install LaTeK, uncomment the section below.
# If you would like to install LaTeK, uncomment the section below.
# Note: This will increase the image size by 1 GB.
#USER root
#RUN yum -y update \
Expand All @@ -96,9 +108,3 @@ ENV SCM_ROOT=/comsoftware/ccpp-scm/

# For interactive use, vim mouse settings are infuriating
RUN echo "set mouse=" > ~/.vimrc

# Set up python virtual environment and install needed packages
ENV VIRTUAL_ENV=~/.venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN pip3 install f90nml==1.4.4 netcdf4==1.6.5
9 changes: 9 additions & 0 deletions scm/etc/case_config/COMBLE.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$case_config
case_name = 'COMBLE',
input_type = 1
lsm_ics = .false.,
do_spinup = .false.,
spinup_timesteps = 0,
reference_profile_choice = 2,
column_area = 1.45E8,
/
23 changes: 7 additions & 16 deletions scm/etc/case_config/LASSO_2016051812.nml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
$case_config
case_name = 'LASSO_2016051812',
runtime = 54000,
thermo_forcing_type = 2,
mom_forcing_type = 3,
relax_time = 7200.0,
sfc_flux_spec = .true.,
sfc_roughness_length_cm = 10.0
sfc_type = 1,
reference_profile_choice = 2,
year = 2016,
month = 5,
day = 18,
hour = 12,
column_area = 2.0E9,
$end
&case_config
case_name = 'LASSO_2016051812'
column_area = 2000000000.0
input_type = 1
reference_profile_choice = 2
sfc_roughness_length_cm = 10.0
/
23 changes: 7 additions & 16 deletions scm/etc/case_config/LASSO_2016051812_MSDA.nml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
$case_config
case_name = 'LASSO_2016051812_MSDA',
runtime = 54000,
thermo_forcing_type = 2,
mom_forcing_type = 3,
relax_time = 7200.0,
sfc_flux_spec = .true.,
sfc_roughness_length_cm = 10.0
sfc_type = 1,
reference_profile_choice = 2,
year = 2016,
month = 5,
day = 18,
hour = 12,
column_area = 2.0E9,
$end
&case_config
case_name = 'LASSO_2016051812_MSDA'
column_area = 2000000000.0
input_type = 1
reference_profile_choice = 2
sfc_roughness_length_cm = 10.0
/
23 changes: 7 additions & 16 deletions scm/etc/case_config/LASSO_2016051812_VARA.nml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
$case_config
case_name = 'LASSO_2016051812_VARA',
runtime = 54000,
thermo_forcing_type = 2,
mom_forcing_type = 3,
relax_time = 7200.0,
sfc_flux_spec = .true.,
sfc_roughness_length_cm = 10.0
sfc_type = 1,
reference_profile_choice = 2,
year = 2016,
month = 5,
day = 18,
hour = 12,
column_area = 2.0E9,
$end
&case_config
case_name = 'LASSO_2016051812_VARA'
column_area = 2000000000.0
input_type = 1
reference_profile_choice = 2
sfc_roughness_length_cm = 10.0
/
23 changes: 7 additions & 16 deletions scm/etc/case_config/LASSO_20180514_s02.nml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
$case_config
case_name = 'LASSO_20180514_s02',
runtime = 54000,
thermo_forcing_type = 2,
mom_forcing_type = 3,
relax_time = 7200.0,
sfc_flux_spec = .true.,
sfc_roughness_length_cm = 10.0
sfc_type = 1,
reference_profile_choice = 2,
year = 2018,
month = 5,
day = 14,
hour = 12,
column_area = 2.0E9,
$end
&case_config
case_name = 'LASSO_20180514_s02'
column_area = 2000000000.0
input_type = 1
reference_profile_choice = 2
sfc_roughness_length_cm = 10.0
/
23 changes: 7 additions & 16 deletions scm/etc/case_config/LASSO_20180522_s02.nml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
$case_config
case_name = 'LASSO_20180522_s02',
runtime = 54000,
thermo_forcing_type = 2,
mom_forcing_type = 3,
relax_time = 7200.0,
sfc_flux_spec = .true.,
sfc_roughness_length_cm = 10.0
sfc_type = 1,
reference_profile_choice = 2,
year = 2018,
month = 5,
day = 22,
hour = 12,
column_area = 2.0E9,
$end
&case_config
case_name = 'LASSO_20180522_s02'
column_area = 2000000000.0
input_type = 1
reference_profile_choice = 2
sfc_roughness_length_cm = 10.0
/
23 changes: 7 additions & 16 deletions scm/etc/case_config/LASSO_20180606_s02.nml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
$case_config
case_name = 'LASSO_20180606_s02',
runtime = 54000,
thermo_forcing_type = 2,
mom_forcing_type = 3,
relax_time = 7200.0,
sfc_flux_spec = .true.,
sfc_roughness_length_cm = 10.0
sfc_type = 1,
reference_profile_choice = 2,
year = 2018,
month = 6,
day = 06,
hour = 12,
column_area = 2.0E9,
$end
&case_config
case_name = 'LASSO_20180606_s02'
column_area = 2000000000.0
input_type = 1
reference_profile_choice = 2
sfc_roughness_length_cm = 10.0
/
23 changes: 7 additions & 16 deletions scm/etc/case_config/LASSO_20180618_s02.nml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
$case_config
case_name = 'LASSO_20180618_s02',
runtime = 54000,
thermo_forcing_type = 2,
mom_forcing_type = 3,
relax_time = 7200.0,
sfc_flux_spec = .true.,
sfc_roughness_length_cm = 10.0
sfc_type = 1,
reference_profile_choice = 2,
year = 2018,
month = 6,
day = 18,
hour = 12,
column_area = 2.0E9,
$end
&case_config
case_name = 'LASSO_20180618_s02'
column_area = 2000000000.0
input_type = 1
reference_profile_choice = 2
sfc_roughness_length_cm = 10.0
/
23 changes: 7 additions & 16 deletions scm/etc/case_config/LASSO_20180619_s02.nml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
$case_config
case_name = 'LASSO_20180619_s02',
runtime = 54000,
thermo_forcing_type = 2,
mom_forcing_type = 3,
relax_time = 7200.0,
sfc_flux_spec = .true.,
sfc_roughness_length_cm = 10.0
sfc_type = 1,
reference_profile_choice = 2,
year = 2018,
month = 6,
day = 19,
hour = 12,
column_area = 2.0E9,
$end
&case_config
case_name = 'LASSO_20180619_s02'
column_area = 2000000000.0
input_type = 1
reference_profile_choice = 2
sfc_roughness_length_cm = 10.0
/
23 changes: 7 additions & 16 deletions scm/etc/case_config/LASSO_20180705_s02.nml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
$case_config
case_name = 'LASSO_20180705_s02',
runtime = 54000,
thermo_forcing_type = 2,
mom_forcing_type = 3,
relax_time = 7200.0,
sfc_flux_spec = .true.,
sfc_roughness_length_cm = 10.0
sfc_type = 1,
reference_profile_choice = 2,
year = 2018,
month = 7,
day = 05,
hour = 12,
column_area = 2.0E9,
$end
&case_config
case_name = 'LASSO_20180705_s02'
column_area = 2000000000.0
input_type = 1
reference_profile_choice = 2
sfc_roughness_length_cm = 10.0
/
Loading

0 comments on commit 175a84d

Please sign in to comment.