Psyclone fixed format support

Open
#2,192 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
fortran, python
Domain
compilers

Research direction

Start with algorithm.py:parse_fp2 and reproduce the fparser failure on the fixed-format make_block_6_1.f example. Review how PSyclone selects the parser for NEMO API files and consider the two proposed approaches: retrying fixed format or adding a command-line override. Done means the make_block_6_* files parse successfully, with disort_interface behavior checked if relevant.

Written by the indexing model from the issue text.

Description

bug enhancement

Socrates contains a number of fixed-format files which are not handled correctly by PSyclone, using the NEMO API.

fparser throws an exception on this code:

      SUBROUTINE make_block_6_1(ierr
     &  , n_band, wave_length_short, wave_length_long
     &  , l_exclude, n_band_exclude, index_exclude
     &  , n_deg_fit, t_ref_thermal, thermal_coefficient
     &  , theta_planck_tbl, l_present_6, l_planck_tbl
     &  )

This is valid fixed-format Fortran, but will cause a standard F90 compiler to raise syntax errors (e.g. godbolt with no arguments). At the moment, PSyclone also fails to parse this with this error:

Parse Error: algorithm.py:parse_fp2: Syntax error in file './make_block_6_1.f':
at line 20
>>>      SUBROUTINE make_block_6_1(ierr

Andy's suggestions here were:

  1. Either retry with fixed format is parsing fails (could be expensive) or be a bit smarter and consider the file suffix when creating the parser.
  2. Add a command line flag to PSyclone to override this and force either fixed or free formatted Fortran parsing.

At least this breaks for make_block_6_* files and perhaps also the cause of issues in disort_interface for Socrates.

Dominant language
Python
Stars
137
Forks
36
Avg merge
6d 16h
Merged PRs (30d)
18

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stfc/PSyclone

All issues in stfc/PSyclone

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.