PSyclone icon indicating copy to clipboard operation
PSyclone copied to clipboard

[PSyData] Incorrect code in Driver

Open hiker opened this issue 1 year ago • 0 comments

Using a user-defined type seems to be extracted correctly:

      CALL extract_psy_data%PreDeclareVariable("tdims%i_end@atm_fields_bounds_mod", tdims%i_end)
      CALL extract_psy_data%PreDeclareVariable("tdims%i_start@atm_fields_bounds_mod", tdims%i_start)
      CALL extract_psy_data%PreDeclareVariable("tdims%j_end@atm_fields_bounds_mod", tdims%j_end)
      CALL extract_psy_data%PreDeclareVariable("tdims%j_start@atm_fields_bounds_mod", tdims%j_start)
...
      CALL extract_psy_data%ProvideVariable("tdims%i_end@atm_fields_bounds_mod", tdims%i_end)
      CALL extract_psy_data%ProvideVariable("tdims%i_start@atm_fields_bounds_mod", tdims%i_start)
      CALL extract_psy_data%ProvideVariable("tdims%j_end@atm_fields_bounds_mod", tdims%j_end)
      CALL extract_psy_data%ProvideVariable("tdims%j_start@atm_fields_bounds_mod", tdims%j_start)

but the code in the driver is not correct:

  call extract_psy_data%ReadVariable('tdims@atm_fields_bounds_mod', tdims)
  call extract_psy_data%ReadVariable('tdims@atm_fields_bounds_mod', tdims)
  call extract_psy_data%ReadVariable('tdims@atm_fields_bounds_mod', tdims)
  call extract_psy_data%ReadVariable('tdims@atm_fields_bounds_mod', tdims)

The original idea of the driver was of course to map any user defined type (like fields) back to the plain Fortran data structures, so problems here are to be expected.

Note that tdims is not passed to the actual kernel, it is used inside of one of the called physics routine only,

hiker avatar Jan 11 '24 04:01 hiker