47 private :: topography_read
53 character(len=H_LONG),
private :: topography_in_basename =
''
54 character(len=H_LONG),
private :: topography_in_varname =
'topo'
55 logical,
private :: topography_in_aggregate
56 logical,
private :: topography_in_check_coordinates = .false.
57 character(len=H_LONG),
private :: topography_out_basename =
''
58 logical,
private :: topography_out_aggregate
59 character(len=H_MID),
private :: topography_out_title =
'SCALE-RM TOPOGRAPHY'
60 character(len=H_SHORT),
private :: topography_out_dtype =
'DEFAULT'
73 namelist / param_topography / &
74 topography_in_basename, &
75 topography_in_varname, &
76 topography_in_aggregate, &
77 topography_in_check_coordinates, &
78 topography_out_basename, &
79 topography_out_aggregate, &
86 log_info(
"TOPOGRAPHY_setup",*)
'Setup'
95 log_info(
"TOPOGRAPHY_setup",*)
'Not found namelist. Default used.'
96 elseif( ierr > 0 )
then
97 log_error(
"TOPOGRAPHY_setup",*)
'Not appropriate names in namelist PARAM_TOPOGRAPHY. Check!'
100 log_nml(param_topography)
124 real(
rp),
intent(inout),
optional :: zsfc(
ia,
ja)
125 logical,
intent(in),
optional :: fill_bnd
131 if (
present(fill_bnd) ) fill_bnd_ = fill_bnd
133 if (
present(zsfc) )
then
134 call comm_vars8( zsfc(:,:), 1 )
135 call comm_wait ( zsfc(:,:), 1, fill_bnd_ )
160 subroutine topography_read
165 file_cartesc_check_coordinates, &
175 log_info(
"TOPOGRAPHY_read",*)
'Input topography file '
177 if ( topography_in_basename /=
'' )
then
179 call file_cartesc_open( topography_in_basename, fid, aggregate=topography_in_aggregate )
180 call file_cartesc_read( fid, topography_in_varname,
'XY',
topography_zsfc(:,:) )
185 if ( topography_in_check_coordinates )
then
186 call file_cartesc_check_coordinates( fid )
197 log_info_cont(*)
'topography file is not specified.'
203 end subroutine topography_read
212 file_cartesc_write_var, &
219 if ( topography_out_basename /=
'' .and. topography_out_basename /= topography_in_basename )
then
222 log_info(
"TOPOGRAPHY_write",*)
'Output topography file '
226 call file_cartesc_create( topography_out_basename, topography_out_title, topography_out_dtype, &
228 haszcoord=.false., aggregate=topography_out_aggregate )
232 standard_name=
"surface_altitude" )
236 call file_cartesc_write_var( fid, vid,
topography_zsfc(:,:),
'topo',
'XY' )
247 IA, IS, IE, JA, JS, JE, &
252 integer,
intent(in) ::
ia,
is,
ie
253 integer,
intent(in) ::
ja,
js,
je
254 real(
rp),
intent(in) :: rcdx(
ia), rcdy(
ja)
255 real(
rp),
intent(in) :: mapf(
ia,
ja,2)
275 * rcdx(i) * mapf(i,j,1)
286 * rcdy(j) * mapf(i,j,2)