Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to work with emc/develop #1

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions .github/workflows/extbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
CPPFLAGS: "-I/usr/include -I/usr/local/include"

# Versions of all dependencies can be updated here
ESMF_VERSION: v8.6.0
ESMF_VERSION: v8.6.1
PNETCDF_VERSION: checkpoint.1.12.3
NETCDF_FORTRAN_VERSION: v4.6.1
PIO_VERSION: pio2_6_2
CDEPS_VERSION: cdeps1.0.26
CDEPS_VERSION: cdeps1.0.36
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Build the ESMF library, if the cache contains a previous build
# it will be used instead
- id: load-env
Expand All @@ -40,13 +40,13 @@ jobs:
sudo apt-get install pnetcdf-bin libpnetcdf-dev
sudo apt-get install autotools-dev autoconf
- id: cache-esmf
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/ESMF
key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF
- name: Cache ParallelIO
id: cache-ParallelIO
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/pio
key: ${{ runner.os }}-${{ env.PIO_VERSION }}.pio
Expand All @@ -71,31 +71,35 @@ jobs:
parallelio_path: $HOME/pio
- name: Cache CDEPS
id: cache-cdeps
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: $HOME/cdeps
key: ${{ runner.os }}-${{ env.CDEPS_VERSION }}.cdeps
path: /homme/runner/work/CMEPS/CMEPS/build-cdeps
key: ${{ runner.os }}-${{ env.CDEPS_VERSION }}.cdeps1

- name: checkout CDEPS
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ESCOMP/CDEPS
path: cdeps-src
ref: ${{ env.CDEPS_VERSION }}
- name: get genf90
run: |
cd cdeps-src
git submodule update --init
- name: Build CDEPS
if: steps.cache-cdeps.outputs.cache-hit != 'true'
uses: ESCOMP/CDEPS/.github/actions/[email protected]
with:
esmfmkfile: $HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk
pio_path: $HOME/pio
src_root: ${GITHUB_WORKSPACE}/cdeps-src
cmake_flags: " -Wno-dev -DCMAKE_BUILD_TYPE=DEBUG -DWERROR=ON -DCMAKE_Fortran_FLAGS=\"-DCPRGNU -g -Wall \
cmake_flags: " -Wno-dev -DDISABLE_FoX=ON -DCMAKE_BUILD_TYPE=DEBUG -DWERROR=ON -DCMAKE_Fortran_FLAGS=\"-DCPRGNU -g -Wall \
-ffree-form -ffree-line-length-none -fallow-argument-mismatch \""

- name: Build CMEPS
run: |
export ESMFMKFILE=$HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk
export PIO=$HOME/pio
export ESMFMKFILE=$HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk
mkdir build-cmeps
pushd build-cmeps
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" ../
Expand Down
82 changes: 32 additions & 50 deletions .github/workflows/srt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
CPPFLAGS: "-I/usr/include -I/usr/local/include "
LDFLAGS: "-L/usr/lib/x86_64-linux-gnu -lnetcdf -lnetcdff -lpnetcdf"
# Versions of all dependencies can be updated here
ESMF_VERSION: v8.6.0
ESMF_VERSION: v8.6.1
PARALLELIO_VERSION: pio2_6_2
CIME_MODEL: cesm
CIME_DRIVER: nuopc
Expand Down Expand Up @@ -64,13 +64,13 @@ jobs:
run: pip install -r requirements.txt
# use the latest cesm main
- name: cesm checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ESCOMP/CESM
path: cesm
# this cmeps commit
- name: cmeps checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: cesm/components/cmeps

Expand All @@ -79,7 +79,7 @@ jobs:
- name: checkout externals
run: |
pushd cesm
./manage_externals/checkout_externals ccs_config cdeps share mct cpl7 parallelio
./bin/git-fleximod update ccs_config cdeps share mct parallelio
cd ccs_config
git checkout main
cd ../
Expand All @@ -94,72 +94,55 @@ jobs:
git submodule update --init
cd ../components/cdeps
git checkout main
git submodule update --init
cd ../../share
git checkout main

- name: Cache ESMF
id: cache-esmf
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/ESMF
key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF1
# - name: cache pnetcdf
# id: cache-pnetcdf
# uses: actions/cache@v3
# with:
# path: ~/pnetcdf
# key: ${{ runner.os }}-${{ env.PNETCDF_VERSION}}-pnetcdf

# - name: Cache netcdf-fortran
# id: cache-netcdf-fortran
# uses: actions/cache@v3
# with:
# path: ~/netcdf-fortran
# key: ${{ runner.os }}-${{ env.NETCDF_FORTRAN_VERSION }}-netcdf-fortran
key: ${{ runner.os }}-${{ env.ESMF_VERSION }}

- name: Cache ParallelIO
id: cache-ParallelIO
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/pio
path: ${GITHUB_WORKSPACE}/pio
key: ${{ runner.os }}-${{ env.PARALLELIO_VERSION }}.parallelio

- name: Cache inputdata
id: cache-inputdata
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: $HOME/cesm/inputdata
key: inputdata
# - name: Build PNetCDF
# if: steps.cache-pnetcdf.outputs.cache-hit != 'true'
# uses: ESCOMP/CDEPS/.github/actions/buildpnetcdf@e06246b560d3132170bb1a5443fa3d65dfbd2040
# with:
# pnetcdf_version: ${{ env.PNETCDF_VERSION }}
# install_prefix: $HOME/pnetcdf
# - name: Build NetCDF Fortran
# if: steps.cache-netcdf-fortran.outputs.cache-hit != 'true'
# uses: ESCOMP/CDEPS/.github/actions/buildnetcdff@e06246b560d3132170bb1a5443fa3d65dfbd2040
# with:
# netcdf_fortran_version: ${{ env.NETCDF_FORTRAN_VERSION }}
# install_prefix: $HOME/netcdf-fortran
# netcdf_c_path: /usr

- name: Build ParallelIO
if: steps.cache-PARALLELIO.outputs.cache-hit != 'true'
uses: NCAR/ParallelIO/.github/actions/parallelio_cmake@05173a6556ea8d80eb34e3881a5014ea8f4b7543
with:
parallelio_version: ${{ env.ParallelIO_VERSION }}
enable_fortran: True
install_prefix: /home/runner/pio
install_prefix: ${GITHUB_WORKSPACE}/pio

- name: Build ESMF
if: steps.cache-esmf.outputs.cache-hit != 'true'
uses: ESCOMP/CDEPS/.github/actions/buildesmf@e06246b560d3132170bb1a5443fa3d65dfbd2040
- name: Install ESMF
uses: esmf-org/install-esmf-action@v1
env:
ESMF_COMPILER: gfortran
ESMF_BOPT: g
ESMF_COMM: openmpi
ESMF_NETCDF: nc-config
ESMF_PNETCDF: pnetcdf-config
ESMF_INSTALL_PREFIX: ${GITHUB_WORKSPACE}/ESMF
ESMF_PIO: external
ESMF_PIO_INCLUDE: ${GITHUB_WORKSPACE}/pio/include
ESMF_PIO_LIBPATH: ${GITHUB_WORKSPACE}/pio/lib
with:
esmf_version: ${{ env.ESMF_VERSION }}
esmf_bopt: g
esmf_comm: openmpi
install_prefix: ~/ESMF
netcdf_c_path: /usr
netcdf_fortran_path: /usr
pnetcdf_path: /usr
parallelio_path: ~/pio
version: ${{ env.ESMF_VERSION }}
esmpy: false
cache: true


- name: PREP for scripts regression test
Expand All @@ -169,14 +152,13 @@ jobs:
pushd $GITHUB_WORKSPACE/cesm/cime/CIME/tests
export SRCROOT=$GITHUB_WORKSPACE/cesm/
export CIME_TEST_PLATFORM=ubuntu-latest
export PIO_INCDIR=$HOME/pio/include
export PIO_LIBDIR=$HOME/pio/lib
export PIO_INCDIR=$GITHUB_WORKSPACE/pio/include
export PIO_LIBDIR=$GITHUB_WORKSPACE/pio/lib
export PIO_VERSION_MAJOR=2
export PIO_TYPENAME_VALID_VALUES="netcdf,pnetcdf"
export NETCDF_PATH=/usr
export PNETCDF_PATH=/usr
export LD_LIBRARY_PATH=/usr/lib/libx86_64-linux-gnu/:$LD_LIBRARY_PATH
export ESMFMKFILE=$HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk
cat <<EOF >> $GITHUB_WORKSPACE/cesm/ccs_config/machines/cmake_macros/ubuntu-latest.cmake
set(NetCDF_Fortran_INCLUDE_DIR /usr/include)
set(NetCDF_Fortran_LIBRARY /usr/lib/x86_64-gnu-Linux/libnetcdff.so)
Expand Down
4 changes: 0 additions & 4 deletions cesm/driver/esm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,6 @@ subroutine esm_init_pelayout(driver, maxthreads, rc)
#ifndef NO_MPI2
use mpi , only : MPI_COMM_NULL, mpi_comm_size
#endif
use m_MCTWorld , only : mct_world_init => init

#ifdef MED_PRESENT
use med_internalstate_mod , only : med_id
Expand Down Expand Up @@ -1164,9 +1163,6 @@ subroutine esm_init_pelayout(driver, maxthreads, rc)

enddo

call mct_world_init(componentCount+1, GLOBAL_COMM, comms, comps)


deallocate(petlist, comms, comps, comp_iamin, comp_comm_iam)

end subroutine esm_init_pelayout
Expand Down
17 changes: 14 additions & 3 deletions cesm/flux_atmocn/shr_flux_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &
& ocn_surface_flux_scheme, &
& add_gusts, &
& duu10n, &
& ugust_out, &
& ugust_out, &
& u10res, &
& ustar_sv ,re_sv ,ssq_sv, &
& missval)

Expand Down Expand Up @@ -194,6 +195,7 @@ SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &
real(R8),intent(out) :: qref (nMax) ! diag: 2m ref humidity (kg/kg)
real(R8),intent(out) :: duu10n(nMax) ! diag: 10m wind speed squared (m/s)^2
real(R8),intent(out) :: ugust_out(nMax) ! diag: gustiness addition to U10 (m/s)
real(R8),intent(out) :: u10res(nMax) ! diag: gustiness addition to U10 (m/s)

real(R8),intent(out),optional :: ustar_sv(nMax) ! diag: ustar
real(R8),intent(out),optional :: re_sv (nMax) ! diag: sqrt of exchange coefficient (water)
Expand Down Expand Up @@ -243,6 +245,7 @@ SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &
real(R8) :: cp ! specific heat of moist air
real(R8) :: fac ! vertical interpolation factor
real(R8) :: spval ! local missing value
real(R8) :: wind0 ! resolved large-scale 10m wind (no gust added)
!!++ COARE only
real(R8) :: zo,zot,zoq ! roughness lengths
real(R8) :: hsb,hlb ! sens & lat heat flxs at zbot
Expand Down Expand Up @@ -343,23 +346,28 @@ SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &

!--- compute some needed quantities ---
if (add_gusts) then
vmag = max(seq_flux_atmocn_minwind, sqrt( (ubot(n)-us(n))**2 + (vbot(n)-vs(n))**2) + ugust(min(rainc(n),6.94444e-4_r8)) )
vmag = max(seq_flux_atmocn_minwind, sqrt( (ubot(n)-us(n))**2 + (vbot(n)-vs(n))**2 + (1.0_R8*ugust(min(rainc(n),6.94444e-4_r8))**2)) )
ugust_out(n) = ugust(min(rainc(n),6.94444e-4_r8))
else
vmag = max(seq_flux_atmocn_minwind, sqrt( (ubot(n)-us(n))**2 + (vbot(n)-vs(n))**2) )
ugust_out(n) = 0.0_r8
end if
wind0 = max(seq_flux_atmocn_minwind, sqrt( (ubot(n)-us(n))**2 + (vbot(n)-vs(n))**2) )

if (use_coldair_outbreak_mod) then
! Cold Air Outbreak Modification:
! Increase windspeed for negative tbot-ts
! based on Mahrt & Sun 1995,MWR

if (tdiff(n).lt.td0) then
! if add_gusts wind0 and vmag are different, both need this factor.
vscl=min((1._R8+alpha*(abs(tdiff(n)-td0)**0.5_R8/abs(vmag))),maxscl)
vmag=vmag*vscl
vscl=min((1._R8+alpha*(abs(tdiff(n)-td0)**0.5_R8/abs(wind0))),maxscl)
wind0=wind0*vscl
endif
endif

ssq = 0.98_R8 * qsat(ts(n)) / rbot(n) ! sea surf hum (kg/kg)
delt = thbot(n) - ts(n) ! pot temp diff (K)
delq = qbot(n) - ssq ! spec hum dif (kg/kg)
Expand Down Expand Up @@ -460,6 +468,7 @@ SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &
qref(n) = qbot(n) - delq*fac

duu10n(n) = u10n*u10n ! 10m wind speed squared
u10res(n) = u10n * (wind0/vmag) ! resolved 10m wind

!------------------------------------------------------------
! optional diagnostics, needed for water tracer fluxes (dcn)
Expand All @@ -472,6 +481,7 @@ SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &
!------------------------------------------------------------
! no valid data here -- out of domain
!------------------------------------------------------------

sen (n) = spval ! sensible heat flux (W/m^2)
lat (n) = spval ! latent heat flux (W/m^2)
lwup (n) = spval ! long-wave upward heat flux (W/m^2)
Expand All @@ -484,7 +494,8 @@ SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &
tref (n) = spval ! 2m reference height temperature (K)
qref (n) = spval ! 2m reference height humidity (kg/kg)
duu10n(n) = spval ! 10m wind speed squared (m/s)^2
ugust_out(n) = spval ! gustiness addition (m/s)
ugust_out(n) = spval ! gustiness addition (m/s)
u10res(n) = spval ! 10m resolved wind (no gusts) (m/s)

if (present(ustar_sv)) ustar_sv(n) = spval
if (present(re_sv )) re_sv (n) = spval
Expand Down
2 changes: 0 additions & 2 deletions cesm/nuopc_cap_share/seq_drydep_mod.F90
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module seq_drydep_mod

use shr_drydep_mod, only: seq_drydep_setHCoeff=>shr_drydep_setHCoeff
use shr_drydep_mod

implicit none

! method specification
Expand Down
Loading