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 if (grid_is_active(n)) then
64 call mprintf(.true.,STDOUT,'Processing domain %i of %i', i1=n, i2=max_dom)
65 call mprintf(.true.,LOGFILE,'Processing domain %i of %i', i1=n, i2=max_dom)
67 call process_domain(n, extra_row, extra_col)
69 call mprintf(.true.,STDOUT,'Skipping domain %i of %i', i1=n, i2=max_dom)
70 call mprintf(.true.,LOGFILE,'Skipping domain %i of %i', i1=n, i2=max_dom)
73 end do ! Loop over max_dom
75 else if (gridtype == 'E') then
77 call mprintf(.true.,STDOUT,'Processing coarse domain only for NMM.')
78 call mprintf(.true.,LOGFILE,'Processing coarse domain only for NMM.')
80 call process_domain(1, extra_row, extra_col)
89 call interp_option_destroy()
91 call parallel_finish()
93 call mprintf(.true.,STDOUT,'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
94 call mprintf(.true.,STDOUT,'! Successful completion of metgrid. !')
95 call mprintf(.true.,STDOUT,'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
97 call mprintf(.true.,LOGFILE,' *** Successful completion of program metgrid.exe *** ')