Ignore:
Timestamp:
07/16/14 18:05:01 (10 years ago)
Author:
milmd
Message:

Last LMDZ version (1315) with OpenMP directives and other stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/branches/SATURN_DYNAMICO/LMDZ.COMMON/libf/phystd/aeropacity.F90

    r222 r227  
    3030!     pq                Aerosol mixing ratio 
    3131!     reffrad(ngrid,nlayer,naerkind)         Aerosol effective radius 
    32 !     QREFvis3d(ngrid,nlayermx,naerkind) \ 3d extinction coefficients 
    33 !     QREFir3d(ngrid,nlayermx,naerkind)  / at reference wavelengths 
     32!     QREFvis3d(ngrid,nlayer,naerkind) \ 3d extinction coefficients 
     33!     QREFir3d(ngrid,nlayer,naerkind)  / at reference wavelengths 
    3434! 
    3535!     Output 
     
    4040!======================================================================= 
    4141 
    42 #include "dimensions.h" 
    43 #include "dimphys.h" 
     42!#include "dimensions.h" 
     43!#include "dimphys.h" 
    4444#include "callkeys.h" 
    4545#include "comcstfi.h" 
    46 #include "comvert.h" 
     46!#include "comvert.h" 
    4747 
    4848      INTEGER,INTENT(IN) :: ngrid  ! number of atmospheric columns 
     
    5454      REAL,INTENT(OUT) :: aerosol(ngrid,nlayer,naerkind) ! aerosol optical depth 
    5555      REAL,INTENT(IN) :: reffrad(ngrid,nlayer,naerkind) ! aerosol effective radius 
    56       REAL,INTENT(IN) :: QREFvis3d(ngrid,nlayermx,naerkind) ! extinction coefficient in the visible 
    57       REAL,INTENT(IN) :: QREFir3d(ngrid,nlayermx,naerkind) 
     56      REAL,INTENT(IN) :: QREFvis3d(ngrid,nlayer,naerkind) ! extinction coefficient in the visible 
     57      REAL,INTENT(IN) :: QREFir3d(ngrid,nlayer,naerkind) 
    5858      REAL,INTENT(OUT):: tau_col(ngrid) !column integrated visible optical depth 
    5959      ! BENJAMIN MODIFS 
    60       real,intent(in) :: cloudfrac(ngrid,nlayermx) ! cloud fraction 
     60      real,intent(in) :: cloudfrac(ngrid,nlayer) ! cloud fraction 
    6161      real,intent(out) :: totcloudfrac(ngrid) ! total cloud fraction 
    6262      logical,intent(in) :: clearsky 
     
    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 
     
    135137           iaer=iaero_co2 
    136138!       1. Initialization 
    137             aerosol(1:ngrid,1:nlayermx,iaer)=0.0 
     139            aerosol(1:ngrid,1:nlayer,iaer)=0.0 
    138140!       2. Opacity calculation 
    139141            if (noaero) then ! aerosol set to zero 
    140              aerosol(1:ngrid,1:nlayermx,iaer)=0.0 
     142             aerosol(1:ngrid,1:nlayer,iaer)=0.0 
    141143            elseif (aerofixco2.or.(i_co2ice.eq.0)) then !  CO2 ice cloud prescribed 
    142                aerosol(1:ngrid,1:nlayermx,iaer)=1.e-9 
     144               aerosol(1:ngrid,1:nlayer,iaer)=1.e-9 
    143145               !aerosol(1:ngrid,12,iaer)=4.0 ! single cloud layer option 
    144146            else 
     
    172174           iaer=iaero_h2o 
    173175!       1. Initialization 
    174             aerosol(1:ngrid,1:nlayermx,iaer)=0.0 
     176            aerosol(1:ngrid,1:nlayer,iaer)=0.0 
    175177!       2. Opacity calculation 
    176178            if (aerofixh2o.or.(i_h2oice.eq.0).or.clearsky) then 
    177                aerosol(1:ngrid,1:nlayermx,iaer) =1.e-9 
     179               aerosol(1:ngrid,1:nlayer,iaer) =1.e-9 
    178180 
    179181               ! put cloud at cloudlvl 
     
    226228 
    227229               if(CLFvarying)then 
    228                   call totalcloudfrac(ngrid,nq,cloudfrac,totcloudfrac,pplev,pq,aerosol(1:ngrid,1:nlayermx,iaer)) 
     230                  call totalcloudfrac(ngrid,nlayer,nq,cloudfrac,totcloudfrac,pplev,pq,aerosol(1,1,iaer)) 
    229231                  do ig=1, ngrid 
    230232                     do l=1,nlayer-1 ! to stop the rad tran bug 
     
    253255          iaer=iaero_dust 
    254256!         1. Initialization  
    255           aerosol(1:ngrid,1:nlayermx,iaer)=0.0 
     257          aerosol(1:ngrid,1:nlayer,iaer)=0.0 
    256258           
    257259          topdust=30.0 ! km  (used to be 10.0 km) LK 
     
    264266!             Typical mixing ratio profile 
    265267 
    266                  zp=(preff/pplay(ig,l))**(70./topdust) 
     268                 zp=(pplev(ig,1)/pplay(ig,l))**(70./topdust) 
    267269                 expfactor=max(exp(0.007*(1.-max(zp,1.))),1.e-3) 
    268270 
     
    277279!          Rescaling each layer to reproduce the choosen (or assimilated) 
    278280!          dust extinction opacity at visible reference wavelength, which 
    279 !          is scaled to the "preff" reference surface pressure available in comvert.h 
    280 !          and stored in startfi.nc 
     281!          is scaled to the surface pressure pplev(ig,1) 
    281282 
    282283            taudusttmp(1:ngrid)=0. 
     
    291292                  aerosol(ig,l,iaer) = max(1E-20, & 
    292293                          dusttau & 
    293                        *  pplev(ig,1) / preff & 
     294                       *  pplev(ig,1) / pplev(ig,1) & 
    294295                       *  aerosol(ig,l,iaer) & 
    295296                       /  taudusttmp(ig)) 
     
    307308 
    308309!       1. Initialization 
    309          aerosol(1:ngrid,1:nlayermx,iaer)=0.0 
     310         aerosol(1:ngrid,1:nlayer,iaer)=0.0 
    310311 
    311312 
     
    317318!              Typical mixing ratio profile 
    318319 
    319                zp=(preff/pplay(ig,l))**(70./30) !emulating topdust 
     320               zp=(pplev(ig,1)/pplay(ig,l))**(70./30) !emulating topdust 
    320321               expfactor=max(exp(0.007*(1.-max(zp,1.))),1.e-3) 
    321322 
     
    335336               aerosol(ig,l,iaer) = max(1E-20, & 
    336337                          1 & 
    337                        *  pplev(ig,1) / preff & 
     338                       *  pplev(ig,1) / pplev(ig,1) & 
    338339                       *  aerosol(ig,l,iaer) & 
    339340                       /  tauh2so4tmp(ig)) 
     
    367368           iaer=iaero_back2lay 
    368369!       1. Initialization 
    369             aerosol(1:ngrid,1:nlayermx,iaer)=0.0 
     370            aerosol(1:ngrid,1:nlayer,iaer)=0.0 
    370371!       2. Opacity calculation 
    371372          DO ig=1,ngrid 
Note: See TracChangeset for help on using the changeset viewer.