Skip to content

Commit

Permalink
Merge pull request #682 from GEOS-ESM/feature/jkolassa_catchCNrst_cle…
Browse files Browse the repository at this point in the history
…anup

Cleanup of Catchment-CN constants in CatchmentCNRst.F90
  • Loading branch information
sdrabenh authored Mar 7, 2023
2 parents b513561 + bfd00c7 commit d4775d5
Show file tree
Hide file tree
Showing 8 changed files with 162 additions and 368 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ module clm_varpar
! Module containing CLM parameters
!
! !USES:

use clm_varpar_shared, only : VAR_COL =>VAR_COL_40, VAR_PFT => VAR_PFT_40, &
numpft => numpft_CN, NUM_ZON => NUM_ZON_CN, &
NUM_VEG => NUM_VEG_CN

!
! !PUBLIC TYPES:
implicit none
Expand All @@ -23,7 +28,6 @@ module clm_varpar
! Define indices used in surface file read
! maxpatch_pft = max number of plant functional types in naturally vegetated landunit

integer, parameter :: numpft = 19 ! actual # of pfts (without bare)
integer :: maxpatch_pft

! clm_varpar_init seems to do something similar; less prone to error to move
Expand All @@ -39,10 +43,6 @@ module clm_varpar
! CatchCN parameters
! ------------------

integer, parameter, PUBLIC :: NUM_ZON=3 ! number of CN hydrology zones per tile
integer, parameter, PUBLIC :: NUM_VEG=4 ! number of CN PFTs per zone
integer, parameter, PUBLIC :: VAR_COL=40 ! number of CN column restart variables
integer, parameter, PUBLIC :: VAR_PFT=74 ! number of CN PFT variables per column
real, parameter, PUBLIC, dimension(NUM_ZON) :: CN_zone_weight = (/0.10,0.45,0.45/) ! gkw: tunable; must sum to 1
integer, parameter, PUBLIC :: map_cat(0:numpft) = (/4,3,3,3,1,1,2,2,2,5,5,5,6,4,4,4,4,4,4,4/) ! gkw: 0 -> 6, since 8 now gone

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ module clm_varpar
!
! !USES:
!
use clm_varpar_shared, only : VAR_COL =>VAR_COL_45, VAR_PFT => VAR_PFT_45, &
numpft => numpft_CN, NUM_ZON => NUM_ZON_CN, &
NUM_VEG => NUM_VEG_CN
! !PUBLIC TYPES:
implicit none
save
Expand All @@ -26,7 +29,6 @@ module clm_varpar
! Define indices used in surface file read
! maxpatch_pft = max number of plant functional types in naturally vegetated landunit

integer, parameter :: numpft = 19 ! actual # of pfts (without bare), same as in Catchment-CN.clm4
integer :: maxpatch_pft

! clm_varpar_init seems to do something similar; less prone to error to move
Expand Down Expand Up @@ -85,10 +87,6 @@ module clm_varpar
! 8: DESERT => 0
! 9: ICE => n/a

integer, parameter, PUBLIC :: NUM_ZON=3 ! number of CN hydrology zones per tile
integer, parameter, PUBLIC :: NUM_VEG=4 ! number of CN PFTs per zone
integer, parameter, PUBLIC :: VAR_COL=35 ! number of CN column restart variables
integer, parameter, PUBLIC :: VAR_PFT=75 ! number of CN PFT variables per column
real, parameter, PUBLIC, dimension(NUM_ZON) :: CN_zone_weight = (/0.10,0.45,0.45/) ! gkw: tunable; must sum to 1
integer, parameter, PUBLIC :: map_cat(0:numpft) = (/4,3,3,3,1,1,2,2,2,5,5,5,6,4,4,4,4,4,4,4/)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ esma_set_this(OVERRIDE GEOS_CatchCNShared)
set (srcs
nanMod.F90
catchmentCN.F90
catchcn_iau.F90)
catchcn_iau.F90
clm_varpar_shared.F90)

esma_add_library (${this}
SRCS ${srcs}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module clm_varpar_shared

!-----------------------------------------------------------------------
!BOP
!
! !MODULE: clm_varpar_shared
!
! !DESCRIPTION:
! Module containing CLM parameters
!
! !USES:
!
! !PUBLIC TYPES:
implicit none
save
!
! Define number of levels

integer, parameter :: numpft_CN = 19 ! actual # of pfts (without bare), same as in Catchment-CN.clm4

integer, parameter, PUBLIC :: NUM_ZON_CN=3 ! number of CN hydrology zones per tile
integer, parameter, PUBLIC :: NUM_VEG_CN=4 ! number of CN PFTs per zone
integer, parameter, PUBLIC :: VAR_COL_40=40 ! number of CN column restart variables
integer, parameter, PUBLIC :: VAR_PFT_40=74 ! number of CN PFT variables per column
integer, parameter, PUBLIC :: VAR_COL_45=35 ! number of CN column restart variables
integer, parameter, PUBLIC :: VAR_PFT_45=75 ! number of CN PFT variables per column

!------------------------------------------------------------------------------
end module clm_varpar_shared
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ set (exe_srcs

esma_add_library (${this}
SRCS ${srcs}
DEPENDENCIES MAPL GEOS_SurfaceShared GEOS_LandShared esmf NetCDF::NetCDF_Fortran)
DEPENDENCIES MAPL GEOS_SurfaceShared GEOS_LandShared esmf NetCDF::NetCDF_Fortran GEOS_CatchCNShared)

foreach (src ${exe_srcs})
string (REGEX REPLACE ".F90" ".x" exe ${src})
ecbuild_add_executable (
TARGET ${exe}
SOURCES ${src}
LIBS MAPL GFTL_SHARED::gftl-shared GEOS_SurfaceShared GEOSroute_GridComp GEOS_LandShared ${this})
LIBS MAPL GFTL_SHARED::gftl-shared GEOS_SurfaceShared GEOSroute_GridComp GEOS_LandShared GEOS_CatchCNShared ${this})
endforeach ()

install(PROGRAMS mk_Restarts DESTINATION bin)
Expand Down
Loading

0 comments on commit d4775d5

Please sign in to comment.