46 private :: topography_read
52 character(len=H_LONG),
private :: topography_in_basename =
''
53 character(len=H_LONG),
private :: topography_in_varname =
'topo'
54 logical,
private :: topography_in_aggregate
55 logical,
private :: topography_in_check_coordinates = .false.
56 character(len=H_LONG),
private :: topography_out_basename =
''
57 logical,
private :: topography_out_aggregate
58 character(len=H_MID),
private :: topography_out_title =
'SCALE-RM TOPOGRAPHY'
59 character(len=H_SHORT),
private :: topography_out_dtype =
'DEFAULT'
72 namelist / param_topography / &
73 topography_in_basename, &
74 topography_in_varname, &
75 topography_in_aggregate, &
76 topography_in_check_coordinates, &
77 topography_out_basename, &
78 topography_out_aggregate, &
85 log_info(
"TOPOGRAPHY_setup",*)
'Setup'
94 log_info(
"TOPOGRAPHY_setup",*)
'Not found namelist. Default used.'
95 elseif( ierr > 0 )
then
96 log_error(
"TOPOGRAPHY_setup",*)
'Not appropriate names in namelist PARAM_TOPOGRAPHY. Check!'
99 log_nml(param_topography)
122 real(
rp),
intent(inout),
optional :: zsfc(
ia,
ja)
123 logical,
intent(in),
optional :: fill_bnd
129 if (
present(fill_bnd) ) fill_bnd_ = fill_bnd
131 if (
present(zsfc) )
then
132 call comm_vars8( zsfc(:,:), 1 )
133 call comm_wait ( zsfc(:,:), 1, fill_bnd_ )
144 subroutine topography_read
149 file_cartesc_check_coordinates, &
159 log_info(
"TOPOGRAPHY_read",*)
'Input topography file '
161 if ( topography_in_basename /=
'' )
then
163 call file_cartesc_open( topography_in_basename, fid, aggregate=topography_in_aggregate )
164 call file_cartesc_read( fid, topography_in_varname,
'XY',
topography_zsfc(:,:) )
168 if ( topography_in_check_coordinates )
then
169 call file_cartesc_check_coordinates( fid )
179 log_info_cont(*)
'topography file is not specified.'
185 end subroutine topography_read
194 file_cartesc_write_var, &
201 if ( topography_out_basename /=
'' .and. topography_out_basename /= topography_in_basename )
then
204 log_info(
"TOPOGRAPHY_write",*)
'Output topography file '
208 call file_cartesc_create( topography_out_basename, topography_out_title, topography_out_dtype, &
210 haszcoord=.false., aggregate=topography_out_aggregate )
214 standard_name=
"surface_altitude" )
218 call file_cartesc_write_var( fid, vid,
topography_zsfc(:,:),
'topo',
'XY' )
229 IA, IS, IE, JA, JS, JE, &
234 integer,
intent(in) ::
ia,
is,
ie
235 integer,
intent(in) ::
ja,
js,
je
236 real(
rp),
intent(in) :: rcdx(
ia), rcdy(
ja)
237 real(
rp),
intent(in) :: mapf(
ia,
ja,2)
254 * rcdx(i) * mapf(i,j,1)
263 * rcdy(j) * mapf(i,j,2)