Skip to content

Auto PR - develop → MAPL-v3 - add matlab reader for Tb scaling parameters (read_Tb_scale_param.m) - #182

Merged
mathomp4 merged 45 commits into
release/MAPL-v3from
develop
Jul 24, 2026
Merged

mathomp4 merged 45 commits into
release/MAPL-v3from
develop

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

📝 Automatic PR: developrelease/MAPL-v3

Description

add matlab reader for Tb scaling parameters (read_Tb_scale_param.m)

📁 Modified files

CHANGELOG.md | 8 +-
CMakeLists.txt | 2 +-
GEOS_LdasGridComp.F90 | 121 +-
GEOSens_GridComp/CMakeLists.txt (gone) | 6 -
GEOSensavg_GridComp/CMakeLists.txt (new) | 13 +
.../GEOS_LandAvgGridComp.F90 | 548 +-------
.../GEOS_LandiceAvgGridComp.F90 (new) | 1471 ++++++++++++++++++++
.../GEOS_MetforceAvgGridComp.F90 (new) | 560 ++++++++
.../GEOS_RouteAvgGridComp.F90 (new) | 290 ++++
GEOSlandassim_GridComp/CMakeLists.txt | 2 +-
GEOSlandassim_GridComp/GEOS_LandAssimGridComp.F90 | 129 +-
GEOSlandassim_GridComp/clsm_ensupd_enkf_update.F90 | 85 +-
GEOSlandassim_GridComp/clsm_ensupd_read_obs.F90 | 42 +-
.../clsm_ensupd_upd_routines.F90 | 1 +
GEOSlandpert_GridComp/CMakeLists.txt | 2 +-
GEOSlandpert_GridComp/GEOS_LandPertGridComp.F90 | 69 +-
GEOSldas_App/GEOSldas_HIST.rc | 136 +-
GEOSldas_App/GEOSldas_HISTdet.rc | 120 +-
GEOSldas_App/GEOSldas_HISTens.rc | 120 +-
GEOSldas_App/process_hist.csh | 12 +-
.../obs_scaling_params/read_Tb_scale_param.m (new) | 203 +++
LDAS_Shared/CMakeLists.txt | 1 +
LDAS_Shared/LDAS_ensdrv_Globals.F90 | 11 +-
LDAS_Shared/StateMerge.F90 (new) | 142 ++
24 files changed, 3149 insertions(+), 945 deletions(-)

weiyuan-jiang and others added 30 commits May 8, 2026 16:44
In debug mode, Intel Fortran raises error 65 (floating invalid) when
comparing NaN values (e.g. NaN >= 0.). Input scaling parameter files
use NaN as a no-data indicator, which causes comparisons like
sclprm_std_obs >= 0. to raise FP exceptions before returning false.

Fix: Add NaN guards using the standard Fortran idiom (val == val is
.false. for NaN) before the existing range checks at all 3 guard sites
in clsm_ensupd_read_obs.F90 (~line 9755, ~9989, ~10384).
When N_files=1, lon_min_vec(2) and lon_max_vec(2) remain initialized
to MAPL_UNDEF (1.0e15). Whole-array operations like:
  start_ind = (lon_min_vec - CMG_ll_lon) / CMG_dlon
produce ~2e16 which overflows a 32-bit integer, causing
forrtl: error (65): floating invalid in debug mode.

Fix: Restrict array operations to (1:N_files) elements only:
  start_ind(1:N_files) = (lon_min_vec(1:N_files) - CMG_ll_lon)/CMG_dlon
  last_ind(1:N_files)  = (lon_max_vec(1:N_files) - CMG_ll_lon)/CMG_dlon
  N_lon_vec(1:N_files) = last_ind(1:N_files) - start_ind(1:N_files) + 1
…GEOS-ESM/GEOSldas_GridComp into feature/wjiang/add_ensavg_landice_route
- GEOSlandassim: add deallocate(Observations_lH) in non-MPI path of
  get_enkf_increments (clsm_ensupd_enkf_update.F90); pointer was
  allocated every assimilation cycle but never freed
- GEOSlandassim: add deallocate(tmp_wFOV) to cleanup block of
  get_obs_pred (clsm_ensupd_upd_routines.F90); omitted alongside
  four sibling arrays that were already freed
- GEOSlandassim: add comprehensive deallocate calls in Finalize()
  for all module-level variables allocated in Initialize()
  (GEOS_LandAssimGridComp.F90): tb_nodata, Pert_rseed, Pert_rseed_r8,
  N_catl_vec, low_ind, l2rf, rf2f, tile_coord_rf, rf2g, rf2l, obs_param
- GEOSlandpert: add explicit deallocate(pert_rseed) before RETURN_ macro
  in GenerateRaw_ntrmdt, consistent with ApplyForcePert/ApplyPrognPert
- GEOSlandpert: add deallocate(pert_iseed) + nullify in Finalize();
  module-level pointer was never freed
- GEOSlandpert: add deallocate(internal) + nullify(wrap%ptr) in
  Finalize(); T_LANDPERT_STATE struct itself was never freed
- GEOSlandpert: nullify force_pert_param and progn_pert_param after
  their targets are deallocated in Finalize() to avoid dangling pointers
…am%soilcls (GEOS_LandAssimGridComp.F90, LDAS_ensdrv_Globals.F90)
@github-actions
github-actions Bot requested a review from a team as a code owner July 17, 2026 13:56
@github-actions github-actions Bot added Skip Changelog Skips the Changelog Enforcer automatic MAPL3 labels Jul 17, 2026
@gmao-rreichle
gmao-rreichle requested a review from a team as a code owner July 21, 2026 16:33
@mathomp4
mathomp4 merged commit 80f2af0 into release/MAPL-v3 Jul 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automatic MAPL3 Skip Changelog Skips the Changelog Enforcer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants