diff --git a/CHANGELOG.md b/CHANGELOG.md index b889d363..d8cc91f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +## [v2.6.6] - 2026-08-03 + +### Fixed + +- Fixed ifx compilation errors in legacy GOCART GridComps (Ops emissions path): + - Changed `intent(in)` to `intent(inout)` on `w_c` (`Chem_Bundle`) arguments in `Aero`, `CFC`, `CH4`, `CO`, `CO2`, and `Rn` GridComps, as sub-components temporarily modify registry indices +- Additional fixes in `CO_GridCompMod.F90`: + - Initialize `eCO_bioburn_` to `0.0` to prevent use of uninitialized data when `diurnal_bb` is false + - Guard `DEALLOCATE` of `ier` with an `ALLOCATED` check + - Add local `ios` variable in `CO_Emission` to prevent host-association aliasing under optimization + ## [v2.6.5] - 2026-05-15 ### Fixed diff --git a/CMakeLists.txt b/CMakeLists.txt index 63e3249e..25013c7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ endif() if (GOCART_STANDALONE) project ( GOCART - VERSION 2.6.5 + VERSION 2.6.6 LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF if ("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}") diff --git a/ESMF/GOCART_GridComp/Aero_GridCompMod.F90 b/ESMF/GOCART_GridComp/Aero_GridCompMod.F90 index 3ec00479..56899d86 100644 --- a/ESMF/GOCART_GridComp/Aero_GridCompMod.F90 +++ b/ESMF/GOCART_GridComp/Aero_GridCompMod.F90 @@ -507,7 +507,7 @@ subroutine Aero_GridCompFinalize ( gcThis, w_c, impChem, expChem, & ! !INPUT PARAMETERS: - type(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: sub-components temporarily modify reg indices) integer, intent(in) :: nymd, nhms ! time real, intent(in) :: cdt ! chemistry timestep (secs) @@ -601,4 +601,3 @@ subroutine Aero_GridCompFinalize ( gcThis, w_c, impChem, expChem, & end subroutine Aero_GridCompFinalize end module Aero_GridCompMod - diff --git a/ESMF/GOCART_GridComp/CFC_GridComp/CFC_GridCompMod.F90 b/ESMF/GOCART_GridComp/CFC_GridComp/CFC_GridCompMod.F90 index 0cb45e3d..ced05946 100644 --- a/ESMF/GOCART_GridComp/CFC_GridComp/CFC_GridCompMod.F90 +++ b/ESMF/GOCART_GridComp/CFC_GridComp/CFC_GridCompMod.F90 @@ -130,7 +130,7 @@ SUBROUTINE CFC_GridCompInitialize( gcCFC, w_c, impChem, expChem, & ! !INPUT PARAMETERS: - TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: SingleInstance_ temporarily modifies reg indices) INTEGER, INTENT(IN) :: nymd, nhms ! time REAL, INTENT(IN) :: cdt ! chemical timestep (secs) diff --git a/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridCompMod.F90 b/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridCompMod.F90 index 1aa436ad..765fd1ae 100644 --- a/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridCompMod.F90 +++ b/ESMF/GOCART_GridComp/CH4_GridComp/CH4_GridCompMod.F90 @@ -174,7 +174,7 @@ SUBROUTINE CH4_GridCompInitialize ( gcCH4, w_c, impChem, expChem, nymd, nhms, cd ! !INPUT PARAMETERS: - TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: SingleInstance_ temporarily modifies reg indices) INTEGER, INTENT(IN) :: nymd, nhms ! time REAL, INTENT(IN) :: cdt ! chemical timestep (secs) @@ -310,7 +310,7 @@ SUBROUTINE CH4_GridCompRun ( gcCH4, w_c, impChem, expChem, nymd, nhms, cdt, rc ) ! !INPUT PARAMETERS: - TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: SingleInstance_ temporarily modifies reg indices) INTEGER, INTENT(IN) :: nymd, nhms ! time REAL, INTENT(IN) :: cdt ! chemical timestep (secs) @@ -366,7 +366,7 @@ SUBROUTINE CH4_GridCompFinalize ( gcCH4, w_c, impChem, expChem, nymd, nhms, cdt, ! !INPUT PARAMETERS: - TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: SingleInstance_ temporarily modifies reg indices) INTEGER, INTENT(IN) :: nymd, nhms ! time REAL, INTENT(IN) :: cdt ! chemical timestep (secs) @@ -459,7 +459,7 @@ SUBROUTINE CH4_GridCompInitialize1_ ( gcCH4, w_c, impChem, expChem, nymd, nhms, ! !INPUT PARAMETERS: - TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: SingleInstance_ temporarily modifies reg indices) INTEGER, INTENT(IN) :: nymd, nhms ! time REAL, INTENT(IN) :: cdt ! chemical timestep (secs) diff --git a/ESMF/GOCART_GridComp/CO2_GridComp/CO2_GridCompMod.F90 b/ESMF/GOCART_GridComp/CO2_GridComp/CO2_GridCompMod.F90 index 1a8da2ef..a6946ab9 100644 --- a/ESMF/GOCART_GridComp/CO2_GridComp/CO2_GridCompMod.F90 +++ b/ESMF/GOCART_GridComp/CO2_GridComp/CO2_GridCompMod.F90 @@ -265,7 +265,7 @@ subroutine CO2_GridCompInitialize ( gcCO2, w_c, impChem, expChem, & ! !INPUT PARAMETERS: - type(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: SingleInstance_ temporarily modifies reg indices) integer, intent(in) :: nymd, nhms ! time real, intent(in) :: cdt ! chemical timestep (secs) @@ -989,7 +989,7 @@ subroutine CO2_GridCompFinalize ( gcCO2, w_c, impChem, expChem, & ! !INPUT PARAMETERS: - type(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + type(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: SingleInstance_ temporarily modifies reg indices) integer, intent(in) :: nymd, nhms ! time real, intent(in) :: cdt ! chemical timestep (secs) diff --git a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridCompMod.F90 b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridCompMod.F90 index ff7ef7f8..82acaa1f 100644 --- a/ESMF/GOCART_GridComp/CO_GridComp/CO_GridCompMod.F90 +++ b/ESMF/GOCART_GridComp/CO_GridComp/CO_GridCompMod.F90 @@ -197,7 +197,7 @@ subroutine CO_GridCompInitialize ( gcCO, w_c, impChem, expChem, & ! !INPUT PARAMETERS: - TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: CO_SingleInstance_ temporarily modifies reg indices) INTEGER, INTENT(IN) :: nymd, nhms ! time REAL, INTENT(IN) :: cdt ! chemical timestep (secs) @@ -353,7 +353,7 @@ subroutine CO_GridCompRun ( gcCO, w_c, impChem, expChem, & ! !INPUT PARAMETERS: - TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: CO_SingleInstance_ temporarily modifies reg indices) INTEGER, INTENT(IN) :: nymd, nhms ! time REAL, INTENT(IN) :: cdt ! chemical timestep (secs) @@ -411,7 +411,7 @@ subroutine CO_GridCompFinalize ( gcCO, w_c, impChem, expChem, & ! !INPUT PARAMETERS: - TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: CO_SingleInstance_ temporarily modifies reg indices) INTEGER, INTENT(IN) :: nymd, nhms ! time REAL, INTENT(IN) :: cdt ! chemical timestep (secs) @@ -702,6 +702,7 @@ SUBROUTINE init_() ier(nerr),STAT=ios ) ier = 0 IF ( ios /= 0 ) rc = 100 + gcCO%eCO_bioburn_ = 0.0 ! initialize to prevent use of uninitialized data if diurnal_bb is false END SUBROUTINE init_ SUBROUTINE final_(ierr) @@ -711,7 +712,8 @@ SUBROUTINE final_(ierr) gcCO%eCO_bioburn_, & gcCO%COsfcFlux, gcCO%eCO_iso, gcCO%eCO_mon, & gcCO%eCO_mtn, gcCO%CH4, gcCO%OHnd, & - ier, STAT=ios ) + STAT=ios ) + IF ( ALLOCATED(ier) ) DEALLOCATE( ier, STAT=ios ) CALL I90_release() rc = ierr END SUBROUTINE final_ @@ -1149,6 +1151,7 @@ SUBROUTINE CO_Emission ( rc ) CHARACTER(LEN=*), PARAMETER :: myname = 'CO_Emission' INTEGER :: i, j, k, kt, minkPBL + INTEGER :: ios ! local ios - prevent host association aliasing under optimization INTEGER, ALLOCATABLE :: index(:) REAL, PARAMETER :: mwtAir=28.97 diff --git a/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridCompMod.F90 b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridCompMod.F90 index 5a09a884..99c65819 100644 --- a/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridCompMod.F90 +++ b/ESMF/GOCART_GridComp/Rn_GridComp/Rn_GridCompMod.F90 @@ -183,7 +183,7 @@ subroutine Rn_GridCompInitialize ( gcRn, w_c, impChem, expChem, & ! !INPUT PARAMETERS: - TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: SingleInstance_ temporarily modifies reg indices) INTEGER, INTENT(IN) :: nymd, nhms ! time REAL, INTENT(IN) :: cdt ! chemical timestep (secs) @@ -316,7 +316,7 @@ SUBROUTINE Rn_GridCompRun ( gcRn, w_c, impChem, expChem, & ! !INPUT PARAMETERS: - TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: SingleInstance_ temporarily modifies reg indices) INTEGER, INTENT(IN) :: nymd, nhms ! time REAL, INTENT(IN) :: cdt ! chemical timestep (secs) @@ -373,7 +373,7 @@ SUBROUTINE Rn_GridCompFinalize ( gcRn, w_c, impChem, expChem, & ! !INPUT PARAMETERS: - TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: SingleInstance_ temporarily modifies reg indices) INTEGER, INTENT(IN) :: nymd, nhms ! time REAL, INTENT(IN) :: cdt ! chemical timestep (secs) @@ -461,7 +461,7 @@ subroutine Rn_GridCompInitialize1_ ( gcRn, w_c, impChem, expChem, & ! !INPUT PARAMETERS: - TYPE(Chem_Bundle), intent(in) :: w_c ! Chemical tracer fields + TYPE(Chem_Bundle), intent(inout) :: w_c ! Chemical tracer fields (inout: SingleInstance_ temporarily modifies reg indices) INTEGER, INTENT(IN) :: nymd, nhms ! time REAL, INTENT(IN) :: cdt ! chemical timestep (secs)