Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,7 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
<stream_year_last_urbantv sim_year="constant" sim_year_range="1850-2000" >2106</stream_year_last_urbantv>

<stream_fldfilename_urbantv phys="clm5_0" hgrid="0.9x1.25"
>lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc</stream_fldfilename_urbantv>
>lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c181017.nc</stream_fldfilename_urbantv>

<stream_fldfilename_urbantv phys="clm4_5" hgrid="0.9x1.25"
>lnd/clm2/urbandata/CLM45_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc</stream_fldfilename_urbantv>
Expand Down
2 changes: 1 addition & 1 deletion bld/namelist_files/namelist_defaults_ctsm_tools.xml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).

<!-- urban -->
<mksrf_furban hgrid="3x3min" lmask="LandScan2004"
>lnd/clm2/rawdata/mksrf_urban_0.05x0.05_simyr2000.c120621.nc</mksrf_furban>
>lnd/clm2/rawdata/mksrf_urban_0.05x0.05_simyr2000.c170724.nc</mksrf_furban>

<mksrf_furban hgrid="3x3min" lmask="LandScan2004" sim_year="PtVg"
>lnd/clm2/rawdata/mksrf_urban_0.05x0.05_zerourbanpct.c181014.nc</mksrf_furban>
Expand Down
7 changes: 5 additions & 2 deletions src/main/clm_initializeMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ subroutine initialize1(dtime, gindex_ocn)
use decompInitMod , only: decompInit_lnd, decompInit_clumps, decompInit_glcp, decompInit_lnd3D
use decompInitMod , only: decompInit_ocn
use domainMod , only: domain_check, ldomain, domain_init
use surfrdMod , only: surfrd_get_globmask, surfrd_get_grid, surfrd_get_data, surfrd_get_num_patches
use surfrdMod , only: surfrd_get_globmask, surfrd_get_grid, surfrd_get_data, surfrd_get_num_patches, &
surfrd_get_nlevurb
use controlMod , only: control_init, control_print, NLFilename
use ncdio_pio , only: ncd_pio_init
use initGridCellsMod , only: initGridCells
Expand Down Expand Up @@ -84,6 +85,7 @@ subroutine initialize1(dtime, gindex_ocn)
integer :: nc ! clump index
integer :: actual_maxsoil_patches ! value from surface dataset
integer :: actual_numcft ! numcft from sfc dataset
integer :: actual_nlevurb ! nlevurb from sfc dataset
integer ,pointer :: amask(:) ! global land mask
character(len=32) :: subname = 'initialize1' ! subroutine name
!-----------------------------------------------------------------------
Expand All @@ -105,7 +107,8 @@ subroutine initialize1(dtime, gindex_ocn)
call control_init(dtime)
call ncd_pio_init()
call surfrd_get_num_patches(fsurdat, actual_maxsoil_patches, actual_numcft)
call clm_varpar_init(actual_maxsoil_patches, actual_numcft)
call surfrd_get_nlevurb(fsurdat, actual_nlevurb)
call clm_varpar_init(actual_maxsoil_patches, actual_numcft, actual_nlevurb)
call clm_varcon_init( IsSimpleBuildTemp() )
call landunit_varcon_init()

Expand Down
5 changes: 3 additions & 2 deletions src/main/clm_varpar.F90
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ module clm_varpar
contains

!------------------------------------------------------------------------------
subroutine clm_varpar_init(actual_maxsoil_patches, actual_numcft)
subroutine clm_varpar_init(actual_maxsoil_patches, actual_numcft, actual_nlevurb)
!
! !DESCRIPTION:
! Initialize module variables
Expand All @@ -106,6 +106,7 @@ subroutine clm_varpar_init(actual_maxsoil_patches, actual_numcft)
implicit none
integer, intent(in) :: actual_maxsoil_patches ! value from surface dataset
integer, intent(in) :: actual_numcft ! Actual number of crops
integer, intent(in) :: actual_nlevurb ! nlevurb from surface dataset
!
! !LOCAL VARIABLES:
!
Expand Down Expand Up @@ -144,7 +145,7 @@ subroutine clm_varpar_init(actual_maxsoil_patches, actual_numcft)
max_patch_per_col= max(maxsoil_patches, actual_numcft, maxpatch_urb)

nlevsoifl = 10
nlevurb = 5
nlevurb = actual_nlevurb

if ( masterproc ) write(iulog, *) 'soil_layerstruct_predefined varpar ', soil_layerstruct_predefined
if ( masterproc ) write(iulog, *) 'soil_layerstruct_userdefined varpar ', soil_layerstruct_userdefined
Expand Down
5 changes: 5 additions & 0 deletions src/main/initVerticalMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ subroutine initVertical(bounds, glc_behavior, snow_depth, thick_wall, thick_roof
write(iulog, *) 'dzsoi_decomp: ',dzsoi_decomp
end if

if (nlevurb == ispval) then
call shr_sys_abort(' ERROR nlevurb has not been defined '//&
errMsg(sourcefile, __LINE__))
end if

if (nlevurb > 0) then
allocate(zurb_wall(bounds%begl:bounds%endl,nlevurb), &
zurb_roof(bounds%begl:bounds%endl,nlevurb), &
Expand Down
45 changes: 45 additions & 0 deletions src/main/surfrdMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module surfrdMod
public :: surfrd_get_grid ! Read grid/ladnfrac data into domain (after domain decomp)
public :: surfrd_get_data ! Read surface dataset and determine subgrid weights
public :: surfrd_get_num_patches ! Read surface dataset to determine maxsoil_patches and numcft
public :: surfrd_get_nlevurb ! Read surface dataset to determine nlevurb

! !PRIVATE MEMBER FUNCTIONS:
private :: surfrd_special ! Read the special landunits
Expand Down Expand Up @@ -499,6 +500,50 @@ subroutine surfrd_get_num_patches (lfsurdat, actual_maxsoil_patches, actual_numc
end subroutine surfrd_get_num_patches

!-----------------------------------------------------------------------

subroutine surfrd_get_nlevurb (lfsurdat, actual_nlevurb)
!
! !DESCRIPTION:
! Read nlevurb from the surface dataset
!
! !USES:
use fileutils , only : getfil
!
! !ARGUMENTS:
character(len=*), intent(in) :: lfsurdat ! surface dataset filename
integer, intent(out) :: actual_nlevurb ! nlevurb from surface dataset
!
! !LOCAL VARIABLES:
character(len=256):: locfn ! local file name
type(file_desc_t) :: ncid ! netcdf file id
integer :: dimid ! netCDF dimension id
character(len=32) :: subname = 'surfrd_get_nlevurb' ! subroutine name
!-----------------------------------------------------------------------

if (masterproc) then
write(iulog,*) 'Attempting to read nlevurb from the surface data .....'
if (lfsurdat == ' ') then
write(iulog,*)'lfsurdat must be specified'
call endrun(msg=errMsg(sourcefile, __LINE__))
endif
endif

! Open surface dataset
call getfil( lfsurdat, locfn, 0 )
call ncd_pio_openfile (ncid, trim(locfn), 0)

! Read nlevurb
call ncd_inqdlen(ncid, dimid, actual_nlevurb, 'nlevurb')

if ( masterproc )then
write(iulog,*) 'Successfully read nlevurb from the surface data'
write(iulog,*)
end if

end subroutine surfrd_get_nlevurb

!-----------------------------------------------------------------------

subroutine surfrd_special(begg, endg, ncid, ns)
!
! !DESCRIPTION:
Expand Down
2 changes: 1 addition & 1 deletion tools/mksurfdata_map/mksurfdata_map.namelist
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
outnc_double = .true.
all_urban = .false.
no_inlandwet = .true.
mksrf_furban = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_urban_0.05x0.05_simyr2000.c120621.nc'
mksrf_furban = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_urban_0.05x0.05_simyr2000.c170724.nc'
mksrf_fvegtyp = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/pftcftlandusedynharv.0.25x0.25.MODIS.simyr1850-2015.c170412/mksrf_landuse_histclm50_LUH2_2000.c170412.nc'
mksrf_fhrvtyp = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/pftcftlandusedynharv.0.25x0.25.MODIS.simyr1850-2015.c170412/mksrf_landuse_histclm50_LUH2_2000.c170412.nc'
mksrf_fsoicol = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/pftcftlandusedynharv.0.25x0.25.MODIS.simyr1850-2015.c170412/mksrf_soilcolor_simyr2005.c170413.nc'
Expand Down
4 changes: 2 additions & 2 deletions tools/mksurfdata_map/src/mkfileMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ subroutine mkfile(domain, fname, harvdata, dynlanduse)
use shr_kind_mod , only : r8 => shr_kind_r8
use shr_sys_mod , only : shr_sys_getenv
use fileutils , only : get_filename
use mkvarpar , only : nlevsoi, nlevurb, numrad, numstdpft
use mkvarpar , only : nlevsoi, numrad, numstdpft
use mkvarctl
use mkurbanparMod, only : numurbl
use mkurbanparMod, only : numurbl, nlevurb
use mkglcmecMod , only : nglcec
use mkpftMod , only : mkpftAtt
use mksoilMod , only : mksoilAtt
Expand Down
5 changes: 5 additions & 0 deletions tools/mksurfdata_map/src/mkurbanparMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module mkurbanparMod
! !USES:
use shr_kind_mod, only : r8 => shr_kind_r8
use shr_sys_mod , only : shr_sys_flush
use mkvarctl, only : ispval
implicit none

private
Expand All @@ -29,8 +30,10 @@ module mkurbanparMod

! !PUBLIC DATA MEMBERS:
integer :: numurbl ! number of urban classes
integer :: nlevurb = ispval ! number of urban layers

public :: numurbl
public :: nlevurb

! !PRIVATE DATA MEMBERS:
! flag to indicate nodata for index variables in output file:
Expand Down Expand Up @@ -80,6 +83,8 @@ subroutine mkurbanInit(datfname)
call check_ret(nf_open(datfname, 0, ncid), subname)
call check_ret(nf_inq_dimid (ncid, 'density_class', dimid), subname)
call check_ret(nf_inq_dimlen (ncid, dimid, numurbl), subname)
call check_ret(nf_inq_dimid (ncid, 'nlevurb', dimid), subname)
call check_ret(nf_inq_dimlen (ncid, dimid, nlevurb), subname)
call check_ret(nf_close(ncid), subname)

end subroutine mkurbanInit
Expand Down
1 change: 1 addition & 0 deletions tools/mksurfdata_map/src/mkvarctl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module mkvarctl
save
!
real(r8), public, parameter :: spval = 1.e36 ! special value
integer, public, parameter :: ispval = -9999 ! special value

logical, public :: outnc_large_files ! output files in 64-bit format for large files
logical, public :: outnc_double ! output ALL data in files as 64-bit
Expand Down
1 change: 0 additions & 1 deletion tools/mksurfdata_map/src/mkvarpar.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module mkvarpar
integer, parameter :: numstdpft = 16! number of standard PFT types
integer, parameter :: numstdcft = 2 ! of the number of standard PFT types, how many are crop (CFT)
integer, parameter :: noveg = 0 ! value for non-vegetated pft
integer, parameter :: nlevurb = 5 ! number of urban layers
integer, parameter :: numsolar = 2 ! number of solar types (Direct,Diffuse)
integer, parameter :: numrad = 2 ! number of solar bands (VIS,NIR)
real(r8),parameter :: elev_thresh = 2600._r8 ! elevation threshold for screening urban areas
Expand Down