SCALE-RM
Functions/Subroutines | Variables
mod_realinput Module Reference

module REAL input More...

Functions/Subroutines

subroutine, public realinput_atmos
 
subroutine, public realinput_surface
 
subroutine land_interporation (tg, strg, lst, albg, ust, albu, tg_org, strg_org, smds_org, lst_org, albg_org, ust_org, sst_org, lmask_org, lsmask_nest, topo_org, lz_org, llon_org, llat_org, LCZ, LON, LAT, ldims, odims, maskval_tg, maskval_strg, init_landwater_ratio, use_file_landwater, use_waterratio, soilwater_ds2vc_flag, elevation_collection, intrp_iter_max, ol_interp, URBAN_do)
 
subroutine make_mask (gmask, data, nx, ny, landdata)
 
subroutine replace_misval_const (data, maskval, frac_land)
 
subroutine replace_misval_map (data, maskval, nx, ny, elem)
 

Variables

integer, parameter, public iscale = 1
 
integer, parameter, public iwrfarw = 2
 
integer, parameter, public igrads = 4
 

Detailed Description

module REAL input

Description
read data from file for real atmospheric simulations
Author
Team SCALE
NAMELIST
  • PARAM_MKINIT_REAL_ATMOS
    nametypedefault valuecomment
    NUMBER_OF_FILES integer 1
    NUMBER_OF_TSTEPS integer 1 num of time steps in one file
    NUMBER_OF_SKIP_TSTEPS integer 0 num of skipped first several data
    SERIAL_PROC_READ logical .true. read by one MPI process and broadcast
    FILETYPE_ORG character(len=H_LONG) ''
    BASENAME_ORG character(len=H_LONG) ''
    BASENAME_ADD_NUM logical .false.
    BASENAME_BOUNDARY character(len=H_LONG) ''
    BOUNDARY_POSTFIX_TIMELABEL logical .false.
    BOUNDARY_TITLE character(len=H_LONG) 'SCALE-RM BOUNDARY CONDITION for REAL CASE'
    BOUNDARY_DTYPE character(len=H_SHORT) 'DEFAULT'
    BOUNDARY_UPDATE_DT real(DP) 0.0_DP inteval time of boudary data update [s]
    FILTER_ORDER integer 8 order of the hyper-diffusion (must be even)
    FILTER_NITER integer 5 times for hyper-diffusion iteration
    USE_FILE_DENSITY logical .false. use density data from files
    SAME_MP_TYPE logical .false. microphysics type of the parent model is same as it in this model

  • PARAM_MKINIT_REAL_LAND
    nametypedefault valuecomment
    NUMBER_OF_FILES integer 1
    NUMBER_OF_TSTEPS integer 1 num of time steps in one file
    NUMBER_OF_SKIP_TSTEPS integer 0 num of skipped first several data
    FILETYPE_ORG character(len=H_LONG) ''
    BASENAME_ORG character(len=H_LONG) ''
    BASENAME_ADD_NUM logical .false.
    BASENAME_BOUNDARY character(len=H_LONG) ''
    BOUNDARY_POSTFIX_TIMELABEL logical .false.
    BOUNDARY_TITLE character(len=H_LONG) 'SCALE-RM BOUNDARY CONDITION for REAL CASE'
    BOUNDARY_UPDATE_DT real(DP) 0.0_DP inteval time of boudary data update [s]
    USE_FILE_LANDWATER logical
    INIT_LANDWATER_RATIO real(RP)
    INTRP_LAND_TEMP character(len=*)
    INTRP_LAND_WATER character(len=*)
    INTRP_LAND_SFC_TEMP character(len=*)
    INTRP_ITER_MAX integer
    FILTER_ORDER integer 8 order of the hyper-diffusion (must be even)
    FILTER_NITER integer 5 times for hyper-diffusion iteration
    SOILWATER_DS2VC character(len=H_SHORT) 'limit'
    ELEVATION_COLLECTION logical
    SERIAL_PROC_READ logical .true. read by one MPI process and broadcast

  • PARAM_MKINIT_REAL_OCEAN
    nametypedefault valuecomment
    NUMBER_OF_FILES integer 1
    NUMBER_OF_TSTEPS integer 1 num of time steps in one file
    NUMBER_OF_SKIP_TSTEPS integer 0 num of skipped first several data
    FILETYPE_ORG character(len=H_LONG) ''
    BASENAME_ORG character(len=H_LONG) ''
    BASENAME_ADD_NUM logical .false.
    BASENAME_BOUNDARY character(len=H_LONG) ''
    BOUNDARY_POSTFIX_TIMELABEL logical .false.
    BOUNDARY_TITLE character(len=H_LONG) 'SCALE-RM BOUNDARY CONDITION for REAL CASE'
    BOUNDARY_UPDATE_DT real(DP) 0.0_DP inteval time of boudary data update [s]
    INIT_OCEAN_ALB_LW real(RP)
    INIT_OCEAN_ALB_SW real(RP)
    INIT_OCEAN_Z0W real(RP)
    INTRP_OCEAN_TEMP character(len=*)
    INTRP_OCEAN_SFC_TEMP character(len=*)
    INTRP_ITER_MAX integer
    FILTER_ORDER integer 8 order of the hyper-diffusion (must be even)
    FILTER_NITER integer 5 times for hyper-diffusion iteration
    SERIAL_PROC_READ logical .true. read by one MPI process and broadcast

History Output
No history output

Function/Subroutine Documentation

◆ realinput_atmos()

subroutine, public mod_realinput::realinput_atmos ( )

Definition at line 167 of file mod_realinput.F90.

References mod_atmos_admin::atmos_phy_mp_type, mod_atmos_vars::dens, scale_atmos_grid_cartesc_index::ia, scale_io::io_fid_conf, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::ka, mod_atmos_vars::momx, mod_atmos_vars::momy, mod_atmos_vars::momz, scale_prc::prc_abort(), scale_tracer::qa, mod_atmos_vars::qtrc, mod_atmos_vars::rhot, and scale_time::time_gettimelabel().

Referenced by mod_mkinit::read_sounding().

167  use scale_time, only: &
169  use mod_atmos_vars, only: &
170  dens, &
171  momz, &
172  momx, &
173  momy, &
174  rhot, &
175  qtrc
176  use mod_atmos_admin, only: &
178  implicit none
179 
180  namelist / param_mkinit_real_atmos / &
181  number_of_files, &
182  number_of_tsteps, &
183  number_of_skip_tsteps, &
184  serial_proc_read, &
185  filetype_org, &
186  basename_org, &
187  basename_add_num, &
188  basename_boundary, &
189  boundary_postfix_timelabel, &
190  boundary_title, &
191  boundary_dtype, &
192  boundary_update_dt, &
193  filter_order, &
194  filter_niter, &
195  use_file_density, &
196  same_mp_type
197 
198  character(len=H_LONG) :: basename_mod
199  character(len=H_LONG) :: basename_out_mod
200  character(len=19) :: timelabel
201 
202  integer :: dims(6) ! dims 1-3: normal, 4-6: staggerd
203  integer :: timelen
204 
205  integer :: fid_atmos
206  integer :: vid_atmos(5+qa)
207 
208  real(RP) :: dens_in(ka,ia,ja)
209  real(RP) :: momz_in(ka,ia,ja) ! staggered point
210  real(RP) :: momx_in(ka,ia,ja) ! staggered point
211  real(RP) :: momy_in(ka,ia,ja) ! staggered point
212  real(RP) :: rhot_in(ka,ia,ja)
213  real(RP) :: qtrc_in(ka,ia,ja,qa)
214 
215  real(RP) :: velz_in(ka,ia,ja) ! staggered point
216  real(RP) :: velx_in(ka,ia,ja) ! staggered point
217  real(RP) :: vely_in(ka,ia,ja) ! staggered point
218  real(RP) :: pott_in(ka,ia,ja)
219 
220  integer :: ifile, istep, t, tall
221  integer :: k, i, j, iq
222  integer :: ierr
223  !---------------------------------------------------------------------------
224 
225  log_newline
226  log_info('REALINPUT_atmos',*) 'Setup'
227 
228  !--- read namelist
229  rewind(io_fid_conf)
230  read(io_fid_conf,nml=param_mkinit_real_atmos,iostat=ierr)
231  if( ierr < 0 ) then !--- missing
232  log_info("REALINPUT_atmos",*) 'Not found namelist. Default used.'
233  elseif( ierr > 0 ) then !--- fatal error
234  log_error("REALINPUT_atmos",*) 'Not appropriate names in namelist PARAM_MKINIT_REAL_ATMOS. Check!'
235  call prc_abort
236  endif
237  log_nml(param_mkinit_real_atmos)
238 
239  if ( boundary_update_dt <= 0.0_dp ) then
240  log_error("REALINPUT_atmos",*) 'BOUNDARY_UPDATE_DT is necessary in real case preprocess'
241  call prc_abort
242  endif
243 
244  if ( filetype_org == 'GrADS' ) then
245  basename_mod = trim(basename_org) ! namelist file name
246  else
247  if ( number_of_files > 1 .OR. basename_add_num ) then
248  basename_mod = trim(basename_org)//'_00000'
249  else
250  basename_mod = trim(basename_org)
251  endif
252  endif
253 
254  call parentatmossetup( filetype_org, & ![IN]
255  basename_mod, & ![IN]
256  serial_proc_read, & ![IN]
257  use_file_density, & ![IN]
258  dims(:), & ![OUT]
259  timelen ) ![OUT]
260 
261  if ( timelen > 0 ) then
262  number_of_tsteps = timelen ! read from file
263  endif
264 
265  log_newline
266  log_info("REALINPUT_atmos",*) 'Number of temporal data in each file : ', number_of_tsteps
267 
268  do ifile = 1, number_of_files
269 
270  if ( filetype_org == 'GrADS' ) then
271  if ( number_of_files > 1 .OR. basename_add_num ) then
272  write(basename_mod,'(A,I5.5)') '_', ifile-1 ! only the number postfix
273  else
274  basename_mod = ''
275  endif
276  else
277  if ( number_of_files > 1 .OR. basename_add_num ) then
278  write(basename_mod,'(A,A,I5.5)') trim(basename_org), '_', ifile-1
279  else
280  basename_mod = trim(basename_org)
281  endif
282  endif
283 
284  log_newline
285  log_info("REALINPUT_atmos",*) 'read external data from : ', trim(basename_mod)
286 
287  call parentatmosopen( filetype_org, & ![IN]
288  basename_mod, & ![IN]
289  dims(:) ) ![IN]
290 
291  do istep = 1, number_of_tsteps
292 
293  tall = number_of_tsteps * (ifile-1) + istep ! consecutive time step (input)
294  t = tall - number_of_skip_tsteps ! time step (output)
295 
296  if ( t <= 0 ) then
297  log_progress('(1x,A,I4,A,I5,A,I6,A)') &
298  '[file,step,cons.] = [', ifile, ',', istep, ',', tall, '] ...skip.'
299  cycle
300  endif
301 
302  if ( t == 1 .OR. basename_boundary /= '' ) then
303 
304  log_progress('(1x,A,I4,A,I5,A,I6,A)') &
305  '[file,step,cons.] = [', ifile, ',', istep, ',', tall, ']'
306 
307  ! read prepared data
308  call parentatmosinput( filetype_org, & ! [IN]
309  basename_mod, & ! [IN]
310  dims(:), & ! [IN]
311  istep, & ! [IN]
312  same_mp_type, & ! [IN]
313  dens_in(:,:,:), & ! [OUT]
314  momz_in(:,:,:), & ! [OUT]
315  momx_in(:,:,:), & ! [OUT]
316  momy_in(:,:,:), & ! [OUT]
317  rhot_in(:,:,:), & ! [OUT]
318  qtrc_in(:,:,:,:), & ! [OUT]
319  velz_in(:,:,:), & ! [OUT]
320  velx_in(:,:,:), & ! [OUT]
321  vely_in(:,:,:), & ! [OUT]
322  pott_in(:,:,:) ) ! [OUT]
323  else
324  log_progress('(1x,A,I4,A,I5,A,I6,A)') &
325  '[file,step,cons.] = [', ifile, ',', istep, ',', tall, '] ...skip.'
326  endif
327 
328  !--- store prognostic variables as initial
329  if ( t == 1 ) then
330  log_newline
331  log_info("REALINPUT_atmos",*) 'store initial state.'
332 
333  do j = 1, ja
334  do i = 1, ia
335  do k = 1, ka
336  dens(k,i,j) = dens_in(k,i,j)
337  momz(k,i,j) = momz_in(k,i,j)
338  momx(k,i,j) = momx_in(k,i,j)
339  momy(k,i,j) = momy_in(k,i,j)
340  rhot(k,i,j) = rhot_in(k,i,j)
341  enddo
342  enddo
343  enddo
344 
345  do iq = 1, qa
346  do j = 1, ja
347  do i = 1, ia
348  do k = 1, ka
349  qtrc(k,i,j,iq) = qtrc_in(k,i,j,iq)
350  enddo
351  enddo
352  enddo
353  enddo
354 
355  endif
356 
357  !--- output boundary data
358  if ( basename_boundary /= '' ) then
359 
360  if ( t == 1 ) then
361  if ( boundary_postfix_timelabel ) then
362  call time_gettimelabel( timelabel )
363  basename_out_mod = trim(basename_boundary)//'_'//trim(timelabel)
364  else
365  basename_out_mod = trim(basename_boundary)
366  endif
367 
368  call boundaryatmossetup( basename_out_mod, & ! [IN]
369  boundary_title, & ! [IN]
370  boundary_dtype, & ! [IN]
371  boundary_update_dt, & ! [IN]
372  fid_atmos, & ! [OUT]
373  vid_atmos(:) ) ! [OUT]
374  endif
375 
376  call boundaryatmosoutput( dens_in(:,:,:), & ! [IN]
377  velz_in(:,:,:), & ! [IN]
378  velx_in(:,:,:), & ! [IN]
379  vely_in(:,:,:), & ! [IN]
380  pott_in(:,:,:), & ! [IN]
381  qtrc_in(:,:,:,:), & ! [IN]
382  fid_atmos, & ! [IN]
383  vid_atmos(:), & ! [IN]
384  boundary_update_dt, & ! [IN]
385  t ) ! [IN]
386  endif
387 
388  enddo ! istep loop
389  enddo ! ifile loop
390 
391  return
module ATMOS admin
real(rp), dimension(:,:,:), allocatable, target, public momz
real(rp), dimension(:,:,:), allocatable, target, public rhot
module ATMOSPHERIC Variables
real(rp), dimension(:,:,:), allocatable, target, public momx
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:55
real(rp), dimension(:,:,:), allocatable, target, public dens
subroutine, public time_gettimelabel(timelabel)
generate time label
Definition: scale_time.F90:94
module TIME
Definition: scale_time.F90:16
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
character(len=h_short), public atmos_phy_mp_type
real(rp), dimension(:,:,:), allocatable, target, public momy
real(rp), dimension(:,:,:,:), allocatable, target, public qtrc
Here is the call graph for this function:
Here is the caller graph for this function:

◆ realinput_surface()

subroutine, public mod_realinput::realinput_surface ( )

Definition at line 396 of file mod_realinput.F90.

References scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_rotc, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_cz, scale_atmos_hydrometeor::atmos_hydrometeor_dry, mod_atmos_admin::atmos_phy_ch_type, mod_atmos_phy_mp_driver::atmos_phy_mp_driver_qhyd2qtrc(), mod_atmos_phy_sf_vars::atmos_phy_sf_sfc_albedo, mod_atmos_phy_sf_vars::atmos_phy_sf_sfc_temp, mod_atmos_phy_sf_vars::atmos_phy_sf_sfc_z0e, mod_atmos_phy_sf_vars::atmos_phy_sf_sfc_z0h, mod_atmos_phy_sf_vars::atmos_phy_sf_sfc_z0m, scale_comm_cartesc_nest::comm_cartesc_nest_interp_level, scale_const::const_eps, scale_const::const_i_lw, scale_const::const_i_sw, scale_const::const_laps, scale_const::const_undef, mod_atmos_vars::dens, scale_file_cartesc::file_cartesc_create(), scale_file_cartesc::file_cartesc_def_var(), scale_file_cartesc::file_cartesc_enddef(), scale_atmos_hydrometeor::i_qv, scale_cpl_sfc_index::i_r_diffuse, scale_cpl_sfc_index::i_r_direct, scale_cpl_sfc_index::i_r_ir, scale_cpl_sfc_index::i_r_nir, scale_cpl_sfc_index::i_r_vis, scale_atmos_grid_cartesc_index::ia, scale_atmos_grid_cartesc_index::ie, igrads, scale_interp::interp_domain_compatibility(), scale_interp::interp_factor2d(), scale_interp::interp_factor3d(), scale_interp::interp_interp2d(), scale_interp::interp_interp3d(), scale_io::io_fid_conf, scale_atmos_grid_cartesc_index::is, iscale, iwrfarw, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::je, scale_atmos_grid_cartesc_index::js, scale_atmos_grid_cartesc_index::ka, scale_atmos_grid_cartesc_index::ke, scale_atmos_grid_cartesc_index::ks, mod_land_admin::land_do, scale_land_grid_cartesc::land_grid_cartesc_cz, land_interporation(), mod_land_vars::land_sfc_albedo, mod_land_vars::land_sfc_temp, mod_land_vars::land_temp, mod_land_vars::land_water, scale_landuse::landuse_fact_land, scale_landuse::landuse_fact_ocean, scale_landuse::landuse_fact_urban, scale_landuse::landuse_frac_land, scale_land_grid_cartesc_index::lkmax, make_mask(), mod_atmos_vars::momx, mod_atmos_vars::momy, mod_atmos_vars::momz, scale_atmos_hydrometeor::n_hyd, scale_cpl_sfc_index::n_rad_dir, scale_cpl_sfc_index::n_rad_rgn, mod_ocean_admin::ocean_do, mod_ocean_vars::ocean_ice_mass, mod_ocean_vars::ocean_ice_temp, mod_ocean_vars::ocean_ocn_z0m, scale_ocean_phy_ice_simple::ocean_phy_ice_freezetemp, mod_ocean_vars::ocean_salt, mod_ocean_vars::ocean_sfc_albedo, mod_ocean_vars::ocean_sfc_temp, mod_ocean_vars::ocean_sfc_z0e, mod_ocean_vars::ocean_sfc_z0h, mod_ocean_vars::ocean_sfc_z0m, mod_ocean_vars::ocean_temp, mod_ocean_vars::ocean_uvel, mod_ocean_vars::ocean_vvel, scale_ocean_grid_cartesc_index::okmax, scale_ocean_grid_cartesc_index::oks, mod_realinput_grads::parentatmosinputgrads(), mod_realinput_scale::parentatmosinputscale(), mod_realinput_wrfarw::parentatmosinputwrfarw(), mod_realinput_grads::parentatmosopengrads(), mod_realinput_scale::parentatmosopenscale(), mod_realinput_wrfarw::parentatmosopenwrfarw(), mod_realinput_grads::parentatmossetupgrads(), mod_realinput_scale::parentatmossetupscale(), mod_realinput_wrfarw::parentatmossetupwrfarw(), mod_realinput_grads::parentlandinputgrads(), mod_realinput_scale::parentlandinputscale(), mod_realinput_wrfarw::parentlandinputwrfarw(), mod_realinput_grads::parentlandsetupgrads(), mod_realinput_scale::parentlandsetupscale(), mod_realinput_wrfarw::parentlandsetupwrfarw(), mod_realinput_grads::parentoceaninputgrads(), mod_realinput_scale::parentoceaninputscale(), mod_realinput_wrfarw::parentoceaninputwrfarw(), mod_realinput_grads::parentoceanopengrads(), mod_realinput_scale::parentoceanopenscale(), mod_realinput_wrfarw::parentoceanopenwrfarw(), mod_realinput_grads::parentoceansetupgrads(), mod_realinput_scale::parentoceansetupscale(), mod_realinput_wrfarw::parentoceansetupwrfarw(), scale_prc::prc_abort(), scale_prc::prc_ismaster, scale_prof::prof_rapend(), scale_prof::prof_rapstart(), scale_tracer::qa, mod_atmos_phy_ch_vars::qe_ch, mod_atmos_phy_mp_vars::qe_mp, scale_atmos_hydrometeor::qle, scale_atmos_hydrometeor::qls, mod_atmos_phy_ch_vars::qs_ch, mod_atmos_phy_mp_vars::qs_mp, mod_atmos_vars::qtrc, replace_misval_map(), mod_atmos_vars::rhot, scale_time::time_gettimelabel(), scale_time::time_nowdate, scale_topography::topo_zsfc, scale_tracer::tracer_cp, scale_tracer::tracer_cv, scale_tracer::tracer_mass, scale_tracer::tracer_name, scale_tracer::tracer_r, scale_urban_grid_cartesc_index::ukmax, mod_urban_admin::urban_do, mod_urban_vars::urban_qc, mod_urban_vars::urban_rainb, mod_urban_vars::urban_raing, mod_urban_vars::urban_rainr, mod_urban_vars::urban_roff, mod_urban_vars::urban_sfc_albedo, mod_urban_vars::urban_sfc_temp, mod_urban_vars::urban_tb, mod_urban_vars::urban_tbl, mod_urban_vars::urban_tc, mod_urban_vars::urban_tg, mod_urban_vars::urban_tgl, mod_urban_vars::urban_tr, mod_urban_vars::urban_trl, and mod_urban_vars::urban_uc.

Referenced by mod_mkinit::read_sounding().

396  use scale_time, only: &
398  use scale_landuse, only: &
399  fact_ocean => landuse_fact_ocean, &
400  fact_land => landuse_fact_land, &
401  fact_urban => landuse_fact_urban
402  use mod_atmos_phy_sf_vars, only: &
408  use mod_ocean_admin, only: &
409  ocean_do
410  use scale_ocean_phy_ice_simple, only: &
412  use mod_ocean_vars, only: &
413  ocean_temp, &
414  ocean_salt, &
415  ocean_uvel, &
416  ocean_vvel, &
417  ocean_ocn_z0m, &
418  ocean_ice_temp, &
419  ocean_ice_mass, &
420  ocean_sfc_temp, &
422  ocean_sfc_z0m, &
423  ocean_sfc_z0h, &
425  use mod_land_admin, only: &
426  land_do
427  use mod_land_vars, only: &
428  land_temp, &
429  land_water, &
430  land_sfc_temp, &
432  use mod_urban_admin, only: &
433  urban_do
434  use mod_urban_vars, only: &
435  urban_tc, &
436  urban_qc, &
437  urban_uc, &
438  urban_tr, &
439  urban_tb, &
440  urban_tg, &
441  urban_trl, &
442  urban_tbl, &
443  urban_tgl, &
444  urban_rainr, &
445  urban_rainb, &
446  urban_raing, &
447  urban_roff, &
448  urban_sfc_temp, &
450  implicit none
451 
452  logical :: use_file_landwater = .true. ! use land water data from files
453  real(RP) :: init_landwater_ratio = 0.5_rp ! Ratio of land water to storage is constant, if USE_FILE_LANDWATER is ".false."
454  real(RP) :: init_ocean_alb_lw = 0.04_rp ! initial LW albedo on the ocean
455  real(RP) :: init_ocean_alb_sw = 0.10_rp ! initial SW albedo on the ocean
456  real(RP) :: init_ocean_z0w = 1.0e-3_rp ! initial surface roughness on the ocean
457  character(len=H_SHORT) :: intrp_land_temp = 'off'
458  character(len=H_SHORT) :: intrp_land_water = 'off'
459  character(len=H_SHORT) :: intrp_land_sfc_temp = 'off'
460  character(len=H_SHORT) :: intrp_ocean_temp = 'off'
461  character(len=H_SHORT) :: intrp_ocean_sfc_temp = 'off'
462  integer :: intrp_iter_max = 100
463  character(len=H_SHORT) :: soilwater_ds2vc = 'limit'
464  logical :: soilwater_ds2vc_flag ! true: 'critical', false: 'limit'
465  logical :: elevation_collection = .true.
466  logical :: elevation_collection_land
467  logical :: elevation_collection_ocean
468 
469  namelist / param_mkinit_real_land / &
470  number_of_files, &
471  number_of_tsteps, &
472  number_of_skip_tsteps, &
473  filetype_org, &
474  basename_org, &
475  basename_add_num, &
476  basename_boundary, &
477  boundary_postfix_timelabel, &
478  boundary_title, &
479  boundary_update_dt, &
480  use_file_landwater, &
481  init_landwater_ratio, &
482  intrp_land_temp, &
483  intrp_land_water, &
484  intrp_land_sfc_temp, &
485  intrp_iter_max, &
486  filter_order, &
487  filter_niter, &
488  soilwater_ds2vc, &
489  elevation_collection, &
490  serial_proc_read
491 
492  namelist / param_mkinit_real_ocean / &
493  number_of_files, &
494  number_of_tsteps, &
495  number_of_skip_tsteps, &
496  filetype_org, &
497  basename_org, &
498  basename_add_num, &
499  basename_boundary, &
500  boundary_postfix_timelabel, &
501  boundary_title, &
502  boundary_update_dt, &
503  init_ocean_alb_lw, &
504  init_ocean_alb_sw, &
505  init_ocean_z0w, &
506  intrp_ocean_temp, &
507  intrp_ocean_sfc_temp, &
508  intrp_iter_max, &
509  filter_order, &
510  filter_niter, &
511  serial_proc_read
512 
513  character(len=H_LONG) :: filetype_land
514  character(len=H_LONG) :: filetype_ocean
515  character(len=H_LONG) :: basename_land
516  character(len=H_LONG) :: basename_ocean
517  character(len=5) :: num = ''
518 
519  ! land
520  real(RP), allocatable :: land_temp_org (:,:,:,:)
521  real(RP), allocatable :: land_water_org (:,:,:,:)
522  real(RP), allocatable :: land_sfc_temp_org (:,:,:)
523  real(RP), allocatable :: land_sfc_albedo_org(:,:,:,:,:)
524 
525  ! urban
526  real(RP) :: urban_tc_org(ia,ja)
527  real(RP) :: urban_qc_org(ia,ja)
528  real(RP) :: urban_uc_org(ia,ja)
529  real(RP) :: urban_sfc_temp_org(ia,ja)
530  real(RP) :: urban_sfc_albedo_org(ia,ja,n_rad_dir,n_rad_rgn)
531 
532  ! ocean
533  real(RP), allocatable :: ocean_temp_org (:,:,:,:)
534  real(RP), allocatable :: ocean_sfc_temp_org (:,:,:)
535  real(RP), allocatable :: ocean_sfc_albedo_org(:,:,:,:,:)
536  real(RP), allocatable :: ocean_sfc_z0_org (:,:,:)
537 
538  integer :: number_of_files_land = 1
539  integer :: number_of_files_ocean = 1
540  integer :: number_of_tsteps_land = 1 ! num of time steps in one file
541  integer :: number_of_tsteps_ocean = 1 ! num of time steps in one file
542  integer :: number_of_skip_tsteps_land = 0 ! num of skipped first several data
543  integer :: number_of_skip_tsteps_ocean = 0 ! num of skipped first several data
544 
545  character(len=H_LONG) :: basename_boundary_land = ''
546  character(len=H_LONG) :: basename_boundary_ocean = ''
547  logical :: boundary_postfix_timelabel_land = .false.
548  logical :: boundary_postfix_timelabel_ocean = .false.
549  character(len=H_LONG) :: boundary_title_land = 'SCALE-RM BOUNDARY CONDITION for REAL CASE'
550  character(len=H_LONG) :: boundary_title_ocean = 'SCALE-RM BOUNDARY CONDITION for REAL CASE'
551  real(DP) :: boundary_update_dt_land = 0.0_dp ! inteval time of boudary data update [s]
552  real(DP) :: boundary_update_dt_ocean = 0.0_dp ! inteval time of boudary data update [s]
553 
554  integer :: mdlid_land, mdlid_ocean
555  integer :: ldims(3), odims(2)
556 
557  integer :: totaltimesteps = 1
558  integer :: timelen
559  integer :: skip_steps
560  integer :: ierr
561 
562  character(len=H_LONG) :: basename_out_mod
563  character(len=19) :: timelabel
564 
565  logical :: boundary_flag = .false.
566  logical :: land_flag
567 
568  integer :: k, i, j, n, ns, ne, idir, irgn
569  !---------------------------------------------------------------------------
570 
571  if ( land_do .or. urban_do ) then
572  land_flag = .true.
573  else
574  land_flag = .false.
575  end if
576 
577  if ( .not. land_flag .or. .not. ocean_do ) then
578  log_error("REALINPUT_surface",*) 'OCEAN_ and LAND_DYN_TYPE must be set'
579  end if
580 
581 
582  log_newline
583  log_info('REALINPUT_surface',*) 'Setup LAND'
584 
585  ! LAND/URBAN
586 
587  !--- read namelist
588  rewind(io_fid_conf)
589  read(io_fid_conf,nml=param_mkinit_real_land,iostat=ierr)
590  if( ierr < 0 ) then !--- missing
591  log_info("REALINPUT_surface",*) 'Not found namelist. Default used.'
592  elseif( ierr > 0 ) then !--- fatal error
593  log_error("REALINPUT_surface",*) 'Not appropriate names in namelist PARAM_MKINIT_REAL_LAND. Check!'
594  call prc_abort
595  endif
596  log_nml(param_mkinit_real_land)
597 
598  number_of_files_land = number_of_files
599  number_of_tsteps_land = number_of_tsteps
600  number_of_skip_tsteps_land = number_of_skip_tsteps
601  filetype_land = filetype_org
602  basename_boundary_land = basename_boundary
603  boundary_postfix_timelabel_land = boundary_postfix_timelabel
604  boundary_title_land = boundary_title
605  boundary_update_dt_land = boundary_update_dt
606  elevation_collection_land = elevation_collection
607 
608  if ( filetype_land .ne. "GrADS" .and. ( number_of_files > 1 .OR. basename_add_num ) ) then
609  basename_land = trim(basename_org)//"_00000"
610  else
611  basename_land = trim(basename_org)
612  endif
613 
614  select case( soilwater_ds2vc )
615  case( 'critical' )
616  soilwater_ds2vc_flag = .true.
617  case('limit' )
618  soilwater_ds2vc_flag = .false.
619  case default
620  log_error("REALINPUT_surface",*) 'Unsupported SOILWATER_DS2CV TYPE:', trim(soilwater_ds2vc)
621  call prc_abort
622  end select
623 
624  serial_land = serial_proc_read
625 
626  log_newline
627  log_info('REALINPUT_surface',*) 'Setup OCEAN'
628 
629  !--- read namelist
630  rewind(io_fid_conf)
631  read(io_fid_conf,nml=param_mkinit_real_ocean,iostat=ierr)
632  if( ierr < 0 ) then !--- missing
633  log_info("REALINPUT_surface",*) 'Not found namelist. Default used.'
634  elseif( ierr > 0 ) then !--- fatal error
635  log_error("REALINPUT_surface",*) 'Not appropriate names in namelist PARAM_MKINIT_REAL_OCEAN. Check!'
636  call prc_abort
637  endif
638  log_nml(param_mkinit_real_ocean)
639 
640  number_of_files_ocean = number_of_files
641  number_of_tsteps_ocean = number_of_tsteps
642  number_of_skip_tsteps_ocean = number_of_skip_tsteps
643  filetype_ocean = filetype_org
644  basename_boundary_ocean = basename_boundary
645  boundary_postfix_timelabel_ocean = boundary_postfix_timelabel
646  boundary_title_ocean = boundary_title
647  boundary_update_dt_ocean = boundary_update_dt
648  elevation_collection_ocean = elevation_collection
649 
650  if ( filetype_ocean .ne. "GrADS" .and. ( number_of_files > 1 .OR. basename_add_num ) ) then
651  basename_ocean = trim(basename_org)//"_00000"
652  else
653  basename_ocean = trim(basename_org)
654  endif
655 
656  serial_ocean = serial_proc_read
657 
658  ! check land/ocean parameters
659  if( number_of_files_land .NE. number_of_files_ocean .OR. &
660  number_of_tsteps_land .NE. number_of_tsteps_ocean .OR. &
661  number_of_skip_tsteps_land .NE. number_of_skip_tsteps_ocean .OR. &
662  basename_boundary_land .NE. basename_boundary_ocean .OR. &
663  boundary_postfix_timelabel_land .NEQV. boundary_postfix_timelabel_ocean .OR. &
664  boundary_title_land .NE. boundary_title_ocean .OR. &
665  boundary_update_dt_land .NE. boundary_update_dt_ocean ) then
666  log_error("REALINPUT_surface",*) 'The following LAND/OCEAN parameters must be consistent due to technical problem:'
667  log_error_cont(*) ' NUMBER_OF_FILES, NUMBER_OF_TSTEPS, NUMBER_OF_SKIP_TSTEPS,'
668  log_error_cont(*) ' BASENAME_BOUNDARY, BOUNDARY_POSTFIX_TIMELABEL, BOUNDARY_TITLE, BOUNDARY_UPDATE_DT.'
669  call prc_abort
670  end if
671 
672  call parentsurfacesetup( ldims, odims, & ![OUT]
673  mdlid_land, & ![OUT]
674  mdlid_ocean, & ![OUT]
675  timelen, & ![OUT]
676  basename_land, & ![IN]
677  basename_ocean, & ![IN]
678  filetype_land, & ![IN]
679  filetype_ocean, & ![IN]
680  use_file_landwater, & ![IN]
681  intrp_land_temp, & ![IN]
682  intrp_land_water, & ![IN]
683  intrp_land_sfc_temp, & ![IN]
684  intrp_ocean_temp, & ![IN]
685  intrp_ocean_sfc_temp ) ![IN]
686 
687  if ( timelen > 0 ) then
688  number_of_tsteps = timelen ! read from file
689  endif
690 
691  totaltimesteps = number_of_files * number_of_tsteps
692 
693  allocate( land_temp_org(lkmax,ia,ja, 1+number_of_skip_tsteps:totaltimesteps) )
694  allocate( land_water_org(lkmax,ia,ja, 1+number_of_skip_tsteps:totaltimesteps) )
695  allocate( land_sfc_temp_org( ia,ja, 1+number_of_skip_tsteps:totaltimesteps) )
696  allocate( land_sfc_albedo_org( ia,ja,n_rad_dir,n_rad_rgn,1+number_of_skip_tsteps:totaltimesteps) )
697 
698  allocate( ocean_temp_org(okmax,ia,ja, 1+number_of_skip_tsteps:totaltimesteps) )
699  allocate( ocean_sfc_temp_org( ia,ja, 1+number_of_skip_tsteps:totaltimesteps) )
700  allocate( ocean_sfc_albedo_org( ia,ja,n_rad_dir,n_rad_rgn,1+number_of_skip_tsteps:totaltimesteps) )
701  allocate( ocean_sfc_z0_org( ia,ja, 1+number_of_skip_tsteps:totaltimesteps) )
702 
703  if ( mdlid_ocean == igrads ) then
704  basename_org = ""
705  endif
706 
707  if ( basename_boundary /= '' ) then
708  boundary_flag = .true.
709  endif
710 
711  !--- read external file
712  do n = 1, number_of_files
713 
714  if ( number_of_files > 1 .OR. basename_add_num ) then
715  write(num,'(I5.5)') n-1
716  basename_land = trim(basename_org)//"_"//num
717  basename_ocean = trim(basename_org)//"_"//num
718  else
719  basename_land = trim(basename_org)
720  basename_ocean = trim(basename_org)
721  endif
722 
723  log_newline
724  log_info("REALINPUT_surface",*) 'Target File Name (Land) : ', trim(basename_land)
725  log_info("REALINPUT_surface",*) 'Target File Name (Ocean): ', trim(basename_ocean)
726  log_info("REALINPUT_surface",*) 'Time Steps in One File : ', number_of_tsteps
727 
728  ns = number_of_tsteps * (n - 1) + 1
729  ne = ns + (number_of_tsteps - 1)
730 
731  if ( ne <= number_of_skip_tsteps ) then
732  log_info("REALINPUT_surface",*) ' SKIP'
733  cycle
734  endif
735 
736  skip_steps = max(number_of_skip_tsteps - ns + 1, 0)
737  ns = max(ns, number_of_skip_tsteps+1)
738 
739  ! read all prepared data
740  call parentsurfaceinput( land_temp_org(:,:,:, ns:ne), &
741  land_water_org(:,:,:, ns:ne), &
742  land_sfc_temp_org(:,:, ns:ne), &
743  land_sfc_albedo_org(:,:,:,:,ns:ne), &
744  urban_tc_org, &
745  urban_qc_org, &
746  urban_uc_org, &
747  urban_sfc_temp_org, &
748  urban_sfc_albedo_org, &
749  ocean_temp_org(oks,:,:, ns:ne), &
750  ocean_sfc_temp_org( :,:, ns:ne), &
751  ocean_sfc_albedo_org( :,:,:,:,ns:ne), &
752  ocean_sfc_z0_org( :,:, ns:ne), &
753  basename_land, &
754  basename_ocean, &
755  mdlid_land, mdlid_ocean, &
756  ldims, odims, &
757  use_file_landwater, &
758  init_landwater_ratio, &
759  init_ocean_alb_lw, &
760  init_ocean_alb_sw, &
761  init_ocean_z0w, &
762  intrp_iter_max, &
763  soilwater_ds2vc_flag, &
764  elevation_collection_land, &
765  elevation_collection_ocean, &
766  boundary_flag, &
767  number_of_tsteps, skip_steps, &
768  urban_do )
769 
770  ! required one-step data only
771  if( basename_boundary == '' ) exit
772 
773  enddo
774 
775 
776  !--- input initial data
777  ns = number_of_skip_tsteps + 1 ! skip first several data
778 
779  do j = 1, ja
780  do i = 1, ia
781  ocean_sfc_temp(i,j) = ocean_sfc_temp_org(i,j,ns)
782  ocean_sfc_z0m(i,j) = ocean_sfc_z0_org(i,j,ns)
783  ocean_sfc_z0h(i,j) = ocean_sfc_z0_org(i,j,ns)
784  ocean_sfc_z0e(i,j) = ocean_sfc_z0_org(i,j,ns)
785  do irgn = i_r_ir, i_r_vis
786  do idir = i_r_direct, i_r_diffuse
787  ocean_sfc_albedo(i,j,idir,irgn) = ocean_sfc_albedo_org(i,j,idir,irgn,ns)
788  enddo
789  enddo
790  do k = 1, okmax
791  ocean_temp(k,i,j) = ocean_temp_org(oks,i,j,ns)
792  ocean_salt(k,i,j) = 0.0_rp
793  ocean_uvel(k,i,j) = 0.0_rp
794  ocean_vvel(k,i,j) = 0.0_rp
795  enddo
796  ocean_ocn_z0m(i,j) = ocean_sfc_z0_org(i,j,ns)
797  ocean_ice_temp(i,j) = min( ocean_sfc_temp_org(i,j,ns), ocean_phy_ice_freezetemp )
798  ocean_ice_mass(i,j) = 0.0_rp
799 
800  land_sfc_temp(i,j) = land_sfc_temp_org(i,j, ns)
801  do irgn = i_r_ir, i_r_vis
802  do idir = i_r_direct, i_r_diffuse
803  land_sfc_albedo(i,j,idir,irgn) = land_sfc_albedo_org(i,j,idir,irgn,ns)
804  enddo
805  enddo
806  do k = 1, lkmax
807  land_temp(k,i,j) = land_temp_org(k,i,j,ns)
808  land_water(k,i,j) = land_water_org(k,i,j,ns)
809  enddo
810 
811  if ( urban_do ) then
812  urban_sfc_temp(i,j) = urban_sfc_temp_org(i,j)
813  do irgn = i_r_ir, i_r_vis
814  do idir = i_r_direct, i_r_diffuse
815  urban_sfc_albedo(i,j,idir,irgn) = urban_sfc_albedo_org(i,j,idir,irgn)
816  enddo
817  enddo
818  do k = 1, ukmax
819  urban_trl(k,i,j) = urban_sfc_temp_org(i,j)
820  urban_tbl(k,i,j) = urban_sfc_temp_org(i,j)
821  urban_tgl(k,i,j) = urban_sfc_temp_org(i,j)
822  enddo
823  urban_tc(i,j) = urban_tc_org(i,j)
824  urban_qc(i,j) = urban_qc_org(i,j)
825  urban_uc(i,j) = urban_uc_org(i,j)
826  urban_tr(i,j) = urban_sfc_temp_org(i,j)
827  urban_tb(i,j) = urban_sfc_temp_org(i,j)
828  urban_tg(i,j) = urban_sfc_temp_org(i,j)
829  urban_rainr(i,j) = 0.0_rp
830  urban_rainb(i,j) = 0.0_rp
831  urban_raing(i,j) = 0.0_rp
832  urban_roff(i,j) = 0.0_rp
833  end if
834 
838 
839  if ( urban_do ) then
840  atmos_phy_sf_sfc_temp(i,j) = fact_ocean(i,j) * ocean_sfc_temp(i,j) &
841  + fact_land(i,j) * land_sfc_temp(i,j) &
842  + fact_urban(i,j) * urban_sfc_temp(i,j)
843  do irgn = i_r_ir, i_r_vis
844  do idir = i_r_direct, i_r_diffuse
845  atmos_phy_sf_sfc_albedo(i,j,idir,irgn) = fact_ocean(i,j) * ocean_sfc_albedo(i,j,idir,irgn) &
846  + fact_land(i,j) * land_sfc_albedo(i,j,idir,irgn) &
847  + fact_urban(i,j) * urban_sfc_albedo(i,j,idir,irgn)
848  enddo
849  enddo
850  else
851  atmos_phy_sf_sfc_temp(i,j) = fact_ocean(i,j) * ocean_sfc_temp(i,j) &
852  + fact_land(i,j) * land_sfc_temp(i,j)
853  do irgn = i_r_ir, i_r_vis
854  do idir = i_r_direct, i_r_diffuse
855  atmos_phy_sf_sfc_albedo(i,j,idir,irgn) = fact_ocean(i,j) * ocean_sfc_albedo(i,j,idir,irgn) &
856  + fact_land(i,j) * land_sfc_albedo(i,j,idir,irgn)
857  enddo
858  enddo
859  endif
860  enddo
861  enddo
862 
863 
864  !--- output boundary data
865  if( basename_boundary /= '' ) then
866  totaltimesteps = totaltimesteps - number_of_skip_tsteps ! skip first several data
867  if ( totaltimesteps > 1 ) then
868  if ( boundary_update_dt <= 0.0_dp ) then
869  log_error("REALINPUT_surface",*) 'BOUNDARY_UPDATE_DT is necessary in real case preprocess'
870  call prc_abort
871  endif
872 
873  if ( boundary_postfix_timelabel ) then
874  call time_gettimelabel( timelabel )
875  basename_out_mod = trim(basename_boundary)//'_'//trim(timelabel)
876  else
877  basename_out_mod = trim(basename_boundary)
878  endif
879 
880  call parentsurfaceboundary( land_temp_org(:,:,:,ns:ne), &
881  land_water_org(:,:,:,ns:ne), &
882  land_sfc_temp_org( :,:,ns:ne), &
883  ocean_temp_org(:,:,:,ns:ne), &
884  ocean_sfc_temp_org( :,:,ns:ne), &
885  ocean_sfc_z0_org( :,:,ns:ne), &
886  totaltimesteps, &
887  boundary_update_dt, &
888  basename_out_mod, &
889  boundary_title )
890 
891  endif
892  endif
893 
894  deallocate( land_temp_org )
895  deallocate( land_water_org )
896  deallocate( land_sfc_temp_org )
897  deallocate( land_sfc_albedo_org )
898  deallocate( ocean_temp_org )
899  deallocate( ocean_sfc_temp_org )
900  deallocate( ocean_sfc_albedo_org )
901  deallocate( ocean_sfc_z0_org )
902 
903  return
module Land admin
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sfc_z0e
real(rp), dimension(:,:), allocatable, public urban_qc
real(rp), dimension(:,:), allocatable, public landuse_fact_urban
urban factor
logical, public ocean_do
real(rp), dimension(:,:), allocatable, public ocean_sfc_temp
ocean surface skin temperature [K]
real(rp), dimension(:,:), allocatable, public ocean_ice_mass
sea ice mass [kg]
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sfc_temp
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:55
real(rp), dimension(:,:), allocatable, public urban_tb
module URBAN Variables
real(rp), dimension(:,:), allocatable, public urban_raing
real(rp), dimension(:,:), allocatable, public urban_uc
real(rp), dimension(:,:,:,:), allocatable, public urban_sfc_albedo
real(rp), dimension(:,:), allocatable, public land_sfc_temp
land surface skin temperature [K]
module ATMOSPHERIC Surface Variables
real(rp), dimension(:,:), allocatable, public urban_tr
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_sf_sfc_albedo
real(rp), dimension(:,:,:), allocatable, public urban_tgl
real(rp), dimension(:,:,:,:), allocatable, public land_sfc_albedo
land surface albedo (direct/diffuse,IR/near-IR/VIS) (0-1)
real(rp), dimension(:,:,:), allocatable, public ocean_salt
ocean salinity [PSU]
module LANDUSE
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sfc_z0h
subroutine, public time_gettimelabel(timelabel)
generate time label
Definition: scale_time.F90:94
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0h
ocean surface roughness length for heat [m]
real(rp), dimension(:,:,:), allocatable, public ocean_temp
ocean temperature [K]
real(rp), dimension(:,:,:), allocatable, public land_temp
temperature of each soil layer [K]
real(rp), dimension(:,:), allocatable, public landuse_fact_ocean
ocean factor
module TIME
Definition: scale_time.F90:16
real(rp), dimension(:,:), allocatable, public urban_roff
module Ocean admin
module LAND Variables
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
real(rp), dimension(:,:), allocatable, public urban_tc
real(rp), dimension(:,:), allocatable, public urban_rainr
real(rp), dimension(:,:,:), allocatable, public land_water
moisture of each soil layer [m3/m3]
real(rp), dimension(:,:,:), allocatable, public ocean_vvel
ocean meridional velocity [m/s]
module ocean / physics / ice / simple
real(rp), dimension(:,:), allocatable, public urban_tg
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sfc_z0m
real(rp), dimension(:,:), allocatable, public urban_sfc_temp
real(rp), dimension(:,:,:), allocatable, public urban_trl
real(rp), dimension(:,:), allocatable, public ocean_ice_temp
sea ice temperature [K]
real(rp), dimension(:,:), allocatable, public ocean_ocn_z0m
surface roughness length for momentum, open ocean [m]
real(rp), dimension(:,:), allocatable, public landuse_fact_land
land factor
real(rp), dimension(:,:,:,:), allocatable, public ocean_sfc_albedo
ocean surface albedo (direct/diffuse,IR/near-IR/VIS) (0-1)
module Urban admin
real(rp), dimension(:,:,:), allocatable, public urban_tbl
logical, public urban_do
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0m
ocean surface roughness length for momentum [m]
real(rp), dimension(:,:,:), allocatable, public ocean_uvel
ocean zonal velocity [m/s]
module OCEAN Variables
logical, public land_do
real(rp), dimension(:,:), allocatable, public urban_rainb
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0e
ocean surface roughness length for vapor [m]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ land_interporation()

subroutine mod_realinput::land_interporation ( real(rp), dimension(lkmax,ia,ja), intent(out)  tg,
real(rp), dimension(lkmax,ia,ja), intent(out)  strg,
real(rp), dimension(ia,ja), intent(out)  lst,
real(rp), dimension(ia,ja,n_rad_dir,n_rad_rgn), intent(out)  albg,
real(rp), dimension(ia,ja), intent(out)  ust,
real(rp), dimension(ia,ja,n_rad_dir,n_rad_rgn), intent(out)  albu,
real(rp), dimension(:,:,:), intent(inout)  tg_org,
real(rp), dimension(:,:,:), intent(inout)  strg_org,
real(rp), dimension(:,:,:), intent(inout)  smds_org,
real(rp), dimension(:,:), intent(inout)  lst_org,
real(rp), dimension(:,:,:,:), intent(inout)  albg_org,
real(rp), dimension(:,:), intent(inout)  ust_org,
real(rp), dimension(:,:), intent(inout)  sst_org,
real(rp), dimension(:,:), intent(in)  lmask_org,
real(rp), dimension(:,:), intent(in)  lsmask_nest,
real(rp), dimension(:,:), intent(in)  topo_org,
real(rp), dimension(:), intent(in)  lz_org,
real(rp), dimension(:,:), intent(in)  llon_org,
real(rp), dimension(:,:), intent(in)  llat_org,
real(rp), dimension(lkmax), intent(in)  LCZ,
real(rp), dimension(ia,ja), intent(in)  LON,
real(rp), dimension(ia,ja), intent(in)  LAT,
integer, dimension(3), intent(in)  ldims,
integer, dimension(2), intent(in)  odims,
real(rp), intent(in)  maskval_tg,
real(rp), intent(in)  maskval_strg,
real(rp), intent(in)  init_landwater_ratio,
logical, intent(in)  use_file_landwater,
logical, intent(in)  use_waterratio,
logical, intent(in)  soilwater_ds2vc_flag,
logical, intent(in)  elevation_collection,
integer, intent(in)  intrp_iter_max,
logical, intent(in)  ol_interp,
logical, intent(in)  URBAN_do 
)

Definition at line 2909 of file mod_realinput.F90.

References scale_const::const_eps, scale_const::const_i_lw, scale_const::const_i_sw, scale_const::const_laps, scale_const::const_undef, mod_land_vars::convert_ws2vwc(), scale_cpl_sfc_index::i_r_diffuse, scale_cpl_sfc_index::i_r_direct, scale_cpl_sfc_index::i_r_ir, scale_cpl_sfc_index::i_r_nir, scale_cpl_sfc_index::i_r_vis, scale_atmos_grid_cartesc_index::ia, scale_atmos_grid_cartesc_index::ie, scale_interp::interp_factor2d(), scale_interp::interp_factor3d(), scale_interp::interp_interp2d(), scale_interp::interp_interp3d(), scale_atmos_grid_cartesc_index::is, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::je, scale_atmos_grid_cartesc_index::js, scale_land_grid_cartesc_index::lke, scale_land_grid_cartesc_index::lkmax, scale_land_grid_cartesc_index::lks, make_mask(), scale_prc::prc_abort(), replace_misval_const(), replace_misval_map(), and scale_topography::topo_zsfc.

Referenced by realinput_surface().

2909  use scale_prc, only: &
2910  prc_abort
2911  use scale_const, only: &
2912  undef => const_undef, &
2913  eps => const_eps, &
2914  i_sw => const_i_sw, &
2915  i_lw => const_i_lw, &
2916  laps => const_laps
2917  use scale_interp, only: &
2918  interp_factor2d, &
2919  interp_factor3d, &
2920  interp_interp2d, &
2922  use scale_comm_cartesc, only: &
2923  comm_vars8, &
2924  comm_wait
2925  use scale_filter, only: &
2926  filter_hyperdiff
2927  use scale_topography, only: &
2928  topo_zsfc
2929  use mod_land_vars, only: &
2931  implicit none
2932  real(RP), intent(out) :: tg(lkmax,ia,ja)
2933  real(RP), intent(out) :: strg(lkmax,ia,ja)
2934  real(RP), intent(out) :: lst(ia,ja)
2935  real(RP), intent(out) :: albg(ia,ja,n_rad_dir,n_rad_rgn)
2936  real(RP), intent(out) :: ust(ia,ja)
2937  real(RP), intent(out) :: albu(ia,ja,n_rad_dir,n_rad_rgn)
2938  real(RP), intent(inout) :: tg_org(:,:,:)
2939  real(RP), intent(inout) :: strg_org(:,:,:)
2940  real(RP), intent(inout) :: smds_org(:,:,:)
2941  real(RP), intent(inout) :: lst_org(:,:)
2942  real(RP), intent(inout) :: albg_org(:,:,:,:)
2943  real(RP), intent(inout) :: ust_org(:,:)
2944  real(RP), intent(inout) :: sst_org(:,:)
2945  real(RP), intent(in) :: lmask_org(:,:)
2946  real(RP), intent(in) :: lsmask_nest(:,:)
2947  real(RP), intent(in) :: topo_org(:,:)
2948  real(RP), intent(in) :: lz_org(:)
2949  real(RP), intent(in) :: llon_org(:,:)
2950  real(RP), intent(in) :: llat_org(:,:)
2951  real(RP), intent(in) :: lcz(lkmax)
2952  real(RP), intent(in) :: lon(ia,ja)
2953  real(RP), intent(in) :: lat(ia,ja)
2954  integer, intent(in) :: ldims(3)
2955  integer, intent(in) :: odims(2)
2956  real(RP), intent(in) :: maskval_tg
2957  real(RP), intent(in) :: maskval_strg
2958  real(RP), intent(in) :: init_landwater_ratio
2959  logical, intent(in) :: use_file_landwater
2960  logical, intent(in) :: use_waterratio
2961  logical, intent(in) :: soilwater_ds2vc_flag
2962  logical, intent(in) :: elevation_collection
2963  integer, intent(in) :: intrp_iter_max
2964  logical, intent(in) :: ol_interp
2965  logical, intent(in) :: urban_do
2966 
2967  real(RP) :: lmask(ldims(2), ldims(3))
2968  real(RP) :: smds(lkmax,ia,ja)
2969 
2970  ! data for interporation
2971  real(RP) :: hfact_l(ldims(2), ldims(3), itp_nh)
2972  integer :: igrd_l (ldims(2), ldims(3), itp_nh)
2973  integer :: jgrd_l (ldims(2), ldims(3), itp_nh)
2974  real(RP) :: vfactl(lkmax,ia,ja,itp_nh,itp_nv)
2975  integer :: kgrdl (lkmax,ia,ja,itp_nh,itp_nv)
2976 
2977  real(RP) :: sst_land(ldims(2), ldims(3))
2978  real(RP) :: work(ldims(2), ldims(3))
2979 
2980  real(RP) :: lz3d_org(ldims(1),ldims(2),ldims(3))
2981  real(RP) :: lcz_3d(lkmax,ia,ja)
2982 
2983  ! elevation collection
2984  real(RP) :: topo(ia,ja)
2985  real(RP) :: tdiff
2986 
2987  real(RP) :: one2d(ia,ja)
2988  real(RP) :: one3d(ka,ia,ja)
2989 
2990  integer :: k, i, j
2991 
2992 
2993  ! Surface skin temp: interpolate over the ocean
2994  if ( i_intrp_land_sfc_temp .ne. i_intrp_off ) then
2995  select case( i_intrp_land_sfc_temp )
2996  case( i_intrp_mask )
2997  lmask = lmask_org
2998  case( i_intrp_fill )
2999  call make_mask( lmask, lst_org, ldims(2), ldims(3), landdata=.true.)
3000  case default
3001  log_error("land_interporation",*) 'INTRP_LAND_SFC_TEMP is invalid.'
3002  call prc_abort
3003  end select
3004  call interp_oceanland_data(lst_org, lmask, ldims(2), ldims(3), .true., intrp_iter_max)
3005  end if
3006 
3007  ! Urban surface temp: interpolate over the ocean
3008  ! if ( i_INTRP_URB_SFC_TEMP .ne. i_intrp_off ) then
3009  ! select case( i_INTRP_URB_SFC_TEMP )
3010  ! case( i_intrp_mask )
3011  ! lmask = lmask_org
3012  ! case( i_intrp_fill )
3013  ! call make_mask( lmask, ust_org, ldims(2), ldims(3), landdata=.true.)
3014  ! case default
3015  ! LOG_ERROR("land_interporation",*) 'INTRP_URB_SFC_TEMP is invalid.'
3016  ! call PRC_abort
3017  ! end select
3018  ! call interp_OceanLand_data(ust_org, lmask, ldims(2), ldims(3), .true., intrp_iter_max)
3019  !end if
3020 
3021  if ( ol_interp ) then
3022  ! interpolation facter between outer land grid and ocean grid
3023  call interp_factor2d( itp_nh, & ! [IN]
3024  odims(1), odims(2), & ! [IN]
3025  olon_org(:,:), & ! [IN]
3026  olat_org(:,:), & ! [IN]
3027  ldims(2), ldims(3), & ! [IN]
3028  llon_org(:,:), & ! [IN]
3029  llat_org(:,:), & ! [IN]
3030  igrd_l(:,:,:), & ! [OUT]
3031  jgrd_l(:,:,:), & ! [OUT]
3032  hfact_l(:,:,:) ) ! [OUT]
3033 
3034  ! sst on land grid
3035  call interp_interp2d( itp_nh, & ! [IN]
3036  odims(1), odims(2), & ! [IN]
3037  ldims(2), ldims(3), & ! [IN]
3038  igrd_l(:,:,:), & ! [IN]
3039  jgrd_l(:,:,:), & ! [IN]
3040  hfact_l(:,:,:), & ! [IN]
3041  sst_org(:,:), & ! [IN]
3042  sst_land(:,:) ) ! [OUT]
3043  else
3044  sst_land(:,:) = sst_org(:,:)
3045  end if
3046 
3047  do j = 1, ldims(3)
3048  do i = 1, ldims(2)
3049  if ( topo_org(i,j) > undef + eps ) then ! ignore UNDEF value
3050  sst_land(i,j) = sst_land(i,j) - topo_org(i,j) * laps
3051  end if
3052  end do
3053  end do
3054 
3055  call replace_misval_map( lst_org, sst_land, ldims(2), ldims(3), "SKINT" )
3056 
3057  ! replace missing value
3058  do j = 1, ldims(3)
3059  do i = 1, ldims(2)
3060 ! if ( skinw_org(i,j) == UNDEF ) skinw_org(i,j) = 0.0_RP
3061 ! if ( snowq_org(i,j) == UNDEF ) snowq_org(i,j) = 0.0_RP
3062 ! if ( snowt_org(i,j) == UNDEF ) snowt_org(i,j) = TEM00
3063  if( albg_org(i,j,i_r_direct ,i_r_ir ) == undef ) albg_org(i,j,i_r_direct ,i_r_ir ) = 0.03_rp
3064  if( albg_org(i,j,i_r_diffuse,i_r_ir ) == undef ) albg_org(i,j,i_r_diffuse,i_r_ir ) = 0.03_rp ! emissivity of general ground surface : 0.95-0.98
3065  if( albg_org(i,j,i_r_direct ,i_r_nir) == undef ) albg_org(i,j,i_r_direct ,i_r_nir) = 0.22_rp
3066  if( albg_org(i,j,i_r_diffuse,i_r_nir) == undef ) albg_org(i,j,i_r_diffuse,i_r_nir) = 0.22_rp
3067  if( albg_org(i,j,i_r_direct ,i_r_vis) == undef ) albg_org(i,j,i_r_direct ,i_r_vis) = 0.22_rp
3068  if( albg_org(i,j,i_r_diffuse,i_r_vis) == undef ) albg_org(i,j,i_r_diffuse,i_r_vis) = 0.22_rp
3069  end do
3070  end do
3071  if ( urban_do ) then
3072  do j = 1, ldims(3)
3073  do i = 1, ldims(2)
3074  if ( ust_org(i,j) == undef ) ust_org(i,j) = lst_org(i,j)
3075  end do
3076  end do
3077  end if
3078 
3079  ! Land temp: interpolate over the ocean
3080  if ( i_intrp_land_temp .ne. i_intrp_off ) then
3081  do k = 1, ldims(1)
3082  work(:,:) = tg_org(k,:,:)
3083  select case( i_intrp_land_temp )
3084  case( i_intrp_mask )
3085  lmask = lmask_org
3086  case( i_intrp_fill )
3087  call make_mask( lmask, work, ldims(2), ldims(3), landdata=.true.)
3088  end select
3089  call interp_oceanland_data( work, lmask, ldims(2), ldims(3), .true., intrp_iter_max )
3090  !replace land temp using skin temp
3091  call replace_misval_map( work, lst_org, ldims(2), ldims(3), "STEMP")
3092  tg_org(k,:,:) = work(:,:)
3093  end do
3094  end if
3095 
3096 
3097  ! fill grid data
3098  do j = 1, ldims(3)
3099  do i = 1, ldims(2)
3100  lz3d_org(:,i,j) = lz_org(:)
3101  end do
3102  end do
3103 
3104  do j = 1, ja
3105  do i = 1, ia
3106  lcz_3d(:,i,j) = lcz(:)
3107  enddo
3108  enddo
3109 
3110  call interp_factor3d( itp_nh, & ! [IN]
3111  ldims(1), 1, ldims(1), & ! [IN]
3112  ldims(2), ldims(3), & ! [IN]
3113  llon_org(:,:), & ! [IN]
3114  llat_org(:,:), & ! [IN]
3115  lz3d_org(:,:,:), & ! [IN]
3116  lkmax, lks, lke, & ! [IN]
3117  ia, ja, & ! [IN]
3118  lon(:,:), & ! [IN]
3119  lat(:,:), & ! [IN]
3120  lcz_3d(:,:,:), & ! [IN]
3121  igrd( :,:,:), & ! [OUT]
3122  jgrd( :,:,:), & ! [OUT]
3123  hfact( :,:,:), & ! [OUT]
3124  kgrdl(:,:,:,:,:), & ! [OUT]
3125  vfactl(:,:,:,:,:) ) ! [OUT]
3126 
3127  call interp_interp2d( itp_nh, & ! [IN]
3128  ldims(2), ldims(3), & ! [IN]
3129  ia, ja, & ! [IN]
3130  igrd(:,:,:), & ! [IN]
3131  jgrd(:,:,:), & ! [IN]
3132  hfact(:,:,:), & ! [IN]
3133  lst_org(:,:), & ! [IN]
3134  lst(:,:) ) ! [OUT]
3135  if ( filter_niter > 0 ) then
3136  call filter_hyperdiff( ia, is, ie, ja, js, je, &
3137  lst(:,:), filter_order, filter_niter )
3138  call comm_vars8( lst(:,:), 1 )
3139  call comm_wait ( lst(:,:), 1 )
3140  end if
3141 
3142  if ( urban_do ) then
3143  call interp_interp2d( itp_nh, & ! [IN]
3144  ldims(2), ldims(3), & ! [IN]
3145  ia, ja, & ! [IN]
3146  igrd(:,:,:), & ! [IN]
3147  jgrd(:,:,:), & ! [IN]
3148  hfact(:,:,:), & ! [IN]
3149  ust_org(:,:), & ! [IN]
3150  ust(:,:) ) ! [OUT]
3151  if ( filter_niter > 0 ) then
3152  call filter_hyperdiff( ia, is, ie, ja, js, je, &
3153  ust(:,:), filter_order, filter_niter )
3154  call comm_vars8( ust(:,:), 1 )
3155  call comm_wait ( ust(:,:), 1 )
3156  end if
3157  end if
3158 
3159  call interp_interp2d( itp_nh, & ! [IN]
3160  ldims(2), ldims(3), & ! [IN]
3161  ia, ja, & ! [IN]
3162  igrd(:,:,:), & ! [IN]
3163  jgrd(:,:,:), & ! [IN]
3164  hfact(:,:,:), & ! [IN]
3165  albg_org(:,:,i_r_direct ,i_r_ir ), & ! [IN]
3166  albg(:,:,i_r_direct ,i_r_ir ) ) ! [OUT]
3167  if ( filter_niter > 0 ) then
3168  one2d(:,:) = 1.0_rp
3169  call filter_hyperdiff( ia, is, ie, ja, js, je, &
3170  albg(:,:,i_r_direct,i_r_ir), filter_order, filter_niter, &
3171  limiter_sign = one2d(:,:) )
3172  call comm_vars8( albg(:,:,i_r_direct,i_r_ir), 1 )
3173  call comm_wait ( albg(:,:,i_r_direct,i_r_ir), 1 )
3174  end if
3175 
3176  call interp_interp2d( itp_nh, & ! [IN]
3177  ldims(2), ldims(3), & ! [IN]
3178  ia, ja, & ! [IN]
3179  igrd(:,:,:), & ! [IN]
3180  jgrd(:,:,:), & ! [IN]
3181  hfact(:,:,:), & ! [IN]
3182  albg_org(:,:,i_r_diffuse,i_r_ir ), & ! [IN]
3183  albg(:,:,i_r_diffuse,i_r_ir ) ) ! [OUT]
3184  if ( filter_niter > 0 ) then
3185  call filter_hyperdiff( ia, is, ie, ja, js, je, &
3186  albg(:,:,i_r_diffuse,i_r_ir), filter_order, filter_niter, &
3187  limiter_sign = one2d(:,:) )
3188  call comm_vars8( albg(:,:,i_r_diffuse,i_r_ir), 1 )
3189  call comm_wait ( albg(:,:,i_r_diffuse,i_r_ir), 1 )
3190  end if
3191 
3192  call interp_interp2d( itp_nh, & ! [IN]
3193  ldims(2), ldims(3), & ! [IN]
3194  ia, ja, & ! [IN]
3195  igrd(:,:,:), & ! [IN]
3196  jgrd(:,:,:), & ! [IN]
3197  hfact(:,:,:), & ! [IN]
3198  albg_org(:,:,i_r_direct ,i_r_nir), & ! [IN]
3199  albg(:,:,i_r_direct ,i_r_nir) ) ! [OUT]
3200  if ( filter_niter > 0 ) then
3201  call filter_hyperdiff( ia, is, ie, ja, js, je, &
3202  albg(:,:,i_r_direct,i_r_nir), filter_order, filter_niter, &
3203  limiter_sign = one2d(:,:) )
3204  call comm_vars8( albg(:,:,i_r_direct,i_r_nir), 1 )
3205  call comm_wait ( albg(:,:,i_r_direct,i_r_nir), 1 )
3206  end if
3207 
3208  call interp_interp2d( itp_nh, & ! [IN]
3209  ldims(2), ldims(3), & ! [IN]
3210  ia, ja, & ! [IN]
3211  igrd(:,:,:), & ! [IN]
3212  jgrd(:,:,:), & ! [IN]
3213  hfact(:,:,:), & ! [IN]
3214  albg_org(:,:,i_r_diffuse,i_r_nir), & ! [IN]
3215  albg(:,:,i_r_diffuse,i_r_nir) ) ! [OUT]
3216  if ( filter_niter > 0 ) then
3217  call filter_hyperdiff( ia, is, ie, ja, js, je, &
3218  albg(:,:,i_r_diffuse,i_r_nir), filter_order, filter_niter, &
3219  limiter_sign = one2d(:,:) )
3220  call comm_vars8( albg(:,:,i_r_diffuse,i_r_nir), 1 )
3221  call comm_wait ( albg(:,:,i_r_diffuse,i_r_nir), 1 )
3222  end if
3223 
3224  call interp_interp2d( itp_nh, & ! [IN]
3225  ldims(2), ldims(3), & ! [IN]
3226  ia, ja, & ! [IN]
3227  igrd(:,:,:), & ! [IN]
3228  jgrd(:,:,:), & ! [IN]
3229  hfact(:,:,:), & ! [IN]
3230  albg_org(:,:,i_r_direct ,i_r_vis), & ! [IN]
3231  albg(:,:,i_r_direct ,i_r_vis) ) ! [OUT]
3232  if ( filter_niter > 0 ) then
3233  call filter_hyperdiff( ia, is, ie, ja, js, je, &
3234  albg(:,:,i_r_direct,i_r_vis), filter_order, filter_niter, &
3235  limiter_sign = one2d(:,:) )
3236  call comm_vars8( albg(:,:,i_r_direct,i_r_vis), 1 )
3237  call comm_wait ( albg(:,:,i_r_direct,i_r_vis), 1 )
3238  end if
3239 
3240  call interp_interp2d( itp_nh, & ! [IN]
3241  ldims(2), ldims(3), & ! [IN]
3242  ia, ja, & ! [IN]
3243  igrd(:,:,:), & ! [IN]
3244  jgrd(:,:,:), & ! [IN]
3245  hfact(:,:,:), & ! [IN]
3246  albg_org(:,:,i_r_diffuse,i_r_vis), & ! [IN]
3247  albg(:,:,i_r_diffuse,i_r_vis) ) ! [OUT]
3248  if ( filter_niter > 0 ) then
3249  call filter_hyperdiff( ia, is, ie, ja, js, je, &
3250  albg(:,:,i_r_diffuse,i_r_vis), filter_order, filter_niter, &
3251  limiter_sign = one2d(:,:) )
3252  call comm_vars8( albg(:,:,i_r_diffuse,i_r_vis), 1 )
3253  call comm_wait ( albg(:,:,i_r_diffuse,i_r_vis), 1 )
3254  end if
3255 
3256  call interp_interp3d( itp_nh, & ! [IN]
3257  ldims(1), ldims(2), ldims(3), & ! [IN]
3258  lkmax, lks, lke, & ! [IN]
3259  ia, ja, & ! [IN]
3260  igrd( :,:,:), & ! [IN]
3261  jgrd( :,:,:), & ! [IN]
3262  hfact( :,:,:), & ! [IN]
3263  kgrdl(:,:,:,:,:), & ! [IN]
3264  vfactl(:,:,:,:,:), & ! [IN]
3265  tg_org(:,:,:), & ! [IN]
3266  tg(:,:,:) ) ! [OUT]
3267 
3268  do j = 1, ja
3269  do i = 1, ia
3270  tg(lkmax,i,j) = tg(lkmax-1,i,j)
3271  enddo
3272  enddo
3273 
3274  ! replace values over the ocean
3275  do k = 1, lkmax
3276  call replace_misval_const( tg(k,:,:), maskval_tg, lsmask_nest )
3277  enddo
3278  if ( filter_niter > 0 ) then
3279  call filter_hyperdiff( lkmax, 1, lkmax, ia, is, ie, ja, js, je, &
3280  tg(:,:,:), filter_order, filter_niter )
3281  call comm_vars8( tg(:,:,:), 1 )
3282  call comm_wait ( tg(:,:,:), 1 )
3283  end if
3284 
3285 
3286  ! elevation collection
3287  if ( elevation_collection ) then
3288  call interp_interp2d( itp_nh, & ! [IN]
3289  ldims(2), ldims(3), & ! [IN]
3290  ia, ja, & ! [IN]
3291  igrd(:,:,:), & ! [IN]
3292  jgrd(:,:,:), & ! [IN]
3293  hfact(:,:,:), & ! [IN]
3294  topo_org(:,:), & ! [IN]
3295  topo(:,:) ) ! [OUT]
3296  if ( filter_niter > 0 ) then
3297  call filter_hyperdiff( ia, is, ie, ja, js, je, &
3298  topo(:,:), filter_order, filter_niter )
3299  call comm_vars8( topo(:,:), 1 )
3300  call comm_wait ( topo(:,:), 1 )
3301  end if
3302 
3303  do j = 1, ja
3304  do i = 1, ia
3305  if ( topo(i,j) > undef + eps ) then ! ignore UNDEF value
3306  tdiff = ( topo_zsfc(i,j) - topo(i,j) ) * laps
3307  lst(i,j) = lst(i,j) - tdiff
3308  do k = 1, lkmax
3309  tg(k,i,j) = tg(k,i,j) - tdiff
3310  end do
3311  end if
3312  end do
3313  end do
3314 
3315  if ( urban_do ) then
3316  do j = 1, ja
3317  do i = 1, ia
3318  if ( topo(i,j) > 0.0_rp ) then ! ignore UNDEF value
3319  tdiff = ( topo_zsfc(i,j) - topo(i,j) ) * laps
3320  ust(i,j) = ust(i,j) - tdiff
3321  end if
3322  end do
3323  end do
3324  end if
3325 
3326  end if
3327 
3328 
3329 
3330  ! Land water: interpolate over the ocean
3331  if( use_file_landwater )then
3332 
3333  if ( use_waterratio ) then
3334 
3335  if ( i_intrp_land_water .ne. i_intrp_off ) then
3336  do k = 1, ldims(1)
3337  work(:,:) = smds_org(k,:,:)
3338  select case( i_intrp_land_water )
3339  case( i_intrp_mask )
3340  lmask = lmask_org
3341  case( i_intrp_fill )
3342  call make_mask( lmask, work, ldims(2), ldims(3), landdata=.true.)
3343  end select
3344  call interp_oceanland_data(work, lmask, ldims(2), ldims(3), .true., intrp_iter_max)
3345  lmask(:,:) = init_landwater_ratio
3346  !replace missing value to init_landwater_ratio
3347  call replace_misval_map( work, lmask, ldims(2), ldims(3), "SMOISDS")
3348  smds_org(k,:,:) = work(:,:)
3349  enddo
3350  end if
3351 
3352  call interp_interp3d( itp_nh, & ! [IN]
3353  ldims(1), ldims(2), ldims(3), & ! [IN]
3354  lkmax, lks, lke, & ! [IN]
3355  ia, ja, & ! [IN]
3356  igrd( :,:,:), & ! [IN]
3357  jgrd( :,:,:), & ! [IN]
3358  hfact( :,:,:), & ! [IN]
3359  kgrdl(:,:,:,:,:), & ! [IN]
3360  vfactl(:,:,:,:,:), & ! [IN]
3361  smds_org(:,:,:), & ! [IN]
3362  smds(:,:,:) ) ! [OUT]
3363 
3364  do k = 1, lkmax-1
3365  strg(k,:,:) = convert_ws2vwc( smds(k,:,:), critical=soilwater_ds2vc_flag )
3366  end do
3367 
3368  else
3369 
3370  if ( i_intrp_land_water .ne. i_intrp_off ) then
3371  do k = 1, ldims(1)
3372  work(:,:) = strg_org(k,:,:)
3373  select case( i_intrp_land_water )
3374  case( i_intrp_mask )
3375  lmask = lmask_org
3376  case( i_intrp_fill )
3377  call make_mask( lmask, work, ldims(2), ldims(3), landdata=.true.)
3378  end select
3379  call interp_oceanland_data(work, lmask, ldims(2), ldims(3), .true., intrp_iter_max)
3380  lmask(:,:) = maskval_strg
3381  !replace missing value to init_landwater_ratio
3382  call replace_misval_map( work, lmask, ldims(2), ldims(3), "SMOIS")
3383  strg_org(k,:,:) = work(:,:)
3384  enddo
3385  end if
3386 
3387  call interp_interp3d( itp_nh, & ! [IN]
3388  ldims(1), ldims(2), ldims(3), & ! [IN]
3389  lkmax, lks, lke, & ! [IN]
3390  ia, ja, & ! [IN]
3391  igrd( :,:,:), & ! [IN]
3392  jgrd( :,:,:), & ! [IN]
3393  hfact( :,:,:), & ! [IN]
3394  kgrdl(:,:,:,:,:), & ! [IN]
3395  vfactl(:,:,:,:,:), & ! [IN]
3396  strg_org(:,:,:), & ! [IN]
3397  strg(:,:,:) ) ! [OUT]
3398  end if
3399 
3400  ! replace values over the ocean
3401  do k = 1, lkmax-1
3402  call replace_misval_const( strg(k,:,:), maskval_strg, lsmask_nest )
3403  enddo
3404 
3405  if ( filter_niter > 0 ) then
3406  one3d(:,:,:) = 1.0_rp
3407  call filter_hyperdiff( lkmax, 1, lkmax-1, ia, is, ie, ja, js, je, &
3408  strg(:,:,:), filter_order, filter_niter, &
3409  limiter_sign = one3d(:,:,:) )
3410  call comm_vars8( strg(:,:,:), 1 )
3411  call comm_wait ( strg(:,:,:), 1 )
3412  end if
3413 
3414  do j = 1, ja
3415  do i = 1, ia
3416  strg(lkmax,i,j) = strg(lkmax-1,i,j)
3417  enddo
3418  enddo
3419 
3420  else ! not read from boundary file
3421 
3422  smds(:,:,:) = init_landwater_ratio
3423  ! conversion from water saturation [fraction] to volumetric water content [m3/m3]
3424  do k = 1, lkmax
3425  strg(k,:,:) = convert_ws2vwc( smds(k,:,:), critical=.true. )
3426  end do
3427 
3428  endif ! use_file_waterratio
3429 
3430 
3431  if ( urban_do ) then
3432  ! copy albedo of land to urban
3433  do j = 1, ja
3434  do i = 1, ia
3435  albu(i,j,:,:) = albg(i,j,:,:)
3436  enddo
3437  enddo
3438  end if
3439 
3440 
3441  return
integer, public const_i_lw
long-wave radiation index
Definition: scale_const.F90:93
real(rp) function, dimension(lia, lja), public convert_ws2vwc(WS, critical)
conversion from water saturation [fraction] to volumetric water content [m3/m3]
module INTERPOLATION
subroutine, public interp_factor3d(npoints, KA_ref, KS_ref, KE_ref, IA_ref, JA_ref, lon_ref, lat_ref, hgt_ref, KA, KS, KE, IA, JA, lon, lat, hgt, idx_i, idx_j, hfact, idx_k, vfact)
real(rp), public const_laps
lapse rate of ISA [K/m]
Definition: scale_const.F90:58
subroutine, public interp_interp3d(npoints, KA_ref, IA_ref, JA_ref, KA, KS, KE, IA, JA, idx_i, idx_j, hfact, idx_k, vfact, val_ref, val, logwgt)
integer, parameter, public i_lw
real(rp), public const_undef
Definition: scale_const.F90:41
module COMMUNICATION
integer, parameter, public i_sw
module FILTER
module PROCESS
Definition: scale_prc.F90:11
subroutine, public interp_interp2d(npoints, IA_ref, JA_ref, IA, JA, idx_i, idx_j, hfact, val_ref, val)
module LAND Variables
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
module CONSTANT
Definition: scale_const.F90:11
real(rp), public const_eps
small number
Definition: scale_const.F90:33
integer, public const_i_sw
short-wave radiation index
Definition: scale_const.F90:94
real(rp), dimension(:,:), allocatable, public topo_zsfc
absolute ground height [m]
module TOPOGRAPHY
subroutine, public interp_factor2d(npoints, IA_ref, JA_ref, lon_ref, lat_ref, IA, JA, lon, lat, idx_i, idx_j, hfact, search_limit, latlon_structure, weight_order)
logical, public urban_do
Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_mask()

subroutine mod_realinput::make_mask ( real(rp), dimension(:,:), intent(out)  gmask,
real(rp), dimension(:,:), intent(in)  data,
integer, intent(in)  nx,
integer, intent(in)  ny,
logical, intent(in)  landdata 
)

Definition at line 3451 of file mod_realinput.F90.

References scale_const::const_eps, and scale_const::const_undef.

Referenced by land_interporation(), and realinput_surface().

3451  use scale_const, only: &
3452  eps => const_eps, &
3453  undef => const_undef
3454  implicit none
3455  real(RP), intent(out) :: gmask(:,:)
3456  real(RP), intent(in) :: data(:,:)
3457  integer, intent(in) :: nx
3458  integer, intent(in) :: ny
3459  logical, intent(in) :: landdata ! .true. => land data , .false. => ocean data
3460 
3461  real(RP) :: dd
3462  integer :: i,j
3463 
3464  if( landdata )then
3465  gmask(:,:) = 1.0_rp ! gmask=1 will be skip in "interp_OceanLand_data"
3466  dd = 0.0_rp
3467  else
3468  gmask(:,:) = 0.0_rp ! gmask=0 will be skip in "interp_OceanLand_data"
3469  dd = 1.0_rp
3470  endif
3471 
3472  do j = 1, ny
3473  do i = 1, nx
3474  if( abs(data(i,j) - undef) < sqrt(eps) )then
3475  gmask(i,j) = dd
3476  endif
3477  enddo
3478  enddo
3479 
3480  return
real(rp), public const_undef
Definition: scale_const.F90:41
module CONSTANT
Definition: scale_const.F90:11
real(rp), public const_eps
small number
Definition: scale_const.F90:33
Here is the caller graph for this function:

◆ replace_misval_const()

subroutine mod_realinput::replace_misval_const ( real(rp), dimension(:,:), intent(inout)  data,
real(rp), intent(in)  maskval,
real(rp), dimension(:,:), intent(in)  frac_land 
)

Definition at line 3596 of file mod_realinput.F90.

References scale_const::const_eps, scale_atmos_grid_cartesc_index::ia, and scale_atmos_grid_cartesc_index::ja.

Referenced by land_interporation().

3596  use scale_const, only: &
3597  eps => const_eps
3598  implicit none
3599  real(RP), intent(inout) :: data(:,:)
3600  real(RP), intent(in) :: maskval
3601  real(RP), intent(in) :: frac_land(:,:)
3602  integer :: i, j
3603 
3604  do j = 1, ja
3605  do i = 1, ia
3606  if( abs(frac_land(i,j)-0.0_rp) < eps )then ! ocean grid
3607  data(i,j) = maskval
3608  endif
3609  enddo
3610  enddo
3611 
module CONSTANT
Definition: scale_const.F90:11
real(rp), public const_eps
small number
Definition: scale_const.F90:33
Here is the caller graph for this function:

◆ replace_misval_map()

subroutine mod_realinput::replace_misval_map ( real(rp), dimension(:,:), intent(inout)  data,
real(rp), dimension(:,:), intent(in)  maskval,
integer, intent(in)  nx,
integer, intent(in)  ny,
character(len=*), intent(in)  elem 
)

Definition at line 3616 of file mod_realinput.F90.

References scale_const::const_eps, scale_const::const_undef, and scale_prc::prc_abort().

Referenced by land_interporation(), and realinput_surface().

3616  use scale_const, only: &
3617  eps => const_eps, &
3618  undef => const_undef
3619  implicit none
3620 
3621  real(RP), intent(inout) :: data(:,:)
3622  real(RP), intent(in) :: maskval(:,:)
3623  integer, intent(in) :: nx, ny
3624  character(len=*), intent(in) :: elem
3625 
3626  integer :: i, j
3627 
3628  do j = 1, ny
3629  do i = 1, nx
3630  if( abs(data(i,j) - undef) < sqrt(eps) )then
3631  if( abs(maskval(i,j) - undef) < sqrt(eps) )then
3632  log_error("replace_misval_map",*) "data for mask of "//trim(elem)//"(",i,",",j,") includes missing value."
3633  log_error_cont(*) "Please check input data of SKINTEMP or SST. "
3634  call prc_abort
3635  else
3636  data(i,j) = maskval(i,j)
3637  endif
3638  endif
3639  enddo
3640  enddo
3641 
real(rp), public const_undef
Definition: scale_const.F90:41
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
module CONSTANT
Definition: scale_const.F90:11
real(rp), public const_eps
small number
Definition: scale_const.F90:33
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ iscale

integer, parameter, public mod_realinput::iscale = 1

Definition at line 72 of file mod_realinput.F90.

Referenced by realinput_surface().

72  integer, public, parameter :: iscale = 1

◆ iwrfarw

integer, parameter, public mod_realinput::iwrfarw = 2

Definition at line 73 of file mod_realinput.F90.

Referenced by realinput_surface().

73  integer, public, parameter :: iwrfarw = 2

◆ igrads

integer, parameter, public mod_realinput::igrads = 4

Definition at line 75 of file mod_realinput.F90.

Referenced by realinput_surface().

75  integer, public, parameter :: igrads = 4