Go to the documentation of this file.
74 private :: landuse_read
80 character(len=H_LONG),
private :: landuse_in_basename =
''
81 logical,
private :: landuse_in_aggregate
82 logical,
private :: landuse_in_check_coordinates = .true.
83 character(len=H_LONG),
private :: landuse_out_basename =
''
84 logical,
private :: landuse_out_aggregate
85 character(len=H_MID),
private :: landuse_out_title =
'SCALE-RM LANDUSE'
86 character(len=H_SHORT),
private :: landuse_out_dtype =
'DEFAULT'
87 logical,
private :: landuse_allocean = .false.
88 logical,
private :: landuse_allland = .false.
89 logical,
private :: landuse_allurban = .false.
90 logical,
private :: landuse_alllake = .false.
91 logical,
private :: landuse_ignore_lake = .false.
92 logical,
private :: landuse_mosaicworld = .false.
108 logical,
intent(in) :: ocean_do
109 logical,
intent(in) :: urban_do
110 logical,
intent(in) :: lake_do
112 namelist / param_landuse / &
113 landuse_in_basename, &
114 landuse_in_aggregate, &
115 landuse_in_check_coordinates, &
116 landuse_out_basename, &
117 landuse_out_aggregate, &
125 landuse_ignore_lake, &
132 log_info(
"LANDUSE_setup",*)
'Setup'
141 log_info(
"LANDUSE_setup",*)
'Not found namelist. Default used.'
142 elseif( ierr > 0 )
then
143 log_error(
"LANDUSE_setup",*)
'Not appropriate names in namelist PARAM_LANDUSE. Check!'
146 log_nml(param_landuse)
185 if ( landuse_allocean )
then
187 log_info(
"LANDUSE_setup",*)
'Assume all grids are ocean'
189 elseif( landuse_allland )
then
191 log_info(
"LANDUSE_setup",*)
'Assume all grids are land'
192 log_info(
"LANDUSE_setup",*)
'Assume land PFT is 1 (bare ground)'
195 elseif( landuse_allurban )
then
197 log_info(
"LANDUSE_setup",*)
'Assume all grids are land'
198 log_info(
"LANDUSE_setup",*)
'Assume all lands are urban'
204 elseif( landuse_alllake )
then
206 log_info(
"LANDUSE_setup",*)
'Assume all grids are land'
207 log_info(
"LANDUSE_setup",*)
'Assume all lands are lake'
213 elseif( landuse_mosaicworld )
then
215 log_info(
"LANDUSE_setup",*)
'Assume all grids have ocean, land, and urban'
217 log_info(
"LANDUSE_setup",*)
'Assume land PFT is 1 (bare ground)'
224 call landuse_read( ocean_do, urban_do, lake_do )
240 real(
rp) :: fact_soil
245 log_info(
"LANDUSE_calc_fact",*)
'calculate landuse factor'
280 logical,
intent(in),
optional :: fill_bnd
293 if (
present(fill_bnd) ) fill_bnd_ = fill_bnd
319 call comm_vars8( temp(:,:) , 9+2*(p-1) )
322 call comm_wait ( temp(:,:) , 9+2*(p-1), fill_bnd_ )
340 subroutine landuse_read( &
348 file_cartesc_check_coordinates, &
354 logical,
intent(in) :: ocean_do
355 logical,
intent(in) :: urban_do
356 logical,
intent(in) :: lake_do
360 character(len=H_SHORT) :: varname
367 log_info(
"LANDUSE_read",*)
'Input landuse file '
369 if ( landuse_in_basename /=
'' )
then
371 call file_cartesc_open( landuse_in_basename, fid, aggregate=landuse_in_aggregate )
380 write(varname,
'(A8,I1.1)')
'FRAC_PFT', p
384 write(varname,
'(A9,I1.1)')
'INDEX_PFT', p
386 call file_cartesc_read( fid, varname,
'XY', temp(:,:) )
396 if ( landuse_in_check_coordinates )
then
397 call file_cartesc_check_coordinates( fid )
409 log_error(
"LANDUSE_read",*)
'LANDUSE_frac_land is invalid: ', i,j,
landuse_frac_land(i,j)
413 log_error(
"LANDUSE_read",*)
'LANDUSE_frac_lake is invalid: ', i,j,
landuse_frac_lake(i,j)
417 log_error(
"LANDUSE_read",*)
'LANDUSE_frac_urban is invalid: ', i,j,
landuse_frac_urban(i,j)
446 if ( .not. urban_do )
then
466 if ( .not. lake_do )
then
467 if ( landuse_ignore_lake .or. (.not. ocean_do) )
then
493 log_error(
"LANDUSE_read",*)
'Not appropriate original landuse (w/ Lake). Bug!',i,j
500 log_error(
"LANDUSE_read",*)
'Not appropriate replaced landuse (w/o Lake). Bug!',i,j
512 log_info_cont(*)
'landuse file is not specified.'
513 log_info_cont(*)
'Assume all grids are ocean'
517 end subroutine landuse_read
526 file_cartesc_write_var, &
533 character(len=H_SHORT) :: varname
539 if ( landuse_out_basename /=
'' .and. landuse_out_basename /= landuse_in_basename )
then
542 log_info(
"LANDUSE_write",*)
'Output landuse file '
548 haszcoord=.false., aggregate=landuse_out_aggregate )
550 call file_cartesc_def_var( fid,
'FRAC_LAND' ,
'LAND fraction' ,
'1',
'XY', landuse_out_dtype, vid(1), standard_name=
"land_area_fraction" )
551 call file_cartesc_def_var( fid,
'FRAC_LAKE' ,
'LAKE fraction' ,
'1',
'XY', landuse_out_dtype, vid(2) )
552 call file_cartesc_def_var( fid,
'FRAC_URBAN' ,
'URBAN fraction' ,
'1',
'XY', landuse_out_dtype, vid(3) )
553 call file_cartesc_def_var( fid,
'FRAC_OCEAN_abs',
'absolute OCEAN fraction',
'1',
'XY', landuse_out_dtype, vid(4) )
554 call file_cartesc_def_var( fid,
'FRAC_LAND_abs' ,
'absolute LAND fraction' ,
'1',
'XY', landuse_out_dtype, vid(5) )
555 call file_cartesc_def_var( fid,
'FRAC_URBAN_abs',
'absolute URBAN fraction',
'1',
'XY', landuse_out_dtype, vid(6) )
556 call file_cartesc_def_var( fid,
'FRAC_LAKE_abs' ,
'absolute LAKE fraction' ,
'1',
'XY', landuse_out_dtype, vid(7) )
559 write(varname,
'(A8,I1.1)')
'FRAC_PFT', p
560 call file_cartesc_def_var( fid, varname,
'PFT fraction',
'1',
'XY', landuse_out_dtype, vid(8+2*(p-1)) )
561 write(varname,
'(A9,I1.1)')
'INDEX_PFT', p
562 call file_cartesc_def_var( fid, varname,
'PFT index',
'1',
'XY', landuse_out_dtype, vid(9+2*(p-1)) )
567 call file_cartesc_write_var( fid, vid(1),
landuse_frac_land(:,:),
'FRAC_LAND' ,
'XY' )
568 call file_cartesc_write_var( fid, vid(2),
landuse_frac_lake(:,:),
'FRAC_LAKE' ,
'XY' )
569 call file_cartesc_write_var( fid, vid(3),
landuse_frac_urban(:,:),
'FRAC_URBAN' ,
'XY' )
570 call file_cartesc_write_var( fid, vid(4),
landuse_fact_ocean(:,:),
'FRAC_OCEAN_abs',
'XY' )
571 call file_cartesc_write_var( fid, vid(5),
landuse_fact_land(:,:),
'FRAC_LAND_abs' ,
'XY' )
572 call file_cartesc_write_var( fid, vid(6),
landuse_fact_urban(:,:),
'FRAC_URBAN_abs',
'XY' )
573 call file_cartesc_write_var( fid, vid(7),
landuse_fact_lake(:,:),
'FRAC_LAKE_abs' ,
'XY' )
576 write(varname,
'(A8,I1.1)')
'FRAC_PFT', p
577 call file_cartesc_write_var( fid, vid(8+2*(p-1)),
landuse_frac_pft(:,:,p), varname,
'XY' )
578 write(varname,
'(A9,I1.1)')
'INDEX_PFT', p
580 call file_cartesc_write_var( fid, vid(9+2*(p-1)), temp(:,:), varname,
'XY' )
597 log_info(
"LANDUSE_finalize",*)
'Finalize'
real(rp), dimension(:,:), allocatable, public landuse_fact_lake
lake factor
real(rp), dimension(:,:), allocatable, public landuse_fact_ocean
ocean factor
subroutine, public prc_abort
Abort Process.
subroutine, public file_cartesc_enddef(fid)
Exit netCDF file define mode.
subroutine, public landuse_calc_fact
subroutine, public file_cartesc_def_var(fid, varname, desc, unit, dim_type, datatype, vid, standard_name, timeintv, nsteps, cell_measures)
Define a variable to file.
logical, dimension(:,:), allocatable, public landuse_exists_lake
lake calculation flag
subroutine, public landuse_setup(OCEAN_do, URBAN_do, LAKE_do)
Setup.
integer, parameter, public landuse_index_ocean
ocean index
integer, public landuse_pft_mosaic
number of PFT mosaic
logical, dimension(:,:), allocatable, public landuse_exists_land
land calculation flag
integer, parameter, public rp
real(rp), dimension(:,:), allocatable, public landuse_frac_urban
urban fraction
integer, public ie
end point of inner domain: x, local
module atmosphere / grid / cartesC index
real(rp), dimension(:,:), allocatable, public landuse_frac_land
land fraction
integer, dimension(:,:,:), allocatable, public landuse_index_pft
index of PFT for each mosaic
subroutine, public file_cartesc_close(fid)
Close a netCDF file.
integer, public landuse_pft_nmax
number of plant functional type(PFT)
integer, public is
start point of inner domain: x, local
integer, parameter, public landuse_index_urban
urban index
real(rp), dimension(:,:,:), allocatable, public landuse_frac_pft
fraction of PFT for each mosaic
real(rp), dimension(:,:), allocatable, public landuse_frac_lake
lake fraction
real(rp), dimension(:,:), allocatable, public landuse_fact_land
land factor
logical, dimension(:,:), allocatable, public landuse_exists_ocean
ocean calculation flag
logical, public file_aggregate
subroutine, public file_cartesc_create(basename, title, datatype, fid, date, subsec, haszcoord, append, aggregate, single)
Create/open a netCDF file.
subroutine, public landuse_finalize
Finalize.
subroutine, public file_cartesc_flush(fid)
Flush all pending requests to a netCDF file (PnetCDF only)
logical, dimension(:,:), allocatable, public landuse_exists_urban
urban calculation flag
integer, public js
start point of inner domain: y, local
integer, parameter, public landuse_index_lake
lake index
subroutine, public landuse_write
Write landuse data.
subroutine, public file_cartesc_open(basename, fid, single, aggregate)
open a netCDF file for read
real(rp), dimension(:,:), allocatable, public landuse_fact_urban
urban factor
integer, public io_fid_conf
Config file ID.
integer, public je
end point of inner domain: y, local
subroutine, public landuse_fillhalo(FILL_BND)
HALO Communication.
integer, parameter, public landuse_pft_nmin
minimum number of PFT type