Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ab0c659
addition of new optional streams for ndep, aero, co2 and o3
mvertens Dec 19, 2025
ceea1a5
fixed compiler issues
mvertens Dec 19, 2025
7d93a2e
added new streams clim_1850_cmip7 and hist_cmip7
mvertens Dec 20, 2025
44b36c0
fixed cmip7 ndep configurations
mvertens Dec 20, 2025
80cb97b
fixed typo for ndep
mvertens Dec 20, 2025
6a9cf9d
removed DEBUG print statement
mvertens Dec 20, 2025
7467e6c
determine if stream pointers are required and preset values if they are
mvertens Dec 21, 2025
2a649c1
Merge branch 'feature/fix_unstructured_multilev_input' into feature/n…
mvertens Dec 21, 2025
d6a74c2
add error code to shr_log_error where missing
mvertens Dec 21, 2025
dce9ee7
fixed compiler bug
mvertens Dec 21, 2025
a2406b3
replaced the cmip7 ndep files with those that remove the prefix strin…
mvertens Dec 22, 2025
c8e8436
Merge remote-tracking branch 'mvertens/feature/fix_unstructured_multi…
mvertens Dec 24, 2025
2399934
more updates to the share code
mvertens Dec 25, 2025
2c8d4a5
merge to head of mvertens/feature/fix_unstructured_multilev_input
mvertens Dec 25, 2025
0119f50
Merge branch 'feature/fix_unstructured_multilev_input' into feature/n…
mvertens Dec 31, 2025
3d97bac
updated buildnml
mvertens Dec 31, 2025
a719f81
fixed compilation problem for gnu
mvertens Dec 31, 2025
29becf2
updated to cdeps1.0.83_noresm_v3
mvertens Dec 31, 2025
092836f
Merge branch 'noresm' into feature/new_datm_optional_streams
mvertens Dec 31, 2025
b139209
updated comments
mvertens Dec 31, 2025
c43ac11
fixed gnu compiler error
mvertens Jan 3, 2026
cb5f4a7
updated dglc tests
mvertens Jan 3, 2026
76fec80
addressed comments in PR review
mvertens Jan 4, 2026
8ef224a
new cmip7 default settings for datm ndep forcing
mvertens Jan 6, 2026
47566bb
added issues raised in review of ESCOMP/CDEPS PR#368
mvertens Jan 6, 2026
410ce30
addressed testing failures
mvertens Jan 6, 2026
29690ef
removed unnecessary commented section and cleaned up typo
mvertens Jan 6, 2026
7bcb202
minor editing changes
mvertens Jan 6, 2026
06bdf5f
minor changes to get PR aligned with corresponding ESCOMP CDEPS PR
mvertens Jan 6, 2026
b783bf7
more cleanup changes
mvertens Jan 8, 2026
620d15c
updated share to escomp/main since this is only used by UFS and will …
mvertens Jan 9, 2026
2b5fca7
fixed typo
mvertens Jan 9, 2026
2e60aed
updated testlist_dglc.xml to be consistent with escomp/main
mvertens Jan 9, 2026
7d6db27
updated datm/buildnml to be up to date with escomp/main
mvertens Jan 9, 2026
e5915ac
updated workflows to be up to date with escomp/main
mvertens Jan 9, 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
6 changes: 5 additions & 1 deletion datm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ set(SRCFILES atm_comp_nuopc.F90
datm_datamode_jra_mod.F90
datm_datamode_gefs_mod.F90
datm_datamode_era5_mod.F90
datm_datamode_simple_mod.F90)
datm_datamode_simple_mod.F90
datm_pres_aero_mod.F90
datm_pres_co2_mod.F90
datm_pres_ndep_mod.F90
datm_pres_o3_mod.F90)


foreach(FILE ${SRCFILES})
Expand Down
168 changes: 97 additions & 71 deletions datm/atm_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,22 @@ module cdeps_datm_comp
use datm_datamode_simple_mod , only : datm_datamode_simple_init_pointers
use datm_datamode_simple_mod , only : datm_datamode_simple_advance

use datm_pres_ndep_mod , only : datm_pres_ndep_advertise
use datm_pres_ndep_mod , only : datm_pres_ndep_init_pointers
use datm_pres_ndep_mod , only : datm_pres_ndep_advance

use datm_pres_aero_mod , only : datm_pres_aero_advertise
use datm_pres_aero_mod , only : datm_pres_aero_init_pointers
use datm_pres_aero_mod , only : datm_pres_aero_advance

use datm_pres_o3_mod , only : datm_pres_o3_advertise
use datm_pres_o3_mod , only : datm_pres_o3_init_pointers
use datm_pres_o3_mod , only : datm_pres_o3_advance

use datm_pres_co2_mod , only : datm_pres_co2_advertise
use datm_pres_co2_mod , only : datm_pres_co2_init_pointers
use datm_pres_co2_mod , only : datm_pres_co2_advance

implicit none
private ! except

Expand Down Expand Up @@ -370,23 +386,33 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
return
endif

! Advertise datm fields
! Advertise fields that are not datamode specific
if (flds_co2) then
call datm_pres_co2_advertise(fldsExport, datamode)
end if
if (flds_preso3) then
call datm_pres_o3_advertise(fldsExport)
end if
if (flds_presndep) then
call datm_pres_ndep_advertise(fldsExport)
end if
if (flds_presaero) then
call datm_pres_aero_advertise(fldsExport)
end if

! Advertise fields that are not datamode specific
Comment thread
gold2718 marked this conversation as resolved.
Outdated
select case (trim(datamode))
case ('CORE2_NYF', 'CORE2_IAF')
call datm_datamode_core2_advertise(exportState, fldsExport, flds_scalar_name, &
flds_co2, flds_wiso, flds_presaero, flds_presndep, rc)
call datm_datamode_core2_advertise(exportState, fldsExport, flds_scalar_name, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case ('CORE_IAF_JRA', 'CORE_RYF6162_JRA', 'CORE_RYF8485_JRA', 'CORE_RYF9091_JRA', 'CORE_RYF0304_JRA')
call datm_datamode_jra_advertise(exportState, fldsExport, flds_scalar_name, &
flds_co2, flds_wiso, flds_presaero, flds_presndep, rc)
call datm_datamode_jra_advertise(exportState, fldsExport, flds_scalar_name, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case ('CLMNCEP')
call datm_datamode_clmncep_advertise(exportState, fldsExport, flds_scalar_name, &
flds_co2, flds_wiso, flds_presaero, flds_presndep, flds_preso3, rc)
call datm_datamode_clmncep_advertise(exportState, fldsExport, flds_scalar_name, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case ('CPLHIST')
call datm_datamode_cplhist_advertise(exportState, fldsExport, flds_scalar_name, &
flds_co2, flds_wiso, flds_presaero, flds_presndep, rc)
call datm_datamode_cplhist_advertise(exportState, fldsExport, flds_scalar_name, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case ('ERA5')
call datm_datamode_era5_advertise(exportState, fldsExport, flds_scalar_name, rc)
Expand Down Expand Up @@ -603,7 +629,7 @@ subroutine datm_comp_run(gcomp, importState, exportState, target_ymd, target_tod

! local variables
logical :: first_time = .true.
character(len=CL) :: rpfile
character(len=CL) :: rpfile
character(*), parameter :: subName = '(datm_comp_run) '
!-------------------------------------------------------------------------------

Expand All @@ -616,11 +642,35 @@ subroutine datm_comp_run(gcomp, importState, exportState, target_ymd, target_tod
!--------------------

if (first_time) then
! Initialize data pointers for co2 (non datamode specific)
if (flds_co2) then
call datm_pres_co2_init_pointers(exportState, sdat, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if

! Initialize data pointers for o3 (non datamode specific)
if (flds_preso3) then
call datm_pres_o3_init_pointers(exportState, sdat, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if

! Initialize data pointers for nitrogen deposition (non datamode specific and use of ungridded dimensions)
if (flds_presndep) then
call datm_pres_ndep_init_pointers(exportState, sdat, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if

! Initialize data pointers for prescribed aerosols (non datamode specific and use of ungridded dimensions)
if (flds_presaero) then
call datm_pres_aero_init_pointers(exportState, sdat, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if

! Initialize dfields
call datm_init_dfields(rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

! Initialize datamode module ponters
! Initialize datamode module pointers
select case (trim(datamode))
case('CORE2_NYF','CORE2_IAF')
call datm_datamode_core2_init_pointers(exportState, sdat, datamode, factorfn_mesh, factorfn_data, rc)
Expand Down Expand Up @@ -650,7 +700,10 @@ subroutine datm_comp_run(gcomp, importState, exportState, target_ymd, target_tod
call shr_get_rpointer_name(gcomp, 'atm', target_ymd, target_tod, rpfile, 'read', rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
select case (trim(datamode))
case('CORE2_NYF','CORE2_IAF','CORE_IAF_JRA','CORE_RYF6162_JRA','CORE_RYF8485_JRA','CORE_RYF9091_JRA','CORE_RYF0304_JRA','CLMNCEP','CPLHIST','ERA5','GEFS','SIMPLE')
case('CORE2_NYF','CORE2_IAF','CORE_IAF_JRA',&
'CORE_RYF6162_JRA','CORE_RYF8485_JRA' ,&
'CORE_RYF9091_JRA','CORE_RYF0304_JRA' ,&
'CLMNCEP','CPLHIST','ERA5','GEFS','SIMPLE')
call dshr_restart_read(restfilm, rpfile, logunit, my_task, mpicom, sdat, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case default
Expand All @@ -676,6 +729,24 @@ subroutine datm_comp_run(gcomp, importState, exportState, target_ymd, target_tod
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_TraceRegionExit('datm_strdata_advance')

! Update export state for non data-mode specific fields
if (flds_co2) then
call datm_pres_co2_advance()
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if
if (flds_preso3) then
call datm_pres_o3_advance()
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if
if (flds_presndep) then
call datm_pres_ndep_advance()
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if
if (flds_presaero) then
call datm_pres_aero_advance()
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if

! copy all fields from streams to export state as default
! This automatically will update the fields in the export state
call ESMF_TraceRegionEnter('datm_dfield_copy')
Expand Down Expand Up @@ -718,9 +789,12 @@ subroutine datm_comp_run(gcomp, importState, exportState, target_ymd, target_tod
call shr_get_rpointer_name(gcomp, 'atm', target_ymd, target_tod, rpfile, 'write', rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
select case (trim(datamode))
case('CORE2_NYF','CORE2_IAF','CORE_IAF_JRA','CORE_RYF6162_JRA','CORE_RYF8485_JRA','CORE_RYF9091_JRA','CORE_RYF0304_JRA','CLMNCEP','CPLHIST','ERA5','GEFS','SIMPLE')
call dshr_restart_write(rpfile, case_name, 'datm', inst_suffix, target_ymd, target_tod, logunit, &
my_task, sdat, rc)
case('CORE2_NYF','CORE2_IAF','CORE_IAF_JRA',&
'CORE_RYF6162_JRA','CORE_RYF8485_JRA' ,&
'CORE_RYF9091_JRA','CORE_RYF0304_JRA' ,&
'CLMNCEP','CPLHIST','ERA5','GEFS','SIMPLE')
call dshr_restart_write(rpfile, case_name, 'datm', inst_suffix, &
target_ymd, target_tod, logunit, my_task, sdat, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case default
call shr_log_error(subName//'datamode '//trim(datamode)//' not recognized', rc=rc)
Expand Down Expand Up @@ -754,13 +828,10 @@ subroutine datm_init_dfields(rc)
integer, intent(out) :: rc

! local variables
integer :: n
character(CS) :: strm_flds2(2)
character(CS) :: strm_flds3(3)
character(CS) :: strm_flds4(4)
integer :: rank
integer :: fieldcount
type(ESMF_Field) :: lfield
integer :: n
integer :: rank
integer :: fieldcount
type(ESMF_Field) :: lfield
character(ESMF_MAXSTR) ,pointer :: lfieldnames(:)
character(*), parameter :: subName = "(datm_init_dfields) "
!-------------------------------------------------------------------------------
Expand All @@ -778,58 +849,13 @@ subroutine datm_init_dfields(rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call ESMF_FieldGet(lfield, rank=rank, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (rank == 1) then
! Currently rank==2 fields are handled in datm_pres_aero_mod.F90, datm_pres_co2_mod.F90
! and datm_pres_ndep_mod.F90
! The rank one Sa_o3 field is handled in datm_pres_o3_mod.F90
if (rank == 1 .and. trim(lfieldnames(n)) /= 'Sa_o3') then
call dshr_dfield_add( dfields, sdat, trim(lfieldnames(n)), trim(lfieldnames(n)), &
exportState, logunit, mainproc, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
else if (rank == 2) then
! The following maps stream input fields to export fields that have an ungridded dimension
! TODO: in the future it might be better to change the format of the streams file to have two more entries
! that could denote how the stream variables are mapped to export fields that have an ungridded dimension

select case (trim(lfieldnames(n)))
case('Faxa_bcph')
strm_flds3 = (/'Faxa_bcphidry', 'Faxa_bcphodry', 'Faxa_bcphiwet'/)
call dshr_dfield_add(dfields, sdat, trim(lfieldnames(n)), strm_flds3, exportState, logunit, mainproc, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('Faxa_ocph')
strm_flds3 = (/'Faxa_ocphidry', 'Faxa_ocphodry', 'Faxa_ocphiwet'/)
call dshr_dfield_add(dfields, sdat, trim(lfieldnames(n)), strm_flds3, exportState, logunit, mainproc, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('Faxa_dstwet')
strm_flds4 = (/'Faxa_dstwet1', 'Faxa_dstwet2', 'Faxa_dstwet3', 'Faxa_dstwet4'/)
call dshr_dfield_add(dfields, sdat, trim(lfieldnames(n)), strm_flds4, exportState, logunit, mainproc, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('Faxa_dstdry')
strm_flds4 = (/'Faxa_dstdry1', 'Faxa_dstdry2', 'Faxa_dstdry3', 'Faxa_dstdry4'/)
call dshr_dfield_add(dfields, sdat, trim(lfieldnames(n)), strm_flds4, exportState, logunit, mainproc, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('Faxa_rainc_wiso')
strm_flds3 = (/'Faxa_rainc_16O', 'Faxa_rainc_18O', 'Faxa_rainc_HDO'/)
call dshr_dfield_add(dfields, sdat, trim(lfieldnames(n)), strm_flds3, exportState, logunit, mainproc, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('Faxa_rainl_wiso')
strm_flds3 = (/'Faxa_rainl_16O', 'Faxa_rainl_18O', 'Faxa_rainl_HDO'/)
call dshr_dfield_add(dfields, sdat, trim(lfieldnames(n)), strm_flds3, exportState, logunit, mainproc, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('Faxa_snowc_wiso')
strm_flds3 = (/'Faxa_snowc_16O', 'Faxa_snowc_18O', 'Faxa_snowc_HDO'/)
call dshr_dfield_add(dfields, sdat, trim(lfieldnames(n)), strm_flds3, exportState, logunit, mainproc, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('Faxa_snowl_wiso')
strm_flds3 = (/'Faxa_snowl_16O', 'Faxa_snowl_18O', 'Faxa_snowl_HDO'/)
call dshr_dfield_add(dfields, sdat, trim(lfieldnames(n)), strm_flds3, exportState, logunit, mainproc, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('Faxa_ndep')
strm_flds2 = (/'Faxa_ndep_nhx', 'Faxa_ndep_noy'/)
call dshr_dfield_add(dfields, sdat, trim(lfieldnames(n)), strm_flds2, exportState, logunit, mainproc, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('cpl_scalars')
continue
case default
call shr_log_error(subName//'field '//trim(lfieldnames(n))//' not recognized', rc=rc)
return
end select
end if
end do
end subroutine datm_init_dfields
Expand Down
20 changes: 10 additions & 10 deletions datm/cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@

<entry id="DATM_PRESNDEP">
<type>char</type>
<valid_values>none,clim_1850,clim_2000,clim_2010,hist,SSP1-2.6,SSP2-4.5,SSP3-7.0,SSP5-3.4,SSP5-8.5,cplhist</valid_values>
<valid_values>none,clim_1850,clim_1850_cmip7,clim_2000,clim_2010,hist,hist_cmip7,SSP1-2.6,SSP2-4.5,SSP3-7.0,SSP5-3.4,SSP5-8.5,cplhist</valid_values>
<default_value>clim_2000</default_value>
<values match="last">
<value compset="^1850[CE]?_" >clim_1850</value>
<value compset="^2000_" >clim_2000</value>
<value compset="^2010_" >clim_2010</value>
<value compset="^SSP126_" >SSP1-2.6</value>
<value compset="^SSP245_" >SSP2-4.5</value>
<value compset="^SSP370_" >SSP3-7.0</value>
<value compset="^SSP585_" >SSP5-8.5</value>
<value compset="^HIST[CE]?_" >hist</value>
<value compset="^20TR_" >hist</value>
<value compset="^1850[CE]?_" >clim_1850</value>
<value compset="^2000_" >clim_2000</value>
<value compset="^2010_" >clim_2010</value>
<value compset="^SSP126_" >SSP1-2.6</value>
<value compset="^SSP245_" >SSP2-4.5</value>
<value compset="^SSP370_" >SSP3-7.0</value>
<value compset="^SSP585_" >SSP5-8.5</value>
<value compset="^HIST[CE]?_" >hist</value>
<value compset="^20TR_" >hist</value>
<value compset="_DATM%CPLHIST">cplhist</value>
<value compset="_DATM.*_DICE.*_DOCN.*_DROF">none</value>
</values>
Expand Down
Loading