Skip to content

Commit

Permalink
Merge pull request #717 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
Sync develop into main
  • Loading branch information
sdrabenh authored Mar 8, 2023
2 parents 377221d + d4775d5 commit 4689e6a
Show file tree
Hide file tree
Showing 86 changed files with 5,011 additions and 1,485 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -711,11 +711,6 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )
real :: bgstressmax
real, pointer, dimension(:,:) :: LATS

character(len=ESMF_MAXSTR) :: GRIDNAME
character(len=4) :: imchar
character(len=2) :: dateline
integer :: imsize,nn

! Rayleigh friction parameters

REAL :: H0, HH, Z1, TAU1
Expand Down Expand Up @@ -752,16 +747,6 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )
RC=STATUS )
VERIFY_(STATUS)

! Get grid name to determine IMSIZE
call MAPL_GetResource(MAPL,GRIDNAME,'AGCM_GRIDNAME:', RC=STATUS)
VERIFY_(STATUS)
GRIDNAME = AdjustL(GRIDNAME)
nn = len_trim(GRIDNAME)
dateline = GRIDNAME(nn-1:nn)
imchar = GRIDNAME(3:index(GRIDNAME,'x')-1)
read(imchar,*) imsize
if(dateline.eq.'CF') imsize = imsize*4

! Gravity wave drag
! -----------------

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set (alldirs
GEOScatchCN_GridComp
GEOSlana_GridComp
GEOSroute_GridComp
GEOSigni_GridComp
)

esma_add_library (${this}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module GEOS_LandGridCompMod

!BOP
! !MODULE: GEOS_LandGridCompMod -- A Module to combine VegDyn and Catch Gridded Components
! !MODULE: GEOS_LandGridCompMod -- A Module to combine VegDyn and Catch, and Igni Gridded Components

! !DESCRIPTION: This gridded component operates on the land tiles as
! as child of GEOS\_SurfaceGridComp. The core functionality is the
Expand All @@ -30,6 +30,7 @@ module GEOS_LandGridCompMod
use GEOS_VegdynGridCompMod, only : VegdynSetServices => SetServices
use GEOS_CatchGridCompMod, only : CatchSetServices => SetServices
use GEOS_CatchCNGridCompMod, only : CatchCNSetServices => SetServices
use GEOS_IgniGridCompMod, only : IgniSetServices => SetServices
! use GEOS_RouteGridCompMod, only : RouteSetServices => SetServices

implicit none
Expand All @@ -45,7 +46,9 @@ module GEOS_LandGridCompMod

integer :: VEGDYN
integer, allocatable :: CATCH(:), ROUTE (:), CATCHCN (:)
INTEGER :: LSM_CHOICE, RUN_ROUTE, DO_GOSWIM
integer :: LSM_CHOICE, RUN_ROUTE, DO_GOSWIM
integer :: IGNI
logical :: DO_FIRE_DANGER

contains

Expand Down Expand Up @@ -153,6 +156,7 @@ subroutine SetServices ( GC, RC )
call ESMF_ConfigLoadFile(SCF,SURFRC,rc=status) ; VERIFY_(STATUS)
call MAPL_GetResource (SCF, RUN_ROUTE, label='RUN_ROUTE:', DEFAULT=0, __RC__ )
call MAPL_GetResource (SCF, DO_GOSWIM, label='N_CONST_LAND4SNWALB:', DEFAULT=0, __RC__ )
call MAPL_GetResource (SCF, DO_FIRE_DANGER, label='FIRE_DANGER:', DEFAULT=.false., __RC__ )
call ESMF_ConfigDestroy (SCF, __RC__)

SELECT CASE (LSM_CHOICE)
Expand Down Expand Up @@ -204,7 +208,14 @@ subroutine SetServices ( GC, RC )
! end do
! end if
! ENDIF


if (DO_FIRE_DANGER) then
IGNI = MAPL_AddChild(GC, NAME='IGNI'//trim(tmp), SS=IgniSetServices, RC=STATUS)
VERIFY_(STATUS)
else
IGNI = -1
end if

!BOS

!------------------------------------------------------------
Expand Down Expand Up @@ -1343,6 +1354,37 @@ subroutine SetServices ( GC, RC )
! VERIFY_(STATUS)
! ENDIF


if (DO_FIRE_DANGER) then
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'FFMC', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'GFMC', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'DMC', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'DC', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'ISI', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'BUI', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'FWI', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'DSR', CHILD_ID = IGNI, __RC__ )

call MAPL_AddExportSpec ( GC, SHORT_NAME = 'FFMC_DAILY', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'DMC_DAILY', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'DC_DAILY', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'ISI_DAILY', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'BUI_DAILY', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'FWI_DAILY', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'DSR_DAILY', CHILD_ID = IGNI, __RC__ )

call MAPL_AddExportSpec ( GC, SHORT_NAME = 'FFMC_DAILY_', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'DMC_DAILY_', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'DC_DAILY_', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'ISI_DAILY_', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'BUI_DAILY_', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'FWI_DAILY_', CHILD_ID = IGNI, __RC__ )
call MAPL_AddExportSpec ( GC, SHORT_NAME = 'DSR_DAILY_', CHILD_ID = IGNI, __RC__ )

call MAPL_AddExportSpec ( GC, SHORT_NAME = 'VPD', CHILD_ID = IGNI, __RC__ )
end if


!EOS

!------------------------------------------------------------
Expand All @@ -1367,6 +1409,19 @@ subroutine SetServices ( GC, RC )
RC=STATUS )
VERIFY_(STATUS)

if (DO_FIRE_DANGER) then
call MAPL_AddConnectivity ( &
GC, &
SHORT_NAME = (/ 'MOT2M ', 'MOQ2M ', &
'MOU10M ', 'MOV10M ', &
'PRLAND ', 'SWDOWNLAND', &
'ASNOW ', 'SNOWDP ' /), &
DST_ID = IGNI, &
SRC_ID = CATCH(I), &
RC = STATUS )
VERIFY_(STATUS)
end if

! IF(RUN_ROUTE == 1) THEN
! call MAPL_AddConnectivity ( &
! GC ,&
Expand All @@ -1387,6 +1442,19 @@ subroutine SetServices ( GC, RC )
SRC_ID = VEGDYN , &
RC=STATUS )

if (DO_FIRE_DANGER) then
call MAPL_AddConnectivity ( &
GC, &
SHORT_NAME = (/ 'MOT2M ', 'MOQ2M ', &
'MOU10M ', 'MOV10M ', &
'PRLAND ', 'SWDOWNLAND', &
'ASNOW ', 'SNOWDP ' /), &
DST_ID = IGNI, &
SRC_ID = CATCHCN(I), &
RC = STATUS )
VERIFY_(STATUS)
end if

! IF(RUN_ROUTE == 1) THEN
! call MAPL_AddConnectivity ( &
! GC ,&
Expand Down
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 @@ -5167,13 +5167,10 @@ subroutine Driver ( RC )
! Variables for FPAR
! --------------------------
real , allocatable, dimension (:,:) :: parzone
character(len=ESMF_MAXSTR) :: Co2_CycleFile

IAm=trim(COMP_NAME)//"::RUN2::Driver"

! Begin

IAm=trim(COMP_NAME)//"Driver"

! --------------------------------------------------------------------------
! Get time step from configuration
! --------------------------------------------------------------------------
Expand Down Expand Up @@ -5656,7 +5653,11 @@ subroutine Driver ( RC )
call MPI_Info_create(info, STATUS); VERIFY_(status)
call MPI_Info_set(info, "romio_cb_read", "automatic", STATUS); VERIFY_(status)

STATUS = NF_OPEN ('CO2_MonthlyMean_DiurnalCycle.nc4', NF_NOWRITE, CTfile); VERIFY_(status)
call MAPL_GetResource (MAPL, CO2_CycleFile, label = 'CO2_MonthlyMean_DiurnalCycle_FILE:', &
default = 'CO2_MonthlyMean_DiurnalCycle.nc4', RC=STATUS )
VERIFY_(STATUS)

STATUS = NF_OPEN (trim(CO2_CycleFile), NF_NOWRITE, CTfile); VERIFY_(status)

allocate (CT_CO2V (1: NUNQ, 1:12, 1:8))
allocate (CTCO2_TMP (1:CT_grid_N_lon, 1:CT_grid_N_lat, 1:12, 1:8))
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 @@ -5115,7 +5115,7 @@ subroutine Driver ( RC )
real, allocatable, dimension(:,:,:) :: pft

real, allocatable, dimension(:) :: lnfm
character(len=ESMF_MAXSTR) :: LNFMFile
character(len=ESMF_MAXSTR) :: LNFMFile, CO2_CycleFile

integer :: ntile, nv, dpy, ierr, iok, ndt
integer, save :: year_prev = -9999
Expand Down Expand Up @@ -5653,7 +5653,9 @@ subroutine Driver ( RC )
call MPI_Info_create(info, STATUS); VERIFY_(status)
call MPI_Info_set(info, "romio_cb_read", "automatic", STATUS); VERIFY_(status)

STATUS = NF_OPEN ('CO2_MonthlyMean_DiurnalCycle.nc4', NF_NOWRITE, CTfile); VERIFY_(status)
call MAPL_GetResource (MAPL, CO2_CycleFile, label = 'CO2_MonthlyMean_DiurnalCycle_FILE:', default = 'CO2_MonthlyMean_DiurnalCycle.nc4', RC=STATUS )
VERIFY_(STATUS)
STATUS = NF_OPEN (trim(CO2_CycleFile), NF_NOWRITE, CTfile); VERIFY_(status)

allocate (CT_CO2V (1: NUNQ, 1:12, 1:8))
allocate (CTCO2_TMP (1:CT_grid_N_lon, 1:CT_grid_N_lat, 1:12, 1:8))
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
@@ -0,0 +1,22 @@
esma_set_this ()


set (resource_files
GEOS_IgniGridComp.rc
)

install( FILES ${resource_files}
DESTINATION etc
)

set (srcs
GEOS_IgniGridComp.F90
cffwi.F90
)


esma_add_library (${this}
SRCS ${srcs}
DEPENDENCIES MAPL GEOS_Shared esmf
)

Loading

0 comments on commit 4689e6a

Please sign in to comment.