Skip to content

omp critical directives #3199

@RobWatersMet

Description

@RobWatersMet

Simialr to #3198

Ideally we'd like to replace exisiting omp directives with identical equivalents from a transformer - This will help ensure the directives are not mistakenly stripped out in the future and will improve consistency in how omp directives are being applied to UKCA.

E.g.:

! OMP CRITICAL will only allow one thread through this code at a time,
! while the other threads are held until completion.
!$OMP CRITICAL (asad_bedriv_init)
IF (first_pass) THEN
  IF (first) THEN
    first = .FALSE.
    ! find N2O5, NO3, and NO2 species in species array
    DO js = 1,jpspec
      SELECT CASE (speci(js))
      CASE ('N2O5      ')
        in2o5 = js
      CASE ('NO3       ')
        ino3  = js
      CASE ('NO2       ')
        ino2  = js
      END SELECT
    END DO

    ! find N2O5 + M and NO2 + NO3 + M in termolecular reactions array
    DO js = 1,jptk
      SELECT CASE (spt(js,1))
      CASE ('N2O5      ')
        tn2o5   = ntrkx(js)
      CASE ('NO2       ')
        IF (spt(js,2) == 'NO3       ') tno2no3 = ntrkx(js)
      CASE ('NO3       ')
        IF (spt(js,2) == 'NO2       ') tno2no3 = ntrkx(js)
      END SELECT
    END DO

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions