Ignore:
Timestamp:
Feb 19, 2025, 2:26:32 PM (5 months ago)
Author:
afalco
Message:

Pluto: OpenMP fixes.
AF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.PLUTO/libf/phypluto/lymalpha.F90

    r3613 r3632  
    22      use datafile_mod
    33      use comcstfi_mod, only: pi
    4       use mod_phys_lmdz_para, only : is_master, bcast
     4      use mod_phys_lmdz_para, only : is_master
    55
    66      implicit none
     
    4343      integer ifine
    4444      character(len=100) :: file_path
    45       real,save :: lsdat(Nfine),fluxdat(Nfine)
    46 !$OMP THREADPRIVATE(lsdat,fluxdat)
     45      ! real,save :: lsdat(Nfine),fluxdat(Nfine)
     46      real,save,allocatable :: lsdat(:)
     47      real,save,allocatable :: fluxdat(:)
    4748
    4849
     
    5051
    5152      IF (firstcall) then
    52         firstcall=.false.
    53         file_path=trim(datadir)//'/sol_uv_flux.txt'
    54         if (is_master) print*,file_path
    55         open(222,file=file_path,form='formatted')
     53         firstcall=.false.
    5654
    57         if (is_master) then
    58         do ifine=1,Nfine
    59            read(222,*) lsdat(ifine), fluxdat(ifine)
    60         enddo
    61         close(222)
    62         endif ! is_master
     55!$OMP MASTER
     56         file_path=trim(datadir)//'/sol_uv_flux.txt'
     57         if (is_master) print*,file_path
    6358
    64         call bcast(lsdat)
    65         call bcast(fluxdat)
     59         open(222,file=file_path,form='formatted')
     60
     61            if(.not.allocated(lsdat)) then
     62               allocate(lsdat(Nfine))
     63            endif
     64            if(.not.allocated(fluxdat)) then
     65               allocate(fluxdat(Nfine))
     66            endif
     67
     68            do ifine=1,Nfine
     69               read(222,*) lsdat(ifine), fluxdat(ifine)
     70            enddo
     71            close(222)
     72
     73!$OMP END MASTER
     74!$OMP BARRIER
    6675      ENDIF
    67 
    6876
    6977      CALL interp_line(lsdat,fluxdat,Nfine,pls*180./pi,pflux,1)
Note: See TracChangeset for help on using the changeset viewer.