Skip to content

Commit

Permalink
make them pointer instead of pointer assingment
Browse files Browse the repository at this point in the history
  • Loading branch information
boulderdaze committed Feb 6, 2025
1 parent 79b4737 commit 505cd89
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/tuvx/interface_grid_map.F90
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ function interal_get_grid(grid_map, c_grid_name, c_grid_name_length, &

call c_f_pointer(grid_map, grid_warehouse)

f_grid => grid_warehouse%get_grid(f_grid_name, f_grid_units)
f_grid = grid_warehouse%get_grid(f_grid_name, f_grid_units)

select type(f_grid)
type is(grid_from_host_t)
error_code = 0
grid_ptr = c_loc(f_grid)
class default
error_code = 1
! deallocate(f_grid)
deallocate(f_grid)
grid_ptr = c_null_ptr
end select

Expand Down
4 changes: 2 additions & 2 deletions src/tuvx/interface_profile_map.F90
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ function internal_get_profile(profile_map, c_profile_name, &

call c_f_pointer(profile_map, profile_warehouse)

f_profile => profile_warehouse%get_profile(f_profile_name, f_profile_units)
f_profile = profile_warehouse%get_profile(f_profile_name, f_profile_units)

select type(f_profile)
type is(profile_from_host_t)
profile_ptr = c_loc(f_profile)
error_code = 0
class default
error_code = 1
! deallocate(f_profile)
deallocate(f_profile)
profile_ptr = c_null_ptr
end select

Expand Down
8 changes: 4 additions & 4 deletions src/tuvx/interface_radiator_map.F90
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,17 @@ function internal_get_radiator(radiator_map, c_radiator_name, &
error_code = 1
radiator_ptr = c_null_ptr
else
f_radiator_ptr => radiator_warehouse%get_radiator(f_radiator_name)
allocate(f_radiator, source = f_radiator_ptr)
nullify(f_radiator_ptr)
f_radiator_ptr = radiator_warehouse%get_radiator(f_radiator_name)
! allocate(f_radiator, source = f_radiator_ptr)
! nullify(f_radiator_ptr)

select type(f_radiator)
type is(radiator_from_host_t)
error_code = 0
radiator_ptr = c_loc(f_radiator)
class default
error_code = 1
! deallocate(f_radiator)
deallocate(f_radiator)
radiator_ptr = c_null_ptr
end select
end if
Expand Down

0 comments on commit 505cd89

Please sign in to comment.