From 19a53ec2522ecab9028a19d448d7b8ac402b3e63 Mon Sep 17 00:00:00 2001 From: dqwu Date: Mon, 22 Jul 2024 21:57:41 -0500 Subject: [PATCH] Fix Cray Fortran 17.0.0 build errors in FireDataBaseType.F90 This workaround was provided by Andrew Bradley. According to Gautam Bisht, the code commented out by Andrew is only used if BGC is on in the land model. --- .../elm/src/biogeochem/FireDataBaseType.F90 | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/components/elm/src/biogeochem/FireDataBaseType.F90 b/components/elm/src/biogeochem/FireDataBaseType.F90 index c15a13e42db..a272c118173 100644 --- a/components/elm/src/biogeochem/FireDataBaseType.F90 +++ b/components/elm/src/biogeochem/FireDataBaseType.F90 @@ -8,8 +8,7 @@ module FireDataBaseType ! ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL - use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create, shr_strdata_print - use shr_strdata_mod , only : shr_strdata_advance + use shr_strdata_mod , only : shr_strdata_type use shr_log_mod , only : errMsg => shr_log_errMsg use elm_varctl , only : iulog, inst_name use spmdMod , only : masterproc, mpicom, comp_id @@ -36,10 +35,10 @@ module FireDataBaseType real(r8), public, pointer :: forc_hdm(:) ! Human population density real(r8), public, pointer :: gdp_lf_col(:) ! col global real gdp data (k US$/capita) - - type(shr_strdata_type) :: sdat_hdm ! Human population density input data stream - type(shr_strdata_type) :: sdat_lnfm ! Lightning input data stream - +#ifdef CCE_17_COMPILER_BUG_FIXED + type(shr_strdata_type), private :: sdat_hdm ! Human population density input data stream + type(shr_strdata_type), private :: sdat_lnfm ! Lightning input data stream +#endif contains ! !PUBLIC MEMBER FUNCTIONS: @@ -219,7 +218,7 @@ subroutine hdm_init( this, bounds, NLFilename ) endif call elm_domain_mct (bounds, dom_elm) - +#ifdef CCE_17_COMPILER_BUG_FIXED call shr_strdata_create(this%sdat_hdm,name="clmhdm", & pio_subsystem=pio_subsystem, & pio_iotype=shr_pio_getiotype(inst_name), & @@ -250,7 +249,7 @@ subroutine hdm_init( this, bounds, NLFilename ) if (masterproc) then call shr_strdata_print(this%sdat_hdm,'population density data') endif - +#endif ! Add history fields call hist_addfld1d (fname='HDM', units='counts/km^2', & avgflag='A', long_name='human population density', & @@ -282,7 +281,7 @@ subroutine hdm_interp( this, bounds ) call get_curr_date(year, mon, day, sec) mcdate = year*10000 + mon*100 + day - +#ifdef CCE_17_COMPILER_BUG_FIXED call shr_strdata_advance(this%sdat_hdm, mcdate, sec, mpicom, 'hdmdyn') ig = 0 @@ -290,7 +289,7 @@ subroutine hdm_interp( this, bounds ) ig = ig+1 this%forc_hdm(g) = this%sdat_hdm%avs(1)%rAttr(1,ig) end do - +#endif end subroutine hdm_interp !----------------------------------------------------------------------- @@ -375,7 +374,7 @@ subroutine lnfm_init( this, bounds, NLFilename ) endif call elm_domain_mct (bounds, dom_elm) - +#ifdef CCE_17_COMPILER_BUG_FIXED call shr_strdata_create(this%sdat_lnfm,name="clmlnfm", & pio_subsystem=pio_subsystem, & pio_iotype=shr_pio_getiotype(inst_name), & @@ -406,7 +405,7 @@ subroutine lnfm_init( this, bounds, NLFilename ) if (masterproc) then call shr_strdata_print(this%sdat_lnfm,'Lightning data') endif - +#endif ! Add history fields call hist_addfld1d (fname='LNFM', units='counts/km^2/hr', & avgflag='A', long_name='Lightning frequency', & @@ -438,7 +437,7 @@ subroutine lnfm_interp(this, bounds ) call get_curr_date(year, mon, day, sec) mcdate = year*10000 + mon*100 + day - +#ifdef CCE_17_COMPILER_BUG_FIXED call shr_strdata_advance(this%sdat_lnfm, mcdate, sec, mpicom, 'lnfmdyn') ig = 0 @@ -446,7 +445,7 @@ subroutine lnfm_interp(this, bounds ) ig = ig+1 this%forc_lnfm(g) = this%sdat_lnfm%avs(1)%rAttr(1,ig) end do - +#endif end subroutine lnfm_interp !-----------------------------------------------------------------------