Auto PR - develop → MAPL-v3 - add matlab reader for Tb scaling parameters (read_Tb_scale_param.m) - #182
Merged
Conversation
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)
…GEOS_LdasGridComp.F90, GEOS_MetforceAvgGridComp.F90, GEOSldas_HIST.rc)
…ensavg_landice_route' into feature/wjiang/add_ensavg_landice_route
…GEOS_LandiceAvgGridComp.F90)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Automatic PR:
develop→release/MAPL-v3Description
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(-)