Ignore:
Timestamp:
Jul 11, 2014, 4:15:06 PM (11 years ago)
Author:
milmd
Message:

LMDZ.GENERIC. OpenMP directives added in generic physic. When running in pure OpenMP or hybrid OpenMP/MPI, may have some bugs with condense_cloud and wstats routines.

Location:
trunk/LMDZ.GENERIC/libf/phystd
Files:
59 edited

Legend:

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

    r1308 r1315  
    6767
    6868      LOGICAL,SAVE :: firstcall=.true.
     69!$OMP THREADPRIVATE(firstcall)
    6970      REAL CBRT
    7071      EXTERNAL CBRT
     
    7273      INTEGER,SAVE :: i_co2ice=0      ! co2 ice
    7374      INTEGER,SAVE :: i_h2oice=0      ! water ice
     75!$OMP THREADPRIVATE(i_co2ice,i_h2oice)
    7476      CHARACTER(LEN=20) :: tracername ! to temporarily store text
    7577
  • trunk/LMDZ.GENERIC/libf/phystd/aeroptproperties.F90

    r1308 r1315  
    6767!     Pi!
    6868      REAL,SAVE :: pi
     69!$OMP THREADPRIVATE(pi)
    6970!     Variables used by the Gauss-Legendre integration:
    7071      INTEGER radius_id,gausind
     
    8788                      0.08327674160932,0.06267204829828, &
    8889                      0.04060142982019,0.01761400714091/
     90!$OMP THREADPRIVATE(radgaus,weightgaus)
    8991!     Indices
    9092      INTEGER :: i,j,k,l,m,iaer,idomain
     
    102104!     Grid used to remember which calculation is done
    103105      LOGICAL,SAVE :: checkgrid(refftabsize,nuefftabsize,naerkind,2) = .false.
     106!$OMP THREADPRIVATE(refftab,nuefftab,logvratgrid,vratgrid,checkgrid)
    104107!     Optical properties of the grid (VISIBLE)
    105108      REAL,SAVE :: qsqrefVISgrid(refftabsize,nuefftabsize,L_NSPECTV,naerkind)
     
    108111      REAL,SAVE :: omegVISgrid(refftabsize,nuefftabsize,L_NSPECTV,naerkind)
    109112      REAL,SAVE :: gVISgrid(refftabsize,nuefftabsize,L_NSPECTV,naerkind)
     113!$OMP THREADPRIVATE(qsqrefVISgrid,qextVISgrid,qscatVISgrid,omegVISgrid,gVISgrid)
    110114!     Optical properties of the grid (INFRARED)
    111115      REAL,SAVE :: qsqrefIRgrid(refftabsize,nuefftabsize,L_NSPECTI,naerkind)
     
    114118      REAL,SAVE :: omegIRgrid(refftabsize,nuefftabsize,L_NSPECTI,naerkind)
    115119      REAL,SAVE :: gIRgrid(refftabsize,nuefftabsize,L_NSPECTI,naerkind)
     120!$OMP THREADPRIVATE(qsqrefIRgrid,qextIRgrid,qscatIRgrid,omegIRgrid,gIRgrid)
    116121!     Optical properties of the grid (REFERENCE WAVELENGTHS)
    117122      REAL,SAVE :: qrefVISgrid(refftabsize,nuefftabsize,naerkind)
     
    121126      REAL,SAVE :: omegrefVISgrid(refftabsize,nuefftabsize,naerkind)
    122127      REAL,SAVE :: omegrefIRgrid(refftabsize,nuefftabsize,naerkind)
     128!$OMP THREADPRIVATE(qrefVISgrid,qscatrefVISgrid,qrefIRgrid,qscatrefIRgrid,omegrefVISgrid,&
     129        !$OMP omegrefIRgrid)
    123130!     Firstcall
    124131      LOGICAL,SAVE :: firstcall = .true.
     132!$OMP THREADPRIVATE(firstcall)
    125133!     Variables used by the Gauss-Legendre integration:
    126134      REAL,SAVE :: normd(refftabsize,nuefftabsize,naerkind,2)
    127135      REAL,SAVE :: dista(refftabsize,nuefftabsize,naerkind,2,ngau)
    128136      REAL,SAVE :: distb(refftabsize,nuefftabsize,naerkind,2,ngau)
     137!$OMP THREADPRIVATE(normd,dista,distb)
    129138
    130139      REAL,SAVE :: radGAUSa(ngau,naerkind,2)
    131140      REAL,SAVE :: radGAUSb(ngau,naerkind,2)
     141!$OMP THREADPRIVATE(radGAUSa,radGAUSb)
    132142
    133143      REAL,SAVE :: qsqrefVISa(L_NSPECTV,ngau,naerkind)
     
    141151      REAL,SAVE :: gVISa(L_NSPECTV,ngau,naerkind)
    142152      REAL,SAVE :: gVISb(L_NSPECTV,ngau,naerkind)
     153!$OMP THREADPRIVATE(qsqrefVISa,qrefVISa,qsqrefVISb,qrefVISb,omegVISa, &
     154        !$OMP omegrefVISa,omegVISb,omegrefVISb,gVISa,gVISb)
    143155
    144156      REAL,SAVE :: qsqrefIRa(L_NSPECTI,ngau,naerkind)
     
    152164      REAL,SAVE :: gIRa(L_NSPECTI,ngau,naerkind)
    153165      REAL,SAVE :: gIRb(L_NSPECTI,ngau,naerkind)
     166!$OMP THREADPRIVATE(qsqrefIRa,qrefIRa,qsqrefIRb,qrefIRb,omegIRa,omegrefIRa,&
     167        !$OMP omegIRb,omegrefIRb,gIRa,gIRb)
    154168
    155169      REAL :: radiusm
  • trunk/LMDZ.GENERIC/libf/phystd/aerosol_mod.F90

    r1151 r1315  
    1616! two-layer simple aerosol model
    1717      integer :: iaero_back2lay = 0
     18!$OMP THREADPRIVATE(iaero_co2,iaero_h2o,iaero_dust,iaero_h2so4,noaero,iaero_back2lay)
    1819     
    1920!==================================================================
  • trunk/LMDZ.GENERIC/libf/phystd/ave_stelspec.F90

    r863 r1315  
    3838      integer ifine
    3939
    40       real,allocatable :: lam(:),stel_f(:)
     40      real,allocatable,save :: lam(:),stel_f(:)         !read by master
    4141      real band,lamm,lamp
    4242      real dl
     
    116116         End Select
    117117
     118!$OMP MASTER
    118119         allocate(lam(Nfine),stel_f(Nfine))
    119120
     
    153154           close(111)
    154155         endif
     156!$OMP END MASTER
     157!$OMP BARRIER
    155158         
    156159         ! sum data by band
     
    173176         
    174177         STELLAR(1:L_NSPECTV)=STELLAR(1:L_NSPECTV)/sum(STELLAR(1:L_NSPECTV))
    175          deallocate(lam,stel_f)
    176          
     178!$OMP BARRIER
     179!$OMP MASTER
     180         if (allocated(lam)) deallocate(lam)
     181         if (allocated(stel_f)) deallocate(stel_f)
     182!$OMP END MASTER
     183!$OMP BARRIER         
    177184      endif
    178185
  • trunk/LMDZ.GENERIC/libf/phystd/bilinearbig.F90

    r919 r1315  
    1414      real*8 f2d_arr(nX,nY)
    1515      real*8,save :: x,y
     16!$OMP THREADPRIVATE(x,y)
    1617
    1718      integer strlen
  • trunk/LMDZ.GENERIC/libf/phystd/callcorrk.F90

    r1308 r1315  
    1212      use watercommon_h
    1313      use datafile_mod, only: datadir
    14       use ioipsl_getincom
     14!      use ioipsl_getincom
     15      use ioipsl_getincom_p
    1516      use gases_h
    1617      use radii_mod, only : su_aer_radii,co2_reffrad,h2o_reffrad,dust_reffrad,h2so4_reffrad,back2lay_reffrad
     
    9293      REAL,ALLOCATABLE,SAVE :: reffrad(:,:,:) ! aerosol effective radius (m)
    9394      REAL,ALLOCATABLE,SAVE :: nueffrad(:,:,:) ! aerosol effective variance
     95!$OMP THREADPRIVATE(reffrad,nueffrad)
    9496
    9597!-----------------------------------------------------------------------
     
    128130      logical global1d
    129131      save szangle,global1d
     132!$OMP THREADPRIVATE(szangle,global1d)
    130133      real*8 taugsurf(L_NSPECTV,L_NGAUSS-1)
    131134      real*8 taugsurfi(L_NSPECTI,L_NGAUSS-1)
     
    146149      real, dimension(:,:,:), save, allocatable :: QREFvis3d
    147150      real, dimension(:,:,:), save, allocatable :: QREFir3d
     151!$OMP THREADPRIVATE(QXVAER,QSVAER,GVAER,QXIAER,QSIAER,GIAER,QREFvis3d,QREFir3d)
    148152
    149153
     
    214218!     set up correlated k
    215219         print*, "callcorrk: Correlated-k data base folder:",trim(datadir)
    216          call getin("corrkdir",corrkdir)
     220         call getin_p("corrkdir",corrkdir)
    217221         print*, "corrkdir = ",corrkdir
    218222         write( tmp1, '(i3)' ) L_NSPECTI
     
    238242           PRINT*, 'Simulate global averaged conditions ?'
    239243           global1d = .false. ! default value
    240            call getin("global1d",global1d)
     244           call getin_p("global1d",global1d)
    241245           write(*,*) "global1d = ",global1d
    242246           ! Test of incompatibility:
     
    251255             PRINT *,'(assumed for averaged solar flux S/4)'
    252256             szangle=60.0  ! default value
    253              call getin("szangle",szangle)
     257             call getin_p("szangle",szangle)
    254258             write(*,*) "szangle = ",szangle
    255259           endif
     
    866870        IF( ALLOCATED( gasi ) ) DEALLOCATE( gasi )
    867871        IF( ALLOCATED( gasv ) ) DEALLOCATE( gasv )
     872!$OMP BARRIER
     873!$OMP MASTER
    868874        IF( ALLOCATED( pgasref ) ) DEALLOCATE( pgasref )
    869875        IF( ALLOCATED( tgasref ) ) DEALLOCATE( tgasref )
    870876        IF( ALLOCATED( wrefvar ) ) DEALLOCATE( wrefvar )
    871877        IF( ALLOCATED( pfgasref ) ) DEALLOCATE( pfgasref )
     878!$OMP END MASTER
     879!$OMP BARRIER   
    872880        IF ( ALLOCATED(reffrad)) DEALLOCATE(reffrad)
    873881        IF ( ALLOCATED(nueffrad)) DEALLOCATE(nueffrad)
  • trunk/LMDZ.GENERIC/libf/phystd/callkeys.h

    r1297 r1315  
    117117      real J2
    118118      real MassPlanet
     119     
     120      logical :: iscallphys=.false.!existence of callphys.def
  • trunk/LMDZ.GENERIC/libf/phystd/callsedim.F

    r1308 r1315  
    6969
    7070      LOGICAL,SAVE :: firstcall=.true.
     71!$OMP THREADPRIVATE(firstcall)
    7172
    7273c    ** un petit test de coherence
  • trunk/LMDZ.GENERIC/libf/phystd/comdiurn_h.F90

    r787 r1315  
    66       real, allocatable, dimension(:) :: sinlon, coslon, sinlat, coslat
    77       logical :: ldiurn
     8!$OMP THREADPRIVATE(sinlon,coslon,sinlat,coslat,ldiurn) !ldiurn is unused
    89
    910       end module comdiurn_h
  • trunk/LMDZ.GENERIC/libf/phystd/comgeomfi_h.F90

    r1295 r1315  
    66       REAL,ALLOCATABLE,DIMENSION(:) :: long,lati,area
    77       REAL :: totarea, totarea_planet
     8!$OMP THREADPRIVATE(long,lati,area,totarea)
    89
    910       end module comgeomfi_h
  • trunk/LMDZ.GENERIC/libf/phystd/comsaison_h.F90

    r787 r1315  
    99
    1010       real, allocatable, dimension(:) :: mu0,fract
     11!$OMP THREADPRIVATE(isaison,callsais,dist_star,declin,mu0,fract)
    1112
    1213       end module comsaison_h
  • trunk/LMDZ.GENERIC/libf/phystd/comsoil_h.F90

    r1297 r1315  
    1414       !     in physdem (or set via tabfi, or initialized in
    1515       !                 soil_settings.F)
     16!$OMP THREADPRIVATE(layer,mlayer,inertiedat,volcapa)
    1617
    1718contains
  • trunk/LMDZ.GENERIC/libf/phystd/condense_cloud.F90

    r1308 r1315  
    133133      REAL,SAVE :: cpice=1000.
    134134      REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: emisref
     135!$OMP THREADPRIVATE(latcond,ccond,cpice,emisref)
    135136
    136137      LOGICAL,SAVE :: firstcall=.true.
     138!$OMP THREADPRIVATE(firstcall)
    137139      REAL,EXTERNAL :: SSUM
    138140
     
    140142
    141143      INTEGER,SAVE :: i_co2ice=0      ! co2 ice
     144!$OMP THREADPRIVATE(i_co2ice)
    142145      CHARACTER(LEN=20) :: tracername ! to temporarily store text
    143146
  • trunk/LMDZ.GENERIC/libf/phystd/convadj.F

    r1308 r1315  
    6767      INTEGER iq,ico2
    6868      save ico2
     69!$OMP THREADPRIVATE(ico2)
    6970      REAL zq(ngrid,nlay,nq), zq2(ngrid,nlay,nq)
    7071      REAL zqm(nq),zqco2m
    7172      real m_co2, m_noco2, A , B
    7273      save A, B
     74!$OMP THREADPRIVATE(A,B)
    7375
    7476      real mtot1, mtot2 , mm1, mm2
     
    7779      save firstcall
    7880      data firstcall/.true./
     81!$OMP THREADPRIVATE(firstcall)
    7982
    8083!     for conservation test
  • trunk/LMDZ.GENERIC/libf/phystd/dimphy.F90

    r1216 r1315  
    22 
    33  INTEGER,SAVE :: klon   ! number of atmospheric columns (for this OpenMP subgrid)
    4   INTEGER,SAVE :: klev   ! number of atmospheric layers
    5   INTEGER,SAVE :: klevp1 ! number of atmospheric layers+1
    6   INTEGER,SAVE :: klevm1 ! number of atmospheric layers-1
     4  INTEGER,SAVE :: klev   ! number of atmospheric layers, read by master
     5  INTEGER,SAVE :: klevp1 ! number of atmospheric layers+1, read by master
     6  INTEGER,SAVE :: klevm1 ! number of atmospheric layers-1, read by master
    77!  INTEGER,SAVE :: kflev
    88
  • trunk/LMDZ.GENERIC/libf/phystd/gases_h.F90

    r869 r1315  
    1414      integer :: ngasmx
    1515      integer :: vgas
    16       character*20,allocatable,DIMENSION(:) :: gnom ! name of the gas
     16      character*20,allocatable,DIMENSION(:) :: gnom ! name of the gas, read by master
    1717      real,allocatable,DIMENSION(:) :: gfrac
    1818
     
    3131      integer :: igas_C2H2
    3232      integer :: igas_C2H6
     33!!$OMP THREADPRIVATE(ngasmx,vgas,gnom,gfrac,&
     34!       !$OMP igas_H2,igas_He,igas_H2O,igas_CO2,igas_CO,igas_N2,&
     35!       !$OMP igas_O2,igas_SO2,igas_H2S,igas_CH4,igas_NH3,igas_C2H2,igas_C2H6)
    3336
    3437      end module gases_h
  • trunk/LMDZ.GENERIC/libf/phystd/hydrol.F90

    r1308 r1315  
    44     pctsrf_sic,sea_ice)
    55
    6   use ioipsl_getincom
     6!  use ioipsl_getincom
     7  use ioipsl_getincom_p
    78  use watercommon_h, only: T_h2O_ice_liq, RLFTT, rhowater, mx_eau_sol
    89  USE surfdat_h
     
    5051      real albedoice
    5152      save albedoice
     53!$OMP THREADPRIVATE(albedoice)
    5254
    5355      real snowlayer
     
    5961      logical,save :: activerunoff ! enable simple runoff scheme?
    6062      logical,save :: oceanalbvary ! ocean albedo varies with the diurnal cycle?
     63!$OMP THREADPRIVATE(oceanbulkavg,activerunoff,oceanalbvary)
    6164
    6265!     Arguments
     
    6669      real totalrunoff, tsea, oceanarea
    6770      save oceanarea
     71!$OMP THREADPRIVATE(runoff,oceanarea)
    6872
    6973      real ptimestep
     
    96100
    97101      integer, save :: ivap, iliq, iice
     102!$OMP THREADPRIVATE(ivap,iliq,iice)
    98103
    99104      logical, save :: firstcall
     105!$OMP THREADPRIVATE(firstcall)
    100106
    101107      data firstcall /.true./
     
    108114         write(*,*)"Activate runnoff into oceans?"
    109115         activerunoff=.false.
    110          call getin("activerunoff",activerunoff)
     116         call getin_p("activerunoff",activerunoff)
    111117         write(*,*)" activerunoff = ",activerunoff
    112118         
  • trunk/LMDZ.GENERIC/libf/phystd/inifis.F

    r1308 r1315  
    5050      use datafile_mod, only: datadir
    5151! to use  'getin'
    52       USE ioipsl_getincom
     52!      USE ioipsl_getincom
     53      USE ioipsl_getincom_p
    5354      IMPLICIT NONE
    5455!#include "dimensions.h"
     
    7980      real psurf,pN2 ! added by RW for Gliese 581d N2+CO2
    8081
     82!$OMP MASTER
    8183      rad=prad
    8284      daysec=pdaysec
     
    8991      avocado = 6.02214179e23   ! added by RW
    9092
     93!$OMP END MASTER
     94!$OMP BARRIER
    9195
    9296      ! read in 'ecritphy' (frequency of calls to physics, in dynamical steps)
    9397      ! (also done in dyn3d/defrun_new but not in LMDZ.COMMON)
    94       call getin("ecritphy",ecritphy)
     98      call getin_p("ecritphy",ecritphy)
    9599
    96100! --------------------------------------------------------------
     
    98102! --------------------------------------------------------------
    99103     
     104!$OMP MASTER     
    100105      ! check that 'callphys.def' file is around
    101106      OPEN(99,file='callphys.def',status='old',form='formatted'
    102107     &     ,iostat=ierr)
    103108      CLOSE(99)
     109      IF(ierr.EQ.0) iscallphys=.true. !iscallphys initialised as false in callkeys.h
     110!$OMP END MASTER
     111!$OMP BARRIER
    104112     
    105       IF(ierr.EQ.0) THEN
     113!!!      IF(ierr.EQ.0) THEN
     114      IF(iscallphys) THEN
    106115         PRINT*
    107116         PRINT*
     
    112121         write(*,*) "Directory where external input files are:"
    113122         ! default 'datadir' is set in "datadir_mod"
    114          call getin("datadir",datadir) ! default path
     123         call getin_p("datadir",datadir) ! default path
    115124         write(*,*) " datadir = ",trim(datadir)
    116125
    117126         write(*,*) "Run with or without tracer transport ?"
    118127         tracer=.false. ! default value
    119          call getin("tracer",tracer)
     128         call getin_p("tracer",tracer)
    120129         write(*,*) " tracer = ",tracer
    121130
     
    123132     &      " due to tracer evaporation/condensation?"
    124133         mass_redistrib=.false. ! default value
    125          call getin("mass_redistrib",mass_redistrib)
     134         call getin_p("mass_redistrib",mass_redistrib)
    126135         write(*,*) " mass_redistrib = ",mass_redistrib
    127136
     
    129138         write(*,*) "(if diurnal=false, diurnal averaged solar heating)"
    130139         diurnal=.true. ! default value
    131          call getin("diurnal",diurnal)
     140         call getin_p("diurnal",diurnal)
    132141         write(*,*) " diurnal = ",diurnal
    133142
     
    136145     &   "set in 'start'"
    137146         season=.true. ! default value
    138          call getin("season",season)
     147         call getin_p("season",season)
    139148         write(*,*) " season = ",season
    140149
    141150         write(*,*) "Tidally resonant rotation ?"
    142151         tlocked=.false. ! default value
    143          call getin("tlocked",tlocked)
     152         call getin_p("tlocked",tlocked)
    144153         write(*,*) "tlocked = ",tlocked
    145154
    146155         write(*,*) "Saturn ring shadowing ?"
    147156         rings_shadow = .false.
    148          call getin("rings_shadow", rings_shadow)
     157         call getin_p("rings_shadow", rings_shadow)
    149158         write(*,*) "rings_shadow = ", rings_shadow
    150159         
    151160         write(*,*) "Compute latitude-dependent gravity field?"
    152161         oblate = .false.
    153          call getin("oblate", oblate)
     162         call getin_p("oblate", oblate)
    154163         write(*,*) "oblate = ", oblate
    155164
    156165         write(*,*) "Flattening of the planet (a-b)/a "
    157166         flatten = 0.0
    158          call getin("flatten", flatten)
     167         call getin_p("flatten", flatten)
    159168         write(*,*) "flatten = ", flatten
    160169         
     
    162171         write(*,*) "Needed if oblate=.true.: J2"
    163172         J2 = 0.0
    164          call getin("J2", J2)
     173         call getin_p("J2", J2)
    165174         write(*,*) "J2 = ", J2
    166175         
    167176         write(*,*) "Needed if oblate=.true.: Planet mass (*1e24 kg)"
    168177         MassPlanet = 0.0
    169          call getin("MassPlanet", MassPlanet)
     178         call getin_p("MassPlanet", MassPlanet)
    170179         write(*,*) "MassPlanet = ", MassPlanet         
    171180
    172181         write(*,*) "Needed if oblate=.true.: Planet mean radius (m)"
    173182         Rmean = 0.0
    174          call getin("Rmean", Rmean)
     183         call getin_p("Rmean", Rmean)
    175184         write(*,*) "Rmean = ", Rmean
    176185         
     
    184193         write(*,*) "Tidal resonance ratio ?"
    185194         nres=0          ! default value
    186          call getin("nres",nres)
     195         call getin_p("nres",nres)
    187196         write(*,*) "nres = ",nres
    188197
    189198         write(*,*) "Write some extra output to the screen ?"
    190199         lwrite=.false. ! default value
    191          call getin("lwrite",lwrite)
     200         call getin_p("lwrite",lwrite)
    192201         write(*,*) " lwrite = ",lwrite
    193202
    194203         write(*,*) "Save statistics in file stats.nc ?"
    195204         callstats=.true. ! default value
    196          call getin("callstats",callstats)
     205         call getin_p("callstats",callstats)
    197206         write(*,*) " callstats = ",callstats
    198207
    199208         write(*,*) "Test energy conservation of model physics ?"
    200209         enertest=.false. ! default value
    201          call getin("enertest",enertest)
     210         call getin_p("enertest",enertest)
    202211         write(*,*) " enertest = ",enertest
    203212
    204213         write(*,*) "Check to see if cpp values used match gases.def ?"
    205214         check_cpp_match=.true. ! default value
    206          call getin("check_cpp_match",check_cpp_match)
     215         call getin_p("check_cpp_match",check_cpp_match)
    207216         write(*,*) " check_cpp_match = ",check_cpp_match
    208217
    209218         write(*,*) "call radiative transfer ?"
    210219         callrad=.true. ! default value
    211          call getin("callrad",callrad)
     220         call getin_p("callrad",callrad)
    212221         write(*,*) " callrad = ",callrad
    213222
    214223         write(*,*) "call correlated-k radiative transfer ?"
    215224         corrk=.true. ! default value
    216          call getin("corrk",corrk)
     225         call getin_p("corrk",corrk)
    217226         write(*,*) " corrk = ",corrk
    218227
    219228         write(*,*) "prohibit calculations outside corrk T grid?"
    220229         strictboundcorrk=.true. ! default value
    221          call getin("strictboundcorrk",strictboundcorrk)
     230         call getin_p("strictboundcorrk",strictboundcorrk)
    222231         write(*,*) "strictboundcorrk = ",strictboundcorrk
    223232
     
    225234     &              "(matters only if callrad=T)"
    226235         callgasvis=.false. ! default value
    227          call getin("callgasvis",callgasvis)
     236         call getin_p("callgasvis",callgasvis)
    228237         write(*,*) " callgasvis = ",callgasvis
    229238       
     
    231240     &              "(matters only if callrad=T)"
    232241         continuum=.true. ! default value
    233          call getin("continuum",continuum)
     242         call getin_p("continuum",continuum)
    234243         write(*,*) " continuum = ",continuum
    235244
    236245         write(*,*) "use analytic function for H2O continuum ?"
    237246         H2Ocont_simple=.false. ! default value
    238          call getin("H2Ocont_simple",H2Ocont_simple)
     247         call getin_p("H2Ocont_simple",H2Ocont_simple)
    239248         write(*,*) " H2Ocont_simple = ",H2Ocont_simple
    240249 
    241250         write(*,*) "call turbulent vertical diffusion ?"
    242251         calldifv=.true. ! default value
    243          call getin("calldifv",calldifv)
     252         call getin_p("calldifv",calldifv)
    244253         write(*,*) " calldifv = ",calldifv
    245254
    246255         write(*,*) "use turbdiff instead of vdifc ?"
    247256         UseTurbDiff=.true. ! default value
    248          call getin("UseTurbDiff",UseTurbDiff)
     257         call getin_p("UseTurbDiff",UseTurbDiff)
    249258         write(*,*) " UseTurbDiff = ",UseTurbDiff
    250259
    251260         write(*,*) "call convective adjustment ?"
    252261         calladj=.true. ! default value
    253          call getin("calladj",calladj)
     262         call getin_p("calladj",calladj)
    254263         write(*,*) " calladj = ",calladj
    255264
    256265         write(*,*) "call CO2 condensation ?"
    257266         co2cond=.false. ! default value
    258          call getin("co2cond",co2cond)
     267         call getin_p("co2cond",co2cond)
    259268         write(*,*) " co2cond = ",co2cond
    260269! Test of incompatibility
     
    266275         write(*,*) "CO2 supersaturation level ?"
    267276         co2supsat=1.0 ! default value
    268          call getin("co2supsat",co2supsat)
     277         call getin_p("co2supsat",co2supsat)
    269278         write(*,*) " co2supsat = ",co2supsat
    270279
    271280         write(*,*) "Radiative timescale for Newtonian cooling ?"
    272281         tau_relax=30. ! default value
    273          call getin("tau_relax",tau_relax)
     282         call getin_p("tau_relax",tau_relax)
    274283         write(*,*) " tau_relax = ",tau_relax
    275284         tau_relax=tau_relax*24*3600 ! convert Earth days --> seconds
     
    277286         write(*,*)"call thermal conduction in the soil ?"
    278287         callsoil=.true. ! default value
    279          call getin("callsoil",callsoil)
     288         call getin_p("callsoil",callsoil)
    280289         write(*,*) " callsoil = ",callsoil
    281290         
     
    283292     &             " physical timestep"
    284293         iradia=1 ! default value
    285          call getin("iradia",iradia)
     294         call getin_p("iradia",iradia)
    286295         write(*,*)" iradia = ",iradia
    287296       
    288297         write(*,*)"Rayleigh scattering ?"
    289298         rayleigh=.false.
    290          call getin("rayleigh",rayleigh)
     299         call getin_p("rayleigh",rayleigh)
    291300         write(*,*)" rayleigh = ",rayleigh
    292301
    293302         write(*,*) "Use blackbody for stellar spectrum ?"
    294303         stelbbody=.false. ! default value
    295          call getin("stelbbody",stelbbody)
     304         call getin_p("stelbbody",stelbbody)
    296305         write(*,*) " stelbbody = ",stelbbody
    297306
    298307         write(*,*) "Stellar blackbody temperature ?"
    299308         stelTbb=5800.0 ! default value
    300          call getin("stelTbb",stelTbb)
     309         call getin_p("stelTbb",stelTbb)
    301310         write(*,*) " stelTbb = ",stelTbb
    302311
    303312         write(*,*)"Output mean OLR in 1D?"
    304313         meanOLR=.false.
    305          call getin("meanOLR",meanOLR)
     314         call getin_p("meanOLR",meanOLR)
    306315         write(*,*)" meanOLR = ",meanOLR
    307316
    308317         write(*,*)"Output spectral OLR in 3D?"
    309318         specOLR=.false.
    310          call getin("specOLR",specOLR)
     319         call getin_p("specOLR",specOLR)
    311320         write(*,*)" specOLR = ",specOLR
    312321
    313322         write(*,*)"Operate in kastprof mode?"
    314323         kastprof=.false.
    315          call getin("kastprof",kastprof)
     324         call getin_p("kastprof",kastprof)
    316325         write(*,*)" kastprof = ",kastprof
    317326
    318327         write(*,*)"Uniform absorption in radiative transfer?"
    319328         graybody=.false.
    320          call getin("graybody",graybody)
     329         call getin_p("graybody",graybody)
    321330         write(*,*)" graybody = ",graybody
    322331
     
    324333         write(*,*) "Use slab-ocean ?"
    325334         ok_slab_ocean=.false.         ! default value
    326          call getin("ok_slab_ocean",ok_slab_ocean)
     335         call getin_p("ok_slab_ocean",ok_slab_ocean)
    327336         write(*,*) "ok_slab_ocean = ",ok_slab_ocean
    328337
    329338         write(*,*) "Use slab-sea-ice ?"
    330339         ok_slab_sic=.true.         ! default value
    331          call getin("ok_slab_sic",ok_slab_sic)
     340         call getin_p("ok_slab_sic",ok_slab_sic)
    332341         write(*,*) "ok_slab_sic = ",ok_slab_sic
    333342
    334343         write(*,*) "Use heat transport for the ocean ?"
    335344         ok_slab_heat_transp=.true.   ! default value
    336          call getin("ok_slab_heat_transp",ok_slab_heat_transp)
     345         call getin_p("ok_slab_heat_transp",ok_slab_heat_transp)
    337346         write(*,*) "ok_slab_heat_transp = ",ok_slab_heat_transp
    338347
     
    348357         write(*,*)"Stratospheric temperature for kastprof mode?"
    349358         Tstrat=167.0
    350          call getin("Tstrat",Tstrat)
     359         call getin_p("Tstrat",Tstrat)
    351360         write(*,*)" Tstrat = ",Tstrat
    352361
    353362         write(*,*)"Remove lower boundary?"
    354363         nosurf=.false.
    355          call getin("nosurf",nosurf)
     364         call getin_p("nosurf",nosurf)
    356365         write(*,*)" nosurf = ",nosurf
    357366
     
    366375     .             "... matters only if callsoil=F"
    367376         intheat=0.
    368          call getin("intheat",intheat)
     377         call getin_p("intheat",intheat)
    369378         write(*,*)" intheat = ",intheat
    370379
    371380         write(*,*)"Use Newtonian cooling for radiative transfer?"
    372381         newtonian=.false.
    373          call getin("newtonian",newtonian)
     382         call getin_p("newtonian",newtonian)
    374383         write(*,*)" newtonian = ",newtonian
    375384
     
    390399         write(*,*)"Test physics timescale in 1D?"
    391400         testradtimes=.false.
    392          call getin("testradtimes",testradtimes)
     401         call getin_p("testradtimes",testradtimes)
    393402         write(*,*)" testradtimes = ",testradtimes
    394403
     
    402411         write(*,*)"Default planetary temperature?"
    403412         tplanet=215.0
    404          call getin("tplanet",tplanet)
     413         call getin_p("tplanet",tplanet)
    405414         write(*,*)" tplanet = ",tplanet
    406415
    407416         write(*,*)"Which star?"
    408417         startype=1 ! default value = Sol
    409          call getin("startype",startype)
     418         call getin_p("startype",startype)
    410419         write(*,*)" startype = ",startype
    411420
    412421         write(*,*)"Value of stellar flux at 1 AU?"
    413422         Fat1AU=1356.0 ! default value = Sol today
    414          call getin("Fat1AU",Fat1AU)
     423         call getin_p("Fat1AU",Fat1AU)
    415424         write(*,*)" Fat1AU = ",Fat1AU
    416425
     
    420429         write(*,*)"Varying H2O cloud fraction?"
    421430         CLFvarying=.false.     ! default value
    422          call getin("CLFvarying",CLFvarying)
     431         call getin_p("CLFvarying",CLFvarying)
    423432         write(*,*)" CLFvarying = ",CLFvarying
    424433
    425434         write(*,*)"Value of fixed H2O cloud fraction?"
    426435         CLFfixval=1.0                ! default value
    427          call getin("CLFfixval",CLFfixval)
     436         call getin_p("CLFfixval",CLFfixval)
    428437         write(*,*)" CLFfixval = ",CLFfixval
    429438
    430439         write(*,*)"fixed radii for Cloud particles?"
    431440         radfixed=.false. ! default value
    432          call getin("radfixed",radfixed)
     441         call getin_p("radfixed",radfixed)
    433442         write(*,*)" radfixed = ",radfixed
    434443
     
    439448         write(*,*)"Number mixing ratio of CO2 ice particles:"
    440449         Nmix_co2=1.e6 ! default value
    441          call getin("Nmix_co2",Nmix_co2)
     450         call getin_p("Nmix_co2",Nmix_co2)
    442451         write(*,*)" Nmix_co2 = ",Nmix_co2
    443452
    444453!         write(*,*)"Number of radiatively active aerosols:"
    445454!         naerkind=0. ! default value
    446 !         call getin("naerkind",naerkind)
     455!         call getin_p("naerkind",naerkind)
    447456!         write(*,*)" naerkind = ",naerkind
    448457
    449458         write(*,*)"Opacity of dust (if used):"
    450459         dusttau=0. ! default value
    451          call getin("dusttau",dusttau)
     460         call getin_p("dusttau",dusttau)
    452461         write(*,*)" dusttau = ",dusttau
    453462
    454463         write(*,*)"Radiatively active CO2 aerosols?"
    455464         aeroco2=.false.     ! default value
    456          call getin("aeroco2",aeroco2)
     465         call getin_p("aeroco2",aeroco2)
    457466         write(*,*)" aeroco2 = ",aeroco2
    458467
    459468         write(*,*)"Fixed CO2 aerosol distribution?"
    460469         aerofixco2=.false.     ! default value
    461          call getin("aerofixco2",aerofixco2)
     470         call getin_p("aerofixco2",aerofixco2)
    462471         write(*,*)" aerofixco2 = ",aerofixco2
    463472
    464473         write(*,*)"Radiatively active water ice?"
    465474         aeroh2o=.false.     ! default value
    466          call getin("aeroh2o",aeroh2o)
     475         call getin_p("aeroh2o",aeroh2o)
    467476         write(*,*)" aeroh2o = ",aeroh2o
    468477
    469478         write(*,*)"Fixed H2O aerosol distribution?"
    470479         aerofixh2o=.false.     ! default value
    471          call getin("aerofixh2o",aerofixh2o)
     480         call getin_p("aerofixh2o",aerofixh2o)
    472481         write(*,*)" aerofixh2o = ",aerofixh2o
    473482
    474483         write(*,*)"Radiatively active sulfuric acid aersols?"
    475484         aeroh2so4=.false.     ! default value
    476          call getin("aeroh2so4",aeroh2so4)
     485         call getin_p("aeroh2so4",aeroh2so4)
    477486         write(*,*)" aeroh2so4 = ",aeroh2so4
    478487         
     
    481490         write(*,*)"Radiatively active two-layer aersols?"
    482491         aeroback2lay=.false.     ! default value
    483          call getin("aeroback2lay",aeroback2lay)
     492         call getin_p("aeroback2lay",aeroback2lay)
    484493         write(*,*)" aeroback2lay = ",aeroback2lay
    485494
     
    487496     &              "in the tropospheric layer (visible)"
    488497         obs_tau_col_tropo=8.D0
    489          call getin("obs_tau_col_tropo",obs_tau_col_tropo)
     498         call getin_p("obs_tau_col_tropo",obs_tau_col_tropo)
    490499         write(*,*)" obs_tau_col_tropo = ",obs_tau_col_tropo
    491500
     
    493502     &              "in the stratospheric layer (visible)"
    494503         obs_tau_col_strato=0.08D0
    495          call getin("obs_tau_col_strato",obs_tau_col_strato)
     504         call getin_p("obs_tau_col_strato",obs_tau_col_strato)
    496505         write(*,*)" obs_tau_col_strato = ",obs_tau_col_strato
    497506
    498507         write(*,*)"TWOLAY AEROSOL: pres_bottom_tropo? in pa"
    499508         pres_bottom_tropo=66000.0
    500          call getin("pres_bottom_tropo",pres_bottom_tropo)
     509         call getin_p("pres_bottom_tropo",pres_bottom_tropo)
    501510         write(*,*)" pres_bottom_tropo = ",pres_bottom_tropo
    502511
    503512         write(*,*)"TWOLAY AEROSOL: pres_top_tropo? in pa"
    504513         pres_top_tropo=18000.0
    505          call getin("pres_top_tropo",pres_top_tropo)
     514         call getin_p("pres_top_tropo",pres_top_tropo)
    506515         write(*,*)" pres_top_tropo = ",pres_top_tropo
    507516
    508517         write(*,*)"TWOLAY AEROSOL: pres_bottom_strato? in pa"
    509518         pres_bottom_strato=2000.0
    510          call getin("pres_bottom_strato",pres_bottom_strato)
     519         call getin_p("pres_bottom_strato",pres_bottom_strato)
    511520         write(*,*)" pres_bottom_strato = ",pres_bottom_strato
    512521
    513522         write(*,*)"TWOLAY AEROSOL: pres_top_strato? in pa"
    514523         pres_top_strato=100.0
    515          call getin("pres_top_strato",pres_top_strato)
     524         call getin_p("pres_top_strato",pres_top_strato)
    516525         write(*,*)" pres_top_strato = ",pres_top_strato
    517526
     
    519528     &              "tropospheric layer, in meters"
    520529         size_tropo=2.e-6
    521          call getin("size_tropo",size_tropo)
     530         call getin_p("size_tropo",size_tropo)
    522531         write(*,*)" size_tropo = ",size_tropo
    523532
     
    525534     &              "stratospheric layer, in meters"
    526535         size_strato=1.e-7
    527          call getin("size_strato",size_strato)
     536         call getin_p("size_strato",size_strato)
    528537         write(*,*)" size_strato = ",size_strato
    529538
     
    532541         write(*,*)"Cloud pressure level (with kastprof only):"
    533542         cloudlvl=0. ! default value
    534          call getin("cloudlvl",cloudlvl)
     543         call getin_p("cloudlvl",cloudlvl)
    535544         write(*,*)" cloudlvl = ",cloudlvl
    536545
     
    538547         Tstrat=167.0
    539548         varactive=.false.
    540          call getin("varactive",varactive)
     549         call getin_p("varactive",varactive)
    541550         write(*,*)" varactive = ",varactive
    542551
    543552         write(*,*)"Is the variable gas species distribution set?"
    544553         varfixed=.false.
    545          call getin("varfixed",varfixed)
     554         call getin_p("varfixed",varfixed)
    546555         write(*,*)" varfixed = ",varfixed
    547556
    548557         write(*,*)"What is the saturation % of the variable species?"
    549558         satval=0.8
    550          call getin("satval",satval)
     559         call getin_p("satval",satval)
    551560         write(*,*)" satval = ",satval
    552561
     
    561570         write(*,*) "Gravitationnal sedimentation ?"
    562571         sedimentation=.false. ! default value
    563          call getin("sedimentation",sedimentation)
     572         call getin_p("sedimentation",sedimentation)
    564573         write(*,*) " sedimentation = ",sedimentation
    565574
    566575         write(*,*) "Compute water cycle ?"
    567576         water=.false. ! default value
    568          call getin("water",water)
     577         call getin_p("water",water)
    569578         write(*,*) " water = ",water
    570579         
     
    578587         write(*,*) "Include water condensation ?"
    579588         watercond=.false. ! default value
    580          call getin("watercond",watercond)
     589         call getin_p("watercond",watercond)
    581590         write(*,*) " watercond = ",watercond
    582591
     
    590599         write(*,*) "Include water precipitation ?"
    591600         waterrain=.false. ! default value
    592          call getin("waterrain",waterrain)
     601         call getin_p("waterrain",waterrain)
    593602         write(*,*) " waterrain = ",waterrain
    594603
    595604         write(*,*) "Include surface hydrology ?"
    596605         hydrology=.false. ! default value
    597          call getin("hydrology",hydrology)
     606         call getin_p("hydrology",hydrology)
    598607         write(*,*) " hydrology = ",hydrology
    599608
    600609         write(*,*) "Evolve surface water sources ?"
    601610         sourceevol=.false. ! default value
    602          call getin("sourceevol",sourceevol)
     611         call getin_p("sourceevol",sourceevol)
    603612         write(*,*) " sourceevol = ",sourceevol
    604613
    605614         write(*,*) "Ice evolution timestep ?"
    606615         icetstep=100.0 ! default value
    607          call getin("icetstep",icetstep)
     616         call getin_p("icetstep",icetstep)
    608617         write(*,*) " icetstep = ",icetstep
    609618
    610619         write(*,*) "Snow albedo ?"
    611620         albedosnow=0.5         ! default value
    612          call getin("albedosnow",albedosnow)
     621         call getin_p("albedosnow",albedosnow)
    613622         write(*,*) " albedosnow = ",albedosnow
    614623
    615624         write(*,*) "Maximum ice thickness ?"
    616625         maxicethick=2.0         ! default value
    617          call getin("maxicethick",maxicethick)
     626         call getin_p("maxicethick",maxicethick)
    618627         write(*,*) " maxicethick = ",maxicethick
    619628
    620629         write(*,*) "Freezing point of seawater ?"
    621630         Tsaldiff=-1.8          ! default value
    622          call getin("Tsaldiff",Tsaldiff)
     631         call getin_p("Tsaldiff",Tsaldiff)
    623632         write(*,*) " Tsaldiff = ",Tsaldiff
    624633
    625634         write(*,*) "Does user want to force cpp and mugaz?"
    626635         force_cpp=.false. ! default value
    627          call getin("force_cpp",force_cpp)
     636         call getin_p("force_cpp",force_cpp)
    628637         write(*,*) " force_cpp = ",force_cpp
    629638
     
    631640           mugaz = -99999.
    632641           PRINT *,'MEAN MOLECULAR MASS in g mol-1 ?'
    633            call getin("mugaz",mugaz)
     642           call getin_p("mugaz",mugaz)
    634643           IF (mugaz.eq.-99999.) THEN
    635644               PRINT *, "mugaz must be set if force_cpp = T"
     
    640649           cpp = -99999.
    641650           PRINT *,'SPECIFIC HEAT CAPACITY in J K-1 kg-1 ?'
    642            call getin("cpp",cpp)
     651           call getin_p("cpp",cpp)
    643652           IF (cpp.eq.-99999.) THEN
    644653               PRINT *, "cpp must be set if force_cpp = T"
     
    702711      ENDDO
    703712
     713!$OMP MASTER
    704714      pi=2.*asin(1.) ! NB: pi is a common in comcstfi.h
     715!$OMP END MASTER
     716!$OMP BARRIER
    705717
    706718      ! allocate "comsoil_h" arrays
  • trunk/LMDZ.GENERIC/libf/phystd/iniphysiq.F90

    r1308 r1315  
    6060ENDIF
    6161
    62 !$OMP PARALLEL PRIVATE(ibegin,iend)
    63 !$OMP+        SHARED(parea,pcu,pcv,plon,plat)
     62!$OMP PARALLEL PRIVATE(ibegin,iend) &
     63        !$OMP SHARED(parea,pcu,pcv,plon,plat)
    6464     
    6565offset=klon_mpi_begin-1
  • trunk/LMDZ.GENERIC/libf/phystd/interpolateH2H2.F90

    r878 r1315  
    4343      logical firstcall
    4444
    45       save wn_arr, temp_arr, abs_arr
     45      save wn_arr, temp_arr, abs_arr !read by master
    4646
    4747      character*100 dt_file
     
    7272         dt_file=TRIM(datadir)//'/continuum_data/H2-H2_norm_2011.cia'
    7373
     74!$OMP MASTER
    7475         open(33,file=dt_file,form='formatted',status='old',iostat=ios)
    7576         if (ios.ne.0) then        ! file not found
     
    102103         endif
    103104         close(33)
     105!$OMP END MASTER
     106!$OMP BARRIER
    104107
    105108         print*,'interpolateH2H2: At wavenumber ',wn,' cm^-1'
  • trunk/LMDZ.GENERIC/libf/phystd/interpolateH2He.F90

    r878 r1315  
    4545      logical firstcall
    4646
    47       save wn_arr, temp_arr, abs_arr
     47      save wn_arr, temp_arr, abs_arr !read by master
    4848
    4949      character*100 dt_file
     
    7373!     1.1 Open the ASCII files
    7474         dt_file=TRIM(datadir)//'/continuum_data/H2-He_norm_2011.cia'
    75 
     75         
     76!$OMP MASTER
    7677         open(33,file=dt_file,form='formatted',status='old',iostat=ios)
    7778         if (ios.ne.0) then        ! file not found
     
    104105         endif
    105106         close(33)
     107!$OMP END MASTER
     108!$OMP BARRIER
    106109
    107110         print*,'interpolateH2He: At wavenumber ',wn,' cm^-1'
  • trunk/LMDZ.GENERIC/libf/phystd/interpolateH2Ocont_CKD.F90

    r878 r1315  
    4343      logical firstcall
    4444
    45       save wn_arr, temp_arr, abs_arrS, abs_arrF
     45      save wn_arr, temp_arr, abs_arrS, abs_arrF !read by master
    4646
    4747      character*100 dt_file
     
    5757!     1.1 Open the ASCII files
    5858
     59!$OMP MASTER
    5960         ! nu array
    6061         dt_file=TRIM(datadir)//'/continuum_data/H2O_CONT_NU.dat'
     
    129130         print*,'   H2O pressure ',presS,' Pa'
    130131         print*,'   air pressure ',presF,' Pa'
     132!$OMP END MASTER
     133!$OMP BARRIER
    131134         
    132135      endif
  • trunk/LMDZ.GENERIC/libf/phystd/interpolateN2H2.F90

    r879 r1315  
    4444  logical firstcall
    4545
    46   save wn_arr, temp_arr, abs_arr
     46  save wn_arr, temp_arr, abs_arr !read by master
    4747
    4848  character*100 dt_file
     
    7272     dt_file=TRIM(datadir)//'/continuum_data/N2-H2_2011.cia'
    7373
     74!$OMP MASTER
    7475     open(33,file=dt_file,form='formatted',status='old',iostat=ios)
    7576     if (ios.ne.0) then        ! file not found
     
    102103     endif
    103104     close(33)
     105!$OMP END MASTER
     106!$OMP BARRIER
    104107
    105108     print*,'interpolateN2H2: At wavenumber ',wn,' cm^-1'
  • trunk/LMDZ.GENERIC/libf/phystd/interpolateN2N2.F90

    r878 r1315  
    4343  logical firstcall
    4444
    45   save wn_arr, temp_arr, abs_arr
     45  save wn_arr, temp_arr, abs_arr !read by master
    4646
    4747  character*100 dt_file
     
    7070     dt_file=TRIM(datadir)//'/continuum_data/N2-N2_2011.cia'
    7171
     72!$OMP MASTER
    7273     open(33,file=dt_file,form='formatted',status='old',iostat=ios)
    7374     if (ios.ne.0) then        ! file not found
     
    100101     endif
    101102     close(33)
     103!$OMP END MASTER
     104!$OMP BARRIER
    102105
    103106     print*,'interpolateN2N2: At wavenumber ',wn,' cm^-1'
  • trunk/LMDZ.GENERIC/libf/phystd/iostart.F90

    r1297 r1315  
    55    INTEGER,SAVE :: nid_start ! NetCDF file identifier for startfi.nc file
    66    INTEGER,SAVE :: nid_restart ! NetCDF file identifier for restartfi.nc file
     7!$OMP THREADPRIVATE(nid_start,nid_restart)
    78   
    89    ! restartfi.nc file dimension identifiers: (see open_restartphy())
     
    1617    INTEGER,SAVE :: idim8 ! "ocean_layers" dimension
    1718    INTEGER,SAVE :: timeindex ! current time index (for time-dependent fields)
     19!$OMP THREADPRIVATE(idim1,idim2,idim3,idim4,idim5,idim6,idim7,timeindex)
    1820    INTEGER,PARAMETER :: length=100 ! size of tab_cntrl array
    1921   
     
    473475    INTEGER                     :: ierr
    474476    LOGICAL,SAVE :: already_created=.false.
     477!$OMP THREADPRIVATE(already_created)
    475478   
    476479    IF (is_master) THEN
     
    956959     INTEGER :: idim1d
    957960     logical,save :: firsttime=.true.
     961!$OMP THREADPRIVATE(firsttime)
    958962         
    959963    IF (is_master) THEN
  • trunk/LMDZ.GENERIC/libf/phystd/largescale.F90

    r1308 r1315  
    44
    55!     to use  'getin'
    6       use ioipsl_getincom
     6!      use ioipsl_getincom
     7      use ioipsl_getincom_p
    78      use watercommon_h, only : RLVTT, RCPD, RVTMP2,  &
    89          T_h2O_ice_clouds,T_h2O_ice_liq,Psat_waterDP,Lcpdqsat_waterDP
     
    4748!     Options du programme
    4849      REAL, SAVE :: ratqs   ! determine largeur de la distribution de vapeur
     50!$OMP THREADPRIVATE(ratqs)
    4951
    5052!     Variables locales
     
    6971      DOUBLE PRECISION zx_q(ngrid)
    7072      LOGICAL,SAVE :: firstcall=.true.
     73!$OMP THREADPRIVATE(firstcall)
    7174
    7275
     
    7578         write(*,*) "value for ratqs? "
    7679         ratqs=0.2 ! default value
    77          call getin("ratqs",ratqs)
     80         call getin_p("ratqs",ratqs)
    7881         write(*,*) " ratqs = ",ratqs
    7982
  • trunk/LMDZ.GENERIC/libf/phystd/mass_redistribution.F90

    r1309 r1315  
    102102!   local saved variables
    103103      LOGICAL, SAVE :: firstcall=.true.
     104!$OMP THREADPRIVATE(firstcall)
    104105
    105106!----------------------------------------------------------------------
  • trunk/LMDZ.GENERIC/libf/phystd/mod_grid_phy_lmdz.F90

    r1216 r1315  
    1212  INTEGER,SAVE :: nbp_lev  ! == llm
    1313  INTEGER,SAVE :: klon_glo
     14!$OMP THREADPRIVATE(nbp_lon,nbp_lat,nbp_lev,klon_glo)
    1415
    1516  INTERFACE grid1dTo2d_glo
  • trunk/LMDZ.GENERIC/libf/phystd/mod_phys_lmdz_mpi_data.F90

    r1216 r1315  
    1616  INTEGER,SAVE :: klon_mpi_end
    1717  INTEGER,SAVE :: klon_mpi
     18!!$OMP THREADPRIVATE(ii_begin,ii_end,jj_begin,jj_end,jj_nb,ij_begin,&
     19!       !$OMP ij_end,ij_nb,klon_mpi_begin,klon_mpi_end,klon_mpi)
    1820 
    1921  INTEGER,SAVE,ALLOCATABLE,DIMENSION(:) :: jj_para_nb
     
    3133  INTEGER,SAVE,ALLOCATABLE,DIMENSION(:) :: klon_mpi_para_begin
    3234  INTEGER,SAVE,ALLOCATABLE,DIMENSION(:) :: klon_mpi_para_end
     35!!$OMP THREADPRIVATE(jj_para_nb,jj_para_begin,jj_para_end,ii_para_begin,ii_para_end,&
     36!       !$OMP ij_para_nb,ij_para_begin,ij_para_end,klon_mpi_para_nb,klon_mpi_para_begin,&
     37!       !$OMP klon_mpi_para_end)
    3338
    3439 
     
    3843  LOGICAL,SAVE :: is_mpi_root
    3944  LOGICAL,SAVE :: is_using_mpi
     45!!$OMP THREADPRIVATE(mpi_rank,mpi_size,mpi_root,is_mpi_root,is_using_mpi)
    4046 
    4147 
     
    4349  LOGICAL,SAVE :: is_south_pole
    4450  INTEGER,SAVE :: COMM_LMDZ_PHY
     51!!$OMP THREADPRIVATE(is_north_pole,is_south_pole,COMM_LMDZ_PHY)
    4552
    4653CONTAINS
  • trunk/LMDZ.GENERIC/libf/phystd/mod_phys_lmdz_para.F90

    r1216 r1315  
    1313 
    1414!$OMP THREADPRIVATE(klon_loc,is_master)
     15!$OMP THREADPRIVATE(is_sequential,is_parallel)
    1516 
    1617CONTAINS
  • trunk/LMDZ.GENERIC/libf/phystd/moistadj.F90

    r1308 r1315  
    7777      INTEGER,SAVE :: i_h2o=0  ! water vapour
    7878      INTEGER,SAVE :: i_ice=0  ! water ice
     79!$OMP THREADPRIVATE(i_h2o,i_ice)
    7980
    8081      LOGICAL,SAVE :: firstcall=.TRUE.
     82!$OMP THREADPRIVATE(firstcall)
    8183
    8284      IF (firstcall) THEN
  • trunk/LMDZ.GENERIC/libf/phystd/newsedim.F

    r1308 r1315  
    4444
    4545      LOGICAL,SAVE :: firstcall=.true.
     46!$OMP THREADPRIVATE(firstcall)
    4647
    4748c    Traceurs :
     
    6263c     local and saved variable
    6364      real,save :: a,b
     65!$OMP THREADPRIVATE(a,b)
    6466
    6567c    ** un petit test de coherence
  • trunk/LMDZ.GENERIC/libf/phystd/newstart.F

    r1308 r1315  
    2323      use datafile_mod, only: datadir
    2424! to use  'getin'
    25       USE ioipsl_getincom, only: getin
     25!      USE ioipsl_getincom, only: getin
     26      USE ioipsl_getincom_p, only: getin_p
    2627      use control_mod, only: day_step, iphysiq, anneeref
    2728      use phyredem, only: physdem0, physdem1
     
    481482!    First get the correct value of datadir, if not already done:
    482483        ! default 'datadir' is set in "datafile_mod"
    483         call getin("datadir",datadir)
     484        call getin_p("datadir",datadir)
    484485        write(*,*) 'Available surface data files are:'
    485486        filestring='ls '//trim(datadir)//' | grep .nc'
  • trunk/LMDZ.GENERIC/libf/phystd/newtrelax.F90

    r1308 r1315  
    3838  real Trelax_V, Trelax_H
    3939  real,allocatable,dimension(:,:),save :: Trelax
     40!$OMP THREADPRIVATE(Trelax)
    4041
    4142  real T_trop ! relaxation temperature at tropopause (K)
  • trunk/LMDZ.GENERIC/libf/phystd/ocean_slab_mod.F90

    r1308 r1315  
    2626 
    2727  !LOGICAL, PRIVATE, SAVE  :: ok_slab_sic,ok_slab_heaT_h2O_ice_liqBS
    28   !$OMP THREADPRIVATE(ok_slab_sic,ok_slab_heaT_h2O_ice_liqBS)
     28  !!$OMP THREADPRIVATE(ok_slab_sic,ok_slab_heaT_h2O_ice_liqBS)
    2929  !INTEGER, PRIVATE, SAVE                           :: slab_ekman, slab_cadj
    30   !$OMP THREADPRIVATE(slab_ekman,slab_cadj)
     30  !!$OMP THREADPRIVATE(slab_ekman,slab_cadj)
    3131  INTEGER, PRIVATE, SAVE                           :: lmt_pas, julien, idayvrai
    3232  !$OMP THREADPRIVATE(lmt_pas,julien,idayvrai)
  • trunk/LMDZ.GENERIC/libf/phystd/physiq.F90

    r1312 r1315  
    188188      real, dimension(:,:),allocatable,save ::  tsoil  ! sub-surface temperatures (K)
    189189      real, dimension(:),allocatable,save :: albedo ! Surface albedo
     190!$OMP THREADPRIVATE(tsurf,tsoil,albedo)
    190191
    191192      real,dimension(:),allocatable,save :: albedo0 ! Surface albedo
    192193      real,dimension(:),allocatable,save :: rnat ! added by BC
     194!$OMP THREADPRIVATE(albedo0,rnat)
    193195
    194196      real,dimension(:),allocatable,save :: emis ! Thermal IR surface emissivity
     
    200202      real,dimension(:,:),allocatable,save :: qsurf ! tracer on surface (e.g. kg.m-2)
    201203      real,dimension(:,:),allocatable,save :: q2 ! Turbulent Kinetic Energy
     204!$OMP THREADPRIVATE(emis,dtrad,fluxrad_sky,fluxrad,capcal,fluxgrd,qsurf,q2)
    202205
    203206      save day_ini, icount
     207!$OMP THREADPRIVATE(day_ini,icount)
    204208
    205209! Local variables :
     
    227231      real,dimension(:,:),allocatable,save :: zdtsw ! (K/s)
    228232      real,dimension(:),allocatable,save :: sensibFlux ! turbulent flux given by the atm to the surface
     233!$OMP THREADPRIVATE(fluxsurf_lw,fluxsurf_sw,fluxtop_lw,fluxabs_sw,fluxtop_dn,fluxdyn,OLR_nu,OSR_nu,&
     234        !$OMP zdtlw,zdtsw,sensibFlux)
    229235
    230236      real zls                       ! solar longitude (rad)
     
    298304      real zdtdyn(ngrid,nlayer)
    299305      real,allocatable,dimension(:,:),save :: ztprevious
     306!$OMP THREADPRIVATE(ztprevious)
    300307      real reff(ngrid,nlayer) ! effective dust radius (used if doubleq=T)
    301308      real qtot1,qtot2            ! total aerosol mass
     
    312319!     reinstated by RW for diagnostic
    313320      real,allocatable,dimension(:),save :: tau_col
     321!$OMP THREADPRIVATE(tau_col)
    314322     
    315323!     included by RW to reduce insanity of code
     
    344352      real dEtot, dEtots, AtmToSurf_TurbFlux
    345353      real,save :: dEtotSW, dEtotsSW, dEtotLW, dEtotsLW
     354!$OMP THREADPRIVATE(dEtotSW, dEtotsSW, dEtotLW, dEtotsLW)
    346355      real dEzRadsw(ngrid,nlayer),dEzRadlw(ngrid,nlayer),dEzdiff(ngrid,nlayer)
    347356      real dEdiffs(ngrid),dEdiff(ngrid)
     
    360369!     included by BC for hydrology
    361370      real,allocatable,save :: hice(:)
     371 !$OMP THREADPRIVATE(hice)     
    362372
    363373!     included by RW to test water conservation (by routine)
     
    367377      logical watertest
    368378      save watertest
     379!$OMP THREADPRIVATE(watertest)
    369380
    370381!     included by RW for RH diagnostic
     
    394405      real,allocatable,dimension(:,:),save :: cloudfrac
    395406      real,allocatable,dimension(:),save :: totcloudfrac
     407!$OMP THREADPRIVATE(cloudfrac,totcloudfrac)
    396408
    397409!     included by RW for vdifc water conservation test
     
    402414!      double precision qsurf_hist(ngrid,nq)
    403415      real,allocatable,dimension(:,:),save :: qsurf_hist
     416!$OMP THREADPRIVATE(qsurf_hist)
    404417
    405418!     included by RW for temp convadj conservation test
     
    416429      real,allocatable,dimension(:,:,:),save :: reffrad ! aerosol effective radius (m)
    417430      real,allocatable,dimension(:,:,:),save :: nueffrad ! aerosol effective radius variance
     431!$OMP THREADPRIVATE(reffrad,nueffrad)
    418432!      real :: nueffrad_dummy(ngrid,nlayer,naerkind) !! AS. This is temporary. Check below why.
    419433      real :: reffh2oliq(ngrid,nlayer) ! liquid water particles effective radius (m)
     
    429443      integer num_run
    430444      logical,save :: ice_update
     445!$OMP THREADPRIVATE(ice_initial,ice_min,ice_update)
    431446
    432447!     included by MS to compute the daily average of rings shadowing
     
    447462      real, dimension(:),allocatable,save :: zmasq
    448463      integer, dimension(:),allocatable,save ::knindex
     464!$OMP THREADPRIVATE(pctsrf_sic,tslab,tsea_ice,sea_ice,zmasq,knindex)
    449465
    450466      real :: tsurf2(ngrid)
     
    630646         ice_update=.false.
    631647         if(sourceevol)then
     648!$OMP MASTER
    632649            open(128,file='num_run',form='formatted', &
    633650                     status="old",iostat=ierr)
     
    639656            read(128,*) num_run
    640657            close(128)
     658!$OMP END MASTER
     659!$OMP BARRIER
    641660       
    642661            if(num_run.ne.0.and.mod(num_run,2).eq.0)then
     
    21962215
    21972216        ! deallocate gas variables
     2217!$OMP BARRIER
     2218!$OMP MASTER
    21982219        IF ( ALLOCATED( gnom ) ) DEALLOCATE( gnom )
    21992220        IF ( ALLOCATED( gfrac ) ) DEALLOCATE( gfrac )  ! both allocated in su_gases.F90
     2221!$OMP END MASTER
     2222!$OMP BARRIER
    22002223
    22012224        ! deallocate saved arrays
     
    22162239        IF ( ALLOCATED(q2)) DEALLOCATE(q2)
    22172240        IF ( ALLOCATED(ztprevious)) DEALLOCATE(ztprevious)
     2241        IF ( ALLOCATED(hice)) DEALLOCATE(hice)
    22182242        IF ( ALLOCATED(cloudfrac)) DEALLOCATE(cloudfrac)
    22192243        IF ( ALLOCATED(totcloudfrac)) DEALLOCATE(totcloudfrac)
     
    22362260        IF ( ALLOCATED(zdtsw)) DEALLOCATE(zdtsw)
    22372261        IF ( ALLOCATED(tau_col)) DEALLOCATE(tau_col)
     2262        IF ( ALLOCATED(pctsrf_sic)) DEALLOCATE(pctsrf_sic)
     2263        IF ( ALLOCATED(tslab)) DEALLOCATE(tslab)
     2264        IF ( ALLOCATED(tsea_ice)) DEALLOCATE(tsea_ice)
     2265        IF ( ALLOCATED(sea_ice)) DEALLOCATE(sea_ice)
     2266        IF ( ALLOCATED(zmasq)) DEALLOCATE(zmasq)
     2267        IF ( ALLOCATED(knindex)) DEALLOCATE(knindex)
    22382268
    22392269        !! this is defined in comsaison_h
  • trunk/LMDZ.GENERIC/libf/phystd/planete_mod.F90

    r1308 r1315  
    1717  REAL :: p_elips
    1818 
    19   REAL :: preff ! reference surface pressure (Pa)
    20   REAL,ALLOCATABLE :: ap(:) ! hybrid coordinate at layer interface
    21   REAL,ALLOCATABLE :: bp(:) ! hybrid coordinate at layer interface
     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
    2222 
    2323  CONTAINS
     
    3131  real,intent(in) :: bp_dyn(nlayer+1) ! hybrid coordinate at interfaces
    3232 
     33!$OMP MASTER
    3334  allocate(ap(nlayer+1))
    3435  allocate(bp(nlayer+1))
     
    3738  ap(:)=ap_dyn(:)
    3839  bp(:)=bp_dyn(:)
     40!$OMP END MASTER
     41!$OMP BARRIER
    3942 
    4043  end subroutine ini_planete_mod
  • trunk/LMDZ.GENERIC/libf/phystd/radcommon_h.F90

    r1194 r1315  
    6161! gIR      :  mean assymetry factor
    6262
    63       REAL*8 BWNI(L_NSPECTI+1), WNOI(L_NSPECTI), DWNI(L_NSPECTI), WAVEI(L_NSPECTI)
    64       REAL*8 BWNV(L_NSPECTV+1), WNOV(L_NSPECTV), DWNV(L_NSPECTV), WAVEV(L_NSPECTV)
     63      REAL*8 BWNI(L_NSPECTI+1), WNOI(L_NSPECTI), DWNI(L_NSPECTI), WAVEI(L_NSPECTI) !BWNI read by master in setspi
     64      REAL*8 BWNV(L_NSPECTV+1), WNOV(L_NSPECTV), DWNV(L_NSPECTV), WAVEV(L_NSPECTV) !BWNV read by master in setspv
    6565      REAL*8 STELLARF(L_NSPECTV), TAURAY(L_NSPECTV), TAURAYVAR(L_NSPECTV)
     66!$OMP THREADPRIVATE(WNOI,DWNI,WAVEI,&
     67        !$OMP WNOV,DWNV,WAVEV,&
     68        !$OMP STELLARF,TAURAY,TAURAYVAR)
    6669
    6770      REAL*8 blami(L_NSPECTI+1)
    6871      REAL*8 blamv(L_NSPECTV+1) ! these are needed by suaer.F90
     72!$OMP THREADPRIVATE(blami,blamv)
    6973
    7074      !! AS: introduced to avoid doing same computations again for continuum
    7175      INTEGER, DIMENSION(:,:,:), ALLOCATABLE :: indi
    7276      INTEGER, DIMENSION(:,:,:), ALLOCATABLE :: indv
     77!$OMP THREADPRIVATE(indi,indv)
    7378
    7479      !!! ALLOCATABLE STUFF SO THAT DIMENSIONS ARE READ in *.dat FILES -- AS 12/2011 
     
    7984      real*8 pgasmin, pgasmax
    8085      real*8 tgasmin, tgasmax
     86!$OMP THREADPRIVATE(gasi,gasv,&  !wrefvar,pgasref,tgasref,pfgasref read by master in sugas_corrk
     87        !$OMP FZEROI,FZEROV)     !pgasmin,pgasmax,tgasmin,tgasmax read by master in sugas_corrk
    8188
    8289      real QVISsQREF(L_NSPECTV,naerkind,nsizemax)
     
    8693      real omegair(L_NSPECTI,naerkind,nsizemax)
    8794      real gir(L_NSPECTI,naerkind,nsizemax)
     95!$OMP THREADPRIVATE(QVISsQREF,omegavis,gvis,QIRsQREF,omegair,gir)
    8896
    8997
     
    102110
    103111      DOUBLE PRECISION :: radiustab(naerkind,2,nsizemax)
     112!$OMP THREADPRIVATE(lamrefir,lamrefvis,radiustab) !nsize read by suaer_corrk
    104113
    105114! Extinction coefficient at reference wavelengths;
     
    121130
    122131      real*8 gweight(L_NGAUSS)
     132!$OMP THREADPRIVATE(QREFvis,QREFir,omegaREFvis,omegaREFir,&     ! gweight read by master in sugas_corrk
     133                !$OMP tstellar,planckir,PTOP,TAUREF)
    123134
    124135!     If the gas optical depth (top to the surface) is less than
     
    137148      real*8 glat_ig
    138149      save glat_ig
     150!$OMP THREADPRIVATE(Cmk,glat_ig)
    139151
    140152      ! extinction of incoming sunlight (Saturn's rings, eclipses, etc...)
     
    143155      !Latitude-dependent gravity
    144156      REAL, DIMENSION(:), ALLOCATABLE :: glat
     157!$OMP THREADPRIVATE(glat,eclipse)
    145158
    146159      end module radcommon_h
  • trunk/LMDZ.GENERIC/libf/phystd/radii_mod.F90

    r1308 r1315  
    1212      real, save ::  Nmix_h2o
    1313      real, save ::  Nmix_h2o_ice
     14!$OMP THREADPRIVATE(rad_h2o,rad_h2o_ice,Nmix_h2o,Nmix_h2o_ice)
    1415      real, parameter ::  coef_chaud=0.13
    1516      real, parameter ::  coef_froid=0.09
     
    3233!==================================================================
    3334 ! to use  'getin'
    34       use ioipsl_getincom
     35!      use ioipsl_getincom
     36      use ioipsl_getincom_p
    3537      use radinc_h, only: naerkind
    3638      use aerosol_mod
     
    4951
    5052      logical, save :: firstcall=.true.
     53!$OMP THREADPRIVATE(firstcall)
    5154      integer :: iaer   
    5255     
     
    99102            write(*,*)"radius of H2O water particles:"
    100103            rad_h2o=13. ! default value
    101             call getin("rad_h2o",rad_h2o)
     104            call getin_p("rad_h2o",rad_h2o)
    102105            write(*,*)" rad_h2o = ",rad_h2o
    103106
    104107            write(*,*)"radius of H2O ice particles:"
    105108            rad_h2o_ice=35. ! default value
    106             call getin("rad_h2o_ice",rad_h2o_ice)
     109            call getin_p("rad_h2o_ice",rad_h2o_ice)
    107110            write(*,*)" rad_h2o_ice = ",rad_h2o_ice
    108111
     
    111114            write(*,*)"Number mixing ratio of H2O water particles:"
    112115            Nmix_h2o=1.e6 ! default value
    113             call getin("Nmix_h2o",Nmix_h2o)
     116            call getin_p("Nmix_h2o",Nmix_h2o)
    114117            write(*,*)" Nmix_h2o = ",Nmix_h2o
    115118
    116119            write(*,*)"Number mixing ratio of H2O ice particles:"
    117120            Nmix_h2o_ice=Nmix_h2o ! default value
    118             call getin("Nmix_h2o_ice",Nmix_h2o_ice)
     121            call getin_p("Nmix_h2o_ice",Nmix_h2o_ice)
    119122            write(*,*)" Nmix_h2o_ice = ",Nmix_h2o_ice
    120123         endif
  • trunk/LMDZ.GENERIC/libf/phystd/radinc_h.F90

    r728 r1315  
    6363      ! These are set in sugas_corrk
    6464      ! [uses allocatable arrays] -- AS 12/2011
    65       integer :: L_NPREF, L_NTREF, L_REFVAR, L_PINT
     65      integer :: L_NPREF, L_NTREF, L_REFVAR, L_PINT   !L_NPREF, L_NTREF, L_REFVAR, L_PINT read by master in sugas_corrk
    6666
    6767      integer, parameter :: L_NGAUSS  = 17
     
    9292      character (len=100) :: corrkdir
    9393      save corrkdir
     94!$OMP THREADPRIVATE(corrkdir)
    9495
    9596      character (len=100) :: banddir
    9697      save banddir
     98!$OMP THREADPRIVATE(banddir)
    9799
    98100      end module radinc_h
  • trunk/LMDZ.GENERIC/libf/phystd/rain.F90

    r1308 r1315  
    22
    33
    4   use ioipsl_getincom, only: getin
     4! to use  'getin'
     5!  use ioipsl_getincom
     6  use ioipsl_getincom_p
    57  use watercommon_h, only: T_h2O_ice_liq,T_h2O_ice_clouds, RLVTT, RCPD, RCPV, RV, RVTMP2,Psat_water,Tsat_water,rhowater
    68  use radii_mod, only: h2o_cloudrad
     
    6365      REAL,PARAMETER :: Kboucher=1.19E8
    6466      REAL,SAVE :: c1
     67!$OMP THREADPRIVATE(precip_scheme,rainthreshold,cloud_sat,precip_timescale,Cboucher,c1)
    6568
    6669      INTEGER,PARAMETER :: ninter=5
    6770
    6871      logical,save :: evap_prec ! Does the rain evaporate?
     72!$OMP THREADPRIVATE(evap_prec)
    6973
    7074!     for simple scheme
     
    9397      INTEGER, SAVE :: i_vap=0  ! water vapour
    9498      INTEGER, SAVE :: i_ice=0  ! water ice
     99!$OMP THREADPRIVATE(i_vap,i_ice)
    95100
    96101      LOGICAL,SAVE :: firstcall=.true.
     102!$OMP THREADPRIVATE(firstcall)
    97103
    98104!     Online functions
     
    115121         write(*,*) "Precipitation scheme to use?"
    116122         precip_scheme=1 ! default value
    117          call getin("precip_scheme",precip_scheme)
     123         call getin_p("precip_scheme",precip_scheme)
    118124         write(*,*) " precip_scheme = ",precip_scheme
    119125
     
    121127            write(*,*) "rainthreshold in simple scheme?"
    122128            rainthreshold=0. ! default value
    123             call getin("rainthreshold",rainthreshold)
     129            call getin_p("rainthreshold",rainthreshold)
    124130            write(*,*) " rainthreshold = ",rainthreshold
    125131
     
    127133            write(*,*) "cloud water saturation level in non simple scheme?"
    128134            cloud_sat=2.6e-4   ! default value
    129             call getin("cloud_sat",cloud_sat)
     135            call getin_p("cloud_sat",cloud_sat)
    130136            write(*,*) " cloud_sat = ",cloud_sat
    131137            write(*,*) "precipitation timescale in non simple scheme?"
    132138            precip_timescale=3600.  ! default value
    133             call getin("precip_timescale",precip_timescale)
     139            call getin_p("precip_timescale",precip_timescale)
    134140            write(*,*) " precip_timescale = ",precip_timescale
    135141
     
    137143            write(*,*) "multiplicative constant in Boucher 95 precip scheme"
    138144            Cboucher=1.   ! default value
    139             call getin("Cboucher",Cboucher)
     145            call getin_p("Cboucher",Cboucher)
    140146            write(*,*) " Cboucher = ",Cboucher 
    141147            c1=1.00*1.097/rhowater*Cboucher*Kboucher 
     
    145151         write(*,*) "re-evaporate precipitations?"
    146152         evap_prec=.true. ! default value
    147          call getin("evap_prec",evap_prec)
     153         call getin_p("evap_prec",evap_prec)
    148154         write(*,*) " evap_prec = ",evap_prec
    149155
  • trunk/LMDZ.GENERIC/libf/phystd/setspi.F90

    r997 r1315  
    9292      endif
    9393   
     94!$OMP MASTER   
    9495      nb=0
    9596      ierr=0
     
    121122      BWNI(L_NSPECTI)  =lastband(1)
    122123      BWNI(L_NSPECTI+1)=lastband(2)
     124!$OMP END MASTER
     125!$OMP BARRIER
    123126
    124127      print*,''
  • trunk/LMDZ.GENERIC/libf/phystd/setspv.F90

    r997 r1315  
    6969         call abort
    7070      endif
    71    
     71       
     72!$OMP MASTER       
    7273      nb=0
    7374      ierr=0
     
    9899      BWNV(L_NSPECTV)  =lastband(1)
    99100      BWNV(L_NSPECTV+1)=lastband(2)
    100 
     101!$OMP END MASTER
     102!$OMP BARRIER
    101103
    102104      print*,'setspv: VI band limits:'
  • trunk/LMDZ.GENERIC/libf/phystd/soil.F

    r1308 r1315  
    4545      real,dimension(:,:),save,allocatable :: beta ! beta_k coefficients
    4646      real,save :: mu
     47!$OMP THREADPRIVATE(mthermdiff,thermdiff,coefq,coefd,alph,beta,mu)
    4748           
    4849! local variables:
  • trunk/LMDZ.GENERIC/libf/phystd/stokes.F90

    r253 r1315  
    3333      real a,b,molrad,visc
    3434      save a,b
     35!$OMP THREADPRIVATE(a,b)
    3536 
    3637      LOGICAL firstcall
    3738      SAVE firstcall
    3839      DATA firstcall/.true./
     40!$OMP THREADPRIVATE(firstcall)
    3941
    4042      if (firstcall) then
  • trunk/LMDZ.GENERIC/libf/phystd/su_gases.F90

    r869 r1315  
    2020  !==================================================================
    2121
     22!$OMP MASTER
    2223  ! load gas names from file 'gases.def'
    2324  open(90,file='gases.def',status='old',form='formatted',iostat=ierr)
     
    122123  endif
    123124  close(90)
     125!$OMP END MASTER
     126!$OMP BARRIER
    124127
    125128end subroutine su_gases
  • trunk/LMDZ.GENERIC/libf/phystd/suaer_corrk.F90

    r1026 r1315  
    4646#include "callkeys.h"
    4747!     Optical properties (read in external ASCII files)
    48       INTEGER          :: nwvl  ! Number of wavelengths in
    49                                 ! the domain (VIS or IR)
     48      INTEGER,SAVE      :: nwvl  ! Number of wavelengths in
     49                                ! the domain (VIS or IR), read by master
    5050
    5151!      REAL             :: solsir ! visible to infrared ratio
     
    5353
    5454      REAL, DIMENSION(:),&
    55       ALLOCATABLE, SAVE :: wvl  ! Wavelength axis
     55      ALLOCATABLE, SAVE :: wvl  ! Wavelength axis, read by master
    5656      REAL, DIMENSION(:),&
    57       ALLOCATABLE, SAVE :: radiusdyn ! Particle size axis
     57      ALLOCATABLE, SAVE :: radiusdyn ! Particle size axis, read by master
    5858
    5959      REAL, DIMENSION(:,:),&
    60       ALLOCATABLE, SAVE :: ep,& ! Extinction coefficient Qext
    61       omeg,&                    ! Single Scattering Albedo
    62       gfactor                   ! Assymetry Factor
     60      ALLOCATABLE, SAVE :: ep,& ! Extinction coefficient Qext, read by master
     61      omeg,&                    ! Single Scattering Albedo, read by master
     62      gfactor                   ! Assymetry Factor, read by master
    6363
    6464!     Local variables:
     
    9898
    9999      CHARACTER(LEN=30), DIMENSION(naerkind,2), SAVE :: file_id
     100!$OMP THREADPRIVATE(file_id)
    100101!---- Please indicate the names of the optical property files below
    101102!     Please also choose the reference wavelengths of each aerosol
     
    203204!     1.1 Open the ASCII file
    204205
     206!$OMP MASTER
    205207            INQUIRE(FILE=TRIM(datadir)//&
    206208         '/'//TRIM(file_id(iaer,idomain)),&
     
    339341      endif
    340342
     343!$OMP END MASTER
     344!$OMP BARRIER
    341345
    342346
     
    432436!========================================================================
    433437
    434       DEALLOCATE(wvl)           ! wvl
    435       DEALLOCATE(radiusdyn)     ! radiusdyn
    436       DEALLOCATE(ep)            ! ep
    437       DEALLOCATE(omeg)          ! omeg
    438       DEALLOCATE(gfactor)       ! g
     438!$OMP BARRIER
     439!$OMP MASTER
     440      IF (ALLOCATED(wvl)) DEALLOCATE(wvl)                 ! wvl
     441      IF (ALLOCATED(radiusdyn)) DEALLOCATE(radiusdyn)     ! radiusdyn
     442      IF (ALLOCATED(ep)) DEALLOCATE(ep)                   ! ep
     443      IF (ALLOCATED(omeg)) DEALLOCATE(omeg)               ! omeg
     444      IF (ALLOCATED(gfactor)) DEALLOCATE(gfactor)         ! g
     445!$OMP END MASTER
     446!$OMP BARRIER
    439447
    440448      END DO                    ! Loop on iaer
  • trunk/LMDZ.GENERIC/libf/phystd/sugas_corrk.F90

    r1297 r1315  
    2828
    2929      use gases_h
    30       use ioipsl_getincom
     30!      use ioipsl_getincom
     31      use ioipsl_getincom_p
    3132      implicit none
    3233
     
    4546
    4647      ! ALLOCATABLE ARRAYS -- AS 12/2011
    47       REAL*8, DIMENSION(:,:,:,:,:), ALLOCATABLE :: gasi8, gasv8
    48       character*20,allocatable,DIMENSION(:) :: gastype ! for check with gnom
     48      REAL*8, DIMENSION(:,:,:,:,:), ALLOCATABLE,SAVE :: gasi8, gasv8    !read by master
     49      character*20,allocatable,DIMENSION(:),SAVE :: gastype ! for check with gnom, read by master
    4950
    5051      real*8 x, xi(4), yi(4), ans, p
     
    7677      endif
    7778
     79!$OMP MASTER
    7880      ! check that database matches varactive toggle
    7981      open(111,file=TRIM(file_path),form='formatted')
     
    261263      tgasmin = tgasref(1)
    262264      tgasmax = tgasref(L_NTREF)
     265!$OMP END MASTER
     266!$OMP BARRIER
    263267
    264268!-----------------------------------------------------------------------
     
    302306         write(*,*)"graybody: constant absorption coefficient in visible:"
    303307         kappa_VI=-100000.
    304          call getin("kappa_VI",kappa_VI)
     308         call getin_p("kappa_VI",kappa_VI)
    305309         write(*,*)" kappa_VI = ",kappa_VI
    306310         kappa_VI=kappa_VI*1.e4* mugaz * 1.672621e-27    ! conversion from m^2/kg to cm^2/molecule         
     
    309313         write(*,*)"graybody: constant absorption coefficient in InfraRed:"
    310314         kappa_IR=-100000.
    311          call getin("kappa_IR",kappa_IR)
     315         call getin_p("kappa_IR",kappa_IR)
    312316         write(*,*)" kappa_IR = ",kappa_IR       
    313317         kappa_IR=kappa_IR*1.e4* mugaz * 1.672621e-27    ! conversion from m^2/kg to cm^2/molecule
     
    320324      End if
    321325
     326!$OMP MASTER         
    322327!      print*,corrkdir(1:4)
    323328      ! VISIBLE
     
    361366         gasv8(1:L_NTREF,1:L_NPREF,1:L_REFVAR,1:L_NSPECTV,1:L_NGAUSS)=0.0
    362367      endif
     368!$OMP END MASTER
     369!$OMP BARRIER
    363370
    364371      ! INFRA-RED
    365372      if ((corrkdir(1:4).eq.'null'))then       !.or.(TRIM(corrkdir).eq.'null_LowTeffStar')) then
    366373         print*,'Infrared corrk gaseous absorption is set to zero if graybody=F'
     374!$OMP MASTER         
    367375         gasi8(1:L_NTREF,1:L_NPREF,1:L_REFVAR,1:L_NSPECTI,1:L_NGAUSS)=0.0
    368       else 
     376!$OMP END MASTER
     377!$OMP BARRIER
     378      else
    369379         file_id='/corrk_data/'//trim(adjustl(banddir))//'/corrk_gcm_IR.dat'
    370380         file_path=TRIM(datadir)//TRIM(file_id)
     
    379389         endif
    380390         
     391!$OMP MASTER                   
    381392         open(111,file=TRIM(file_path),form='formatted')
    382393         read(111,*) gasi8
    383394         close(111)
     395!$OMP END MASTER
     396!$OMP BARRIER
    384397     
    385398         ! 'fzero' is a currently unused feature that allows optimisation
     
    423436      endif
    424437
     438!$OMP MASTER                 
    425439      if(nIR_limit.eq.0) then
    426440         gasi8(1:L_NTREF,1:L_NPREF,1:L_REFVAR,1:L_NSPECTI,1:L_NGAUSS)=   &
     
    465479         end do
    466480      end do
     481!$OMP END MASTER
     482!$OMP BARRIER
    467483
    468484!     Interpolate the values:  first the longwave
     
    653669
    654670!     Deallocate local arrays
     671!$OMP BARRIER
     672!$OMP MASTER
    655673      IF( ALLOCATED( gasi8 ) ) DEALLOCATE( gasi8 )
    656674      IF( ALLOCATED( gasv8 ) ) DEALLOCATE( gasv8 )
    657675      IF( ALLOCATED( pgasref ) ) DEALLOCATE( pgasref )
    658676      IF( ALLOCATED( gastype ) ) DEALLOCATE( gastype )
     677!$OMP END MASTER
     678!$OMP BARRIER
    659679
    660680      return
  • trunk/LMDZ.GENERIC/libf/phystd/surfdat_h.F90

    r787 r1315  
    55
    66       real,allocatable,dimension(:) :: albedodat ! albedo of bare ground
     7!$OMP THREADPRIVATE(albedodat)
    78       ! Ehouarn: moved inertiedat to comsoil.h
    89       !      real inertiedat, ! thermal inertia
    910       real,allocatable,dimension(:) :: phisfi ! geopotential at ground level
     11!$OMP THREADPRIVATE(phisfi)
    1012       real,dimension(2) :: albedice
    1113       real,dimension(2) :: emisice ! ice emissivity; 1:Northern hemisphere 2:Southern hemisphere
    1214       real emissiv
    1315       real,dimension(2) :: iceradius, dtemisice
     16!$OMP THREADPRIVATE(albedice,emisice,emissiv,iceradius,dtemisice)
    1417       real,allocatable,dimension(:) :: zmea,zstd,zsig,zgam,zthe
     18!$OMP THREADPRIVATE(zmea,zstd,zsig,zgam,zthe)
    1519
    1620       real,allocatable,dimension(:) :: dryness  !"Dryness coefficient" for grnd water ice sublimation
     
    1822
    1923       logical,allocatable,dimension(:) :: watercaptag !! was in watercap.h
     24!$OMP THREADPRIVATE(dryness,watercaptag)
    2025
    2126       end module surfdat_h
  • trunk/LMDZ.GENERIC/libf/phystd/tracer_h.F90

    r787 r1315  
    1919      real rho_co2     ! CO2 ice density (kg.m-3)
    2020      real ref_r0        ! for computing reff=ref_r0*r0 (in log.n. distribution)
     21!$OMP THREADPRIVATE(noms,mmol,radius,rho_q,qext,alpha_lift,alpha_devil,qextrhor, &
     22        !$OMP varian,r3n_q,rho_dust,rho_ice,rho_co2,ref_r0)
    2123
    2224! tracer indexes: these are initialized in initracer and should be 0 if the
     
    4749      integer :: igcm_ar_n2 ! for simulations using co2 +neutral gaz
    4850      integer :: igcm_co2_ice ! CO2 ice
     51!$OMP THREADPRIVATE(igcm_dustbin,igcm_dust_mass,igcm_dust_number,igcm_h2o_vap,igcm_h2o_ice, &
     52        !$OMP igcm_co2,igcm_co,igcm_o,igcm_o1d,igcm_o2,igcm_o3,igcm_h,igcm_h2,igcm_oh,      &
     53        !$OMP igcm_ho2,igcm_h2o2,igcm_n2,igcm_ar,igcm_ar_n2,igcm_co2_ice)
    4954
    5055       end module tracer_h
  • trunk/LMDZ.GENERIC/libf/phystd/turbdiff.F90

    r1308 r1315  
    107107
    108108      LOGICAL,SAVE :: firstcall=.true.
     109!$OMP THREADPRIVATE(firstcall)
    109110     
    110111!     Tracers
     
    124125
    125126      integer, save :: ivap, iliq, iliq_surf,iice_surf ! also make liq for clarity on surface...
     127!$OMP THREADPRIVATE(ivap,iliq,iliq_surf,iice_surf)
    126128
    127129      real, parameter :: karman=0.4
  • trunk/LMDZ.GENERIC/libf/phystd/vdif_cd.F

    r135 r1315  
    5555      DATA firstcal/.true./
    5656      SAVE b,c,d,karman,c2b,c3bc,c3b,firstcal,umin2
     57!$OMP THREADPRIVATE(b,c,d,karman,c2b,c3bc,c3b,firstcal,umin2)
    5758
    5859c-----------------------------------------------------------------------
  • trunk/LMDZ.GENERIC/libf/phystd/vdifc.F

    r1308 r1315  
    9696      LOGICAL firstcall
    9797      SAVE firstcall
     98!$OMP THREADPRIVATE(firstcall)
    9899     
    99100      LOGICAL lastcall
     
    105106!     REAL acond,bcond
    106107!     SAVE acond,bcond
     108!!$OMP THREADPRIVATE(acond,bcond)
    107109!     DATA latcond,tcond1mb/5.9e5,136.27/
    108110
     
    132134      integer ivap, iice ! also make liq for clarity on surface...
    133135      save ivap, iice
     136!$OMP THREADPRIVATE(ivap,iice)
    134137
    135138      real, parameter :: karman=0.4
  • trunk/LMDZ.GENERIC/libf/phystd/watercommon_h.F90

    r1255 r1315  
    1919
    2020      real, save :: epsi, RCPD, RCPV, RV, RVTMP2
     21!$OMP THREADPRIVATE(epsi,RCPD,RCPV,RV,RVTMP2)
    2122     
    2223      contains
  • trunk/LMDZ.GENERIC/libf/phystd/writediagfi.F

    r1216 r1315  
    6868
    6969      real*4,save :: date
     70!$OMP THREADPRIVATE(date)
    7071
    7172      REAL phis(ip1jmp1)
     
    7879      integer,save :: zitau=0
    7980      character(len=20),save :: firstnom='1234567890'
     81!$OMP THREADPRIVATE(zitau,firstnom)
    8082
    8183! Ajouts
    8284      integer, save :: ntime=0
     85!$OMP THREADPRIVATE(ntime)
    8386      integer :: idim,varid
    8487      integer :: nid
     
    9598      character(len=120),save :: nom_def(n_nom_def_max)
    9699      logical,save :: firstcall=.true.
     100!$OMP THREADPRIVATE(firstcall)  !diagfi_def,n_nom_def,nom_def read in diagfi.def
    97101     
    98102#ifndef MESOSCALE
     
    128132         firstcall=.false.
    129133
     134!$OMP MASTER
    130135  !      Open diagfi.def definition file if there is one:
    131136         open(99,file="diagfi.def",status='old',form='formatted',
     
    151156            diagfi_def=.false.
    152157         endif
     158!$OMP END MASTER
     159!$OMP BARRIER
    153160      END IF ! of IF (firstcall)
    154161
  • trunk/LMDZ.GENERIC/libf/phystd/writediagsoil.F90

    r1216 r1315  
    4646character(len=20),save :: firstname="1234567890"
    4747integer,save :: zitau=0
     48!$OMP THREADPRIVATE(date,isample,ntime,firstname,zitau)
    4849
    4950character(len=30) :: filename="diagsoil.nc"
  • trunk/LMDZ.GENERIC/libf/phystd/writediagspecIR.F

    r1308 r1315  
    9191      data firstnom /'1234567890'/
    9292      data zitau /0/
     93!$OMP THREADPRIVATE(firstnom,zitau,date)
    9394
    9495! Ajouts
    9596      integer, save :: ntime=0
     97!$OMP THREADPRIVATE(ntime)
    9698      integer :: idim,varid
    9799      integer :: nid
  • trunk/LMDZ.GENERIC/libf/phystd/writediagspecVI.F

    r1308 r1315  
    9191      data firstnom /'1234567890'/
    9292      data zitau /0/
     93!$OMP THREADPRIVATE(firstnom,zitau,date)
    9394
    9495! Ajouts
    9596      integer, save :: ntime=0
     97!$OMP THREADPRIVATE(ntime)
    9698      integer :: idim,varid
    9799      integer :: nid
  • trunk/LMDZ.GENERIC/libf/phystd/wstats.F90

    r1308 r1315  
    2222character (len=50) :: namebis
    2323character (len=50), save :: firstvar
     24!$OMP THREADPRIVATE(firstvar)
    2425integer :: ierr,varid,nbdim,nid
    2526integer :: meanid,sdid
     
    3031
    3132integer, save :: step=0
     33!$OMP THREADPRIVATE(firstcall,indx,step)
    3234
    3335! Added to work in parallel mode
Note: See TracChangeset for help on using the changeset viewer.