[Dart-dev] DART/branches Revision: 11960

dart at ucar.edu dart at ucar.edu
Fri Sep 29 10:58:58 MDT 2017


thoar at ucar.edu
2017-09-29 10:58:57 -0600 (Fri, 29 Sep 2017)
632
Removed references to 'coamps_state' from coamps_translate_mod.f90 - no need
to store a duplicate copy that may have differed only in endianness - the hdf/netcdf
interfaces take care of that.

Still struggling trying to update a variable in an HDF file.
Latest attempt uses (COAMPS private code) coamps_hdf5_mod.F90, I'm clearly not
calling stuff in the right order - will work with Sasa later today.
Dying at line 723 of coamps_hdf5_mod.F90

    call h5dwrite_f(dset_id, H5T_IEEE_F32LE, data_out, dims, error)

Had to add to the mkmf_dart_to_coamps to use the preprocessor to compile the ifdef HDF portions of coamps_hdf5_mod.F90




Modified: DART/branches/coamps/models/coamps_nest/coamps_netcdf_mod.f90
===================================================================
--- DART/branches/coamps/models/coamps_nest/coamps_netcdf_mod.f90	2017-09-27 22:26:37 UTC (rev 11959)
+++ DART/branches/coamps/models/coamps_nest/coamps_netcdf_mod.f90	2017-09-29 16:58:57 UTC (rev 11960)
@@ -24,6 +24,7 @@
 
     use types_mod,         only : r8
 
+    !>@todo should use nc_check from the DART netcdf_utilities_mod (not utilities_mod)
     use utilities_mod,     only : nc_check,                     &
                                   do_output,                    &
                                   error_handler,                &
@@ -598,8 +599,9 @@
         
         character(len=*), parameter :: routine = 'new_dimension'
 
+        write(msgstring,*) trim(routine)//' adding dimension "'//trim(dim_name)//'"'
         call nc_check(nf90_def_dim(ncid=ncFileID, name=dim_name,   &
-                                   len=length, dimid=new_dimension), routine)  
+                                   len=length, dimid=new_dimension), msgstring)  
     end function new_dimension
 
     ! new_variable

Modified: DART/branches/coamps/models/coamps_nest/coamps_translate_mod.f90
===================================================================
--- DART/branches/coamps/models/coamps_nest/coamps_translate_mod.f90	2017-09-27 22:26:37 UTC (rev 11959)
+++ DART/branches/coamps/models/coamps_nest/coamps_translate_mod.f90	2017-09-29 16:58:57 UTC (rev 11960)
@@ -122,8 +122,15 @@
   public :: dart_write
 
   ! Conversion tools
-  public :: convert_dart_state_to_coamps
-  public :: convert_coamps_state_to_dart
+  ! before the use of hdf files, it was necessary to have a coamps_state
+  ! and a dart_state that could differ in endianness and real type. With
+  ! the use of hdf and netCDF, both of those issues are moot. Consequently,
+  ! convert_dart_state_to_coamps and convert_coamps_state_to_dart are gone.
+  ! They were both wrappers around an internal routine 'convert_state' that
+  ! is also no longer needed.
+  !  public :: convert_dart_state_to_coamps  NOT NEEDED, REMOVED
+  !  public :: convert_coamps_state_to_dart  NOT NEEDED, REMOVED
+
   public :: fix_negative_values
 
   ! Time handling tools
@@ -131,6 +138,7 @@
   public :: get_dart_current_time
   public :: get_dart_target_time
   public :: write_pickup_file
+  public :: get_current_dtg
 
   public :: print_dart_diagnostics
 
@@ -237,11 +245,6 @@
   type(time_type), dimension(2)                      :: dart_time
   real(kind=r8),   dimension(:), allocatable, target :: dart_state
 
-  ! Contents of COAMPS state vector - this is not the full restart
-  ! file - only the fields that we have defined in the dynamic
-  ! state vector definition 
-  real(kind=C_REAL), dimension(:), allocatable, target :: coamps_state
-
   ! Arrays allow reading/writing multiple COAMPS files 
   integer                                      :: total_coamps_files
   character(len=NAME_LEN), dimension(:), allocatable :: coamps_file_names
@@ -345,9 +348,6 @@
     deallocate(dart_state,   stat=dealloc_status)
     call check_dealloc_status(dealloc_status, routine, source, &
                               revision, revdate, 'dart_state'  )
-    deallocate(coamps_state, stat=dealloc_status)
-    call check_dealloc_status(dealloc_status, routine, source, &
-                              revision, revdate, 'coamps_state')
 
     do cur_file = 1, total_coamps_files
        close(coamps_file_units(cur_file))
@@ -515,8 +515,6 @@
 
       write (*,'(I2.2,2x,A)') coamps_file_index,                      &
                   trim(dsnrff1)//coamps_file_names(coamps_file_index)
-
-
     end do flat_file_loop
 
     print *,"-------------------------------------------------"
@@ -799,26 +797,6 @@
 end subroutine open_dart_file
 
 
-  ! convert_dart_state_to_coamps
-  ! ----------------------------
-  ! Wrapper for DART -> COAMPS convert_state
-  !  PARAMETERS
-  !   [none]
-  subroutine convert_dart_state_to_coamps()
-    logical, parameter :: CONVERT_TO_COAMPS = .false.
-    call convert_state(CONVERT_TO_COAMPS)
-  end subroutine convert_dart_state_to_coamps
-
-  ! convert_coamps_state_to_dart
-  ! ----------------------------


More information about the Dart-dev mailing list