SCALE-RM
Functions/Subroutines | Variables
mod_cnv2d Module Reference

module Convert 2D data More...

Functions/Subroutines

subroutine, public cnv2d_setup
 Setup. More...
 
subroutine, public cnv2d
 Driver. More...
 
subroutine cnv2d_fillhalo (VAR, FILL_BND)
 HALO Communication. More...
 

Variables

logical, public cnv2d_donothing
 
logical, public cnv2d_usegrads = .true.
 

Detailed Description

module Convert 2D data

Description
subroutines for preparing 2D data (convert from external file)
Author
Team SCALE
NAMELIST
  • PARAM_CNV2D
    nametypedefault valuecomment
    CNV2D_USEGRADS logical .true.
    CNV2D_INTERPOLATION_TYPE character(len=H_SHORT) 'bilinear' interpolation type
    CNV2D_UNITTILE_DDEG real(RP) 0.0_RP dx for unit tile [deg]
    CNV2D_OVERSAMPLING_FACTOR real(RP) 2.0_RP factor of min. dx against the unit tile
    CNV2D_OUT_BASENAME character(len=H_LONG) '' basename of the output file
    CNV2D_OUT_TITLE character(len=H_MID) 'SCALE-RM 2D Boundary' title of the output file
    CNV2D_OUT_VARNAME character(len=H_SHORT) '' name of the variable
    CNV2D_OUT_VARDESC character(len=H_MID) '' title of the variable
    CNV2D_OUT_VARUNIT character(len=H_SHORT) '' units of the variable
    CNV2D_OUT_DTYPE character(len=H_SHORT) 'DEFAULT' REAL4 or REAL8

  • PARAM_CNV2D_GrADS
    nametypedefault valuecomment
    GRADS_NLAT integer -1 number of latitude tile
    GRADS_NLON integer -1 number of longitude tile
    GRADS_DLAT real(RP) -1.0_RP width of latitude tile [deg.]
    GRADS_DLON real(RP) -1.0_RP width of longitude tile [deg.]
    GRADS_IN_CATALOGUE character(len=H_LONG) '' catalogue file
    GRADS_IN_DIR character(len=H_LONG) '.' directory contains data files (GrADS format)
    GRADS_IN_FILENAME character(len=H_LONG) '' single data file (GrADS format)
    GRADS_IN_DATATYPE character(len=H_LONG) 'REAL4' datatype (REAL4,REAL8,INT2)
    GRADS_LATORDER_N2S logical .false. data of the latitude direction is stored in ordar of North->South?
    GRADS_MISSINGVAL real(RP) missing value
    GRADS_LAT_START real(RP) -90.0_RP (for single file) start latitude of domain in input data
    GRADS_LAT_END real(RP) 90.0_RP (for single file) end latitude of domain in input data
    GRADS_LON_START real(RP) 0.0_RP (for single file) start longitude of domain in input data
    GRADS_LON_END real(RP) 360.0_RP (for single file) end longitude of domain in input data
    GRADS_NSTEP integer 1 number of steps
    GRADS_DT real(DP) 0.0_DP time interval
    GRADS_DT_UNIT character(len=H_SHORT) "SEC" time unit for GrADS_DT

History Output
No history output

Function/Subroutine Documentation

◆ cnv2d_setup()

subroutine, public mod_cnv2d::cnv2d_setup ( )

Setup.

Definition at line 71 of file mod_cnv2d.F90.

References scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_dlat, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_dlon, cnv2d_donothing, cnv2d_usegrads, scale_const::const_d2r, scale_atmos_grid_cartesc_index::ia, scale_atmos_grid_cartesc_index::ie, scale_io::io_fid_conf, scale_atmos_grid_cartesc_index::is, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::je, scale_atmos_grid_cartesc_index::js, and scale_prc::prc_abort().

Referenced by mod_convert::convert_setup().

71  use scale_prc, only: &
72  prc_abort
73  use scale_const, only: &
74  d2r => const_d2r
75  use scale_statistics, only: &
76  statistics_horizontal_min
78  real_dlat => atmos_grid_cartesc_real_dlat, &
79  real_dlon => atmos_grid_cartesc_real_dlon
80  implicit none
81 
82  namelist / param_cnv2d / &
83  cnv2d_usegrads, &
84  cnv2d_interpolation_type, &
85  cnv2d_unittile_ddeg, &
86  cnv2d_oversampling_factor, &
87  cnv2d_out_basename, &
88  cnv2d_out_title, &
89  cnv2d_out_varname, &
90  cnv2d_out_vardesc, &
91  cnv2d_out_varunit, &
92  cnv2d_out_dtype
93 
94  real(RP) :: drad(ia,ja)
95  real(RP) :: drad_min
96 
97  integer :: ierr
98  !---------------------------------------------------------------------------
99 
100  log_newline
101  log_info("CNV2D_setup",*) 'Setup'
102 
103  !--- read namelist
104  rewind(io_fid_conf)
105  read(io_fid_conf,nml=param_cnv2d,iostat=ierr)
106  if( ierr < 0 ) then !--- missing
107  log_info("CNV2D_setup",*) 'Not found namelist. Default used.'
108  elseif( ierr > 0 ) then !--- fatal error
109  log_error("CNV2D_setup",*) 'Not appropriate names in namelist PARAM_CNV2D. Check!'
110  call prc_abort
111  endif
112  log_nml(param_cnv2d)
113 
114  cnv2d_donothing = .true.
115 
116  if ( cnv2d_usegrads ) then
117  cnv2d_donothing = .false.
118  log_info("CNV2D_setup",*) 'Use GrADS format file for input'
119  endif
120 
121  if ( cnv2d_interpolation_type == 'bilinear' ) then
122  log_info("CNV2D_setup",*) 'Interpolation type : bi-linear interpolation (coarse input->fine model grid)'
123  elseif( cnv2d_interpolation_type == 'areaweighted' ) then
124  log_info("CNV2D_setup",*) 'Interpolation type : area-weighted average (fine input->coarse model grid)'
125  elseif( cnv2d_interpolation_type == 'nearestneighbor' ) then
126  log_info("CNV2D_setup",*) 'Interpolation type : nearest neighbor'
127  else
128  log_error("CNV2D_setup",*) 'Not appropriate interpolation type. Check!', trim(cnv2d_interpolation_type)
129  call prc_abort
130  endif
131 
132  if ( cnv2d_donothing ) then
133  log_info("CNV2D_setup",*) 'Do nothing for 2D data conversion'
134  else
135  drad(:,:) = min( real_dlat(:,:), real_dlon(:,:) )
136  call statistics_horizontal_min( ia, is, ie, ja, js, je, &
137  drad(:,:), drad_min )
138 
139  if ( cnv2d_unittile_ddeg > 0.0_rp ) then
140  cnv2d_oversampling_factor = ( drad_min / d2r ) / cnv2d_unittile_ddeg
141  endif
142  cnv2d_oversampling_factor = max( 1.0_rp, cnv2d_oversampling_factor )
143  cnv2d_unittile_ddeg = ( drad_min / d2r ) / cnv2d_oversampling_factor
144 
145  log_info("CNV2D_setup",*) 'The size of tile [deg] = ', cnv2d_unittile_ddeg
146  log_info("CNV2D_setup",*) 'oversampling factor = ', cnv2d_oversampling_factor
147  endif
148 
149  return
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:55
real(rp), public const_d2r
degree to radian
Definition: scale_const.F90:32
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_dlon
delta longitude
module PROCESS
Definition: scale_prc.F90:11
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_dlat
delta latitude
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
module CONSTANT
Definition: scale_const.F90:11
module Atmosphere GRID CartesC Real(real space)
module Statistics
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cnv2d()

subroutine, public mod_cnv2d::cnv2d ( )

Driver.

Definition at line 155 of file mod_cnv2d.F90.

References scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_lat, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_latxv, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_lon, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_lonuy, scale_calendar::calendar_unit2sec(), cnv2d_donothing, cnv2d_usegrads, scale_const::const_d2r, scale_const::const_eps, scale_const::const_pi, scale_const::const_radius, scale_const::const_undef, scale_atmos_grid_cartesc_index::ia, scale_atmos_grid_cartesc_index::ie, scale_io::io_fid_conf, scale_io::io_get_available_fid(), scale_atmos_grid_cartesc_index::is, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::je, scale_atmos_grid_cartesc_index::js, and scale_prc::prc_abort().

Referenced by mod_convert::convert().

155  implicit none
156  !---------------------------------------------------------------------------
157 
158  if ( cnv2d_donothing ) then
159  log_newline
160  log_progress(*) 'skip convert topography data'
161  else
162  log_newline
163  log_progress(*) 'start convert topography data'
164 
165  if ( cnv2d_usegrads ) then
166  call cnv2d_grads
167  endif
168 
169  log_progress(*) 'end convert topography data'
170  endif
171 
172  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cnv2d_fillhalo()

subroutine mod_cnv2d::cnv2d_fillhalo ( real(rp), dimension(ia,ja), intent(inout)  VAR,
logical, intent(in), optional  FILL_BND 
)

HALO Communication.

Definition at line 1199 of file mod_cnv2d.F90.

References scale_time::time_nowdate.

1199  use scale_comm_cartesc, only: &
1200  comm_vars8, &
1201  comm_wait
1202  implicit none
1203 
1204  real(RP), intent(inout) :: var(ia,ja)
1205 
1206  logical, intent(in), optional :: fill_bnd
1207 
1208  logical :: fill_bnd_
1209  !---------------------------------------------------------------------------
1210 
1211  fill_bnd_ = .false.
1212  if ( present(fill_bnd) ) fill_bnd_ = fill_bnd
1213 
1214  call comm_vars8( var(:,:), 1 )
1215  call comm_wait ( var(:,:), 1, fill_bnd_ )
1216 
1217  return
module COMMUNICATION

Variable Documentation

◆ cnv2d_donothing

logical, public mod_cnv2d::cnv2d_donothing

Definition at line 35 of file mod_cnv2d.F90.

Referenced by cnv2d(), and cnv2d_setup().

35  logical, public :: cnv2d_donothing

◆ cnv2d_usegrads

logical, public mod_cnv2d::cnv2d_usegrads = .true.

Definition at line 36 of file mod_cnv2d.F90.

Referenced by cnv2d(), and cnv2d_setup().

36  logical, public :: cnv2d_usegrads = .true.