-
Notifications
You must be signed in to change notification settings - Fork 341
FATES JSON parameter files #3570
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
base: master
Are you sure you want to change the base?
Changes from all commits
71e5d91
4f88906
4a59e01
96459bc
632c9bc
4dbe613
1942849
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -576,10 +576,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). | |
|
|
||
| <!-- ================================================================== --> | ||
| <!-- FATES default parameter file --> | ||
| <!-- path is relative to the land root (ie the path to CTSM) --> | ||
| <!-- ================================================================== --> | ||
|
|
||
| <fates_paramfile>lnd/clm2/paramdata/fates_params_api.41.0.0_14pft_c250813.nc</fates_paramfile> | ||
|
|
||
| <fates_paramfile>src/fates/parameter_files/fates_params_default.json</fates_paramfile> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm. Interesting. Currently we assume that anything with a relative path is under $DIN_LOC_ROOT. But, here we need to point out that it's under LANDROOT. So we should probably add an attribute to say that here. |
||
|
|
||
| <!-- ================================================================== --> | ||
| <!-- Default surface roughness parameterization --> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1016,7 +1016,7 @@ constants for biogeochem modules | |
| </entry> | ||
|
|
||
| <entry id="fates_paramfile" type="char*512" category="datasets" | ||
| input_pathname="abs" group="clm_inparm" valid_values="" > | ||
| input_pathname="landroot" group="clm_inparm" valid_values="" > | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahhh, here is where you are pointing out that it's under landroot. |
||
| Full pathname datafile with fates parameters | ||
| (Only relevant if FATES is on). | ||
| </entry> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -418,17 +418,4 @@ | |
| <issue>#3494</issue> | ||
| </phase> | ||
| </test> | ||
|
|
||
| <test name="ERI_D_Ld9.f45_f45_mg37.I2000Clm60FatesSpCruRsGs.derecho_gnu.clm-FatesColdSatPhenCamLndTuningMode"> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fixes these two tests? Or is this something that was fixed with the nextsw change, that just didn't get these removed from ExpectedFails? |
||
| <phase name="COMPARE_base_rest"> | ||
| <status>FAIL</status> | ||
| <issue>#3496</issue> | ||
| </phase> | ||
| </test> | ||
| <test name="ERI_D_Ld9.f45_f45_mg37.I2000Clm60FatesSpCruRsGs.derecho_intel.clm-FatesColdSatPhenCamLndTuningMode"> | ||
| <phase name="RUN"> | ||
| <status>FAIL</status> | ||
| <issue>#3507</issue> | ||
| </phase> | ||
| </test> | ||
| </expectedFails> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,13 @@ | ||
| SRCDIR=`./xmlquery SRCROOT --value` | ||
| CASEDIR=`./xmlquery CASEROOT --value` | ||
| FATESDIR=$SRCDIR/src/fates/ | ||
| FATESPARAMFILE=$CASEDIR/fates_params_prt2_prescribed_np.nc | ||
|
|
||
| ncgen -o $FATESPARAMFILE $FATESDIR/parameter_files/fates_params_default.cdl | ||
| FATESPARAMFILE=$CASEDIR/fates_params_prt2_prescribed_np.json | ||
|
|
||
| $FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_cnp_prescribed_nuptake --val 1.0 --allpfts | ||
| cp $FATESDIR/parameter_files/fates_params_default.json $FATESPARAMFILE | ||
|
|
||
| $FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_cnp_prescribed_puptake --val 1.0 --allpfts | ||
| $FATESDIR/tools/modify_fates_paramfile.py --overwrite --fin $FATESPARAMFILE --param fates_cnp_prescribed_nuptake --values 1.0 --indices all | ||
|
|
||
| $FATESDIR/tools/modify_fates_paramfile.py --overwrite --fin $FATESPARAMFILE --param fates_cnp_prescribed_puptake --values 1.0 --indices all | ||
|
|
||
| echo "fates_paramfile = '$FATESPARAMFILE'" >> $CASEDIR/user_nl_clm | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a bit concerned about this bit about adding it to the end of the user_nl_clm. A small thing is that each time shell_commands is run it'll append it to the end again. It still works -- but looks a bit strange. But, putting it here could conflict with what the user adds to a test case. Since, it is a test case that seems unlikely -- but I wonder about unintended consequences. This is a part that can be removed when we can move forward on the plan to move fates parameter file handling into buildnml. So it's likely fine to do as a first step. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,14 @@ | ||
| SRCDIR=`./xmlquery SRCROOT --value` | ||
| CASEDIR=`./xmlquery CASEROOT --value` | ||
| FATESDIR=$SRCDIR/src/fates/ | ||
| FATESPARAMFILE=$CASEDIR/fates_params_seeddisp_4x5.nc | ||
|
|
||
| ncgen -o $FATESPARAMFILE $FATESDIR/parameter_files/fates_params_default.cdl | ||
| FATESPARAMFILE=$CASEDIR/fates_params_seeddisp_4x5.json | ||
|
|
||
| $FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_seed_dispersal_fraction --val 0.2 --allpfts | ||
| $FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_seed_dispersal_max_dist --val 2500000 --allpfts | ||
| $FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_seed_dispersal_pdf_scale --val 1e-05 --allpfts | ||
| $FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_seed_dispersal_pdf_shape --val 0.1 --allpfts | ||
| cp $FATESDIR/parameter_files/fates_params_default.json $FATESPARAMFILE | ||
|
|
||
| $FATESDIR/tools/modify_fates_paramfile.py --overwrite --fin $FATESPARAMFILE --param fates_seed_dispersal_fraction --values 0.2 --indices all | ||
| $FATESDIR/tools/modify_fates_paramfile.py --overwrite --fin $FATESPARAMFILE --param fates_seed_dispersal_max_dist --values 2500000 --indices all | ||
| $FATESDIR/tools/modify_fates_paramfile.py --overwrite --fin $FATESPARAMFILE --param fates_seed_dispersal_pdf_scale --values 1e-05 --indices all | ||
| $FATESDIR/tools/modify_fates_paramfile.py --overwrite --fin $FATESPARAMFILE --param fates_seed_dispersal_pdf_shape --values 0.1 --indices all | ||
|
|
||
| echo "fates_paramfile = '$FATESPARAMFILE'" >> $CASEDIR/user_nl_clm |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ module CLMFatesInterfaceMod | |
| #include "shr_assert.h" | ||
| use PatchType , only : patch | ||
| use shr_kind_mod , only : r8 => shr_kind_r8 | ||
| use shr_file_mod , only : shr_file_getUnit,shr_file_freeUnit | ||
| use decompMod , only : bounds_type, subgrid_level_column | ||
| use WaterStateBulkType , only : waterstatebulk_type | ||
| use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type | ||
|
|
@@ -128,12 +129,10 @@ 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 | ||
| use FatesInterfaceMod , only : fates_interface_type | ||
| use FatesInterfaceMod, only : FatesInterfaceInit, FatesReportParameters | ||
| use FatesInterfaceMod, only : FatesInterfaceInit | ||
| use FatesInterfaceMod, only : SetFatesGlobalElements1 | ||
| use FatesInterfaceMod, only : SetFatesGlobalElements2 | ||
| use FatesInterfaceMod , only : allocate_bcin | ||
|
|
@@ -145,10 +144,7 @@ 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 clm_varctl , only : fates_paramfile | ||
| use FatesInterfaceMod , only : DetermineGridCellNeighbors | ||
| use FatesHistoryInterfaceMod, only : fates_hist | ||
| use FatesRestartInterfaceMod, only : fates_restart_interface_type | ||
|
|
@@ -311,16 +307,16 @@ subroutine CLMFatesGlobals1(surf_numpft,surf_numcft,maxsoil_patches) | |
| ! in CTSM | ||
| ! -------------------------------------------------------------------------------- | ||
|
|
||
| integer,intent(in) :: surf_numpft | ||
| integer,intent(in) :: surf_numcft | ||
| integer,intent(out) :: maxsoil_patches | ||
| integer :: pass_use_fixed_biogeog | ||
| integer :: pass_use_nocomp | ||
| integer :: pass_use_sp | ||
| integer :: pass_masterproc | ||
| integer :: pass_use_luh2 | ||
| logical :: verbose_output | ||
| type(fates_param_reader_ctsm_impl) :: var_reader | ||
| integer,intent(in) :: surf_numpft | ||
| integer,intent(in) :: surf_numcft | ||
| integer,intent(out) :: maxsoil_patches | ||
| integer :: pass_use_fixed_biogeog | ||
| integer :: pass_use_nocomp | ||
| integer :: pass_use_sp | ||
| integer :: pass_masterproc | ||
| integer :: pass_use_luh2 | ||
| logical :: verbose_output | ||
| integer :: fates_paramfile_unit | ||
|
|
||
| call t_startf('fates_globals1') | ||
|
|
||
|
|
@@ -369,10 +365,12 @@ subroutine CLMFatesGlobals1(surf_numpft,surf_numcft,maxsoil_patches) | |
| pass_use_luh2 = 0 | ||
| end if | ||
| call set_fates_ctrlparms('use_luh2',ival=pass_use_luh2) | ||
|
|
||
|
|
||
| call set_fates_ctrlparms('parteh_mode',ival=fates_parteh_mode) | ||
|
|
||
| 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 | ||
|
|
@@ -381,8 +379,20 @@ 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,var_reader) | ||
|
|
||
| !------------------------------------------------------------------------ | ||
|
|
||
| ! It is FATES' job to open and close the file | ||
| ! This step is simply to provide a unit number to use | ||
| fates_paramfile_unit = shr_file_getUnit() | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shr_file_getUnit is actually deprecated now that Fortran has built-in file unit management. When you use open to open a file you can use newunit= to get a free unit. So it simplifies how this is done. |
||
|
|
||
| !call opnfil (locfn, iun, form) | ||
| !call getfil(fates_paramfile, locfn, 0) | ||
|
|
||
| call SetFatesGlobalElements1(use_fates,surf_numpft,surf_numcft,fates_paramfile,fates_paramfile_unit) | ||
|
|
||
| call shr_file_freeUnit(fates_paramfile_unit) | ||
|
|
||
| maxsoil_patches = fates_maxPatchesPerSite | ||
|
|
||
| call t_stopf('fates_globals1') | ||
|
|
@@ -436,22 +446,15 @@ subroutine CLMFatesGlobals2() | |
|
|
||
| if (use_fates) then | ||
|
|
||
|
|
||
|
|
||
| ! Send parameters individually | ||
| call set_fates_ctrlparms('num_sw_bbands',ival=numrad) | ||
| call set_fates_ctrlparms('vis_sw_index',ival=ivis) | ||
| call set_fates_ctrlparms('nir_sw_index',ival=inir) | ||
|
|
||
| call set_fates_ctrlparms('num_lev_soil',ival=nlevsoi) | ||
| call set_fates_ctrlparms('hlm_name',cval='CLM') | ||
| call set_fates_ctrlparms('hio_ignore_val',rval=spval) | ||
| call set_fates_ctrlparms('soilwater_ipedof',ival=get_ipedof(0)) | ||
|
|
||
| call set_fates_ctrlparms('parteh_mode',ival=fates_parteh_mode) | ||
| call set_fates_ctrlparms('seeddisp_cadence',ival=fates_seeddisp_cadence) | ||
|
|
||
|
|
||
| call set_fates_ctrlparms('hist_hifrq_dimlevel',ival=fates_history_dimlevel(1)) | ||
| call set_fates_ctrlparms('hist_dynam_dimlevel',ival=fates_history_dimlevel(2)) | ||
|
|
||
|
|
@@ -1036,9 +1039,13 @@ subroutine init(this, bounds_proc, flandusepftdat) | |
|
|
||
| call this%init_history_io(bounds_proc) | ||
|
|
||
| ! Report Fates Parameters (debug flag in lower level routines) | ||
| call FatesReportParameters(masterproc) | ||
|
|
||
| ! Check through FATES parameters | ||
| ! THis step is performed after the parameter | ||
| ! reads because we need to cross-reference | ||
| ! these against namelist settings | ||
| !call FatesCheckParameters(masterproc) | ||
|
|
||
|
|
||
| ! Fire data to send to FATES | ||
| call create_fates_fire_data_method( this%fates_fire_data_method ) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't need to send landroot in, as we should be able to get it from information already in CLMBuildNamelist.pm