Ignore:
Timestamp:
Mar 24, 2016, 12:51:12 PM (9 years ago)
Author:
emillour
Message:

Generic GCM:

  • Some fixes/adjustments to run using OpenMP (in the physics, best practice is to always have "save" variables, this of course includes all module variables, as "threadprivate").

EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/planete_mod.F90

    r1315 r1520  
    22  IMPLICIT NONE
    33 
    4   REAL :: apoastr ! maximum star-planet distance (AU)
    5   REAL :: periastr ! minimum star-planet distance (AU)
    6   REAL :: year_day ! length of year (sols)
    7   REAL :: peri_day ! date of periastron (sols since N. spring)
    8   REAL :: obliquit ! Obliquity of the planet (deg)
    9   REAL :: nres ! tidal resonance ratio
    10   REAL :: z0 ! surface roughness (m)
    11   REAL :: lmixmin ! mixing length
    12   REAL :: emin_turb ! minimal energy
    13   REAL :: coefvis
    14   REAL :: coefir
    15   REAL :: timeperi
    16   REAL :: e_elips
    17   REAL :: p_elips
     4  REAL,SAVE :: apoastr ! maximum star-planet distance (AU)
     5  REAL,SAVE :: periastr ! minimum star-planet distance (AU)
     6  REAL,SAVE :: year_day ! length of year (sols)
     7  REAL,SAVE :: peri_day ! date of periastron (sols since N. spring)
     8  REAL,SAVE :: obliquit ! Obliquity of the planet (deg)
     9!$OMP THREADPRIVATE(apoastr,periastr,year_day,peri_day,obliquit)
     10  REAL,SAVE :: nres ! tidal resonance ratio
     11  REAL,SAVE :: z0 ! surface roughness (m)
     12  REAL,SAVE :: lmixmin ! mixing length
     13  REAL,SAVE :: emin_turb ! minimal energy
     14!$OMP THREADPRIVATE(nres,z0,lmixmin,emin_turb)
     15  REAL,SAVE :: coefvis
     16  REAL,SAVE :: coefir
     17  REAL,SAVE :: timeperi
     18  REAL,SAVE :: e_elips
     19  REAL,SAVE :: p_elips
     20!$OMP THREADPRIVATE(coefvis,coefir,timeperi,e_elips,p_elips)
    1821 
    19   REAL :: preff ! reference surface pressure (Pa)       !read by master
    20   REAL,ALLOCATABLE :: ap(:) ! hybrid coordinate at layer interface      !read by master
    21   REAL,ALLOCATABLE :: bp(:) ! hybrid coordinate at layer interface      !read by master
    22  
     22  REAL,SAVE :: preff ! reference surface pressure (Pa)  !read by master
     23  REAL,SAVE,ALLOCATABLE :: ap(:) ! hybrid coordinate at layer interface !read by master
     24  REAL,SAVE,ALLOCATABLE :: bp(:) ! hybrid coordinate at layer interface         !read by master
     25!$OMP THREADPRIVATE(preff,ap,bp)
     26
    2327  CONTAINS
    2428 
     
    3135  real,intent(in) :: bp_dyn(nlayer+1) ! hybrid coordinate at interfaces
    3236 
    33 !$OMP MASTER
    3437  allocate(ap(nlayer+1))
    3538  allocate(bp(nlayer+1))
     
    3841  ap(:)=ap_dyn(:)
    3942  bp(:)=bp_dyn(:)
    40 !$OMP END MASTER
    41 !$OMP BARRIER
    4243 
    4344  end subroutine ini_planete_mod
Note: See TracChangeset for help on using the changeset viewer.