{"title":"用户定义和重载操作","authors":"A. Markus","doi":"10.1145/2594488.2594490","DOIUrl":null,"url":null,"abstract":"Object-oriented programming has the reputation of allowing far-reaching abstractions in the source code, so that programs become more comprehensible and general. With the Fortran 2003 standard, the Fortran language has gained that power too, but that does not mean that it was impossible before to write compact code that hides all the implementation details. The user-defined operations and the overloading of standard operations for derived types as defined in the Fortran 90/95 standards already allow you to hide the gory details and stay close to, say, the mathematical formulation. In this note I present a straightforward solver for a simple partial differential equation as well as an implicit solver for an ordinary differential equation using these Fortran 90/95 features only. The attraction to me at least is the possibility to almost completely hide the numerical aspects in a set of routines implementing operations on a grid of data.","PeriodicalId":379614,"journal":{"name":"ACM SIGPLAN Fortran Forum","volume":"42 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2014-03-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":"{\"title\":\"User-defined and overloaded operations\",\"authors\":\"A. Markus\",\"doi\":\"10.1145/2594488.2594490\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Object-oriented programming has the reputation of allowing far-reaching abstractions in the source code, so that programs become more comprehensible and general. With the Fortran 2003 standard, the Fortran language has gained that power too, but that does not mean that it was impossible before to write compact code that hides all the implementation details. The user-defined operations and the overloading of standard operations for derived types as defined in the Fortran 90/95 standards already allow you to hide the gory details and stay close to, say, the mathematical formulation. In this note I present a straightforward solver for a simple partial differential equation as well as an implicit solver for an ordinary differential equation using these Fortran 90/95 features only. The attraction to me at least is the possibility to almost completely hide the numerical aspects in a set of routines implementing operations on a grid of data.\",\"PeriodicalId\":379614,\"journal\":{\"name\":\"ACM SIGPLAN Fortran Forum\",\"volume\":\"42 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2014-03-15\",\"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/2594488.2594490\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"ACM SIGPLAN Fortran Forum","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2594488.2594490","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Object-oriented programming has the reputation of allowing far-reaching abstractions in the source code, so that programs become more comprehensible and general. With the Fortran 2003 standard, the Fortran language has gained that power too, but that does not mean that it was impossible before to write compact code that hides all the implementation details. The user-defined operations and the overloading of standard operations for derived types as defined in the Fortran 90/95 standards already allow you to hide the gory details and stay close to, say, the mathematical formulation. In this note I present a straightforward solver for a simple partial differential equation as well as an implicit solver for an ordinary differential equation using these Fortran 90/95 features only. The attraction to me at least is the possibility to almost completely hide the numerical aspects in a set of routines implementing operations on a grid of data.