Note
This is just a wapper for destroy
in geopotential_model.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | intent(in), | value | :: | cp |
pointer to a container containing a geopotential_model |
subroutine destroy_geopotential_model(cp) bind(c,name='destroy_geopotential_model') implicit none type(c_ptr),intent(in),value :: cp !! pointer to a [[container]] !! containing a [[geopotential_model]] type(container),pointer :: grav_container !! Fortran version of `cp` ! convert cp to fortran: call c_f_pointer(cp,grav_container) if (associated(grav_container)) then select type (g => grav_container%data) class is (geopotential_model) call g%destroy() !cp = c_null_ptr ! should we do this too (make inout ?) end select deallocate(grav_container) else error stop 'error: pointer is not associated' end if end subroutine destroy_geopotential_model