From 6e71a0aacaaee4e655693822c81f1dd988aa376e Mon Sep 17 00:00:00 2001 From: "Ted Mansell (NOAA/NSSL)" <37668594+MicroTed@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:51:39 -0500 Subject: [PATCH] Case insensitive F90 compile rule (#2057) The .F90 source files in physics_mmm need to be compiled directly to .o on case-insensitive file systems (like MacOS standard FS). This PR avoids the creation of a .f90 temporary, which will clobber the .F90 version. TYPE: [bug fix] KEYWORDS: case-insensitive filesystem SOURCE: "Ted Mansell (NOAA/NSSL)" DESCRIPTION OF CHANGES: Problem: 1. On case-insensitive file systems (like MacOS standard FS), the creation of .f90 temporary files from .F90 source will clobber the source files. 2. The configure.defaults has an unrecognized option for Apple clang Solution: 1. In postamble: Removed the .F90.f90 rule and compacted the .F90.o rule to use only the fortran compiler to do any necessary preprocessing. It is convention among fortran compilers that .F90 will be preprocessed. 2. In configure.defaults: For Darwin compile with ifort+clang, removed the -qopenmp from OMPCC (Apple clang does not support OpenMP) ISSUE: Addresses .F90.f90 issue raised in https://github.com/wrf-model/WRF/pull/1989 LIST OF MODIFIED FILES: arch/postamble arch/configure.defaults TESTS CONDUCTED: 1. Compiles correctly on MacOS (Intel CPU with ifort + clang) and Linux 2. Are the Jenkins tests all passing? Yes. RELEASE NOTE: Fixed a compile problem with .F90 source files on case-insensitive file systems. --- arch/postamble | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/postamble b/arch/postamble index aa55662073..b5e585d29e 100644 --- a/arch/postamble +++ b/arch/postamble @@ -207,9 +207,9 @@ wrfio_esmf : $(RM) $@ sed -e "s/^\!.*'.*//" -e "s/^ *\!.*'.*//" $*.F90 > $*.G $(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $(OMPCPP) $*.G > $*.bb - $(SED_FTN) $*.bb | $(CPP) $(TRADFLAG) > $*.f90 + $(SED_FTN) $*.bb | $(CPP) $(TRADFLAG) > $*.tmp.f90 $(RM) $*.G $*.bb - $(FC) -o $@ -c $(FCFLAGS) $(OMP) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $*.f90 + $(FC) -o $@ -c $(FCFLAGS) $(OMP) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $*.tmp.f90 .F.f90: $(RM) $@ @@ -218,13 +218,6 @@ wrfio_esmf : $(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $*.H > $@ $(RM) $*.G $*.H -.F90.f90: - $(RM) $@ - sed -e "s/^\!.*'.*//" -e "s/^ *\!.*'.*//" $*.F90 > $*.G - $(SED_FTN) $*.G > $*.H - $(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $*.H > $@ - $(RM) $*.G $*.H - .f90.o: $(RM) $@ $(FC) -o $@ -c $(FCFLAGS) $(PROMOTION) $(FCSUFFIX) $*.f90