<p><b>dwj07@fsu.edu</b> 2013-04-04 12:01:21 -0600 (Thu, 04 Apr 2013)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Moving provenance attributes from mpas_constants to domain type.<br>
        They are still "parameters" right now, but that could be modified later to allow different domains to have different attributes.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/history_attribute/src/framework/mpas_constants.F
===================================================================
--- branches/history_attribute/src/framework/mpas_constants.F        2013-04-04 17:59:45 UTC (rev 2728)
+++ branches/history_attribute/src/framework/mpas_constants.F        2013-04-04 18:01:21 UTC (rev 2729)
@@ -27,8 +27,6 @@
real (kind=RKIND), parameter :: cv = cp - rgas !< Constant: Specific heat of dry air at constant volume [J kg-1 K-1]
real (kind=RKIND), parameter :: cvpm = -cv/cp !
real (kind=RKIND), parameter :: prandtl = 1.0 !< Constant: Prandtl number
- character (len=StrKIND*2) :: history !< History attribute, read in from input file.
-#include "model_variables.inc"
contains
Modified: branches/history_attribute/src/framework/mpas_grid_types.F
===================================================================
--- branches/history_attribute/src/framework/mpas_grid_types.F        2013-04-04 17:59:45 UTC (rev 2728)
+++ branches/history_attribute/src/framework/mpas_grid_types.F        2013-04-04 18:01:21 UTC (rev 2729)
@@ -428,6 +428,8 @@
! Also store parallelization info here
type (dm_info), pointer :: dminfo
+#include "model_variables.inc"
+ character (len=StrKIND*2) :: history !< History attribute, read in from input file.
end type domain_type
interface mpas_allocate_scratch_field
Modified: branches/history_attribute/src/framework/mpas_io_input.F
===================================================================
--- branches/history_attribute/src/framework/mpas_io_input.F        2013-04-04 17:59:45 UTC (rev 2728)
+++ branches/history_attribute/src/framework/mpas_io_input.F        2013-04-04 18:01:21 UTC (rev 2729)
@@ -247,18 +247,18 @@
end if
end if
- call MPAS_readStreamAtt(input_obj % io_stream, 'history', history, ierr)
+ call MPAS_readStreamAtt(input_obj % io_stream, 'history', domain % history, ierr)
if (ierr /= MPAS_STREAM_NOERR) then
write(0,*) 'Warning: Attribute History not found in '//trim(input_obj % filename)
write(0,*) ' Setting History to '''''
- history = ""
+ domain % history = ""
else
! Remove C String NULL characters, replace C String newlines with semicolons
- do i = 1, len(history)
- if(iachar(history(i:i)) == 0) then
- history(i:i) = " "
- else if(iachar(history(i:i)) == 10) then
- history(i:i) = ";"
+ do i = 1, len(domain % history)
+ if(iachar(domain % history(i:i)) == 0) then
+ domain % history(i:i) = " "
+ else if(iachar(domain % history(i:i)) == 10) then
+ domain % history(i:i) = ";"
end if
end do
end if
Modified: branches/history_attribute/src/framework/mpas_io_output.F
===================================================================
--- branches/history_attribute/src/framework/mpas_io_output.F        2013-04-04 17:59:45 UTC (rev 2728)
+++ branches/history_attribute/src/framework/mpas_io_output.F        2013-04-04 18:01:21 UTC (rev 2729)
@@ -347,10 +347,10 @@
integer, dimension(10) :: dimlist
character (len=StrKIND*4) :: runCmd
- if(len(trim(history)) > 0) then
- write(runCmd,'(a,a,i0,a,a,a)') trim(history),';mpirun -n ',domain % dminfo % nProcs, ' ', trim(coreName), '_model.exe;'
+ if(len(trim(domain % history)) > 0) then
+ write(runCmd,'(a,a,i0,a,a,a)') trim(domain % history),';mpirun -n ',domain % dminfo % nProcs, ' ', trim(domain % coreName), '_model.exe;'
else
- write(runCmd,'(a,i0,a,a,a)') 'mpirun -n ',domain % dminfo % nProcs, ' ', trim(coreName), '_model.exe;'
+ write(runCmd,'(a,i0,a,a,a)') 'mpirun -n ',domain % dminfo % nProcs, ' ', trim(domain % coreName), '_model.exe;'
end if
call MPAS_createStream(output_obj % io_stream, trim(output_obj % filename), MPAS_IO_PNETCDF, MPAS_IO_WRITE, 1, nferr)
@@ -363,9 +363,9 @@
call MPAS_writeStreamAtt(output_obj % io_stream, 'on_a_sphere', 'NO ', nferr)
end if
call MPAS_writeStreamAtt(output_obj % io_stream, 'sphere_radius', mesh % sphere_radius, nferr)
- call MPAS_writeStreamAtt(output_obj % io_stream, 'model_name', modelName, nferr)
- call MPAS_writeStreamAtt(output_obj % io_stream, 'core_name', coreName, nferr)
- call MPAS_writeStreamAtt(output_obj % io_stream, 'version', version, nferr)
+ call MPAS_writeStreamAtt(output_obj % io_stream, 'model_name', domain % modelName, nferr)
+ call MPAS_writeStreamAtt(output_obj % io_stream, 'core_name', domain % coreName, nferr)
+ call MPAS_writeStreamAtt(output_obj % io_stream, 'version', domain % modelVersion, nferr)
call MPAS_writeStreamAtt(output_obj % io_stream, 'history', runCmd, nferr)
#include "add_output_atts.inc"
Modified: branches/history_attribute/src/registry/gen_inc.c
===================================================================
--- branches/history_attribute/src/registry/gen_inc.c        2013-04-04 17:59:45 UTC (rev 2728)
+++ branches/history_attribute/src/registry/gen_inc.c        2013-04-04 18:01:21 UTC (rev 2729)
@@ -174,9 +174,9 @@
        FILE *fd;
        fd = fopen("model_variables.inc","w");
-        fortprintf(fd, " character (len=StrKIND) :: modelName = '%s' !< Constant: Name of model</font>
<font color="red">", modelname);
-        fortprintf(fd, " character (len=StrKIND) :: coreName = '%s' !< Constant: Name of core</font>
<font color="red">", corename);
-        fortprintf(fd, " character (len=StrKIND) :: version = '%s' !< Constant: Version number</font>
<font color="blue">", version);
+        fortprintf(fd, " character (len=StrKIND) :: modelName = '%s' !< Constant: Name of model</font>
<font color="blue">", modelname);
+        fortprintf(fd, " character (len=StrKIND) :: coreName = '%s' !< Constant: Name of core</font>
<font color="blue">", corename);
+        fortprintf(fd, " character (len=StrKIND) :: modelVersion = '%s' !< Constant: Version number</font>
<font color="black">", version);
        fclose(fd);
}
</font>
</pre>