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)
76 integer,
intent(in) :: status
77 character(len=*),
intent(in) :: string
78 character(len=256) :: errmsg
80 if (status .ne. nf_noerr)
then
81 errmsg = nf_strerror(status)
82 errmsg = trim(errmsg) //
" " // trim(string)
83 print *,
"FATAL ERROR:"
subroutine read_namelist
Read the program namelist file.
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.