[Dart-dev] [4310] DART/trunk/obs_def/DEFAULT_obs_def_mod.F90: Add a local 'fileformat' variable that is set by the utility subroutine

nancy at ucar.edu nancy at ucar.edu
Wed Mar 10 13:37:50 MST 2010


Revision: 4310
Author:   nancy
Date:     2010-03-10 13:37:50 -0700 (Wed, 10 Mar 2010)
Log Message:
-----------
Add a local 'fileformat' variable that is set by the utility subroutine
ascii_file_format, to make the changes to the obs_def mod completely
backwards compatible.  This local variable should be removed after the
next release and people should use 'fform' instead of 'fileformat' as the
last argument to any private read/write obs def routines.

Modified Paths:
--------------
    DART/trunk/obs_def/DEFAULT_obs_def_mod.F90

-------------- next part --------------
Modified: DART/trunk/obs_def/DEFAULT_obs_def_mod.F90
===================================================================
--- DART/trunk/obs_def/DEFAULT_obs_def_mod.F90	2010-03-10 20:25:42 UTC (rev 4309)
+++ DART/trunk/obs_def/DEFAULT_obs_def_mod.F90	2010-03-10 20:37:50 UTC (rev 4310)
@@ -417,13 +417,23 @@
 character(len=*), optional, intent(in)    :: fform
 
 character(len=5)  :: header
+integer           :: o_index
 logical           :: is_ascii
-integer           :: o_index
+character(len=32) :: fileformat   ! here for backwards compatibility only
 
 if ( .not. module_initialized ) call initialize_module
 
 is_ascii = ascii_file_format(fform)
 
+! here for backwards compatibility only; after the next release,
+! remove this and force people in their own obs_def_xxx_mod.f90 code
+! to set the last arg to read/write to be fform instead of fileformat
+if (is_ascii) then
+   fileformat = 'formatted'
+else
+   fileformat = 'unformatted'
+endif
+
 ! Begin by reading five character ascii header, then location, kind, error variance, index
 
 ! Need to add additional error checks on read
@@ -497,12 +507,22 @@
 integer,                    intent(in) :: key
 character(len=*), intent(in), optional :: fform
 
-logical :: is_ascii
+logical           :: is_ascii
+character(len=32) :: fileformat   ! here for backwards compatibility only
 
 if ( .not. module_initialized ) call initialize_module
 
 is_ascii = ascii_file_format(fform)
 
+! here for backwards compatibility only; after the next release,
+! remove this and force people in their own obs_def_xxx_mod.f90 code
+! to set the last arg to read/write to be fform instead of fileformat
+if (is_ascii) then
+   fileformat = 'formatted'
+else
+   fileformat = 'unformatted'
+endif
+
 ! Write the 5 character identifier for verbose formatted output
 if (is_ascii) write(ifile, '("obdef")')
 


More information about the Dart-dev mailing list