Skip to content

Commit

Permalink
Merge branch 'develop' into rrfsv1-to-ufs/dev9
Browse files Browse the repository at this point in the history
  • Loading branch information
grantfirl committed Dec 23, 2024
2 parents bff5acd + e119370 commit 81341db
Show file tree
Hide file tree
Showing 74 changed files with 3,334 additions and 2,721 deletions.
2 changes: 1 addition & 1 deletion CDEPS-interface/CDEPS
Submodule CDEPS updated 69 files
+4 −4 .github/workflows/extbuild.yml
+3 −0 .gitmodules
+1 −18 CMakeLists.txt
+43 −25 cime_config/buildlib
+21 −0 cime_config/stream_cdeps.py
+2 −1 cime_config/stream_definition_v2.0.xsd
+0 −150 cime_config/testdefs/testlist_cdeps.xml
+63 −77 datm/atm_comp_nuopc.F90
+12 −5 datm/cime_config/buildnml
+13 −2 datm/cime_config/config_component.xml
+40 −7 datm/cime_config/namelist_definition_datm.xml
+334 −9 datm/cime_config/stream_definition_datm.xml
+39 −34 datm/cime_config/testdefs/testlist_datm.xml
+0 −38 datm/datm_datamode_clmncep_mod.F90
+12 −39 datm/datm_datamode_core2_mod.F90
+2 −41 datm/datm_datamode_cplhist_mod.F90
+2 −40 datm/datm_datamode_era5_mod.F90
+0 −39 datm/datm_datamode_gefs_mod.F90
+18 −39 datm/datm_datamode_jra_mod.F90
+0 −39 datm/datm_datamode_simple_mod.F90
+34 −0 dglc/CMakeLists.txt
+1 −0 dglc/cime_config/buildlib
+197 −0 dglc/cime_config/buildnml
+11 −0 dglc/cime_config/config_archive.xml
+92 −0 dglc/cime_config/config_component.xml
+140 −0 dglc/cime_config/namelist_definition_dglc.xml
+49 −0 dglc/cime_config/stream_definition_dglc.xml
+42 −0 dglc/cime_config/testdefs/testlist_dglc.xml
+13 −0 dglc/cime_config/user_nl_dglc
+33 −0 dglc/cime_config/user_nl_dglc_streams
+697 −0 dglc/dglc_datamode_noevolve_mod.F90
+842 −0 dglc/glc_comp_nuopc.F90
+6 −4 dice/cime_config/testdefs/testlist_dice.xml
+12 −6 dice/dice_datamode_cplhist_mod.F90
+12 −9 dice/dice_datamode_ssmi_mod.F90
+16 −10 dice/ice_comp_nuopc.F90
+3 −2 dlnd/cime_config/testdefs/testlist_dlnd.xml
+19 −10 dlnd/lnd_comp_nuopc.F90
+4 −1 doc/source/datm.rst
+117 −0 doc/source/dglc.rst
+1 −0 doc/source/index.rst
+2 −1 doc/source/introduction.rst
+3 −1 doc/source/streams.rst
+2 −0 docn/CMakeLists.txt
+6 −2 docn/cime_config/config_component.xml
+5 −1 docn/cime_config/namelist_definition_docn.xml
+99 −1 docn/cime_config/stream_definition_docn.xml
+10 −7 docn/cime_config/testdefs/testlist_docn.xml
+0 −39 docn/docn_datamode_copyall_mod.F90
+0 −39 docn/docn_datamode_cplhist_mod.F90
+0 −44 docn/docn_datamode_iaf_mod.F90
+221 −0 docn/docn_datamode_multilev_dom_mod.F90
+186 −0 docn/docn_datamode_multilev_mod.F90
+15 −9 docn/docn_datamode_som_mod.F90
+77 −35 docn/ocn_comp_nuopc.F90
+4 −2 drof/cime_config/config_component.xml
+2 −1 drof/cime_config/namelist_definition_drof.xml
+32 −0 drof/cime_config/stream_definition_drof.xml
+3 −2 drof/cime_config/testdefs/testlist_drof.xml
+18 −11 drof/rof_comp_nuopc.F90
+16 −4 dshr/dshr_dfield_mod.F90
+16 −23 dshr/dshr_mod.F90
+3 −2 dwav/cime_config/testdefs/testlist_dwav.xml
+17 −9 dwav/wav_comp_nuopc.F90
+2 −1 share/CMakeLists.txt
+936 −0 share/nuopc_shr_methods.F90
+6 −3 streams/dshr_methods_mod.F90
+50 −18 streams/dshr_strdata_mod.F90
+8 −8 streams/dshr_stream_mod.F90
11 changes: 10 additions & 1 deletion CDEPS-interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ target_include_directories(dwav PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY
target_link_libraries(dwav PRIVATE dshr share streams)
target_link_libraries(dwav PRIVATE esmf)

# CDEPS/dglc
add_library(dglc OBJECT ${cdeps_dglc_files})
add_dependencies(dglc share streams dshr)
set_target_properties(dglc PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mod)
target_include_directories(dglc PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>)
target_link_libraries(dglc PRIVATE dshr share streams)
target_link_libraries(dglc PRIVATE esmf PIO::PIO_Fortran)

# CDEPS
add_library(cdeps STATIC $<TARGET_OBJECTS:share>
$<TARGET_OBJECTS:streams>
Expand All @@ -104,7 +112,8 @@ add_library(cdeps STATIC $<TARGET_OBJECTS:share>
$<TARGET_OBJECTS:dlnd>
$<TARGET_OBJECTS:docn>
$<TARGET_OBJECTS:drof>
$<TARGET_OBJECTS:dwav>)
$<TARGET_OBJECTS:dwav>
$<TARGET_OBJECTS:dglc>)
add_library(cdeps::cdeps ALIAS cdeps)
target_include_directories(cdeps PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/mod>
$<INSTALL_INTERFACE:mod>)
Expand Down
9 changes: 9 additions & 0 deletions CDEPS-interface/cdeps_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ list(APPEND ufs_cdeps_share_files
ufs/cdeps_share/shr_assert_mod.F90
ufs/cdeps_share/shr_frz_mod.F90
ufs/cdeps_share/shr_infnan_mod.F90
ufs/cdeps_share/shr_is_restart_fh_mod.F90
)

list(APPEND cdeps_share_files
Expand All @@ -24,6 +25,7 @@ list(APPEND cdeps_share_files
CDEPS/share/shr_timer_mod.F90
CDEPS/share/shr_file_mod.F90
CDEPS/share/shr_nl_mod.F90
CDEPS/share/nuopc_shr_methods.F90
)

list(APPEND cdeps_streams_files
Expand Down Expand Up @@ -67,6 +69,8 @@ list(APPEND cdeps_docn_files
CDEPS/docn/docn_datamode_iaf_mod.F90
CDEPS/docn/docn_datamode_som_mod.F90
CDEPS/docn/docn_datamode_cplhist_mod.F90
CDEPS/docn/docn_datamode_multilev_mod.F90
CDEPS/docn/docn_datamode_multilev_dom_mod.F90
CDEPS/docn/docn_import_data_mod.F90
CDEPS/docn/ocn_comp_nuopc.F90
)
Expand All @@ -78,3 +82,8 @@ list(APPEND cdeps_drof_files
list(APPEND cdeps_dwav_files
CDEPS/dwav/wav_comp_nuopc.F90
)

list(APPEND cdeps_dglc_files
CDEPS/dglc/dglc_datamode_noevolve_mod.F90
CDEPS/dglc/glc_comp_nuopc.F90
)
137 changes: 137 additions & 0 deletions CDEPS-interface/ufs/cdeps_share/shr_is_restart_fh_mod.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
module shr_is_restart_fh_mod

! Common methods for components to check if it's time to write forecast hour-based restarts

!use dshr_methods_mod , only : chkerr
use ESMF, only : ESMF_ConfigCreate, ESMF_ConfigDestroy, ESMF_ConfigLoadFile, &
ESMF_ConfigGetLen, ESMF_ConfigGetAttribute, ESMF_TimePrint, &
ESMF_LOGMSG_INFO, ESMF_LogWrite, ESMF_TimeInterval, &
ESMF_Time, ESMF_KIND_R8, ESMF_Config, ESMF_Clock, &
ESMF_TimeIntervalSet, ESMF_TimePrint, operator(+), operator(==), &
ESMF_LogFoundError, ESMF_LOGERR_PASSTHRU

implicit none
private

type :: is_restart_fh_type
logical :: write_restartfh = .false.
type(ESMF_Time), allocatable :: restartFhTimes(:)
end type is_restart_fh_type

public :: init_is_restart_fh, is_restart_fh, finalize_restart_fh, is_restart_fh_type

contains

!-----------------------------------------------------------------------
subroutine init_is_restart_fh(currentTime, dtime, lLog, restartfh_info)
!
! !DESCRIPTION:
! Process restart_fh attribute from model_configure in UFS
!
! !USES:
!
! !ARGUMENTS:
type(ESMF_Time), intent(in) :: currentTime
integer, intent(in) :: dtime ! time step (s)
logical, intent(in) :: lLog ! If true, this task logs restart_fh info
type(is_restart_fh_type), intent(out) :: restartfh_info !restart_fh info for each task
!
! !LOCAL VARIABLES:
character(len=256) :: timestr
integer :: n, nfh, fh_s, rc
logical :: isPresent
real(kind=ESMF_KIND_R8), allocatable :: restart_fh(:)
type(ESMF_TimeInterval) :: fhInterval
type(ESMF_Config) :: CF_mc
!-----------------------------------------------------------------------

! set up Times to write non-interval restarts
inquire(FILE='model_configure', EXIST=isPresent)
if (isPresent) then !model_configure exists. this is ufs run
CF_mc = ESMF_ConfigCreate(rc=rc)
call ESMF_ConfigLoadFile(config=CF_mc,filename='model_configure' ,rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return

nfh = ESMF_ConfigGetLen(config=CF_mc, label ='restart_fh:',rc=rc)
if (nfh .gt. 0) then
allocate(restart_fh(1:nfh))
allocate(restartfh_info%restartFhTimes(1:nfh)) !not deallocated here

call ESMF_ConfigGetAttribute(CF_mc,valueList=restart_fh,label='restart_fh:', rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
! create a list of times at each restart_fh
do n = 1,nfh
fh_s = NINT(3600*restart_fh(n))
call ESMF_TimeIntervalSet(fhInterval, s=fh_s, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
restartfh_info%restartFhTimes(n) = currentTime + fhInterval
call ESMF_TimePrint(restartfh_info%restartFhTimes(n), options="string", &
preString="restart_fh at ", unit=timestr, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
if (lLog) then
if (mod(fh_s,dtime) /= 0) then
call ESMF_LogWrite('restart time NOT to be written for '//trim(timestr), ESMF_LOGMSG_INFO)
else
call ESMF_LogWrite('restart time to be written for '//trim(timestr), ESMF_LOGMSG_INFO)
end if
end if
end do
deallocate(restart_fh)
end if !nfh>0
call ESMF_ConfigDestroy(CF_mc, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
end if !model_configure

end subroutine init_is_restart_fh

subroutine is_restart_fh(clock, restartfh_info, lWrite)
!
! !DESCRIPTION:
! True/false if time to write restart
!
! !USES:
use ESMF, only : ESMF_ClockGetNextTime

!
! !ARGUMENTS:
type(ESMF_Clock), intent(in) :: clock
type(is_restart_fh_type), intent(inout) :: restartfh_info
logical, intent(out) :: lWrite ! time to write?
!
! !LOCAL VARIABLES:
integer :: nfh, rc
type(ESMF_Time) :: nextTime
!-----------------------------------------------------------------------

restartfh_info%write_restartfh = .false.
if (allocated(restartfh_info%restartFhTimes)) then
! check if next time is == to any restartfhtime
do nfh = 1,size(restartfh_info%restartFhTimes)
call ESMF_ClockGetNextTime(clock, nextTime=nexttime, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
if (nextTime == restartfh_info%restartFhTimes(nfh)) restartfh_info%write_restartfh = .true.
end do
end if

lWrite = restartfh_info%write_restartfh

end subroutine is_restart_fh

subroutine finalize_restart_fh(restartfh_info)
!
! !DESCRIPTION:
! Clean-up...release allocated memory
!
! !USES:
!
! !ARGUMENTS:
type(is_restart_fh_type), intent(inout) :: restartfh_info
!
! !LOCAL VARIABLES:
!-----------------------------------------------------------------------

if (allocated(restartfh_info%restartFhTimes)) deallocate(restartfh_info%restartFhTimes)

end subroutine finalize_restart_fh

end module shr_is_restart_fh_mod
2 changes: 1 addition & 1 deletion CICE-interface/CICE
2 changes: 1 addition & 1 deletion CICE-interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ list(APPEND lib_src_files
${icepack_files}
${cice_mpi_comm_files}
${cice_nuopc_cmeps_driver_files}
${cice_cdeps_inline_files})
${cice_cdeps_share_files})

list(APPEND _cice_defs FORTRANUNDERSCORE
coupled)
Expand Down
7 changes: 5 additions & 2 deletions CICE-interface/cice_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ list(APPEND cice_nuopc_cmeps_driver_files
CICE/cicecore/drivers/nuopc/cmeps/ice_mesh_mod.F90
)

#-- Using ice prescribed ifndef cesmcoupled
list(APPEND cice_cdeps_inline_files
list(APPEND cice_cdeps_share_files
#-- Using ice prescribed ifndef cesmcoupled
${PROJECT_SOURCE_DIR}/CDEPS-interface/CDEPS/share/shr_orb_mod.F90
${PROJECT_SOURCE_DIR}/CDEPS-interface/CDEPS/share/shr_const_mod.F90
${PROJECT_SOURCE_DIR}/CDEPS-interface/CDEPS/share/shr_abort_mod.F90
Expand All @@ -168,4 +168,7 @@ list(APPEND cice_cdeps_inline_files
${PROJECT_SOURCE_DIR}/CDEPS-interface/CDEPS/streams/dshr_stream_mod.F90
${PROJECT_SOURCE_DIR}/CDEPS-interface/CDEPS/streams/dshr_methods_mod.F90
${PROJECT_SOURCE_DIR}/CDEPS-interface/CDEPS/dshr/dshr_mod.F90

#restart_fh
${PROJECT_SOURCE_DIR}/CDEPS-interface/ufs/cdeps_share/shr_is_restart_fh_mod.F90
)
5 changes: 3 additions & 2 deletions CMEPS-interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ list(APPEND _ufs_util_files
${PROJECT_SOURCE_DIR}/CDEPS-interface/CDEPS/share/shr_sys_mod.F90
${PROJECT_SOURCE_DIR}/CDEPS-interface/CDEPS/share/shr_kind_mod.F90
${PROJECT_SOURCE_DIR}/CDEPS-interface/ufs/cdeps_share/shr_assert_mod.F90
${PROJECT_SOURCE_DIR}/CDEPS-interface/ufs/cdeps_share/shr_infnan_mod.F90)
${PROJECT_SOURCE_DIR}/CDEPS-interface/ufs/cdeps_share/shr_infnan_mod.F90
${PROJECT_SOURCE_DIR}/CDEPS-interface/CDEPS/share/nuopc_shr_methods.F90
${PROJECT_SOURCE_DIR}/CDEPS-interface/ufs/cdeps_share/shr_is_restart_fh_mod.F90)

list(APPEND _mediator_files
CMEPS/mediator/med_phases_restart_mod.F90
Expand All @@ -65,7 +67,6 @@ list(APPEND _mediator_files
CMEPS/mediator/med_phases_prep_ocn_mod.F90
CMEPS/mediator/esmFlds.F90
CMEPS/mediator/med.F90
CMEPS/mediator/med_time_mod.F90
CMEPS/mediator/med_phases_ocnalb_mod.F90
CMEPS/mediator/med_phases_prep_wav_mod.F90
CMEPS/mediator/med_utils_mod.F90
Expand Down
2 changes: 1 addition & 1 deletion MOM6-interface/MOM6
4 changes: 4 additions & 0 deletions MOM6-interface/mom6_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ list(APPEND mom6_nuopc_src_files
MOM6/config_src/drivers/timing_tests/time_MOM_EOS.F90
)

list(APPEND mom6_nuopc_src_files
${PROJECT_SOURCE_DIR}/CDEPS-interface/ufs/cdeps_share/shr_is_restart_fh_mod.F90
)

list(APPEND mom6_solo_src_files
MOM6/config_src/drivers/solo_driver/MESO_surface_forcing.F90
MOM6/config_src/drivers/solo_driver/MOM_driver.F90
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions cmake/configure_gaeac6.intel.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(PARALLEL_NETCDF ON CACHE BOOL "Enable parallel NetCDF" FORCE)
set(MOM6_Extra_FORTRAN_FLAGS "-xsse2")
set(HYCOM_Extra_FORTRAN_FLAGS "-xSSE4.2")
set(HYCOM_Extra_C_FLAGS "-xSSE4.2")
2 changes: 2 additions & 0 deletions cmake/configure_gaeac6.intelllvm.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set(PARALLEL_NETCDF ON CACHE BOOL "Enable parallel NetCDF" FORCE)
set(AVX2 OFF CACHE BOOL "Enable AVX2 instruction set" FORCE)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ help([[
on the NOAA RDHPC machine Gaea C5 using Intel-2023.1.0.
]])

whatis([===[Loads libraries needed for building the UFS Weather Model on Gaea ]===])
whatis([===[Loads libraries needed for building the UFS Weather Model on Gaea C5 ]===])

prepend_path("MODULEPATH", "/ncrc/proj/epic/spack-stack/spack-stack-1.6.0/envs/fms-2024.01/install/modulefiles/Core")

Expand All @@ -30,4 +30,4 @@ unload("cray-libsci")
setenv("CC","cc")
setenv("CXX","CC")
setenv("FC","ftn")
setenv("CMAKE_Platform","gaea.intel")
setenv("CMAKE_Platform","gaeac5.intel")
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ help([[
on the NOAA RDHPC machine Gaea C5 using Intel-2023.1.0.
]])

whatis([===[Loads libraries needed for building the UFS Weather Model on Gaea ]===])
whatis([===[Loads libraries needed for building the UFS Weather Model on Gaea C5]===])

prepend_path("MODULEPATH", "/ncrc/proj/epic/spack-stack/spack-stack-1.6.0/envs/fms-2024.01/install/modulefiles/Core")

Expand Down Expand Up @@ -36,4 +36,4 @@ setenv("I_MPI_F90", "ifx")
setenv("CC","cc")
setenv("CXX","CC")
setenv("FC","ftn")
setenv("CMAKE_Platform","gaea.intelllvm")
setenv("CMAKE_Platform","gaeac5.intelllvm")
33 changes: 33 additions & 0 deletions modulefiles/ufs_gaeac6.intel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
help([[
This module loads libraries required for building and running UFS Weather Model
on the NOAA RDHPC machine Gaea C6 using Intel-2023.2.0.
]])

whatis([===[Loads libraries needed for building the UFS Weather Model on Gaea C6]===])

prepend_path("MODULEPATH", "/ncrc/proj/epic/spack-stack/c6/spack-stack-1.6.0/envs/fms-2024.01/install/modulefiles/Core")

stack_intel_ver=os.getenv("stack_intel_ver") or "2023.2.0"
load(pathJoin("stack-intel", stack_intel_ver))

stack_cray_mpich_ver=os.getenv("stack_cray_mpich_ver") or "8.1.29"
load(pathJoin("stack-cray-mpich", stack_cray_mpich_ver))

stack_python_ver=os.getenv("stack_python_ver") or "3.10.13"
load(pathJoin("stack-python", stack_python_ver))

cmake_ver=os.getenv("cmake_ver") or "3.23.1"
load(pathJoin("cmake", cmake_ver))

load("ufs_common")

nccmp_ver=os.getenv("nccmp_ver") or "1.9.0.1"
load(pathJoin("nccmp", nccmp_ver))

unload("darshan-runtime")
unload("cray-libsci")

setenv("CC","cc")
setenv("CXX","CC")
setenv("FC","ftn")
setenv("CMAKE_Platform","gaeac6.intel")
40 changes: 40 additions & 0 deletions modulefiles/ufs_gaeac6.intelllvm.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
help([[
This module loads libraries required for building and running UFS Weather Model
on the NOAA RDHPC machine Gaea C6 using Intel-2023.2.0.
]])

whatis([===[Loads libraries needed for building the UFS Weather Model on Gaea C6]===])

prepend_path("MODULEPATH", "/ncrc/proj/epic/spack-stack/c6/spack-stack-1.6.0/envs/fms-2024.01/install/modulefiles/Core")

stack_intel_ver=os.getenv("stack_intel_ver") or "2023.2.0"
load(pathJoin("stack-intel", stack_intel_ver))

stack_cray_mpich_ver=os.getenv("stack_cray_mpich_ver") or "8.1.29"
load(pathJoin("stack-cray-mpich", stack_cray_mpich_ver))

stack_python_ver=os.getenv("stack_python_ver") or "3.10.13"
load(pathJoin("stack-python", stack_python_ver))

cmake_ver=os.getenv("cmake_ver") or "3.23.1"
load(pathJoin("cmake", cmake_ver))

load("ufs_common")

nccmp_ver=os.getenv("nccmp_ver") or "1.9.0.1"
load(pathJoin("nccmp", nccmp_ver))

unload("darshan-runtime")
unload("cray-libsci")

unload("intel-classic/2023.2.0")
load("intel-oneapi/2023.2.0")

setenv("I_MPI_CC", "icx")
setenv("I_MPI_CXX", "icpx")
setenv("I_MPI_F90", "ifx")

setenv("CC","cc")
setenv("CXX","CC")
setenv("FC","ftn")
setenv("CMAKE_Platform","gaeac6.intelllvm")
2 changes: 1 addition & 1 deletion tests/bl_date.conf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export BL_DATE=20241127
export BL_DATE=20241212
Loading

0 comments on commit 81341db

Please sign in to comment.