{"title":"Note on creating an array of procedure pointers","authors":"N. Clerman","doi":"10.1145/1520752.1520753","DOIUrl":null,"url":null,"abstract":"Introduction Fortran programmers know that it is not possible to directly form an array of pointers. To the uninitiated, the notation may be somewhat confusing. The following line of code is a declaration of an array of intrinsic type real. real , dimension (20) :: samples But the following line of code is a declaration of a pointer to an array of real values, not an array of pointers. real , dimension (:) , pointer :: ptr_samples And in the following code, a pointer assignment points ptr_samples at the samples array. ptr_samples => samples To create an array of pointers, you can define a data type whose sole component is a pointer, and you can then use an array of this new type as a pointer array. type Real_Ptr_Type real , dimension (:) , pointer :: real_ptr_comp end type Real_Ptr_Type","PeriodicalId":379614,"journal":{"name":"ACM SIGPLAN Fortran Forum","volume":"31 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2009-03-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"ACM SIGPLAN Fortran Forum","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1520752.1520753","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1
Abstract
Introduction Fortran programmers know that it is not possible to directly form an array of pointers. To the uninitiated, the notation may be somewhat confusing. The following line of code is a declaration of an array of intrinsic type real. real , dimension (20) :: samples But the following line of code is a declaration of a pointer to an array of real values, not an array of pointers. real , dimension (:) , pointer :: ptr_samples And in the following code, a pointer assignment points ptr_samples at the samples array. ptr_samples => samples To create an array of pointers, you can define a data type whose sole component is a pointer, and you can then use an array of this new type as a pointer array. type Real_Ptr_Type real , dimension (:) , pointer :: real_ptr_comp end type Real_Ptr_Type