stfc / PSyclone

Domain-specific compiler and code transformation system for Finite Difference/Volume/Element Earth-system models in Fortran
BSD 3-Clause "New" or "Revised" License
103 stars 25 forks source link

Missing types in LFRic infrastructure #2018

Open hiker opened 1 year ago

hiker commented 1 year ago

Two types issues that need to be either fixed or resolved in LFric before we can change them in PSyclone:

  1. PSyclone defines r_phys (and other physics related types), but they are not defined in the infrastructure. This results in the extraction driver not compiling (since it imports all defined symbols). For now r_phys and r_quad are explicitly ignored, but this should be fixed.

  2. LFRicConstants defines:

        LFRicConstants.PRECISION_MAP = {"i_def": 4,
                                        "r_def": 8,
                                        "r_double": 8,
                                        "r_ncdf": 8,
                                        "r_quad": 16,
    ...

    When I use the PRECISION_MAP to create a driver and import all precision symbols from the PRECISION_MAP, the created code does not compile. because constants_mod.F90 does define but not export the symbol.

This is the same in current LFRic (https://code.metoffice.gov.uk/svn/lfric/LFRic/trunk/infrastructure/source/utilities/constants_mod.F90). Since I am not sure how/if r_quad is supposed to be used, I explicitly do not import r_quad, and refer this ticket :)

hiker commented 8 months ago

I've renamed this ticket and changed the description to keep track of both type related issues, which need LFRic changes.