From 1213981882cd33e89f624692a2a7eb18ae2eca41 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Wed, 24 Apr 2024 02:44:12 -0600 Subject: [PATCH 01/13] changes for adding multi-level docn input to cdeps --- cime_config/namelist_definition_drv.xml | 13 ------ mediator/esmFldsExchange_cesm_mod.F90 | 2 +- mediator/med_phases_post_ocn_mod.F90 | 1 + mediator/med_phases_prep_glc_mod.F90 | 60 +++++++++++++++---------- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/cime_config/namelist_definition_drv.xml b/cime_config/namelist_definition_drv.xml index 698efb2c9..03dfcbe54 100644 --- a/cime_config/namelist_definition_drv.xml +++ b/cime_config/namelist_definition_drv.xml @@ -620,19 +620,6 @@ - - char - flds - ALLCOMP_attributes - - if the ocean component sends fields at multiple ocean levels to the - land-ice component, these are the colon deliminted level indices - - - 1:10:19:26:30:33:35 - - - char control diff --git a/mediator/esmFldsExchange_cesm_mod.F90 b/mediator/esmFldsExchange_cesm_mod.F90 index b68e4d13f..47d0ae1a7 100644 --- a/mediator/esmFldsExchange_cesm_mod.F90 +++ b/mediator/esmFldsExchange_cesm_mod.F90 @@ -3206,7 +3206,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc) !----------------------------- ! to glc: from ocn !----------------------------- - if (is_local%wrap%ocn2glc_coupling) then + if (ocn2glc_coupling) then if (phase == 'advertise') then call addfld_from(compocn, 'So_t_depth') call addfld_from(compocn, 'So_s_depth') diff --git a/mediator/med_phases_post_ocn_mod.F90 b/mediator/med_phases_post_ocn_mod.F90 index bfc234507..b253de664 100644 --- a/mediator/med_phases_post_ocn_mod.F90 +++ b/mediator/med_phases_post_ocn_mod.F90 @@ -83,6 +83,7 @@ subroutine med_phases_post_ocn(gcomp, rc) ! Accumulate ocn input for glc if there is ocn->glc coupling if (is_local%wrap%ocn2glc_coupling) then + call ESMF_LogWrite(subname//' DEBUG: calling med_phases_prep_glc_accum_ocn', ESMF_LOGMSG_INFO) call med_phases_prep_glc_accum_ocn(gcomp, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return end if diff --git a/mediator/med_phases_prep_glc_mod.F90 b/mediator/med_phases_prep_glc_mod.F90 index 1fecf1a86..542cac761 100644 --- a/mediator/med_phases_prep_glc_mod.F90 +++ b/mediator/med_phases_prep_glc_mod.F90 @@ -37,6 +37,7 @@ module med_phases_prep_glc_mod use med_methods_mod , only : FB_check_for_nans => med_methods_FB_check_for_nans use med_methods_mod , only : field_getdata2d => med_methods_Field_getdata2d use med_methods_mod , only : field_getdata1d => med_methods_Field_getdata1d + use med_methods_mod , only : fldchk => med_methods_FB_FldChk use med_utils_mod , only : chkerr => med_utils_ChkErr use med_time_mod , only : med_time_alarmInit use glc_elevclass_mod , only : glc_get_num_elevation_classes @@ -44,6 +45,8 @@ module med_phases_prep_glc_mod use glc_elevclass_mod , only : glc_get_fractional_icecov use perf_mod , only : t_startf, t_stopf + use shr_sys_mod, only : shr_sys_abort + implicit none private @@ -106,7 +109,7 @@ module med_phases_prep_glc_mod integer , public :: ocnAccum2glc_cnt character(len=14) :: fldnames_fr_ocn(2) = (/'So_t_depth','So_s_depth'/) ! TODO: what else needs to be added here type(ESMF_DynamicMask) :: dynamicOcnMask - integer, parameter :: num_ocndepths = 7 + integer, parameter :: num_ocndepths = 30 type(ESMF_Clock) :: prepglc_clock character(*), parameter :: u_FILE_u = & @@ -319,7 +322,7 @@ subroutine med_phases_prep_glc_init(gcomp, rc) end if ! ------------------------------- - ! If ocn->glc couplng is active + ! If ocn->glc coupling is active ! ------------------------------- if (is_local%wrap%ocn2glc_coupling) then @@ -355,8 +358,8 @@ subroutine med_phases_prep_glc_init(gcomp, rc) ! Create a dynamic mask object ! The dynamic mask object further holds a pointer to the routine that will be called in order to ! handle dynamically masked elements - in this case its DynOcnMaskProc (see below) - call ESMF_DynamicMaskSetR8R8R8(dynamicOcnMask, dynamicSrcMaskValue=czero, & - dynamicMaskRoutine=DynOcnMaskProc, rc=rc) + call ESMF_DynamicMaskSetR8R8R8(dynamicOcnMask, dynamicMaskRoutine=DynOcnMaskProc, & + dynamicSrcMaskValue=1.e30_r8, handleAllElements=.true., rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return end if @@ -618,21 +621,24 @@ subroutine med_phases_prep_glc_avg(gcomp, rc) if (do_avg) then ! Always average import from accumulated land import data do n = 1, size(fldnames_fr_lnd) - call fldbun_getdata2d(FBlndAccum2glc_l, fldnames_fr_lnd(n), data2d, rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - if (lndAccum2glc_cnt > 0) then - ! If accumulation count is greater than 0, do the averaging - data2d(:,:) = data2d(:,:) / real(lndAccum2glc_cnt) - else - ! If accumulation count is 0, then simply set the averaged field bundle values from the land - ! to the import field bundle values - call fldbun_getdata2d(is_local%wrap%FBImp(complnd,complnd), fldnames_fr_lnd(n), data2d_import, rc) + if (fldchk(FBlndAccum2glc_l, fldnames_fr_lnd(n), rc=rc)) then + call fldbun_getdata2d(FBlndAccum2glc_l, fldnames_fr_lnd(n), data2d, rc) if (chkerr(rc,__LINE__,u_FILE_u)) return - data2d(:,:) = data2d_import(:,:) + if (lndAccum2glc_cnt > 0) then + ! If accumulation count is greater than 0, do the averaging + data2d(:,:) = data2d(:,:) / real(lndAccum2glc_cnt) + else + ! If accumulation count is 0, then simply set the averaged field bundle values from the land + ! to the import field bundle values + call fldbun_getdata2d(is_local%wrap%FBImp(complnd,complnd), fldnames_fr_lnd(n), data2d_import, rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + data2d(:,:) = data2d_import(:,:) + end if end if end do if (is_local%wrap%ocn2glc_coupling) then + call ESMF_LogWrite(subname//' DEBUG: averaging FBocnAccum2glc_o', ESMF_LOGMSG_INFO) ! Average import from accumulated ocn import data do n = 1, size(fldnames_fr_ocn) call fldbun_getdata2d(FBocnAccum2glc_o, fldnames_fr_ocn(n), data2d, rc) @@ -662,6 +668,7 @@ subroutine med_phases_prep_glc_avg(gcomp, rc) call ESMF_FieldBundleGet(is_local%wrap%FBExp(compglc(ns)), fldnames_fr_ocn(n), field=lfield_dst, rc=rc) if (chkErr(rc,__LINE__,u_FILE_u)) return ! Do mapping of ocn to glc with dynamic masking + write(6,'(a)')' DEBUG: mapping FBocnAccum2glc_o with dynamic masking for '//trim(fldnames_fr_ocn(n)) call ESMF_FieldRegrid(lfield_src, lfield_dst, & routehandle=is_local%wrap%RH(compocn,compglc(ns),mapbilnr), dynamicMask=dynamicOcnMask, rc=rc) if (chkErr(rc,__LINE__,u_FILE_u)) return @@ -1244,7 +1251,7 @@ subroutine dynOcnMaskProc(dynamicMaskList, dynamicSrcMaskValue, dynamicDstMaskVa integer , intent(out) :: rc ! local variables - integer :: i, j + integer :: no, ni real(ESMF_KIND_R8) :: renorm !--------------------------------------------------------------- @@ -1253,21 +1260,26 @@ subroutine dynOcnMaskProc(dynamicMaskList, dynamicSrcMaskValue, dynamicDstMaskVa ! Below - ONLY if you do NOT have the source masked out then do ! the regridding (which is done explicitly here) + write(6,*)'DEBUG: dynamicSrcMaskValue = ',dynamicSrcMaskValue if (associated(dynamicMaskList)) then - do i=1, size(dynamicMaskList) - dynamicMaskList(i)%dstElement = czero ! set to zero + do no = 1, size(dynamicMaskList) + dynamicMaskList(no)%dstElement = czero ! set to zero renorm = 0.d0 ! reset - do j = 1, size(dynamicMaskList(i)%factor) - if (dynamicSrcMaskValue /= dynamicMaskList(i)%srcElement(j)) then - dynamicMaskList(i)%dstElement = dynamicMaskList(i)%dstElement + & - (dynamicMaskList(i)%factor(j) * dynamicMaskList(i)%srcElement(j)) - renorm = renorm + dynamicMaskList(i)%factor(j) + do ni = 1, size(dynamicMaskList(no)%factor) + + write(6,'(a,2(i10,2x),3(d13.5,2x))')'DEBUG: ',no,ni,& + dynamicMaskList(no)%srcElement(ni), dynamicMaskList(no)%dstElement, dynamicMaskList(no)%factor(ni) + + if (dynamicSrcMaskValue /= dynamicMaskList(no)%srcElement(ni)) then + dynamicMaskList(no)%dstElement = dynamicMaskList(no)%dstElement + & + (dynamicMaskList(no)%factor(ni) * dynamicMaskList(no)%srcElement(ni)) + renorm = renorm + dynamicMaskList(no)%factor(ni) endif enddo if (renorm > 0.d0) then - dynamicMaskList(i)%dstElement = dynamicMaskList(i)%dstElement / renorm + dynamicMaskList(no)%dstElement = dynamicMaskList(no)%dstElement / renorm else if (present(dynamicSrcMaskValue)) then - dynamicMaskList(i)%dstElement = dynamicSrcMaskValue + dynamicMaskList(no)%dstElement = dynamicSrcMaskValue else rc = ESMF_RC_ARG_BAD ! error detected return From 2289571bb7504538f3109596722b84ab177816d1 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Wed, 24 Apr 2024 09:36:27 -0600 Subject: [PATCH 02/13] implemented correct mapping of multi-level ocean to glc --- mediator/med_internalstate_mod.F90 | 2 +- mediator/med_phases_prep_glc_mod.F90 | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/mediator/med_internalstate_mod.F90 b/mediator/med_internalstate_mod.F90 index e45331f76..fb35645db 100644 --- a/mediator/med_internalstate_mod.F90 +++ b/mediator/med_internalstate_mod.F90 @@ -477,7 +477,7 @@ subroutine med_internalstate_coupling(gcomp, rc) isPresent=isPresent, isSet=isSet, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return if (isPresent .and. isSet) then - ! are multiple ocean depths for temperature and salinity sent from the ocn to glc? + ! multiple ocean depths for temperature and salinity sent from the ocn to glc read(cvalue,*) is_local%wrap%ocn2glc_coupling else is_local%wrap%ocn2glc_coupling = .false. diff --git a/mediator/med_phases_prep_glc_mod.F90 b/mediator/med_phases_prep_glc_mod.F90 index 542cac761..4a1df0eea 100644 --- a/mediator/med_phases_prep_glc_mod.F90 +++ b/mediator/med_phases_prep_glc_mod.F90 @@ -20,7 +20,7 @@ module med_phases_prep_glc_mod use ESMF , only : ESMF_Field, ESMF_FieldGet, ESMF_FieldCreate use ESMF , only : ESMF_Mesh, ESMF_MESHLOC_ELEMENT, ESMF_TYPEKIND_R8, ESMF_KIND_R8 use ESMF , only : ESMF_DYNAMICMASK, ESMF_DynamicMaskSetR8R8R8, ESMF_DYNAMICMASKELEMENTR8R8R8 - use ESMF , only : ESMF_FieldRegrid + use ESMF , only : ESMF_FieldRegrid, ESMF_REGION_EMPTY use med_internalstate_mod , only : complnd, compocn, mapbilnr, mapconsd, compname, compglc use med_internalstate_mod , only : InternalState, maintask, logunit use med_map_mod , only : med_map_routehandles_init, med_map_rh_is_created @@ -523,6 +523,7 @@ subroutine med_phases_prep_glc_avg(gcomp, rc) logical :: isPresent, isSet logical :: write_histaux_l2x1yrg character(len=*) , parameter :: subname=' (med_phases_prep_glc) ' + integer :: k,cnt !--------------------------------------- call t_startf('MED:'//subname) @@ -638,7 +639,6 @@ subroutine med_phases_prep_glc_avg(gcomp, rc) end do if (is_local%wrap%ocn2glc_coupling) then - call ESMF_LogWrite(subname//' DEBUG: averaging FBocnAccum2glc_o', ESMF_LOGMSG_INFO) ! Average import from accumulated ocn import data do n = 1, size(fldnames_fr_ocn) call fldbun_getdata2d(FBocnAccum2glc_o, fldnames_fr_ocn(n), data2d, rc) @@ -668,10 +668,14 @@ subroutine med_phases_prep_glc_avg(gcomp, rc) call ESMF_FieldBundleGet(is_local%wrap%FBExp(compglc(ns)), fldnames_fr_ocn(n), field=lfield_dst, rc=rc) if (chkErr(rc,__LINE__,u_FILE_u)) return ! Do mapping of ocn to glc with dynamic masking - write(6,'(a)')' DEBUG: mapping FBocnAccum2glc_o with dynamic masking for '//trim(fldnames_fr_ocn(n)) call ESMF_FieldRegrid(lfield_src, lfield_dst, & - routehandle=is_local%wrap%RH(compocn,compglc(ns),mapbilnr), dynamicMask=dynamicOcnMask, rc=rc) + routehandle=is_local%wrap%RH(compocn,compglc(ns),mapbilnr), dynamicMask=dynamicOcnMask, & + zeroregion=ESMF_REGION_EMPTY, rc=rc) if (chkErr(rc,__LINE__,u_FILE_u)) return + call fldbun_getdata2d(is_local%wrap%FBExp(compglc(ns)), fldnames_fr_ocn(n), data2d, rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + ! reset values of 0 to spval + where (data2d == 0._r8) data2d = shr_const_spval end do end do ocnAccum2glc_cnt = 0 @@ -1251,7 +1255,7 @@ subroutine dynOcnMaskProc(dynamicMaskList, dynamicSrcMaskValue, dynamicDstMaskVa integer , intent(out) :: rc ! local variables - integer :: no, ni + integer :: no, ni, i, j real(ESMF_KIND_R8) :: renorm !--------------------------------------------------------------- @@ -1260,17 +1264,14 @@ subroutine dynOcnMaskProc(dynamicMaskList, dynamicSrcMaskValue, dynamicDstMaskVa ! Below - ONLY if you do NOT have the source masked out then do ! the regridding (which is done explicitly here) - write(6,*)'DEBUG: dynamicSrcMaskValue = ',dynamicSrcMaskValue if (associated(dynamicMaskList)) then do no = 1, size(dynamicMaskList) dynamicMaskList(no)%dstElement = czero ! set to zero renorm = 0.d0 ! reset do ni = 1, size(dynamicMaskList(no)%factor) - - write(6,'(a,2(i10,2x),3(d13.5,2x))')'DEBUG: ',no,ni,& - dynamicMaskList(no)%srcElement(ni), dynamicMaskList(no)%dstElement, dynamicMaskList(no)%factor(ni) - - if (dynamicSrcMaskValue /= dynamicMaskList(no)%srcElement(ni)) then + ! Need to multiply by .90 to handle averaging of input fields before remapping is called + if ( dynamicMaskList(no)%srcElement(ni) > 0.d0 .and. & + dynamicMaskList(no)%srcElement(ni) < dynamicSrcMaskValue*.90) then dynamicMaskList(no)%dstElement = dynamicMaskList(no)%dstElement + & (dynamicMaskList(no)%factor(ni) * dynamicMaskList(no)%srcElement(ni)) renorm = renorm + dynamicMaskList(no)%factor(ni) From 0577deb05f8997f736680023fcac0021ab1c9829 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 14 May 2024 08:43:03 -0600 Subject: [PATCH 03/13] update esmf build --- .github/workflows/srt.yml | 45 ++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/srt.yml b/.github/workflows/srt.yml index 1044661ba..21af63350 100644 --- a/.github/workflows/srt.yml +++ b/.github/workflows/srt.yml @@ -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 @@ -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 @@ -94,10 +94,11 @@ jobs: git submodule update --init cd ../components/cdeps git checkout main + git submodule update --init - name: Cache ESMF id: cache-esmf - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/ESMF key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF1 @@ -117,13 +118,13 @@ jobs: - name: Cache ParallelIO id: cache-ParallelIO - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/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 @@ -148,18 +149,22 @@ jobs: enable_fortran: True install_prefix: /home/runner/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 @@ -190,6 +195,6 @@ jobs: popd # the following can be used by developers to login to the github server in case of errors # see https://github.com/marketplace/actions/debugging-with-tmate for further details - - name: Setup tmate session - if: ${{ failure() }} - uses: mxschmitt/action-tmate@v3 +# - name: Setup tmate session +# if: ${{ failure() }} +# uses: mxschmitt/action-tmate@v3 From 359513d939b488d4f22f6c60d6ee0529032489e2 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 14 May 2024 08:55:29 -0600 Subject: [PATCH 04/13] fix pio path in github srt --- .github/workflows/srt.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/srt.yml b/.github/workflows/srt.yml index 21af63350..9a2ab750b 100644 --- a/.github/workflows/srt.yml +++ b/.github/workflows/srt.yml @@ -120,7 +120,7 @@ jobs: id: cache-ParallelIO uses: actions/cache@v4 with: - path: ~/pio + path: ${GITHUB_WORKSPACE}/pio key: ${{ runner.os }}-${{ env.PARALLELIO_VERSION }}.parallelio - name: Cache inputdata id: cache-inputdata @@ -147,7 +147,7 @@ jobs: with: parallelio_version: ${{ env.ParallelIO_VERSION }} enable_fortran: True - install_prefix: /home/runner/pio + install_prefix: ${GITHUB_WORKSPACE}/pio - name: Install ESMF uses: esmf-org/install-esmf-action@v1 @@ -174,8 +174,8 @@ 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 From b5165bbb9bb4d3f1a39008b7ab9e2444834029c8 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 14 May 2024 09:39:38 -0600 Subject: [PATCH 05/13] working on srt --- .github/workflows/srt.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/srt.yml b/.github/workflows/srt.yml index 9a2ab750b..01dfd7d50 100644 --- a/.github/workflows/srt.yml +++ b/.github/workflows/srt.yml @@ -181,7 +181,7 @@ jobs: 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 + export ESMFMKFILE=$GITHUB_WORKSPACE/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk cat <> $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) From 91213a0c26c58d5f132b1c0e8ae2ad9182362da8 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 14 May 2024 13:36:25 -0600 Subject: [PATCH 06/13] more workflow updates --- .github/workflows/extbuild.yml | 14 +++++++------- .github/workflows/srt.yml | 31 +++---------------------------- 2 files changed, 10 insertions(+), 35 deletions(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index 0614d5acb..a558fa57a 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -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.35 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 @@ -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 @@ -71,13 +71,13 @@ 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 - name: checkout CDEPS - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ESCOMP/CDEPS path: cdeps-src diff --git a/.github/workflows/srt.yml b/.github/workflows/srt.yml index 01dfd7d50..63121dd7a 100644 --- a/.github/workflows/srt.yml +++ b/.github/workflows/srt.yml @@ -101,20 +101,7 @@ jobs: 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 @@ -122,25 +109,14 @@ jobs: with: path: ${GITHUB_WORKSPACE}/pio key: ${{ runner.os }}-${{ env.PARALLELIO_VERSION }}.parallelio + - name: Cache inputdata id: cache-inputdata 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 @@ -181,7 +157,6 @@ jobs: export NETCDF_PATH=/usr export PNETCDF_PATH=/usr export LD_LIBRARY_PATH=/usr/lib/libx86_64-linux-gnu/:$LD_LIBRARY_PATH - export ESMFMKFILE=$GITHUB_WORKSPACE/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk cat <> $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) From 6a522585e6b525ae8d2b75f6707453090890df57 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 15 May 2024 10:21:56 -0600 Subject: [PATCH 07/13] work on ext build --- .github/workflows/extbuild.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index a558fa57a..c5cce2288 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -89,12 +89,11 @@ jobs: 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 mkdir build-cmeps pushd build-cmeps From e0007c0de1133082af91914b8825463de268ea28 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 15 May 2024 10:49:37 -0600 Subject: [PATCH 08/13] case error correction --- .github/workflows/extbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index c5cce2288..3fbe99ab0 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -89,7 +89,7 @@ jobs: 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 -DDISABLE_FOX=ON -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 From 85f01535581aab492448df43ab7fab0a46d833aa Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 15 May 2024 11:49:31 -0600 Subject: [PATCH 09/13] try this for cdeps build --- .github/workflows/extbuild.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index 3fbe99ab0..cb353dd30 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -73,7 +73,7 @@ jobs: id: cache-cdeps uses: actions/cache@v4 with: - path: $HOME/cdeps + path: cdeps-src key: ${{ runner.os }}-${{ env.CDEPS_VERSION }}.cdeps - name: checkout CDEPS @@ -82,6 +82,10 @@ jobs: 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/buildcdeps@cdeps1.0.26 From e10beac899f940778537f3a52c57f2bc85d7e490 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 15 May 2024 15:11:32 -0600 Subject: [PATCH 10/13] more github workflow work --- .github/workflows/extbuild.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index cb353dd30..7f9b159bc 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -24,7 +24,7 @@ jobs: PNETCDF_VERSION: checkpoint.1.12.3 NETCDF_FORTRAN_VERSION: v4.6.1 PIO_VERSION: pio2_6_2 - CDEPS_VERSION: cdeps1.0.35 + CDEPS_VERSION: cdeps1.0.36 steps: - uses: actions/checkout@v4 # Build the ESMF library, if the cache contains a previous build @@ -99,6 +99,7 @@ jobs: - name: Build CMEPS run: | 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" ../ From 522dd60d382d0e2e76012f617a611dc0d0e78fbc Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 15 May 2024 16:41:04 -0600 Subject: [PATCH 11/13] clean up compiler warnings --- mediator/med_phases_prep_glc_mod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediator/med_phases_prep_glc_mod.F90 b/mediator/med_phases_prep_glc_mod.F90 index 4a1df0eea..8d8685f4f 100644 --- a/mediator/med_phases_prep_glc_mod.F90 +++ b/mediator/med_phases_prep_glc_mod.F90 @@ -523,7 +523,7 @@ subroutine med_phases_prep_glc_avg(gcomp, rc) logical :: isPresent, isSet logical :: write_histaux_l2x1yrg character(len=*) , parameter :: subname=' (med_phases_prep_glc) ' - integer :: k,cnt + !--------------------------------------- call t_startf('MED:'//subname) @@ -1255,7 +1255,7 @@ subroutine dynOcnMaskProc(dynamicMaskList, dynamicSrcMaskValue, dynamicDstMaskVa integer , intent(out) :: rc ! local variables - integer :: no, ni, i, j + integer :: no, ni real(ESMF_KIND_R8) :: renorm !--------------------------------------------------------------- From 158c82f58940af176db38e21262c6aa668cbd229 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Thu, 16 May 2024 09:50:58 -0600 Subject: [PATCH 12/13] remove unused shr_sys_abort --- mediator/med_phases_prep_glc_mod.F90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/mediator/med_phases_prep_glc_mod.F90 b/mediator/med_phases_prep_glc_mod.F90 index 8d8685f4f..fb46bb8a4 100644 --- a/mediator/med_phases_prep_glc_mod.F90 +++ b/mediator/med_phases_prep_glc_mod.F90 @@ -45,8 +45,6 @@ module med_phases_prep_glc_mod use glc_elevclass_mod , only : glc_get_fractional_icecov use perf_mod , only : t_startf, t_stopf - use shr_sys_mod, only : shr_sys_abort - implicit none private From 978fcaabcce86c7873a25b879a3570c6a473ec30 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Thu, 16 May 2024 11:01:06 -0600 Subject: [PATCH 13/13] fix cdeps cache issue --- .github/workflows/extbuild.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index 7f9b159bc..e1c69cd7b 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -73,8 +73,8 @@ jobs: id: cache-cdeps uses: actions/cache@v4 with: - path: cdeps-src - 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@v4