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

Adding excess ground ice to CTSM #1787

Merged
merged 103 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
f84f1cc
add namelist definitions and defaults to use excess ice
mvdebolskiy Jan 19, 2022
3feb457
setup initialization and vars
mvdebolskiy Jan 25, 2022
21fca41
exice streams namelists and initialization at cold start
mvdebolskiy Jan 26, 2022
dcbeee0
added bedrock and temperature to excess ice initialization + some com…
mvdebolskiy Jan 27, 2022
2a09e77
improved initialization
mvdebolskiy Feb 2, 2022
d55ba7c
add excess ice to soil temperature mod
mvdebolskiy Feb 2, 2022
46b5d64
Revert "add excess ice to soil temperature mod"
mvdebolskiy Feb 17, 2022
3ccbed9
fixed restart
mvdebolskiy Mar 30, 2022
f8edb89
first layer should have no excess ice.
mvdebolskiy Apr 1, 2022
f99106e
fix stream memory leak and restart from old files
mvdebolskiy Apr 28, 2022
54ccc3b
excess ice restart from old files
mvdebolskiy Apr 29, 2022
75ec42f
Revert "excess ice restart from old files"
mvdebolskiy Apr 29, 2022
88d301f
excess calc. and melt in soiltemperaturemod
mvdebolskiy May 16, 2022
afeb00a
0.125x0.125 initial ex. ice concentration stream
mvdebolskiy May 16, 2022
bee1b47
added exice to the ice fraction in soilhydrology
mvdebolskiy May 19, 2022
0f5f4a5
Rremove extra exice vars
mvdebolskiy May 22, 2022
1736456
add restart for exice from no exice inital condi
mvdebolskiy May 29, 2022
4c79e8f
add exice to ice mass
mvdebolskiy May 29, 2022
628bb9f
add subsidence to water diagnostic vars
mvdebolskiy May 29, 2022
60e9448
added one more diag var and cleanup
mvdebolskiy Jun 5, 2022
57c8a8c
fix diag vars
mvdebolskiy Jun 12, 2022
4923009
make history active only when exice is used
mvdebolskiy Jun 16, 2022
805a3ba
add mapalgo to namelists and stream
mvdebolskiy Jun 16, 2022
3169a42
pass alm_lastyear_indx to restart and improve cold
mvdebolskiy Jun 16, 2022
5a122ba
fix namelists so exice files are not always downloaded
mvdebolskiy Jun 24, 2022
d284f31
added error message for non-nuopc driver
mvdebolskiy Jun 24, 2022
4e3610a
cleanup, comments and rename diagnostic history vars
mvdebolskiy Jun 24, 2022
2046a94
fixed comments
mvdebolskiy Jun 26, 2022
b8fe30d
nlfilename passing
mvdebolskiy Jun 26, 2022
5caa179
indent and comment spaces fix
mvdebolskiy Jun 26, 2022
a3ab210
removed sb
mvdebolskiy Jun 26, 2022
6ecc63b
stream descirption, private usestreams, indents
mvdebolskiy Jun 26, 2022
e305155
change initial depth InitCold to 0.5
mvdebolskiy Aug 2, 2022
8ded405
Change name of mesh file to one in CDF5 format
ekluzek Aug 2, 2022
88b8fea
fixed indent WaterState
mvdebolskiy Aug 3, 2022
ca9a595
add TODO to ExcessIceStream
mvdebolskiy Aug 3, 2022
444d5b6
Fixed typo
mvdebolskiy Aug 3, 2022
ddd7a82
another typo
mvdebolskiy Aug 3, 2022
b75e6ba
remove MVD
mvdebolskiy Aug 3, 2022
57ddf52
Merge branch 'exice_nuopc_pr' of github.com:mvdebolskiy/CTSM into exi…
ekluzek Aug 4, 2022
e839250
Add an excess ice test to the testlist
ekluzek Aug 4, 2022
5dd8aa5
Add excess ice testmod
ekluzek Aug 4, 2022
a9848ad
history vars and issue 1819
mvdebolskiy Oct 14, 2022
5928f7c
iulog for restart and stream
mvdebolskiy Oct 14, 2022
5dc5f59
Add logical use_excess_ice_streams to control if streams file is used…
ekluzek Nov 22, 2022
3460498
Fix number of tests, by the way in the spirit of test-driven developm…
ekluzek Nov 22, 2022
d397157
Add the error checking for excess ice and excess ice streams, this ge…
ekluzek Nov 22, 2022
53e272b
Add an execess ice test with and without excess ice streams
ekluzek Nov 22, 2022
5a56434
Add use_excess_ice_streams to excess ice namelist, make UseStreams a …
ekluzek Nov 23, 2022
2703c04
Turn on excess ice streams
ekluzek Nov 23, 2022
2dfc71f
Add another excess ice test that starts up from a restart file
ekluzek Nov 23, 2022
0035dc7
Fill out all the options for the excess ice tests, add a higher resol…
ekluzek Nov 23, 2022
58e5255
Put use_excess_ice_streams in the right namelist
ekluzek Nov 26, 2022
6597b7b
Fix name of variable
ekluzek Nov 26, 2022
2bf8797
Add test for excess_ice streams on, but mct, that fails
ekluzek Nov 28, 2022
4af3fd5
Fix the check for MCT driver with excess ice streams
ekluzek Nov 28, 2022
5aaef81
Don't run the MCT driver test with excess ice stremas
ekluzek Nov 28, 2022
33c760e
Add stub excess ice streams for MCT, so MCT driver cases can build
ekluzek Nov 28, 2022
d0e1e8e
Fix so can compiler
ekluzek Nov 28, 2022
621f353
Add stream_fldFileName_exice and stream_mapalgo_exice to MCT excess i…
ekluzek Nov 29, 2022
4813ff6
handle the excess ice streams difference for MCT and NUOPC a little b…
ekluzek Nov 29, 2022
6344bb3
Don't call abort on call of CalcExcessIce as it's always called
ekluzek Nov 29, 2022
8cd3956
Change name of UseStreams to UseExcessIceStreams, make it public and …
ekluzek Nov 29, 2022
eb20a75
Add check that new excess ice fields are on the restart file and if n…
ekluzek Nov 29, 2022
03ff5a2
Add a check for issue 1787 about excess ice fields, if they aren't on…
ekluzek Dec 2, 2022
ca96f76
Move RestartExcessIceIssu to restartUtils so that it can be used by m…
ekluzek Dec 5, 2022
0e09dd4
Only write excess ice issue to restart metadata if excess ice is on
ekluzek Dec 5, 2022
b2d469b
Add RestartExcessIceIssue in WaterStateType and send down the logical…
ekluzek Dec 5, 2022
212e104
Prevent nbedrock from being used before it's set
ekluzek Dec 5, 2022
9432c90
Handle InitCold for excess ice when excess ice streams are off
ekluzek Dec 5, 2022
1a40987
Don't do the write in ExcessIceRestart so writing_finidat_interp_dest…
ekluzek Dec 5, 2022
0ff6d4d
Don't do the write in ExcessIceRestart so writing_finidat_interp_dest…
ekluzek Dec 6, 2022
2581d07
Point to a finidat file that has excess ice on it
ekluzek Dec 6, 2022
d4c4efc
Add an excess ice test to the ctsm_sci list and lengthen the time
ekluzek Dec 6, 2022
dcaaf69
Add an output user-mod option for excessice to the yearly file, chang…
ekluzek Dec 6, 2022
b848a7a
Add in needed stubs for unit-testing to work
ekluzek Dec 7, 2022
f258b5d
ERS tests can't be a single day, use the default length
ekluzek Dec 7, 2022
2ae796b
Correct directory name
ekluzek Dec 7, 2022
f599275
Change dimension of local varialbes from nlevgrnd to nlevmaxurbgrnd b…
ekluzek Dec 7, 2022
307ebfb
Make note of PGI test for excess ice that fails
ekluzek Dec 8, 2022
782fc19
Only adjust soil depths for excess ice calculations if excess ice is on
ekluzek Dec 8, 2022
9bb110f
Merge tag 'ctsm5.1.dev115' into exice_nuopc_pr
ekluzek Dec 8, 2022
bbd90a1
Add setting for initial interpolation for excess ice startup file
ekluzek Dec 9, 2022
4be8cc0
Dimension exice_subs_col as noticed by izumi case
ekluzek Dec 9, 2022
689fb3f
Cut back on the excess ice tests
ekluzek Dec 9, 2022
fc28448
Remove expected fail as removed the PGI excess ice test
ekluzek Dec 9, 2022
6a07efb
initial technote writeup
mvdebolskiy Dec 11, 2022
c3fd679
added references
mvdebolskiy Dec 11, 2022
60589cd
fixed typos, punctuation, added more description
mvdebolskiy Dec 19, 2022
9ea6750
Merge remote-tracking branch 'escomp/master' into exice_nuopc_pr
slevis-lmwg Jun 23, 2023
608d2fd
Change syntax in 5 NEON tests from L10d to Ld10
slevis-lmwg Jun 27, 2023
85eea6b
Remove excess ice test from cheyenne aux_clm suite (keep it on izumi)
slevis-lmwg Jul 6, 2023
65f492a
Adding comment to restart issue handling for issue #1787
slevis-lmwg Jul 6, 2023
d67e3bf
Declare parameter excess_ice_issue once
slevis-lmwg Jul 7, 2023
66e2843
Resolved conflict in $ntests BUT DID I PICK THE RIGHT VALUES?
slevis-lmwg Jul 7, 2023
d4be4e2
Format changes to adhere to ctsm coding practices
slevis-lmwg Jul 8, 2023
779e64c
Change exice_vol_col dimension from nlevgrnd to nlevsoi
slevis-lmwg Jul 10, 2023
62b376b
Update $ntests following @ekluzek's suggestion (not tested, yet)
slevis-lmwg Jul 10, 2023
a2cf6bd
Merge remote-tracking branch 'escomp/master' into exice_nuopc_pr
slevis-lmwg Jul 27, 2023
9763297
First draft of ChangeLog/Sum
slevis-lmwg Jul 28, 2023
34900bc
Corrected new tag number in ChangeLog/Sum
slevis-lmwg Aug 3, 2023
4905a09
Rm test that I prob. reintroduced when resolving conflicts: ERI_D_Ld9…
slevis-lmwg Aug 4, 2023
2981687
Update change files
ekluzek Aug 4, 2023
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
25 changes: 25 additions & 0 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1732,6 +1732,11 @@ sub process_namelist_inline_logic {
# namelist group: clm_initinterp_inparm #
#########################################
setup_logic_initinterp($opts, $nl_flags, $definition, $defaults, $nl);

###############################
# namelist group: exice_streams #
###############################
setup_logic_exice($opts, $nl_flags, $definition, $defaults, $nl);
}

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -2132,6 +2137,7 @@ sub setup_logic_soilstate {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'organic_frac_squared' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_bedrock',
'use_fates'=>$nl_flags->{'use_fates'}, 'vichydro'=>$nl_flags->{'vichydro'} );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_excess_ice'); # excess ice flag should be read before stream vars

my $var1 = "soil_layerstruct_predefined";
my $var2 = "soil_layerstruct_userdefined";
Expand Down Expand Up @@ -4137,6 +4143,24 @@ sub setup_logic_fates {
}
}

#-------------------------------------------------------------------------------
sub setup_logic_exice {
#
# excess ice streams
#
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
my $use_exice = $nl->get_value( 'use_excess_ice' );
if (defined($use_exice) && $opts->{'driver'} eq "nuopc" && value_is_true($use_exice)) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_exice');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_exice');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_mapalgo_exice');
} elsif (defined($use_exice) && (! $opts->{'driver'} eq "nuopc") && value_is_true($use_exice)) {
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
$log->fatal_error("nuopc driver is required when use_excess_ice is set to true" );
}


} # end exice streams

#-------------------------------------------------------------------------------

sub setup_logic_misc {
Expand Down Expand Up @@ -4204,6 +4228,7 @@ sub write_output_files {
push @groups, "nitrif_inparm";
push @groups, "lifire_inparm";
push @groups, "ch4finundated";
push @groups, "exice_streams";
push @groups, "soilbgc_decomp";
push @groups, "clm_canopy_inparm";
if (remove_leading_and_trailing_quotes($nl->get_value('snow_cover_fraction_method')) eq 'SwensonLawrence2012') {
Expand Down
10 changes: 10 additions & 0 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2586,4 +2586,14 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts

<init_interp_method>general</init_interp_method>

<!-- ========================================= -->
<!-- Defaults for excess_ice -->
<!-- ========================================= -->

<use_excess_ice>.false.</use_excess_ice>

<stream_fldfilename_exice use_excess_ice=".true.">lnd/clm2/paramdata/exice_init_0.125x0.125_c20220516.nc</stream_fldfilename_exice>
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
<stream_meshfile_exice use_excess_ice=".true.">lnd/clm2/paramdata/exice_init_0.125x0.125_ESMFmesh_c20220516.nc</stream_meshfile_exice>
<stream_mapalgo_exice use_excess_ice=".true.">bilinear</stream_mapalgo_exice>

</namelist_defaults>
26 changes: 26 additions & 0 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2818,4 +2818,30 @@ use case.)

</entry>

<!-- ======================================================================================== -->
<!-- Namelist options related to excess ice -->
<!-- ======================================================================================== -->
<entry id="use_excess_ice" type="logical" category="clm_physics"
group="clm_inparm" valid_values="" >
If TRUE turn on the excess ice physics, (Lee et al., 2014; Cai et al., 2020)
</entry>

<entry id="stream_fldfilename_exice" type="char*256(30)" category="datasets"
input_pathname="abs" group="exice_streams" valid_values="" >
Filename of input stream data for excess ice data
</entry>

<entry id="stream_meshfile_exice" type="char*256" category="datasets"
input_pathname="abs" group="exice_streams" valid_values="" >
mesh filename of input stream data for excess ice
</entry>

<entry id="stream_mapalgo_exice" type="char*256" category="datasets"
group="exice_streams" valid_values="bilinear,nn" >
Mapping method from excess ice input stream data to the model resolution
bilinear = bilinear interpolation
nn = nearest neighbor
</entry>


</namelist_definition>
5 changes: 4 additions & 1 deletion src/biogeophys/SoilHydrologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ subroutine SetSoilWaterFractions(bounds, num_hydrologyc, filter_hydrologyc, &
integer :: j, fc, c
real(r8) :: vol_ice(bounds%begc:bounds%endc,1:nlevsoi) !partial volume of ice lens in layer
real(r8) :: icefrac_orig ! original formulation for icefrac
real(r8) :: dz_ext(bounds%begc:bounds%endc,1:nlevsoi)

character(len=*), parameter :: subname = 'SetSoilWaterFractions'
!-----------------------------------------------------------------------
Expand All @@ -191,6 +192,7 @@ subroutine SetSoilWaterFractions(bounds, num_hydrologyc, filter_hydrologyc, &

h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2)
h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice water (kg/m2)
excess_ice => waterstatebulk_inst%excess_ice_col , & ! Input: [real(r8) (:,:) ] excess ice (kg/m2)

origflag => soilhydrology_inst%origflag , & ! Input: logical
icefrac => soilhydrology_inst%icefrac_col , & ! Output: [real(r8) (:,:) ]
Expand All @@ -203,7 +205,8 @@ subroutine SetSoilWaterFractions(bounds, num_hydrologyc, filter_hydrologyc, &

! Porosity of soil, partial volume of ice and liquid, fraction of ice in each layer,
! fractional impermeability
vol_ice(c,j) = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice))
dz_ext(c,j) = dz(c,j) + excess_ice(c,j)/denice ! extended layer thickness, should be good for all the columns
vol_ice(c,j) = min(watsat(c,j), (h2osoi_ice(c,j) + excess_ice(c,j))/(dz_ext(c,j)*denice))
eff_porosity(c,j) = max(0.01_r8,watsat(c,j)-vol_ice(c,j))
icefrac(c,j) = min(1._r8,vol_ice(c,j)/watsat(c,j))

Expand Down
Loading