Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync CDEPS with ESCOMP #60

Merged
merged 68 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
5bec8cd
introduce simple data mode as an constant configurable forcing.
alperaltuntas Dec 19, 2022
916ca86
add constant forcing namelist and set forcing fields to values from nml
alperaltuntas Dec 19, 2022
f2688cd
Merge branch 'master' into merge_simple_forcing
jedwards4b Dec 21, 2022
52fdf7b
Merge branch 'master' into merge_simple_forcing
jedwards4b Dec 23, 2022
27e1c3e
Update stream definitions for new coupler history file format.
olyson Apr 28, 2023
8136439
Merge tag 'cdeps1.0.10' into cplhistStreams
olyson Apr 28, 2023
d47f1ba
filename_add_days to filename_advance_days
olyson Apr 28, 2023
00414e1
Remove tabs fixing #231
ekluzek May 8, 2023
977260a
Add externals to the git ignore
ekluzek May 8, 2023
0afab9d
Merge pull request #232 from ekluzek/removetabsindatmbuildnml
jedwards4b May 9, 2023
252acc0
Merge remote-tracking branch 'escomp/main' into cplhistStreams
billsacks May 9, 2023
af2a809
Merge pull request #228 from olyson/cplhistStreams
billsacks May 9, 2023
1ca35a5
black reformat these python files
jedwards4b May 16, 2023
aa77161
Merge pull request #233 from jedwards4b/black_format_python
jedwards4b May 17, 2023
380f6fe
update github to make cdeps ext build an action
jedwards4b May 19, 2023
895f31b
debug action
jedwards4b May 19, 2023
cae6d80
try again
jedwards4b May 19, 2023
169c280
fix run statement format
jedwards4b May 19, 2023
4a1f889
need to build in action to make it useable by other repos
jedwards4b May 19, 2023
d7c8f92
Merge pull request #234 from jedwards4b/update_actions
jedwards4b May 19, 2023
9a1d6f9
update SST files for historical configurations
fvitt Jun 5, 2023
63889cd
Merge pull request #235 from fvitt/sst_files_update
jedwards4b Jun 5, 2023
f5ad119
correct docs link in README.md
klindsay28 Jun 27, 2023
bb232d8
enable DISABLE_FoX for standalone build
uturuncoglu Jul 3, 2023
f3a837b
install data component specific module files
uturuncoglu Jul 4, 2023
2521e4e
introduce export_all option
uturuncoglu Jun 30, 2022
fe5a578
Merge pull request #236 from klindsay28/docs_link_in_readme
jedwards4b Jul 10, 2023
39bc5b1
Merge remote-tracking branch 'upstream/main' into feature/esmx
uturuncoglu Jul 10, 2023
ae827c3
Merge pull request #237 from uturuncoglu/feature/esmx
uturuncoglu Jul 10, 2023
707b505
fix for docn
uturuncoglu Jul 13, 2023
26ab1e0
Merge pull request #238 from uturuncoglu/hotfix/export_all
jedwards4b Jul 13, 2023
4750a27
update esmf bld to use official esmf action
jedwards4b Aug 16, 2023
bb60bdc
update esmf bld to use official esmf action
jedwards4b Aug 16, 2023
aab9411
add pio as external to esmf build
jedwards4b Aug 16, 2023
2e1b9f8
add pio as external to esmf build
jedwards4b Aug 16, 2023
57ef5ec
add pnetcdf-config
jedwards4b Aug 16, 2023
6dce402
cleanup github workflow script
jedwards4b Aug 16, 2023
8276318
response to review
jedwards4b Aug 16, 2023
f415e66
response to review
jedwards4b Aug 16, 2023
f7e657e
Merge pull request #239 from jedwards4b/github_esmf_bld_update
jedwards4b Aug 17, 2023
d31de60
simple fix
Aug 21, 2023
c4a200b
Merge branch 'main' into buildlib_fix
Aug 21, 2023
8b7bb12
make a little nicer
Aug 21, 2023
a04df35
put back...
Aug 21, 2023
4a6b374
Merge pull request #241 from adrifoster/buildlib_fix
billsacks Aug 21, 2023
30477e1
merge cdeps1.0.21 and resolve conflicts
alperaltuntas Oct 4, 2023
57cd466
in simple (idealized) data mode, replace giss radiation with an ideal…
alperaltuntas Oct 8, 2023
3501b20
address change requests: undo nlfilename assignment reorder, use ESMF…
alperaltuntas Oct 9, 2023
74b5c4c
Merge pull request #198 from alperaltuntas/merge_simple_forcing
jedwards4b Oct 9, 2023
4a38196
add save attribute to this variable
jedwards4b Oct 17, 2023
a0e50c9
add namelist lookup to each namelist read call
jedwards4b Oct 20, 2023
7f79dc6
need to add shr_nl_mod for standalone builds
jedwards4b Oct 20, 2023
723d3f9
Merge pull request #250 from jedwards4b/add_nl_lookup_tool
jedwards4b Oct 20, 2023
9de323e
fix minor typo in drof modifier mode
alperaltuntas Oct 24, 2023
7ebbff8
Merge pull request #251 from alperaltuntas/fix_modifier_typo
jedwards4b Oct 24, 2023
9945da5
allow path changes and symlinks in stream filenames
jedwards4b Oct 27, 2023
97a2da6
Merge pull request #253 from jedwards4b/allow_path_changes
jedwards4b Oct 27, 2023
4211498
enabling setting source and destination mask for interpolation
uturuncoglu Nov 9, 2023
ee00179
update default SSTICE_DATA_FILENAME to match that previously used in cam
jedwards4b Dec 13, 2023
416b566
enabling setting source and destination mask for interpolation
uturuncoglu Nov 9, 2023
28cc73e
Merge pull request #259 from uturuncoglu/feature/mask_only
jedwards4b Jan 26, 2024
30a360c
Merge branch 'main' into sst_Had_update
jedwards4b Jan 26, 2024
5d4f62a
sync with escomp
uturuncoglu Jan 26, 2024
9338407
minor fix
uturuncoglu Jan 26, 2024
3c70fc8
Merge pull request #256 from jedwards4b/sst_Had_update
jedwards4b Jan 26, 2024
4cb3a75
Merge remote-tracking branch 'upstream/main' into feature/mask
uturuncoglu Jan 29, 2024
1d6b65a
Merge remote-tracking branch 'remotes/upstream/develop' into feature/…
BinLiu-NOAA Feb 1, 2024
66cc553
Merge pull request #1 from hafs-community/feature/mask
uturuncoglu Feb 1, 2024
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
9 changes: 7 additions & 2 deletions datm/atm_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ module cdeps_datm_comp
use datm_datamode_gfs_hafs_mod , only : datm_datamode_gfs_hafs_advance
use datm_datamode_gfs_hafs_mod , only : datm_datamode_gfs_hafs_restart_write
use datm_datamode_gfs_hafs_mod , only : datm_datamode_gfs_hafs_restart_read

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
use datm_datamode_simple_mod , only : datm_datamode_simple_restart_write
use datm_datamode_simple_mod , only : datm_datamode_simple_restart_read

use datm_datamode_simple_mod , only : datm_datamode_simple_advertise
use datm_datamode_simple_mod , only : datm_datamode_simple_init_pointers
Expand Down Expand Up @@ -744,6 +750,7 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe
case('GEFS')
call datm_datamode_gefs_advance(exportstate, mainproc, logunit, mpicom, target_ymd, &
target_tod, sdat%model_calendar, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('CFSR')
call datm_datamode_cfsr_advance(exportstate, mainproc, logunit, mpicom, target_ymd, &
target_tod, sdat%model_calendar, rc)
Expand Down Expand Up @@ -786,11 +793,9 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe
case('CFSR')
call datm_datamode_cfsr_restart_write(case_name, inst_suffix, target_ymd, target_tod, &
logunit, my_task, sdat)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('GFS')
call datm_datamode_gfs_restart_write(case_name, inst_suffix, target_ymd, target_tod, &
logunit, my_task, sdat)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('GFS_HAFS')
call datm_datamode_gfs_hafs_restart_write(case_name, inst_suffix, target_ymd, target_tod, &
logunit, my_task, sdat)
Expand Down
2 changes: 1 addition & 1 deletion docn/cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
<entry id="SSTICE_DATA_FILENAME">
<type>char</type>
<valid_values></valid_values>
<default_value>$DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1x1_clim_c101029.nc</default_value>
<default_value>$DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1x1_2000climo_c180511.nc</default_value>
<values match="last">
<value compset="DOCN%DOM" grid="a%T31.*_oi%T31" >$DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_48x96_clim_c050526.nc</value>
<value compset="DOCN%DOM" grid="a%1.9x2.5.*_oi%1.9x2.5" >$DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_clim_c061031.nc</value>
Expand Down
56 changes: 35 additions & 21 deletions streams/dshr_strdata_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ subroutine shr_strdata_init_from_inline(sdat, my_task, logunit, compname, &
stream_meshfile, stream_lev_dimname, stream_mapalgo, &
stream_filenames, stream_fldlistFile, stream_fldListModel, &
stream_yearFirst, stream_yearLast, stream_yearAlign, &
stream_offset, stream_taxmode, stream_dtlimit, stream_tintalgo, stream_name, rc)
stream_offset, stream_taxmode, stream_dtlimit, stream_tintalgo, &
stream_src_mask, stream_dst_mask, stream_name, rc)

! input/output variables
type(shr_strdata_type) , intent(inout) :: sdat ! stream data type
Expand All @@ -262,8 +263,14 @@ subroutine shr_strdata_init_from_inline(sdat, my_task, logunit, compname, &
character(*) , intent(in) :: stream_taxMode ! time axis mode
real(r8) , intent(in) :: stream_dtlimit ! ratio of max/min stream delta times
character(*) , intent(in) :: stream_tintalgo ! time interpolation algorithm
integer, optional , intent(in) :: stream_src_mask ! source mask value
integer, optional , intent(in) :: stream_dst_mask ! destination mask value
character(*), optional , intent(in) :: stream_name ! name of stream
integer , intent(out) :: rc ! error code
integer, optional , intent(out) :: rc ! error code

! local variables
integer :: src_mask = 0
integer :: dst_mask = 0
! ----------------------------------------------

rc = ESMF_SUCCESS
Expand All @@ -277,6 +284,10 @@ subroutine shr_strdata_init_from_inline(sdat, my_task, logunit, compname, &
sdat%io_format = shr_pio_getioformat(trim(compname))
#endif

! Check source and destination mask, defaults are 0
if (present(stream_src_mask)) src_mask = stream_src_mask
if (present(stream_dst_mask)) dst_mask = stream_dst_mask

! Initialize sdat%pstrm - ASSUME only 1 stream
allocate(sdat%pstrm(1))

Expand All @@ -292,7 +303,7 @@ subroutine shr_strdata_init_from_inline(sdat, my_task, logunit, compname, &
stream_yearFirst, stream_yearLast, stream_yearAlign, &
stream_offset, stream_taxmode, stream_tintalgo, stream_dtlimit, &
stream_fldlistFile, stream_fldListModel, stream_fileNames, &
logunit, trim(compname))
logunit, trim(compname), src_mask, dst_mask)

! Now finish initializing sdat
call shr_strdata_init(sdat, model_clock, stream_name, rc)
Expand Down Expand Up @@ -549,8 +560,8 @@ subroutine shr_strdata_init(sdat, model_clock, stream_name, rc)
regridmethod=ESMF_REGRIDMETHOD_BILINEAR, &
polemethod=ESMF_POLEMETHOD_ALLAVG, &
extrapMethod=ESMF_EXTRAPMETHOD_NEAREST_STOD, &
dstMaskValues = (/0/), & ! ignore destination points where the mask is 0
srcMaskValues = (/0/), & ! ignore source points where the mask is 0
dstMaskValues=(/sdat%stream(ns)%dst_mask_val/), &
srcMaskValues=(/sdat%stream(ns)%src_mask_val/), &
srcTermProcessing=srcTermProcessing_Value, ignoreDegenerate=.true., rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
else if (trim(sdat%stream(ns)%mapalgo) == 'redist') then
Expand All @@ -562,26 +573,26 @@ subroutine shr_strdata_init(sdat, model_clock, stream_name, rc)
call ESMF_FieldReGridStore(sdat%pstrm(ns)%field_stream, lfield_dst, &
routehandle=sdat%pstrm(ns)%routehandle, &
regridmethod=ESMF_REGRIDMETHOD_NEAREST_STOD, &
dstMaskValues = (/0/), & ! ignore destination points where the mask is 0
srcMaskValues = (/0/), & ! ignore source points where the mask is 0
dstMaskValues=(/sdat%stream(ns)%dst_mask_val/), &
srcMaskValues=(/sdat%stream(ns)%src_mask_val/), &
srcTermProcessing=srcTermProcessing_Value, ignoreDegenerate=.true., &
unmappedaction=ESMF_UNMAPPEDACTION_IGNORE, rc=rc)
else if (trim(sdat%stream(ns)%mapalgo) == 'consf') then
call ESMF_FieldReGridStore(sdat%pstrm(ns)%field_stream, lfield_dst, &
routehandle=sdat%pstrm(ns)%routehandle, &
regridmethod=ESMF_REGRIDMETHOD_CONSERVE, &
normType=ESMF_NORMTYPE_FRACAREA, &
dstMaskValues = (/0/), & ! ignore destination points where the mask is 0
srcMaskValues = (/0/), & ! ignore source points where the mask is 0
dstMaskValues=(/sdat%stream(ns)%dst_mask_val/), &
srcMaskValues=(/sdat%stream(ns)%src_mask_val/), &
srcTermProcessing=srcTermProcessing_Value, ignoreDegenerate=.true., &
unmappedaction=ESMF_UNMAPPEDACTION_IGNORE, rc=rc)
else if (trim(sdat%stream(ns)%mapalgo) == 'consd') then
call ESMF_FieldReGridStore(sdat%pstrm(ns)%field_stream, lfield_dst, &
routehandle=sdat%pstrm(ns)%routehandle, &
regridmethod=ESMF_REGRIDMETHOD_CONSERVE, &
normType=ESMF_NORMTYPE_DSTAREA, &
dstMaskValues = (/0/), & ! ignore destination points where the mask is 0
srcMaskValues = (/0/), & ! ignore source points where the mask is 0
dstMaskValues=(/sdat%stream(ns)%dst_mask_val/), &
srcMaskValues=(/sdat%stream(ns)%src_mask_val/), &
srcTermProcessing=srcTermProcessing_Value, ignoreDegenerate=.true., &
unmappedaction=ESMF_UNMAPPEDACTION_IGNORE, rc=rc)
else if (trim(sdat%stream(ns)%mapalgo) == 'none') then
Expand Down Expand Up @@ -1235,9 +1246,10 @@ subroutine shr_strdata_print(sdat, name)
character(*),parameter :: F00 = "('(shr_strdata_print) ',8a)"
character(*),parameter :: F01 = "('(shr_strdata_print) ',a,i6,a)"
character(*),parameter :: F02 = "('(shr_strdata_print) ',a,es13.6)"
character(*),parameter :: F04 = "('(shr_strdata_print) ',a,i2,a,a)"
character(*),parameter :: F05 = "('(shr_strdata_print) ',a)"
character(*),parameter :: F07 = "('(shr_strdata_print) ',a,i2,a,es13.6)"
character(*),parameter :: F03 = "('(shr_strdata_print) ',a,i2,a,a)"
character(*),parameter :: F04 = "('(shr_strdata_print) ',a)"
character(*),parameter :: F05 = "('(shr_strdata_print) ',a,i2,a,es13.6)"
character(*),parameter :: F06 = "('(shr_strdata_print) ',a,i2,a,i1)"
character(*),parameter :: F90 = "('(shr_strdata_print) ',58('-'))"
!-------------------------------------------------------------------------------

Expand All @@ -1251,14 +1263,16 @@ subroutine shr_strdata_print(sdat, name)
write(sdat%stream(1)%logunit,F02) "obliqr = ",sdat%obliqr
write(sdat%stream(1)%logunit,F01) "pio_iotype = ",sdat%io_type
write(sdat%stream(1)%logunit,F01) "nstreams = ",shr_strdata_get_stream_count(sdat)
write(sdat%stream(1)%logunit,F05) "Per stream information "
write(sdat%stream(1)%logunit,F04) "Per stream information "
do ns = 1, shr_strdata_get_stream_count(sdat)
write(sdat%stream(1)%logunit,F04) " taxMode (",ns,") = ",trim(sdat%stream(ns)%taxmode)
write(sdat%stream(1)%logunit,F07) " dtlimit (",ns,") = ",sdat%stream(ns)%dtlimit
write(sdat%stream(1)%logunit,F04) " mapalgo (",ns,") = ",trim(sdat%stream(ns)%mapalgo)
write(sdat%stream(1)%logunit,F04) " tintalgo(",ns,") = ",trim(sdat%stream(ns)%tinterpalgo)
write(sdat%stream(1)%logunit,F04) " readmode(",ns,") = ",trim(sdat%stream(ns)%readmode)
write(sdat%stream(1)%logunit,F04) " vectors (",ns,") = ",trim(sdat%stream(ns)%stream_vectors)
write(sdat%stream(1)%logunit,F03) " taxMode (",ns,") = ",trim(sdat%stream(ns)%taxmode)
write(sdat%stream(1)%logunit,F05) " dtlimit (",ns,") = ",sdat%stream(ns)%dtlimit
write(sdat%stream(1)%logunit,F03) " mapalgo (",ns,") = ",trim(sdat%stream(ns)%mapalgo)
write(sdat%stream(1)%logunit,F03) " tintalgo(",ns,") = ",trim(sdat%stream(ns)%tinterpalgo)
write(sdat%stream(1)%logunit,F03) " readmode(",ns,") = ",trim(sdat%stream(ns)%readmode)
write(sdat%stream(1)%logunit,F03) " vectors (",ns,") = ",trim(sdat%stream(ns)%stream_vectors)
write(sdat%stream(1)%logunit,F06) " src_mask(",ns,") = ",sdat%stream(ns)%src_mask_val
write(sdat%stream(1)%logunit,F06) " dst_mask(",ns,") = ",sdat%stream(ns)%dst_mask_val
write(sdat%stream(1)%logunit,F01) " "
end do
write(sdat%stream(1)%logunit,F90)
Expand Down
21 changes: 19 additions & 2 deletions streams/dshr_stream_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ module dshr_stream_mod
type(file_desc_t) :: currpioid ! current pio file desc
type(shr_stream_file_type) , allocatable :: file(:) ! filenames of stream data files (full pathname)
type(shr_stream_data_variable), allocatable :: varlist(:) ! stream variable names (on file and in model)
integer :: src_mask_val = 0 ! mask value for src mesh
integer :: dst_mask_val = 0 ! mask value for dst mesh
end type shr_stream_streamType

!----- parameters -----
Expand Down Expand Up @@ -445,7 +447,7 @@ subroutine shr_stream_init_from_inline(streamdat, &
stream_yearFirst, stream_yearLast, stream_yearAlign, &
stream_offset, stream_taxmode, stream_tintalgo, stream_dtlimit, &
stream_fldlistFile, stream_fldListModel, stream_fileNames, &
logunit, compname)
logunit, compname, stream_src_mask_val, stream_dst_mask_val)

! --------------------------------------------------------
! set values of stream datatype independent of a reading in a stream text file
Expand All @@ -472,6 +474,8 @@ subroutine shr_stream_init_from_inline(streamdat, &
character(*) ,intent(in) :: stream_filenames(:) ! stream data filenames (full pathnamesa)
integer ,intent(in) :: logunit ! stdout unit
character(len=*) ,intent(in) :: compname ! component name (e.g. ATM, OCN...)
integer ,optional, intent(in) :: stream_src_mask_val ! source mask value
integer ,optional, intent(in) :: stream_dst_mask_val ! destination mask value

! local variables
integer :: n
Expand Down Expand Up @@ -534,10 +538,15 @@ subroutine shr_stream_init_from_inline(streamdat, &

! Initialize logunit
streamdat(:)%logunit = logunit

! Get stream calendar
call shr_stream_getCalendar(streamdat(1), 1, calendar)
streamdat(1)%calendar = trim(calendar)

! Set source and destination mask
if (present(stream_src_mask_val)) streamdat(1)%src_mask_val = stream_src_mask_val
if (present(stream_dst_mask_val)) streamdat(1)%dst_mask_val = stream_dst_mask_val

! Initialize flag that stream has been set
streamdat(1)%init = .true.

Expand Down Expand Up @@ -571,6 +580,8 @@ subroutine shr_stream_init_from_esmfconfig(streamfilename, streamdat, logunit,
!! stream_data_files:
!! stream_data_variables:
!! stream_offset:
!! stream_src_mask:
!! stream_dst_mask:
!!---------------------------------------------------------------------

! input/output variables
Expand Down Expand Up @@ -606,7 +617,6 @@ subroutine shr_stream_init_from_esmfconfig(streamfilename, streamdat, logunit,
call ESMF_ConfigLoadFile(config=CF ,filename=trim(streamfilename), rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return


! get number of streams
nstrms = ESMF_ConfigGetLen(config=CF, label='stream_info:', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
Expand Down Expand Up @@ -718,6 +728,13 @@ subroutine shr_stream_init_from_esmfconfig(streamfilename, streamdat, logunit,

call shr_stream_getCalendar(streamdat(i), 1, streamdat(i)%calendar)

! Get source and destination mask, 0 by default
call ESMF_ConfigGetAttribute(CF,value=streamdat(i)%src_mask_val,label="stream_src_mask"//mystrm//':', default=0, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

call ESMF_ConfigGetAttribute(CF,value=streamdat(i)%dst_mask_val,label="stream_dst_mask"//mystrm//':', default=0, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

! Error check
if (trim(streamdat(i)%taxmode) == shr_stream_taxis_extend .and. streamdat(i)%dtlimit < 1.e10) then
call shr_sys_abort(trim(subName)//" ERROR: if taxmode value is extend set dtlimit to 1.e30")
Expand Down