From d3a85cd4a63975f2a4d9624f30fb9e7115b7b0b5 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Tue, 6 Feb 2024 15:52:49 -0700 Subject: [PATCH] Simplify formatting for printing arrays --- example/bmi_geospatial_ex.f90 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/example/bmi_geospatial_ex.f90 b/example/bmi_geospatial_ex.f90 index fd01117..a5993b0 100644 --- a/example/bmi_geospatial_ex.f90 +++ b/example/bmi_geospatial_ex.f90 @@ -28,10 +28,7 @@ program bmi_geospatial_ex allocate(grid_shape(grid_rank)) status = h%get_grid_shape(grid_id, grid_shape) - write (*,"(a)") "Grid shape:" - do i = 1, size(grid_shape) - write (*,"(a, i3)") "-", grid_shape(i) - end do + write (*,"(a, *(x, i3))") "Grid shape:", grid_shape g = bmi_heat_geo(h) @@ -51,13 +48,11 @@ program bmi_geospatial_ex allocate(ycoordinate(grid_shape(1))) status = g%get_grid_coordinate(grid_id, names(1), ycoordinate) - write (*,"(a)") "Y-coordinate:" - write (*,"(*(x, f4.1))") ycoordinate + write (*,"(a, *(x, f4.1))") "Y-coordinate:", ycoordinate allocate(xcoordinate(grid_shape(2))) status = g%get_grid_coordinate(grid_id, names(2), xcoordinate) - write (*,"(a)") "X-coordinate:" - write (*,"(*(x, f4.1))") xcoordinate + write (*,"(a, *(x, f4.1))") "X-coordinate:", xcoordinate status = g%get_grid_crs(grid_id, crs) write (*,"(a, a30)") "CRS: ", crs