40 integer :: stdunit = 6, unit=7, io_status
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 fill_regional_halo(data, halo)
This routine extrapolate geolat_c and geolon_c halo points for the regional standalone grid...
character(len=128) topo_field
NetCDF record name of the filtered topography (or orography).
character(len=128) mask_field
NetCDF record name of the land/sea mask.
logical nested
If true, process a global grid with a nest.
subroutine handle_err(status, string)
Prints an error message to standard output, then halts program execution with a bad status...
subroutine read_namelist
Read the program namelist file.
character(len=512) grid_file
Path/name of the grid mosaic file.
real res
The 'CRES' resolution.
logical regional
If true, process a stand-alone regional grid.
integer grid_type
Grid type.
real stretch_fac
Grid stretching factor.
Module that contains general utility routines.
logical zero_ocean
If true, no diffusive flux into water/ocean area (preserve islands).
character(len=512) topo_file
Path/name of the topography (or orography) file.