[Dart-dev] DART/branches Revision: 11049
dart at ucar.edu
dart at ucar.edu
Wed Feb 8 15:06:11 MST 2017
hendric at ucar.edu
2017-02-08 15:06:11 -0700 (Wed, 08 Feb 2017)
132
Aadding global attribute with the model name. Using nc_write_model_atts
to define location only and not the model state variable.
Modified: DART/branches/rma_single_file/io/direct_netcdf_mod.f90
===================================================================
--- DART/branches/rma_single_file/io/direct_netcdf_mod.f90 2017-02-08 22:04:59 UTC (rev 11048)
+++ DART/branches/rma_single_file/io/direct_netcdf_mod.f90 2017-02-08 22:06:11 UTC (rev 11049)
@@ -793,7 +793,6 @@
integer :: istart, iend
integer, allocatable :: dims(:)
integer :: i, ret, var_id, var_size
-logical :: clamped
istart = 1
do i = start_var, end_var
Modified: DART/branches/rma_single_file/io/state_space_diag_mod.f90
===================================================================
--- DART/branches/rma_single_file/io/state_space_diag_mod.f90 2017-02-08 22:04:59 UTC (rev 11048)
+++ DART/branches/rma_single_file/io/state_space_diag_mod.f90 2017-02-08 22:06:11 UTC (rev 11049)
@@ -61,6 +61,7 @@
all_copies_to_all_vars, all_vars_to_all_copies, &
get_allow_transpose
use assim_model_mod, only : assim_model_type, get_model_size
+use model_mod, only : nc_write_model_vars, nc_write_model_atts
use mpi_utilities_mod, only : my_task_id, broadcast_flag
use utilities_mod, only : error_handler, E_MSG, E_ERR, E_DBG, E_WARN, &
file_to_text, find_textfile_dims, nc_check, &
@@ -211,12 +212,6 @@
'init_singlefile_output', 'def_dim time '//trim(fname))
!----------------------------------------------------------------------------
- ! Define the model-specific components
- !----------------------------------------------------------------------------
-
- call write_model_attributes(ncFileID, MemberDimID, TimeDimID)
-
- !----------------------------------------------------------------------------
! Find dimensions of namelist file ... will save it as a variable.
!----------------------------------------------------------------------------
@@ -253,20 +248,6 @@
call nc_check(nf90_put_att(ncFileID%ncid, NF90_GLOBAL, "assim_model_revdate", revdate ), &
'init_singlefile_output', 'put_att assim_model_revdate '//trim(fname))
- !----------------------------------------------------------------------------
- ! Create variables and attributes.
- ! The locations are part of the model (some models have multiple grids).
- ! They are written by model_mod:nc_write_model_atts
- !----------------------------------------------------------------------------
-
- ens_size = ens_handle%num_copies - ens_handle%num_extras
- do icopy = ens_size+1, ens_handle%num_copies
- copyname = trim(get_copy_name(file_handle,icopy))
- if ( file_handle%stage_metadata%io_flag(icopy) == WRITE_COPY ) then
- call write_extra_attributes(ncFileID, TimeDimID, copyname)
- endif
- enddo
-
! Metadata for each Copy
call nc_check(nf90_def_var(ncid=ncFileID%ncid, name="MemberMetadata", xtype=nf90_char, &
dimids=(/ MetaDataDimID, MemberDimID /), varid=metadataVarID), &
@@ -301,7 +282,35 @@
!----------------------------------------------------------------------------
call nc_check(nf90_enddef(ncFileID%ncid), 'init_singlefile_output', 'enddef '//trim(fname))
+
+ call nc_check(nf90_sync(ncFileID%ncid), 'init_inglefile_output', 'sync '//trim(fname))
+ !----------------------------------------------------------------------------
+ ! Define the model-specific components
+ !----------------------------------------------------------------------------
+ ret = nc_write_model_atts( ncFileID%ncid, local_model_mod_will_write_state_variables)
+ if ( ret /= 0 ) then
+ write(msgstring, *)'nc_write_model_atts bombed with error ', ret
+ call error_handler(E_MSG,'init_diag_output',msgstring,source,revision,revdate)
+ endif
+
+ call write_model_attributes(ncFileID, MemberDimID, TimeDimID)
+
+ !----------------------------------------------------------------------------
+ ! Create variables and attributes.
+ ! The locations are part of the model (some models have multiple grids).
+ ! They are written by model_mod:nc_write_model_atts
+ !----------------------------------------------------------------------------
+
+ ens_size = ens_handle%num_copies - ens_handle%num_extras
+ do icopy = ens_size+1, ens_handle%num_copies
+ copyname = trim(get_copy_name(file_handle,icopy))
+ if ( file_handle%stage_metadata%io_flag(icopy) == WRITE_COPY ) then
+ call write_extra_attributes(ncFileID, TimeDimID, copyname)
+ endif
+ enddo
+
+
!----------------------------------------------------------------------------
! Fill the coordinate variables.
! Write the input namelist as a netCDF variable.
@@ -720,23 +729,22 @@
ncFileID%diag_id = create_diagnostic_structure()
my_ncid = ncFileID%ncid
- timeindex = nc_get_tindex(ncFileID, curr_ens_time)
-!#! print*, 'timeindex = ', timeindex, my_ncid
More information about the Dart-dev
mailing list