Commit 27a1b760 authored by Keith Bennett's avatar Keith Bennett

Merge branch 'release/1.5.0'

parents 98b86041 635636c5
test_ubuntu_gfortran:
script:
- COMPILER=gfortran sh -x src/test.sh
tags:
- ubuntu
- gfortran
test_ubuntu_intel:
script:
- COMPILER=intel sh -x src/test.sh
tags:
- ubuntu
- intel
test_osx:
script:
- COMPILER=gfortran sh -x src/test.sh
tags:
- osx
......@@ -13,8 +13,7 @@ if(NOT INHERIT_FLAGS)
endif()
set(CMAKE_Fortran_FLAGS
"-Mnodefaultunit -Ktrap=fp -mcmodel=medium -Mdclchk ${CPU} "
"${MPI_Fortran_COMPILE_FLAGS}"
"-Mnodefaultunit -Ktrap=fp -mcmodel=medium -Mdclchk ${CPU} ${MPI_Fortran_COMPILE_FLAGS}"
CACHE STRING "Fortran flags" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -Mvect -Munroll"
CACHE STRING "Fortran flags for release build" FORCE)
......@@ -28,18 +27,19 @@ if(NOT INHERIT_FLAGS)
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -ip -vec-report0"
CACHE STRING "Fortran flags for release build" FORCE)
set(CMAKE_Fortran_FLAGS_DEBUG
"-O0 -g -u -ftrapuv -traceback -nothreads -fltconsistency -C -warn "
"-save-temps -fpic -Wl,-no_pie"
"-O0 -g -u -ftrapuv -traceback -nothreads -fltconsistency -C -warn -save-temps -fpic -Wl,-no_pie"
CACHE STRING "Fortran flags for debug build" FORCE)
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")
set(CMAKE_Fortran_FLAGS "-Wall -frecord-marker=4 -mcmodel=medium"
if(NOT APPLE)
set(MCMODEL "-mcmodel=medium")
endif()
set(CMAKE_Fortran_FLAGS "-Wall -frecord-marker=4 ${MCMODEL}"
CACHE STRING "Fortran flags" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O3"
CACHE STRING "Fortran flags for release build" FORCE)
set(CMAKE_Fortran_FLAGS_DEBUG
"-O0 -g -fimplicit-none -fbounds-check -fbacktrace -Wextra "
"-ffpe-trap=invalid,zero,overflow -pedantic"
"-O0 -g -fimplicit-none -fbounds-check -fbacktrace -Wextra -ffpe-trap=invalid,zero,overflow -pedantic"
CACHE STRING "Fortran flags for debug build" FORCE)
endif()
......
......@@ -223,7 +223,7 @@ sdf_source_info.o: sdf_source_info.f90 $(SOURCE_ALL)
$(LIB): $(OBJS)
$(RM) -f $@
$(AR) -rsu $@ $(addprefix $(OBJDIR)/,$(OBJS))
$(AR) -crs $@ $(addprefix $(OBJDIR)/,$(OBJS))
$(RANLIB) $@
$(OBJS): | $(OBJDIR) $(INCDIR)
......
......@@ -61,13 +61,24 @@ set(PACK_OPTS ${GIT_DIR} sdf ${PACK_SOURCE_CODE} ${PACK_GIT_DIFF}
include(${CONFIGURE_PACK_TARGET})
list(APPEND SOURCES ${INFO_FILE})
set(MCMODEL "-mcmodel=medium")
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")
set(INFO_FLAGS "-Wno-conversion -fno-range-check")
set_source_files_properties(${INFO_FILE} PROPERTIES COMPILE_FLAGS
${INFO_FLAGS})
if(APPLE)
set(MCMODEL " ")
endif()
endif()
if(NOT TARGET sdf)
add_library(sdf ${SOURCES})
set_target_properties(sdf PROPERTIES COMPILE_FLAGS "-mcmodel=medium")
set_target_properties(
sdf
PROPERTIES
COMPILE_FLAGS ${MCMODEL}
Fortran_MODULE_DIRECTORY include)
install(TARGETS sdf DESTINATION lib COMPONENT develop)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include DESTINATION . COMPONENT develop)
endif()
......@@ -136,7 +136,6 @@ MODULE sdf
PUBLIC :: sdf_read_point_mesh_info
PUBLIC :: sdf_read_point_variable
PUBLIC :: sdf_read_point_variable_info
PUBLIC :: sdf_read_lagrangian_mesh
PUBLIC :: sdf_read_srl_plain_mesh
PUBLIC :: sdf_read_srl_point_mesh
PUBLIC :: sdf_read_srl_point_variable
......@@ -147,6 +146,7 @@ MODULE sdf
PUBLIC :: sdf_read_station_info_arrays
PUBLIC :: sdf_read_station_info_arrays_all
PUBLIC :: sdf_read_station_array
PUBLIC :: sdf_read_namevalue
PUBLIC :: sdf_write_header
PUBLIC :: sdf_write_run_info
PUBLIC :: sdf_write_source_code
......@@ -158,7 +158,6 @@ MODULE sdf
PUBLIC :: sdf_write_plain_variable
PUBLIC :: sdf_write_point_mesh
PUBLIC :: sdf_write_point_variable
PUBLIC :: sdf_write_lagrangian_mesh
PUBLIC :: sdf_write_srl_plain_mesh
PUBLIC :: sdf_write_srl_point_mesh
PUBLIC :: sdf_write_srl_point_variable
......
......@@ -43,4 +43,15 @@ MODULE sdf_input
read_run_info_minor
END INTERFACE sdf_read_run_info
INTERFACE sdf_read_namevalue
MODULE PROCEDURE &
read_namevalue, &
read_namevalue_i4, &
read_namevalue_i8, &
read_namevalue_r4, &
read_namevalue_r8, &
read_namevalue_logical, &
read_namevalue_string
END INTERFACE sdf_read_namevalue
END MODULE sdf_input
......@@ -36,18 +36,14 @@ MODULE sdf_input_cartesian
read_3d_mesh_r4, &
read_1d_mesh_r8, &
read_2d_mesh_r8, &
read_3d_mesh_r8
END INTERFACE sdf_read_plain_mesh
INTERFACE sdf_read_lagrangian_mesh
MODULE PROCEDURE &
read_3d_mesh_r8, &
read_1d_lag_mesh_r4, &
read_2d_lag_mesh_r4, &
read_3d_lag_mesh_r4, &
read_1d_lag_mesh_r8, &
read_2d_lag_mesh_r8, &
read_3d_lag_mesh_r8
END INTERFACE sdf_read_lagrangian_mesh
END INTERFACE sdf_read_plain_mesh
INTERFACE sdf_read_plain_variable
MODULE PROCEDURE &
......
......@@ -1316,6 +1316,50 @@ CONTAINS
SUBROUTINE read_entry_array_logical_c(h, value, nentries)
INTEGER, PARAMETER :: n = 1
TYPE(sdf_file_handle) :: h
CHARACTER(LEN=n), INTENT(OUT) :: value(:)
INTEGER, INTENT(IN) :: nentries
INTEGER(i8) :: i
INTEGER :: j, errcode, mpitype = MPI_CHARACTER
IF (ASSOCIATED(h%buffer)) THEN
i = h%current_location - h%start_location + 1
DO j = 1, nentries
value(j) = h%buffer(i)
i = i + 1
ENDDO
ELSE
IF (h%rank == h%rank_master) THEN
CALL MPI_FILE_READ(h%filehandle, value, nentries, mpitype, &
MPI_STATUS_IGNORE, errcode)
ENDIF
CALL MPI_BCAST(value, nentries, mpitype, h%rank_master, h%comm, errcode)
ENDIF
h%current_location = h%current_location + n * nentries
END SUBROUTINE read_entry_array_logical_c
SUBROUTINE read_entry_array_string(h, value, nentries)
TYPE(sdf_file_handle) :: h
CHARACTER(LEN=*), INTENT(OUT) :: value(:)
INTEGER, INTENT(IN) :: nentries
INTEGER :: i
DO i = 1, nentries
CALL read_entry_string(h, value(i))
END DO
END SUBROUTINE read_entry_array_string
SUBROUTINE sdf_safe_read_string(h, string)
TYPE(sdf_file_handle) :: h
......@@ -1438,4 +1482,186 @@ CONTAINS
END FUNCTION sdf_info_init
SUBROUTINE read_namevalue(h, names)
TYPE(sdf_file_handle) :: h
CHARACTER(LEN=*), INTENT(OUT), OPTIONAL :: names(:)
INTEGER :: i
TYPE(sdf_block_type), POINTER :: b
IF (sdf_info_init(h)) RETURN
b => h%current_block
IF (.NOT. b%done_info) THEN
ALLOCATE(b%material_names(b%ndims))
DO i = 1,b%ndims
CALL read_entry_string(h, b%material_names(i))
ENDDO
IF (b%datatype == c_datatype_integer4) THEN
ALLOCATE(b%i4_array(b%ndims))
CALL read_entry_array_int4(h, b%i4_array, INT(b%ndims))
ELSE IF (b%datatype == c_datatype_integer8) THEN
ALLOCATE(b%i8_array(b%ndims))
CALL read_entry_array_int8(h, b%i8_array, INT(b%ndims))
ELSE IF (b%datatype == c_datatype_real4) THEN
ALLOCATE(b%r4_array(b%ndims))
CALL read_entry_array_real4(h, b%r4_array, INT(b%ndims))
ELSE IF (b%datatype == c_datatype_real8) THEN
ALLOCATE(b%r8_array(b%ndims))
CALL read_entry_array_real8(h, b%r8_array, INT(b%ndims))
ELSE IF (b%datatype == c_datatype_logical) THEN
ALLOCATE(b%logical_array(b%ndims))
CALL read_entry_array_logical_c(h, b%logical_array, INT(b%ndims))
ELSE IF (b%datatype == c_datatype_character) THEN
ALLOCATE(b%string_array(b%ndims))
CALL read_entry_array_string(h, b%string_array, INT(b%ndims))
ENDIF
ENDIF
IF (PRESENT(names)) THEN
DO i = 1,b%ndims
CALL sdf_safe_copy_string(b%material_names(i), names(i))
ENDDO
ENDIF
h%current_location = b%data_location + b%data_length
b%done_info = .TRUE.
b%done_data = .TRUE.
END SUBROUTINE read_namevalue
SUBROUTINE read_namevalue_i4(h, names, values)
TYPE(sdf_file_handle) :: h
CHARACTER(LEN=*), INTENT(OUT) :: names(:)
INTEGER(i4), INTENT(OUT) :: values(:)
INTEGER :: i
TYPE(sdf_block_type), POINTER :: b
CALL read_namevalue(h, names)
b => h%current_block
DO i = 1,b%ndims
values(i) = b%i4_array(i)
ENDDO
END SUBROUTINE read_namevalue_i4
SUBROUTINE read_namevalue_i8(h, names, values)
TYPE(sdf_file_handle) :: h
CHARACTER(LEN=*), INTENT(OUT) :: names(:)
INTEGER(i8), INTENT(OUT) :: values(:)
INTEGER :: i
TYPE(sdf_block_type), POINTER :: b
CALL read_namevalue(h, names)
b => h%current_block
DO i = 1,b%ndims
values(i) = b%i8_array(i)
ENDDO
END SUBROUTINE read_namevalue_i8
SUBROUTINE read_namevalue_r4(h, names, values)
TYPE(sdf_file_handle) :: h
CHARACTER(LEN=*), INTENT(OUT) :: names(:)
REAL(r4), INTENT(OUT) :: values(:)
INTEGER :: i
TYPE(sdf_block_type), POINTER :: b
CALL read_namevalue(h, names)
b => h%current_block
DO i = 1,b%ndims
values(i) = b%r4_array(i)
ENDDO
END SUBROUTINE read_namevalue_r4
SUBROUTINE read_namevalue_r8(h, names, values)
TYPE(sdf_file_handle) :: h
CHARACTER(LEN=*), INTENT(OUT) :: names(:)
REAL(r8), INTENT(OUT) :: values(:)
INTEGER :: i
TYPE(sdf_block_type), POINTER :: b
CALL read_namevalue(h, names)
b => h%current_block
DO i = 1,b%ndims
values(i) = b%r8_array(i)
ENDDO
END SUBROUTINE read_namevalue_r8
SUBROUTINE read_namevalue_logical(h, names, values)
TYPE(sdf_file_handle) :: h
CHARACTER(LEN=*), INTENT(OUT) :: names(:)
LOGICAL, INTENT(OUT) :: values(:)
INTEGER :: i
TYPE(sdf_block_type), POINTER :: b
CALL read_namevalue(h, names)
b => h%current_block
DO i = 1,b%ndims
IF (b%logical_array(i) == ACHAR(0)) THEN
values(i) = .FALSE.
ELSE
values(i) = .TRUE.
ENDIF
ENDDO
END SUBROUTINE read_namevalue_logical
SUBROUTINE read_namevalue_string(h, names, values)
TYPE(sdf_file_handle) :: h
CHARACTER(LEN=*), INTENT(OUT) :: names(:)
CHARACTER(LEN=*), INTENT(OUT) :: values(:)
INTEGER :: i
TYPE(sdf_block_type), POINTER :: b
CALL read_namevalue(h, names)
b => h%current_block
DO i = 1,b%ndims
CALL sdf_safe_copy_string(b%string_array(i), names(i))
ENDDO
END SUBROUTINE read_namevalue_string
END MODULE sdf_input_ru
......@@ -98,6 +98,8 @@ CONTAINS
CALL sdf_read_stitched_obstacle_group(h)
ELSE IF (b%blocktype == c_blocktype_station) THEN
CALL sdf_read_station_info(h)
ELSE IF (b%blocktype == c_blocktype_namevalue) THEN
CALL sdf_read_namevalue(h)
ENDIF
END SUBROUTINE sdf_read_block_info
......
......@@ -22,18 +22,14 @@ MODULE sdf_output_cartesian
write_3d_mesh_r4, &
write_1d_mesh_r8, &
write_2d_mesh_r8, &
write_3d_mesh_r8
END INTERFACE sdf_write_plain_mesh
INTERFACE sdf_write_lagrangian_mesh
MODULE PROCEDURE &
write_3d_mesh_r8, &
write_1d_lag_mesh_r4, &
write_2d_lag_mesh_r4, &
write_3d_lag_mesh_r4, &
write_1d_lag_mesh_r8, &
write_2d_lag_mesh_r8, &
write_3d_lag_mesh_r8
END INTERFACE sdf_write_lagrangian_mesh
END INTERFACE sdf_write_plain_mesh
INTERFACE sdf_write_plain_variable
MODULE PROCEDURE &
......
......@@ -17,7 +17,7 @@ CONTAINS
!----------------------------------------------------------------------------
SUBROUTINE write_srl_1d_mesh_r4(h, id, name, x, convert_in, &
dim_labels, dim_units, dim_mults, rank_write)
dim_labels, dim_units, dim_mults, geometry, rank_write)
INTEGER, PARAMETER :: ndims = 1
TYPE(sdf_file_handle) :: h
......@@ -26,7 +26,7 @@ CONTAINS
LOGICAL, INTENT(IN), OPTIONAL :: convert_in
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: dim_labels(:), dim_units(:)
REAL(r4), DIMENSION(:), INTENT(IN), OPTIONAL :: dim_mults
INTEGER, INTENT(IN), OPTIONAL :: rank_write
INTEGER, INTENT(IN), OPTIONAL :: geometry, rank_write
REAL(r4), DIMENSION(:), ALLOCATABLE :: r4array
INTEGER :: errcode, intn
TYPE(sdf_block_type), POINTER :: b
......@@ -50,7 +50,12 @@ CONTAINS
b%datatype = datatype_real
b%mpitype = mpitype_real
ENDIF
b%geometry = c_geometry_cartesian
IF (PRESENT(geometry)) THEN
b%geometry = geometry
ELSE
b%geometry = c_geometry_cartesian
ENDIF
b%ndims = ndims
IF (PRESENT(rank_write)) h%rank_master = rank_write
......@@ -106,7 +111,7 @@ CONTAINS
!----------------------------------------------------------------------------
SUBROUTINE write_srl_2d_mesh_r4(h, id, name, x, y, convert_in, &
dim_labels, dim_units, dim_mults, rank_write)
dim_labels, dim_units, dim_mults, geometry, rank_write)
INTEGER, PARAMETER :: ndims = 2
TYPE(sdf_file_handle) :: h
......@@ -115,7 +120,7 @@ CONTAINS
LOGICAL, INTENT(IN), OPTIONAL :: convert_in
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: dim_labels(:), dim_units(:)
REAL(r4), DIMENSION(:), INTENT(IN), OPTIONAL :: dim_mults
INTEGER, INTENT(IN), OPTIONAL :: rank_write
INTEGER, INTENT(IN), OPTIONAL :: geometry, rank_write
REAL(r4), DIMENSION(:), ALLOCATABLE :: r4array
INTEGER :: errcode, intn
TYPE(sdf_block_type), POINTER :: b
......@@ -139,7 +144,12 @@ CONTAINS
b%datatype = datatype_real
b%mpitype = mpitype_real
ENDIF
b%geometry = c_geometry_cartesian
IF (PRESENT(geometry)) THEN
b%geometry = geometry
ELSE
b%geometry = c_geometry_cartesian
ENDIF
b%ndims = ndims
IF (PRESENT(rank_write)) h%rank_master = rank_write
......@@ -207,7 +217,7 @@ CONTAINS
!----------------------------------------------------------------------------
SUBROUTINE write_srl_3d_mesh_r4(h, id, name, x, y, z, convert_in, &
dim_labels, dim_units, dim_mults, rank_write)
dim_labels, dim_units, dim_mults, geometry, rank_write)
INTEGER, PARAMETER :: ndims = 3
TYPE(sdf_file_handle) :: h
......@@ -216,7 +226,7 @@ CONTAINS
LOGICAL, INTENT(IN), OPTIONAL :: convert_in
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: dim_labels(:), dim_units(:)
REAL(r4), DIMENSION(:), INTENT(IN), OPTIONAL :: dim_mults
INTEGER, INTENT(IN), OPTIONAL :: rank_write
INTEGER, INTENT(IN), OPTIONAL :: geometry, rank_write
REAL(r4), DIMENSION(:), ALLOCATABLE :: r4array
INTEGER :: errcode, intn
TYPE(sdf_block_type), POINTER :: b
......@@ -240,7 +250,12 @@ CONTAINS
b%datatype = datatype_real
b%mpitype = mpitype_real
ENDIF
b%geometry = c_geometry_cartesian
IF (PRESENT(geometry)) THEN
b%geometry = geometry
ELSE
b%geometry = c_geometry_cartesian
ENDIF
b%ndims = ndims
IF (PRESENT(rank_write)) h%rank_master = rank_write
......@@ -322,7 +337,7 @@ CONTAINS
SUBROUTINE write_1d_mesh_r4(h, id, name, x, dims, xmin, xmax, &
distribution, subarray, convert_in, dim_labels, &
dim_units, dim_mults)
dim_units, dim_mults, geometry)
INTEGER, PARAMETER :: ndims = 1
TYPE(sdf_file_handle) :: h
......@@ -334,6 +349,7 @@ CONTAINS
LOGICAL, INTENT(IN), OPTIONAL :: convert_in
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: dim_labels(:), dim_units(:)
REAL(r4), DIMENSION(:), INTENT(IN), OPTIONAL :: dim_mults
INTEGER, INTENT(IN), OPTIONAL :: geometry
REAL(r8), DIMENSION(ndims) :: gmn, gmx
REAL(r4), DIMENSION(:), ALLOCATABLE :: r4array
INTEGER :: i, errcode, intn = 0
......@@ -361,7 +377,12 @@ CONTAINS
b%datatype = datatype_real
b%mpitype = mpitype_real
ENDIF
b%geometry = c_geometry_cartesian
IF (PRESENT(geometry)) THEN
b%geometry = geometry
ELSE
b%geometry = c_geometry_cartesian
ENDIF
b%ndims = ndims
DO i = 1,ndims
......@@ -413,7 +434,7 @@ CONTAINS
SUBROUTINE write_2d_mesh_r4(h, id, name, x, y, dims, xmin, xmax, &
ymin, ymax, distribution, subarray, convert_in, dim_labels, &
dim_units, dim_mults)
dim_units, dim_mults, geometry)
INTEGER, PARAMETER :: ndims = 2
TYPE(sdf_file_handle) :: h
......@@ -425,6 +446,7 @@ CONTAINS
LOGICAL, INTENT(IN), OPTIONAL :: convert_in
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: dim_labels(:), dim_units(:)
REAL(r4), DIMENSION(:), INTENT(IN), OPTIONAL :: dim_mults
INTEGER, INTENT(IN), OPTIONAL :: geometry
REAL(r8), DIMENSION(ndims) :: gmn, gmx
REAL(r4), DIMENSION(:), ALLOCATABLE :: r4array
INTEGER :: i, errcode, sz(ndims), intn
......@@ -455,7 +477,12 @@ CONTAINS
b%datatype = datatype_real
b%mpitype = mpitype_real
ENDIF
b%geometry = c_geometry_cartesian
IF (PRESENT(geometry)) THEN
b%geometry = geometry
ELSE
b%geometry = c_geometry_cartesian
ENDIF
b%ndims = ndims
DO i = 1,ndims
......@@ -524,7 +551,7 @@ CONTAINS
SUBROUTINE write_3d_mesh_r4(h, id, name, x, y, z, dims, xmin, xmax, &
ymin, ymax, zmin, zmax, distribution, subarray, convert_in, dim_labels, &
dim_units, dim_mults)
dim_units, dim_mults, geometry)
INTEGER, PARAMETER :: ndims = 3
TYPE(sdf_file_handle) :: h
......@@ -536,6 +563,7 @@ CONTAINS
LOGICAL, INTENT(IN), OPTIONAL :: convert_in
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: dim_labels(:), dim_units(:)
REAL(r4), DIMENSION(:), INTENT(IN), OPTIONAL :: dim_mults
INTEGER, INTENT(IN), OPTIONAL :: geometry
REAL(r8), DIMENSION(ndims) :: gmn, gmx
REAL(r4), DIMENSION(:), ALLOCATABLE :: r4array
INTEGER :: i, errcode, sz(ndims), intn
......@@ -567,7 +595,12 @@ CONTAINS
b%datatype = datatype_real
b%mpitype = mpitype_real
ENDIF
b%geometry = c_geometry_cartesian
IF (PRESENT(geometry)) THEN
b%geometry = geometry
ELSE
b%geometry = c_geometry_cartesian
ENDIF
b%ndims = ndims
DO i = 1,ndims
......@@ -652,7 +685,7 @@ CONTAINS
SUBROUTINE write_1d_lag_mesh_r4(h, id, name, x, dims, xmin, xmax, &
distribution, subarray, convert_in, dim_labels, &
dim_units, dim_mults)
dim_units, dim_mults, geometry)
INTEGER, PARAMETER :: ndims = 1
TYPE(sdf_file_handle) :: h
......@@ -664,6 +697,7 @@ CONTAINS
LOGICAL, INTENT(IN), OPTIONAL :: convert_in
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: dim_labels(:), dim_units(:)
REAL(r4), DIMENSION(:), INTENT(IN), OPTIONAL :: dim_mults
INTEGER, INTENT(IN), OPTIONAL :: geometry
REAL(r8), DIMENSION(ndims) :: gmn, gmx
REAL(r4), DIMENSION(:), ALLOCATABLE :: r4array
INTEGER :: i, errcode, sz(ndims)
......@@ -692,7 +726,12 @@ CONTAINS
b%datatype = datatype_real
b%mpitype = mpitype_real
ENDIF
b%geometry = c_geometry_cartesian
IF (PRESENT(geometry)) THEN
b%geometry = geometry
ELSE
b%geometry = c_geometry_cartesian
ENDIF
b%ndims = ndims
DO i = 1,ndims
......@@ -746,7 +785,7 @@ CONTAINS
SUBROUTINE write_2d_lag_mesh_r4(h, id, name, x, y, dims, xmin, xmax, &
ymin, ymax, distribution, subarray, convert_in, dim_labels, &
dim_units, dim_mults)
dim_units, dim_mults, geometry)
INTEGER, PARAMETER :: ndims = 2
TYPE(sdf_file_handle) :: h
......@@ -758,6 +797,7 @@ CONTAINS
LOGICAL, INTENT(IN), OPTIONAL :: convert_in
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: dim_labels(:), dim_units(:)
REAL(r4), DIMENSION(:), INTENT(IN), OPTIONAL :: dim_mults
INTEGER, INTENT(IN), OPTIONAL :: geometry
REAL(r8), DIMENSION(ndims) :: gmn, gmx
REAL(r4), DIMENSION(:,:), ALLOCATABLE :: r4array
INTEGER :: i, errcode, sz(ndims)
......@@ -787,7 +827,12 @@ CONTAINS
b%datatype = datatype_real
b%mpitype = mpitype_real
ENDIF
b%geometry = c_geometry_cartesian
IF (PRESENT(geometry)) THEN
b%geometry = geometry
ELSE
b%geometry = c_geometry_cartesian
ENDIF
b%ndims = ndims
DO i = 1,ndims
......@@ -850,7 +895,7 @@ CONTAINS
SUBROUTINE write_3d_lag_mesh_r4(h, id, name, x, y, z, dims, xmin, xmax, &
ymin, ymax, zmin, zmax, distribution, subarray, convert_in, dim_labels, &
dim_units, dim_mults)
dim_units, dim_mults, geometry)
INTEGER, PARAMETER :: ndims = 3
TYPE(sdf_file_handle) :: h
......@@ -862,6 +907,7 @@ CONTAINS
LOGICAL, INTENT(IN), OPTIONAL :: convert_in
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: dim_labels(:), dim_units(:)
REAL(r4), DIMENSION(:), INTENT(IN), OPTIONAL :: dim_mults
INTEGER, INTENT(IN), OPTIONAL :: geometry
REAL(r8), DIMENSION(ndims) :: gmn, gmx
REAL(r4), DIMENSION(:,:,:), ALLOCATABLE :: r4array
INTEGER :: i, errcode, sz(ndims)
......@@ -892,7 +938,12 @@ CONTAINS
b%datatype = datatype_real
b%mpitype = mpitype_real
ENDIF
b%geometry = c_geometry_cartesian
IF (PRESENT(geometry)) THEN
b%geometry = geometry
ELSE
b%geometry = c_geometry_cartesian
ENDIF
b%ndims = ndims
DO i = 1,ndims
......
......@@ -17,7 +17,7 @@ CONTAINS
!----------------------------------------------------------------------------
SUBROUTINE write_srl_1d_mesh_r8(h, id, name, x, convert_in, &
dim_labels, dim_units, dim_mults, rank_write)
dim_labels, dim_units, dim_mults, geometry, rank_write)
INTEGER, PARAMETER :: ndims = 1
TYPE(sdf_file_handle) :: h
......@@ -26,7 +26,7 @@ CONTAINS
LOGICAL, INTENT(IN), OPTIONAL :: convert_in
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: dim_labels(:), dim_units(:)
REAL(r8), DIMENSION(:), INTENT(IN), OPTIONAL :: dim_mults
INTEGER, INTENT(IN), OPTIONAL :: rank_write