Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure FORTRAN code properly aborts when fire-emission is asked for and it can't be provided #2844

Open
wants to merge 36 commits into
base: cesm3_0_beta04_changes
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
13e5437
Add tests for fire_emis with SP bgc mode or BGC mode with nofire, the…
ekluzek Oct 3, 2024
36126dc
Make CLM_BLDNML_OPTS explicitly turn off drv_flds_in options off for …
ekluzek Oct 11, 2024
8653d35
Start adding a unit tests for CNFireFactory with just a single simple…
ekluzek Oct 23, 2024
b98fe8c
Start adding a unit tests for CNFireFactory with just a single simple…
ekluzek Oct 23, 2024
cfff96a
Merge remote-tracking branch 'escomp/cesm3_0_beta04_changes' into fir…
ekluzek Oct 23, 2024
69e1ccf
Merge remote-tracking branch 'escomp/cesm3_0_beta04_changes' into fir…
ekluzek Feb 6, 2025
2c330c0
Change to full ESMF library
ekluzek Feb 6, 2025
6d0f1e5
Add tests for each of the Li fire types
ekluzek Feb 7, 2025
3d81a1b
Add LAI stream to compile list
ekluzek Mar 4, 2025
9f7527e
Add check_dim_size
ekluzek Mar 4, 2025
e022783
Add FireClean method
ekluzek Mar 4, 2025
29b5b61
Make pointers set to NULL, and add BaseFireClean method
ekluzek Mar 4, 2025
61826eb
Add shr_expr and fire_emis to list
ekluzek Mar 4, 2025
de0c358
Add more setup and teardown, and also add several more tests, and inc…
ekluzek Mar 4, 2025
d4707b6
Initialize pointer to NULL, add clean method, add some returns after …
ekluzek Mar 4, 2025
fad3d1b
Add a note about the call to the base BaseFireClean method failing at…
ekluzek Mar 4, 2025
2fcc081
Get one of the failing tests working by implementing an init method t…
ekluzek Mar 5, 2025
39661d6
Get the last test working by aborting if fire-emissions are on in SP …
ekluzek Mar 5, 2025
ed88834
Add CNFireSetFireMethod for unit testing of the CNFireFactory, remove…
ekluzek Mar 5, 2025
570c5fe
Initialize fire_method to UNSET, so it will fail if it isn't set by s…
ekluzek Mar 6, 2025
6bcac0c
The unit testing actually doesn't need to call the fire_emis namelist…
ekluzek Mar 6, 2025
ad3d766
Add FATES Fire factory files to list
ekluzek Mar 6, 2025
4e36aa4
Add unit-tester for FATESFireFactory, two tests pass, two fail becaus…
ekluzek Mar 7, 2025
52c290a
Add unit-tester for FATESFireFactory, two tests pass, two fail becaus…
ekluzek Mar 7, 2025
a6fb39a
Get another test working, by checking that fire-emissions are off for…
ekluzek Mar 7, 2025
bbcc2a1
Merge tag 'ctsm5.3.030' into fire_emis
ekluzek Mar 7, 2025
99676ab
Don't allocate cnfire if NOT a BGC case
ekluzek Mar 10, 2025
bf6170e
Don't set stream types to NULL as they aren't pointers
ekluzek Mar 10, 2025
236a0a4
Make sure fire-emissions is off for FatesSp and FatesSt3 modes, which…
ekluzek Mar 11, 2025
14ad093
Add a fates_use_ed_st3 test and make sure it works
ekluzek Mar 11, 2025
1e5bfff
Get new namelist tests to work
ekluzek Mar 12, 2025
ae3fc28
Add failing test that both fates_sp and fates_st3 can be active at th…
ekluzek Mar 13, 2025
d7a23c7
Merge remote-tracking branch 'escomp/cesm3_0_beta04_changes' into fir…
ekluzek Mar 13, 2025
d0ba1ac
Change query of use_fates_sp to use nl_flags
ekluzek Mar 13, 2025
026d24f
Another update to use nl_flags query for use_fates_sp
ekluzek Mar 13, 2025
8caba7c
Don't allow both use_fates_sp and use_fates_ed_st3 to be on at the sa…
ekluzek Mar 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make pointers set to NULL, and add BaseFireClean method
  • Loading branch information
ekluzek committed Mar 4, 2025
commit 29b5b61372aca89c64e7c1112939966fc8d026e0
42 changes: 35 additions & 7 deletions src/cpl/share_esmf/FireDataBaseType.F90
Original file line number Diff line number Diff line change
@@ -26,20 +26,22 @@ module FireDataBaseType
type, abstract, extends(fire_method_type) :: fire_base_type
private
! !PRIVATE MEMBER DATA:
real(r8), public, pointer :: forc_hdm(:) ! Human population density
type(shr_strdata_type) :: sdat_hdm ! Human population density input data stream
real(r8), public, pointer :: forc_lnfm(:) ! Lightning frequency
type(shr_strdata_type) :: sdat_lnfm ! Lightning frequency input data stream
real(r8), public, pointer :: forc_hdm(:) => NULL() ! Human population density
type(shr_strdata_type) :: sdat_hdm => NULL() ! Human population density input data stream
real(r8), public, pointer :: forc_lnfm(:) => NULL() ! Lightning frequency
type(shr_strdata_type) :: sdat_lnfm => NULL() ! Lightning frequency input data stream

real(r8), public, pointer :: gdp_lf_col(:) ! col global real gdp data (k US$/capita)
real(r8), public, pointer :: peatf_lf_col(:) ! col global peatland fraction data (0-1)
integer , public, pointer :: abm_lf_col(:) ! col global peak month of crop fire emissions
real(r8), public, pointer :: gdp_lf_col(:) => NULL() ! col global real gdp data (k US$/capita)
real(r8), public, pointer :: peatf_lf_col(:) => NULL() ! col global peatland fraction data (0-1)
integer , public, pointer :: abm_lf_col(:) => NULL() ! col global peak month of crop fire emissions

contains
!
! !PUBLIC MEMBER FUNCTIONS:
procedure, public :: FireInit => BaseFireInit ! Initialization of Fire
procedure, public :: BaseFireInit ! Initialization of Fire
procedure, public :: FireClean=> BaseFireClean! Clean up data and deallocate data
procedure, public :: BaseFireClean ! Clean up data and deallocate data
procedure, public :: FireInterp ! Interpolate fire data
procedure(FireReadNML_interface), public, deferred :: &
FireReadNML ! Read in namelist for Fire
@@ -128,6 +130,32 @@ subroutine BaseFireInit( this, bounds, NLFilename )

end subroutine BaseFireInit

!================================================================
subroutine BaseFireClean( this )
!
! !DESCRIPTION:
! Clean fire data
! !USES:
!
! !ARGUMENTS:
class(fire_base_type) :: this
!-----------------------------------------------------------------------

if ( this%need_lightning_and_popdens() ) then
deallocate( this%forc_lnfm )
deallocate( this%forc_hdm )
deallocate( this%gdp_lf_col )
deallocate( this%peatf_lf_col )
deallocate( this%abm_lf_col )
this%forc_lnfm => NULL()
this%forc_hdm => NULL()
this%gdp_lf_col => NULL()
this%peatf_lf_col => NULL()
this%abm_lf_col => NULL()
end if

end subroutine BaseFireClean

!================================================================
subroutine FireInterp(this,bounds)
!