1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4 ! First version: Michael Duda -- January 2006
5 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9 use interp_option_module
12 use process_domain_module
18 logical :: extra_row, extra_col
24 ! Initialize parallel stuff
27 call mprintf(.true.,LOGFILE,' *** Starting program metgrid.exe *** ')
29 ! Get info about how many nests there are to process, etc.
30 call get_namelist_params()
32 ! Having determined which processor we are, which grid type we are, and where
33 ! our patch is located in the domain, we can determine if U or V staggered
34 ! fields will have one more row or column than the M staggered fields
35 if (gridtype == 'C') then
36 if (my_x == nproc_x-1) then
42 if (my_y == nproc_y-1) then
47 else if (gridtype == 'E') then
52 ! Get info about which interpolators should be used with each field
53 call read_interp_table()
56 ! Now begin the processing work, looping over all domains to be processed
59 if (gridtype == 'C') then
63 call mprintf(.true.,STDOUT,'Processing domain %i of %i', i1=n, i2=max_dom)
64 call mprintf(.true.,LOGFILE,'Processing domain %i of %i', i1=n, i2=max_dom)
66 call process_domain(n, extra_row, extra_col)
68 end do ! Loop over max_dom
70 else if (gridtype == 'E') then
72 call mprintf(.true.,STDOUT,'Processing coarse domain only for NMM.')
73 call mprintf(.true.,LOGFILE,'Processing coarse domain only for NMM.')
75 call process_domain(1, extra_row, extra_col)
84 call interp_option_destroy()
86 call parallel_finish()
88 call mprintf(.true.,STDOUT,'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
89 call mprintf(.true.,STDOUT,'! Successful completion of metgrid. !')
90 call mprintf(.true.,STDOUT,'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
92 call mprintf(.true.,LOGFILE,' *** Successful completion of program metgrid.exe *** ')