53 private :: landuse_read
59 character(len=H_LONG),
private :: landuse_in_basename =
'' 60 logical,
private :: landuse_in_check_coordinates = .true.
61 character(len=H_LONG),
private :: landuse_out_basename =
'' 62 character(len=H_MID),
private :: landuse_out_title =
'SCALE-RM LANDUSE' 63 character(len=H_SHORT),
private :: landuse_out_dtype =
'DEFAULT' 64 logical,
private :: landuse_allocean = .false.
65 logical,
private :: landuse_allland = .false.
66 logical,
private :: landuse_allurban = .false.
67 logical,
private :: landuse_mosaicworld = .false.
78 namelist / param_landuse / &
79 landuse_in_basename, &
80 landuse_in_check_coordinates, &
81 landuse_out_basename, &
94 if(
io_l )
write(
io_fid_log,*)
'++++++ Module[LANDUSE] / Categ[COUPLER] / Origin[SCALElib]' 100 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 101 elseif( ierr > 0 )
then 102 write(*,*)
'xxx Not appropriate names in namelist PARAM_LANDUSE. Check!' 128 if ( landuse_allocean )
then 131 elseif( landuse_allland )
then 135 elseif( landuse_allurban )
then 141 elseif( landuse_mosaicworld )
then 142 if(
io_l )
write(
io_fid_log,*)
'*** Assume all grids have ocean, land, and urban' 175 subroutine landuse_read
180 fileio_check_coordinates, &
187 real(RP) :: temp(
ia,
ja)
189 character(len=H_SHORT) :: varname
197 if ( landuse_in_basename /=
'' )
then 202 fid,
'FRAC_LAND',
'XY', step=1 )
204 fid,
'FRAC_LAKE',
'XY', step=1 )
206 fid,
'FRAC_URBAN',
'XY', step=1 )
209 fid,
'FRAC_OCEAN_abs',
'XY', step=1 )
211 fid,
'FRAC_LAND_abs',
'XY', step=1 )
213 fid,
'FRAC_URBAN_abs',
'XY', step=1 )
217 if ( landuse_in_check_coordinates )
then 218 call fileio_check_coordinates( fid )
235 write(varname,
'(A8,I1.1)')
'FRAC_PFT', p
238 fid, varname,
'XY', step=1 )
245 write(varname,
'(A9,I1.1)')
'INDEX_PFT', p
247 call fileio_read( temp(:,:), &
248 fid, varname,
'XY', step=1 )
252 call comm_vars8( temp(:,:), tag )
253 call comm_wait ( temp(:,:), tag )
261 if(
io_l )
write(
io_fid_log,*)
'*** landuse file is not specified.' 266 end subroutine landuse_read
279 real(RP) :: temp(
ia,
ja)
282 character(len=H_SHORT) :: varname
286 if ( landuse_out_basename /=
'' )
then 291 call fileio_create( fid, landuse_out_basename, landuse_out_title, &
292 landuse_out_dtype, nozcoord=.true. )
294 call fileio_def_var( fid, vid(1),
'FRAC_LAND',
'LAND fraction',
'1',
'XY', landuse_out_dtype )
295 call fileio_def_var( fid, vid(2),
'FRAC_LAKE',
'LAKE fraction',
'1',
'XY', landuse_out_dtype )
296 call fileio_def_var( fid, vid(3),
'FRAC_URBAN',
'URBAN fraction',
'1',
'XY', landuse_out_dtype )
297 call fileio_def_var( fid, vid(4),
'FRAC_OCEAN_abs',
'absolute OCEAN fraction',
'1',
'XY', landuse_out_dtype )
298 call fileio_def_var( fid, vid(5),
'FRAC_LAND_abs',
'absolute LAND fraction',
'1',
'XY', landuse_out_dtype )
299 call fileio_def_var( fid, vid(6),
'FRAC_URBAN_abs',
'absolute URBAN fraction',
'1',
'XY', landuse_out_dtype )
302 write(varname,
'(A8,I1.1)')
'FRAC_PFT', p
303 call fileio_def_var( fid, vid(7+2*(p-1)), varname,
'PFT fraction',
'1',
'XY', landuse_out_dtype )
304 write(varname,
'(A9,I1.1)')
'INDEX_PFT', p
305 call fileio_def_var( fid, vid(8+2*(p-1)), varname,
'PFT index',
'1',
'XY', landuse_out_dtype )
314 call fileio_write_var( fid, vid(5),
landuse_fact_land(:,:),
'FRAC_LAND_abs',
'XY' )
318 write(varname,
'(A8,I1.1)')
'FRAC_PFT', p
319 call fileio_write_var( fid, vid(7+2*(p-1)),
landuse_frac_pft(:,:,p), varname,
'XY' )
320 write(varname,
'(A9,I1.1)')
'INDEX_PFT', p
321 temp(:,:) =
real(LANDUSE_index_PFT(:,:,p),kind=
rp)
322 call fileio_write_var( fid, vid(8+2*(p-1)), temp(:,:), varname,
'XY' )
real(rp), dimension(:,:,:), allocatable, public landuse_frac_pft
fraction of PFT for each mosaic
subroutine, public prc_mpistop
Abort MPI.
real(rp), dimension(:,:), allocatable, public landuse_fact_urban
urban factor
logical, public io_l
output log or not? (this process)
subroutine, public landuse_setup
Setup.
subroutine, public fileio_flush(fid)
Flush all pending requests to a netCDF file (PnetCDF only)
subroutine, public landuse_calc_fact
real(rp), dimension(:,:), allocatable, public landuse_frac_urban
urban fraction
logical, public io_nml
output log or not? (for namelist, this process)
integer, public ia
of whole cells: x, local, with HALO
subroutine, public fileio_create(fid, basename, title, datatype, date, subsec, append, nozcoord)
Create/open a netCDF file.
subroutine, public landuse_write
Write landuse data.
real(rp), dimension(:,:), allocatable, public landuse_fact_ocean
ocean factor
integer, public landuse_pft_mosaic
number of PFT mosaic
integer, dimension(:,:,:), allocatable, public landuse_index_pft
index of PFT for each mosaic
subroutine, public fileio_enddef(fid)
Exit netCDF file define mode.
real(rp), dimension(:,:), allocatable, public landuse_frac_lake
lake fraction
subroutine, public fileio_open(fid, basename)
open a netCDF file for read
subroutine, public fileio_def_var(fid, vid, varname, desc, unit, axistype, datatype, timeintv, nsteps)
Define a variable to file.
integer, public landuse_pft_nmax
number of plant functional type(PFT)
subroutine, public fileio_close(fid)
Close a netCDF file.
integer, public io_fid_conf
Config file ID.
real(rp), dimension(:,:), allocatable, public landuse_fact_land
land factor
integer, public io_fid_log
Log file ID.
integer, parameter, public rp
real(rp), dimension(:,:), allocatable, public landuse_frac_land
land fraction
integer, public io_fid_nml
Log file ID (only for output namelist)
integer, public ja
of whole cells: y, local, with HALO