Skip to content

Commit 27fa2e0

Browse files
committed
wip - Allow polygonal landunits to be initiated from surface file
Updates initialization routines to allow for polygonal landunits to be created from namelist option and from polygon type percentages specified on input file. In particular, it allows for four landunits to be created with istsoil ltype on each topounit so that the ice wedge polygons can have their own soil columns as well as be vegetated. The fourth landunit is for non-polygonal natural vegetated ground on the same topounit.
1 parent 4a88a2d commit 27fa2e0

File tree

8 files changed

+285
-187
lines changed

8 files changed

+285
-187
lines changed

components/elm/bld/namelist_files/namelist_defaults.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,4 +2155,7 @@ this mask will have smb calculated over the entire global land surface
21552155
<use_fan use_fates=".true." >.false.</use_fan>
21562156
<use_fan fan_mode='disable'>.false.</use_fan>
21572157

2158+
<!-- NGEE Arctic Options -->
2159+
<use_polygonal_tundra>.false.</use_polygonal_tundra>;
2160+
21582161
</namelist_defaults>

components/elm/bld/namelist_files/namelist_definition.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,4 +2135,14 @@ not be called.
21352135
<default>Default: 0</default>
21362136
</entry>
21372137

2138+
<!-- ======================================================================================== -->
2139+
<!-- NGEE Arctic Options -->
2140+
<!-- ======================================================================================== -->
2141+
2142+
<entry id="use_polygonal_tundra" type="logical" category="default_settings"
2143+
group="elm_inparm" value=".false.">
2144+
Use polygonal tundra parameterizations for ice wedge polygon microtopography and inindation fraction
2145+
<default>Default: .false.</default>
2146+
</entry>
2147+
21382148
</namelist_definition>

components/elm/src/main/controlMod.F90

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ module controlMod
6060
! !PUBLIC TYPES:
6161
implicit none
6262
save
63-
63+
6464
! !PUBLIC MEMBER FUNCTIONS:
6565
public :: control_setNL ! Set namelist filename
6666
public :: control_init ! initial run control information
6767
public :: control_print ! print run control information
68-
68+
6969
! !PRIVATE TYPES:
7070
character(len= 7) :: runtyp(4) ! run type
7171
character(len=SHR_KIND_CL) :: NLFilename = 'lnd.stdin' ! Namelist filename
@@ -79,14 +79,14 @@ module controlMod
7979

8080
!------------------------------------------------------------------------
8181
subroutine control_setNL( NLfile )
82-
82+
8383
! !DESCRIPTION:
8484
! Set the namelist filename to use
85-
85+
8686
! !ARGUMENTS:
8787
implicit none
8888
character(len=*), intent(IN) :: NLFile ! Namelist filename
89-
89+
9090
! !LOCAL VARIABLES:
9191
character(len=32) :: subname = 'control_setNL' ! subroutine name
9292
logical :: lexist ! File exists
@@ -111,19 +111,19 @@ end subroutine control_setNL
111111

112112
!------------------------------------------------------------------------
113113
subroutine control_init( )
114-
114+
115115
! !DESCRIPTION:
116116
! Initialize CLM run control information
117-
117+
118118
! !USES:
119119
use elm_time_manager , only : set_timemgr_init, get_timemgr_defaults
120120
use fileutils , only : getavu, relavu
121121
use shr_string_mod , only : shr_string_getParentDir
122122
use elm_interface_pflotranMod , only : elm_pf_readnl
123123
use ELMBeTRNLMod , only : betr_readNL
124-
124+
125125
implicit none
126-
126+
127127
! !LOCAL VARIABLES:
128128
character(len=32) :: starttype ! infodata start type
129129
integer :: i,j,n ! loop indices
@@ -306,8 +306,8 @@ subroutine control_init( )
306306
namelist /elm_inparm/ &
307307
do_budgets, budget_inst, budget_daily, budget_month, &
308308
budget_ann, budget_ltann, budget_ltend
309-
310-
namelist /elm_inparm/ &
309+
310+
namelist /elm_inparm/ &
311311
use_atm_downscaling_to_topunit, precip_downscaling_method
312312

313313
namelist /elm_inparm/ &
@@ -318,16 +318,19 @@ subroutine control_init( )
318318

319319
namelist /elm_mosart/ &
320320
lnd_rof_coupling_nstep
321-
321+
322+
namelist /elm_inparm/ &
323+
snow_shape, snicar_atm_type, use_dust_snow_internal_mixing
324+
322325
namelist /elm_inparm/ &
323-
snow_shape, snicar_atm_type, use_dust_snow_internal_mixing
324-
325-
namelist /elm_inparm/ &
326326
use_modified_infil
327327

328328
namelist /elm_inparm/ &
329329
use_fan, fan_mode, fan_to_bgc_veg, nh4_ads_coef
330330

331+
! NGEE Arctic options
332+
namelist /elm_inparm/ &
333+
use_polygonal_tundra
331334
! ----------------------------------------------------------------------
332335
! Default values
333336
! ----------------------------------------------------------------------
@@ -506,7 +509,7 @@ subroutine control_init( )
506509
end if
507510
end if
508511

509-
if (use_lch4 .and. use_vertsoilc) then
512+
if (use_lch4 .and. use_vertsoilc) then
510513
anoxia = .true.
511514
else
512515
anoxia = .false.
@@ -551,7 +554,7 @@ subroutine control_init( )
551554
if (use_lnd_rof_two_way) then
552555
if (lnd_rof_coupling_nstep < 1) then
553556
call endrun(msg=' ERROR: lnd_rof_coupling_nstep cannot be smaller than 1.'//&
554-
errMsg(__FILE__, __LINE__))
557+
errMsg(__FILE__, __LINE__))
555558
endif
556559
endif
557560

@@ -686,7 +689,7 @@ end subroutine control_init
686689

687690
!------------------------------------------------------------------------
688691
subroutine control_spmd()
689-
692+
690693
! !DESCRIPTION:
691694
! Distribute namelist data all processors. All program i/o is
692695
! funnelled through the master processor. Processor 0 either
@@ -695,13 +698,13 @@ subroutine control_spmd()
695698
! all processors and writes it to disk.
696699
!
697700
! !USES:
698-
701+
699702
use spmdMod, only : mpicom, MPI_CHARACTER, MPI_INTEGER, MPI_LOGICAL, MPI_REAL8
700703
use elm_varpar, only : numrad
701-
704+
702705
! !ARGUMENTS:
703706
implicit none
704-
707+
705708
! !LOCAL VARIABLES:
706709
integer ier !error code
707710
!-----------------------------------------------------------------------
@@ -874,7 +877,7 @@ subroutine control_spmd()
874877
call mpi_bcast (more_vertlayers,1, MPI_LOGICAL, 0, mpicom, ier)
875878
call mpi_bcast (const_climate_hist, 1, MPI_LOGICAL, 0, mpicom, ier)
876879
call mpi_bcast (use_top_solar_rad, 1, MPI_LOGICAL, 0, mpicom, ier) ! TOP solar radiation parameterization
877-
880+
878881
! glacier_mec variables
879882
call mpi_bcast (create_glacier_mec_landunit, 1, MPI_LOGICAL, 0, mpicom, ier)
880883
call mpi_bcast (maxpatch_glcmec, 1, MPI_INTEGER, 0, mpicom, ier)
@@ -948,11 +951,11 @@ subroutine control_spmd()
948951

949952
! PETSc-based thermal model
950953
call mpi_bcast (use_petsc_thermal_model, 1, MPI_LOGICAL, 0, mpicom, ier)
951-
954+
952955
! Downscaling of atmospheric forcing to topounits
953956
call mpi_bcast (use_atm_downscaling_to_topunit, 1, MPI_LOGICAL, 0, mpicom, ier)
954957
call mpi_bcast (precip_downscaling_method, len(precip_downscaling_method), MPI_CHARACTER, 0, mpicom, ier)
955-
958+
956959
! soil erosion
957960
call mpi_bcast (use_erosion, 1, MPI_LOGICAL, 0, mpicom, ier)
958961
call mpi_bcast (ero_ccycle , 1, MPI_LOGICAL, 0, mpicom, ier)
@@ -974,28 +977,30 @@ subroutine control_spmd()
974977
call mpi_bcast (snow_shape, len(snow_shape), MPI_CHARACTER, 0, mpicom, ier)
975978
call mpi_bcast (snicar_atm_type, len(snicar_atm_type), MPI_CHARACTER, 0, mpicom, ier)
976979
call mpi_bcast (use_dust_snow_internal_mixing, 1, MPI_LOGICAL, 0, mpicom, ier)
977-
980+
978981
call mpi_bcast (mpi_sync_nstep_freq, 1, MPI_INTEGER, 0, mpicom, ier)
979-
982+
980983
! use modified infiltration scheme in surface water storage
981984
call mpi_bcast (use_modified_infil, 1, MPI_LOGICAL, 0, mpicom, ier)
982985

986+
!NGEE Arctic options
987+
call mpi_bcast (use_polygonal_tundra, 1, MPI_LOGICAL, 0, mpicom, ier)
983988
end subroutine control_spmd
984989

985990
!------------------------------------------------------------------------
986991
subroutine control_print ()
987-
992+
988993
! !DESCRIPTION:
989994
! Write out the clm namelist run control variables
990-
995+
991996
! !USES:
992-
997+
993998
use AllocationMod, only : suplnitro, suplnNon
994999
use AllocationMod, only : suplphos, suplpNon
995-
1000+
9961001
! !ARGUMENTS:
9971002
implicit none
998-
1003+
9991004
! !LOCAL VARIABLES:
10001005
integer i !loop index
10011006
character(len=32) :: subname = 'control_print' ! subroutine name
@@ -1035,7 +1040,7 @@ subroutine control_print ()
10351040
write(iulog,*) ' precip_downscaling_method = ', precip_downscaling_method
10361041
write(iulog,*) 'input data files:'
10371042
write(iulog,*) ' PFT physiology and parameters file = ',trim(paramfile)
1038-
write(iulog,*) ' Soil order dependent parameters file = ',trim(fsoilordercon)
1043+
write(iulog,*) ' Soil order dependent parameters file = ',trim(fsoilordercon)
10391044
if (fsurdat == ' ') then
10401045
write(iulog,*) ' fsurdat, surface dataset not set'
10411046
else
@@ -1056,13 +1061,13 @@ subroutine control_print ()
10561061
else
10571062
write(iulog,*) ' atm topographic data = ',trim(fatmtopo)
10581063
end if
1059-
1064+
10601065
if (use_top_solar_rad) then
10611066
write(iulog,*) ' use TOP solar radiation parameterization instead of PP'
10621067
else
10631068
write(iulog,*) ' use_top_solar_rad is False, so do not run TOP solar radiation parameterization'
10641069
end if
1065-
1070+
10661071
if (use_cn) then
10671072
if (suplnitro /= suplnNon)then
10681073
write(iulog,*) ' Supplemental Nitrogen mode is set to run over Patches: ', &
@@ -1176,9 +1181,9 @@ subroutine control_print ()
11761181
write(iulog,*) ' atm_gustiness = ', atm_gustiness
11771182
write(iulog,*) ' force_land_gustiness = ', force_land_gustiness
11781183
write(iulog,*) ' more vertical layers = ', more_vertlayers
1179-
1184+
11801185
write(iulog,*) ' Sub-grid topographic effects on solar radiation = ', use_top_solar_rad ! TOP solar radiation parameterization
1181-
1186+
11821187
if (nsrest == nsrContinue) then
11831188
write(iulog,*) 'restart warning:'
11841189
write(iulog,*) ' Namelist not checked for agreement with initial run.'
@@ -1241,9 +1246,9 @@ subroutine control_print ()
12411246
write(iulog,*) ' use_lnd_rof_two_way = ', use_lnd_rof_two_way
12421247
write(iulog,*) ' lnd_rof_coupling_nstep = ', lnd_rof_coupling_nstep
12431248
write(iulog,*) ' mpi_sync_nstep_freq = ', mpi_sync_nstep_freq
1244-
1249+
12451250
write(iulog,*) ' use_modified_infil = ', use_modified_infil
1246-
1251+
12471252

12481253
! FAN
12491254
write(iulog,*) ' use_fan = ', use_fan
@@ -1253,6 +1258,8 @@ subroutine control_print ()
12531258
write(iulog,*) ' fan_to_bgc_veg = ', fan_to_bgc_veg
12541259
end if
12551260

1261+
! NGEE Arctic options
1262+
if (use_polygonal_tundra) write(iulog, *) ' use_polygonal_tundra =', use_polygonal_tundra
12561263
end subroutine control_print
12571264

12581265
end module controlMod

components/elm/src/main/elm_varctl.F90

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,11 @@ module elm_varctl
374374
logical, public :: fan_nh3_to_atm = .false.
375375
logical, public :: fan_to_bgc_crop = .false.
376376
logical, public :: fan_to_bgc_veg = .false.
377-
377+
378+
!----------------------------------------------------------
379+
! NGEE Arctic parameterizations
380+
!----------------------------------------------------------
381+
logical, public :: use_polygonal_tundra = .false.
378382

379383
!----------------------------------------------------------
380384
! VSFM switches
@@ -524,8 +528,8 @@ module elm_varctl
524528
!----------------------------------------------------------
525529
logical, public :: use_lnd_rof_two_way = .false.
526530
integer, public :: lnd_rof_coupling_nstep = 0
527-
528-
531+
532+
529533
!----------------------------------------------------------
530534
! SNICAR-AD
531535
!----------------------------------------------------------
@@ -537,7 +541,7 @@ module elm_varctl
537541
! MPI syncing
538542
!----------------------------------------------------------
539543
integer, public :: mpi_sync_nstep_freq = 0
540-
544+
541545
!----------------------------------------------------------
542546
! Modified infiltration scheme in surface water storage
543547
!----------------------------------------------------------

components/elm/src/main/elm_varsur.F90

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module elm_varsur
22

33
!-----------------------------------------------------------------------
44
! Module containing 2-d surface boundary data information
5-
! surface boundary data, these are all "gdc" local
5+
! surface boundary data, these are all "gdc" local
66
! Note that some of these need to be pointers (as opposed to just allocatable arrays) to
77
! match the ncd_io interface; for consistency, we make them all pointers
88
!
@@ -14,20 +14,26 @@ module elm_varsur
1414
save
1515
!
1616
! weight of each landunit on the topounit in the grid cell
17-
real(r8), pointer :: wt_lunit(:,:,:)
17+
real(r8), pointer :: wt_lunit(:,:,:)
1818

1919
! whether we have valid urban data in each grid cell or (in each topounit)
2020
logical , pointer :: urban_valid(:,:)
2121

2222
! for natural veg landunit, weight of each pft on the landunit (adds to 1.0 on the
2323
! landunit for all all grid cells, even! those without any natural pft)
2424
! (second dimension goes natpft_lb:natpft_ub)
25-
real(r8), pointer :: wt_nat_patch(:,:,:)
25+
real(r8), pointer :: wt_nat_patch(:,:,:)
26+
27+
! for polygonal tundra special case of natural veg landunit, weight of polygon type
28+
! with respect to the natural vegetation landunit (NOT the grid cell). these do
29+
! not need to sum to 1 to preserve possibility of polygonal tundra and non-polygonal
30+
! ground on the same grid cell, on the vegetated landunit.
31+
real(r8), pointer :: wt_polygon(:,:,:) ! dims: clump, topounit, polygon type
2632

2733
! for crop landunit, weight of each cft on the landunit (adds to 1.0 on the
2834
! landunit for all all grid cells, even those without any crop)
2935
! (second dimension goes cft_lb:cft_ub)
30-
real(r8), pointer :: wt_cft(:,:,:)
36+
real(r8), pointer :: wt_cft(:,:,:)
3137

3238
! for each cft on the crop landunit prescribe annual fertilizer
3339
! landunit for all all grid cells, even those without any crop)
@@ -37,19 +43,19 @@ module elm_varsur
3743

3844
! for glc_mec landunits, weight of glacier in each elevation class (adds to 1.0 on the
3945
! landunit for all grid cells, even those without any glacier)
40-
real(r8), pointer :: wt_glc_mec(:,:,:)
46+
real(r8), pointer :: wt_glc_mec(:,:,:)
4147

4248
! subgrid glacier_mec sfc elevation
43-
real(r8), pointer :: topo_glc_mec(:,:,:)
44-
49+
real(r8), pointer :: topo_glc_mec(:,:,:)
50+
4551
! Topounit related poiters
4652
real(r8), pointer :: num_tunit_per_grd(:) ! Topounit area fraction
4753
real(r8), pointer :: wt_tunit(:,:) ! Topounit area fraction
48-
real(r8), pointer :: elv_tunit(:,:) ! Topounit elevation
49-
real(r8), pointer :: slp_tunit(:,:) ! Topounit slope
54+
real(r8), pointer :: elv_tunit(:,:) ! Topounit elevation
55+
real(r8), pointer :: slp_tunit(:,:) ! Topounit slope
5056
integer, pointer :: asp_tunit(:,:) ! Topounit aspect
51-
52-
real(r8),pointer :: firrig(:,:)
57+
58+
real(r8),pointer :: firrig(:,:)
5359
real(r8),pointer :: f_surf(:,:) ! fraction of water withdraws from surfacewater
5460
real(r8),pointer :: f_grd(:,:) ! fraction of water withdraws from groundwater
5561
!-----------------------------------------------------------------------

0 commit comments

Comments
 (0)