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

separate the host parameters file from the fates parameter file #155

Closed
bandre-ucar opened this issue Dec 6, 2016 · 3 comments
Closed
Assignees

Comments

@bandre-ucar
Copy link
Contributor

Summary of Issue:

Separate the host parameters file from the fates parameter file.

Requirements or design considerations:

TBD

@rgknox
Copy link
Contributor

rgknox commented Dec 9, 2016

@bandre-ucar and I checked in on this. I will work on generating the first dedicated fates netcdf file. After that generating the host-fates api and the pre-processor are orthogonal units of work.

@rgknox
Copy link
Contributor

rgknox commented Dec 16, 2016

Here is the current list of FATES parameters that are pulled from the parameter file.

The parameters are associated with four different structures:

    pftcon%    These are CLM PFT parameters that FATES is also using)

    EDParamsShareInst%    These are also pft parameters, and only two of them, and they also seem to be used in fates and CLM)

    EDecophyscon%   These are FATES only PFT variables
    
    ED_val_      These are not in a structure, they just have this name convention.  They are mostly single parameter values, although one of them is pft indexed.

Variable List: (broken into groups, and after each variable it lists the files it is called from)
Variable name in file is in quotes

    EDSharedParamsMod (defined in biogeochem/EDSharedParamsMod.F90)
        EDParamsShareInst%Q10   "q10_mr"
              ./biogeochem/EDPhysiologyMod.F90:
              ./biogeophys/EDPhotosynthesisMod.F90:
        EDParamsShareInst%froz_q10  "froz_q10"
              ./biogeochem/EDPhysiologyMod.F90: 
     EDparamsMod  (defined in main/EDParamsMod.F90:)
          ED_val_grass_spread "grass_spread"
               biogeochem/EDGrowthFunctionsMod.F90:
          ED_val_comp_excln   "comp_excln"
               biogeochem/EDCanopyStructureMod.F90:
         ED_val_stress_mort  "stress_mort"
               biogeochem/EDGrowthFunctionsMod.F90:
          ED_val_dispersal "dispersal"
               (NOT USED)
          ED_val_grperc(maxPft)  "grperc"
               ./biogeochem/EDPhysiologyMod.F90:
               ./biogeophys/EDPhotosynthesisMod.F90:
          ED_val_maxspread  "maxspread"
               ./biogeochem/EDPatchDynamicsMod.F90:
               ./biogeochem/EDCanopyStructureMod.F90:
               ./main/EDInitMod.F90:
          ED_val_minspread "minspread"
               ./biogeochem/EDCanopyStructureMod.F90:
          ED_val_init_litter "init_litter"
               ./main/EDRestVectorMod.F90:  (THIS SEEMS UNNECESSARY)
               ./main/EDInitMod.F90:
          ED_val_nfires "nfires"
               ./fire/SFMainMod.F90
          ED_val_understorey_death "understorey_death"
               ./biogeochem/EDPatchDynamicsMod.F90:
          ED_val_profile_tol "profile_tol"
               (NOT USED)
          ED_val_ag_biomass "ag_biomass"
               ./fire/SFMainMod.F90:
               ./biogeochem/EDPatchDynamicsMod.F90:
               ./biogeochem/EDCohortDynamicsMod.F90:
               ./biogeochem/EDPhysiologyMod.F90:
               ./biogeochem/EDCanopyStructureMod.F90:
               ./main/FatesHistoryInterfaceMod.F90:
               ./biogeophys/EDPhotosynthesisMod.F90:
     EDEcophysConType  (./main/EDEcophysConType.F90:)
          EDecophyscon%max_dbh "max_dbh"
               ./biogeochem/EDPhysiologyMod.F90:
          EDecophyscon%freezetol "freezetol"
               (NOT USED?)
          EDecophyscon%wood_density "wood_density"
               ./biogeochem/EDGrowthFunctionsMod.F90:
          EDecophyscon%alpha_stem "alpha_stem"
               (NOT USED?)
          EDecophyscon%hgt_min "hgt_min"
               ./biogeochem/EDPhysiologyMod.F90:
               ./main/EDInitMod.F90:
          EDecophyscon%cushion "cushion"
               ./biogeochem/EDPhysiologyMod.F90:
               ./main/EDInitMod.F90:
          EDecophyscon%leaf_stor_priority "leaf_stor_priority"
               ./biogeochem/EDPhysiologyMod.F90:
          EDecophyscon%leafwatermax "leafwatermax"
               (NOT USED?)
          EDecophyscon%rootresist "rootresist"
               (NOT USED?)
          EDecophyscon%soilbeta "soilbeta"
               (NOT USED?)
          EDecophyscon%crown "crown"
               ./fire/SFMainMod.F90:
               ./biogeochem/EDCanopyStructureMod.F90:
          EDecophyscon%bark_scaler "bark_scaler"
               ./fire/SFMainMod.F90:
          EDecophyscon%crown_kill "crown_kill"
               ./fire/SFMainMod.F90:
          EDecophyscon%initd "initd"
               ./main/EDInitMod.F90:
          EDecophyscon%sd_mort "sd_mort"
               (NOT USED?)
          EDecophyscon%seed_rain  "seed_rain"
               ./biogeochem/EDPhysiologyMod.F90:
          EDecophyscon%BB_slope  "BB_slope"
               ./biogeophys/EDPhotosynthesisMod.F90:
          EDecophyscon%root_long  "root_long"
               ./biogeochem/EDPhysiologyMod.F90:
          EDecophyscon%seed_alloc  "seed_alloc"
               ./biogeochem/EDPhysiologyMod.F90:
          EDecophyscon%clone_alloc  "clone_alloc"
               ./biogeochem/EDPhysiologyMod.F90:
          EDecophyscon%sapwood_ratio  "sapwood_ratio"
               ./biogeochem/EDCohortDynamicsMod.F90:
               ./biogeochem/EDPhysiologyMod.F90:
               ./main/EDInitMod.F90:
               ./biogeophys/EDPhotosynthesisMod.F90:
      pftcon
          pftcon%woody  "woody"
               ./fire/SFMainMod.F90
               ./biogeochem/EDPatchDynamicsMod.F90:
               ./biogeochem/EDGrowthFunctionsMod.F90
               ./biogeochem/EDCanopyStructureMod.F90:
               ./main/FatesHistoryInterfaceMod.F90:
               ./biogeophys/EDPhotosynthesisMod.F90:
          pftcon%season_decid  "season_decid"
               ./biogeochem/EDCohortDynamicsMod.F90:
               ./biogeochem/EDPhysiologyMod.F90:
               ./main/EDInitMod.F90:
          pftcon%stress_decid  "stress_decid"
               ./biogeochem/EDCohortDynamicsMod.F90:
               ./biogeochem/EDPhysiologyMod.F90:
               ./main/EDRestVectorMod.F90:
               ./main/EDInitMod.F90:
          pftcon%evergreen "evergreen"
               ./biogeochem/EDCohortDynamicsMod.F90:
               ./biogeochem/EDPhysiologyMod.F90:
               ./main/EDInitMod.F90:
          pftcon%froot_leaf "froot_leaf"
               ./biogeochem/EDCohortDynamicsMod.F90:
               ./biogeochem/EDPhysiologyMod.F90:
               ./biogeophys/EDPhotosynthesisMod.F90:
          pftcon%slatop "slatop"
               ./biogeochem/EDGrowthFunctionsMod.F90:
               ./biogeochem/EDPhysiologyMod.F90:
               ./biogeophys/EDPhotosynthesisMod.F90:
          pftcon%leaf_long "leaf_long"
               ./biogeochem/EDPhysiologyMod.F90:
          pftcon%rootprof_beta "rootprof_beta"
               ./biogeochem/EDPhysiologyMod.F90:
          pftcon%roota_par "roota_par"
               ./biogeochem/EDPhysiologyMod.F90:
               ./main/EDTypesMod.F90:
          pftcon%rootb_par "rootb_par"
               ./biogeochem/EDPhysiologyMod.F90:
               ./main/EDTypesMod.F90:
          pftcon%lf_flab  "lf_flab"
               ./biogeochem/EDPhysiologyMod.F90
          pftcon%lf_fcel  "lf_fcel"
               ./biogeochem/EDPhysiologyMod.F90
          pftcon%lf_flig   "lf_flig"
               ./biogeochem/EDPhysiologyMod.F90
          pftcon%fr_flab  "fr_flab"
               ./biogeochem/EDPhysiologyMod.F90
          pftcon%fr_fcel  "fr_fcel"
               ./biogeochem/EDPhysiologyMod.F90
          pftcon%fr_flig  "fr_flig"
               ./biogeochem/EDPhysiologyMod.F90
          pftcon%rhol    "rholvis"  AND "rholnir"
               biogeophys/EDSurfaceAlbedoMod.F90:
          pftcon%rhos  "rhosvis" AND "rhosnir"
               biogeophys/EDSurfaceAlbedoMod.F90:
          pftcon%taul    "taulvis"  AND "taulnir"
               biogeophys/EDSurfaceAlbedoMod.F90:
          pftcon%taus   "tausvis"  AND "tausnir"
               biogeophys/EDSurfaceAlbedoMod.F90:
          pftcon%xl  "xl"
               biogeophys/EDSurfaceAlbedoMod.F90:
          pftcon%c3psn  "c3psn"
               biogeophys/EDPhotosynthesisMod.F90:
          pftcon%flnr  "flnr"
               biogeophys/EDPhotosynthesisMod.F90:
          pftcon%fnitr "fnitr"   CHANGE TO VCMAX25!!!!!
               biogeophys/EDPhotosynthesisMod.F90:
          pftcon%leafcn  "leafcn"
               biogeophys/EDPhotosynthesisMod.F90:
          pftcon%frootcn  "frootcn"
               biogeophys/EDPhotosynthesisMod.F90:
          pftcon%smpsc  "smpsc"
               biogeophys/EDBtranMod.F90:
          pftcon%smpso  "smpso"
               biogeophys/EDBtranMod.F90:

@rgknox
Copy link
Contributor

rgknox commented Dec 16, 2016

I uploaded three files involved in creating a stand-alone netcdf file. Aside from the script and the list (explained below), you need the base netcdf parameter file (clm_params_ed.c160808.nc) and nco installed on your computer. Specifically, you need the "ncks" binary that is part of that package.

This file is a bash script that loops through a list of variables that are copied from the default hlm-fates parameter file, into the stand-alone fates parameter file.

This file is the parameter name list that is read from the bash script (second argument).

This is the result netcdf file I generated from the above mentioned script and transfer list.

bandre-ucar added a commit that referenced this issue Mar 15, 2017
Merge remote-tracking branch 'pr/andre-ed-params'

Introduce an interface to pass parameter information from the host to
fates. Fates registers a set of parameters that it needs read in, and
indicates if they are fates only parameters, or need to be synced with
values from the host. The host reads the parameters and returns them
to fates.

This refactor attempted to be as minimally invasive as possible to the
fates science code. All existing storage and conventions for fates
parameters were left in place. The only exception was the
consolidation of all pft dimensioned parameters into the EDpftvarcon
type. Fates no longer uses variables from the host pftcon type.

This introduces dynamic allocation of pft level parameter in
preparation for setting the number of pfts at run time, but still
requires a hard coded number of pfts until the host code can be
modified.

Note that the default clm and old clm-ed parameter files have diverged
before this work began. To do this development in a bit for bit way,
the clm-ed parameter file was updated to agree with the clm default
parameter file. This is answer changing compared to the fates master
branch, but code was refactored in a bit for bit way. No netcdf
variables were added or removed in this PR.

Fixes: #155, #156

User interface changes?: Yes.

1. Users will need to update custom parameter files. This introduces a
new namelist variable, fates_paramfile. The fates parameters are
**always** read from the netcdf file pointed to by
fates_paramfile. All host parameters are **always** read from the
netcdf file pointed to by paramfile. The host paramfile and fates
paramfile **may** point to the same netcdf file.

2. All fates parameters and dimensions are now name spaced by
'fates_'. The variable names have remained the same, but the dimension
'param' is now 'fates_scalar'. A new default parameter file with the
required changes is available. See fates_params.c170308.nc in the
input data repo.

Code review: self. Discussion with clm-cmt, code walk through with
ckoven, rgknox, rosie

Testing:

  andre: 2017-03-14

    Test suite: ed - yellowstone gnu, intel, pgi
                     hobart nag
    Test baseline: 0ea3fed
    Test namelist changes: addition of fates_paramfile
    Test answer changes: bit for bit
    Test status: all tests pass

    Test suite: clm_short - yellowstone gnu, intel, pgi
    Test baseline: clm4_5_12_r195
    Test namelist changes: none
    Test answer changes: bit for bit
    Test status: all tests pass
rgknox pushed a commit that referenced this issue Apr 21, 2017
The fates parameter file is now specified via a separate namelist
fates_paramfile. This variable may or may not point to the same netcdf
file as the host parameter file. All fates parameters are read from
this file, including the pft level variables, which are now stored in
EDpftvarcon instead of pftcon. Note that some parameters are shared
between the host and fates. These are 'host' parameters, not fates
parameters and are read from the host file.

Work for NGT-ED Github issue #155

User interface changes?: Yes. Users who have custom parameter files
will need to set namelist varible 'fates_paramfile' to point to their
file instead. Host parameters are still read from the file specified
by namelist variable 'paramfile'. If users have modified host
parameters in addition to fates parameters, they will need to update
both namelist variables.

Code review: andre

Test suite: clm_short
Test baseline: clm4_5_12_r195
Test namelist changes: none
Test answer changes: bit for bit
Test summary: all tests pass

Test suite: ed - yellowstone gnu, intel, pgi
Test baseline: a651a4f
Test namelist changes: yes, new namilest var fates_paramfile
Test answer changes: bit for bit
Test summary: all tests pass
rgknox pushed a commit that referenced this issue May 23, 2017
The fates parameter file is now specified via a separate namelist
fates_paramfile. This variable may or may not point to the same netcdf
file as the host parameter file. All fates parameters are read from
this file, including the pft level variables, which are now stored in
EDpftvarcon instead of pftcon. Note that some parameters are shared
between the host and fates. These are 'host' parameters, not fates
parameters and are read from the host file.

Work for NGT-ED Github issue #155

User interface changes?: Yes. Users who have custom parameter files
will need to set namelist varible 'fates_paramfile' to point to their
file instead. Host parameters are still read from the file specified
by namelist variable 'paramfile'. If users have modified host
parameters in addition to fates parameters, they will need to update
both namelist variables.

Code review: andre

Test suite: clm_short
Test baseline: clm4_5_12_r195
Test namelist changes: none
Test answer changes: bit for bit
Test summary: all tests pass

Test suite: ed - yellowstone gnu, intel, pgi
Test baseline: a651a4f
Test namelist changes: yes, new namilest var fates_paramfile
Test answer changes: bit for bit
Test summary: all tests pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants