Skip to content

Commit

Permalink
add ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
boulderdaze committed Feb 6, 2025
1 parent 505cd89 commit 09fce1c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/tuvx/interface_grid_map.F90
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ function interal_get_grid(grid_map, c_grid_name, c_grid_name_length, &

! variables
class(grid_t), pointer :: f_grid
class(grid_t), pointer :: f_grid_ptr
type(grid_warehouse_t), pointer :: grid_warehouse
character(len=:), allocatable :: f_grid_name
character(len=:), allocatable :: f_grid_units
Expand All @@ -126,7 +127,9 @@ 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_ptr => grid_warehouse%get_grid(f_grid_name, f_grid_units)
allocate(f_grid, source = f_grid_ptr)
nullify(f_grid_ptr)

select type(f_grid)
type is(grid_from_host_t)
Expand Down
5 changes: 4 additions & 1 deletion src/tuvx/interface_profile_map.F90
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ function internal_get_profile(profile_map, c_profile_name, &

! variables
class(profile_t), pointer :: f_profile
class(profile_t), pointer :: f_profile_ptr
type(profile_warehouse_t), pointer :: profile_warehouse
character(len=:), allocatable :: f_profile_name
character(len=:), allocatable :: f_profile_units
Expand All @@ -126,7 +127,9 @@ 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_ptr => profile_warehouse%get_profile(f_profile_name, f_profile_units)
allocate(f_profile, source = f_profile_ptr)
nullify(f_profile_ptr)

select type(f_profile)
type is(profile_from_host_t)
Expand Down
6 changes: 3 additions & 3 deletions src/tuvx/interface_radiator_map.F90
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ 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)
Expand Down

0 comments on commit 09fce1c

Please sign in to comment.