<p><b>duda</b> 2011-07-20 17:31:21 -0600 (Wed, 20 Jul 2011)</p><p>BRANCH COMMIT<br>
<br>
Enable the outputting of fields on the 's' stream. Writing 's' stream fields<br>
is accomplished in essentially the same way as writing 'o' stream variables;<br>
for example:<br>
<br>
type (io_output_object) :: sfc_update_obj<br>
<br>
sfc_update_obj % time = 1<br>
sfc_update_obj % filename = 'mgd_sst.nc'<br>
<br>
call output_state_init(sfc_update_obj, domain, "SFC")<br>
<br>
call output_state_for_domain(sfc_update_obj, domain, sfc_update_obj % time)<br>
<br>
call output_state_finalize(sfc_update_obj, dminfo)<br>
<br>
<br>
M src/registry/gen_inc.c<br>
M src/framework/module_io_output.F<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/framework/module_io_output.F
===================================================================
--- branches/atmos_physics/src/framework/module_io_output.F        2011-07-20 21:54:34 UTC (rev 925)
+++ branches/atmos_physics/src/framework/module_io_output.F        2011-07-20 23:31:21 UTC (rev 926)
@@ -7,6 +7,7 @@
integer, parameter :: OUTPUT = 1
integer, parameter :: RESTART = 2
+ integer, parameter :: SFC = 3
type io_output_object
integer :: wr_ncid
@@ -82,6 +83,9 @@
else if (trim(stream) == 'RESTART') then
output_obj % filename = trim(config_restart_name)
output_obj % stream = RESTART
+ else if (trim(stream) == 'SFC') then
+ ! Keep filename as whatever was set by the user
+ output_obj % stream = SFC
end if
! For now, we assume that a domain consists only of one block,
Modified: branches/atmos_physics/src/registry/gen_inc.c
===================================================================
--- branches/atmos_physics/src/registry/gen_inc.c        2011-07-20 21:54:34 UTC (rev 925)
+++ branches/atmos_physics/src/registry/gen_inc.c        2011-07-20 23:31:21 UTC (rev 926)
@@ -1716,6 +1716,7 @@
fortprintf(fd, " if (.false. &</font>
<font color="black">");
if (var_ptr->iostreams & RESTART0) fortprintf(fd, " .or. output_obj %% stream == RESTART &</font>
<font color="black">");
if (var_ptr->iostreams & OUTPUT0) fortprintf(fd, " .or. output_obj %% stream == OUTPUT &</font>
<font color="blue">");
+ if (var_ptr->iostreams & SFC0) fortprintf(fd, " .or. output_obj %% stream == SFC &</font>
<font color="black">");
fortprintf(fd, " ) then</font>
<font color="gray">");
dimlist_ptr = var_ptr->dimlist;
i = 1;
@@ -1783,11 +1784,13 @@
if (strncmp(var_ptr->super_array, "-", 1024) != 0) {
fortprintf(fd, " if ((%s %% %s %% ioinfo %% output .and. output_obj %% stream == OUTPUT) .or. &</font>
<font color="red">", struct_deref, var_ptr->super_array);
- fortprintf(fd, " (%s %% %s %% ioinfo %% restart .and. output_obj %% stream == RESTART)) then</font>
<font color="blue">", struct_deref, var_ptr->super_array);
+ fortprintf(fd, " (%s %% %s %% ioinfo %% restart .and. output_obj %% stream == RESTART) .or. &</font>
<font color="blue">", struct_deref, var_ptr->super_array);
+ fortprintf(fd, " (%s %% %s %% ioinfo %% sfc .and. output_obj %% stream == SFC)) then</font>
<font color="black">", struct_deref, var_ptr->super_array);
}
else {
fortprintf(fd, " if ((%s %% %s %% ioinfo %% output .and. output_obj %% stream == OUTPUT) .or. &</font>
<font color="red">", struct_deref, var_ptr->name_in_code);
- fortprintf(fd, " (%s %% %s %% ioinfo %% restart .and. output_obj %% stream == RESTART)) then</font>
<font color="blue">", struct_deref, var_ptr->name_in_code);
+ fortprintf(fd, " (%s %% %s %% ioinfo %% restart .and. output_obj %% stream == RESTART) .or. &</font>
<font color="blue">", struct_deref, var_ptr->name_in_code);
+ fortprintf(fd, " (%s %% %s %% ioinfo %% sfc .and. output_obj %% stream == SFC)) then</font>
<font color="black">", struct_deref, var_ptr->name_in_code);
}
if (var_ptr->ndims > 0) {
</font>
</pre>