16 use utilities,
only : error_handler
21 integer,
intent(in) :: unt
22 character(*),
intent(in) :: namel
24 type(grid_setup_type),
intent(out) :: grid_setup
26 character(len=7) :: gridtype
27 character(len=100) :: fname, fname_mask, fname_coord
28 character(len=100) :: dir, dir_mask, dir_coord
29 character(len=4) :: default_str=
"NULL" 33 namelist /input/ fname, dir, &
35 fname_mask, dir_mask, &
36 fname_coord, dir_coord, &
39 namelist /output/ fname, dir, &
41 fname_mask, dir_mask, &
42 fname_coord, dir_coord,&
48 fname_mask = default_str
49 dir_mask = default_str
50 fname_coord = default_str
51 dir_coord = default_str
57 read(unt, nml=input, iostat=ierr)
58 if (ierr /= 0)
call error_handler(
"READING input NAMELIST.", ierr)
60 read(unt, nml=output, iostat=ierr)
61 if (ierr /= 0)
call error_handler(
"READING output NAMELIST.", ierr)
63 call error_handler(
"unknown namel in readin_setup", 1)
66 grid_setup%descriptor = gridtype
69 grid_setup%fname = fname
72 select case (gridtype)
74 grid_setup%dir_mask = dir_mask
75 grid_setup%fname_mask = fname_mask
76 grid_setup%mask_variable(1) =
"vegetation_type" 78 if (trim(fname_mask) == default_str)
then 79 grid_setup%dir_mask = dir
80 grid_setup%fname_mask = fname
82 grid_setup%dir_mask = dir_mask
83 grid_setup%fname_mask = fname_mask
85 grid_setup%mask_variable(1) =
"soilsnow_mask " 87 call error_handler(
"unknown gridtype in readin_setup", 1)
90 grid_setup%dir_coord = dir_coord
91 grid_setup%fname_coord = fname_coord
92 grid_setup%ires = ires
93 grid_setup%jres = jres
subroutine readin_setup(unt, namel, grid_setup)
Subroutine to read in namelists, and convert values into setupgrid.