Skip to content

Commit

Permalink
Fix Cray Fortran 17.0.0 build errors in FireDataBaseType.F90
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dqwu committed Jul 23, 2024
1 parent 42baef2 commit 19a53ec
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions components/elm/src/biogeochem/FireDataBaseType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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), &
Expand Down Expand Up @@ -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', &
Expand Down Expand Up @@ -282,15 +281,15 @@ 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
do g = bounds%begg,bounds%endg
ig = ig+1
this%forc_hdm(g) = this%sdat_hdm%avs(1)%rAttr(1,ig)
end do
#endif
end subroutine hdm_interp

!-----------------------------------------------------------------------
Expand Down Expand Up @@ -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), &
Expand Down Expand Up @@ -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', &
Expand Down Expand Up @@ -438,15 +437,15 @@ 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
do g = bounds%begg,bounds%endg
ig = ig+1
this%forc_lnfm(g) = this%sdat_lnfm%avs(1)%rAttr(1,ig)
end do
#endif
end subroutine lnfm_interp

!-----------------------------------------------------------------------
Expand Down

0 comments on commit 19a53ec

Please sign in to comment.