Changeset 3182 for palm/trunk/UTIL/inifor/src/util.f90
- Timestamp:
- Jul 27, 2018 1:36:03 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/UTIL/inifor/src/util.f90
r2718 r3182 21 21 ! Current revisions: 22 22 ! ----------------- 23 ! Improved real-to-string conversion 23 24 ! 24 25 ! … … 43 44 ONLY : C_CHAR, C_INT, C_PTR, C_SIZE_T 44 45 USE defs, & 45 ONLY : dp, PI, DATE 46 ONLY : dp, PI, DATE, SNAME 46 47 47 48 IMPLICIT NONE … … 279 280 ! Convert a real number to a string in scientific notation 280 281 ! showing four significant digits. 281 CHARACTER(LEN= 11) FUNCTION real_to_str(val, format)282 CHARACTER(LEN=SNAME) FUNCTION real_to_str(val, format) 282 283 283 284 REAL(dp), INTENT(IN) :: val … … 285 286 286 287 IF (PRESENT(format)) THEN 287 WRITE(real_to_str, TRIM(format)) val288 WRITE(real_to_str, format) val 288 289 ELSE 289 290 WRITE(real_to_str, '(E11.4)') val 290 real_to_str = ADJUSTL(real_to_str)291 291 END IF 292 real_to_str = ADJUSTL(real_to_str) 292 293 293 294 END FUNCTION real_to_str
Note: See TracChangeset
for help on using the changeset viewer.