-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importers #2
Comments
Start to merge @victorsndvg work from its fork. There are a lot of work to do... Victor programming styleVictor programming styles seems too much different from mine. Take this in count. Library source sizeThe library source is becoming huge. Consider to exploit Speak of this with victor. XML ParsingVictor XML parsing seems complex: pay attention to the auxiliary procedures he is using. Speak of this with victor. Library APIVictor adopted a new set of public interface where the suffix ! importer
E_IO = VTK_INI_XML(...,action='load')
! export
E_IO = VTK_INI_XML(...,action='save') Speak of this with victor. |
Hi Stefano, I'm glad to see that you are reviewing the new and big piece of code... Good luck! :) Feel free to ask or suggest anything. I will try to help you with any doubt and I can also try to adapt or reimplement the code according to your suggestions. Probably it will be a long conversation :) Best regards, |
Thank you very much for your kindness, it is very appreciated. Let's go! Lib_VTK_IO.F90 source file sizeIn your version, that is the most up-to-date, the lines counting is now the procedures of (let us say) module procedure VTK_GEO_XML_STRG_1DA_R8, VTK_GEO_XML_STRG_3DA_R8, & ! real(R8P) StructuredGrid, 1D/3D Arrays
VTK_GEO_XML_STRG_1DAP_R8,VTK_GEO_XML_STRG_3DAP_R8, & ! real(R8P) StructuredGrid, 1D/3D Arrays packed API
VTK_GEO_XML_STRG_1DA_R4, VTK_GEO_XML_STRG_3DA_R4, & ! real(R4P) StructuredGrid, 1D/3D Arrays
VTK_GEO_XML_STRG_1DAP_R4,VTK_GEO_XML_STRG_3DAP_R4, & ! real(R4P) StructuredGrid, 1D/3D Arrays packed API
VTK_GEO_XML_RECT_R8, & ! real(R8P) RectilinearGrid
VTK_GEO_XML_RECT_R4, & ! real(R4P) RectilinearGrid
VTK_GEO_XML_UNST_R8,VTK_GEO_XML_UNST_PACK_R4, & ! real(R8P) UnstructuredGrid, standard and packed API
VTK_GEO_XML_UNST_R4,VTK_GEO_XML_UNST_PACK_R8, & ! real(R4P) UnstructuredGrid, standard and packed API
VTK_GEO_XML_CLOSEP will go into include("Lib_VTK_IO-GEO_XML.inc") The same for all big generic interface. What do you think about this? |
I've never used the include statement before. I have to read something about it. My first impression, and baseless opinion, about And, why not to modularize the code? I mean, reorganize the source code in different modules. For example: File File What do you think ? |
You are (almost) right.
Indeed, my first thought was (as your) to use module for packing the interfaces. However, besides the new compiling hierarchy (that is a minor issue), my main concern is about the (ab)use of some global variables defined into the Lib_VTK_IO main module: if we use (sub)modules for packing the interfaces, we must ensure to avoid circular modules use because interface-modules must access to the global variables defined into the main module and the main module must use the interface-modules... if we agree to modularize the library, we must plan a module also for global variable (being careful with multi-thread security...). Ok, tomorrow I will propose a possible modularization and a possible include exploiting trying to highlight pros and cons of both. See you soon. |
@szaghi , it's nice to learn reading your posts. Thank you. I'm agree with you, there must be some modules (or only 1) containing global variables and common procedures. As an early/basic idea, and according to this, to avoid circular dependencies between modules we could think in a 3 (or more) level hierarchy. The lowest level could contain those common and global things and the highest level work as a front-end. The biggest work should the placed in the intermediate levels, containing the interfaces an procedures for effective reading and writing. The highest level will use the intermediates level modules and, following the hierarchy, those levels will use the lowest level. Do you think this is possible? Do you see any potential problem of this simple schema? |
You are completely right. This night, "sloshing" my daughter, I realized that modularization is definitely the better approach because allow the easy maintenance of the library and favorite the future refactoring (I am planning to refactor the API to allow OOP, that, besides other things, means encapsulate all...). I think to discard the idea of exploiting Thus we can think to our modularization. I like to try implement the modularization step by step with you. The following is just a first idea. Modularization hierarchyThree levels of abstraction (as you suggest):
Modules namingNo idea... do you have some suggestions? New branch generationToday I will create a new branch, beside the master one, named importers. I would like to allow you to directly control with me my gitrepo, thus you can control my mistakes... is it ok for you? See you soon. |
Start library modularization as described into #2 The modules naming convention is temporary: ask victor his suggestion.
Add (sub)modules: the library is now modularized as #2
Just added a new branch, importers. The modularization is done as above described. The naming convention adopted is trivial, but feel free to suggest a more smart one. Into the back-end module I have already inserted your auxiliary procedures. Besides some minor changes for conforming my (bad) style, I have made some major changes:
This is my break-lunch work. See you soon. |
an OOP approach will be great! Modularization hierarchyI'm completely agree with you. Modules namingAbout modules naming, as a user of your library since some time ago, i think that the actual name functions are friendly. I think that maintaining this names will help the old users to adapt and understand the new modularization. Maybe something like:
New branch generationIt's Ok for me. I will follow the changes too near to understand your refactoring improvements See you. |
Just added you as collaborators. You can push your commit directly here. See you. |
About the two previous point talking about auxiliary procedures:
It seems that, talking about ambiguous signatures, the order of those mixed arguments affect only to the procedure calling if you don't use the keyword. I'm not sure if I answered your question, I did? See you |
You are right. I was thinking exactly to the sentences you have reported (I had not the standard under my eyes today). I use named associations always alsi for avoid ambiguity. However, the sentence you reported is not talking about the definition of the procedure (as I was concerning) rather to the caller signature. Tomorrow I will check, but lrt us now consider an example: call foo(a=1,b=2)
call foo(1,b=2)
call foo(1,2)
call foo(1) The eventual ambiguity comes from:
As a consequence, the following definition are not identical: subroutine foo(a,b)
integer, optional:: a
integer::b subroutine foo(b,a)
integer::b
integer, optional:: a The problem is that I don remember which of the above two is better. Anyhow, tomorrow should be easy to check. Night! |
It's hard to read all references to optional arguments in the handbook to get what we want to know. Now I'm going to continue reading. I think that is strongly coherent to put the non optional arguments first, because when you call the procedures without keywords: ...arguments without keywords must appear prior... . I always use it in this way because I think that it's usual in Python. I hope to get it more clear today |
My today tests have been usefulness. I cannot discover why (if I remember right) some Intel's Fortran Guru showed me that it was a best practice define optional arguments before non optional.... On the contrary, re-reading a great book, Modern Fortran, style and usage of Clerman and Spector, I found our searching best practice hint
If you agree, I will follow this convention. |
sorry I cannot found any useful info ... I'm agree with you. I will take note of this convention also for my future works |
Importers are missing.
The text was updated successfully, but these errors were encountered: