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

Remove duplicative allsoils filter for FATES SatellitePhenology call #1515

Merged
merged 17 commits into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ hash = 34723c2
required = True

[ccs_config]
tag = ccs_config_cesm0.0.36
tag = ccs_config_cesm0.0.38
protocol = git
repo_url = https://github.com/ESMCI/ccs_config_cesm.git
local_path = ccs_config
Expand All @@ -44,7 +44,7 @@ required = True
local_path = cime
protocol = git
repo_url = https://github.com/ESMCI/cime
tag = cime6.0.27
tag = cime6.0.40
required = True

[cmeps]
Expand Down
2 changes: 1 addition & 1 deletion Externals_CLM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local_path = src/fates
protocol = git
repo_url = https://github.com/NGEET/fates
tag = sci.1.57.4_api.24.0.0
tag = sci.1.58.1_api.24.1.0
required = True

[externals_description]
Expand Down
14 changes: 0 additions & 14 deletions cime_config/testdefs/ExpectedTestFails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,6 @@

<!-- fates test suite failures -->

<test name="SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdDefHydro">
<phase name="RUN">
<status>FAIL</status>
<issue>NGEET/fates#795</issue>
</phase>
</test>

<test name="ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdDefHydro">
<phase name="RUN">
<status>FAIL</status>
<issue>#1525</issue>
</phase>
</test>

<test name="ERS_D_Lm12.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesFireLightningPopDens">
<phase name="COMPARE_base_rest">
<status>FAIL</status>
Expand Down
4 changes: 2 additions & 2 deletions cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS',
'FATES_DISTURBANCE_RATE_POTENTIAL', 'FATES_HARVEST_CARBON_FLUX',
'FATES_STOMATAL_COND', 'FATES_LBLAYER_COND', 'FATES_NPP', 'FATES_GPP',
'FATES_AUTORESP', 'FATES_GROWTH_RESP', 'FATES_MAINT_RESP', 'FATES_GPP_CANOPY',
'FATES_AUTORESP_CANOPY', 'FATES_GPP_UNDERSTORY', 'FATES_AUTORESP_UNDERSTORY',
'FATES_AUTORESP_CANOPY', 'FATES_GPP_USTORY', 'FATES_AUTORESP_USTORY',
'FATES_DEMOTION_CARBONFLUX', 'FATES_PROMOTION_CARBONFLUX',
'FATES_MORTALITY_CFLUX_CANOPY', 'FATES_MORTALITY_CFLUX_UNDERSTORY',
'FATES_MORTALITY_CFLUX_CANOPY', 'FATES_MORTALITY_CFLUX_USTORY',
'FATES_NEP', 'FATES_HET_RESP', 'FATES_FIRE_CLOSS', 'FATES_FIRE_FLUX_EL',
'FATES_CBALANCE_ERROR', 'FATES_ERROR_EL', 'FATES_LEAF_ALLOC',
'FATES_SEED_ALLOC', 'FATES_STEM_ALLOC', 'FATES_FROOT_ALLOC',
Expand Down
4 changes: 2 additions & 2 deletions cime_config/usermods_dirs/fates_sp/user_nl_clm
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ hist_fexcl1 = 'FATES_TRIMMING', 'FATES_COLD_STATUS', 'FATES_DROUGHT_STATUS', 'FA
'FATES_DISTURBANCE_RATE_P2P', 'FATES_DISTURBANCE_RATE_P2S', 'FATES_DISTURBANCE_RATE_S2S',
'FATES_DISTURBANCE_RATE_FIRE', 'FATES_DISTURBANCE_RATE_LOGGING', 'FATES_DISTURBANCE_RATE_TREEFALL',
'FATES_DISTURBANCE_RATE_POTENTIAL', 'FATES_HARVEST_CARBON_FLUX', 'FATES_GPP_CANOPY', 'FATES_AUTORESP_CANOPY',
'FATES_GPP_UNDERSTORY', 'FATES_AUTORESP_UNDERSTORY', 'FATES_CROWNAREA_CL', 'FATES_DEMOTION_CARBONFLUX',
'FATES_PROMOTION_CARBONFLUX', 'FATES_MORTALITY_CFLUX_CANOPY', 'FATES_MORTALITY_CFLUX_UNDERSTORY',
'FATES_GPP_USTORY', 'FATES_AUTORESP_USTORY', 'FATES_CROWNAREA_CL', 'FATES_DEMOTION_CARBONFLUX',
'FATES_PROMOTION_CARBONFLUX', 'FATES_MORTALITY_CFLUX_CANOPY', 'FATES_MORTALITY_CFLUX_USTORY',
'FATES_DDBH_CANOPY_SZ', 'FATES_DDBH_USTORY_SZ', 'FATES_BASALAREA_SZ',
'FATES_VEGC_ABOVEGROUND_SZ', 'FATES_LAI_CANOPY_SZ', 'FATES_MORTALITY_CANOPY_SZ', 'FATES_NPLANT_USTORY_SZ',
'FATES_LAI_USTORY_SZ', 'FATES_NPLANT_SZ', 'FATES_NPLANT_AC', 'FATES_MORTALITY_BACKGROUND_SZ',
Expand Down
96 changes: 96 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,100 @@
===============================================================
Tag name: ctsm5.1.dev104
Originator(s): glemieux (Gregory Lemieux,LBL/NGEET,510-486-5049)
Date: Mon Jul 18 15:45:00 MDT 2022
One-line Summary: Update to fates history names and machine configuration

Purpose and description of changes
----------------------------------

This PR includes a number of minor fixes and updates associated with FATES.
A duplicate filter for all soils that was introduced during the the initial
implementation of FATES-SP mode is removed. A small set of FATES history
variable names have been updated necessitating an update to the testmod
user namelists. The ccs_config and cime externals have been updated to
include the FATES development workstation, lobata. The cime tag update
is necessary to include a fix enabling support for module initilization
on certain linux distributions (https://github.com/ESMCI/cime/issues/4260).
Finally, a minor fix was included to the initialization of the fates_levcdam
dimension that was introduced with the last fates api update.

Significant changes to scientifically-supported configurations
--------------------------------------------------------------

Does this tag change answers significantly for any of the following physics configurations?
(Details of any changes will be given in the "Answer changes" section below.)

[Put an [X] in the box for any configuration with significant answer changes.]

[ ] clm5_1

[ ] clm5_0

[ ] ctsm5_0-nwp

[ ] clm4_5


Bugs fixed or introduced
------------------------
[Remove any lines that don't apply. Remove entire section if nothing applies.]

CTSM issues fixed (include CTSM Issue #):
Fixes #1794 -- Get lobata in ccs_config and working with NUOPC
Fixes #1488 -- Remove all_soil_patches filter and use and filter_inactive_and_active(nc)%soilp in it's place

Testing summary:
----------------

[PASS means all tests PASS; OK means tests PASS other than expected fails.]

tools-tests (test/tools) (if tools have been changed):

cheyenne - PASS

python testing (if python code has changed; see instructions in python/README.md; document testing done):

cheyenne - PASS

regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):

cheyenne ---- OK
izumi ------- OK

fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates-<FATES TAG>-<CTSM TAG>)
cheyenne ---- OK
izumi ------- OK

If the tag used for baseline comparisons was NOT the previous tag, note that here:

FATES tests run against fates-sci.1.58.0_api.24.0.0-ctsm5.1.dev103 baseline

Answer changes
--------------

Changes answers relative to baseline:

Changes answers due to a correction only for a subset of fates testmods for the fates_levcdam dimension.
NLCOMP and FIELDLIST differences only due to expected ccs_config and fates updates.

Other details
-------------

List any externals directories updated (cime, rtm, mosart, cism, fates, etc.):

- CIME: cime6.0.27 -> cime6.0.40
- ccs_config: ccs_config_cesm0.0.36 -> ccs_config_cesm0.0.38
- FATES: sci.1.58.0_api.24.0.0 -> sci.1.58.1_api.24.1.0

Pull Requests that document the changes (include PR ids):
(https://github.com/ESCOMP/ctsm/pull)

https://github.com/ESCOMP/CTSM/pull/1515
https://github.com/NGEET/fates/pull/854


===============================================================
===============================================================
Tag name: ctsm5.1.dev103
Originator(s): sacks (Bill Sacks)
Date: Tue Jul 12 22:27:30 MDT 2022
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeSum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Tag Who Date Summary
============================================================================================================================
ctsm5.1.dev104 glemieux 07/15/2022 Update to FATES history names and machine configuration
ctsm5.1.dev103 sacks 07/12/2022 Fix accumulation variables when changing model time step
ctsm5.1.dev102 sacks 07/11/2022 Fix LILAC interface to PIO
ctsm5.1.dev101 samrabin 07/11/2022 Fix winter wheat sowing window bugs
Expand Down
4 changes: 2 additions & 2 deletions src/biogeochem/SatellitePhenologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ subroutine SatellitePhenology(bounds, num_filter, filter, &
!
! !ARGUMENTS:
type(bounds_type) , intent(in) :: bounds
integer , intent(in) :: num_filter ! number of column non-lake points in patch filter
integer , intent(in) :: filter(bounds%endp-bounds%begp+1) ! patch filter for non-lake points
integer , intent(in) :: num_filter ! number of column points in patch filter
integer , intent(in) :: filter(bounds%endp-bounds%begp+1) ! patch filter points
type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst
type(canopystate_type) , intent(inout) :: canopystate_inst
!
Expand Down
10 changes: 9 additions & 1 deletion src/main/clm_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1036,9 +1036,17 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro

if (use_fates_sp.and.doalb) then
call t_startf('SatellitePhenology')
call SatellitePhenology(bounds_clump, filter(nc)%num_all_soil_patches, filter(nc)%all_soil_patches, &

! FATES satellite phenology mode needs to include all active and inactive patch-level soil
! filters due to the translation between the hlm pfts and the fates pfts.
! E.g. in FATES, an active PFT vector of 1, 0, 0, 0, 1, 0, 1, 0 would be mapped into
! the host land model as 1, 1, 1, 0, 0, 0, 0. As such, the 'active' filter would only
! use the first three points, which would incorrectly represent the interpolated values.
call SatellitePhenology(bounds_clump, &
filter_inactive_and_active(nc)%num_soilp, filter_inactive_and_active(nc)%soilp, &
water_inst%waterdiagnosticbulk_inst, canopystate_inst)
call t_stopf('SatellitePhenology')

end if

! Dry Deposition of chemical tracers (Wesely (1998) parameterizaion)
Expand Down
12 changes: 10 additions & 2 deletions src/main/clm_initializeMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ subroutine initialize2(ni,nj)
! Get processor bounds for gridcells
call get_proc_bounds(bounds_proc)
begg = bounds_proc%begg; endg = bounds_proc%endg

! Initialize glc behavior
call glc_behavior%Init(begg, endg, NLFilename)

Expand Down Expand Up @@ -661,8 +661,16 @@ subroutine initialize2(ni,nj)
!$OMP PARALLEL DO PRIVATE (nc, bounds_clump)
do nc = 1,nclumps
call get_clump_bounds(nc, bounds_clump)
call SatellitePhenology(bounds_clump, filter(nc)%num_nolakep, filter(nc)%nolakep, &

! FATES satellite phenology mode needs to include all active and inactive patch-level soil
! filters due to the translation between the hlm pfts and the fates pfts.
! E.g. in FATES, an active PFT vector of 1, 0, 0, 0, 1, 0, 1, 0 would be mapped into
! the host land model as 1, 1, 1, 0, 0, 0, 0. As such, the 'active' filter would only
! use the first three points, which would incorrectly represent the interpolated values.
call SatellitePhenology(bounds_clump, &
filter_inactive_and_active(nc)%num_soilp, filter_inactive_and_active(nc)%soilp, &
water_inst%waterdiagnosticbulk_inst, canopystate_inst)

end do
!$OMP END PARALLEL DO
end if
Expand Down
21 changes: 0 additions & 21 deletions src/main/filterMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ subroutine allocFiltersOneGroup(this_filter)
allocate(this_filter(nc)%lakep(bounds%endp-bounds%begp+1))
allocate(this_filter(nc)%nolakep(bounds%endp-bounds%begp+1))
allocate(this_filter(nc)%nolakeurbanp(bounds%endp-bounds%begp+1))
allocate(this_filter(nc)%all_soil_patches(bounds%endp-bounds%begp+1))

allocate(this_filter(nc)%lakec(bounds%endc-bounds%begc+1))
allocate(this_filter(nc)%nolakec(bounds%endc-bounds%begc+1))
Expand Down Expand Up @@ -320,7 +319,6 @@ subroutine setFiltersOneGroup(bounds, this_filter, include_inactive, glc_behavio
integer :: fnl,fnlu ! non-lake filter index
integer :: fs ! soil filter index
integer :: f, fn ! general indices
integer :: f_asp ! all soil patches index
integer :: g !gridcell index
!------------------------------------------------------------------------

Expand Down Expand Up @@ -441,25 +439,6 @@ subroutine setFiltersOneGroup(bounds, this_filter, include_inactive, glc_behavio
end if
end if
end do

! thise filter will include all soil P's irrespective of whether or not they are active.
! its purpose is to allow the TLAI, TSAI and HTOP drivers to be interpolated when in
! FATES-SP mode.
! e.g. in FATES, an active PFT vector of 1, 0, 0, 0, 1, 0, 1, 0
! would be mapped inot the host land model as
! 1, 1, 1, 0, 0, 0, 0
! thus the 'active' filter will only use the first three points.
! this filter will stay on for all the
f_asp = 0
do p = bounds%begp,bounds%endp
l =patch%landunit(p)
if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then
f_asp = f_asp +1
this_filter(nc)%all_soil_patches(f_asp) = p
end if
enddo
this_filter(nc)%num_all_soil_patches = f_asp

this_filter(nc)%num_pcropp = fl
this_filter(nc)%num_soilnopcropp = fnl ! This wasn't being set before...

Expand Down
2 changes: 2 additions & 0 deletions src/main/histFileMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2997,6 +2997,7 @@ subroutine htape_timeconst(t, mode)
use FatesInterfaceTypesMod, only : fates_hdim_agmap_levagepft
use FatesInterfaceTypesMod, only : fates_hdim_pftmap_levagepft
use FatesInterfaceTypesMod, only : fates_hdim_levfuel
use FatesInterfaceTypesMod, only : fates_hdim_levdamage
use FatesInterfaceTypesMod, only : fates_hdim_levcwdsc
use FatesInterfaceTypesMod, only : fates_hdim_levcan
use FatesInterfaceTypesMod, only : fates_hdim_levleaf
Expand Down Expand Up @@ -3175,6 +3176,7 @@ subroutine htape_timeconst(t, mode)
call ncd_io(varname='fates_levheight',data=fates_hdim_levheight, ncid=nfid(t), flag='write')
call ncd_io(varname='fates_levpft',data=fates_hdim_levpft, ncid=nfid(t), flag='write')
call ncd_io(varname='fates_levfuel',data=fates_hdim_levfuel, ncid=nfid(t), flag='write')
call ncd_io(varname='fates_levcdam',data=fates_hdim_levdamage, ncid=nfid(t), flag='write')
call ncd_io(varname='fates_levcwdsc',data=fates_hdim_levcwdsc, ncid=nfid(t), flag='write')
call ncd_io(varname='fates_levcan',data=fates_hdim_levcan, ncid=nfid(t), flag='write')
call ncd_io(varname='fates_levleaf',data=fates_hdim_levleaf, ncid=nfid(t), flag='write')
Expand Down