From 0aa34f44d7a6649a09a38f43d2536b2d3dbf553c Mon Sep 17 00:00:00 2001 From: Weiyuan Jiang Date: Thu, 5 Nov 2026 21:14:25 -0500 Subject: [PATCH 1/3] Fix NAG build on macOS (GEOSlandassim) - Compile hdf4_c_api.c as a separate object library so that hdf.h's does not resolve to GMAO_mpeu/assert.H on case-insensitive file systems - clsm_ensupd_read_obs: real(8) -> real(REAL64) --- GEOSlandassim_GridComp/CMakeLists.txt | 10 +++++++++- GEOSlandassim_GridComp/clsm_ensupd_read_obs.F90 | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/GEOSlandassim_GridComp/CMakeLists.txt b/GEOSlandassim_GridComp/CMakeLists.txt index 87a9bf58..5befb400 100644 --- a/GEOSlandassim_GridComp/CMakeLists.txt +++ b/GEOSlandassim_GridComp/CMakeLists.txt @@ -5,7 +5,7 @@ set (alldirs ) set (SRCS - hdf4_c_api.c hdf4_fortran_api.F90 io_hdf5.F90 enkf_general.F90 adapt_types.F90 mwRTM_types.F90 clsm_ensupd_glob_param.F90 + hdf4_fortran_api.F90 io_hdf5.F90 enkf_general.F90 adapt_types.F90 mwRTM_types.F90 clsm_ensupd_glob_param.F90 mwRTM_routines.F90 clsm_ensupd_upd_routines.F90 clsm_ensdrv_drv_routines.F90 clsm_ensupd_read_obs.F90 catch_bias_types.F90 clsm_bias_routines.F90 clsm_adapt_routines.F90 clsm_ensupd_enkf_update.F90 clsm_ensdrv_out_routines.F90 GEOS_LandAssimGridComp.F90 @@ -16,6 +16,14 @@ find_path(HDF4_INCLUDE_DIR hdf.h PATH_SUFFIXES hdf REQUIRED) find_library(HDF4_MFHDF_LIBRARY NAMES mfhdf REQUIRED) find_library(HDF4_DF_LIBRARY NAMES df REQUIRED) +# The HDF4 C bridge is compiled separately so that it only sees the HDF4 headers. +# Otherwise, on case-insensitive file systems (macOS), the included by +# hdf.h resolves to GMAO_mpeu/assert.H through the include paths of the dependencies. +add_library (${this}_hdf4_c OBJECT hdf4_c_api.c) +target_include_directories (${this}_hdf4_c PRIVATE ${HDF4_INCLUDE_DIR}) +set_target_properties (${this}_hdf4_c PROPERTIES POSITION_INDEPENDENT_CODE ON) +list (APPEND SRCS $) + esma_add_library (${this} SRCS ${SRCS} SUBCOMPONENTS ${alldirs} diff --git a/GEOSlandassim_GridComp/clsm_ensupd_read_obs.F90 b/GEOSlandassim_GridComp/clsm_ensupd_read_obs.F90 index 37e03ba9..e99a1392 100644 --- a/GEOSlandassim_GridComp/clsm_ensupd_read_obs.F90 +++ b/GEOSlandassim_GridComp/clsm_ensupd_read_obs.F90 @@ -20,7 +20,7 @@ module clsm_ensupd_read_obs c_char use, intrinsic :: iso_fortran_env, ONLY: & - int16 + int16, REAL64 use MAPL_BaseMod, ONLY: & MAPL_UNDEF @@ -2291,7 +2291,7 @@ subroutine read_obs_sm_ASCAT_HSAF( & ! per-file arrays allocated to actual obs dimension size integer, allocatable :: lat_raw(:), lon_raw(:) - real(8), allocatable :: time_raw(:) + real(REAL64), allocatable :: time_raw(:) integer(2), allocatable :: ssm_raw(:) integer(1), allocatable :: sflag_raw(:) ! surface_flag (NC_UBYTE -> int8) integer(1), allocatable :: pflag_raw(:) ! processing_flag (NC_UBYTE -> int8) From e97bdaee20a25b077a501e5a49ee4c234055c089 Mon Sep 17 00:00:00 2001 From: Weiyuan Jiang <52509753+weiyuan-jiang@users.noreply.github.com> Date: Mon, 9 Nov 2026 09:53:13 -0500 Subject: [PATCH 2/3] Update CHANGELOG with recent fixes and updates Added a new entry for fixing compiler warnings and improved handling of observation data in various scripts. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30c4d528..9fb5cd43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated [x,y]corr values for HSAF ASCAT soil moisture obs in LDASsa_DEFAULT_inputs_ensupd.nml ([PR #235](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/235)). ### Fixed +- Fixed for compiler Nag - Fixed `frac_cell` and units of `area` in tile_coord when reading nc4 tile file in preprocessing (not 0-diff for nc4 tile files; 0-diff for *.til ASCII tile files). - Fixed double assimilation of MODIS SCF obs for tiles whose center longitude is exactly on the boundary between two assimilation windows (not 0-diff for EASEv2 M36 and CF0360) ([PR #240](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/240)). - Fixed bugs in MATLAB obs scaling parameter scripts (not 0-diff for lat/lon grid) ([PR #227](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/227)). From 5c3e03b7bf1b0f833ab2ac8cc7aa1315e84abec6 Mon Sep 17 00:00:00 2001 From: Rolf Reichle <54944691+gmao-rreichle@users.noreply.github.com> Date: Sat, 14 Nov 2026 10:43:35 -0500 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a41e3b43..47d26126 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated [x,y]corr values for HSAF ASCAT soil moisture obs in LDASsa_DEFAULT_inputs_ensupd.nml ([PR #235](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/235)). ### Fixed -- Fixed for compiler Nag +- Fixed NAG build on macOS (GEOSlandassim) ([PR #244](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/244)). - Fixed out-of-bounds copies of per-tile data in LandPert (`i_indgs`, `j_indgs`) and LandAssim (`f_num`) when `tile_coord` contains lake and land ice tiles in addition to land tiles ([PR #254](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/254)). - Fixed QC of Tb obs for non-land surfaces (water, land ice) in cube-sphere tile space, where it was not applied (not 0-diff for cube-sphere tile space with Tb obs; 0-diff for EASE and lat/lon tile spaces) ([PR #249](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/249)). - Fixed `frac_cell` and units of `area` in tile_coord when reading nc4 tile file in preprocessing (not 0-diff for nc4 tile files; 0-diff for *.til ASCII tile files) ([PR #247](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/247)).