arporter / NEMO-DSL

Investigation into the use of Domain Specific Languages with the NEMO ocean model
BSD 2-Clause "Simplified" License
2 stars 0 forks source link

Make use of dl-esm-inf infrastructure #9

Closed arporter closed 7 years ago

arporter commented 7 years ago

In order for a code to make use of a DSL, it must make use of the infrastructure associated with the implementation of the DSL. In this issue we will start to change the code to use the infrastructure provided by https://github.com/stfc/dl_esm_inf (previously developed for 2D models in the GOcean project).

arporter commented 7 years ago

I now have the code at least looking like the NEMOLite2D code in terms of its use of infrastructure. The code compiles but currently the 1D and 3D 'support' in the infrastructure consists of only stubs that define the interfaces. I'll flesh those out next as part of https://github.com/stfc/dl_esm_inf/issues/1

arporter commented 7 years ago

Code now compiles and runs using dl-esm-inf.

arporter commented 7 years ago

Back to the age-old problem of arranging loop limits so as to get the same answers as the original. I note that the routine that outputs the final field does:

    DO jk = 1, jpk-1
       DO jj = 2, jpj-1
          DO ji = 2, jpi-1

This suggests that the 'internal' region of the domain is (2:jpi-1,2:jpj-1,1:jpk-1). Given that it is a tracer kernel we're working on, it is a tracer field that is output (mydomain in our benchmark code) and therefore it must be on T points.

arporter commented 7 years ago

NEMO uses an Arakawa C grid with 'NE' offset - i.e. {U,V,F} grid points to the North and East of a given T point have the same grid indices.

arporter commented 7 years ago

It was actually relatively pain-free for once. Main problem was that I was not initialising the u, v and T masks in the same way as in the original code. Also had to allow for the fact that dl_esm_inf puts boundary points all round the domain and assumes these are part of the specified grid dimensions provided by the T mask. This would not be a problem if we had a proper routine for interrogating the T-mask to get the domain boundaries (and if we had realistic T-mask values which, in this case, we don't).

arporter commented 7 years ago

Over to Rupert for review...

arporter commented 7 years ago

Pull request merged to master. Closing issue.