Merge branch 'master' into devel
[wrffire.git] / standalone / module_configure.F
blob3b85778e6c768a1c52b68a02f25a3e89161429bc
1 module module_configure
2 use module_wrf_error, only: wrf_error_fatal
4 implicit none
6 private
7 public read_namelist,grid_config_rec_type,nmlfile
10 ! type for all namelist fields, domain 1 only
11 integer,parameter::max_domains=10,max_moves=1,max_eta=501,max_bogus=5
12 type grid_config_rec_type
13 #include "namelist_defines2.inc"
14 end type
16 ! namelist file name
17 character(len=*),parameter::nmlfile='namelist.input'
19 contains
21 subroutine read_namelist(config_flags)
22 implicit none
24 !*** arguments
25 type(grid_config_rec_type), intent(out)::config_flags
27 !*** local
28 character(len=32)::grp
29 integer::iou=1
30 #include "namelist_defines.inc"
31 #include "namelist_statements.inc"
33 integer::placeholder
34 namelist /standalone/ placeholder
36 !*** executable
38 #include "namelist_defaults.inc"
40 write(*,'(2a)')'reading flags from file ',trim(nmlfile)
42 open(iou,file=nmlfile,err=999)
44 grp='time_control'
45 read(iou,time_control,err=998)
46 rewind(iou)
48 grp='domains'
49 read(iou,domains,err=998)
50 rewind(iou)
52 grp='fire'
53 read(iou,fire,err=998)
54 rewind(iou)
56 grp='standalone'
57 read(iou,standalone,err=997,end=997)
58 close(iou)
60 997 continue
62 #define DEST_RECORD config_flags %
63 #define SOURCE_RECORD 
64 #define SOURCE_REC_DEX (1)
65 #include "config_assigns.inc"
67 return
69 998 continue
70 call wrf_error_fatal('error reading namelist group '//grp)
72 999 continue
73 call wrf_error_fatal('error opening namelist '//trim(nmlfile))
75 end subroutine read_namelist
77 end module module_configure