Ignore:
Timestamp:
Jul 24, 2024, 4:39:59 PM (4 months ago)
Author:
abarral
Message:

Replace iniprint.h by lmdz_iniprint.f90
(lint) along the way

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/calcaerosolstrato_rrtm.F90

    r5099 r5118  
    1 
    21! $Id$
    32
    4 SUBROUTINE calcaerosolstrato_rrtm(pplay,t_seri,paprs,debut)
     3SUBROUTINE calcaerosolstrato_rrtm(pplay, t_seri, paprs, debut)
    54
    65  USE phys_state_var_mod, ONLY: tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm, tau_aero_lw_rrtm
     
    109  USE temps_mod
    1110  USE lmdz_yomcst
     11  USE lmdz_iniprint, ONLY: lunout, prt_level
    1212
    1313  IMPLICIT NONE
     
    1616  INCLUDE "clesphys.h"
    1717  INCLUDE "paramet.h"
    18   INCLUDE "iniprint.h"
    1918
    20 ! Variable input
    21   REAL,DIMENSION(klon,klev),INTENT(IN)  :: t_seri  ! Temperature
    22   REAL,DIMENSION(klon,klev),INTENT(IN)  :: pplay   ! pression pour le mileu de chaque couche (en Pa)
    23   LOGICAL,INTENT(IN)                    :: debut   ! le flag de l'initialisation de la physique
    24   REAL,DIMENSION(klon,klev+1),INTENT(IN) :: paprs   ! pression pour chaque inter-couche (en Pa)
     19  ! Variable input
     20  REAL, DIMENSION(klon, klev), INTENT(IN) :: t_seri  ! Temperature
     21  REAL, DIMENSION(klon, klev), INTENT(IN) :: pplay   ! pression pour le mileu de chaque couche (en Pa)
     22  LOGICAL, INTENT(IN) :: debut   ! le flag de l'initialisation de la physique
     23  REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: paprs   ! pression pour chaque inter-couche (en Pa)
    2524
    26 ! Stratospheric aerosols optical properties
    27   REAL, DIMENSION(klon,klev,nbands_sw_rrtm) :: tau_strat, piz_strat, cg_strat
    28   REAL, DIMENSION(klon,klev,nwave_sw+nwave_lw) :: tau_strat_wave
    29   REAL, DIMENSION(klon,klev,nbands_lw_rrtm) :: tau_lw_abs_rrtm
     25  ! Stratospheric aerosols optical properties
     26  REAL, DIMENSION(klon, klev, nbands_sw_rrtm) :: tau_strat, piz_strat, cg_strat
     27  REAL, DIMENSION(klon, klev, nwave_sw + nwave_lw) :: tau_strat_wave
     28  REAL, DIMENSION(klon, klev, nbands_lw_rrtm) :: tau_lw_abs_rrtm
    3029
    3130  INTEGER k, band, wave, i
    3231  REAL zrho, zdz
    3332
    34 !--calculate optical properties of the aerosol size distribution from tr_seri
    35   tau_strat=0.0
    36   piz_strat=0.0
    37   cg_strat=0.0
    38   tau_strat_wave=0.0
    39   tau_lw_abs_rrtm=0.0
     33  !--calculate optical properties of the aerosol size distribution from tr_seri
     34  tau_strat = 0.0
     35  piz_strat = 0.0
     36  cg_strat = 0.0
     37  tau_strat_wave = 0.0
     38  tau_lw_abs_rrtm = 0.0
    4039
    4140  CALL miecalc_aer(tau_strat, piz_strat, cg_strat, tau_strat_wave, tau_lw_abs_rrtm, paprs, debut)
    4241
    43 !!--test CK: deactivate radiative effect of aerosol
    44 !  tau_strat=0.0
    45 !  piz_strat=0.0
    46 !  cg_strat=0.0
    47 !  tau_strat_wave=0.0
    48 !  tau_lw_abs_rrtm=0.0
     42  !!--test CK: deactivate radiative effect of aerosol
     43  !  tau_strat=0.0
     44  !  piz_strat=0.0
     45  !  cg_strat=0.0
     46  !  tau_strat_wave=0.0
     47  !  tau_lw_abs_rrtm=0.0
    4948
    50 !--test CK: deactivate SW radiative effect of aerosol (but leave LW)
    51 !  tau_strat=0.0
    52 !  piz_strat=0.0
    53 !  cg_strat=0.0
     49  !--test CK: deactivate SW radiative effect of aerosol (but leave LW)
     50  !  tau_strat=0.0
     51  !  piz_strat=0.0
     52  !  cg_strat=0.0
    5453
    55 !  DO wave=1, nwave_sw
    56 !  tau_strat_wave(:,:,wave)=0.0
    57 !  ENDDO
     54  !  DO wave=1, nwave_sw
     55  !  tau_strat_wave(:,:,wave)=0.0
     56  !  ENDDO
    5857
    59 !--test CK: deactivate LW radiative effect of aerosol (but leave SW)
    60 !  tau_lw_abs_rrtm=0.0
     58  !--test CK: deactivate LW radiative effect of aerosol (but leave SW)
     59  !  tau_lw_abs_rrtm=0.0
    6160
    62 !  DO wave=nwave_sw+1, nwave_sw+nwave_lw
    63 !  tau_strat_wave(:,:,wave)=0.0
    64 !  ENDDO
     61  !  DO wave=nwave_sw+1, nwave_sw+nwave_lw
     62  !  tau_strat_wave(:,:,wave)=0.0
     63  !  ENDDO
    6564
    66 !--total vertical aod at the 5 SW + 1 LW wavelengths
    67   DO wave=1, nwave_sw+nwave_lw
    68     DO k=1, klev
    69       tausum_aero(:,wave,id_STRAT_phy)=tausum_aero(:,wave,id_STRAT_phy)+tau_strat_wave(:,k,wave)
     65  !--total vertical aod at the 5 SW + 1 LW wavelengths
     66  DO wave = 1, nwave_sw + nwave_lw
     67    DO k = 1, klev
     68      tausum_aero(:, wave, id_STRAT_phy) = tausum_aero(:, wave, id_STRAT_phy) + tau_strat_wave(:, k, wave)
    7069    ENDDO
    7170  ENDDO
    7271
    73 !--weighted average for cg, piz and tau, adding strat aerosols on top of tropospheric ones
    74   DO band=1, nbands_sw_rrtm
     72  !--weighted average for cg, piz and tau, adding strat aerosols on top of tropospheric ones
     73  DO band = 1, nbands_sw_rrtm
    7574    !--no stratospheric aerosol in index 1
    76     cg_aero_sw_rrtm(:,:,1,band)  =  cg_aero_sw_rrtm(:,:,2,band)
    77     piz_aero_sw_rrtm(:,:,1,band)  = piz_aero_sw_rrtm(:,:,2,band)
    78     tau_aero_sw_rrtm(:,:,1,band)  = tau_aero_sw_rrtm(:,:,2,band)
     75    cg_aero_sw_rrtm(:, :, 1, band) = cg_aero_sw_rrtm(:, :, 2, band)
     76    piz_aero_sw_rrtm(:, :, 1, band) = piz_aero_sw_rrtm(:, :, 2, band)
     77    tau_aero_sw_rrtm(:, :, 1, band) = tau_aero_sw_rrtm(:, :, 2, band)
    7978
    8079    !--tropospheric and stratospheric aerosol in index 2
    81     cg_aero_sw_rrtm(:,:,2,band) = ( cg_aero_sw_rrtm(:,:,2,band)*piz_aero_sw_rrtm(:,:,2,band)*tau_aero_sw_rrtm(:,:,2,band) + &
    82                                 cg_strat(:,:,band)*piz_strat(:,:,band)*tau_strat(:,:,band) ) /                              &
    83                                 MAX( piz_aero_sw_rrtm(:,:,2,band)*tau_aero_sw_rrtm(:,:,2,band) +                            &
    84                                 piz_strat(:,:,band)*tau_strat(:,:,band), 1.e-15 )
    85     piz_aero_sw_rrtm(:,:,2,band)= ( piz_aero_sw_rrtm(:,:,2,band)*tau_aero_sw_rrtm(:,:,2,band) +                            &
    86                                 piz_strat(:,:,band)*tau_strat(:,:,band) ) /                                                &
    87                                 MAX( tau_aero_sw_rrtm(:,:,2,band) + tau_strat(:,:,band), 1.e-15 )
    88     tau_aero_sw_rrtm(:,:,2,band)= tau_aero_sw_rrtm(:,:,2,band) + tau_strat(:,:,band)
     80    cg_aero_sw_rrtm(:, :, 2, band) = (cg_aero_sw_rrtm(:, :, 2, band) * piz_aero_sw_rrtm(:, :, 2, band) * tau_aero_sw_rrtm(:, :, 2, band) + &
     81            cg_strat(:, :, band) * piz_strat(:, :, band) * tau_strat(:, :, band)) / &
     82            MAX(piz_aero_sw_rrtm(:, :, 2, band) * tau_aero_sw_rrtm(:, :, 2, band) + &
     83                    piz_strat(:, :, band) * tau_strat(:, :, band), 1.e-15)
     84    piz_aero_sw_rrtm(:, :, 2, band) = (piz_aero_sw_rrtm(:, :, 2, band) * tau_aero_sw_rrtm(:, :, 2, band) + &
     85            piz_strat(:, :, band) * tau_strat(:, :, band)) / &
     86            MAX(tau_aero_sw_rrtm(:, :, 2, band) + tau_strat(:, :, band), 1.e-15)
     87    tau_aero_sw_rrtm(:, :, 2, band) = tau_aero_sw_rrtm(:, :, 2, band) + tau_strat(:, :, band)
    8988  ENDDO
    9089
    91   DO band=1, nbands_lw_rrtm
     90  DO band = 1, nbands_lw_rrtm
    9291    !--no stratospheric aerosols in index 1
    93     tau_aero_lw_rrtm(:,:,1,band)  = tau_aero_lw_rrtm(:,:,2,band)
     92    tau_aero_lw_rrtm(:, :, 1, band) = tau_aero_lw_rrtm(:, :, 2, band)
    9493    !--tropospheric and stratospheric aerosol in index 2
    95     tau_aero_lw_rrtm(:,:,2,band)  = tau_aero_lw_rrtm(:,:,2,band) + tau_lw_abs_rrtm(:,:,band)
     94    tau_aero_lw_rrtm(:, :, 2, band) = tau_aero_lw_rrtm(:, :, 2, band) + tau_lw_abs_rrtm(:, :, band)
    9695  ENDDO
    9796
    98   WHERE (tau_aero_sw_rrtm < 1.e-14) piz_aero_sw_rrtm=1.0
    99   WHERE (tau_aero_sw_rrtm < 1.e-14) tau_aero_sw_rrtm=1.e-15
    100   WHERE (tau_aero_lw_rrtm < 1.e-14) tau_aero_lw_rrtm=1.e-15
     97  WHERE (tau_aero_sw_rrtm < 1.e-14) piz_aero_sw_rrtm = 1.0
     98  WHERE (tau_aero_sw_rrtm < 1.e-14) tau_aero_sw_rrtm = 1.e-15
     99  WHERE (tau_aero_lw_rrtm < 1.e-14) tau_aero_lw_rrtm = 1.e-15
    101100
    102   tausum_strat(:,:)=0.0
    103   DO i=1,klon
    104   DO k=1,klev
    105     IF (stratomask(i,k)>0.5) THEN
    106       tausum_strat(i,1)=tausum_strat(i,1)+tau_strat_wave(i,k,2)  !--550 nm
    107       tausum_strat(i,2)=tausum_strat(i,2)+tau_strat_wave(i,k,5)  !--1020 nm
    108       tausum_strat(i,3)=tausum_strat(i,3)+tau_strat_wave(i,k,6)  !--10 um
    109     ENDIF
    110   ENDDO
     101  tausum_strat(:, :) = 0.0
     102  DO i = 1, klon
     103    DO k = 1, klev
     104      IF (stratomask(i, k)>0.5) THEN
     105        tausum_strat(i, 1) = tausum_strat(i, 1) + tau_strat_wave(i, k, 2)  !--550 nm
     106        tausum_strat(i, 2) = tausum_strat(i, 2) + tau_strat_wave(i, k, 5)  !--1020 nm
     107        tausum_strat(i, 3) = tausum_strat(i, 3) + tau_strat_wave(i, k, 6)  !--10 um
     108      ENDIF
     109    ENDDO
    111110  ENDDO
    112111
    113   DO i=1,klon
    114   DO k=1,klev
    115     zrho=pplay(i,k)/t_seri(i,k)/RD            !air density in kg/m3
    116     zdz=(paprs(i,k)-paprs(i,k+1))/zrho/RG     !thickness of layer in m
    117     tau_strat_550(i,k)=tau_strat_wave(i,k,2)/zdz
    118     tau_strat_1020(i,k)=tau_strat_wave(i,k,5)/zdz
    119   ENDDO
     112  DO i = 1, klon
     113    DO k = 1, klev
     114      zrho = pplay(i, k) / t_seri(i, k) / RD            !air density in kg/m3
     115      zdz = (paprs(i, k) - paprs(i, k + 1)) / zrho / RG     !thickness of layer in m
     116      tau_strat_550(i, k) = tau_strat_wave(i, k, 2) / zdz
     117      tau_strat_1020(i, k) = tau_strat_wave(i, k, 5) / zdz
     118    ENDDO
    120119  ENDDO
    121120
Note: See TracChangeset for help on using the changeset viewer.