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

Modularize snow cover fraction method #769

Merged
merged 47 commits into from
Aug 6, 2019

Commits on Jul 10, 2019

  1. Ensure that user doesn't try to turn on both oldfflag and subgridflag

    These options are incompatible.
    
    Partially addresses ESCOMP#502
    billsacks committed Jul 10, 2019
    Configuration menu
    Copy the full SHA
    cde7257 View commit details
    Browse the repository at this point in the history
  2. Rename subgridflag to use_subgrid_fluxes

    Also, fix error checks involving use_subgrid_fluxes in CLMBuildNamelist:
    previously, subgridflag was not set at the point when the error checks
    involving that value were being done; I have fixed that by always
    including use_subgrid_fluxes in the default namelist.
    
    Resolves ESCOMP#502
    billsacks committed Jul 10, 2019
    Configuration menu
    Copy the full SHA
    d8d2a2d View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2019

  1. Split loop

    Testing:
    SMS_D_Ld1_P4x1.f10_f10_musgs.I2000Clm50BgcCropQianRsGs.bishorn_gnu.clm-default
    passes and bit-for-bit
    billsacks committed Jul 22, 2019
    Configuration menu
    Copy the full SHA
    18cd14a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6c34aa7 View commit details
    Browse the repository at this point in the history
  3. Move int_snow update to later

    This will facilitate upcoming refactoring
    
    Testing:
    SMS_D_Ld1_P4x1.f10_f10_musgs.I2000Clm50BgcCropQianRsGs.bishorn_gnu.clm-default
    passes and is bit-for-bit
    billsacks committed Jul 22, 2019
    Configuration menu
    Copy the full SHA
    40abe78 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d198fe8 View commit details
    Browse the repository at this point in the history
  5. Another loop splitting

    This will facilitate upcoming refactoring
    billsacks committed Jul 22, 2019
    Configuration menu
    Copy the full SHA
    20b6dca View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2019

  1. Configuration menu
    Copy the full SHA
    7d57070 View commit details
    Browse the repository at this point in the history
  2. Make oldhyd test have diagnostic output

    Make oldhyd inherit from default so that it has some output in a one-day
    test
    billsacks committed Jul 25, 2019
    Configuration menu
    Copy the full SHA
    474ecf3 View commit details
    Browse the repository at this point in the history
  3. Add a Clm45 compset for testing

    I plan to use this for testing on my laptop, specifically with the test:
    
    SMS_D_Ld1_P4x1.f10_f10_musgs.I2000Clm45BgcCropQianRsGs.bishorn_gnu.clm-oldhyd
    billsacks committed Jul 25, 2019
    Configuration menu
    Copy the full SHA
    58fb33d View commit details
    Browse the repository at this point in the history
  4. Put an int_snow update in its own routine

    This will be done differently for different snow cover methods, so it
    will be part of the snow_cover_fraction polymorphic class.
    billsacks committed Jul 25, 2019
    Configuration menu
    Copy the full SHA
    2f9efe8 View commit details
    Browse the repository at this point in the history
  5. Extract function to compute frac_sno during melt

    This will be called from SnowCompaction, too
    billsacks committed Jul 25, 2019
    Configuration menu
    Copy the full SHA
    8bb9ea3 View commit details
    Browse the repository at this point in the history
  6. Remove duplicated code by using new function from SnowCompaction

    There was a minor difference between the formulation in SnowCompaction
    and the one in FracSnowDuringMeltClm5: the latter has an extra min
    statement. It looks like this shouldn't change answers (the min
    statement shouldn't be necessary, given the min that is already applied
    to smr), but it's possible that it will change answers by roundoff in
    rare cases.
    billsacks committed Jul 25, 2019
    Configuration menu
    Copy the full SHA
    9c80612 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2019

  1. Configuration menu
    Copy the full SHA
    638d636 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    95b6212 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    dedbb90 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    176c92c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    be00046 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4de1302 View commit details
    Browse the repository at this point in the history
  7. Add class for N&Y07 snow cover fraction method

    This isn't actually used yet in the code, and the two most important
    methods are just stubs.
    billsacks committed Jul 26, 2019
    Configuration menu
    Copy the full SHA
    7d44d44 View commit details
    Browse the repository at this point in the history
  8. Move oldfflag to clm_varctl

    I needed to move it out of SnowHydrologyMod because it will now be used
    in SnowCoverFractionMod. I thought about reading it in in the factory
    method in SnowCoverFractionMod, but I prefer having this (and other
    similar control flags that we might need in the future) in clm_varctl
    for a few reasons:
    
    - It avoids introducing a whole new namelist group and a new namelist
      read routine just to hold and read this one variable
    
    - It makes the interface of the factory method more clear, in that we'll
      pass in the method directly
    
    - I like the idea of having these big controls (determining relatively
      big parameterizations) all be in one namelist group for the sake of
      build-namelist: we can ensure that we read this namelist group first,
      then do some other logic based on things set there (see also
      ESCOMP#26 (comment))
    billsacks committed Jul 26, 2019
    Configuration menu
    Copy the full SHA
    e68492a View commit details
    Browse the repository at this point in the history
  9. Use correct snow cover fraction method

    We still have to move some code from SnowHydrologyMod into
    SnowCoverFractionMod for the N&Y07 method
    billsacks committed Jul 26, 2019
    Configuration menu
    Copy the full SHA
    c2193c6 View commit details
    Browse the repository at this point in the history
  10. Move n&y07 implementation into its final home

    Move the code out of SnowHydrologyMod, into SnowCoverFractionMod
    billsacks committed Jul 26, 2019
    Configuration menu
    Copy the full SHA
    e0ef720 View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2019

  1. Move error check

    It's clearer to have the error check more closely associated with the
    relevant code.
    billsacks committed Jul 27, 2019
    Configuration menu
    Copy the full SHA
    c9bfca8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0026717 View commit details
    Browse the repository at this point in the history
  3. Remove fixme notes

    I have confirmed that, in clm4_0_00, the update of snowdp looked like:
    
              dz_snowf = qflx_snow_grnd_col(c)/bifall
              snowdp(c) = snowdp(c) + dz_snowf*dtime
    billsacks committed Jul 27, 2019
    Configuration menu
    Copy the full SHA
    b53b911 View commit details
    Browse the repository at this point in the history
  4. Change oldfflag to a string option, snow_cover_fraction_method

    Also fix build-namelist error checking of compatibility with
    use_subgrid_fluxes
    billsacks committed Jul 27, 2019
    Configuration menu
    Copy the full SHA
    bb3dc6e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fcaae88 View commit details
    Browse the repository at this point in the history
  6. Remove unnecessary use

    billsacks committed Jul 27, 2019
    Configuration menu
    Copy the full SHA
    d17ba01 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2019

  1. Add empty constructors for snow cover fraction types

    This fixes the error on cheyenne_intel related to trying to allocate an
    array (n_melt) that is already allocated.
    billsacks committed Jul 30, 2019
    Configuration menu
    Copy the full SHA
    fe169f7 View commit details
    Browse the repository at this point in the history
  2. Add LWISO test

    This tests that adding water isotopes does not change answers
    
    This is not yet passing
    billsacks committed Jul 30, 2019
    Configuration menu
    Copy the full SHA
    8a38027 View commit details
    Browse the repository at this point in the history
  3. Tweak LWISO test

    1. Make 'base' case have water isotopes on. This way the baselines
       include water isotopes, which is nice for having stronger baseline
       comparisons.
    
    2. For now, use enable_water_tracer_consistency_checks rather than
       enable_water_isotopes. I hope to revert this later, but this seems
       needed for now in order for the test to run to completion.
    billsacks committed Jul 30, 2019
    Configuration menu
    Copy the full SHA
    8cf07e8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    dbd3264 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2019

  1. Configuration menu
    Copy the full SHA
    7ea3798 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    54d8ed0 View commit details
    Browse the repository at this point in the history
  3. Add test w/ new snow cover fraction method but use_subgrid_fluxes false

    This covers some code that isn't covered by any existing tests (such as
    the oldhyd test), though the amount of additional code coverage is
    small, so we don't necessarily need to keep this test long-term.
    billsacks committed Jul 31, 2019
    Configuration menu
    Copy the full SHA
    46e7cb7 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2019

  1. Merge remote-tracking branch 'escomp/master' into oldfflag_cleanup

    Resolved Conflicts:
    	cime_config/testdefs/testlist_clm.xml
    	src/main/controlMod.F90
    billsacks committed Aug 4, 2019
    Configuration menu
    Copy the full SHA
    b655a70 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3daf306 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ebe1c1e View commit details
    Browse the repository at this point in the history
  4. Refactor UpdateSnowDepthAndFracNY07 to remove redundancy

    This has the theoretical potential to change answers under the following
    conditions:
    
    - Now frac_sno is being explicitly reset to 0; before, under some
      conditions (h2osno_total > 0, but snow_depth <= 0), frac_sno would
      remain at its old value.
    
    - If h2osno_total or newsnow are ever negative, we could have different
      answers
    
    A one-day
    test (SMS_D_Ld1_P4x1.f10_f10_musgs.I2000Clm45BgcCropQianRsGs.bishorn_gnu.clm-oldhyd)
    is still bit-for-bit; I'll run a 3-year test next.
    billsacks committed Aug 4, 2019
    Configuration menu
    Copy the full SHA
    24ffe4e View commit details
    Browse the repository at this point in the history
  5. Rename CLM5 method to SL12

    This is from Swenson & Lawrence 2012
    billsacks committed Aug 4, 2019
    Configuration menu
    Copy the full SHA
    eaec48a View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2019

  1. Use longer names for parameterization names

    Sean Swenson and others suggested using these longer names rather than
    the more cryptic short abbreviations. Part of the motivation is once we
    have 4 separate files, this will make the science modules stand out more
    because of their longer names.
    
    I wanted to name the namelist group scf_SwensonLawrence2012_inparm for
    consistency with the namelist option, but this didn't work with the
    namelist generation scripts, presumably because of the capitalization;
    so I'm using the all-lowercase form, scf_swenson_lawrence_2012_inparm.
    billsacks committed Aug 5, 2019
    Configuration menu
    Copy the full SHA
    3d0137e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cb560be View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2019

  1. Allow snow cover fraction types to have different init interfaces

    Since the init method is only called from the factory method, it's
    fairly straightforward to allow the different init methods to have
    different interfaces, rather than having a bunch of unused arguments in
    some of the methods. The big motivation here is avoiding the need to
    change all parameterizations' Init methods if you add a new
    parameterization with a new input requirement.
    
    This ended up being a little non-trivial because of the need for the
    select type statement. I think we could have avoided that if we did all
    initialization in the constructor (avoiding an Init method
    entirely). But we have had some compilers (e.g., intel17) that don't
    seem to work right with function constructors, so for now we're sticking
    with an Init subroutine.
    billsacks committed Aug 6, 2019
    Configuration menu
    Copy the full SHA
    9ca0439 View commit details
    Browse the repository at this point in the history
  2. Put science routines before infrastructure routines

    Sean Swenson pointed out that it would be better to put the science up
    front.
    billsacks committed Aug 6, 2019
    Configuration menu
    Copy the full SHA
    03cb6d4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b3d3b1a View commit details
    Browse the repository at this point in the history
  4. Update ChangeLog

    billsacks committed Aug 6, 2019
    Configuration menu
    Copy the full SHA
    6c91dff View commit details
    Browse the repository at this point in the history