From 1c4efb2fb0c0d66d01657b1105ee567879e0172a Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Wed, 7 Oct 2020 12:45:40 -0500 Subject: [PATCH 1/5] update PIO and genf90 to support CDEPS --- nems/lib/ParallelIO | 2 +- nems/lib/genf90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nems/lib/ParallelIO b/nems/lib/ParallelIO index 86ad4463a..6f9fb5e1b 160000 --- a/nems/lib/ParallelIO +++ b/nems/lib/ParallelIO @@ -1 +1 @@ -Subproject commit 86ad4463ab46e706aca632c2c4c2ffd48854113b +Subproject commit 6f9fb5e1b9b8adb3fb6e531f6296b2abf9d58a7f diff --git a/nems/lib/genf90 b/nems/lib/genf90 index acb24bb13..4816965ba 160000 --- a/nems/lib/genf90 +++ b/nems/lib/genf90 @@ -1 +1 @@ -Subproject commit acb24bb13b54db505163f683ed5a0e6271bf5e79 +Subproject commit 4816965ba946731352bad195b7d946a5fe682ff5 From df5aa6c75d35d7ed366bf0f853eeb10ee32c254b Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Wed, 7 Oct 2020 14:55:01 -0500 Subject: [PATCH 2/5] make internal PIO initialization optional for different UFS apps --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1ddc4f357..e778090f3 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,11 @@ ifndef CXX $(error CXX not defined) endif +ifndef INTERNAL_PIO_INIT +INTERNAL_PIO_INIT := 1 +endif +$(info INTERNAL_PIO_INIT is set to $(INTERNAL_PIO_INIT)) + MEDIATOR_DIR := $(BASE_DIR)/mediator LIBRARY_MEDIATOR := $(MEDIATOR_DIR)/libcmeps.a LIBRARY_UTIL := $(BASE_DIR)/nems/util/libcmeps_util.a @@ -53,7 +58,7 @@ endif $(LIBRARY_MEDIATOR): $(LIBRARY_UTIL) .FORCE cd mediator ;\ - exec $(MAKE) PIO_INCLUDE_DIR=$(PIO_INCLUDE_DIR) INTERNAL_PIO_INIT=1 + exec $(MAKE) PIO_INCLUDE_DIR=$(PIO_INCLUDE_DIR) INTERNAL_PIO_INIT=$(INTERNAL_PIO_INIT) $(LIBRARY_UTIL): $(PIO_INSTALL_LIBS) .FORCE cd nems/util ;\ From a6e073410be819cebd29ff4d5d2ddd6c47f137f5 Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Wed, 7 Oct 2020 16:49:07 -0500 Subject: [PATCH 3/5] add ESMF_VERSION_MAJOR and ESMF_VERSION_MINOR to Makefile --- mediator/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/mediator/Makefile b/mediator/Makefile index fae000dae..62d40a8ac 100644 --- a/mediator/Makefile +++ b/mediator/Makefile @@ -3,6 +3,7 @@ $(error Environment variable ESMFMKFILE was not set.) endif include $(ESMFMKFILE) +CPPDEFS += -DESMF_VERSION_MAJOR=$(ESMF_VERSION_MAJOR) -DESMF_VERSION_MINOR=$(ESMF_VERSION_MINOR) ifndef PIO_INCLUDE_DIR $(error PIO_INCLUDE_DIR not set) From c6ca6cd8b4e17428faa201234adbce9319a9a336 Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Mon, 12 Oct 2020 11:18:14 -0500 Subject: [PATCH 4/5] fix GTPL issue and optional internal PIO initialization --- mediator/Makefile | 4 ++-- mediator/med_utils_mod.F90 | 2 ++ nuopc_cap_share/nuopc_shr_methods.F90 | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mediator/Makefile b/mediator/Makefile index 62d40a8ac..8bc1f70c2 100644 --- a/mediator/Makefile +++ b/mediator/Makefile @@ -9,8 +9,8 @@ ifndef PIO_INCLUDE_DIR $(error PIO_INCLUDE_DIR not set) endif -ifdef INTERNAL_PIO_INIT -CPPDEFS := -DINTERNAL_PIO_INIT +ifeq ($(INTERNAL_PIO_INIT),1) +CPPDEFS += -DINTERNAL_PIO_INIT endif LIBRARY := libcmeps.a diff --git a/mediator/med_utils_mod.F90 b/mediator/med_utils_mod.F90 index 84ad8e3ba..29c2ec775 100644 --- a/mediator/med_utils_mod.F90 +++ b/mediator/med_utils_mod.F90 @@ -23,10 +23,12 @@ subroutine med_memcheck(string, level, mastertask) logical, intent(in) :: mastertask integer :: ierr #ifndef INTERNAL_PIO_INIT +#ifdef CESMCOUPLED integer, external :: GPTLprint_memusage if((mastertask .and. memdebug_level > level) .or. memdebug_level > level+1) then ierr = GPTLprint_memusage(string) endif +#endif #endif end subroutine med_memcheck diff --git a/nuopc_cap_share/nuopc_shr_methods.F90 b/nuopc_cap_share/nuopc_shr_methods.F90 index 44ead6c8f..8d3283a4f 100644 --- a/nuopc_cap_share/nuopc_shr_methods.F90 +++ b/nuopc_cap_share/nuopc_shr_methods.F90 @@ -83,12 +83,16 @@ subroutine memcheck(string, level, mastertask) ! local variables integer :: ierr +#ifdef CESMCOUPLED integer, external :: GPTLprint_memusage +#endif !----------------------------------------------------------------------- +#ifdef CESMCOUPLED if ((mastertask .and. memdebug_level > level) .or. memdebug_level > level+1) then ierr = GPTLprint_memusage(string) endif +#endif end subroutine memcheck From e48849305da1967a4e676aca8948ccbe90566c95 Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Wed, 28 Oct 2020 15:22:39 -0500 Subject: [PATCH 5/5] minor fix in Makefile --- mediator/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediator/Makefile b/mediator/Makefile index 69673234f..8e39eee1e 100644 --- a/mediator/Makefile +++ b/mediator/Makefile @@ -58,5 +58,5 @@ med_phases_prep_wav_mod.o : med_kind_mod.o med_utils_mod.o med_internalstate_mod med_phases_profile_mod.o : med_kind_mod.o med_utils_mod.o med_constants_mod.o med_internalstate_mod.o med_time_mod.o med_phases_restart_mod.o : med_kind_mod.o med_utils_mod.o med_constants_mod.o med_internalstate_mod.o esmFlds.o med_io_mod.o med_time_mod.o : med_kind_mod.o med_utils_mod.o med_constants_mod.o -med_utils_mod.o : med_kind_mod.o med_utils_mod.F90 -med_diag_mod.o : med_kind_mod.o med_time_mod.o med_utils_mod.o med_methods_mod.o med_internalstate_mod.o med_diag_mod.F90 +med_utils_mod.o : med_kind_mod.o med_utils_mod.o +med_diag_mod.o : med_kind_mod.o med_time_mod.o med_utils_mod.o med_methods_mod.o med_internalstate_mod.o med_diag_mod.o