14 character(len=512) :: topo_file =
"orog"
15 character(len=128) :: topo_field =
"orog_filt"
17 character(len=128) :: mask_field =
"slmsk"
18 character(len=512) :: grid_file =
"atmos_mosaic.nc"
20 logical :: zero_ocean = .true.
22 logical :: nested = .false.
23 logical :: regional = .false.
25 integer :: grid_type = 0
27 real :: stretch_fac = 1.0
40 integer :: stdunit = 6, unit=7, io_status
43 namelist /filter_topo_nml/ topo_file, topo_field, mask_field, grid_file, zero_ocean, &
44 stretch_fac, res, nested, grid_type, regional
47 inquire( unit=unit, opened=opened )
50 if( unit.EQ.100 )call
handle_err(-1,
'Unable to locate unit number.' )
53 open( unit=unit, file=
'input.nml', iostat=io_status )
54 read( unit,filter_topo_nml, iostat=io_status )
57 if (io_status > 0) call
handle_err(-1,
'Error reading input.nml')
59 write (stdunit, nml=filter_topo_nml)
71 integer,
intent(in) :: halo
72 real,
dimension(1-halo:,1-halo:,:),
intent(inout) :: data
73 integer :: h, i_st, i_ed, j_st, j_ed
75 i_st=lbound(
data,1)+halo
76 i_ed=ubound(
data,1)-halo
77 j_st=lbound(
data,2)+halo
78 j_ed=ubound(
data,2)-halo
81 data(i_st:i_ed, j_st-1 , :) = 2*
data(i_st:i_ed, j_st , :) -
data(i_st:i_ed, j_st+1 , :)
82 data(i_st:i_ed, j_ed+1 , :) = 2*
data(i_st:i_ed, j_ed , :) -
data(i_st:i_ed, j_ed-1 , :)
83 data(i_st-1 , j_st:j_ed, :) = 2*
data(i_st , j_st:j_ed, :) -
data(i_st+1 , j_st:j_ed, :)
84 data(i_ed+1 , j_st:j_ed, :) = 2*
data(i_ed , j_st:j_ed, :) -
data(i_ed-1 , j_st:j_ed, :)
86 data(i_st-1, j_st-1, :) = (
data(i_st-1, j_st, :) +
data(i_st, j_st-1, :))*0.5
87 data(i_ed+1, j_st-1, :) = (
data(i_ed+1, j_st, :) +
data(i_ed, j_st-1, :))*0.5
88 data(i_st-1, j_ed+1, :) = (
data(i_st-1, j_ed, :) +
data(i_st, j_ed+1, :))*0.5
89 data(i_ed+1, j_ed+1, :) = (
data(i_ed+1, j_ed, :) +
data(i_ed, j_ed+1, :))*0.5
110 #include <netcdf.inc>
112 integer,
intent(in) :: status
113 character(len=*),
intent(in) :: string
114 character(len=256) :: errmsg
116 if (status .ne. nf_noerr)
then
117 errmsg = nf_strerror(status)
118 errmsg = trim(errmsg) //
" " // trim(string)
119 print *,
"FATAL ERROR:"
120 print *, trim(errmsg)
subroutine read_namelist
Read the program namelist file.
subroutine fill_regional_halo(data, halo)
This routine extrapolate geolat_c and geolon_c halo points for the regional standalone grid...
subroutine handle_err(status, string)
Prints an error message to standard output, then halts program execution with a bad status...
Module that contains general utility routines.