Skip to content

Commit f1fa80d

Browse files
authored
Merge pull request #456 from mvertens/feature/update_docn
Add ability to obtain multi level input from ocn and map and pass it back to cism
2 parents 3b1e50b + 978fcaa commit f1fa80d

7 files changed

+87
-104
lines changed

.github/workflows/extbuild.yml

+15-11
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ jobs:
2020
CPPFLAGS: "-I/usr/include -I/usr/local/include"
2121

2222
# Versions of all dependencies can be updated here
23-
ESMF_VERSION: v8.6.0
23+
ESMF_VERSION: v8.6.1
2424
PNETCDF_VERSION: checkpoint.1.12.3
2525
NETCDF_FORTRAN_VERSION: v4.6.1
2626
PIO_VERSION: pio2_6_2
27-
CDEPS_VERSION: cdeps1.0.26
27+
CDEPS_VERSION: cdeps1.0.36
2828
steps:
29-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@v4
3030
# Build the ESMF library, if the cache contains a previous build
3131
# it will be used instead
3232
- id: load-env
@@ -40,13 +40,13 @@ jobs:
4040
sudo apt-get install pnetcdf-bin libpnetcdf-dev
4141
sudo apt-get install autotools-dev autoconf
4242
- id: cache-esmf
43-
uses: actions/cache@v3
43+
uses: actions/cache@v4
4444
with:
4545
path: ~/ESMF
4646
key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF
4747
- name: Cache ParallelIO
4848
id: cache-ParallelIO
49-
uses: actions/cache@v3
49+
uses: actions/cache@v4
5050
with:
5151
path: ~/pio
5252
key: ${{ runner.os }}-${{ env.PIO_VERSION }}.pio
@@ -71,31 +71,35 @@ jobs:
7171
parallelio_path: $HOME/pio
7272
- name: Cache CDEPS
7373
id: cache-cdeps
74-
uses: actions/cache@v3
74+
uses: actions/cache@v4
7575
with:
76-
path: $HOME/cdeps
77-
key: ${{ runner.os }}-${{ env.CDEPS_VERSION }}.cdeps
76+
path: /homme/runner/work/CMEPS/CMEPS/build-cdeps
77+
key: ${{ runner.os }}-${{ env.CDEPS_VERSION }}.cdeps1
7878

7979
- name: checkout CDEPS
80-
uses: actions/checkout@v3
80+
uses: actions/checkout@v4
8181
with:
8282
repository: ESCOMP/CDEPS
8383
path: cdeps-src
8484
ref: ${{ env.CDEPS_VERSION }}
85+
- name: get genf90
86+
run: |
87+
cd cdeps-src
88+
git submodule update --init
8589
- name: Build CDEPS
8690
if: steps.cache-cdeps.outputs.cache-hit != 'true'
8791
uses: ESCOMP/CDEPS/.github/actions/buildcdeps@cdeps1.0.26
8892
with:
8993
esmfmkfile: $HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk
9094
pio_path: $HOME/pio
9195
src_root: ${GITHUB_WORKSPACE}/cdeps-src
92-
cmake_flags: " -Wno-dev -DCMAKE_BUILD_TYPE=DEBUG -DWERROR=ON -DCMAKE_Fortran_FLAGS=\"-DCPRGNU -g -Wall \
96+
cmake_flags: " -Wno-dev -DDISABLE_FoX=ON -DCMAKE_BUILD_TYPE=DEBUG -DWERROR=ON -DCMAKE_Fortran_FLAGS=\"-DCPRGNU -g -Wall \
9397
-ffree-form -ffree-line-length-none -fallow-argument-mismatch \""
9498

9599
- name: Build CMEPS
96100
run: |
97-
export ESMFMKFILE=$HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk
98101
export PIO=$HOME/pio
102+
export ESMFMKFILE=$HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk
99103
mkdir build-cmeps
100104
pushd build-cmeps
101105
cmake -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_Fortran_FLAGS="-g -Wall -Werror -ffree-form -ffree-line-length-none -Wno-unused-dummy-argument -I /home/runner/work/CMEPS/CMEPS/build-cdeps/share" ../

.github/workflows/srt.yml

+32-52
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
CPPFLAGS: "-I/usr/include -I/usr/local/include "
2727
LDFLAGS: "-L/usr/lib/x86_64-linux-gnu -lnetcdf -lnetcdff -lpnetcdf"
2828
# Versions of all dependencies can be updated here
29-
ESMF_VERSION: v8.6.0
29+
ESMF_VERSION: v8.6.1
3030
PARALLELIO_VERSION: pio2_6_2
3131
CIME_MODEL: cesm
3232
CIME_DRIVER: nuopc
@@ -64,13 +64,13 @@ jobs:
6464
run: pip install -r requirements.txt
6565
# use the latest cesm main
6666
- name: cesm checkout
67-
uses: actions/checkout@v3
67+
uses: actions/checkout@v4
6868
with:
6969
repository: ESCOMP/CESM
7070
path: cesm
7171
# this cmeps commit
7272
- name: cmeps checkout
73-
uses: actions/checkout@v3
73+
uses: actions/checkout@v4
7474
with:
7575
path: cesm/components/cmeps
7676

@@ -94,72 +94,53 @@ jobs:
9494
git submodule update --init
9595
cd ../components/cdeps
9696
git checkout main
97+
git submodule update --init
9798
9899
- name: Cache ESMF
99100
id: cache-esmf
100-
uses: actions/cache@v3
101+
uses: actions/cache@v4
101102
with:
102103
path: ~/ESMF
103-
key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF1
104-
# - name: cache pnetcdf
105-
# id: cache-pnetcdf
106-
# uses: actions/cache@v3
107-
# with:
108-
# path: ~/pnetcdf
109-
# key: ${{ runner.os }}-${{ env.PNETCDF_VERSION}}-pnetcdf
110-
111-
# - name: Cache netcdf-fortran
112-
# id: cache-netcdf-fortran
113-
# uses: actions/cache@v3
114-
# with:
115-
# path: ~/netcdf-fortran
116-
# key: ${{ runner.os }}-${{ env.NETCDF_FORTRAN_VERSION }}-netcdf-fortran
104+
key: ${{ runner.os }}-${{ env.ESMF_VERSION }}
117105

118106
- name: Cache ParallelIO
119107
id: cache-ParallelIO
120-
uses: actions/cache@v3
108+
uses: actions/cache@v4
121109
with:
122-
path: ~/pio
110+
path: ${GITHUB_WORKSPACE}/pio
123111
key: ${{ runner.os }}-${{ env.PARALLELIO_VERSION }}.parallelio
112+
124113
- name: Cache inputdata
125114
id: cache-inputdata
126-
uses: actions/cache@v3
115+
uses: actions/cache@v4
127116
with:
128117
path: $HOME/cesm/inputdata
129118
key: inputdata
130-
# - name: Build PNetCDF
131-
# if: steps.cache-pnetcdf.outputs.cache-hit != 'true'
132-
# uses: ESCOMP/CDEPS/.github/actions/buildpnetcdf@e06246b560d3132170bb1a5443fa3d65dfbd2040
133-
# with:
134-
# pnetcdf_version: ${{ env.PNETCDF_VERSION }}
135-
# install_prefix: $HOME/pnetcdf
136-
# - name: Build NetCDF Fortran
137-
# if: steps.cache-netcdf-fortran.outputs.cache-hit != 'true'
138-
# uses: ESCOMP/CDEPS/.github/actions/buildnetcdff@e06246b560d3132170bb1a5443fa3d65dfbd2040
139-
# with:
140-
# netcdf_fortran_version: ${{ env.NETCDF_FORTRAN_VERSION }}
141-
# install_prefix: $HOME/netcdf-fortran
142-
# netcdf_c_path: /usr
119+
143120
- name: Build ParallelIO
144121
if: steps.cache-PARALLELIO.outputs.cache-hit != 'true'
145122
uses: NCAR/ParallelIO/.github/actions/parallelio_cmake@05173a6556ea8d80eb34e3881a5014ea8f4b7543
146123
with:
147124
parallelio_version: ${{ env.ParallelIO_VERSION }}
148125
enable_fortran: True
149-
install_prefix: /home/runner/pio
126+
install_prefix: ${GITHUB_WORKSPACE}/pio
150127

151-
- name: Build ESMF
152-
if: steps.cache-esmf.outputs.cache-hit != 'true'
153-
uses: ESCOMP/CDEPS/.github/actions/buildesmf@e06246b560d3132170bb1a5443fa3d65dfbd2040
128+
- name: Install ESMF
129+
uses: esmf-org/install-esmf-action@v1
130+
env:
131+
ESMF_COMPILER: gfortran
132+
ESMF_BOPT: g
133+
ESMF_COMM: openmpi
134+
ESMF_NETCDF: nc-config
135+
ESMF_PNETCDF: pnetcdf-config
136+
ESMF_INSTALL_PREFIX: ${GITHUB_WORKSPACE}/ESMF
137+
ESMF_PIO: external
138+
ESMF_PIO_INCLUDE: ${GITHUB_WORKSPACE}/pio/include
139+
ESMF_PIO_LIBPATH: ${GITHUB_WORKSPACE}/pio/lib
154140
with:
155-
esmf_version: ${{ env.ESMF_VERSION }}
156-
esmf_bopt: g
157-
esmf_comm: openmpi
158-
install_prefix: ~/ESMF
159-
netcdf_c_path: /usr
160-
netcdf_fortran_path: /usr
161-
pnetcdf_path: /usr
162-
parallelio_path: ~/pio
141+
version: ${{ env.ESMF_VERSION }}
142+
esmpy: false
143+
cache: true
163144

164145

165146
- name: PREP for scripts regression test
@@ -169,14 +150,13 @@ jobs:
169150
pushd $GITHUB_WORKSPACE/cesm/cime/CIME/tests
170151
export SRCROOT=$GITHUB_WORKSPACE/cesm/
171152
export CIME_TEST_PLATFORM=ubuntu-latest
172-
export PIO_INCDIR=$HOME/pio/include
173-
export PIO_LIBDIR=$HOME/pio/lib
153+
export PIO_INCDIR=$GITHUB_WORKSPACE/pio/include
154+
export PIO_LIBDIR=$GITHUB_WORKSPACE/pio/lib
174155
export PIO_VERSION_MAJOR=2
175156
export PIO_TYPENAME_VALID_VALUES="netcdf,pnetcdf"
176157
export NETCDF_PATH=/usr
177158
export PNETCDF_PATH=/usr
178159
export LD_LIBRARY_PATH=/usr/lib/libx86_64-linux-gnu/:$LD_LIBRARY_PATH
179-
export ESMFMKFILE=$HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk
180160
cat <<EOF >> $GITHUB_WORKSPACE/cesm/ccs_config/machines/cmake_macros/ubuntu-latest.cmake
181161
set(NetCDF_Fortran_INCLUDE_DIR /usr/include)
182162
set(NetCDF_Fortran_LIBRARY /usr/lib/x86_64-gnu-Linux/libnetcdff.so)
@@ -190,6 +170,6 @@ jobs:
190170
popd
191171
# the following can be used by developers to login to the github server in case of errors
192172
# see https://github.com/marketplace/actions/debugging-with-tmate for further details
193-
- name: Setup tmate session
194-
if: ${{ failure() }}
195-
uses: mxschmitt/action-tmate@v3
173+
# - name: Setup tmate session
174+
# if: ${{ failure() }}
175+
# uses: mxschmitt/action-tmate@v3

cime_config/namelist_definition_drv.xml

-13
Original file line numberDiff line numberDiff line change
@@ -620,19 +620,6 @@
620620
</values>
621621
</entry>
622622

623-
<entry id="ocn2glc_levels">
624-
<type>char</type>
625-
<category>flds</category>
626-
<group>ALLCOMP_attributes</group>
627-
<desc>
628-
if the ocean component sends fields at multiple ocean levels to the
629-
land-ice component, these are the colon deliminted level indices
630-
</desc>
631-
<values>
632-
<value>1:10:19:26:30:33:35</value>
633-
</values>
634-
</entry>
635-
636623
<entry id="tfreeze_option" modify_via_xml="TFREEZE_SALTWATER_OPTION">
637624
<type>char</type>
638625
<category>control</category>

mediator/esmFldsExchange_cesm_mod.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -3206,7 +3206,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc)
32063206
!-----------------------------
32073207
! to glc: from ocn
32083208
!-----------------------------
3209-
if (is_local%wrap%ocn2glc_coupling) then
3209+
if (ocn2glc_coupling) then
32103210
if (phase == 'advertise') then
32113211
call addfld_from(compocn, 'So_t_depth')
32123212
call addfld_from(compocn, 'So_s_depth')

mediator/med_internalstate_mod.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ subroutine med_internalstate_coupling(gcomp, rc)
477477
isPresent=isPresent, isSet=isSet, rc=rc)
478478
if (ChkErr(rc,__LINE__,u_FILE_u)) return
479479
if (isPresent .and. isSet) then
480-
! are multiple ocean depths for temperature and salinity sent from the ocn to glc?
480+
! multiple ocean depths for temperature and salinity sent from the ocn to glc
481481
read(cvalue,*) is_local%wrap%ocn2glc_coupling
482482
else
483483
is_local%wrap%ocn2glc_coupling = .false.

mediator/med_phases_post_ocn_mod.F90

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ subroutine med_phases_post_ocn(gcomp, rc)
8383

8484
! Accumulate ocn input for glc if there is ocn->glc coupling
8585
if (is_local%wrap%ocn2glc_coupling) then
86+
call ESMF_LogWrite(subname//' DEBUG: calling med_phases_prep_glc_accum_ocn', ESMF_LOGMSG_INFO)
8687
call med_phases_prep_glc_accum_ocn(gcomp, rc)
8788
if (ChkErr(rc,__LINE__,u_FILE_u)) return
8889
end if

0 commit comments

Comments
 (0)