Skip to content

Commit 9e27bd1

Browse files
author
Shawn P. Serbin
committed
Added serial dockerfile and OLMT ensemble examples
1 parent 1d0dfbd commit 9e27bd1

File tree

4 files changed

+252
-11
lines changed

4 files changed

+252
-11
lines changed

docker/elm/elm_v2-for-ngee/Dockerfile_serial_multiarch

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# AMD64/ARM64 version
66
# ----------------------------------------------------------------------
77

8-
FROM fasstsimulation/baseos:gcc850ompi316-serial_multiarch
8+
FROM serbinsh/ngeearctic_elm_containers:baseos_gcc850ompi316-serial_multiarch
99
LABEL maintainer.name="Shawn P. Serbin" \
1010
maintainer.email="[email protected]" \
1111
author.name="Shawn P. Serbin" \
@@ -15,9 +15,8 @@ LABEL maintainer.name="Shawn P. Serbin" \
1515
version.baseos="gcc8.5"
1616

1717
# where to get the ELM source code
18-
ENV REPOSITORY_URL=https://github.com/FASSt-simulation/simulation_containers
19-
ENV REPOSITORY_RAW_URL=https://raw.githubusercontent.com/FASSt-simulation/simulation_containers
20-
ENV TOOLS_REPOSITORY_RAW_URL=https://raw.githubusercontent.com/FASSt-simulation/fasst_simulation_tools
18+
ENV REPOSITORY_URL=https://github.com/TESTgroup-BNL/ngeearctic_elm_containers
19+
ENV REPOSITORY_RAW_URL=https://raw.githubusercontent.com/TESTgroup-BNL/ngeearctic_elm_containers
2120
ENV USER=modeluser
2221

2322
# Add new group, user, and user directory with user permissions
@@ -103,16 +102,16 @@ USER ${USER}
103102
RUN cd /tools \
104103
&& git -c http.sslVerify=false clone -b Arctic-userpft --single-branch https://github.com/dmricciuto/OLMT.git \
105104
&& cd OLMT/ \
106-
# add specific git commit as src - to try and stabilize changes and avoid new potential bugs
107-
&& git reset --hard 'c208528360d59f46630ef94fe4a3a42cbfd3acab' \
105+
# add specific git commit to version used in the October 2022 NGEE Arctic Modeling Workshop
106+
&& git reset --hard '1b2a02c34deda8a2a796bb68325a87ddb3764c32' \
108107
&& chown $USER:dockerusers -R /tools/OLMT \
109108
&& chmod -R 777 /tools/OLMT
110109

111110
# Copy scripts into /scripts to make availible to users
112111
RUN cd /scripts \
113-
&& wget $TOOLS_REPOSITORY_RAW_URL/main/met_scripts/ngeearctic/download_elm_singlesite_forcing_data.sh \
114-
&& wget $TOOLS_REPOSITORY_RAW_URL/main/elm_scripts/ngeearctic_elm_scripts/olmt_scripts/ngeearctic_site_fullrun_userdata_docker.sh \
115-
&& wget $TOOLS_REPOSITORY_RAW_URL/main/elm_scripts/ngeearctic_elm_scripts/olmt_scripts/ngeearctic_ensemble_example_docker.sh \
112+
&& wget $REPOSITORY_RAW_URL/main/scripts/met_scripts/ngeearctic/download_elm_singlesite_forcing_data.sh \
113+
&& wget $REPOSITORY_RAW_URL/main/scripts/elm_scripts/olmt_scripts/ngeearctic_site_fullrun_userdata_docker.sh \
114+
&& wget $REPOSITORY_RAW_URL/main/scripts/elm_scripts/olmt_scripts/ngeearctic_ensemble_example_docker.sh \
116115
&& mv ngeearctic_site_fullrun_userdata_docker.sh OLMT_docker_example.sh \
117116
&& mv ngeearctic_ensemble_example_docker.sh OLMT_ens_docker_example.sh \
118117
&& chown $USER:dockerusers download_elm_singlesite_forcing_data.sh \
@@ -121,9 +120,9 @@ RUN cd /scripts \
121120
&& chown $USER:dockerusers OLMT_ens_docker_example.sh \
122121
&& chmod +x OLMT_docker_example.sh \
123122
&& chmod +x OLMT_ens_docker_example.sh \
124-
&& wget $TOOLS_REPOSITORY_RAW_URL/main/elm_scripts/ngeearctic_elm_scripts/olmt_scripts/param_list_example_kougarok \
123+
&& wget $REPOSITORY_RAW_URL/main/scripts/elm_scripts/olmt_scripts/param_list_example_kougarok \
125124
&& chown $USER:dockerusers param_list_example_kougarok \
126-
&& wget $TOOLS_REPOSITORY_RAW_URL/main/elm_scripts/ngeearctic_elm_scripts/olmt_scripts/param_list_example_beo \
125+
&& wget $REPOSITORY_RAW_URL/main/scripts/elm_scripts/olmt_scripts/param_list_example_beo \
127126
&& chown $USER:dockerusers param_list_example_beo \
128127
&& cd /
129128

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
#!/bin/sh
2+
# =======================================================================================
3+
# Setup and run an ELM OLMT simulation for an NGEE Arctic site
4+
#
5+
#
6+
# availible site names: kougarok, teller, council, beo
7+
# =======================================================================================
8+
9+
cwd=$(pwd)
10+
cd /tools/OLMT
11+
12+
# =======================================================================================
13+
### Setup and run an example ELM OLMT ensemble simulation for a NGEE-Arctic research site
14+
for i in "$@"
15+
do
16+
case $i in
17+
-sn=*|--site_name=*)
18+
site_name="${i#*=}"
19+
shift # past argument=value
20+
;;
21+
-sg=*|--site_group=*)
22+
site_group="${i#*=}"
23+
shift # past argument=value
24+
;;
25+
-cp=*|--case_prefix=*)
26+
case_prefix="${i#*=}"
27+
shift # past argument=value
28+
;;
29+
-adsy=*|--ad_spinup_years=*)
30+
ad_spinup_years="${i#*=}"
31+
shift # past argument=value
32+
;;
33+
-fsy=*|--final_spinup_years=*)
34+
final_spinup_years="${i#*=}"
35+
shift # past argument=value
36+
;;
37+
-trsy=*|--transient_years=*)
38+
transient_years="${i#*=}"
39+
shift # past argument=value
40+
;;
41+
-tsp=*|--timestep=*)
42+
timestep="${i#*=}"
43+
shift # past argument=value
44+
;;
45+
-pl=*|--param_list=*)
46+
param_list="${i#*=}"
47+
shift # past argument=value
48+
;;
49+
-ne=*|--num_ens=*)
50+
num_ens="${i#*=}"
51+
shift # past argument=value
52+
;;
53+
-ng=*|--num_groups=*)
54+
num_groups="${i#*=}"
55+
shift # past argument=value
56+
;;
57+
*)
58+
# unknown option
59+
;;
60+
esac
61+
done
62+
# =======================================================================================
63+
64+
# =======================================================================================
65+
# Set defaults and print the selected options back to the screen before running
66+
site_name="${site_name:-kougarok}"
67+
site_group="${site_group:-NGEEArctic}"
68+
case_prefix="${case_prefix:-OLMT_ens}"
69+
ad_spinup_years="${ad_spinup_years:-200}"
70+
final_spinup_years="${final_spinup_years:-600}"
71+
transient_years="${transient_years:--1}"
72+
timestep="${timestep:-1}"
73+
param_list="${param_list:-/scripts/param_list_example_kougarok}"
74+
num_ens="${num_ens:-6}"
75+
num_groups="${num_groups:-3}"
76+
77+
# print back selected or set options to the user
78+
echo " "
79+
echo " "
80+
echo "*************************** OLMT run options ***************************"
81+
echo "Site Name = ${site_name}"
82+
echo "Site Group = ${site_group}"
83+
echo "Case Prefix = ${case_prefix}"
84+
echo "Number of AD Spinup Simulation Years = ${ad_spinup_years}"
85+
echo "Number of Final Spinup Simulation Years = ${final_spinup_years}"
86+
echo "Number of Transient Simulation Years = ${transient_years}"
87+
echo "Model Timestep = ${timestep}"
88+
echo "Input parameter list = ${param_list}"
89+
echo "Number of MCMC Ensembles = ${num_ens}"
90+
echo "Number of MPI groups = ${num_groups}"
91+
if [ ${transient_years} != -1 ]; then
92+
sim_years="--nyears_ad_spinup ${ad_spinup_years} --nyears_final_spinup ${final_spinup_years} \
93+
--nyears_transient ${transient_years}"
94+
else
95+
sim_years="--nyears_ad_spinup ${ad_spinup_years} --nyears_final_spinup ${final_spinup_years}"
96+
fi
97+
echo " "
98+
# =======================================================================================
99+
100+
# =======================================================================================
101+
# Set site codes for OLMT
102+
if [ ${site_name} = beo ]; then
103+
site_code="AK-BEOG"
104+
elif [ ${site_name} = council ]; then
105+
site_code="AK-CLG"
106+
elif [ ${site_name} = kougarok ]; then
107+
site_code="AK-K64G"
108+
elif [ ${site_name} = teller ]; then
109+
site_code="AK-TLG"
110+
else
111+
echo " "
112+
echo "**** EXECUTION HALTED ****"
113+
echo "Please select a Site Name from beo, council, kougarok, teller"
114+
exit 0
115+
echo " "
116+
fi
117+
echo "OLMT Site Code: ${site_code}"
118+
# =======================================================================================
119+
120+
# =======================================================================================
121+
# pause to show options before continuing
122+
sleep 3
123+
echo " "
124+
echo " "
125+
# =======================================================================================
126+
127+
# =======================================================================================
128+
echo "Building ensemble simulations with OLMT source: "$(pwd)
129+
echo "*****************************************************************"
130+
echo " "
131+
echo " "
132+
echo "**** User OLMT run command: "
133+
runcmd="python3 ./site_fullrun.py \
134+
--site ${site_code} --sitegroup ${site_group} --caseidprefix ${case_prefix} \
135+
${sim_years} --tstep ${timestep} --machine docker \
136+
--compiler gnu --mpilib mpi-serial \
137+
--cpl_bypass --gswp3 \
138+
--model_root /E3SM \
139+
--caseroot /output \
140+
--ccsm_input /inputdata \
141+
--runroot /output \
142+
--spinup_vars \
143+
--parm_list ${param_list} \
144+
--mc_ensemble ${num_ens} \
145+
--nopointdata \
146+
--metdir /inputdata/atm/datm7/atm_forcing.datm7.GSWP3.0.5d.v2.c180716_NGEE-Grid/cpl_bypass_${site_name}-Grid \
147+
--domainfile /inputdata/share/domains/domain.clm/domain.lnd.1x1pt_${site_name}-GRID_navy.nc \
148+
--surffile /inputdata/lnd/clm2/surfdata_map/surfdata_1x1pt_${site_name}-GRID_simyr1850_c360x720_c171002.nc \
149+
--landusefile /inputdata/lnd/clm2/surfdata_map/landuse.timeseries_1x1pt_${site_name}-GRID_simyr1850-2015_c180423.nc \
150+
& sleep 10"
151+
echo ${runcmd}
152+
echo " "
153+
echo " "
154+
155+
# create the OLMT run command
156+
if python3 ./site_fullrun.py \
157+
--site ${site_code} --sitegroup ${site_group} --caseidprefix ${case_prefix} \
158+
${sim_years} --tstep ${timestep} --machine docker \
159+
--compiler gnu --mpilib mpi-serial \
160+
--cpl_bypass --gswp3 \
161+
--model_root /E3SM \
162+
--caseroot /output \
163+
--ccsm_input /inputdata \
164+
--runroot /output \
165+
--spinup_vars \
166+
--parm_list ${param_list} \
167+
--mc_ensemble ${num_ens} \
168+
--ng ${num_groups} \
169+
--nopointdata \
170+
--metdir /inputdata/atm/datm7/atm_forcing.datm7.GSWP3.0.5d.v2.c180716_NGEE-Grid/cpl_bypass_${site_name}-Grid \
171+
--domainfile /inputdata/share/domains/domain.clm/domain.lnd.1x1pt_${site_name}-GRID_navy.nc \
172+
--surffile /inputdata/lnd/clm2/surfdata_map/surfdata_1x1pt_${site_name}-GRID_simyr1850_c360x720_c171002.nc \
173+
--landusefile /inputdata/lnd/clm2/surfdata_map/landuse.timeseries_1x1pt_${site_name}-GRID_simyr1850-2015_c180423.nc \
174+
& sleep 10
175+
176+
then
177+
wait
178+
179+
echo "DONE docker ELM runs !"
180+
181+
else
182+
exit &?
183+
fi
184+
185+
cd ${cwd}
186+
sleep 2
187+
188+
#### Postprocess
189+
# Copy the example parameter file to the OLMT ensemble output folder
190+
cp ${param_list} /output/cime_run_dirs/UQ/${case_prefix}_${site_code}_ICB20TRCNPRDCTCBC/.
191+
### Collapse transient simulation output into a single netCDF file
192+
echo " "
193+
echo " "
194+
echo " "
195+
echo "**** Postprocessing ELM output in:"
196+
echo "/output/cime_run_dirs/UQ/${case_prefix}_${site_code}_ICB20TRCNPRDCTCBC/"
197+
echo " "
198+
echo " "
199+
cd /output/cime_run_dirs/UQ/${case_prefix}_${site_code}_ICB20TRCNPRDCTCBC/
200+
echo " "
201+
echo "**** Concatenating netCDF output - Hang tight this will take awhile ****"
202+
echo ${PWD}
203+
for d in */ ; do
204+
echo "Post-processing: $d"
205+
cd /output/cime_run_dirs/UQ/${case_prefix}_${site_code}_ICB20TRCNPRDCTCBC/${d}
206+
ncrcat --ovr *.h0.*.nc ELM_output.nc
207+
chmod 777 ELM_output.nc
208+
echo " "
209+
done
210+
echo " "
211+
echo " "
212+
echo "**** Concatenating netCDF output: DONE ****"
213+
echo "**** OLMT Ensemble Simulation at ${site_name}: DONE ****"
214+
echo " "
215+
echo " "
216+
echo " "
217+
sleep 2
218+
# =======================================================================================
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
flnr 11 0.02 0.20
2+
flnr 12 0.02 0.20
3+
vcmaxha 11 68000 77000
4+
vcmaxha 12 68000 77000
5+
jmaxha 11 48000 58000
6+
jmaxha 12 48000 58000
7+
roota_par 11 4 10
8+
roota_par 12 6 15
9+
mbbopt 11 1 13
10+
mbbopt 12 1 13
11+
slatop 11 0.009 0.045
12+
slatop 12 0.009 0.045
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
flnr 11 0.07 0.145
2+
flnr 12 0.07 0.145
3+
vcmaxha 11 68000 79000
4+
vcmaxha 12 68000 79000
5+
jmaxha 11 48000 58000
6+
jmaxha 12 48000 58000
7+
roota_par 11 4.0 10
8+
roota_par 12 6 15
9+
mbbopt 11 1 13
10+
mbbopt 12 1 13
11+
slatop 11 0.009 0.045
12+
slatop 12 0.009 0.045

0 commit comments

Comments
 (0)