diff --git a/.gitmodules b/.gitmodules index b74aac6f02..69c521f4f7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -80,7 +80,7 @@ url = https://github.com/MPAS-Dev/MPAS-Model.git fxrequired = AlwaysRequired fxsparse = ../.mpas_sparse_checkout - fxtag = b8c33daa + fxtag = v8.2.1 fxDONOTUSEurl = https://github.com/MPAS-Dev/MPAS-Model.git [submodule "cosp2"] diff --git a/doc/ChangeLog b/doc/ChangeLog index 06acd1fa7f..294d616fc7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,71 @@ =============================================================== +Tag name: cam6_4_036 +Originator(s): gdicker +Date: Sep 24, 2024 +One-line Summary: Update MPAS-A to v8.2.1 +Github PR URL: https://github.com/ESCOMP/CAM/pull/1145 + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): +- Update MPAS-A within CAM to 'v8.2.1' https://github.com/ESCOMP/CAM/issue/1144 + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: + +List all files eliminated: + +List all files added and what they do: + +List all existing files that have been modified, and describe the changes: +M .gitmodules + - Update the mpas fxTag to v8.2.1 + +M src/dynamics/mpas/Makefile + - Add rules to build stream_inquiry and mpas_stream_inquiry + - Pass CPPFLAGS to the registry command + - Edit CPPFLAGS: add MPAS_BUILD_TARGET and add the GIT_VERSION using a shell command + - Also a commented out addition to enable mpi_f08 support in MPAS + +M src/dynamics/mpas/driver/cam_mpas_subdriver.F90 + - Add streamInfo to the MPAS domain_ptr + - Modify function calls for updated variables + - Optional mpi_f08 change + +If there were any failures reported from running test_driver.sh on any test +platform, and checkin with these failures has been OK'd by the gatekeeper, +then copy the lines from the td.*.status files for the failed tests to the +appropriate machine below. All failed tests must be justified. + +derecho/intel/aux_cam: + + FAIL ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s COMPARE_base_rest + FAIL SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d ... DIFF + - pre-existing failure due to HEMCO not having reproducible results issues #1018 and #856 + + PEND SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s + - pre-existing failures -- need fix in CLM external + +derecho/nvhpc/aux_cam: ALL PASS + +izumi/nag/aux_cam: + + FAIL DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae + - pre-existing failure - issue #670 + +izumi/gnu/aux_cam: ALL PASS + +Summarize any changes to answers: bit-for-bit + +=============================================================== +=============================================================== + Tag name: cam6_4_035 Originator(s): fvitt Date: 23 Sep 2024 diff --git a/src/dynamics/mpas/Makefile b/src/dynamics/mpas/Makefile index 216be0ff1a..f79b718aa0 100644 --- a/src/dynamics/mpas/Makefile +++ b/src/dynamics/mpas/Makefile @@ -1,10 +1,13 @@ -CPPFLAGS := -D_MPI -DMPAS_NATIVE_TIMERS -DMPAS_GIT_VERSION=unknown -DMPAS_NAMELIST_SUFFIX=atmosphere -DMPAS_CAM_DYCORE -DMPAS_PIO_SUPPORT -DMPAS_NO_ESMF_INIT +GIT_VERSION=$(shell git -C "$(MPAS_SRC_ROOT)/dycore" describe --always --dirty --tags || echo "N/A" ) +CPPFLAGS := -D_MPI -DMPAS_NATIVE_TIMERS -DMPAS_CAM_DYCORE -DMPAS_PIO_SUPPORT -DMPAS_NO_ESMF_INIT -DMPAS_GIT_VERSION="$(GIT_VERSION)" -DMPAS_BUILD_TARGET="N/A" -DMPAS_NAMELIST_SUFFIX="atmosphere" ifdef PIODEF CPPFLAGS += $(PIODEF) endif ifeq ($(strip $(COMP_INTERFACE)),nuopc) CPPFLAGS += -DMPAS_EXTERNAL_ESMF_LIB endif +# Uncomment next line to enable MPAS to use mpi_f08 module +#CPPFLAGS += -DMPAS_USE_MPI_F08 REGISTRY_FILE := $(MPAS_SRC_ROOT)/dycore/src/core_atmosphere/Registry.xml @@ -80,6 +83,8 @@ FRAME_OBJS = \ mpas_io_streams.o \ mpas_bootstrapping.o \ mpas_io_units.o \ + mpas_stream_inquiry.o \ + stream_inquiry.o \ mpas_stream_manager.o \ mpas_stream_list.o \ mpas_forcing.o \ @@ -179,6 +184,8 @@ mpas_io_units.o: mpas_kind_types.o mpas_threading.o: mpas_kind_types.o +mpas_stream_inquiry.o: mpas_derived_types.o mpas_log.o mpas_c_interfacing.o stream_inquiry.o + mpas_stream_list.o: mpas_derived_types.o mpas_kind_types.o mpas_io_streams.o mpas_timekeeping.o regex_matching.o mpas_log.o mpas_stream_manager.o: mpas_io_streams.o mpas_timekeeping.o mpas_derived_types.o mpas_kind_types.o mpas_c_interfacing.o mpas_stream_list.o mpas_dmpar.o mpas_io.o mpas_threading.o mpas_log.o @@ -226,7 +233,7 @@ streams_gen: $(STREAMS_GEN_OBJS) ezxml.o # incs: $(REGISTRY_FILE) ( cpp -P -traditional $(CPPFLAGS) -I$(MPAS_SRC_ROOT)/dycore/src/core_atmosphere/diagnostics $(REGISTRY_FILE) > Registry_processed.xml ) - ( ./registry Registry_processed.xml ) + ( ./registry Registry_processed.xml $(CPPFLAGS) ) # # Dycore diff --git a/src/dynamics/mpas/driver/cam_mpas_subdriver.F90 b/src/dynamics/mpas/driver/cam_mpas_subdriver.F90 index 676bacd4af..59d9c462ee 100644 --- a/src/dynamics/mpas/driver/cam_mpas_subdriver.F90 +++ b/src/dynamics/mpas/driver/cam_mpas_subdriver.F90 @@ -73,13 +73,20 @@ end subroutine halt_model !----------------------------------------------------------------------- subroutine cam_mpas_init_phase1(mpicom, endrun, logUnits, realkind) +#ifdef MPAS_USE_MPI_F08 + use mpi_f08, only : mpi_comm_type => mpi_comm +#endif use mpas_domain_routines, only : mpas_allocate_domain use mpas_framework, only : mpas_framework_init_phase1 use atm_core_interface, only : atm_setup_core, atm_setup_domain use mpas_kind_types, only : RKIND ! Dummy argument +#ifdef MPAS_USE_MPI_F08 + type(mpi_comm_type), intent(in) :: mpicom +#else integer, intent(in) :: mpicom +#endif procedure(halt_model) :: endrun integer, dimension(2), intent(in) :: logUnits integer, intent(in) :: realkind @@ -108,7 +115,7 @@ subroutine cam_mpas_init_phase1(mpicom, endrun, logUnits, realkind) ! ! Initialize MPAS infrastructure (principally, the mpas_dmpar module) ! - call mpas_framework_init_phase1(domain_ptr % dminfo, mpi_comm=mpicom) + call mpas_framework_init_phase1(domain_ptr % dminfo, external_comm=mpicom) call atm_setup_core(corelist) call atm_setup_domain(domain_ptr) @@ -152,6 +159,7 @@ subroutine cam_mpas_init_phase2(pio_subsystem, endrun, cam_calendar) use mpas_framework, only : mpas_framework_init_phase2 use mpas_timer, only : mpas_timer_start + use mpas_stream_inquiry, only : mpas_stream_inquiry_new_streaminfo type (iosystem_desc_t), pointer :: pio_subsystem procedure(halt_model) :: endrun @@ -181,12 +189,20 @@ subroutine cam_mpas_init_phase2(pio_subsystem, endrun, cam_calendar) call mpas_timer_start('total time') + ! Since MPAS is being used as a dycore and is not responsible for IO, it's enough to create this + ! object without running its init(). Any queries made to it will always return `.false.` + domain_ptr % streamInfo => mpas_stream_inquiry_new_streaminfo() + if (.not. associated(domain_ptr % streamInfo)) then + call endrun(subname//': FATAL: streamInfo instantiation failed for core '//trim(domain_ptr % core % coreName)) + end if + ierr = domain_ptr % core % define_packages(domain_ptr % packages) if ( ierr /= 0 ) then call endrun(subname//': FATAL: Package definition failed for core '//trim(domain_ptr % core % coreName)) end if - ierr = domain_ptr % core % setup_packages(domain_ptr % configs, domain_ptr % packages, domain_ptr % iocontext) + ierr = domain_ptr % core % setup_packages(domain_ptr % configs, domain_ptr % streamInfo, & + domain_ptr % packages, domain_ptr % iocontext) if ( ierr /= 0 ) then call endrun(subname//': FATAL: Package setup failed for core '//trim(domain_ptr % core % coreName)) end if @@ -2353,6 +2369,7 @@ subroutine cam_mpas_finalize() ! ! Finalize infrastructure ! + deallocate(domain_ptr % streamInfo) ! created by mpas_stream_inquiry_new_streaminfo ! Print out log stats and close log file ! (Do this after timer stats are printed and stream mgr finalized, diff --git a/src/dynamics/mpas/dycore b/src/dynamics/mpas/dycore index b8c33daa4b..b566fc8a95 160000 --- a/src/dynamics/mpas/dycore +++ b/src/dynamics/mpas/dycore @@ -1 +1 @@ -Subproject commit b8c33daa4b124f116b0ba1b1386968c4c15b42e4 +Subproject commit b566fc8a959390d838aba08fd03c81edae986f6a