<p><b>duda</b> 2009-12-23 13:13:48 -0700 (Wed, 23 Dec 2009)</p><p>BRANCH COMMIT: branches/hyd_model<br>
<br>
Allow the names of input, output, and restart files to be specified<br>
at run-time through namelist parameters:<br>
<br>
&amp;io<br>
   config_input_name = 'grid.nc'<br>
   config_output_name = 'output.nc'<br>
   config_restart_name = 'restart.nc'<br>
/<br>
<br>
<br>
M    src/module_io_input.F<br>
M    src/module_io_output.F<br>
M    src/Makefile<br>
M    Registry/Registry<br>
M    namelist.input<br>
</p><hr noshade><pre><font color="gray">Modified: branches/hyd_model/Registry/Registry
===================================================================
--- branches/hyd_model/Registry/Registry        2009-12-23 18:34:55 UTC (rev 97)
+++ branches/hyd_model/Registry/Registry        2009-12-23 20:13:48 UTC (rev 98)
@@ -13,6 +13,9 @@
 namelist integer   sw_model config_number_of_sub_steps  4
 namelist integer   sw_model config_theta_adv_order      2
 namelist integer   sw_model config_scalar_adv_order     2
+namelist character io       config_input_name           grid.nc
+namelist character io       config_output_name          output.nc
+namelist character io       config_restart_name         restart.nc
 namelist integer   restart  config_restart_interval     0
 namelist logical   restart  config_do_restart           false
 namelist real      restart  config_restart_time         172800.0

Modified: branches/hyd_model/namelist.input
===================================================================
--- branches/hyd_model/namelist.input        2009-12-23 18:34:55 UTC (rev 97)
+++ branches/hyd_model/namelist.input        2009-12-23 20:13:48 UTC (rev 98)
@@ -13,6 +13,12 @@
    config_scalar_adv_order = 2
 /
 
+&amp;io
+   config_input_name = 'grid.nc'
+   config_output_name = 'output.nc'
+   config_restart_name = 'restart.nc'
+/
+
 &amp;restart
    config_restart_interval = 3000
    config_do_restart = .false.

Modified: branches/hyd_model/src/Makefile
===================================================================
--- branches/hyd_model/src/Makefile        2009-12-23 18:34:55 UTC (rev 97)
+++ branches/hyd_model/src/Makefile        2009-12-23 20:13:48 UTC (rev 98)
@@ -31,7 +31,7 @@
 
 module_io_input.o: module_grid_types.o module_dmpar.o module_block_decomp.o module_sort.o module_configure.o
 
-module_io_output.o: module_grid_types.o module_dmpar.o module_sort.o
+module_io_output.o: module_grid_types.o module_dmpar.o module_sort.o module_configure.o
 
 module_sw_solver.o: module_configure.o module_grid_types.o module_io_output.o \
                     module_time_integration.o module_dmpar.o module_timer.o module_advection.o

Modified: branches/hyd_model/src/module_io_input.F
===================================================================
--- branches/hyd_model/src/module_io_input.F        2009-12-23 18:34:55 UTC (rev 97)
+++ branches/hyd_model/src/module_io_input.F        2009-12-23 20:13:48 UTC (rev 98)
@@ -91,9 +91,9 @@
       integer :: idxTdiff
 
       if (config_do_restart) then
-         input_obj % filename = 'restart.nc'
+         input_obj % filename = trim(config_restart_name)
       else
-         input_obj % filename = 'grid.nc'
+         input_obj % filename = trim(config_input_name)
       end if
       call io_input_init(input_obj, domain % dminfo)
    
@@ -501,7 +501,7 @@
 
          !
          ! If doing a restart, we need to decide which time slice to read from the 
-         !   restart.nc file
+         !   restart file
          !
          if (input_obj % rdLocalTime &lt;= 0) then
             write(0,*) 'Error: Couldn''t find any times in restart file.'

Modified: branches/hyd_model/src/module_io_output.F
===================================================================
--- branches/hyd_model/src/module_io_output.F        2009-12-23 18:34:55 UTC (rev 97)
+++ branches/hyd_model/src/module_io_output.F        2009-12-23 20:13:48 UTC (rev 98)
@@ -3,6 +3,7 @@
    use grid_types
    use dmpar
    use sort
+   use configure
 
    integer, parameter :: OUTPUT = 1
    integer, parameter :: RESTART = 2
@@ -74,10 +75,10 @@
       nVertLevelsGlobal = block_ptr % mesh % nVertLevels
 
       if (trim(stream) == 'OUTPUT') then
-         output_obj % filename = 'output.nc'
+         output_obj % filename = trim(config_output_name)
          output_obj % stream = OUTPUT
       else if (trim(stream) == 'RESTART') then
-         output_obj % filename = 'restart.nc'
+         output_obj % filename = trim(config_restart_name)
          output_obj % stream = RESTART
       end if
 

</font>
</pre>