Ignore:
Timestamp:
Jun 3, 2016, 7:06:41 PM (8 years ago)
Author:
oboucher
Message:

Changed nbands_sw_rrtm to NSW and nbands_lw_rrtm to NLW to be completely rrtm-proof

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/rrtm/readaerosolstrato2_rrtm.F90

    r2536 r2539  
    2222
    2323    include "YOMCST.h"
     24    INCLUDE "clesphys.h"
    2425
    2526    CHARACTER (len = 80) :: abort_message
     
    7172!--------------------------------------------------------
    7273
    73     IF (.not.ALLOCATED(tau_aer_strat)) ALLOCATE(tau_aer_strat(klon,klev,nbands_sw_rrtm))
    74     IF (.not.ALLOCATED(piz_aer_strat)) ALLOCATE(piz_aer_strat(klon,klev,nbands_sw_rrtm))
    75     IF (.not.ALLOCATED(cg_aer_strat))  ALLOCATE(cg_aer_strat(klon,klev,nbands_sw_rrtm))
    76 
    77     IF (.not.ALLOCATED(taulw_aer_strat)) ALLOCATE(taulw_aer_strat(klon,klev,nbands_lw_rrtm))
     74    IF (.not.ALLOCATED(tau_aer_strat)) ALLOCATE(tau_aer_strat(klon,klev,NSW))
     75    IF (.not.ALLOCATED(piz_aer_strat)) ALLOCATE(piz_aer_strat(klon,klev,NSW))
     76    IF (.not.ALLOCATED(cg_aer_strat))  ALLOCATE(cg_aer_strat(klon,klev,NSW))
     77
     78    IF (.not.ALLOCATED(taulw_aer_strat)) ALLOCATE(taulw_aer_strat(klon,klev,NLW))
    7879
    7980!--we only read monthly strat aerosol data
     
    9293
    9394!--Starts with SW optical properties
    94     IF (nbands_sw_rrtm.NE.6) THEN
    95        abort_message='nbands_sw_rrtm doit etre egal a 6 dans readaerosolstrat_rrtm'
    96        CALL abort_physic(modname,abort_message,1)
    97     ENDIF
    9895
    9996    CALL nf95_open("tauswstrat.2D.nc", nf90_nowrite, ncid_in)
     
    128125    n_wav = size(wav)
    129126    print *, 'WAV aerosol strato=', n_wav, wav
    130     IF (n_wav.NE.nbands_sw_rrtm) THEN
     127    IF (n_wav.NE.NSW) THEN
    131128       abort_message='Le nombre de wav n est pas egal a NSW'
    132129       CALL abort_physic(modname,abort_message,1)
     
    176173
    177174!---reduce to a klon_glo grid
    178     DO band=1, nbands_sw_rrtm
     175    DO band=1, NSW
    179176      CALL grid2dTo1d_glo(tauaerstrat_mois(:,:,:,band),tauaerstrat_mois_glo(:,:,band))
    180177      CALL grid2dTo1d_glo(pizaerstrat_mois(:,:,:,band),pizaerstrat_mois_glo(:,:,band))
     
    184181!--Now LW optical properties
    185182!
    186     IF (nbands_lw_rrtm .NE. NLW) then
    187       abort_message='different values for NLW and nbands_lw_rrtm'
    188       CALL abort_physic(modname,abort_message,1)
    189     ENDIF
    190 
    191183    CALL nf95_open("taulwstrat.2D.nc", nf90_nowrite, ncid_in)
    192184
     
    219211    n_wav = size(wav)
    220212    print *, 'WAV aerosol strato=', n_wav, wav
    221     IF (n_wav.NE.nbands_lw_rrtm) THEN
     213    IF (n_wav.NE.NLW) THEN
    222214       abort_message='Le nombre de wav n est pas egal a NLW'
    223215       CALL abort_physic(modname,abort_message,1)
     
    244236
    245237!---reduce to a klon_glo grid
    246     DO band=1, nbands_lw_rrtm
     238    DO band=1, NLW
    247239      CALL grid2dTo1d_glo(taulwaerstrat_mois(:,:,:,band),taulwaerstrat_mois_glo(:,:,band))
    248240    ENDDO
     
    289281
    290282!--weighted average for cg, piz and tau, adding strat aerosols on top of tropospheric ones
    291     DO band=1, nbands_sw_rrtm
     283    DO band=1, NSW
    292284    WHERE (stratomask.GT.0.999999)
    293 !--anthropogenic aerosols bands 1 to nbands_sw_rrtm
     285!--anthropogenic aerosols bands 1 to NSW
    294286    cg_aero_sw_rrtm(:,:,2,band)  = ( cg_aero_sw_rrtm(:,:,2,band)*piz_aero_sw_rrtm(:,:,2,band)*tau_aero_sw_rrtm(:,:,2,band) + &
    295287                                     cg_aer_strat(:,:,band)*piz_aer_strat(:,:,band)*tau_aer_strat(:,:,band) ) /              &
     
    300292                                MAX( tau_aero_sw_rrtm(:,:,2,band) + tau_aer_strat(:,:,band), 1.e-15 )
    301293    tau_aero_sw_rrtm(:,:,2,band)  = tau_aero_sw_rrtm(:,:,2,band) + tau_aer_strat(:,:,band)
    302 !--natural aerosols bands 1 to nbands_sw_rrtm
     294!--natural aerosols bands 1 to NSW
    303295    cg_aero_sw_rrtm(:,:,1,band)  = ( cg_aero_sw_rrtm(:,:,1,band)*piz_aero_sw_rrtm(:,:,1,band)*tau_aero_sw_rrtm(:,:,1,band) + &
    304296                                     cg_aer_strat(:,:,band)*piz_aer_strat(:,:,band)*tau_aer_strat(:,:,band) ) /              &
     
    316308    ENDDO
    317309
    318     DO band=1, nbands_lw_rrtm
     310    DO band=1, NLW
    319311    WHERE (stratomask.GT.0.999999)
    320312    tau_aero_lw_rrtm(:,:,2,band)  = tau_aero_lw_rrtm(:,:,2,band) + taulw_aer_strat(:,:,band)
Note: See TracChangeset for help on using the changeset viewer.