[Dart-dev] [4627] DART/trunk/utilities/utilities_mod.f90: removed a trim(adjustl()) nesting.
nancy at ucar.edu
nancy at ucar.edu
Wed Jan 5 09:18:06 MST 2011
Revision: 4627
Author: thoar
Date: 2011-01-05 09:18:06 -0700 (Wed, 05 Jan 2011)
Log Message:
-----------
removed a trim(adjustl()) nesting.
Modified Paths:
--------------
DART/trunk/utilities/utilities_mod.f90
-------------- next part --------------
Modified: DART/trunk/utilities/utilities_mod.f90
===================================================================
--- DART/trunk/utilities/utilities_mod.f90 2011-01-05 16:14:23 UTC (rev 4626)
+++ DART/trunk/utilities/utilities_mod.f90 2011-01-05 16:18:06 UTC (rev 4627)
@@ -1768,6 +1768,8 @@
character(len=*), intent(in), optional :: fform
logical :: ascii_file_format
+character(len=129) :: lj_fform ! Left Justified version of optional argument
+
! Returns .true. for formatted/ascii file, .false. is unformatted/binary
! Defaults (if fform not specified) to formatted/ascii.
@@ -1779,7 +1781,17 @@
return
endif
-SELECT CASE (trim(adjustl(fform)))
+! Check to make sure we don't put 10lbs of stuff in a 5lb bag
+
+if (len(fform) > len(lj_fform)) then
+ write(msgstring,*)'fform is long: increase len of lj_fform to ',&
+ len(fform),' and recompile.'
+ call error_handler(E_ERR,'ascii_file_format', msgstring, source, revision, revdate)
+endif
+
+lj_fform = adjustl(fform)
+
+SELECT CASE (trim(lj_fform))
CASE("unf", "UNF", "unformatted", "UNFORMATTED")
ascii_file_format = .false.
CASE DEFAULT
More information about the Dart-dev
mailing list