Skip to content

Commit

Permalink
Add missing allocation of wt_polygon matrix
Browse files Browse the repository at this point in the history
wt_polygon had never been allocated in
elm_initializeMod, so needs to be added here in order
to get polygon weights in surfrdMod.F90
  • Loading branch information
rfiorella committed Jun 11, 2024
1 parent 3189a91 commit 7fd881a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/elm/src/main/elm_initializeMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ subroutine initialize1( )
use elm_varpar , only: update_pft_array_bounds
use elm_varpar , only: surfpft_lb, surfpft_ub
use elm_varcon , only: elm_varcon_init
use landunit_varcon , only: landunit_varcon_init, max_lunit, istice_mec
use landunit_varcon , only: landunit_varcon_init, max_lunit, istice_mec, max_polygon
use column_varcon , only: col_itype_to_icemec_class
use elm_varctl , only: fsurdat, fatmlndfrc, flndtopo, fglcmask, noland, version
use pftvarcon , only: pftconrd
Expand Down Expand Up @@ -279,6 +279,11 @@ subroutine initialize1( )
allocate (wt_glc_mec (1,1,1))
allocate (topo_glc_mec(1,1,1))
endif
if (use_polygonal_tundra) then
allocate (wt_polygon (begg:endg,1:max_topounits, max_polygon))
else
allocate (wt_polygon (1,1,1)) ! RF-not sure this is needed
endif

allocate (wt_tunit (begg:endg,1:max_topounits ))
allocate (elv_tunit (begg:endg,1:max_topounits ))
Expand Down Expand Up @@ -421,6 +426,7 @@ subroutine initialize1( )
!deallocate (wt_lunit, wt_cft, wt_glc_mec)
deallocate (wt_cft, wt_glc_mec) !wt_lunit not deallocated because it is being used in CanopyHydrologyMod.F90
deallocate (wt_tunit, elv_tunit, slp_tunit, asp_tunit,num_tunit_per_grd)
deallocate (wt_polygon) ! RF - might be used elsewhere, not sure if we want to deallocate here.
call t_stopf('elm_init1')

! initialize glc_topo
Expand Down

0 comments on commit 7fd881a

Please sign in to comment.