[Dart-dev] DART/branches Revision: 11933

dart at ucar.edu dart at ucar.edu
Tue Sep 12 16:46:35 MDT 2017


thoar at ucar.edu
2017-09-12 16:46:34 -0600 (Tue, 12 Sep 2017)
365
Can now read the HDF5 file and write a netCDF file we can use with Manhattan.
It has the auxiliary variables ... and I think they have reasonable values in them.

I removed the 'time' and 'copy' refernces from the netCDF file routines that used
to write the DART diagnostic files and used them to write out the netCDF file with
the state needed for rma,Manhattan.




Modified: DART/branches/coamps/models/coamps_nest/coamps_netcdf_mod.f90
===================================================================
--- DART/branches/coamps/models/coamps_nest/coamps_netcdf_mod.f90	2017-09-12 18:57:24 UTC (rev 11932)
+++ DART/branches/coamps/models/coamps_nest/coamps_netcdf_mod.f90	2017-09-12 22:46:34 UTC (rev 11933)
@@ -152,13 +152,9 @@
     !  PARAMETERS
     !   IN  ncFileID      NetCDF file to write to
     !   IN  state           model state vector
-    !   IN  copy_index      Which copy (i.e. member) this is 
-    !   IN  time_index      Which time this is
-    subroutine nc_write_statearray_data(ncFileID, state, copy_index, time_index)
+    subroutine nc_write_statearray_data(ncFileID, state)
         integer, intent(in)                     :: ncFileID
         real(kind=r8), dimension(:), intent(in) :: state
-        integer, intent(in)                     :: copy_index
-        integer, intent(in)                     :: time_index
 
         integer :: state_var_id
 
@@ -183,7 +179,7 @@
         ! ------------------------------------------------------------------
         call nc_check(nf90_inq_varid(ncFileID, 'state', state_var_id), routine) 
         call nc_check(nf90_put_var(ncFileID, state_var_id, state,       &
-                      start=(/ 1, copy_index, time_index /)), routine)
+                      start=(/ 1 /)), routine)
      
         ! ------------------------------------------------------------------
         ! Flush the buffer to disk                                       
@@ -193,94 +189,88 @@
 
     end subroutine nc_write_statearray_data
 
-    ! nc_write_prognostic_data
-    ! ----------------------------
-    ! Writes the models prognostic variables to the supplied NetCDF file
-    !  PARAMETERS
-    !   IN  ncFileID      NetCDF file to write to
-    !   IN  state           model state vector
-    !   IN  copy_index      Which copy (i.e. member) this is 
-    !   IN  time_index      Which time this is
-    subroutine nc_write_prognostic_data(ncFileID, state_list, statevec, copy_index, time_index)
-       integer,                     intent(in)      :: ncFileID
-       type(state_vector),          intent(in)      :: state_list
-       real(kind=r8), dimension(:), intent(in)      :: statevec
-       integer,                     intent(in)      :: copy_index
-       integer,                     intent(in)      :: time_index
+! ----------------------------
+!> Writes the prognostic variables to the supplied NetCDF file
 
-       type(state_iterator)                         :: iterator
-       type(state_variable)                         :: cur_var
-       type(coamps_nest)                            :: nest
-       type(coamps_domain)                          :: domain
-       integer, dimension(3)                        :: var_dims
-       character(len=NF90_MAX_NAME)                 :: var_name
-       integer                                      :: alloc_status
-       integer                                      :: varid 
-       integer                                      :: nx, ny
+subroutine nc_write_prognostic_data(ncFileID, state_list, statevec)
+integer,                     intent(in) :: ncFileID
+type(state_vector),          intent(in) :: state_list
+real(kind=r8), dimension(:), intent(in) :: statevec
 
-       real(kind=r8), allocatable, dimension(:,:,:) :: var3d
-       real(kind=r8), allocatable, dimension(:,:)   :: var2d
-       real(kind=r8), pointer,     dimension(:)     :: var_substate
+type(state_iterator)                         :: iterator
+type(state_variable)                         :: cur_var
+type(coamps_nest)                            :: nest
+type(coamps_domain)                          :: domain
+integer, dimension(3)                        :: var_dims
+character(len=NF90_MAX_NAME)                 :: var_name
+integer                                      :: alloc_status
+integer                                      :: varid 
+integer                                      :: nx, ny
 
-       character(len=*), parameter :: routine = 'nc_write_prognostic_data'
+real(kind=r8), allocatable, dimension(:,:,:) :: var3d
+real(kind=r8), allocatable, dimension(:,:)   :: var2d
+real(kind=r8), pointer,     dimension(:)     :: var_substate
 
-       domain   = get_domain(state_list)
-       iterator = get_iterator(state_list)
-       output_vars:  do while(has_next(iterator))
+character(len=*), parameter :: routine = 'nc_write_prognostic_data'
 
-          cur_var  = get_next(iterator)
-          var_name = get_var_name(cur_var)
-          var_dims = get_var_dims(cur_var, domain)
-          varid    = get_nc_varid(cur_var)
+domain   = get_domain(state_list)
+iterator = get_iterator(state_list)
 
-          nest = get_domain_nest(domain, get_nest_number(cur_var))
-          nx   = get_nest_i_width(nest)
-          ny   = get_nest_j_width(nest)
+output_vars:  do while(has_next(iterator))
 
-          var_substate => get_var_substate(cur_var, statevec)
+   cur_var  = get_next(iterator)
+   var_name = get_var_name(cur_var)


More information about the Dart-dev mailing list