From 27ef3e2d9538a921965dca010b064eccae6b121b Mon Sep 17 00:00:00 2001 From: "G. Dylan Dickerson" Date: Sat, 7 Sep 2024 15:07:52 -0600 Subject: [PATCH 1/5] Updates for v8.2.1 MPAS-A dycore Bring in the 'v8.2.1' tag from MPAS-Dev/MPAS-Model. Add updates to the build system and changes to the cam_mpas_subdriver for streamInfo. --- .gitmodules | 2 +- src/dynamics/mpas/Makefile | 9 +++++++-- src/dynamics/mpas/driver/cam_mpas_subdriver.F90 | 14 ++++++++++++-- src/dynamics/mpas/dycore | 2 +- 4 files changed, 21 insertions(+), 6 deletions(-) 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/src/dynamics/mpas/Makefile b/src/dynamics/mpas/Makefile index 216be0ff1a..74d11132d6 100644 --- a/src/dynamics/mpas/Makefile +++ b/src/dynamics/mpas/Makefile @@ -1,4 +1,5 @@ -CPPFLAGS := -D_MPI -DMPAS_NATIVE_TIMERS -DMPAS_GIT_VERSION=unknown -DMPAS_NAMELIST_SUFFIX=atmosphere -DMPAS_CAM_DYCORE -DMPAS_PIO_SUPPORT -DMPAS_NO_ESMF_INIT +CPPFLAGS := -D_MPI -DMPAS_NATIVE_TIMERS -DMPAS_CAM_DYCORE -DMPAS_PIO_SUPPORT -DMPAS_NO_ESMF_INIT -DMPAS_GIT_VERSION="unknown" -DMPAS_BUILD_TARGET="N/A" -DMPAS_NAMELIST_SUFFIX="atmosphere" + ifdef PIODEF CPPFLAGS += $(PIODEF) endif @@ -80,6 +81,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 +182,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 +231,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..d96aa45915 100644 --- a/src/dynamics/mpas/driver/cam_mpas_subdriver.F90 +++ b/src/dynamics/mpas/driver/cam_mpas_subdriver.F90 @@ -108,7 +108,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 +152,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 +182,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 +2362,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 From 990809546bf6e2394ddfcb7bde94eb2a116b0d92 Mon Sep 17 00:00:00 2001 From: "G. Dylan Dickerson" Date: Sat, 7 Sep 2024 16:24:53 -0600 Subject: [PATCH 2/5] MPAS-A git version in run logs Before this change the line "Output from 'git describe --dirty': unknown" would appear in the atm.log.* files. Now 'unknown' is replaced by the actual output of 'git describe --dirty' to better track version and any local modifications. --- src/dynamics/mpas/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dynamics/mpas/Makefile b/src/dynamics/mpas/Makefile index 74d11132d6..37ddbe8093 100644 --- a/src/dynamics/mpas/Makefile +++ b/src/dynamics/mpas/Makefile @@ -1,5 +1,5 @@ -CPPFLAGS := -D_MPI -DMPAS_NATIVE_TIMERS -DMPAS_CAM_DYCORE -DMPAS_PIO_SUPPORT -DMPAS_NO_ESMF_INIT -DMPAS_GIT_VERSION="unknown" -DMPAS_BUILD_TARGET="N/A" -DMPAS_NAMELIST_SUFFIX="atmosphere" - +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 From b4793c01afe0fba9fee861bf5484ab41da43a216 Mon Sep 17 00:00:00 2001 From: "G. Dylan Dickerson" Date: Mon, 9 Sep 2024 17:59:11 -0600 Subject: [PATCH 3/5] Prepare CAM-MPAS driver for mpi_f08 Initial changes to build MPAS with the Fortran 2008 MPI interfaces. These changes can be enabled by uncommenting the line adding MPAS_USE_MPI_F08 to CPPFLAGS. --- src/dynamics/mpas/Makefile | 2 ++ src/dynamics/mpas/driver/cam_mpas_subdriver.F90 | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/dynamics/mpas/Makefile b/src/dynamics/mpas/Makefile index 37ddbe8093..f79b718aa0 100644 --- a/src/dynamics/mpas/Makefile +++ b/src/dynamics/mpas/Makefile @@ -6,6 +6,8 @@ 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 diff --git a/src/dynamics/mpas/driver/cam_mpas_subdriver.F90 b/src/dynamics/mpas/driver/cam_mpas_subdriver.F90 index d96aa45915..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 From f8b0415385c2e9fb27cee928ac89c02174386de9 Mon Sep 17 00:00:00 2001 From: "G. Dylan Dickerson" Date: Mon, 9 Sep 2024 18:27:56 -0600 Subject: [PATCH 4/5] Initial ChangeLog for mpas v8.2.1 --- doc/ChangeLog | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 635389ba6d..3c2b3584e8 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,84 @@ =============================================================== +Tag name: +Originator(s): gdicker +Date: Sep 09, 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: + +derecho/nvhpc/aux_cam: + +izumi/nag/aux_cam: + +izumi/gnu/aux_cam: + +CAM tag used for the baseline comparison tests if different than previous +tag: + +Summarize any changes to answers, i.e., +- what code configurations: +- what platforms/compilers: +- nature of change (roundoff; larger than roundoff but same climate; new + climate): + +If bitwise differences were observed, how did you show they were no worse +than roundoff? + +If this tag changes climate describe the run(s) done to evaluate the new +climate in enough detail that it(they) could be reproduced, i.e., +- source tag (all code used must be in the repository): +- platform/compilers: +- configure commandline: +- build-namelist command (or complete namelist): +- MSS location of output: + +MSS location of control simulations used to validate new climate: + +URL for AMWG diagnostics output used to validate new climate: + +=============================================================== +=============================================================== + Tag name: cam6_4_030 Originator(s): eaton, cacraig Date: Sept 6, 2024 From e2da4bf2522749674d7be70e5d1b38ad7146d0d5 Mon Sep 17 00:00:00 2001 From: "G. Dylan Dickerson" Date: Tue, 24 Sep 2024 08:45:26 -0600 Subject: [PATCH 5/5] Update ChangeLog with Derecho and Izumi tests --- doc/ChangeLog | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 62e085fc81..294d616fc7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,8 +1,8 @@ =============================================================== -Tag name: +Tag name: cam6_4_036 Originator(s): gdicker -Date: Sep 23, 2024 +Date: Sep 24, 2024 One-line Summary: Update MPAS-A to v8.2.1 Github PR URL: https://github.com/ESCOMP/CAM/pull/1145 @@ -45,35 +45,23 @@ appropriate machine below. All failed tests must be justified. derecho/intel/aux_cam: -derecho/nvhpc/aux_cam: - -izumi/nag/aux_cam: - -izumi/gnu/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 -CAM tag used for the baseline comparison tests if different than previous -tag: + PEND SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s + - pre-existing failures -- need fix in CLM external -Summarize any changes to answers, i.e., -- what code configurations: -- what platforms/compilers: -- nature of change (roundoff; larger than roundoff but same climate; new - climate): +derecho/nvhpc/aux_cam: ALL PASS -If bitwise differences were observed, how did you show they were no worse -than roundoff? +izumi/nag/aux_cam: -If this tag changes climate describe the run(s) done to evaluate the new -climate in enough detail that it(they) could be reproduced, i.e., -- source tag (all code used must be in the repository): -- platform/compilers: -- configure commandline: -- build-namelist command (or complete namelist): -- MSS location of output: + FAIL DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae + - pre-existing failure - issue #670 -MSS location of control simulations used to validate new climate: +izumi/gnu/aux_cam: ALL PASS -URL for AMWG diagnostics output used to validate new climate: +Summarize any changes to answers: bit-for-bit =============================================================== ===============================================================