Skip to content

Commit

Permalink
Merge remote-tracking branch 'escomp/master' into new_params_file
Browse files Browse the repository at this point in the history
  • Loading branch information
slevis-lmwg committed Nov 18, 2023
2 parents f185a31 + d81bff2 commit 6dc1966
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 69 deletions.
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.68.2_api.30.0.0
tag = sci.1.68.2_api.31.0.0
required = True

[externals_description]
Expand Down
22 changes: 1 addition & 21 deletions cime_config/testdefs/ExpectedTestFails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,6 @@

<!-- fates test suite failures -->

<test name="ERS_Lm12.1x1_brazil.I2000Clm50FatesCruRsGs.cheyenne_intel.clm-FatesFireLightningPopDens">
<phase name="COMPARE_base_rest">
<status>FAIL</status>
<issue>#667</issue>
</phase>
</test>

<test name="ERS_Lm13.f45_f45_mg37.I2000Clm50Fates.cheyenne_intel.clm-FatesColdNoComp">
<phase name="COMPARE_base_rest">
<status>FAIL</status>
<issue>FATES#897</issue>
</phase>
</test>

<test name="ERS_Lm13.f10_f10_mg37.I2000Clm50Fates.cheyenne_gnu.clm-FatesCold">
<phase name="COMPARE_base_rest">
<status>FAIL</status>
<issue>FATES#897</issue>
</phase>
</test>

<test name="ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdHydro">
<phase name="COMPARE_base_rest">
Expand All @@ -103,7 +83,7 @@

<test name="ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdPRT2">
<phase name="RUN">
<status>FAIL</status>
<status>PEND</status>
<issue>FATES#983</issue>
<comment>This job should time out on izumi, seems to be hanging on history output.</comment>
</phase>
Expand Down
2 changes: 2 additions & 0 deletions cime_config/usermods_dirs/NEON/FATES/defaults/shell_commands
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ fi

# Explicitly set PIO Type to NETCDF since this is a single processor case (should already be set this way)
./xmlchange PIO_TYPENAME=netcdf

./xmlchange NEONVERSION="v2"
2 changes: 2 additions & 0 deletions cime_config/usermods_dirs/NEON/defaults/shell_commands
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ fi

# Explicitly set PIO Type to NETCDF since this is a single processor case (should already be set this way)
./xmlchange PIO_TYPENAME=netcdf

./xmlchange NEONVERSION="v2"
65 changes: 65 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,69 @@
===============================================================
Tag name: ctsm5.1.dev153
Originator(s): afoster (Adrianna Foster) and johnpaulalex (John Paul Alex)
Date: Fri Nov 17 11:53:14 MST 2023
One-line Summary: Call new FATES-side FatesReadParameters

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

Have CTSM use the new code path in FATES that allows passing in a `fates_param_reader_type`, which does the actual work reading the parameter files, in lieu of calling CTSM methods.

Also updated NEON usermods to use version 2 data by default, rather than latest.

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.)


[ ] clm5_1

[ ] clm5_0

[ ] ctsm5_0-nwp

[ ] clm4_5

Bugs fixed or introduced
------------------------

Some progress towards CTSM#2006 and FATES#1076

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

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

fates baseline: `fates-sci.1.68.2_api.31.0.0-ctsm5.1.dev153`


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

None


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

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

Pull Requests that document the changes (include PR ids):
https://github.com/NGEET/fates/pull/1096
https://github.com/ESCOMP/CTSM/pull/2198


===============================================================
===============================================================
Tag name: ctsm5.1.dev152
Originator(s): multiple (tking (Teagan King); slevis (Sam Levis); AdrienDams (Adrien Damseaux); afoster (Adrianna Foster); samrabin (Sam Rabin); ekluzek (Erik Kluzek); wwieder (Will Wieder); sacks (Bill Sacks); a few others listed below)
Date: Tue Nov 14 17:09:43 MST 2023
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.dev153 afoster 11/17/2023 Call new FATES-side FatesReadParameters
ctsm5.1.dev152 multiple 11/14/2023 Mv tools to /python and add tests; add snow_thermal_cond_method; a few fixes / refactors
ctsm5.1.dev151 rgknox 11/11/2023 Fixes to FATES long run restarts
ctsm5.1.dev150 rgknox 11/06/2023 FATES API fix to support future fates npp-fixation coupling, and urgent coupling fixes with E3SM.
Expand Down
19 changes: 13 additions & 6 deletions src/utils/clmfates_interfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ module CLMFatesInterfaceMod
!
! This is also the only location where CLM code is allowed to see FATES memory
! structures.
! The routines here, that call FATES library routines, will not pass any types defined
! by the driving land model (HLM).
!
! either native type arrays (int,real,log, etc) or packed into fates boundary condition
! structures.
! The routines here, that call FATES library routines, cannot pass most types defined
! by the driving land model (HLM), only native type arrays (int,real,log, etc), implementations
! of fates abstract classes, and references into fates boundary condition structures.
!
! Note that CLM/ALM does use Shared Memory Parallelism (SMP), where processes such as
! the update of state variables are forked. However, IO is not assumed to be
Expand Down Expand Up @@ -112,6 +110,7 @@ module CLMFatesInterfaceMod
use shr_log_mod , only : errMsg => shr_log_errMsg
use clm_varcon , only : dzsoi_decomp
use FuncPedotransferMod, only: get_ipedof
use CLMFatesParamInterfaceMod, only: fates_param_reader_ctsm_impl
! use SoilWaterPlantSinkMod, only : Compute_EffecRootFrac_And_VertTranSink_Default

! Used FATES Modules
Expand All @@ -128,6 +127,10 @@ module CLMFatesInterfaceMod
use FatesInterfaceMod , only : set_fates_ctrlparms
use FatesInterfaceMod , only : UpdateFatesRMeansTStep
use FatesInterfaceMod , only : InitTimeAveragingGlobals

use FatesParametersInterface, only : fates_param_reader_type
use FatesParametersInterface, only : fates_parameters_type

use FatesInterfaceMod , only : DetermineGridCellNeighbors

use FatesHistoryInterfaceMod, only : fates_hist
Expand Down Expand Up @@ -283,6 +286,7 @@ subroutine CLMFatesGlobals1(surf_numpft,surf_numcft,maxsoil_patches)
integer :: pass_sp
integer :: pass_masterproc
logical :: verbose_output
type(fates_param_reader_ctsm_impl) :: var_reader

call t_startf('fates_globals1')

Expand Down Expand Up @@ -326,6 +330,7 @@ subroutine CLMFatesGlobals1(surf_numpft,surf_numcft,maxsoil_patches)

end if


! The following call reads in the parameter file
! and then uses that to determine the number of patches
! FATES requires. We pass that to CLM here
Expand All @@ -334,7 +339,7 @@ subroutine CLMFatesGlobals1(surf_numpft,surf_numcft,maxsoil_patches)
! and allocations on the FATES side, which require
! some allocations from CLM (like soil layering)

call SetFatesGlobalElements1(use_fates,surf_numpft,surf_numcft)
call SetFatesGlobalElements1(use_fates,surf_numpft,surf_numcft,var_reader)

maxsoil_patches = fates_maxPatchesPerSite

Expand Down Expand Up @@ -3590,4 +3595,6 @@ subroutine GetAndSetTime()

end subroutine GetAndSetTime

!-----------------------------------------------------------------------

end module CLMFatesInterfaceMod
76 changes: 35 additions & 41 deletions src/utils/clmfates_paraminterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,30 @@ module CLMFatesParamInterfaceMod
use shr_kind_mod, only : r8 => shr_kind_r8, SHR_KIND_CL
use FatesGlobals, only : fates_log
use FatesParametersInterface, only : fates_parameters_type
use FatesParametersInterface, only : fates_param_reader_type
use EDParamsMod, only : FatesRegisterParams, FatesReceiveParams
use SFParamsMod, only : SpitFireRegisterParams, SpitFireReceiveParams
use PRTInitParamsFATESMod, only : PRTRegisterParams, PRTReceiveParams
use FatesSynchronizedParamsMod, only : FatesSynchronizedParamsInst

implicit none
public :: fates_param_reader_ctsm_impl
!
type, extends(fates_param_reader_type) :: fates_param_reader_ctsm_impl
private

! NOTE(bja, 2017-01) these methods can NOT be part of the clmi-fates
! nterface type because they are called before the instance is
! !PRIVATE MEMBER DATA:

contains
! !PUBLIC MEMBER FUNCTIONS:
procedure, public :: Read ! Read params from disk

end type fates_param_reader_ctsm_impl


! NOTE(bja, 2017-01) these methods can NOT be part of the clm-fates
! interface type because they are called before the instance is
! initialized.
public :: FatesReadParameters
public :: FatesReadPFTs
private :: ParametersFromNetCDF
private :: SetParameterDimensions
Expand All @@ -28,44 +41,6 @@ module CLMFatesParamInterfaceMod

contains

!-----------------------------------------------------------------------
subroutine FatesReadParameters()
use clm_varctl, only : use_fates, paramfile, fates_paramfile
use spmdMod, only : masterproc

implicit none

character(len=32) :: subname = 'FatesReadParameters'
class(fates_parameters_type), allocatable :: fates_params
logical :: is_host_file

if (masterproc) then
write(fates_log(), *) 'clmfates_interfaceMod.F90::'//trim(subname)//' :: CLM reading ED/FATES '//' parameters '
end if

allocate(fates_params)
call fates_params%Init() ! fates_params class, in FatesParameterInterfaceMod
call FatesRegisterParams(fates_params) !EDParamsMod, only operates on fates_params class
call SpitFireRegisterParams(fates_params) !SpitFire Mod, only operates of fates_params class
call PRTRegisterParams(fates_params) ! PRT mod, only operates on fates_params class
call FatesSynchronizedParamsInst%RegisterParams(fates_params) !Synchronized params class in Synchronized params mod, only operates on fates_params class

is_host_file = .false.
call ParametersFromNetCDF(fates_paramfile, is_host_file, fates_params)

is_host_file = .true.
call ParametersFromNetCDF(paramfile, is_host_file, fates_params)

call FatesReceiveParams(fates_params)
call SpitFireReceiveParams(fates_params)
call PRTReceiveParams(fates_params)
call FatesSynchronizedParamsInst%ReceiveParams(fates_params)

call fates_params%Destroy()
deallocate(fates_params)

end subroutine FatesReadParameters

!-----------------------------------------------------------------------
subroutine FatesReadPFTs()

Expand Down Expand Up @@ -238,4 +213,23 @@ subroutine ParametersFromNetCDF(filename, is_host_file, fates_params)
end subroutine ParametersFromNetCDF
!-----------------------------------------------------------------------

subroutine Read(this, fates_params )
!
! !DESCRIPTION:
! Read 'fates_params' parameters from storage.
!
! USES
use clm_varctl, only : fname_len, paramfile, fates_paramfile
! !ARGUMENTS:
class(fates_param_reader_ctsm_impl) :: this
class(fates_parameters_type), intent(inout) :: fates_params
!-----------------------------------------------------------------------
logical :: is_host_file = .false.

call ParametersFromNetCDF(fates_paramfile, is_host_file, fates_params)

end subroutine Read

!-----------------------------------------------------------------------

end module CLMFatesParamInterfaceMod

0 comments on commit 6dc1966

Please sign in to comment.