SCALE-RM
Functions/Subroutines | Variables
scale_landuse Module Reference

module LANDUSE More...

Functions/Subroutines

subroutine, public landuse_setup
 Setup. More...
 
subroutine, public landuse_calc_fact
 
subroutine, public landuse_write
 Write landuse data. More...
 

Variables

real(rp), dimension(:,:), allocatable, public landuse_fact_ocean
 ocean factor More...
 
real(rp), dimension(:,:), allocatable, public landuse_fact_land
 land factor More...
 
real(rp), dimension(:,:), allocatable, public landuse_fact_urban
 urban factor More...
 
real(rp), dimension(:,:), allocatable, public landuse_frac_land
 land fraction More...
 
real(rp), dimension(:,:), allocatable, public landuse_frac_lake
 lake fraction More...
 
real(rp), dimension(:,:), allocatable, public landuse_frac_urban
 urban fraction More...
 
integer, public landuse_pft_mosaic = 2
 number of PFT mosaic More...
 
integer, public landuse_pft_nmax = 15
 number of plant functional type(PFT) More...
 
real(rp), dimension(:,:,:), allocatable, public landuse_frac_pft
 fraction of PFT for each mosaic More...
 
integer, dimension(:,:,:), allocatable, public landuse_index_pft
 index of PFT for each mosaic More...
 

Detailed Description

module LANDUSE

Description
Land use category module Manage land/lake/urban/PFT fraction and PFT index
Author
Team SCALE
NAMELIST
  • PARAM_LANDUSE
    nametypedefault valuecomment
    LANDUSE_IN_BASENAME character(len=H_LONG) '' basename of the input file
    LANDUSE_IN_CHECK_COORDINATES logical .true. switch for check of coordinates
    LANDUSE_OUT_BASENAME character(len=H_LONG) '' basename of the output file
    LANDUSE_OUT_DTYPE character(len=H_SHORT) 'DEFAULT' REAL4 or REAL8
    LANDUSE_PFT_MOSAIC integer 2 number of PFT mosaic
    LANDUSE_PFT_NMAX integer 15 number of plant functional type(PFT)
    LANDUSE_ALLOCEAN logical .false.
    LANDUSE_ALLLAND logical .false.
    LANDUSE_ALLURBAN logical .false.
    LANDUSE_MOSAICWORLD logical .false.

History Output
No history output

Function/Subroutine Documentation

◆ landuse_setup()

subroutine, public scale_landuse::landuse_setup ( )

Setup.

Definition at line 74 of file scale_landuse.F90.

References scale_grid_index::ia, scale_stdio::io_fid_conf, scale_stdio::io_fid_log, scale_stdio::io_fid_nml, scale_stdio::io_l, scale_stdio::io_nml, scale_grid_index::ja, landuse_calc_fact(), landuse_fact_land, landuse_fact_ocean, landuse_fact_urban, landuse_frac_lake, landuse_frac_land, landuse_frac_pft, landuse_frac_urban, landuse_index_pft, landuse_pft_mosaic, landuse_pft_nmax, and scale_process::prc_mpistop().

Referenced by mod_rm_driver::scalerm(), and mod_rm_prep::scalerm_prep().

74  use scale_process, only: &
76  implicit none
77 
78  namelist / param_landuse / &
79  landuse_in_basename, &
80  landuse_in_check_coordinates, &
81  landuse_out_basename, &
82  landuse_out_dtype, &
83  landuse_pft_mosaic, &
84  landuse_pft_nmax, &
85  landuse_allocean, &
86  landuse_allland, &
87  landuse_allurban, &
88  landuse_mosaicworld
89 
90  integer :: ierr
91  !---------------------------------------------------------------------------
92 
93  if( io_l ) write(io_fid_log,*)
94  if( io_l ) write(io_fid_log,*) '++++++ Module[LANDUSE] / Categ[COUPLER] / Origin[SCALElib]'
95 
96  !--- read namelist
97  rewind(io_fid_conf)
98  read(io_fid_conf,nml=param_landuse,iostat=ierr)
99  if( ierr < 0 ) then !--- missing
100  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
101  elseif( ierr > 0 ) then !--- fatal error
102  write(*,*) 'xxx Not appropriate names in namelist PARAM_LANDUSE. Check!'
103  call prc_mpistop
104  endif
105  if( io_nml ) write(io_fid_nml,nml=param_landuse)
106 
107  allocate( landuse_frac_land(ia,ja) )
108  allocate( landuse_frac_lake(ia,ja) )
109  allocate( landuse_frac_urban(ia,ja) )
110  landuse_frac_land(:,:) = 0.0_rp
111  landuse_frac_lake(:,:) = 0.0_rp
112  landuse_frac_urban(:,:) = 0.0_rp
113 
114  allocate( landuse_index_pft(ia,ja,landuse_pft_mosaic) )
115  allocate( landuse_frac_pft(ia,ja,landuse_pft_mosaic) )
116  landuse_frac_pft(:,:,:) = 0.0_rp
117  landuse_frac_pft(:,:,1) = 1.0_rp ! tentative, mosaic is off
118  landuse_index_pft(:,:,:) = 1 ! default
119 
120  allocate( landuse_fact_ocean(ia,ja) )
121  allocate( landuse_fact_land(ia,ja) )
122  allocate( landuse_fact_urban(ia,ja) )
123  landuse_fact_ocean(:,:) = 0.0_rp
124  landuse_fact_land(:,:) = 0.0_rp
125  landuse_fact_urban(:,:) = 0.0_rp
126 
127 
128  if ( landuse_allocean ) then
129  if( io_l ) write(io_fid_log,*) '*** Assume all grids are ocean'
130  call landuse_calc_fact
131  elseif( landuse_allland ) then
132  if( io_l ) write(io_fid_log,*) '*** Assume all grids are land'
133  landuse_frac_land(:,:) = 1.0_rp
134  call landuse_calc_fact
135  elseif( landuse_allurban ) then
136  if( io_l ) write(io_fid_log,*) '*** Assume all grids are land'
137  landuse_frac_land(:,:) = 1.0_rp
138  if( io_l ) write(io_fid_log,*) '*** Assume all lands are urban'
139  landuse_frac_urban(:,:) = 1.0_rp
140  call landuse_calc_fact
141  elseif( landuse_mosaicworld ) then
142  if( io_l ) write(io_fid_log,*) '*** Assume all grids have ocean, land, and urban'
143  landuse_frac_land(:,:) = 0.5_rp
144  landuse_frac_urban(:,:) = 0.5_rp
145  call landuse_calc_fact
146  else
147  ! read from file
148  call landuse_read
149  endif
150 
151  return
subroutine, public prc_mpistop
Abort MPI.
module PROCESS
integer, public io_fid_conf
Config file ID.
Definition: scale_stdio.F90:55
real(rp), dimension(:,:), allocatable, public landuse_fact_land
land factor
Here is the call graph for this function:
Here is the caller graph for this function:

◆ landuse_calc_fact()

subroutine, public scale_landuse::landuse_calc_fact ( )

Definition at line 156 of file scale_landuse.F90.

References scale_fileio::fileio_close(), scale_fileio::fileio_flush(), scale_fileio::fileio_open(), scale_stdio::io_fid_log, scale_stdio::io_l, landuse_fact_land, landuse_fact_ocean, landuse_fact_urban, landuse_frac_lake, landuse_frac_land, landuse_frac_pft, landuse_frac_urban, landuse_index_pft, and landuse_pft_mosaic.

Referenced by mod_cnvlanduse::cnvlanduse(), mod_mkinit::interporation_fact(), and landuse_setup().

156  implicit none
157  !---------------------------------------------------------------------------
158 
159  if( io_l ) write(io_fid_log,*)
160  if( io_l ) write(io_fid_log,*) '+++ calculate landuse factor'
161 
162  ! tentative treatment: The area of the lake is treated as the ocean
163  landuse_frac_land(:,:) = landuse_frac_land(:,:) * ( 1.0_rp - landuse_frac_lake(:,:) )
164 
165  ! make factors
166  landuse_fact_ocean(:,:) = ( 1.0_rp - landuse_frac_land(:,:) )
167  landuse_fact_land(:,:) = ( landuse_frac_land(:,:) ) * ( 1.0_rp - landuse_frac_urban(:,:) )
168  landuse_fact_urban(:,:) = ( landuse_frac_land(:,:) ) * ( landuse_frac_urban(:,:) )
169 
170  return
real(rp), dimension(:,:), allocatable, public landuse_fact_land
land factor
Here is the call graph for this function:
Here is the caller graph for this function:

◆ landuse_write()

subroutine, public scale_landuse::landuse_write ( )

Write landuse data.

Definition at line 271 of file scale_landuse.F90.

References scale_fileio::fileio_close(), scale_fileio::fileio_create(), scale_fileio::fileio_def_var(), scale_fileio::fileio_enddef(), scale_stdio::io_fid_log, scale_stdio::io_l, landuse_fact_land, landuse_fact_ocean, landuse_fact_urban, landuse_frac_lake, landuse_frac_land, landuse_frac_pft, landuse_frac_urban, and landuse_pft_mosaic.

Referenced by mod_cnvlanduse::cnvlanduse(), and mod_mkinit::mkinit().

271  use scale_fileio, only: &
272  fileio_create, &
273  fileio_def_var, &
274  fileio_enddef, &
275  fileio_write_var, &
277  implicit none
278 
279  real(RP) :: temp(IA,JA)
280 
281  integer :: fid, vid(6+LANDUSE_PFT_mosaic*2)
282  character(len=H_SHORT) :: varname
283  integer :: p
284  !---------------------------------------------------------------------------
285 
286  if ( landuse_out_basename /= '' ) then
287 
288  if( io_l ) write(io_fid_log,*)
289  if( io_l ) write(io_fid_log,*) '*** Output landuse file ***'
290 
291  call fileio_create( fid, landuse_out_basename, landuse_out_title, &
292  landuse_out_dtype, nozcoord=.true. )
293 
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 )
300 
301  do p = 1, landuse_pft_mosaic
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 )
306  end do
307 
308  call fileio_enddef( fid )
309 
310  call fileio_write_var( fid, vid(1), landuse_frac_land(:,:), 'FRAC_LAND', 'XY' )
311  call fileio_write_var( fid, vid(2), landuse_frac_lake(:,:), 'FRAC_LAKE', 'XY' )
312  call fileio_write_var( fid, vid(3), landuse_frac_urban(:,:), 'FRAC_URBAN', 'XY' )
313  call fileio_write_var( fid, vid(4), landuse_fact_ocean(:,:), 'FRAC_OCEAN_abs', 'XY' )
314  call fileio_write_var( fid, vid(5), landuse_fact_land(:,:), 'FRAC_LAND_abs', 'XY' )
315  call fileio_write_var( fid, vid(6), landuse_fact_urban(:,:), 'FRAC_URBAN_abs', 'XY' )
316 
317  do p = 1, landuse_pft_mosaic
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' )
323  end do
324 
325  call fileio_close( fid )
326 
327  end if
328 
329  return
module FILE I/O (netcdf)
subroutine, public fileio_create(fid, basename, title, datatype, date, subsec, append, nozcoord)
Create/open a netCDF file.
subroutine, public fileio_enddef(fid)
Exit netCDF file define mode.
subroutine, public fileio_def_var(fid, vid, varname, desc, unit, axistype, datatype, timeintv, nsteps)
Define a variable to file.
subroutine, public fileio_close(fid)
Close a netCDF file.
real(rp), dimension(:,:), allocatable, public landuse_fact_land
land factor
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ landuse_fact_ocean

real(rp), dimension(:,:), allocatable, public scale_landuse::landuse_fact_ocean

◆ landuse_fact_land

real(rp), dimension (:,:), allocatable, public scale_landuse::landuse_fact_land

◆ landuse_fact_urban

real(rp), dimension(:,:), allocatable, public scale_landuse::landuse_fact_urban

◆ landuse_frac_land

real(rp), dimension (:,:), allocatable, public scale_landuse::landuse_frac_land

land fraction

Definition at line 39 of file scale_landuse.F90.

Referenced by mod_cnvlanduse::cnvlanduse(), scale_history::hist_setup(), mod_mkinit::interporation_fact(), landuse_calc_fact(), landuse_setup(), landuse_write(), and mod_realinput::parentatomsetup().

39  real(RP), public, allocatable :: LANDUSE_frac_land (:,:)

◆ landuse_frac_lake

real(rp), dimension (:,:), allocatable, public scale_landuse::landuse_frac_lake

lake fraction

Definition at line 40 of file scale_landuse.F90.

Referenced by mod_cnvlanduse::cnvlanduse(), landuse_calc_fact(), landuse_setup(), and landuse_write().

40  real(RP), public, allocatable :: LANDUSE_frac_lake (:,:)

◆ landuse_frac_urban

real(rp), dimension(:,:), allocatable, public scale_landuse::landuse_frac_urban

urban fraction

Definition at line 41 of file scale_landuse.F90.

Referenced by mod_cnvlanduse::cnvlanduse(), mod_mkinit::interporation_fact(), landuse_calc_fact(), landuse_setup(), and landuse_write().

41  real(RP), public, allocatable :: LANDUSE_frac_urban(:,:)

◆ landuse_pft_mosaic

integer, public scale_landuse::landuse_pft_mosaic = 2

number of PFT mosaic

Definition at line 43 of file scale_landuse.F90.

Referenced by mod_cnvlanduse::cnvlanduse(), landuse_calc_fact(), landuse_setup(), and landuse_write().

43  integer, public :: LANDUSE_PFT_mosaic = 2

◆ landuse_pft_nmax

integer, public scale_landuse::landuse_pft_nmax = 15

number of plant functional type(PFT)

Definition at line 44 of file scale_landuse.F90.

Referenced by mod_cnvlanduse::cnvlanduse(), mod_land_vars::land_vars_external_in(), mod_land_vars::land_vars_setup(), and landuse_setup().

44  integer, public :: LANDUSE_PFT_nmax = 15

◆ landuse_frac_pft

real(rp), dimension (:,:,:), allocatable, public scale_landuse::landuse_frac_pft

fraction of PFT for each mosaic

Definition at line 46 of file scale_landuse.F90.

Referenced by mod_cnvlanduse::cnvlanduse(), landuse_calc_fact(), landuse_setup(), and landuse_write().

46  real(RP), public, allocatable :: LANDUSE_frac_PFT (:,:,:)

◆ landuse_index_pft

integer, dimension(:,:,:), allocatable, public scale_landuse::landuse_index_pft

index of PFT for each mosaic

Definition at line 47 of file scale_landuse.F90.

Referenced by mod_cnvlanduse::cnvlanduse(), mod_land_vars::land_vars_setup(), landuse_calc_fact(), and landuse_setup().

47  integer, public, allocatable :: LANDUSE_index_PFT(:,:,:)