Skip to content
Snippets Groups Projects
Commit 14c61f38 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Bug fix: avoid aliases in arguments

Define two variables `hshp_in` and `hshp_out` to avoid aliases in
arguments of `shpc_create`. I have encountered a run which crashed there.
parent 2d0a2f3d
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ program test_read_eddy
type(eddy) e
integer k, eddy_i
integer:: ishape = 0
TYPE(shpc_slice_handler) hshp
TYPE(shpc_slice_handler) hshp_in, hshp_out
character(len = :), allocatable:: shpc_dir
namelist /main_nml/ ishape
......@@ -24,13 +24,13 @@ program test_read_eddy
call get_command_arg_dyn(1, shpc_dir, "Required argument: SHPC-directory")
print *, "Enter namelist main_nml."
read(unit = *, nml = main_nml)
call shpc_open(hshp, shpc_dir, pszaccess = "rb")
call read_eddy(e, k, eddy_i, hshp, ishape)
CALL shpc_close(hshp)
call shpc_open(hshp_in, shpc_dir, pszaccess = "rb")
call read_eddy(e, k, eddy_i, hshp_in, ishape)
CALL shpc_close(hshp_in)
call shpc_create(hshp, shpc_dir = "SHPC", cyclone = hshp%cyclone)
call write_eddy(e, hshp, k, eddy_i)
CALL shpc_close(hshp)
call shpc_create(hshp_out, shpc_dir = "SHPC", cyclone = hshp_in%cyclone)
call write_eddy(e, hshp_out, k, eddy_i)
CALL shpc_close(hshp_out)
print *, 'Created shapefiles in SHPC.'
end program test_read_eddy
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment