! ! $Id: radlwsw_aero.F90 2056 2014-06-11 13:46:46Z fairhead $ ! SUBROUTINE radlwsw_aero( & dist, rmu0, fract, & paprs, pplay,tsol,alb1, alb2,& t,q,wo,& cldfra, cldemi, cldtaupd,& ok_ade, ok_aie,& tau_aero, piz_aero, cg_aero,& cldtaupi, new_aod, & heat,heat0,cool,cool0,radsol,albpla,& topsw,toplw,solsw,sollw,& sollwdown,& topsw0,toplw0,solsw0,sollw0,& lwdn0, lwdn, lwup0, lwup,& swdn0, swdn, swup0, swup,& topswad_aero, solswad_aero,& topswai_aero, solswai_aero, & topswad0_aero, solswad0_aero,& topsw_aero, topsw0_aero,& solsw_aero, solsw0_aero,qsat,flwc,fiwc) USE DIMPHY USE comgeomphy USE write_field_phy ! modules necessaires au rayonnement ! ----------------------------------------- ! USE YOMCST , ONLY : RG ,RD ,RTT ,RPI ! USE YOERAD , ONLY : NSW ,LRRTM ,LINHOM , LCCNL,LCCNO, ! USE YOERAD , ONLY : NSW ,LRRTM ,LCCNL ,LCCNO ,& ! NSW mis dans .def MPL 20140211 #ifdef CPP_RRTM ! USE YOERAD , ONLY : LRRTM ,LCCNL ,LCCNO ,& ! NRADIP , NRADLP , NICEOPT, NLIQOPT ,RCCNLND , RCCNSEA ! USE YOELW , ONLY : NSIL ,NTRA ,NUA ,TSTAND ,XP ! USE YOESW , ONLY : RYFWCA ,RYFWCB ,RYFWCC ,RYFWCD,& ! RYFWCE ,RYFWCF ,REBCUA ,REBCUB ,REBCUC,& ! REBCUD ,REBCUE ,REBCUF ,REBCUI ,REBCUJ,& ! REBCUG ,REBCUH ,RHSAVI ,RFULIO ,RFLAA0,& ! RFLAA1 ,RFLBB0 ,RFLBB1 ,RFLBB2 ,RFLBB3,& ! RFLCC0 ,RFLCC1 ,RFLCC2 ,RFLCC3 ,RFLDD0,& ! RFLDD1 ,RFLDD2 ,RFLDD3 ,RFUETA ,RASWCA,& ! RASWCB ,RASWCC ,RASWCD ,RASWCE ,RASWCF !& RASWCB ,RASWCC ,RASWCD ,RASWCE ,RASWCF, RLINLI ! USE YOERDU , ONLY : NUAER ,NTRAER ,REPLOG ,REPSC ,REPSCW ,DIFF ! USE YOETHF , ONLY : RTICE ! USE YOERRTWN , ONLY : DELWAVE ,TOTPLNK USE YOMPHY3 , ONLY : RII0 #endif IMPLICIT NONE !====================================================================== ! Auteur(s): Z.X. Li (LMD/CNRS) date: 19960719 ! Objet: interface entre le modele et les rayonnements ! Arguments: ! dist-----input-R- distance astronomique terre-soleil ! rmu0-----input-R- cosinus de l'angle zenithal ! fract----input-R- duree d'ensoleillement normalisee ! co2_ppm--input-R- concentration du gaz carbonique (en ppm) ! solaire--input-R- constante solaire (W/m**2) ! paprs----input-R- pression a inter-couche (Pa) ! pplay----input-R- pression au milieu de couche (Pa) ! tsol-----input-R- temperature du sol (en K) ! alb1-----input-R- albedo du sol(entre 0 et 1) dans l'interval visible ! alb2-----input-R- albedo du sol(entre 0 et 1) dans l'interval proche infra-rouge ! t--------input-R- temperature (K) ! q--------input-R- vapeur d'eau (en kg/kg) ! wo-------input-R- contenu en ozone (en kg/kg) correction MPL 100505 ! cldfra---input-R- fraction nuageuse (entre 0 et 1) ! cldtaupd---input-R- epaisseur optique des nuages dans le visible (present-day value) ! cldemi---input-R- emissivite des nuages dans l'IR (entre 0 et 1) ! ok_ade---input-L- apply the Aerosol Direct Effect or not? ! ok_aie---input-L- apply the Aerosol Indirect Effect or not? ! tau_ae, piz_ae, cg_ae-input-R- aerosol optical properties (calculated in aeropt.F) ! cldtaupi-input-R- epaisseur optique des nuages dans le visible ! calculated for pre-industrial (pi) aerosol concentrations, i.e. with smaller ! droplet concentration, thus larger droplets, thus generally cdltaupi cldtaupd ! it is needed for the diagnostics of the aerosol indirect radiative forcing ! ! heat-----output-R- echauffement atmospherique (visible) (K/jour) ! cool-----output-R- refroidissement dans l'IR (K/jour) ! radsol---output-R- bilan radiatif net au sol (W/m**2) (+ vers le bas) ! albpla---output-R- albedo planetaire (entre 0 et 1) ! topsw----output-R- flux solaire net au sommet de l'atm. ! toplw----output-R- ray. IR montant au sommet de l'atmosphere ! solsw----output-R- flux solaire net a la surface ! sollw----output-R- ray. IR montant a la surface ! solswad---output-R- ray. solaire net absorbe a la surface (aerosol dir) ! topswad---output-R- ray. solaire absorbe au sommet de l'atm. (aerosol dir) ! solswai---output-R- ray. solaire net absorbe a la surface (aerosol ind) ! topswai---output-R- ray. solaire absorbe au sommet de l'atm. (aerosol ind) ! ! ATTENTION: swai and swad have to be interpreted in the following manner: ! --------- ! ok_ade=F & ok_aie=F -both are zero ! ok_ade=T & ok_aie=F -aerosol direct forcing is F_{AD} = topsw-topswad ! indirect is zero ! ok_ade=F & ok_aie=T -aerosol indirect forcing is F_{AI} = topsw-topswai ! direct is zero ! ok_ade=T & ok_aie=T -aerosol indirect forcing is F_{AI} = topsw-topswai ! aerosol direct forcing is F_{AD} = topswai-topswad ! !====================================================================== ! ==================================================================== ! Adapte au modele de chimie INCA par Celine Deandreis & Anne Cozic -- 2009 ! 1 = ZERO ! 2 = AER total ! 3 = NAT ! 4 = BC ! 5 = SO4 ! 6 = POM ! 7 = DUST ! 8 = SS ! 9 = NO3 ! ! ==================================================================== include "YOETHF.h" include "YOMCST.h" include "clesphys.h" ! Input arguments ! REAL, INTENT(in) :: solaire REAL, INTENT(in) :: dist REAL, INTENT(in) :: rmu0(KLON), fract(KLON) REAL, INTENT(in) :: paprs(KLON,KLEV+1), pplay(KLON,KLEV) REAL, INTENT(in) :: alb1(KLON), alb2(KLON),tsol(KLON) REAL, INTENT(in) :: t(KLON,KLEV), q(KLON,KLEV), wo(KLON,KLEV) LOGICAL, INTENT(in) :: ok_ade, ok_aie ! switches whether to use aerosol direct (indirect) effects or not REAL, INTENT(in) :: cldfra(KLON,KLEV), cldemi(KLON,KLEV), cldtaupd(KLON,KLEV) REAL, INTENT(in) :: tau_aero(KLON,KLEV,9,2) ! aerosol optical properties (see aeropt.F) REAL, INTENT(in) :: piz_aero(KLON,KLEV,9,2) ! aerosol optical properties (see aeropt.F) REAL, INTENT(in) :: cg_aero(KLON,KLEV,9,2) ! aerosol optical properties (see aeropt.F) REAL, INTENT(in) :: cldtaupi(KLON,KLEV) ! cloud optical thickness for pre-industrial aerosol concentrations !MPL input supplementaires pour RECMWFL ! flwc, fiwc = Liquid Water Content & Ice Water Content (kg/kg) REAL*8 GEMU(klon) REAL*8 qsat(klon,klev),flwc(klon,klev),fiwc(klon,klev) !MPL input RECMWFL: !Tableaux aux niveaux inverses pour respecter convention Arpege REAL*8 paprs_i(klon,klev+1) REAL*8 pplay_i(klon,klev) REAL*8 cldfra_i(klon,klev) REAL*8 POZON_i(kdlon,kflev) !!!!! Modif MPL 6.01.09 avec RRTM, on passe de 5 a 6 REAL*8 PAER_i(kdlon,kflev,6) REAL*8 PDP_i(klon,klev) REAL*8 t_i(klon,klev),q_i(klon,klev),qsat_i(klon,klev) REAL*8 flwc_i(klon,klev),fiwc_i(klon,klev) ! new_aod: flag pour retrouver les resultats exacts de l'AR4 dans le cas ou l'on ne travaille qu'avec les sulfates LOGICAL, INTENT(in) :: new_aod LOGICAL lldebug ! Output arguments REAL, INTENT(out) :: heat(KLON,KLEV), cool(KLON,KLEV) REAL, INTENT(out) :: heat0(KLON,KLEV), cool0(KLON,KLEV) REAL, INTENT(out) :: radsol(KLON), topsw(KLON), toplw(KLON) REAL, INTENT(out) :: solsw(KLON), sollw(KLON), albpla(KLON) REAL, INTENT(out) :: topsw0(KLON), toplw0(KLON), solsw0(KLON), sollw0(KLON) REAL, INTENT(out) :: sollwdown(KLON) REAL, INTENT(out) :: swdn(KLON,kflev+1),swdn0(KLON,kflev+1) REAL, INTENT(out) :: swup(KLON,kflev+1),swup0(KLON,kflev+1) REAL, INTENT(out) :: lwdn(KLON,kflev+1),lwdn0(KLON,kflev+1) REAL, INTENT(out) :: lwup(KLON,kflev+1),lwup0(KLON,kflev+1) REAL, INTENT(out) :: topswad_aero(KLON), solswad_aero(KLON) ! output: aerosol direct forcing at TOA and surface REAL, INTENT(out) :: topswai_aero(KLON), solswai_aero(KLON) ! output: aerosol indirect forcing atTOA and surface REAL, DIMENSION(klon), INTENT(out) :: topswad0_aero REAL, DIMENSION(klon), INTENT(out) :: solswad0_aero REAL, DIMENSION(kdlon,9), INTENT(out) :: topsw_aero REAL, DIMENSION(kdlon,9), INTENT(out) :: topsw0_aero REAL, DIMENSION(kdlon,9), INTENT(out) :: solsw_aero REAL, DIMENSION(kdlon,9), INTENT(out) :: solsw0_aero ! --------- output RECMWFL ! ZEMTD (KPROMA,KLEV+1) ; TOTAL DOWNWARD LONGWAVE EMISSIVITY ! ZEMTU (KPROMA,KLEV+1) ; TOTAL UPWARD LONGWAVE EMISSIVITY ! ZTRSO (KPROMA,KLEV+1) ; TOTAL SHORTWAVE TRANSMISSIVITY ! ZTH (KPROMA,KLEV+1) ; HALF LEVEL TEMPERATURE ! ZCTRSO(KPROMA,2) ; CLEAR-SKY SHORTWAVE TRANSMISSIVITY ! ZCEMTR(KPROMA,2) ; CLEAR-SKY NET LONGWAVE EMISSIVITY ! ZTRSOD(KPROMA) ; TOTAL-SKY SURFACE SW TRANSMISSITY ! ZLWFC (KPROMA,2) ; CLEAR-SKY LONGWAVE FLUXES ! ZLWFT (KPROMA,KLEV+1) ; TOTAL-SKY LONGWAVE FLUXES ! ZLWFT0(KPROMA,KLEV+1) ; CLEAR-SKY LONGWAVE FLUXES ! added by MPL 090109 ! ZSWFC (KPROMA,2) ; CLEAR-SKY SHORTWAVE FLUXES ! ZSWFT (KPROMA,KLEV+1) ; TOTAL-SKY SHORTWAVE FLUXES ! ZSWFT0(KPROMA,KLEV+1) ; CLEAR-SKY SHORTWAVE FLUXES ! added by MPL 090109 ! ZFLUX (KLON,2,KLEV+1) ; TOTAL LW FLUXES 1=up, 2=DWN ! added by MPL 080411 ! ZFLUC (KLON,2,KLEV+1) ; CLEAR SKY LW FLUXES ! added by MPL 080411 ! ZFSDWN(klon,KLEV+1) ; TOTAL SW DWN FLUXES ! added by MPL 080411 ! ZFCDWN(klon,KLEV+1) ; CLEAR SKY SW DWN FLUXES ! added by MPL 080411 ! ZFSUP (klon,KLEV+1) ; TOTAL SW UP FLUXES ! added by MPL 080411 ! ZFCUP (klon,KLEV+1) ; CLEAR SKY SW UP FLUXES ! added by MPL 080411 !MPL output RECMWFL: REAL*8 ZEMTD (klon,klev+1),ZEMTD_i (klon,klev+1) REAL*8 ZEMTU (klon,klev+1),ZEMTU_i (klon,klev+1) REAL*8 ZTRSO (klon,klev+1),ZTRSO_i (klon,klev+1) REAL*8 ZTH (klon,klev+1),ZTH_i (klon,klev+1) REAL*8 ZCTRSO(klon,2) REAL*8 ZCEMTR(klon,2) REAL*8 ZTRSOD(klon) REAL*8 ZLWFC (klon,2) REAL*8 ZLWFT (klon,klev+1),ZLWFT_i (klon,klev+1) REAL*8 ZSWFC (klon,2) REAL*8 ZSWFT (klon,klev+1),ZSWFT_i (klon,klev+1) REAL*8 ZSWFT0(klon,klev+1),ZLWFT0 (klon,klev+1) REAL*8 PPIZA_DST(klon,klev,NSW) REAL*8 PCGA_DST(klon,klev,NSW) REAL*8 PTAUREL_DST(klon,klev,NSW) REAL*8 PSFSWDIR(klon,NSW) REAL*8 PSFSWDIF(klon,NSW) REAL*8 PFSDNN(klon) REAL*8 PFSDNV(klon) !MPL On ne redefinit pas les tableaux ZFLUX,ZFLUC, !MPL ZFSDWN,ZFCDWN,ZFSUP,ZFCUP car ils existent deja !MPL sous les noms de ZFLDN,ZFLDN0,ZFLUP,ZFLUP0, !MPL ZFSDN,ZFSDN0,ZFSUP,ZFSUP0 REAL*8 ZFLUX_i (klon,2,klev+1) REAL*8 ZFLUC_i (klon,2,klev+1) REAL*8 ZFSDWN_i (klon,klev+1) REAL*8 ZFCDWN_i (klon,klev+1) REAL*8 ZFSUP_i (klon,klev+1) REAL*8 ZFCUP_i (klon,klev+1) ! Local variables REAL*8 ZFSUP(KDLON,KFLEV+1) REAL*8 ZFSDN(KDLON,KFLEV+1) REAL*8 ZFSUP0(KDLON,KFLEV+1) REAL*8 ZFSDN0(KDLON,KFLEV+1) REAL*8 ZFLUP(KDLON,KFLEV+1) REAL*8 ZFLDN(KDLON,KFLEV+1) REAL*8 ZFLUP0(KDLON,KFLEV+1) REAL*8 ZFLDN0(KDLON,KFLEV+1) REAL*8 zx_alpha1, zx_alpha2 INTEGER k, kk, i, j, iof, nb_gr INTEGER ist,iend,ktdia,kmode INTEGER , SAVE :: iprint=0 REAL*8 PSCT REAL*8 PALBD(kdlon,2), PALBP(kdlon,2) REAL*8 PALBD_NEW(kdlon,NSW), PALBP_NEW(kdlon,NSW) REAL*8 PEMIS(kdlon), PDT0(kdlon), PVIEW(kdlon) REAL*8 PPSOL(kdlon), PDP(kdlon,KLEV) REAL*8 PTL(kdlon,kflev+1), PPMB(kdlon,kflev+1) REAL*8 PTAVE(kdlon,kflev) REAL*8 PWV(kdlon,kflev), PQS(kdlon,kflev), POZON(kdlon,kflev) !!!!! Modif MPL 6.01.09 avec RRTM, on passe de 5 a 6 REAL*8 PAER(kdlon,kflev,6) REAL*8 PCLDLD(kdlon,kflev) REAL*8 PCLDLU(kdlon,kflev) REAL*8 PCLDSW(kdlon,kflev) REAL*8 PTAU(kdlon,2,kflev) REAL*8 POMEGA(kdlon,2,kflev) REAL*8 PCG(kdlon,2,kflev) REAL*8 zfract(kdlon), zrmu0(kdlon), zdist REAL*8 zheat(kdlon,kflev), zcool(kdlon,kflev) REAL*8 zheat0(kdlon,kflev), zcool0(kdlon,kflev) REAL*8 ztopsw(kdlon), ztoplw(kdlon) REAL*8 zsolsw(kdlon), zsollw(kdlon), zalbpla(kdlon) REAL*8 zsollwdown(kdlon) REAL*8 ztopsw0(kdlon), ztoplw0(kdlon) REAL*8 zsolsw0(kdlon), zsollw0(kdlon) REAL*8 zznormcp REAL*8 tauaero(kdlon,kflev,9,2) ! aer opt properties REAL*8 pizaero(kdlon,kflev,9,2) REAL*8 cgaero(kdlon,kflev,9,2) REAL*8 PTAUA(kdlon,2,kflev) ! present-day value of cloud opt thickness (PTAU is pre-industrial value), local use REAL*8 POMEGAA(kdlon,2,kflev) ! dito for single scatt albedo REAL*8 ztopswadaero(kdlon), zsolswadaero(kdlon) ! Aerosol direct forcing at TOAand surface REAL*8 ztopswad0aero(kdlon), zsolswad0aero(kdlon) ! Aerosol direct forcing at TOAand surface REAL*8 ztopswaiaero(kdlon), zsolswaiaero(kdlon) ! dito, indirect REAL*8 ztopsw_aero(kdlon,9), ztopsw0_aero(kdlon,9) REAL*8 zsolsw_aero(kdlon,9), zsolsw0_aero(kdlon,9) CHARACTER (LEN=20) :: modname CHARACTER (LEN=80) :: abort_message ! initialisation ist=1 iend=klon ktdia=1 kmode=ist lldebug=.FALSE. ! initialisation tauaero(:,:,:,:)=0. pizaero(:,:,:,:)=0. cgaero(:,:,:,:)=0. ! !------------------------------------------- nb_gr = KLON / kdlon IF (nb_gr*kdlon .NE. KLON) THEN PRINT*, "kdlon mauvais:", KLON, kdlon, nb_gr CALL abort ENDIF IF (kflev .NE. KLEV) THEN PRINT*, "kflev differe de KLEV, kflev, KLEV" CALL abort ENDIF !------------------------------------------- ! print *,'Entree de radlwsw, iflag_rrtm tsol=',iflag_rrtm,tsol IF (iprint>10) THEN DO k = 1, KLEV DO i = 1, KLON ! print *,'En entree de radlwsw: k tsol temp',k,tsol,t(1,k) heat(i,k)=0. cool(i,k)=0. heat0(i,k)=0. cool0(i,k)=0. ENDDO ENDDO ENDIF ! zdist = dist ! PSCT = solaire/zdist/zdist DO j = 1, nb_gr iof = kdlon*(j-1) DO i = 1, kdlon zfract(i) = fract(iof+i) zrmu0(i) = rmu0(iof+i) PALBD(i,1) = alb1(iof+i) ! PALBD(i,2) = alb1(iof+i) PALBD(i,2) = alb2(iof+i) ! PALBD_NEW(i,1) = alb1(iof+i) DO kk=2,NSW PALBD_NEW(i,kk) = alb2(iof+i) ENDDO ! PALBD_NEW(i,2) = alb2(iof+i) ! PALBD_NEW(i,3) = alb2(iof+i) ! PALBD_NEW(i,4) = alb2(iof+i) ! PALBD_NEW(i,5) = alb2(iof+i) ! PALBD_NEW(i,6) = alb2(iof+i) ! PALBP(i,1) = alb1(iof+i) ! PALBP(i,2) = alb1(iof+i) PALBP(i,2) = alb2(iof+i) ! PALBP_NEW(i,1) = alb1(iof+i) DO kk=2,NSW PALBP_NEW(i,kk) = alb2(iof+i) ENDDO ! PALBP_NEW(i,2) = alb2(iof+i) ! PALBP_NEW(i,3) = alb2(iof+i) ! PALBP_NEW(i,4) = alb2(iof+i) ! PALBP_NEW(i,5) = alb2(iof+i) ! PALBP_NEW(i,6) = alb2(iof+i) PEMIS(i) = 1.0 PVIEW(i) = 1.66 PPSOL(i) = paprs(iof+i,1) zx_alpha1 = (paprs(iof+i,1)-pplay(iof+i,2))/(pplay(iof+i,1)-pplay(iof+i,2)) zx_alpha2 = 1.0 - zx_alpha1 PTL(i,1) = t(iof+i,1) * zx_alpha1 + t(iof+i,2) * zx_alpha2 PTL(i,KLEV+1) = t(iof+i,KLEV) PDT0(i) = tsol(iof+i) - PTL(i,1) ENDDO DO k = 2, kflev DO i = 1, kdlon PTL(i,k) = (t(iof+i,k)+t(iof+i,k-1))*0.5 ENDDO ENDDO DO k = 1, kflev DO i = 1, kdlon PDP(i,k) = paprs(iof+i,k)-paprs(iof+i,k+1) PTAVE(i,k) = t(iof+i,k) PWV(i,k) = MAX (q(iof+i,k), 1.0e-12) PQS(i,k) = PWV(i,k) ! wo: cm.atm (epaisseur en cm dans la situation standard) ! POZON: kg/kg POZON(i,k) = MAX(wo(iof+i,k),1.0e-12)*RG/46.6968 & /(paprs(iof+i,k)-paprs(iof+i,k+1))& *(paprs(iof+i,1)/101325.0) PCLDLD(i,k) = cldfra(iof+i,k)*cldemi(iof+i,k) PCLDLU(i,k) = cldfra(iof+i,k)*cldemi(iof+i,k) PCLDSW(i,k) = cldfra(iof+i,k) PTAU(i,1,k) = MAX(cldtaupi(iof+i,k), 1.0e-05)! 1e-12 serait instable PTAU(i,2,k) = MAX(cldtaupi(iof+i,k), 1.0e-05)! pour 32-bit machines POMEGA(i,1,k) = 0.9999 - 5.0e-04 * EXP(-0.5 * PTAU(i,1,k)) POMEGA(i,2,k) = 0.9988 - 2.5e-03 * EXP(-0.05 * PTAU(i,2,k)) PCG(i,1,k) = 0.865 PCG(i,2,k) = 0.910 !- ! Introduced for aerosol indirect forcings. ! The following values use the cloud optical thickness calculated from ! present-day aerosol concentrations whereas the quantities without the ! "A" at the end are for pre-industial (natural-only) aerosol concentrations ! PTAUA(i,1,k) = MAX(cldtaupd(iof+i,k), 1.0e-05)! 1e-12 serait instable PTAUA(i,2,k) = MAX(cldtaupd(iof+i,k), 1.0e-05)! pour 32-bit machines POMEGAA(i,1,k) = 0.9999 - 5.0e-04 * EXP(-0.5 * PTAUA(i,1,k)) POMEGAA(i,2,k) = 0.9988 - 2.5e-03 * EXP(-0.05 * PTAUA(i,2,k)) ENDDO ENDDO ! DO k = 1, kflev+1 DO i = 1, kdlon PPMB(i,k) = paprs(iof+i,k)/100.0 ENDDO ENDDO ! !!!!! Modif MPL 6.01.09 avec RRTM, on passe de 5 a 6 DO kk = 1, 6 DO k = 1, kflev DO i = 1, kdlon PAER(i,k,kk) = 1.0E-15 ENDDO ENDDO ENDDO DO k = 1, kflev DO i = 1, kdlon tauaero(i,k,:,1)=tau_aero(iof+i,k,:,1) pizaero(i,k,:,1)=piz_aero(iof+i,k,:,1) cgaero(i,k,:,1) =cg_aero(iof+i,k,:,1) tauaero(i,k,:,2)=tau_aero(iof+i,k,:,2) pizaero(i,k,:,2)=piz_aero(iof+i,k,:,2) cgaero(i,k,:,2) =cg_aero(iof+i,k,:,2) ENDDO ENDDO ! !====================================================================== !===== si iflag_rrtm=0 ================================================ !IM ctes ds clesphys.h CALL LW(RCO2,RCH4,RN2O,RCFC11,RCFC12, !IM ctes ds clesphys.h CALL SW(PSCT, RCO2, zrmu0, zfract, ! IF (iflag_rrtm.eq.0) then !----- Mise a zero des tableaux output du rayonnement LW-AR4 ---------- DO k = 1, kflev+1 DO i = 1, kdlon ZFLUP(i,k)=0. ZFLDN(i,k)=0. ZFLUP0(i,k)=0. ZFLDN0(i,k)=0. ENDDO ENDDO DO k = 1, kflev DO i = 1, kdlon zcool(i,k)=0. zcool0(i,k)=0. ENDDO ENDDO DO i = 1, kdlon ztoplw(i)=0. zsollw(i)=0. ztoplw0(i)=0. zsollw0(i)=0. zsollwdown(i)=0. ENDDO ! CALL LW_LMDAR4(& PPMB, PDP,& PPSOL,PDT0,PEMIS,& PTL, PTAVE, PWV, POZON, PAER,& PCLDLD,PCLDLU,& PVIEW,& zcool, zcool0,& ztoplw,zsollw,ztoplw0,zsollw0,& zsollwdown,& ZFLUP, ZFLDN, ZFLUP0,ZFLDN0) !----- Mise a zero des tableaux output du rayonnement SW-AR4 ---------- DO k = 1, kflev+1 DO i = 1, kdlon ZFSUP(i,k)=0. ZFSDN(i,k)=0. ZFSUP0(i,k)=0. ZFSDN0(i,k)=0. ENDDO ENDDO DO k = 1, kflev DO i = 1, kdlon zheat(i,k)=0. zheat0(i,k)=0. ENDDO ENDDO DO i = 1, kdlon zalbpla(i)=0. ztopsw(i)=0. zsolsw(i)=0. ztopsw0(i)=0. zsolsw0(i)=0. ztopswadaero(i)=0. zsolswadaero(i)=0. ztopswaiaero(i)=0. zsolswaiaero(i)=0. ENDDO IF (.NOT. new_aod) THEN ! use old version CALL SW_LMDAR4(PSCT, zrmu0, zfract,& PPMB, PDP, & PPSOL, PALBD, PALBP,& PTAVE, PWV, PQS, POZON, PAER,& PCLDSW, PTAU, POMEGA, PCG,& zheat, zheat0,& zalbpla,ztopsw,zsolsw,ztopsw0,zsolsw0,& ZFSUP,ZFSDN,ZFSUP0,ZFSDN0,& tau_aero(:,:,5,:), piz_aero(:,:,5,:), cg_aero(:,:,5,:),& PTAUA, POMEGAA,& ztopswadaero,zsolswadaero,& ztopswaiaero,zsolswaiaero,& ok_ade, ok_aie) ELSE CALL SW_AERO(PSCT, zrmu0, zfract,& PPMB, PDP,& PPSOL, PALBD, PALBP,& PTAVE, PWV, PQS, POZON, PAER,& PCLDSW, PTAU, POMEGA, PCG,& zheat, zheat0,& zalbpla,ztopsw,zsolsw,ztopsw0,zsolsw0,& ZFSUP,ZFSDN,ZFSUP0,ZFSDN0,& tauaero, pizaero, cgaero, & PTAUA, POMEGAA,& ztopswadaero,zsolswadaero,& ztopswad0aero,zsolswad0aero,& ztopswaiaero,zsolswaiaero, & ztopsw_aero,ztopsw0_aero,& zsolsw_aero,zsolsw0_aero,& ok_ade, ok_aie) ENDIF !===== si iflag_rrtm=1, on passe dans SW via RECMWFL =============== !----- Mise a zero des tableaux output de RECMWF ------------------- else #ifdef CPP_RRTM DO k = 1, kflev+1 DO i = 1, kdlon ZEMTD_i(i,k)=0. ZEMTU_i(i,k)=0. ZTRSO_i(i,k)=0. ZTH_i(i,k)=0. ZLWFT_i(i,k)=0. ZSWFT_i(i,k)=0. ZFLUX_i(i,1,k)=0. ZFLUX_i(i,2,k)=0. ZFLUC_i(i,1,k)=0. ZFLUC_i(i,2,k)=0. ZFSDWN_i(i,k)=0. ZFCDWN_i(i,k)=0. ZFSUP_i(i,k)=0. ZFCUP_i(i,k)=0. ENDDO ENDDO ! DO k = 1, kflev DO i = 1, kdlon DO kk = 1, NSW PPIZA_DST(i,k,kk)=0. PCGA_DST(i,k,kk)=0. PTAUREL_DST(i,k,kk)=0. ENDDO ENDDO ENDDO ! DO i = 1, kdlon ZCTRSO(i,1)=0. ZCTRSO(i,2)=0. ZCEMTR(i,1)=0. ZCEMTR(i,2)=0. ZTRSOD(i)=0. ZLWFC(i,1)=0. ZLWFC(i,2)=0. ZSWFC(i,1)=0. ZSWFC(i,2)=0. PFSDNN(i)=0. PFSDNV(i)=0. DO kk = 1, NSW PSFSWDIR(i,kk)=0. PSFSWDIF(i,kk)=0. ENDDO ENDDO !----- Fin des mises a zero des tableaux output de RECMWF ------------------- GEMU(1:klon)=sin(rlatd(1:klon)) ! On met les donnees dans l'ordre des niveaux arpege paprs_i(:,1)=paprs(:,klev+1) DO k=1,klev paprs_i(1:klon,k+1) =paprs(1:klon,klev+1-k) pplay_i(1:klon,k) =pplay(1:klon,klev+1-k) cldfra_i(1:klon,k) =cldfra(1:klon,klev+1-k) PDP_i(1:klon,k) =PDP(1:klon,klev+1-k) t_i(1:klon,k) =t(1:klon,klev+1-k) q_i(1:klon,k) =q(1:klon,klev+1-k) qsat_i(1:klon,k) =qsat(1:klon,klev+1-k) flwc_i(1:klon,k) =flwc(1:klon,klev+1-k) fiwc_i(1:klon,k) =fiwc(1:klon,klev+1-k) ENDDO DO k=1,kflev POZON_i(1:klon,k)=POZON(1:klon,kflev+1-k) ! print *,'Juste avant RECMWFL: k tsol temp',k,tsol,t(1,k) !!!!! Modif MPL 6.01.09 avec RRTM, on passe de 5 a 6 DO i=1,6 PAER_i(1:klon,k,i)=PAER(1:klon,kflev+1-k,i) ENDDO ENDDO ! print *,'RADLWSW: avant RECMWFL, RI0,rmu0 =',solaire,rmu0 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! La version ARPEGE1D utilise differentes valeurs de la constante ! solaire suivant le rayonnement utilise. ! A controler ... ! SOLAR FLUX AT THE TOP (/YOMPHY3/) ! introduce season correction !-------------------------------------- ! RII0 = RIP0 ! IF(LRAYFM) ! RII0 = RIP0M ! =rip0m if Morcrette non-each time step call. ! IF(LRAYFM15) ! RII0 = RIP0M15 ! =rip0m if Morcrette non-each time step call. RII0=solaire ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! Ancien appel a RECMWF (celui du cy25) ! CALL RECMWF (ist , iend, klon , ktdia , klev , kmode , ! s PALBD , PALBP , paprs_i , pplay_i , RCO2 , cldfra_i, ! s POZON_i , PAER_i , PDP_i , PEMIS , GEMU , rmu0, ! s q_i , qsat_i , fiwc_i , flwc_i , zmasq , t_i ,tsol, ! s ZEMTD_i , ZEMTU_i , ZTRSO_i , ! s ZTH_i , ZCTRSO , ZCEMTR , ZTRSOD , ! s ZLWFC , ZLWFT_i , ZSWFC , ZSWFT_i , ! s ZFLUX_i , ZFLUC_i , ZFSDWN_i, ZFSUP_i , ZFCDWN_i,ZFCUP_i) ! s 'RECMWF ') ! IF(lldebug) then call writefield_phy('paprs_i',paprs_i,klev+1) call writefield_phy('pplay_i',pplay_i,klev) call writefield_phy('cldfra_i',cldfra_i,klev) call writefield_phy('pozon_i',POZON_i,klev) call writefield_phy('paer_i',PAER_i,klev) call writefield_phy('pdp_i',PDP_i,klev) call writefield_phy('q_i',q_i,klev) call writefield_phy('qsat_i',qsat_i,klev) call writefield_phy('fiwc_i',fiwc_i,klev) call writefield_phy('flwc_i',flwc_i,klev) call writefield_phy('t_i',t_i,klev) call writefield_phy('palbd_new',PALBD_NEW,NSW) call writefield_phy('palbp_new',PALBP_NEW,NSW) ENDIF ! Nouvel appel a RECMWF (celui du cy32t0) CALL RECMWF (ist , iend, klon , ktdia , klev , kmode ,& PALBD_NEW,PALBP_NEW, paprs_i , pplay_i , RCO2 , cldfra_i,& POZON_i , PAER_i , PDP_i , PEMIS , rmu0 ,& q_i , qsat_i , fiwc_i , flwc_i , zmasq , t_i ,tsol,& ZEMTD_i , ZEMTU_i , ZTRSO_i ,& ZTH_i , ZCTRSO , ZCEMTR , ZTRSOD ,& ZLWFC , ZLWFT_i , ZSWFC , ZSWFT_i ,& PSFSWDIR , PSFSWDIF, PFSDNN , PFSDNV ,& PPIZA_DST, PCGA_DST,PTAUREL_DST,ZFLUX_i , ZFLUC_i ,& ZFSDWN_i , ZFSUP_i , ZFCDWN_i, ZFCUP_i) print *,'RADLWSW: apres RECMWF' IF(lldebug) THEN call writefield_phy('zemtd_i',ZEMTD_i,klev+1) call writefield_phy('zemtu_i',ZEMTU_i,klev+1) call writefield_phy('ztrso_i',ZTRSO_i,klev+1) call writefield_phy('zth_i',ZTH_i,klev+1) call writefield_phy('zctrso',ZCTRSO,2) call writefield_phy('zcemtr',ZCEMTR,2) call writefield_phy('ztrsod',ZTRSOD,1) call writefield_phy('zlwfc',ZLWFC,2) call writefield_phy('zlwft_i',ZLWFT_i,klev+1) call writefield_phy('zswfc',ZSWFC,2) call writefield_phy('zswft_i',ZSWFT_i,klev+1) call writefield_phy('psfswdir',PSFSWDIR,6) call writefield_phy('psfswdif',PSFSWDIF,6) call writefield_phy('pfsdnn',PFSDNN,1) call writefield_phy('pfsdnv',PFSDNV,1) call writefield_phy('ppiza_dst',PPIZA_DST,klev) call writefield_phy('pcga_dst',PCGA_DST,klev) call writefield_phy('ptaurel_dst',PTAUREL_DST,klev) call writefield_phy('zflux_i',ZFLUX_i,klev+1) call writefield_phy('zfluc_i',ZFLUC_i,klev+1) call writefield_phy('zfsdwn_i',ZFSDWN_i,klev+1) call writefield_phy('zfsup_i',ZFSUP_i,klev+1) call writefield_phy('zfcdwn_i',ZFCDWN_i,klev+1) call writefield_phy('zfcup_i',ZFCUP_i,klev+1) ENDIF ! --------- output RECMWFL ! ZEMTD (KPROMA,KLEV+1) ; TOTAL DOWNWARD LONGWAVE EMISSIVITY ! ZEMTU (KPROMA,KLEV+1) ; TOTAL UPWARD LONGWAVE EMISSIVITY ! ZTRSO (KPROMA,KLEV+1) ; TOTAL SHORTWAVE TRANSMISSIVITY ! ZTH (KPROMA,KLEV+1) ; HALF LEVEL TEMPERATURE ! ZCTRSO (KPROMA,2) ; CLEAR-SKY SHORTWAVE TRANSMISSIVITY ! ZCEMTR (KPROMA,2) ; CLEAR-SKY NET LONGWAVE EMISSIVITY ! ZTRSOD (KPROMA) ; TOTAL-SKY SURFACE SW TRANSMISSITY ! ZLWFC (KPROMA,2) ; CLEAR-SKY LONGWAVE FLUXES ! ZLWFT (KPROMA,KLEV+1) ; TOTAL-SKY LONGWAVE FLUXES ! ZSWFC (KPROMA,2) ; CLEAR-SKY SHORTWAVE FLUXES ! ZSWFT (KPROMA,KLEV+1) ; TOTAL-SKY SHORTWAVE FLUXES ! PPIZA_DST (KPROMA,KLEV,NSW); Single scattering albedo of dust ! PCGA_DST (KPROMA,KLEV,NSW); Assymetry factor for dust ! PTAUREL_DST (KPROMA,KLEV,NSW); Optical depth of dust relative to at 550nm ! PSFSWDIR (KPROMA,NSW) ; ! PSFSWDIF (KPROMA,NSW) ; ! PFSDNN (KPROMA) ; ! PFSDNV (KPROMA) ; ! --------- ! On retablit l'ordre des niveaux lmd pour les tableaux de sortie DO k=0,klev ZEMTD(1:klon,k+1) = ZEMTD_i(1:klon,k+1) ZEMTU(1:klon,k+1) = ZEMTU_i(1:klon,k+1) ZTRSO(1:klon,k+1) = ZTRSO_i(1:klon,k+1) ZTH(1:klon,k+1) = ZTH_i(1:klon,k+1) ! ZLWFT(1:klon,k+1) = ZLWFT_i(1:klon,klev+1-k) ! ZSWFT(1:klon,k+1) = ZSWFT_i(1:klon,klev+1-k) ZFLUP(1:klon,k+1) = ZFLUX_i(1:klon,1,k+1) ZFLDN(1:klon,k+1) = ZFLUX_i(1:klon,2,k+1) ZFLUP0(1:klon,k+1) = ZFLUC_i(1:klon,1,k+1) ZFLDN0(1:klon,k+1) = ZFLUC_i(1:klon,2,k+1) ZFSDN(1:klon,k+1) = ZFSDWN_i(1:klon,k+1) ZFSDN0(1:klon,k+1) = ZFCDWN_i(1:klon,k+1) ZFSUP (1:klon,k+1) = ZFSUP_i(1:klon,k+1) ZFSUP0(1:klon,k+1) = ZFCUP_i(1:klon,k+1) ! Nouveau calcul car visiblement ZSWFT et ZSWFC sont nuls dans RRTM cy32 ! en sortie de radlsw.F90 - MPL 7.01.09 ZSWFT(1:klon,k+1) = ZFSDWN_i(1:klon,k+1)-ZFSUP_i(1:klon,k+1) ZSWFT0(1:klon,k+1) = ZFCDWN_i(1:klon,k+1)-ZFCUP_i(1:klon,k+1) ! WRITE(*,'("FSDN FSUP FCDN FCUP: ",4E12.5)') ZFSDWN_i(1:klon,k+1),& ! ZFSUP_i(1:klon,k+1),ZFCDWN_i(1:klon,k+1),ZFCUP_i(1:klon,k+1) ZLWFT(1:klon,k+1) =-ZFLUX_i(1:klon,2,k+1)-ZFLUX_i(1:klon,1,k+1) ZLWFT0(1:klon,k+1)=-ZFLUC_i(1:klon,2,k+1)-ZFLUC_i(1:klon,1,k+1) ! print *,'FLUX2 FLUX1 FLUC2 FLUC1',ZFLUX_i(1:klon,2,k+1), ! s ZFLUX_i(1:klon,1,k+1),ZFLUC_i(1:klon,2,k+1),ZFLUC_i(1:klon,1,k+1) ENDDO print*,'OK1' ! --------- ! On renseigne les champs LMDz, pour avoir la meme chose qu'en sortie de ! LW_LMDAR4 et SW_LMDAR4 DO i = 1, kdlon zsolsw(i) = ZSWFT(i,1) zsolsw0(i) = ZSWFT0(i,1) ! zsolsw0(i) = ZFSDN0(i,1) -ZFSUP0(i,1) ztopsw(i) = ZSWFT(i,klev+1) ztopsw0(i) = ZSWFT0(i,klev+1) ! ztopsw0(i) = ZFSDN0(i,klev+1)-ZFSUP0(i,klev+1) ! ! zsollw(i) = ZFLDN(i,1) -ZFLUP(i,1) ! zsollw0(i) = ZFLDN0(i,1) -ZFLUP0(i,1) ! ztoplw(i) = ZFLDN(i,klev+1) -ZFLUP(i,klev+1) ! ztoplw0(i) = ZFLDN0(i,klev+1)-ZFLUP0(i,klev+1) zsollw(i) = ZLWFT(i,1) zsollw0(i) = ZLWFT0(i,1) ztoplw(i) = ZLWFT(i,klev+1) ztoplw0(i) = ZLWFT0(i,klev+1) ! zalbpla(i) = ZFSUP(i,klev+1)/ZFSDN(i,klev+1) zsollwdown(i)= ZFLDN(i,1) ENDDO print*,'OK2' ! extrait de SW_AR4 ! DO k = 1, KFLEV ! kpl1 = k+1 ! DO i = 1, KDLON ! PHEAT(i,k) = -(ZFSUP(i,kpl1)-ZFSUP(i,k)) -(ZFSDN(i,k)-ZFSDN(i,kpl1)) ! PHEAT(i,k) = PHEAT(i,k) * RDAY*RG/RCPD / PDP(i,k) ! ZLWFT(klon,k),ZSWFT DO k=1,kflev DO i=1,kdlon zheat(i,k)=(ZSWFT(i,k+1)-ZSWFT(i,k))*RDAY*RG/RCPD/PDP(i,k) zheat0(i,k)=(ZSWFT0(i,k+1)-ZSWFT0(i,k))*RDAY*RG/RCPD/PDP(i,k) zcool(i,k)=(ZLWFT(i,k)-ZLWFT(i,k+1))*RDAY*RG/RCPD/PDP(i,k) zcool0(i,k)=(ZLWFT0(i,k)-ZLWFT0(i,k+1))*RDAY*RG/RCPD/PDP(i,k) ! print *,'heat cool heat0 coOl0 '& ! ,zheat(i,k),zcool(i,k),zheat0(i,k),zcool0(i,k) ENDDO ENDDO #else abort_message='You should compile with -rrtm if running with iflag_rrtm=1' call abort_gcm(modname,abort_message,1) #endif ENDIF ! if(iflag_rrtm=0) print*,'OK3' !====================================================================== ! PSOLSW(i) = ZFSDN(i,1) - ZFSUP(i,1) ! PSOLSW0(i) = ZFSDN0(i,1) - ZFSUP0(i,1) ! PSOLSWAD(i) = ZFSDNAD(i,1) - ZFSUPAD(i,1) ! PSOLSWAI(i) = ZFSDNAI(i,1) - ZFSUPAI(i,1) ! PTOPSW(i) = ZFSDN(i,KFLEV+1) - ZFSUP(i,KFLEV+1) ! PTOPSW0(i) = ZFSDN0(i,KFLEV+1) - ZFSUP0(i,KFLEV+1) ! PTOPSWAD(i) = ZFSDNAD(i,KFLEV+1) - ZFSUPAD(i,KFLEV+1) ! PTOPSWAI(i) = ZFSDNAI(i,KFLEV+1) - ZFSUPAI(i,KFLEV+1) !====================================================================== DO i = 1, kdlon radsol(iof+i) = zsolsw(i) + zsollw(i) topsw(iof+i) = ztopsw(i) toplw(iof+i) = ztoplw(i) solsw(iof+i) = zsolsw(i) sollw(iof+i) = zsollw(i) sollwdown(iof+i) = zsollwdown(i) DO k = 1, kflev+1 lwdn0 ( iof+i,k) = ZFLDN0 ( i,k) lwdn ( iof+i,k) = ZFLDN ( i,k) lwup0 ( iof+i,k) = ZFLUP0 ( i,k) lwup ( iof+i,k) = ZFLUP ( i,k) ENDDO topsw0(iof+i) = ztopsw0(i) toplw0(iof+i) = ztoplw0(i) solsw0(iof+i) = zsolsw0(i) sollw0(iof+i) = zsollw0(i) albpla(iof+i) = zalbpla(i) DO k = 1, kflev+1 swdn0 ( iof+i,k) = ZFSDN0 ( i,k) swdn ( iof+i,k) = ZFSDN ( i,k) swup0 ( iof+i,k) = ZFSUP0 ( i,k) swup ( iof+i,k) = ZFSUP ( i,k) ENDDO ENDDO print*,'OK4' !-transform the aerosol forcings, if they have ! to be calculated IF (ok_ade) THEN DO i = 1, kdlon topswad_aero(iof+i) = ztopswadaero(i) topswad0_aero(iof+i) = ztopswad0aero(i) solswad_aero(iof+i) = zsolswadaero(i) solswad0_aero(iof+i) = zsolswad0aero(i) topsw_aero(iof+i,:) = ztopsw_aero(iof+i,:) topsw0_aero(iof+i,:) = ztopsw0_aero(iof+i,:) solsw_aero(iof+i,:) = zsolsw_aero(iof+i,:) solsw0_aero(iof+i,:) = zsolsw0_aero(iof+i,:) ENDDO ELSE DO i = 1, kdlon topswad_aero(iof+i) = 0.0 solswad_aero(iof+i) = 0.0 topswad0_aero(iof+i) = 0.0 solswad0_aero(iof+i) = 0.0 topsw_aero(iof+i,:) = 0. topsw0_aero(iof+i,:) =0. solsw_aero(iof+i,:) = 0. solsw0_aero(iof+i,:) = 0. ENDDO ENDIF IF (ok_aie) THEN DO i = 1, kdlon topswai_aero(iof+i) = ztopswaiaero(i) solswai_aero(iof+i) = zsolswaiaero(i) ENDDO ELSE DO i = 1, kdlon topswai_aero(iof+i) = 0.0 solswai_aero(iof+i) = 0.0 ENDDO ENDIF print*,'OK5' DO k = 1, kflev DO i = 1, kdlon ! scale factor to take into account the difference between ! dry air and watter vapour scpecifi! heat capacity zznormcp=1.0+RVTMP2*PWV(i,k) heat(iof+i,k) = zheat(i,k)/zznormcp cool(iof+i,k) = zcool(i,k)/zznormcp heat0(iof+i,k) = zheat0(i,k)/zznormcp cool0(iof+i,k) = zcool0(i,k)/zznormcp ENDDO ENDDO print*,'OK6' ! ENDDO print*,'OK7' ENDSUBROUTINE radlwsw_aero