Ignore:
Timestamp:
May 24, 2013, 11:52:12 AM (11 years ago)
Author:
Ehouarn Millour
Message:

IOIPSL routine getin is not threadsafe, so when running in OpenMP, it should be called by only one thread (and the result copied to other threads in the case of threadprivate variables).
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phydev/physiq.F90

    r1686 r1759  
    7575integer,save :: iwrite_phys ! output every iwrite_phys physics step
    7676!$OMP THREADPRIVATE(iwrite_phys)
     77integer :: iwrite_phys_omp ! intermediate variable to read iwrite_phys
    7778real :: t_ops ! frequency of the IOIPSL operations (eg average over...)
    7879real :: t_wrt ! frequency of the IOIPSL outputs
     
    8687! Initialize outputs:
    8788  itau0=0
    88   iwrite_phys=1 !default: output every physics timestep
    89   call getin("iwrite_phys",iwrite_phys)
     89!$OMP MASTER
     90  iwrite_phys_omp=1 !default: output every physics timestep
     91  ! NB: getin() is not threadsafe; only one thread should call it.
     92  call getin("iwrite_phys",iwrite_phys_omp)
     93!$OMP END MASTER
     94!$OMP BARRIER
     95  iwrite_phys=iwrite_phys_omp
    9096  t_ops=pdtphys*iwrite_phys ! frequency of the IOIPSL operation
    9197  t_wrt=pdtphys*iwrite_phys ! frequency of the outputs in the file
Note: See TracChangeset for help on using the changeset viewer.