Skip to content

Commit ef71459

Browse files
committed
Merge commit '756065fa' into errors_to_cesmlog_524_runtype_branch_525_cpl_inputdatalist_526
2 parents 6ca33f9 + 756065f commit ef71459

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3743
-4377
lines changed

.github/workflows/bumpversion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- uses: actions/checkout@v2
1111
- name: Bump version and push tag
1212
id: tag_version
13-
uses: mathieudutour/github-tag-action@v5.5
13+
uses: mathieudutour/github-tag-action@v6.2
1414
with:
1515
github_token: ${{ secrets.GITHUB_TOKEN }}
1616
create_annotated_tag: true

.github/workflows/extbuild.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ 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.1
24-
PNETCDF_VERSION: checkpoint.1.12.3
23+
ESMF_VERSION: v8.8.0
24+
PNETCDF_VERSION: checkpoint.1.14.0
2525
NETCDF_FORTRAN_VERSION: v4.6.1
26-
PIO_VERSION: pio2_6_3
27-
CDEPS_VERSION: cdeps1.0.59
26+
PIO_VERSION: pio2_6_5
27+
CDEPS_VERSION: cdeps1.0.80
2828
steps:
2929
- uses: actions/checkout@v4
3030
# Build the ESMF library, if the cache contains a previous build
@@ -75,7 +75,7 @@ jobs:
7575
with:
7676
path: /homme/runner/work/CMEPS/CMEPS/build-cdeps
7777
key: ${{ runner.os }}-${{ env.CDEPS_VERSION }}.cdeps1
78-
78+
7979
- name: checkout CDEPS
8080
uses: actions/checkout@v4
8181
with:
@@ -85,7 +85,7 @@ jobs:
8585
- name: get genf90
8686
run: |
8787
cd cdeps-src
88-
git submodule update --init
88+
git submodule update --init
8989
- name: Build CDEPS
9090
if: steps.cache-cdeps.outputs.cache-hit != 'true'
9191
uses: ESCOMP/CDEPS/.github/actions/[email protected]
@@ -95,7 +95,7 @@ jobs:
9595
src_root: ${GITHUB_WORKSPACE}/cdeps-src
9696
cmake_flags: " -Wno-dev -DDISABLE_FoX=ON -DCMAKE_BUILD_TYPE=DEBUG -DWERROR=ON -DCMAKE_Fortran_FLAGS=\"-DCPRGNU -g -Wall \
9797
-ffree-form -ffree-line-length-none -fallow-argument-mismatch \""
98-
98+
9999
- name: Build CMEPS
100100
run: |
101101
export PIO=$HOME/pio

.github/workflows/srt.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
CPPFLAGS: "-I/usr/include -I/usr/local/include "
2828
LDFLAGS: "-L/usr/lib/x86_64-linux-gnu -lnetcdf -lnetcdff -lpnetcdf"
2929
# Versions of all dependencies can be updated here
30-
ESMF_VERSION: v8.6.1
31-
PARALLELIO_VERSION: pio2_6_3
30+
ESMF_VERSION: v8.8.0
31+
PARALLELIO_VERSION: pio2_6_6
3232
CIME_MODEL: cesm
3333
CIME_DRIVER: nuopc
3434
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -124,7 +124,7 @@ jobs:
124124

125125
- name: Build ParallelIO
126126
if: steps.cache-PARALLELIO.outputs.cache-hit != 'true'
127-
uses: NCAR/ParallelIO/.github/actions/parallelio_cmake@05173a6556ea8d80eb34e3881a5014ea8f4b7543
127+
uses: NCAR/ParallelIO/.github/actions/parallelio_cmake@b38e34eeb9b75ce81ac94daf7c5245931de00b9d
128128
with:
129129
parallelio_version: ${{ env.ParallelIO_VERSION }}
130130
enable_fortran: True
@@ -171,10 +171,25 @@ jobs:
171171
- name: scripts regression tests
172172
run: |
173173
pushd $GITHUB_WORKSPACE/cesm/cime/CIME/tests
174-
./scripts_regression_tests.py --no-fortran-run --compiler gnu --mpilib openmpi --machine ubuntu-latest
174+
./scripts_regression_tests.py --no-fortran-run --compiler gnu --mpilib openmpi --machine ubuntu-latest --no-teardown
175175
popd
176+
177+
# How to download artifacts:
178+
# https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts
179+
180+
# - name: Upload test logs
181+
# if: ${{ failure() }}
182+
# steps:
183+
# - name: Tar test logs
184+
# run: tar zcf scratch-${{ matrix.python-version }}.tar.gz /home/runner/cesm/scratch
185+
# - name: save artifact
186+
# uses: actions/upload-artifact@v4
187+
# with:
188+
# name: test-logs-${{ matrix.python-version }}
189+
# path: scratch-${{ matrix.python-version }}.tar.gz
190+
# retention-days: 4
176191
# the following can be used by developers to login to the github server in case of errors
177192
# see https://github.com/marketplace/actions/debugging-with-tmate for further details
178-
# - name: Setup tmate session
179-
# if: ${{ failure() }}
180-
# uses: mxschmitt/action-tmate@v3
193+
- name: Setup tmate session
194+
if: ${{ failure() }}
195+
uses: mxschmitt/action-tmate@v3

cesm/driver/esm.F90

Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ module ESM
55
!-----------------------------------------------------------------------------
66

77
use shr_kind_mod , only : r8=>shr_kind_r8, cl=>shr_kind_cl, cs=>shr_kind_cs
8-
use shr_sys_mod , only : shr_sys_abort
98
use shr_mpi_mod , only : shr_mpi_bcast
109
use shr_mem_mod , only : shr_mem_init
11-
use shr_log_mod , only : shr_log_setLogunit
10+
use shr_log_mod , only : shr_log_setLogunit, shr_log_error
1211
use esm_utils_mod, only : logunit, maintask, dbug_flag, chkerr
13-
12+
use esmf , only : ESMF_FAILURE, ESMF_VMBARRIER
1413
implicit none
1514
private
1615

@@ -490,10 +489,14 @@ subroutine InitAttributes(driver, rc)
490489
if (chkerr(rc,__LINE__,u_FILE_u)) return
491490

492491
if (.not. shr_wv_sat_valid_idx(shr_wv_sat_get_scheme_idx(trim(wv_sat_scheme)))) then
493-
call shr_sys_abort(subname//': "'//trim(wv_sat_scheme)//'" is not a recognized saturation vapor pressure scheme name')
492+
call shr_log_error(subname//': "'//trim(wv_sat_scheme)//'" is not a recognized saturation vapor pressure scheme name')
493+
rc = ESMF_FAILURE
494+
return
494495
end if
495496
if (.not. shr_wv_sat_set_default(wv_sat_scheme)) then
496-
call shr_sys_abort('Invalid wv_sat_scheme.')
497+
call shr_log_error('Invalid wv_sat_scheme.')
498+
rc = ESMF_FAILURE
499+
return
497500
end if
498501

499502
call NUOPC_CompAttributeGet(driver, name="wv_sat_transition_start", value=cvalue, rc=rc)
@@ -522,7 +525,9 @@ subroutine InitAttributes(driver, rc)
522525

523526
call shr_wv_sat_init(shr_const_tkfrz, shr_const_tktrip, wv_sat_transition_start, epsilo, errstring)
524527
if (errstring /= "") then
525-
call shr_sys_abort('shr_wv_sat_init: '//trim(errstring))
528+
call shr_log_error('shr_wv_sat_init: '//trim(errstring))
529+
rc = ESMF_FAILURE
530+
return
526531
end if
527532

528533
! The below produces internal lookup tables in the range 175-374K for
@@ -567,26 +572,34 @@ subroutine CheckAttributes( driver, rc )
567572
call NUOPC_CompAttributeGet(driver, name="cime_model", value=cime_model, rc=rc)
568573
if (chkerr(rc,__LINE__,u_FILE_u)) return
569574
if ( trim(cime_model) /= 'cesm' .and. trim(cime_model) /= 'ufs') then
570-
call shr_sys_abort( subname//': cime_model must be set to cesm or ufs, aborting')
575+
call shr_log_error( subname//': cime_model must be set to cesm or ufs, aborting')
576+
rc = ESMF_FAILURE
577+
return
571578
end if
572579

573580
! --- LogFile ending name -----
574581
call NUOPC_CompAttributeGet(driver, name="logFilePostFix", value=logFilePostFix, rc=rc)
575582
if (chkerr(rc,__LINE__,u_FILE_u)) return
576583

577584
if ( len_trim(logFilePostFix) == 0 ) then
578-
call shr_sys_abort( subname//': logFilePostFix must be set to something not blank' )
585+
call shr_log_error( subname//': logFilePostFix must be set to something not blank' )
586+
rc = ESMF_FAILURE
587+
return
579588
end if
580589

581590
! --- Output path root directory -----
582591
call NUOPC_CompAttributeGet(driver, name="outPathRoot", value=outPathRoot, rc=rc)
583592
if (chkerr(rc,__LINE__,u_FILE_u)) return
584593

585594
if ( len_trim(outPathRoot) == 0 ) then
586-
call shr_sys_abort( subname//': outPathRoot must be set' )
595+
call shr_log_error( subname//': outPathRoot must be set' )
596+
rc = ESMF_FAILURE
597+
return
587598
end if
588599
if ( index(outPathRoot, "/", back=.true.) /= len_trim(outPathRoot) ) then
589-
call shr_sys_abort( subname//': outPathRoot must end with a slash' )
600+
call shr_log_error( subname//': outPathRoot must end with a slash' )
601+
rc = ESMF_FAILURE
602+
return
590603
end if
591604

592605
end subroutine CheckAttributes
@@ -1256,7 +1269,7 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
12561269

12571270
if ( (scol_lon < scol_spval .and. scol_lat > scol_spval) .or. &
12581271
(scol_lon > scol_spval .and. scol_lat < scol_spval)) then
1259-
call shr_sys_abort(subname//' ERROR: '//trim(compname)//' both scol_lon and scol_lat must be greater than -999 ')
1272+
call shr_log_error(subname//' ERROR: '//trim(compname)//' both scol_lon and scol_lat must be greater than -999 ')
12601273
end if
12611274

12621275
! Set the special value for single column - if pts_lat or pts_lon are equal to the special value
@@ -1271,7 +1284,7 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
12711284
! ATM, LND, OCN and ICE components only
12721285
! verify that WAV and LND are not trying to use single column mode
12731286
if (trim(compname) == 'WAV' .or. trim(compname) == 'ROF' .or. trim(compname) == 'GLC') then
1274-
call shr_sys_abort(subname//' ERROR: '//trim(compname)//' does not support single column mode ')
1287+
call shr_log_error(subname//' ERROR: '//trim(compname)//' does not support single column mode ')
12751288
end if
12761289

12771290
! ensure that single column mode is only run on 1 pet
@@ -1280,7 +1293,7 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
12801293
call ESMF_VMGet(vm, petcount=petcount, rc=rc)
12811294
if (ChkErr(rc,__LINE__,u_FILE_u)) return
12821295
if (petcount > 1) then
1283-
call shr_sys_abort(subname//' ERROR: single column mode must be run on 1 pe')
1296+
call shr_log_error(subname//' ERROR: single column mode must be run on 1 pe')
12841297
endif
12851298

12861299
write(logunit,'(a,2(f10.5,2x))')trim(subname)//' single column point for '//trim(compname)//&
@@ -1304,27 +1317,27 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
13041317
! the closest point in the domin file to scol_lon and scol_lat
13051318

13061319
status = nf90_open(single_column_lnd_domainfile, NF90_NOWRITE, ncid)
1307-
if (status /= nf90_noerr) call shr_sys_abort (trim(subname) //': opening '//&
1320+
if (status /= nf90_noerr) call shr_log_error (trim(subname) //': opening '//&
13081321
trim(single_column_lnd_domainfile))
13091322
status = nf90_inq_dimid (ncid, 'ni', dimid)
1310-
if (status /= nf90_noerr) call shr_sys_abort (trim(subname) //': inq_dimid ni')
1323+
if (status /= nf90_noerr) call shr_log_error (trim(subname) //': inq_dimid ni')
13111324
status = nf90_inquire_dimension(ncid, dimid, len=ni)
1312-
if (status /= nf90_noerr) call shr_sys_abort (trim(subname) //': inquire_dimension ni')
1325+
if (status /= nf90_noerr) call shr_log_error (trim(subname) //': inquire_dimension ni')
13131326
status = nf90_inq_dimid (ncid, 'nj', dimid)
1314-
if (status /= nf90_noerr) call shr_sys_abort (trim(subname) //': inq_dimid nj')
1327+
if (status /= nf90_noerr) call shr_log_error (trim(subname) //': inq_dimid nj')
13151328
status = nf90_inquire_dimension(ncid, dimid, len=nj)
1316-
if (status /= nf90_noerr) call shr_sys_abort (trim(subname) //': inquire_dimension nj')
1329+
if (status /= nf90_noerr) call shr_log_error (trim(subname) //': inquire_dimension nj')
13171330

13181331
status = nf90_inq_varid(ncid, 'xc' , varid_xc)
1319-
if (status /= nf90_noerr) call shr_sys_abort (subname//' inq_varid xc')
1332+
if (status /= nf90_noerr) call shr_log_error (subname//' inq_varid xc')
13201333
status = nf90_inq_varid(ncid, 'yc' , varid_yc)
1321-
if (status /= nf90_noerr) call shr_sys_abort (subname//' inq_varid yc')
1334+
if (status /= nf90_noerr) call shr_log_error (subname//' inq_varid yc')
13221335
status = nf90_inq_varid(ncid, 'area' , varid_area)
1323-
if (status /= nf90_noerr) call shr_sys_abort (subname//' inq_varid area')
1336+
if (status /= nf90_noerr) call shr_log_error (subname//' inq_varid area')
13241337
status = nf90_inq_varid(ncid, 'mask' , varid_mask)
1325-
if (status /= nf90_noerr) call shr_sys_abort (subname//' inq_varid mask')
1338+
if (status /= nf90_noerr) call shr_log_error (subname//' inq_varid mask')
13261339
status = nf90_inq_varid(ncid, 'frac' , varid_frac)
1327-
if (status /= nf90_noerr) call shr_sys_abort (subname//' inq_varid frac')
1340+
if (status /= nf90_noerr) call shr_log_error (subname//' inq_varid frac')
13281341

13291342
! Read in domain file for single column
13301343
! Check for unstructured data ni>1 and nj==1
@@ -1344,10 +1357,10 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
13441357
start3=(/1,1,1/)
13451358
count3=(/ni,nj,1/)
13461359
status = nf90_get_var(ncid, varid_xc, glob_grid, start3, count3)
1347-
if (status /= nf90_noerr) call shr_sys_abort (subname//' get_var xc')
1360+
if (status /= nf90_noerr) call shr_log_error (subname//' get_var xc')
13481361
lons(1:ni) = glob_grid(1:ni,1)
13491362
status = nf90_get_var(ncid, varid_yc, glob_grid, start3, count3)
1350-
if (status /= nf90_noerr) call shr_sys_abort (subname//' get_var yc')
1363+
if (status /= nf90_noerr) call shr_log_error (subname//' get_var yc')
13511364
if (unstructured) then
13521365
lats(1:ni) = glob_grid(1:ni,1)
13531366
else
@@ -1379,31 +1392,31 @@ subroutine esm_set_single_column_attributes(compname, gcomp, rc)
13791392
! read in value of nearest neighbor lon and RESET scol_lon and scol_lat
13801393
! also get area of gridcell, mask and frac
13811394
status = nf90_get_var(ncid, varid_xc, scol_lon, start)
1382-
if (status /= nf90_noerr) call shr_sys_abort (subname//' get_var xc')
1395+
if (status /= nf90_noerr) call shr_log_error (subname//' get_var xc')
13831396

13841397
status = nf90_get_var(ncid, varid_yc, scol_lat, start)
1385-
if (status /= nf90_noerr) call shr_sys_abort (subname//' get_var yc')
1398+
if (status /= nf90_noerr) call shr_log_error (subname//' get_var yc')
13861399

13871400
status = nf90_get_var(ncid, varid_area, scol_area, start)
1388-
if (status /= nf90_noerr) call shr_sys_abort (subname//' get_var area')
1401+
if (status /= nf90_noerr) call shr_log_error (subname//' get_var area')
13891402

13901403
status = nf90_get_var(ncid, varid_mask, iscol_data, start)
1391-
if (status /= nf90_noerr) call shr_sys_abort (subname//' get_var mask')
1404+
if (status /= nf90_noerr) call shr_log_error (subname//' get_var mask')
13921405
scol_lndmask = iscol_data(1)
13931406
scol_ocnmask = 1 - scol_lndmask
13941407

13951408
status = nf90_get_var(ncid, varid_frac, scol_data, start)
1396-
if (status /= nf90_noerr) call shr_sys_abort (subname//' get_var frac')
1409+
if (status /= nf90_noerr) call shr_log_error (subname//' get_var frac')
13971410
scol_lndfrac = scol_data(1)
13981411
scol_ocnfrac = 1._r8 - scol_lndfrac
13991412

14001413
if (scol_ocnmask == 0 .and. scol_lndmask == 0) then
1401-
call shr_sys_abort(trim(subname)//' in single column mode '&
1414+
call shr_log_error(trim(subname)//' in single column mode '&
14021415
//' ocean and land mask cannot both be zero')
14031416
end if
14041417

14051418
status = nf90_close(ncid)
1406-
if (status /= nf90_noerr) call shr_sys_abort (trim(subname) //': closing '//&
1419+
if (status /= nf90_noerr) call shr_log_error (trim(subname) //': closing '//&
14071420
trim(single_column_lnd_domainfile))
14081421

14091422
! Now read in mesh file to get exact values of scol_lon and scol_lat that will be used
@@ -1544,6 +1557,9 @@ subroutine esm_finalize(driver, rc)
15441557
call ESMF_VMGet(vm, mpiCommunicator=mpicomm, rc=rc)
15451558
if (chkerr(rc,__LINE__,u_FILE_u)) return
15461559

1560+
call ESMF_VMBarrier(vm, rc=rc)
1561+
if (chkerr(rc,__LINE__,u_FILE_u)) return
1562+
15471563
call NUOPC_CompAttributeGet(driver, name="timing_dir",value=timing_dir, rc=rc)
15481564
if (chkerr(rc,__LINE__,u_FILE_u)) return
15491565

0 commit comments

Comments
 (0)