@@ -33,7 +33,7 @@ program test_data_override_ongrid
3333use netcdf, only: nf90_create, nf90_def_dim, nf90_def_var, nf90_enddef, nf90_put_var, &
3434 nf90_close, nf90_put_att, nf90_clobber, nf90_64bit_offset, nf90_char, &
3535 nf90_double, nf90_unlimited
36- use fms_mod, only: string
36+ use fms_mod, only: string, fms_init, fms_end
3737
3838implicit none
3939
@@ -53,10 +53,11 @@ program test_data_override_ongrid
5353integer , parameter :: scalar = 3
5454integer , parameter :: weight_file = 4
5555integer :: test_case = ongrid
56+ logical :: write_only= .false. ! < True if creating the input files only
5657
57- namelist / test_data_override_ongrid_nml / nhalox, nhaloy, test_case, nlon, nlat, layout
58+ namelist / test_data_override_ongrid_nml / nhalox, nhaloy, test_case, nlon, nlat, layout, write_only
5859
59- call mpp_init
60+ call fms_init
6061call fms2_io_init
6162
6263read (input_nml_file, test_data_override_ongrid_nml, iostat= io_status)
@@ -75,35 +76,38 @@ program test_data_override_ongrid
7576call mpp_define_io_domain(Domain, (/ 1 ,1 / ))
7677call mpp_get_data_domain(Domain, is, ie, js, je)
7778
78- select case (test_case)
79- case (ongrid)
80- call generate_ongrid_input_file ()
81- case (bilinear)
82- call generate_bilinear_input_file ()
83- case (scalar)
84- call generate_scalar_input_file ()
85- case (weight_file)
86- call generate_weight_input_file ()
87- end select
88-
89- call mpp_sync()
90- call mpp_error(NOTE, " Finished creating INPUT Files" )
91-
92- ! < Initiliaze data_override
93- call data_override_init(Ocean_domain_in= Domain, mode= lkind)
94-
95- select case (test_case)
96- case (ongrid)
97- call ongrid_test()
98- case (bilinear)
99- call bilinear_test()
100- case (scalar)
101- call scalar_test()
102- case (weight_file)
103- call weight_file_test()
104- end select
105-
106- call mpp_exit
79+ if (write_only) then
80+ select case (test_case)
81+ case (ongrid)
82+ call generate_ongrid_input_file ()
83+ case (bilinear)
84+ call generate_bilinear_input_file ()
85+ case (scalar)
86+ call generate_scalar_input_file ()
87+ case (weight_file)
88+ call generate_weight_input_file ()
89+ end select
90+
91+ call mpp_sync()
92+ call mpp_error(NOTE, " Finished creating INPUT Files" )
93+
94+ else
95+ ! < Initiliaze data_override
96+ call data_override_init(Ocean_domain_in= Domain, mode= lkind)
97+
98+ select case (test_case)
99+ case (ongrid)
100+ call ongrid_test()
101+ case (bilinear)
102+ call bilinear_test()
103+ case (scalar)
104+ call scalar_test()
105+ case (weight_file)
106+ call weight_file_test()
107+ end select
108+ endif
109+
110+ call fms_end
107111
108112contains
109113
0 commit comments