Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
7ea7866
Create cplhist mode for dice (#62)
NickSzapiro-NOAA Jun 11, 2024
cf09feb
remove the test for rc after the restart_write calls in ice_comp_nuop…
NickSzapiro-NOAA Aug 2, 2024
0ad75da
Merge branch 'main' into escomp_dice_cplhist
NickSzapiro-NOAA Aug 29, 2024
0a7940b
Remove datm_datamode_cfsr
NickSzapiro-NOAA Aug 29, 2024
f87f18d
refactor alarm code for endofrun restart writes
jedwards4b Oct 17, 2024
d2fa455
remove unused dshr_time_init
jedwards4b Oct 17, 2024
7ca8548
remove extra instance append in dglc
jedwards4b Oct 31, 2024
4a34e46
add restart_fh mod to share to enable github testing of ufs build
DeniseWorthen Dec 18, 2024
5c715db
replace calls to esmf_logmsg_error with shr_abort
jedwards4b Jan 23, 2025
a4de12d
use ESMF_FINALIZE here
jedwards4b Jan 23, 2025
0e3a3ca
remove unused variable
jedwards4b Jan 23, 2025
3539203
fix typo
jedwards4b Jan 23, 2025
27c145b
fix syntax error
jedwards4b Jan 23, 2025
c492b6a
add missing module import
jedwards4b Jan 24, 2025
baa3024
Merge pull request #320 from jedwards4b/replace_esmf_logmsg_error_shr…
jedwards4b Jan 24, 2025
4aa602b
use shr_log_error and pass up stack
jedwards4b Jan 30, 2025
3cd9f5b
add the updated shr_log_mod and shr_abort_mod files
jedwards4b Jan 30, 2025
28f4aa0
some need to remain shr_sys_abort (no return code available)
jedwards4b Jan 30, 2025
da2ddae
need a msg here
jedwards4b Jan 30, 2025
f45f398
no return code here, use abort
jedwards4b Jan 31, 2025
f529284
no return code here, use abort
jedwards4b Jan 31, 2025
01b4d45
no return code here, use abort
jedwards4b Jan 31, 2025
7025adb
clean up
jedwards4b Jan 31, 2025
5c5514d
more cleanup
jedwards4b Jan 31, 2025
2684ab7
fix ref to shr_sys_abort
jedwards4b Feb 3, 2025
241dfb3
Merge branch 'main' into feature/add_restartfh
jedwards4b Feb 5, 2025
bb7cfd7
Merge pull request #319 from DeniseWorthen/feature/add_restartfh
jedwards4b Feb 5, 2025
2385f03
Make CRUJRA2024 the default datm input for clm6
slevis-lmwg Feb 7, 2025
29b08fe
response to comments
jedwards4b Feb 10, 2025
e014b9e
additional documentation
jedwards4b Feb 10, 2025
bfb435b
Merge branch 'main' into mk_crujra_default
jedwards4b Feb 10, 2025
23079d7
Merge branch 'main' into shr_log_error
jedwards4b Feb 10, 2025
44c5203
cleanup whitespace
jedwards4b Feb 10, 2025
15e93d3
Removed plain CRU from config_component.xml
slevis-lmwg Feb 11, 2025
db187f7
Change testlist_datm following Erik's review
slevis-lmwg Feb 11, 2025
ec0a0c8
Merge pull request #321 from jedwards4b/shr_log_error
jedwards4b Feb 12, 2025
3000f0c
Fix bug in four shr_sys_abort calls
slevis-lmwg Feb 12, 2025
6fa792e
Add CRUv7 defaults previously set as CRU (the latter is removed now)
slevis-lmwg Feb 12, 2025
1bcd85a
Revert "Fix bug in four shr_sys_abort calls"
slevis-lmwg Feb 12, 2025
7e149c3
Merge remote-tracking branch 'origin/main' into mk_crujra_default
slevis-lmwg Feb 12, 2025
0fad468
Small updates in config_component.xml that I missed earlier
slevis-lmwg Feb 13, 2025
d73aa12
Add Anomaly.Forcing.cmip5.rcp45.
samsrabin May 8, 2024
2be3338
Fix 'anomoly_forcing' typo.
samsrabin May 9, 2024
a4d87b3
Update meshfile used for Anomaly.Forcing.*.
samsrabin Aug 8, 2024
5323a11
Fix more typos of "anomaly."
samsrabin Aug 8, 2024
ba85ec4
Add Anomaly.Forcing.cmip6.ssp126.
samsrabin Aug 8, 2024
9b0f714
Add Anomaly.Forcing.cmip6.245, 370, 585.
samsrabin Aug 9, 2024
d921931
anomaly_forcing now automatically set based on compset (ISSP*).
samsrabin Sep 4, 2024
0389799
Now actually sets anomaly_forcing based on compset.
samsrabin Sep 5, 2024
c191e5e
SSP compsets now automatically get anomaly_forcing in datm_in.
samsrabin Sep 5, 2024
b02f0cd
Remove Anomaly.Forcing.Precip, Anomaly.Forcing.Temperature, etc.
samsrabin Sep 5, 2024
074d90d
Set anomaly_forcing = 'none' to not use anomalies in an SSP compset.
samsrabin Sep 5, 2024
0a61422
Only set anomaly_forcing for DATM SSP compsets.
samsrabin Sep 5, 2024
4715267
Provide hint in error message if namelist variable invalid due to sur…
samsrabin Sep 5, 2024
a11abf7
Make datm buildnml more robust.
samsrabin Sep 5, 2024
cd97dea
Bugfix to future-proofing of datm buildnml.
samsrabin Sep 5, 2024
94dcdb0
Add aux_cdeps tests for SSPs other than 585.
samsrabin Sep 6, 2024
a911685
Simplify removal of quotes.
samsrabin Feb 19, 2025
93e59c0
Fix indentation.
samsrabin Feb 19, 2025
92a99c7
Merge branch 'main' into add_rpointer_timestamp
jedwards4b Mar 4, 2025
4c50216
Merge pull request #312 from jedwards4b/add_rpointer_timestamp
jedwards4b Mar 4, 2025
83af0a4
Merge branch 'main' into escomp_dice_cplhist
jedwards4b Mar 4, 2025
2a6af66
Update dshr_restart_{read,write} calls in dice_datamode_cplhist_mod.F90
NickSzapiro-NOAA Mar 5, 2025
ca49538
Remove gcomp from dice_datamode_ssmi_restart_read in dice_datamode_ss…
NickSzapiro-NOAA Mar 5, 2025
7a2d75a
Update dice_datamode_{ssmi,cplhist}_restart_read calls in ice_comp_nu…
NickSzapiro-NOAA Mar 5, 2025
9e5701c
rpfile as read,write arguments in dice_datamode_cplhist_mod.F90
NickSzapiro-NOAA Mar 5, 2025
bfd49ab
rpfile in call dice_datamode_cplhist_restart_write in ice_comp_nuopc.F90
NickSzapiro-NOAA Mar 5, 2025
c460020
Merge 'ESCOMP/main' into escomp_simplify_datm
NickSzapiro-NOAA Mar 5, 2025
3eba3ea
Remove isPresent,isSet wrongly added around flds_i2o_per_cat in ice_c…
NickSzapiro-NOAA Mar 5, 2025
36635bd
Merge pull request #290 from NickSzapiro-NOAA/escomp_dice_cplhist
jedwards4b Mar 5, 2025
247e941
Merge branch 'main' into escomp_simplify_datm
jedwards4b Mar 5, 2025
bb29e46
Merge pull request #300 from NickSzapiro-NOAA/escomp_simplify_datm
jedwards4b Mar 5, 2025
4f9b463
Merge branch 'main' into mk_crujra_default
jedwards4b Mar 5, 2025
1fb4025
Change path to the CRUJRA2024 data for consistency with other datasets
slevis-lmwg Mar 7, 2025
aea26e4
For DATM%CLMCRUJRA2024, change datamode and datm_mode to CLMNCEP
slevis-lmwg Mar 7, 2025
32f3517
Add comment explaining the four new tests in testlist_datm.xml
slevis-lmwg Mar 7, 2025
ef16f09
Corrections to a test and corresponding comments based on Erik's review
slevis-lmwg Mar 7, 2025
54af59f
Removed duplicate new test
slevis-lmwg Mar 7, 2025
faaa8ef
Merge pull request #322 from slevis-lmwg/mk_crujra_default
jedwards4b Mar 10, 2025
43ba720
update 1850 and HIST compset names to allow for Concentration or Emis…
jedwards4b Mar 10, 2025
3f37963
Merge pull request #325 from jedwards4b/update_compset_names
jedwards4b Mar 10, 2025
3d85008
Merge remote-tracking branch 'origin/main' into mk_crujra_default
slevis-lmwg Mar 10, 2025
b7b8f5c
Rename mesh file and remove /inputs from CRUJRA paths
slevis-lmwg Mar 10, 2025
44dfda4
Merge pull request #326 from slevis-lmwg/mk_crujra_default
jedwards4b Mar 12, 2025
196957f
buildnml now errors on mismatch between anomaly forcing and DATM_MODE.
samsrabin Mar 14, 2025
4107fc3
Merge tag 'cdeps1.0.61' into ssp-fix-202503
samsrabin Mar 14, 2025
9b35f06
Merge branch 'ssp-fix-202503' into ssp-fix
samsrabin Mar 14, 2025
b56f0b7
Add comments about new tests in testlist_datm.xml.
samsrabin Mar 18, 2025
8aab1ae
Remove DATM_MODE_ANOMALY_FORCING_MISMATCH option.
samsrabin Mar 19, 2025
e71aa9a
Merge branch 'main' into ssp-fix
samsrabin Mar 19, 2025
cde4ac6
Merge pull request #292 from samsrabin/ssp-fix
jedwards4b Mar 19, 2025
5868cdb
Merge ESCOMP/main into sync_escomp_202503
NickSzapiro-NOAA Mar 21, 2025
877024e
needed to be added to CMakeLists.txt
jedwards4b Mar 21, 2025
cd6209f
Merge pull request #330 from jedwards4b/add_is_restart_fh_mod_to_shar…
jedwards4b Mar 21, 2025
79edd44
Merge ESCOMP/main
NickSzapiro-NOAA Mar 21, 2025
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
5 changes: 5 additions & 0 deletions cime_config/stream_cdeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,11 @@ def create_stream_xml(
),
)
if var_key in valid_values:

# # Handle, e.g., 'bilinear' in namelist instead of bilinear (no quotes)
mod_dict[var_key] = re.sub(r"[\"\']", "", mod_dict[var_key])

# Check that key is valid
expect(
mod_dict[var_key] in valid_values[var_key],
"{} can only have values of {} for stream {} in file {}".format(
Expand Down
33 changes: 20 additions & 13 deletions datm/atm_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ module cdeps_datm_comp
use NUOPC_Model , only : NUOPC_ModelGet, setVM
use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs
use shr_const_mod , only : shr_const_cday
use shr_sys_mod , only : shr_sys_abort
use shr_cal_mod , only : shr_cal_ymd2date
use shr_log_mod , only : shr_log_setLogUnit
use shr_log_mod , only : shr_log_setLogUnit, shr_log_error
use dshr_methods_mod , only : dshr_state_diagnose, chkerr, memcheck
use dshr_strdata_mod , only : shr_strdata_type, shr_strdata_init_from_config, shr_strdata_advance
use dshr_strdata_mod , only : shr_strdata_get_stream_pointer, shr_strdata_setOrbs
Expand Down Expand Up @@ -63,7 +62,7 @@ module cdeps_datm_comp
use datm_datamode_gefs_mod , only : datm_datamode_gefs_advertise
use datm_datamode_gefs_mod , only : datm_datamode_gefs_init_pointers
use datm_datamode_gefs_mod , only : datm_datamode_gefs_advance

use datm_datamode_simple_mod , only : datm_datamode_simple_advertise
use datm_datamode_simple_mod , only : datm_datamode_simple_init_pointers
use datm_datamode_simple_mod , only : datm_datamode_simple_advance
Expand Down Expand Up @@ -263,14 +262,16 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
open (newunit=nu,file=trim(nlfilename),status="old",action="read")
call shr_nl_find_group_name(nu, 'datm_nml', status=ierr)
if (ierr > 0) then
write(logunit,*) 'ERROR: reading input namelist, '//trim(nlfilename)//' iostat=',ierr
call shr_sys_abort(subName//': namelist read error '//trim(nlfilename))
rc = ierr
call shr_log_error(subName//': namelist read error '//trim(nlfilename), rc=rc)
return
end if
read (nu,nml=datm_nml,iostat=ierr)
close(nu)
if (ierr > 0) then
write(logunit,*) 'ERROR: reading input namelist, '//trim(nlfilename)//' iostat=',ierr
call shr_sys_abort(subName//': namelist read error '//trim(nlfilename))
rc = ierr
call shr_log_error(subName//': namelist read error '//trim(nlfilename), rc=rc)
return
end if
bcasttmp = 0
bcasttmp(1) = nx_global
Expand Down Expand Up @@ -324,7 +325,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
else if (nextsw_cday_calc == 'cam6') then
nextsw_cday_calc_cam7 = .false.
else
call shr_sys_abort(' ERROR illegal datm nextsw_cday_calc = '//trim(nextsw_cday_calc))
call shr_log_error(' ERROR illegal datm nextsw_cday_calc = '//trim(nextsw_cday_calc), rc=rc)
return
end if

! write namelist input to standard out
Expand Down Expand Up @@ -360,7 +362,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
trim(datamode) == 'ERA5' .or. &
trim(datamode) == 'SIMPLE') then
else
call shr_sys_abort(' ERROR illegal datm datamode = '//trim(datamode))
call shr_log_error(' ERROR illegal datm datamode = '//trim(datamode), rc=rc)
return
endif

! Advertise datm fields
Expand Down Expand Up @@ -488,7 +491,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
if (isPresent .and. isSet) then
read (cvalue,*) flds_scalar_index_nextsw_cday
else
call shr_sys_abort(subname//'Need to set attribute ScalarFieldIdxNextSwCday')
call shr_log_error(subname//'Need to set attribute ScalarFieldIdxNextSwCday', rc=rc)
return
endif

nextsw_cday = getNextRadCDay(dayofYear, current_tod, stepno, idt, iradsw)
Expand Down Expand Up @@ -646,7 +650,8 @@ subroutine datm_comp_run(gcomp, importState, exportState, target_ymd, target_tod
call dshr_restart_read(restfilm, rpfile, logunit, my_task, mpicom, sdat, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case default
call shr_sys_abort(subName//'datamode '//trim(datamode)//' not recognized')
call shr_log_error(subName//'datamode '//trim(datamode)//' not recognized', rc=rc)
return
end select
end if

Expand Down Expand Up @@ -714,7 +719,8 @@ subroutine datm_comp_run(gcomp, importState, exportState, target_ymd, target_tod
my_task, sdat, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case default
call shr_sys_abort(subName//'datamode '//trim(datamode)//' not recognized')
call shr_log_error(subName//'datamode '//trim(datamode)//' not recognized', rc=rc)
return
end select
end if

Expand Down Expand Up @@ -817,7 +823,8 @@ subroutine datm_init_dfields(rc)
case('cpl_scalars')
continue
case default
call shr_sys_abort(subName//'field '//trim(lfieldnames(n))//' not recognized')
call shr_log_error(subName//'field '//trim(lfieldnames(n))//' not recognized', rc=rc)
return
end select
end if
end do
Expand Down
32 changes: 31 additions & 1 deletion datm/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# pylint: disable=wildcard-import,unused-wildcard-import,wrong-import-position

import os, sys
import re

_CDEPS_CONFIG = os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir,os.pardir,"cime_config")
_CIMEROOT = os.environ.get("CIMEROOT")
Expand Down Expand Up @@ -88,6 +89,19 @@ def _get_neon_data_availability(case, neonsite):
expect(newestdate, "No tower data found on server for NEON site {}".format(neonsite))
return None

####################################################################################
def _check_datm_af_mismatch(anomaly_forcing, datm_mode):
####################################################################################

# CMIP5 and CMIP6 anomalies were only generated relative to GSWP3v1
is_cmip5_or_6 = any(x in anomaly_forcing for x in ["cmip5", "cmip6"])
if is_cmip5_or_6 and datm_mode != "CLMGSWP3v1":
raise SystemExit(
"CMIP5 and CMIP6 anomalies were only generated relative for DATM_MODE CLMGSWP3v1."
" To fix this error, do: ./xmlchange DATM_MODE=CLMGSWP3v1"
)


# pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements
####################################################################################
def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path):
Expand Down Expand Up @@ -115,6 +129,7 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path
atm_grid = case.get_value("ATM_GRID")
model_grid = case.get_value("GRID")
comp_lnd = case.get_value("COMP_LND")
compset = case.get_value("COMPSET")

# Check for incompatible options.
if "CLM" in datm_mode and comp_lnd == "clm":
Expand All @@ -135,6 +150,7 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path
logger.debug("DATM preso3 mode is {}".format(datm_preso3))
logger.debug("DATM topo mode is {}".format(datm_topo))
logger.debug("CLM_USRDAT_NAME is {}".format(clm_usrdat_name))
logger.debug("COMPSET is {}".format(compset))

# Initialize namelist defaults
config = {}
Expand Down Expand Up @@ -177,6 +193,17 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path

nmlgen.init_defaults(infile, config)

# Get anomaly forcing
# First, look in namelist
anomaly_forcing = nmlgen.get_value("anomaly_forcing")
if not anomaly_forcing or anomaly_forcing[0] is None:
# If not in namelist, check whether it's an SSP compset
ssp = re.search(r"^SSP\d+_DATM", compset)
if ssp:
ssp = ssp.group().replace("_DATM", "")
anomaly_forcing = ["Anomaly.Forcing.cmip6." + ssp.lower()]
nmlgen.set_value("anomaly_forcing", anomaly_forcing)

# Generate datm_in
namelist_file = os.path.join(confdir, "datm_in")
nmlgen.write_output_file(namelist_file, data_list_path, groups=['datm_nml','const_forcing_nml'])
Expand Down Expand Up @@ -205,8 +232,11 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path
bias_correct = nmlgen.get_value("bias_correct")
if bias_correct is not None:
streamlist.append(bias_correct)

# Set anomaly forcing in datm.streams.xml
anomaly_forcing = nmlgen.get_value("anomaly_forcing")
if anomaly_forcing[0] is not None:
if anomaly_forcing[0] is not None and anomaly_forcing[0] != "none":
_check_datm_af_mismatch(anomaly_forcing[0], datm_mode)
streamlist += anomaly_forcing

# Generate datm.streams.xml
Expand Down
Loading