From 743f616e98d60dbd7edda974c0394de2396db591 Mon Sep 17 00:00:00 2001 From: Rich Fiorella Date: Tue, 11 Jun 2024 14:39:25 -0600 Subject: [PATCH] Add missing allocation of wt_polygon matrix wt_polygon had never been allocated in elm_initializeMod, so needs to be added here in order to get polygon weights in surfrdMod.F90 --- components/elm/src/main/elm_initializeMod.F90 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/elm/src/main/elm_initializeMod.F90 b/components/elm/src/main/elm_initializeMod.F90 index 2a8079692379..a6f708dc62d6 100755 --- a/components/elm/src/main/elm_initializeMod.F90 +++ b/components/elm/src/main/elm_initializeMod.F90 @@ -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 @@ -86,7 +86,7 @@ subroutine initialize1( ) use filterMod , only: allocFilters use reweightMod , only: reweight_wrapup use topounit_varcon , only: max_topounits, has_topounit, topounit_varcon_init - use elm_varctl , only: use_top_solar_rad + use elm_varctl , only: use_top_solar_rad, use_polygonal_tundra ! ! !LOCAL VARIABLES: integer :: ier ! error status @@ -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 )) @@ -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