Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
6b03299
sima updates to get rrtmgp lw to generate caps
Jun 6, 2025
1f19dd0
latest atmos_phys tag
Jun 6, 2025
8ac539c
update atmos_phys submodule
Jun 6, 2025
bc961a0
cleanup; update atmos_phys hash
Jun 9, 2025
b9bdd6e
update git-fleximod
Jul 15, 2025
2a58a1e
latest atmos phys hash
Jul 15, 2025
084b8a4
merge to head of development
Jul 15, 2025
0b817f3
lw answers match cam for 2 timesteps using radiation
peverwhee Aug 7, 2025
a694713
use output variables for physics check
peverwhee Aug 8, 2025
c2a33d7
fix unit tests
peverwhee Aug 8, 2025
8b9df0a
update check_data to not error when variable is not found
peverwhee Aug 8, 2025
b4331de
merge in output variable checking
peverwhee Aug 8, 2025
50e5c2f
Merge remote-tracking branch 'origin/check-out-variables' into rrtmgp-lw
peverwhee Aug 8, 2025
2752030
update atmos phys submodule
peverwhee Aug 9, 2025
586a05f
Add 'var_subset_check' helper routine, with initial 'both present' ch…
nusbaume Aug 5, 2025
d7b4bbe
Add missing subroutine arguments.
nusbaume Aug 5, 2025
63a5cbb
Add check for correct 'start' size, along with new unit test.
nusbaume Aug 6, 2025
de58bea
Add missing 'count' entry to test.
nusbaume Aug 6, 2025
eaf9264
Add missing space to error message, a 'count' size check, and an asso…
nusbaume Aug 6, 2025
f01ec4d
Add check and test for ensuring that start elements are within range.
nusbaume Aug 8, 2025
098f4a0
Add missing Fortran character format.
nusbaume Aug 8, 2025
bd07e62
Add 'alloc_dims' output variable to ensure output variable is allocat…
nusbaume Aug 8, 2025
bf91195
Remove un-needed dimension index from allocate call.
nusbaume Aug 8, 2025
bc91c13
Add bounds checking for 'count' optional variable.
nusbaume Aug 8, 2025
58a4840
Fix syntax error.
nusbaume Aug 8, 2025
e9018c3
Add subsetting when shape(count) matches shape(var), including unit t…
nusbaume Aug 13, 2025
61389fd
Fix typo in subroutine call.
nusbaume Aug 13, 2025
ee4a3e9
Fix 'do_subset' syntax error.
nusbaume Aug 13, 2025
249f87a
Fix bad subroutine name.
nusbaume Aug 13, 2025
c47dbe6
Flip error message and error code check for subset read test.
nusbaume Aug 13, 2025
5175ea3
Add debugging output.
nusbaume Aug 13, 2025
a45e9d2
Cleanup debug output and modify start/count element range checks.
nusbaume Aug 13, 2025
53780e7
Add subsetting to 2-D integer interface, add unit test, fix bad unit …
nusbaume Aug 13, 2025
41fcd3d
Add 'singe value' subset test, and fix bad error message.
nusbaume Aug 13, 2025
640a440
remove extraneous sum calls.
nusbaume Aug 13, 2025
5c48075
Move non-subsetting rank check to 'var_subset_check', and add additio…
nusbaume Aug 14, 2025
d6fc649
Remove use of 'count' intrinsic to avoid name collision.
nusbaume Aug 14, 2025
de647be
Fix bad syntax in error message.
nusbaume Aug 14, 2025
3385d54
Add subsetting calls to all non-scalar get_var calls.
nusbaume Aug 14, 2025
76fc32a
Fix syntax error.
nusbaume Aug 14, 2025
ee27eb3
Adjust 'var_ndims' for charactervariables.
nusbaume Aug 14, 2025
0c85688
Remove extra space in expected error message.
nusbaume Aug 15, 2025
dbc7354
Change error message text, and add additional unit tests.
nusbaume Aug 15, 2025
ac6fce9
Fix use statements in pFUnit Fortran code.
nusbaume Aug 16, 2025
6f184f2
Move count bounds checking outside of output var check, and fix test …
nusbaume Aug 16, 2025
73b75a3
Comment out real var subsetting test.
nusbaume Aug 16, 2025
59775cc
Fix bad subsetting test, and partially uncomment 1D real subset test.
nusbaume Aug 16, 2025
5b331ba
Uncomment 'end subroutine' line.
nusbaume Aug 16, 2025
6402882
Remove comma from expected error message, and try reading press_ref v…
nusbaume Aug 16, 2025
ef23f22
Try 1D real subset test again.
nusbaume Aug 16, 2025
e829e94
Add 'pio_get_var' subsetting to remaining multi-dim get_var interfaces.
nusbaume Aug 18, 2025
2776f7c
Print out press_ref values and change order.
nusbaume Aug 18, 2025
574e71e
Change write statement to see if that fixes build issue?
nusbaume Aug 18, 2025
4add51e
Removed commented-out assert statement.
nusbaume Aug 18, 2025
dfa8143
Add back-in original 'assert' statement.
nusbaume Aug 18, 2025
23f6459
Formally declare expected values in real 1D subset test.
nusbaume Aug 18, 2025
72844d0
Add ability to reduce output variable dimensionality via subsetting. …
nusbaume Aug 19, 2025
a20f592
Make output variable 3D to see if that works.
nusbaume Aug 19, 2025
4f91699
Remove variable dimension reduction functionality (it doesn't appear …
nusbaume Aug 22, 2025
c2ff44c
Add error if user tries to subset a scalar variable, along with a rel…
nusbaume Aug 22, 2025
77d876d
Add character variable subsetting unit test.
nusbaume Aug 22, 2025
1625101
Fix character size assert check in subsetting test.
nusbaume Aug 22, 2025
da268b0
Fix syntax error in subset test.
nusbaume Aug 22, 2025
37f1dd5
Add debugging output.
nusbaume Aug 22, 2025
9cee38d
Try subsetting with character array length provided.
nusbaume Aug 22, 2025
1728712
Increase 'var_ndims' by one to avoid incorrect error.
nusbaume Aug 22, 2025
dc0e3dc
Fix unit test assert statements, and update remaining character get_v…
nusbaume Aug 22, 2025
ab49b90
Fix error message in unit test.
nusbaume Aug 22, 2025
0e5fb36
Remove fork/branch from Github Actions workflow.
nusbaume Aug 25, 2025
f65ec49
Remove leftover debugging code.
nusbaume Aug 25, 2025
44729bd
merge in pio subsetting
peverwhee Aug 26, 2025
3e6eeaa
update to dev tag
peverwhee Aug 26, 2025
cc60fb5
Misc fix: 3-D input field read with dycore enabled; cam_in/cam_out fr…
jimmielin Sep 11, 2025
db335b5
Update cime_config/testdefs/testlist_cam.xml
jimmielin Sep 12, 2025
573cf9a
Address review comments
jimmielin Sep 12, 2025
d347cf3
Updated to remove unused cam_in/cam_outs
jimmielin Sep 12, 2025
b572d80
Update git-fleximod to v1.0.2
nusbaume Sep 15, 2025
5a32d0d
Update externals to match cam6_4_115.
nusbaume Sep 15, 2025
f367b49
Add debugging output to git-fleximod.
nusbaume Sep 16, 2025
6cad15f
Print out git commands in fleximod.
nusbaume Sep 16, 2025
3eaaf02
Remove debugging code.
nusbaume Sep 16, 2025
fcf380c
Update fleximod test and gitmodules file to match new CAM code/submod…
nusbaume Sep 19, 2025
40cf4df
Add missed atmospheric_physics submodule update.
nusbaume Sep 19, 2025
45328ea
Update ccs_config submodule.
nusbaume Sep 23, 2025
e340186
commit latest host side changes
peverwhee Sep 23, 2025
5d404a9
merge in jesses externals updates
peverwhee Sep 23, 2025
f9d9539
read coszrs from file; add dycore name to runtime_obj
peverwhee Oct 8, 2025
c114fe0
merge in development branch
peverwhee Oct 8, 2025
e5384b1
fix merge; add pbuf out fields to registry to be checked
peverwhee Oct 13, 2025
7e29457
update atmos phys hash
peverwhee Oct 13, 2025
b1993e9
fix runtime object setter; add rrtmgp snapshot test
peverwhee Oct 13, 2025
fa9acd0
remove redundant git-fleximod
peverwhee Oct 14, 2025
3dd5cad
remove correct git-fleximod this time
peverwhee Oct 14, 2025
f182739
code cleanup
peverwhee Oct 14, 2025
a5b6dac
Merge remote-tracking branch 'ESCOMP/development' into rrtmgp-lw
peverwhee Oct 14, 2025
92f7b76
remove final redundant git-fleximod files
peverwhee Oct 14, 2025
efd8964
Merge remote-tracking branch 'hplin/hplin/fixes_fadiab' into rrtmgp-lw
peverwhee Oct 16, 2025
c963e10
remove unused diagnostic field; add handling for parameters in registry
peverwhee Oct 20, 2025
581148b
clean up registry
peverwhee Oct 21, 2025
8d3c6c3
update submodule
peverwhee Oct 22, 2025
83ac00e
add gpu test; mods to get nvhpc to run
peverwhee Oct 22, 2025
7105e8c
no error when diffs found for gpu test
peverwhee Oct 22, 2025
1b4a5bb
add missing initial values to registry; removed unused fields
peverwhee Oct 23, 2025
99ec7a7
update atmos phys hash
peverwhee Oct 23, 2025
5d95cbf
Merge remote-tracking branch 'ESCOMP/development' into rrtmgp-lw
peverwhee Oct 23, 2025
c1de147
remove unnecessary reordering
peverwhee Oct 23, 2025
31c9290
remove code that is no longer necessary
peverwhee Oct 24, 2025
ff7da37
merge up; use latest atmos phys hash
peverwhee Oct 24, 2025
28c7a56
move snow and graupel logicals to the registry
peverwhee Dec 9, 2025
5900a8d
merge up
peverwhee Dec 9, 2025
63da84a
bring in latest atmospheric physics rrtmgp mods
peverwhee Dec 15, 2025
c4dd819
add heating rate to registry; update atmospheric physics hash
peverwhee Dec 18, 2025
514a460
Merge remote-tracking branch 'origin/rrtmgp-lw' into rrtmgp-gpu
peverwhee Dec 22, 2025
5b24c6b
use gpuized atmospheric physics
peverwhee Dec 22, 2025
56e7cd2
comment clarifying snapshots for gpu test
peverwhee Dec 22, 2025
9797761
new atmospheric physics hash; update standard name and units
peverwhee Jan 5, 2026
bf176a0
merge to head; grab latest tags for ccs_config and atmos phys
peverwhee Feb 2, 2026
c8d128f
remove unnecessary initialization mark
peverwhee Feb 4, 2026
8fbe9fb
Add function so that SIMA uses the correct hardware-dependent RRTMGP …
nusbaume Feb 13, 2026
f00de07
Add new OpenACC variable to fake case dictionary used for testing.
nusbaume Feb 13, 2026
bfa8aeb
Add new gpu_flag input variable to cam_autogen tests.
nusbaume Feb 13, 2026
23a5af9
set min difference for gpu rrtmgp test
peverwhee Feb 13, 2026
34dd50b
Merge remote-tracking branch 'ESCOMP/development' into rrtmgp-gpu
peverwhee Feb 13, 2026
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
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[submodule "ncar-physics"]
path = src/physics/ncar_ccpp
url = https://github.com/ESCOMP/atmospheric_physics
fxtag = b47246dedfa7c377ac2bfb060e2d465beb931f2a
fxtag = atmos_phys0_21_000
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics
[submodule "rrtmgp-data"]
Expand All @@ -32,7 +32,7 @@
[submodule "ccs_config"]
path = ccs_config
url = https://github.com/ESMCI/ccs_config_cesm.git
fxtag = ccs_config_cesm1.0.65
fxtag = ccs_config_cesm1.0.72
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git
[submodule "cdeps"]
Expand Down
84 changes: 76 additions & 8 deletions cime_config/cam_autogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,68 @@ def _update_genccpp_dir(utility_files, genccpp_dir):
# end if
# end for

###############################################################################
def _set_rrtmgp_dependencies(dependency_files, gpu_flag):
###############################################################################
"""
Modify the list of files that physics schemes depend on
(as provided by the CCPP) so that the correct RRTMGP
dependencies exist for either CPUs or GPUs.

This function returns a modified list with either the
CPU or GPU RRTMGP dependencies, but not both.

>>> in_files = ['/some/path/file.F90','/some/rte-kernels/rrtmgp.F90', \
'/some/rte-kernels/accel/rrtmgp.F90', \
'/some/rte-kernels/mo_rte_solver_kernels.F90', \
'/some/rte-kernels/accel/mo_rte_solver_kernels.F90', \
'/some/other/path/file.F90', \
'/other/rrtmgp-kernels/mo_gas_optics_rrtmgp_kernels.F90', \
'/other/rrtmgp-kernels/accel/mo_gas_optics_rrtmgp_kernels.F90', ]
>>> _set_rrtmgp_dependencies(in_files, False)
['/some/path/file.F90', '/some/rte-kernels/rrtmgp.F90', \
'/some/rte-kernels/accel/rrtmgp.F90', '/some/rte-kernels/mo_rte_solver_kernels.F90', \
'/some/other/path/file.F90', '/other/rrtmgp-kernels/mo_gas_optics_rrtmgp_kernels.F90']

>>> _set_rrtmgp_dependencies(in_files, True)
['/some/path/file.F90', '/some/rte-kernels/rrtmgp.F90', \
'/some/rte-kernels/accel/rrtmgp.F90', \
'/some/rte-kernels/accel/mo_rte_solver_kernels.F90', '/some/other/path/file.F90', \
'/other/rrtmgp-kernels/accel/mo_gas_optics_rrtmgp_kernels.F90']
"""

# Create new list of CCPP-dependent files:
new_dependency_files = []

# List of directory strings that indicate
# RRTMGP dependencies:
rrtmgp_subdirs = ['rte-kernels', 'rrtmgp-kernels']

# List of RRTMGP files that differ between CPUs and GPUs:
rrtmgp_files = ['mo_rte_solver_kernels.F90',
'mo_optical_props_kernels.F90',
'mo_gas_optics_rrtmgp_kernels.F90']


for file_path in dependency_files:
if any(subdir in file_path for subdir in rrtmgp_subdirs):
if any(rfile in file_path for rfile in rrtmgp_files):
if (gpu_flag and 'accel' in file_path):
#If GPU-enabled and is "accelerated", include it:
new_dependency_files.append(file_path)
elif (not gpu_flag and 'accel' not in file_path):
#If CPU-only and not "accelerated", include it:
new_dependency_files.append(file_path)
else:
#Not a hardware-dependent file, so include it:
new_dependency_files.append(file_path)
else:
#Not an RRTMGP file, so include it:
new_dependency_files.append(file_path)

# Return newly-modified dependency files:
return new_dependency_files

###############################################################################
def generate_registry(data_search, build_cache, atm_root, bldroot,
source_mods_dir, dycore, gen_fort_indent):
Expand Down Expand Up @@ -420,7 +482,8 @@ def generate_registry(data_search, build_cache, atm_root, bldroot,
###############################################################################
def generate_physics_suites(build_cache, preproc_defs, host_name,
phys_suites_str, atm_root, bldroot,
reg_dir, reg_files, source_mods_dir, force):
reg_dir, reg_files, source_mods_dir,
gpu_flag, force):
###############################################################################
"""
Generate the source for the configured physics suites,
Expand Down Expand Up @@ -664,8 +727,6 @@ def generate_physics_suites(build_cache, preproc_defs, host_name,
build_cache.update_ccpp(sdfs, scheme_files, host_files, xml_files,
scheme_nl_meta_files, nl_groups, create_nl_file,
preproc_cache_str, kind_types)
##XXgoldyXX: v Temporary fix: Copy CCPP Framework source code into
##XXgoldyXX: v generated code directory
request = DatatableReport("utility_files")
ufiles_str = datatable_report(cap_output_file, request, ";")
utility_files = ufiles_str.split(';')
Expand All @@ -674,8 +735,15 @@ def generate_physics_suites(build_cache, preproc_defs, host_name,
dep_str = datatable_report(cap_output_file, request, ";")
if len(dep_str) > 0:
dependency_files = dep_str.split(';')
# If using RRTMGP in the physics suite, then modify
# the provided dependency files list to use the correct
# CPU or GPU RRTMGP dependencies:
if any("rrtmgp_" in scheme_name for scheme_name in scheme_names):
dependency_files = _set_rrtmgp_dependencies(dependency_files,
gpu_flag)

# Copy dependencies files into CCPP build directory
_update_genccpp_dir(dependency_files, genccpp_dir)
##XXgoldyXX: ^ Temporary fix:
# End if

return [physics_blddir, genccpp_dir], do_gen_ccpp, cap_output_file, \
Expand All @@ -695,7 +763,7 @@ def generate_init_routines(build_cache, bldroot, force_ccpp, force_init,
and/or script).
"""

#Add new directory to build path:
# Add new directory to build path:
init_dir = os.path.join(bldroot, "phys_init")
# Use this for cache check
gen_init_file = os.path.join(_REG_GEN_DIR, "write_init_files.py")
Expand All @@ -706,11 +774,11 @@ def generate_init_routines(build_cache, bldroot, force_ccpp, force_init,
if force_ccpp or force_init:
do_gen_init = True
else:
#If not, then check cache to see if actual
#"write_init_files.py" was modified:
# If not, then check cache to see if actual
# "write_init_files.py" was modified:
do_gen_init = build_cache.init_write_mismatch(gen_init_file)
else:
#If no directory exists, then one will need
# If no directory exists, then one will need
# to create new routines:
os.mkdir(init_dir)
do_gen_init = True
Expand Down
5 changes: 3 additions & 2 deletions cime_config/cam_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ def __init__(self, case, case_log):
# Save case variables needed for code auto-generation:
self.__atm_root = case.get_value("COMP_ROOT_DIR_ATM")
self.__caseroot = case.get_value("CASEROOT")
self.__bldroot = os.path.join(exeroot, "atm", "obj")
self.__bldroot = os.path.join(exeroot, "atm", "obj")
self.__atm_name = case.get_value("COMP_ATM")
self.__gpu_flag = case.get_value("OPENACC_GPU_OFFLOAD") #Returns a Boolean

# Save CPP definitions as a list:
self.__cppdefs = [x for x in case.get_value("CAM_CPPDEFS").split() if x]
Expand Down Expand Up @@ -879,7 +880,7 @@ def generate_cam_src(self, gen_fort_indent):
self.__atm_name, phys_suites,
self.__atm_root, self.__bldroot,
reg_dir, reg_files, source_mods_dir,
force_ccpp)
self.__gpu_flag, force_ccpp)
phys_dirs, force_init, _, nml_fils, capgen_db, scheme_names = retvals

# Add namelist definition files to dictionary:
Expand Down
9 changes: 9 additions & 0 deletions cime_config/testdefs/testlist_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@
<option name="comment">Snapshot test for RRTMGP</option>
</options>
</test>
<test compset="FPHYStest" grid="ne3pg3_ne3pg3_mg37" name="SMS_Ln2" testmods="cam/outfrq_rrtmgp_derecho_gpu">
<machines>
<machine name="derecho" compiler="nvhpc" category="aux_sima"/>
</machines>
<options>
<option name="wallclock">00:10:00</option>
<option name="comment">GPU snapshot test for RRTMGP</option>
</options>
</test>

<!-- Derecho dycore tests -->
<test compset="FKESSLER" grid="mpasa480_mpasa480" name="SMS_Ln9" testmods="cam/outfrq_kessler_mpas_derecho">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
./xmlchange NTASKS=128
./xmlchange NTHRDS=1
./xmlchange ROOTPE='0'
./xmlchange ROF_NCPL=`./xmlquery --value ATM_NCPL`
./xmlchange GLC_NCPL=`./xmlquery --value ATM_NCPL`
./xmlchange TIMER_DETAIL='6'
./xmlchange TIMER_LEVEL='999'
./xmlchange GPU_TYPE=a100
./xmlchange OPENACC_GPU_OFFLOAD=TRUE
./xmlchange OVERSUBSCRIBE_GPU=TRUE
./xmlchange NGPUS_PER_NODE=4
./xmlchange CAM_CONFIG_OPTS="--dyn none --physics-suites rrtmgp"
./xmlchange RUN_STARTDATE=1979-01-01
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
! these are CPU FHISTC_LTso snapshots
ncdata = '/glade/campaign/cesm/community/amwg/sima_baselines/cam_sima_test_snapshots/cam_ne3pg3_fhistc_ltso_rrtmgp_derecho_gnu_before_c20251013.nc'
ncdata_check = '/glade/campaign/cesm/community/amwg/sima_baselines/cam_sima_test_snapshots/cam_ne3pg3_fhistc_ltso_rrtmgp_derecho_gnu_after_c20251013.nc'

! tolerances for testing (currently have high tolerance due to CPU snapshots)
ncdata_check_err = .true.
min_difference = 1e-08

! vertical levels in snapshot
pver = 58

! Do radiation on every timestep we're testing
irad_always=3

! diagnostic output
hist_output_frequency;h1: 1*nsteps
hist_precision;h1: REAL64
hist_add_inst_fields;h1: HR
! Cloud output
hist_add_inst_fields;h1: TOT_CLD_VISTAU,TOT_ICLD_VISTAU,ICE_ICLD_VISTAU,LIQ_ICLD_VISTAU
! Longwave diagnostic output
hist_add_inst_fields;h1: QRL,QRLC,FLNT,FLNTC,FLUT,FLUTC,LWCF,FLN200,FLN200C,FLNR,FLNS,FLNSC,FLDS,FLDSC,FUL,FDL,FULC,FDLC
! Shortwave diagnostic fields
hist_add_inst_fields;h1: SOLIN,QRS,QRSC,FSNT,FSNTC,FSNTOA,FSNTOAC,SWCF,FSUTOA,FSN200,FSN200C,FSNR,SOLL,SOLS,SOLLD,SOLSD
hist_add_inst_fields;h1: FSNS,FSNSC,FSDS,FSDSC,FUS,FDS,FUSC,FDSC
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
! Set fixed orbital parameters
orb_mode='fixed_parameters'
orb_eccen = 0.
orb_obliq = 0.
orb_mvelp = 0.
33 changes: 20 additions & 13 deletions src/core_utils/string_core_utils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pure function stringify(value, separator)

character(:), allocatable :: buffer, delimiter, format
character(:), allocatable :: value_c(:)
integer :: i, n, offset
integer :: i, n, offset, fmt_len

if (present(separator)) then
delimiter = separator
Expand Down Expand Up @@ -168,43 +168,50 @@ pure function stringify(value, separator)

deallocate(value_c)
type is (integer(int32))
allocate(character(11 * n + len(delimiter) * (n - 1)) :: buffer)
allocate(character(17 + len(delimiter) + floor(log10(real(n))) + 1) :: format)
allocate(character(len=11 * n + len(delimiter) * (n - 1)) :: buffer)
fmt_len = 17 + len(delimiter) + floor(log10(real(n))) + 1
allocate(character(fmt_len) :: format)

write(format, '(a, i0, 3a)') '(ss, ', n, '(i0, :, "', delimiter, '"))'
write(buffer, format) value
type is (integer(int64))
allocate(character(20 * n + len(delimiter) * (n - 1)) :: buffer)
allocate(character(17 + len(delimiter) + floor(log10(real(n))) + 1) :: format)
allocate(character(len=20 * n + len(delimiter) * (n - 1)) :: buffer)
fmt_len = 17 + len(delimiter) + floor(log10(real(n))) + 1
allocate(character(len=fmt_len) :: format)

write(format, '(a, i0, 3a)') '(ss, ', n, '(i0, :, "', delimiter, '"))'
write(buffer, format) value
type is (logical)
allocate(character(1 * n + len(delimiter) * (n - 1)) :: buffer)
allocate(character(13 + len(delimiter) + floor(log10(real(n))) + 1) :: format)
allocate(character(len=1 * n + len(delimiter) * (n - 1)) :: buffer)
fmt_len = 13 + len(delimiter) + floor(log10(real(n))) + 1
allocate(character(len=fmt_len) :: format)

write(format, '(a, i0, 3a)') '(', n, '(l1, :, "', delimiter, '"))'
write(buffer, format) value
type is (real(real32))
allocate(character(13 * n + len(delimiter) * (n - 1)) :: buffer)
allocate(character(len=13 * n + len(delimiter) * (n - 1)) :: buffer)

if (maxval(abs(value)) < 1.0e5_real32) then
allocate(character(20 + len(delimiter) + floor(log10(real(n))) + 1) :: format)
fmt_len = 20 + len(delimiter) + floor(log10(real(n))) + 1
allocate(character(len=fmt_len) :: format)
write(format, '(a, i0, 3a)') '(ss, ', n, '(f13.6, :, "', delimiter, '"))'
else
allocate(character(23 + len(delimiter) + floor(log10(real(n))) + 1) :: format)
fmt_len = 23 + len(delimiter) + floor(log10(real(n))) + 1
allocate(character(len=fmt_len) :: format)
write(format, '(a, i0, 3a)') '(ss, ', n, '(es13.6e2, :, "', delimiter, '"))'
end if

write(buffer, format) value
type is (real(real64))
allocate(character(13 * n + len(delimiter) * (n - 1)) :: buffer)
allocate(character(len=13 * n + len(delimiter) * (n - 1)) :: buffer)

if (maxval(abs(value)) < 1.0e5_real64) then
allocate(character(20 + len(delimiter) + floor(log10(real(n))) + 1) :: format)
fmt_len = 20 + len(delimiter) + floor(log10(real(n))) + 1
allocate(character(len=fmt_len) :: format)
write(format, '(a, i0, 3a)') '(ss, ', n, '(f13.6, :, "', delimiter, '"))'
else
allocate(character(23 + len(delimiter) + floor(log10(real(n))) + 1) :: format)
fmt_len = 23 + len(delimiter) + floor(log10(real(n))) + 1
allocate(character(len=fmt_len) :: format)
write(format, '(a, i0, 3a)') '(ss, ', n, '(es13.6e2, :, "', delimiter, '"))'
end if

Expand Down
6 changes: 3 additions & 3 deletions src/data/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,12 @@
<!-- Date and time variables -->
<variable local_name="calday"
standard_name="fractional_calendar_days_on_end_of_current_timestep"
units="1" type="real" kind="kind_phys">
units="days" type="real" kind="kind_phys">
<long_name>fractional calendar day at end of current timestep</long_name>
</variable>
<variable local_name="next_calday"
standard_name="fractional_calendar_days_on_end_of_next_timestep"
units="1" type="real" kind="kind_phys">
units="days" type="real" kind="kind_phys">
<long_name>fractional calendar day at end of next timestep</long_name>
</variable>
<variable local_name="nextsw_cday"
Expand Down Expand Up @@ -1826,7 +1826,7 @@
<ic_file_input_names>QRL pbuf_QRL</ic_file_input_names>
</variable>
<variable local_name="two"
standard_name="ccpp_constant_two"
standard_name="constant_dimension_two"
units="count" type="integer"
allocatable="parameter">
<initial_value>2</initial_value>
Expand Down
4 changes: 3 additions & 1 deletion src/history/cam_history_support.F90
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ subroutine add_hist_coord_r8(name, vlen, long_name, units, values, &
integer, pointer :: local_int_values(:)
real(r8), pointer :: local_bounds(:,:)
type(formula_terms_t) :: local_formula_terms
real(r8), pointer :: r_ptr(:)

nullify(local_int_values)
nullify(local_bounds)
Expand Down Expand Up @@ -626,8 +627,9 @@ subroutine add_hist_coord_r8(name, vlen, long_name, units, values, &
end if

! First, check to see if it is OK to add this coord
r_ptr => values
i = check_hist_coord(name, vlen, long_name, units, local_bounds, &
local_int_values, values, local_bounds_name, local_positive, &
local_int_values, r_ptr, local_bounds_name, local_positive, &
local_standard_name, local_formula_terms)

! Register the name if necessary
Expand Down
6 changes: 3 additions & 3 deletions test/unit/python/test_cam_autogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def test_generate_physics_suites(self):
gen_results = generate_physics_suites(self.test_cache, "UNSET", "cam", "simple",
_CAM_ROOT_DIR, self.test_bldroot,
self.test_reg_dir, [],
self.test_src_mods_dir, False)
self.test_src_mods_dir, False, False)

#Due to the presence of a "dict_values" dictview object which needs
#to be treated in a special way, the tuples will need to be iterated
Expand Down Expand Up @@ -628,7 +628,7 @@ def test_missing_sdf_generate_physics_suites(self):
_ = generate_physics_suites(self.test_cache, "UNSET", "cam", "missing",
_CAM_ROOT_DIR, self.test_bldroot,
self.test_reg_dir, [],
self.test_src_mods_dir, False)
self.test_src_mods_dir, False, False)
#End with

#Check that error message matches what's expected:
Expand Down Expand Up @@ -656,7 +656,7 @@ def test_missing_scheme_generate_physics_suites(self):
_ = generate_physics_suites(self.test_cache, "UNSET", "cam", "simple",
_CAM_ROOT_DIR, self.test_bldroot,
self.test_reg_dir, [],
self.test_src_mods_dir, False)
self.test_src_mods_dir, False, False)
#End with

#Check that error message matches what's expected:
Expand Down
3 changes: 2 additions & 1 deletion test/unit/python/test_cam_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def __init__(self):
"CAM_CPPDEFS" : "UNSET",
"NTHRDS_ATM" : 1,
"RUN_STARTDATE" : "101",
"DEBUG" : False
"DEBUG" : False,
"OPENACC_GPU_OFFLOAD": False
}

def get_value(self, key):
Expand Down