From 5f594493e542f9c478ec5454d8d9443eab006651 Mon Sep 17 00:00:00 2001 From: Johannes Keller Date: Thu, 8 Oct 2026 09:51:23 +0200 Subject: [PATCH 1/4] Makefile fixes --- interface/framework/Makefile | 2 +- interface/model/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/framework/Makefile b/interface/framework/Makefile index 35719909e..efb7bcf09 100644 --- a/interface/framework/Makefile +++ b/interface/framework/Makefile @@ -168,7 +168,7 @@ libpdaf-d.a: %.o : %.c $(PREP_C) $(CC) $(COPT) $(CPP_DEFS) $(CFLAGS) -c $< -o $@ -%.o %.mod: %.F90 +%.o : %.F90 $(PREP_C) $(FC) $(OPT) $(CPP_DEFS) $(FFLAGS) -c $*.F90 .PHONY: clean depend diff --git a/interface/model/Makefile b/interface/model/Makefile index 185b906aa..007d984ab 100644 --- a/interface/model/Makefile +++ b/interface/model/Makefile @@ -72,7 +72,7 @@ $(info $$OBJ is [${OBJ}]) all: libmodel.a libmodel.a: $(OBJ) - ar rcs $@ *.o + ar rcs $@ $(OBJ) ranlib $@ mv $@ $(TSMPPDAFLIBDIR) @echo "library compilation suceeded" From 223934f08e3f4f3636f80da55725cf57a95d2ec8 Mon Sep 17 00:00:00 2001 From: Johannes Keller Date: Thu, 8 Oct 2026 10:45:34 +0200 Subject: [PATCH 2/4] module ordering --- interface/model/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/interface/model/Makefile b/interface/model/Makefile index 007d984ab..3d1c4182c 100644 --- a/interface/model/Makefile +++ b/interface/model/Makefile @@ -68,6 +68,13 @@ endif $(info $$OBJ is [${OBJ}]) +## Module ordering dependencies (parallel build safety) +# Each _mod file must be compiled first so its .mod file exists when +# dependent translation units are compiled with -j. +enkf_clm_5.o print_update_clm_5.o mod_clm_statistics_5.o: enkf_clm_mod_5.o +enkf_clm.o print_update_clm.o mod_clm_statistics.o: enkf_clm_mod.o +enkf_cosmo.o: enkf_cosmo_mod.o + ## target + rules all: libmodel.a From e6ffbba7d7d0f21b173571a1a9efbf1a93d9d98e Mon Sep 17 00:00:00 2001 From: Johannes Keller Date: Thu, 8 Oct 2026 10:58:31 +0200 Subject: [PATCH 3/4] module ordering II --- interface/framework/Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/interface/framework/Makefile b/interface/framework/Makefile index efb7bcf09..260341cbb 100644 --- a/interface/framework/Makefile +++ b/interface/framework/Makefile @@ -130,6 +130,24 @@ OBJ_USER_LOCAL = init_n_domains_pdaf.o \ # Full list of user-supplied routines for online modes OBJ_PDAF_USER = $(OBJ_USER_GEN) $(OBJ_USER_SEIK) $(OBJ_USER_ENKF) $(OBJ_USER_LOCAL) $(OBJ_USER_PDAFOMI) +###################################################### +# Module ordering dependencies (parallel build safety) +# These ensure .mod files exist before dependent translation units +# are compiled with -j. +# Level 1: parser_mpi and mod_read_obs need base modules +parser_mpi.o: mod_parallel_pdaf.o +mod_read_obs.o: mod_tsmp.o mod_parallel_pdaf.o mod_assimilation.o +# Level 2: obs handlers need mod_read_obs +obs_GRACE_pdafomi.o obs_SM_pdafomi.o: mod_read_obs.o +# Level 3: files that USE the obs handlers or parser +init_pdaf.o init_pdaf_parse.o callback_obs_pdafomi.o: \ + obs_GRACE_pdafomi.o obs_SM_pdafomi.o +init_pdaf_parse.o init_parallel_pdaf.o: parser_mpi.o +# All OBJ targets need the three base modules +$(OBJ_MODEL_PDAF) $(OBJ_PDAF_INT) $(OBJ_PDAF_USER): \ + mod_tsmp.o mod_parallel_pdaf.o mod_assimilation.o +# OBJ targets that also USE mod_read_obs +add_obs_error_pdaf.o init_dim_obs_f_pdaf.o init_dim_obs_l_pdaf.o init_dim_obs_pdaf.o init_obscovar_pdaf.o localize_covar_pdaf.o next_observation_pdaf.o obs_op_f_pdaf.o prodrinva_l_pdaf.o prodrinva_pdaf.o: mod_read_obs.o ###################################################### all: $(PROG) From ce115d9d081e0f07b2b0ca1984f197003fa87b89 Mon Sep 17 00:00:00 2001 From: Johannes Keller Date: Mon, 19 Oct 2026 14:15:41 +0200 Subject: [PATCH 4/4] adding explicit dependency on mod_clm_statistics[_5].o MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Trying to avoid error in parallel build: ``` Fatal Error: Cannot open module file ‘mod_clm_statistics.mod’ for reading at (1): No such file or directory ``` --- interface/model/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interface/model/Makefile b/interface/model/Makefile index 3d1c4182c..d07d924b1 100644 --- a/interface/model/Makefile +++ b/interface/model/Makefile @@ -72,7 +72,9 @@ $(info $$OBJ is [${OBJ}]) # Each _mod file must be compiled first so its .mod file exists when # dependent translation units are compiled with -j. enkf_clm_5.o print_update_clm_5.o mod_clm_statistics_5.o: enkf_clm_mod_5.o +enkf_clm_5.o: mod_clm_statistics_5.o enkf_clm.o print_update_clm.o mod_clm_statistics.o: enkf_clm_mod.o +enkf_clm.o: mod_clm_statistics.o enkf_cosmo.o: enkf_cosmo_mod.o ## target + rules