!! ========================================================================= !! INCA - INteraction with Chemistry and Aerosols !! !! Copyright Laboratoire des Sciences du Climat et de l'Environnement (LSCE) !! Unite mixte CEA-CNRS-UVSQ !! !! Contributors to this INCA subroutine: !! !! Stacy Walters, NCAR, stacy@ucar.edu !! !! Anne Cozic, LSCE, anne.cozic@cea.fr !! Yann Meurdesoif, LSCE, yann.meurdesoif@cea.fr !! !! This software is a computer program whose purpose is to simulate the !! atmospheric gas phase and aerosol composition. The model is designed to be !! used within a transport model or a general circulation model. This version !! of INCA was designed to be coupled to the LMDz GCM. LMDz-INCA accounts !! for emissions, transport (resolved and sub-grid scale), photochemical !! transformations, and scavenging (dry deposition and washout) of chemical !! species and aerosols interactively in the GCM. Several versions of the INCA !! model are currently used depending on the envisaged applications with the !! chemistry-climate model. !! !! This software is governed by the CeCILL license under French law and !! abiding by the rules of distribution of free software. You can use, !! modify and/ or redistribute the software under the terms of the CeCILL !! license as circulated by CEA, CNRS and INRIA at the following URL !! "http://www.cecill.info". !! !! As a counterpart to the access to the source code and rights to copy, !! modify and redistribute granted by the license, users are provided only !! with a limited warranty and the software's author, the holder of the !! economic rights, and the successive licensors have only limited !! liability. !! !! In this respect, the user's attention is drawn to the risks associated !! with loading, using, modifying and/or developing or reproducing the !! software by the user in light of its specific status of free software, !! that may mean that it is complicated to manipulate, and that also !! therefore means that it is reserved for developers and experienced !! professionals having in-depth computer knowledge. Users are therefore !! encouraged to load and test the software's suitability as regards their !! requirements in conditions enabling the security of their systems and/or !! data to be ensured and, more generally, to use and operate it in the !! same conditions as regards security. !! !! The fact that you are presently reading this means that you have had !! knowledge of the CeCILL license and that you accept its terms. !! ========================================================================= #include SUBROUTINE OUTFLD_XIOS(pmid,temp,sh,ps,pdel,area) USE IOIPSL USE MOD_INCA_PARA USE INCA_DIM USE MOD_GRID_INCA USE SURF_CHEM_MOD USE PARAM_CHEM #ifdef AER USE AEROSOL_MOD, ONLY : trmx,trnx USE AEROSOL_PROGNOS, ONLY : mdw USE AEROSOL_METEO, ONLY : airm, zheight, zdens #endif USE SPECIES_NAMES USE CHEM_TRACNM, ONLY: solsym USE SFLX USE LIGHTNING, ONLY : flash, flpcg USE CHEM_MODS USE AIRPLANE_SRC, ONLY : ptrop USE TIME_MOD_INCA USE XIOS_INCA USE AEROSOL_DIAG USE CONST_LMDZ, ONLY : config_inca IMPLICIT NONE REAL, INTENT(IN) :: pmid(PLON,PLEV) REAL, INTENT(IN) :: pdel(PLON,PLEV) REAL, INTENT(IN) :: area(PLON) REAL, INTENT(IN) :: temp(PLON,PLEV) REAL, INTENT(IN) :: sh(PLON,PLEV) REAL, INTENT(IN) :: ps(PLON) INTEGER :: it,la, length CHARACTER(len=13) :: tmp_name REAL :: inter_tautot(PLON) REAL :: inter_tauant(PLON) REAL :: inter_taunat(PLON) CALL xios_inca_send_field("pmid",pmid) CALL xios_inca_send_field("temp",temp) CALL xios_inca_send_field("sh",sh) CALL xios_inca_send_field("ps",ps) CALL xios_inca_send_field("area",area) CALL xios_inca_send_field("pdel",pdel) #ifdef AER CALL xios_inca_send_field("zdens",zdens) DO it=trmx,trnx ! do just for aerosol mass tracer #ifdef DUSS IF ( (it.NE.id_CIDUSTM) .AND. (it.NE.id_ASSSM) .AND. (it.NE.id_CSSSM) & .AND. (it.NE.id_SSSSM) ) THEN #else #ifdef NMHC IF ((it.NE.id_CIDUSTM) & .AND. (it.NE.id_ASSSM) .AND. (it.NE.id_CSSSM) .AND. (it.NE.id_SSSSM) & .AND. (it.NE.id_ASPOMM) .AND. (it.NE.id_AIPOMM) & .AND. (it.NE.id_ASAPp1a) .AND. (it.NE.id_ASAPp2a) & .AND. (it.NE.id_ASARp1a) .AND. (it.NE.id_ASARp2a) & .AND. (it.NE.id_ASBCM) .AND. (it.NE.id_AIBCM) & .AND. (it.NE.id_ASNH4M) .AND. (it.NE.id_CINO3M) & .AND. (it.NE.id_ASSO4M) .AND. (it.NE.id_CSSO4M) .AND. & (it.NE.id_ASNO3M) .AND. (it.NE.id_CSNO3M) ) THEN #else IF ((it.NE.id_CIDUSTM) & .AND. (it.NE.id_ASSSM) .AND. (it.NE.id_CSSSM) .AND. (it.NE.id_SSSSM) & .AND. (it.NE.id_ASPOMM) .AND. (it.NE.id_AIPOMM) & .AND. (it.NE.id_ASBCM) .AND. (it.NE.id_AIBCM) & .AND. (it.NE.id_ASNH4M) .AND. (it.NE.id_CINO3M) & .AND. (it.NE.id_ASSO4M) .AND. (it.NE.id_CSSO4M) .AND. & (it.NE.id_ASNO3M) .AND. (it.NE.id_CSNO3M) ) THEN #endif #endif CYCLE ENDIF IF (config_inca .NE. 'aeNP') THEN DO la=1,las CALL xios_inca_send_field("OD"//cla(la)//"_"//solsym(it),tausum(:,la,it)) CALL xios_inca_send_field("OD"//cla(la)//"3D_"//solsym(it),tau(:,:,la,it)) ENDDO ENDIF CALL xios_inca_send_field("SED_"//solsym(it),sflux(:,it)) CALL xios_inca_send_field("WET_"//solsym(it),wflux(:,it)) CALL xios_inca_send_field("LOAD_"//solsym(it),aload(:,it)) CALL xios_inca_send_field("Emi_alt_"//solsym(it),eflux_alt(:,:,it)) CALL xios_inca_send_field("MDW_"//solsym(it),mdw(:,:,it)) CALL xios_inca_send_field("AERH2O_"//solsym(it),spaerh2o(:,:,it)) ENDDO !it=trmx,trnx IF (config_inca .NE. 'aeNP') THEN ! forcing diagnostics DO la=1,naero_grp CALL xios_inca_send_field("ODUVVIS_"//TRIM(mrfname(la)) ,tau_allaer(:,:,la,1)) CALL xios_inca_send_field("ODVISIR_"//TRIM(mrfname(la)) ,tau_allaer(:,:,la,2)) CALL xios_inca_send_field("SSAUVVIS_"//TRIM(mrfname(la)),piz_allaer(:,:,la,1)) CALL xios_inca_send_field("SSAVISIR_"//TRIM(mrfname(la)),piz_allaer(:,:,la,2)) CALL xios_inca_send_field("ASYUVVIS_"//TRIM(mrfname(la)),cg_allaer(:,:,la,1)) CALL xios_inca_send_field("ASYVISIR_"//TRIM(mrfname(la)),cg_allaer(:,:,la,2)) ENDDO ENDIF CALL xios_inca_send_field("AERH2O_AER",totaerh2o(:,:)) CALL xios_inca_send_field("AIRMASS",airm(:,:)) CALL xios_inca_send_field("DZ",zheight(:,:)) #ifndef DUSS CALL xios_inca_send_field("LOAD_DMS" , aload_dms(:) ) CALL xios_inca_send_field("LOAD_DMSO", aload_dmso(:)) CALL xios_inca_send_field("LOAD_SO2" , aload_so2(:) ) CALL xios_inca_send_field("WET_SO2" , wfluxso2(:) ) CALL xios_inca_send_field("WET_DMS" , wfluxdms(:) ) CALL xios_inca_send_field("WET_DMSO" , wfluxdmso(:) ) CALL xios_inca_send_field("WET_NOY" , wfluxnoy(:) ) CALL xios_inca_send_field("WET_NH3" , wfluxnh3(:) ) CALL xios_inca_send_field("WET_HNO3" , wfluxhno3(:) ) ! closing the sulfur budget CALL xios_inca_send_field("Emi_alt_SO2",eflux_alt_so2(:,:)) ! Added ThL CALL xios_inca_send_field("Emi_alt_NH3",eflux_alt_nh3(:,:)) ! Added ThL CALL xios_inca_send_field("Emi_alt_NO2",eflux_alt_no2(:,:)) ! Added ThL CALL xios_inca_send_field("SO2_p_dmsoh" ,SO2_p_dmsoh(:,:) ) CALL xios_inca_send_field("SO2_p_dmsno3",SO2_p_dmsno3(:,:)) CALL xios_inca_send_field("SO2_p_h2soh" ,SO2_p_h2soh(:,:) ) CALL xios_inca_send_field("SO2_p_dmsooh",SO2_p_dmsooh(:,:)) CALL xios_inca_send_field("DMSO_p_dmsoh",DMSO_p_dmsoh(:,:)) CALL xios_inca_send_field("Wet3D_SO2",wet3d_so2(:,:)) CALL xios_inca_send_field("Wet3D_DMS",wet3d_dms(:,:)) IF (config_inca .NE. 'aeNP') THEN CALL xios_inca_send_field("Wet3D_ASSO4M",wet3d_asso4m) CALL xios_inca_send_field("Wet3D_ASNH4M",wet3d_asnh4m) CALL xios_inca_send_field("Wet3D_ASNO3M",wet3d_asno3m) CALL xios_inca_send_field("Wet3D_CSNO3M",wet3d_csno3m) CALL xios_inca_send_field("Wet3D_CINO3M",wet3d_cino3m) ENDIF CALL xios_inca_send_field("ASSO4M_p_so2h2o2",ASSO4M_p_so2h2o2(:,:)) CALL xios_inca_send_field("ASSO4M_p_so2o3" ,ASSO4M_p_so2o3(:,:) ) CALL xios_inca_send_field("ASSO4M_p_so2oh" ,ASSO4M_p_so2oh(:,:) ) CALL xios_inca_send_field("ASMSAM_p_dmsooh" ,ASMSAM_p_dmsooh(:,:) ) CALL xios_inca_send_field("ASNO3M_p_nh3hno3",ASNO3M_p_nh3hno3(:,:)) CALL xios_inca_send_field("ASNH4M_p_nh3hno3",ASNH4M_p_nh3hno3(:,:)) CALL xios_inca_send_field("NH3_p_nh3hno3" ,NH3_p_nh3hno3(:,:) ) CALL xios_inca_send_field("ASSO4M_p_so2oh_col", asso4m_p_so2oh_col) CALL xios_inca_send_field("ASSO4M_p_so2o3_col", asso4m_p_so2o3_col) CALL xios_inca_send_field("ASSO4M_p_so2h2o2_col", asso4m_p_so2h2o2_col) #endif #ifdef NMHC CALL xios_inca_send_field("CINO3_p_a",cino3_p_a(:,:)) CALL xios_inca_send_field("CSNO3_p_a1",csno3_p_a1(:,:)) CALL xios_inca_send_field("HNO3_p_nh3hno3",hno3_p_nh3hno3(:,:)) #endif #endif #ifdef NMHC CALL xios_inca_send_field("ptrop",ptrop(:)) CALL xios_inca_send_field("LghtFlash",flash(:)) CALL xios_inca_send_field("CGLghtFlash",flpcg(:)) CALL xios_inca_send_field("O3_ste",o3_st_flx(:)) CALL xios_inca_send_field("O3_prod",o3_prod(:,:)) CALL xios_inca_send_field("O3_loss",o3_loss(:,:)) CALL xios_inca_send_field("CO_loss",co_loss(:,:)) CALL xios_inca_send_field("CH4_loss",ch4_loss(:,:)) CALL xios_inca_send_field("N2O_loss",N2O_loss(:,:)) CALL xios_inca_send_field("o3_col",o3_col(:)) CALL xios_inca_send_field("o3tot_col",o3tot_col(:)) CALL xios_inca_send_field("co_col",co_col(:)) CALL xios_inca_send_field("so2_col",so2_col(:)) CALL xios_inca_send_field("oh_col",oh_col(:)) CALL xios_inca_send_field("ch4_col",ch4_col(:)) CALL xios_inca_send_field("ch2o_col",ch2o_col(:)) CALL xios_inca_send_field("no2_col",no2_col(:)) CALL xios_inca_send_field("hno2_col",hno2_col(:)) CALL xios_inca_send_field("Dry_HONO",dry_hono(:)) CALL xios_inca_send_field("Wet3D_H2O2",wet3d_h2o2(:,:)) CALL xios_inca_send_field("Wet3D_HONO",wet3d_hono(:,:)) CALL xios_inca_send_field("HNO3_p_g",hno3_p_g(:,:)) CALL xios_inca_send_field("HNO3_p_a",hno3_p_a(:,:)) CALL xios_inca_send_field("HNO3_l_g",hno3_l_g(:,:)) CALL xios_inca_send_field("HNO3_l_a",hno3_l_a(:,:)) #endif #if defined(NMHC) || defined(AER) #ifndef DUSS CALL xios_inca_send_field("NH3_l_g",nh3_l_g(:,:)) CALL xios_inca_send_field("NH3_l_a",nh3_l_a(:,:)) CALL xios_inca_send_field("HONO_p_g",hono_p_g(:,:)) CALL xios_inca_send_field("HONO_p_a",hono_p_a(:,:)) CALL xios_inca_send_field("HONO_l_g",hono_l_g(:,:)) CALL xios_inca_send_field("HONO_l_a",hono_l_a(:,:)) CALL xios_inca_send_field("Wet3D_NH3",wet3d_nh3(:,:)) CALL xios_inca_send_field("Dry_NH3",dry_nh3(:)) CALL xios_inca_send_field("nh3_col",nh3_col(:)) CALL xios_inca_send_field("Dry_HNO3",dry_hno3(:)) CALL xios_inca_send_field("Dry_NOY",dry_noy(:)) CALL xios_inca_send_field("Wet3D_NOY",wet3d_noy(:,:)) CALL xios_inca_send_field("Wet3D_HNO3",wet3d_hno3(:,:)) #ifdef NMHC CALL xios_inca_send_field("ASAPp1a_p",ASAPp1a_p(:,:)) CALL xios_inca_send_field("ASAPp2a_p",ASAPp2a_p(:,:)) CALL xios_inca_send_field("ASARp1a_p",ASARp1a_p(:,:)) CALL xios_inca_send_field("ASARp2a_p",ASARp2a_p(:,:)) CALL xios_inca_send_field("POM_p_g",pom_p_g(:,:)) #endif #endif #endif #ifdef AER IF (config_inca .NE. 'aeNP') THEN CALL xios_inca_send_field("taucld" ,cld_tau(:,:)) CALL xios_inca_send_field("taucldpi",cld_taupi(:,:)) CALL xios_inca_send_field("cldemi" ,cld_emi(:,:)) CALL xios_inca_send_field("CCM1" ,ccm1(:,:)) CALL xios_inca_send_field("CCM2" ,ccm2(:,:)) #ifndef DUSS #ifdef NMHC inter_tautot(:) = & tausum(:,2,id_CIDUSTM) + tausum(:,2,id_ASSO4M) + & tausum(:,2,id_ASAPp1a) + tausum(:,2,id_ASAPp2a) + & tausum(:,2,id_ASARp1a) + tausum(:,2,id_ASARp2a) + & tausum(:,2,id_AIBCM) + tausum(:,2,id_ASBCM) + & tausum(:,2,id_AIPOMM) + tausum(:,2,id_ASPOMM) + & tausum(:,2,id_CSSSM) + tausum(:,2,id_ASSSM) + & tausum(:,2,id_SSSSM) + tausum(:,2,id_ASNO3M) + & tausum(:,2,id_CINO3M) + tausum(:,2,id_CSNO3M) inter_tauant(:) = & tausum(:,2,id_ASSO4M) + tausum(:,2,id_AIBCM) + & tausum(:,2,id_ASBCM) + tausum(:,2,id_AIPOMM) + & tausum(:,2,id_ASARp1a) + tausum(:,2,id_ASARp2a) + & tausum(:,2,id_ASPOMM) + tausum(:,2,id_ASNO3M) #else inter_tautot(:) = & tausum(:,2,id_CIDUSTM) + tausum(:,2,id_ASSO4M) + & tausum(:,2,id_AIBCM) + tausum(:,2,id_ASBCM) + & tausum(:,2,id_AIPOMM) + tausum(:,2,id_ASPOMM) + & tausum(:,2,id_CSSSM) + tausum(:,2,id_ASSSM) + & tausum(:,2,id_SSSSM) + tausum(:,2,id_ASNO3M) + & tausum(:,2,id_CINO3M) + tausum(:,2,id_CSNO3M) inter_tauant(:) = & tausum(:,2,id_ASSO4M) + tausum(:,2,id_AIBCM) + & tausum(:,2,id_ASBCM) + tausum(:,2,id_AIPOMM) + & tausum(:,2,id_ASPOMM) + tausum(:,2,id_ASNO3M) #endif #else inter_tautot(:) = & tausum(:,2,id_CIDUSTM) + tausum(:,2,id_CSSSM) + & tausum(:,2,id_ASSSM) + tausum(:,2,id_SSSSM) inter_tauant(:) = 0. #endif inter_taunat(:) = & tausum(:,2,id_CIDUSTM) + tausum(:,2,id_CSSSM) + & tausum(:,2,id_ASSSM) + tausum(:,2,id_SSSSM) CALL xios_inca_send_field("tautot_550",inter_tautot(:)) CALL xios_inca_send_field("tauant_550",inter_tauant(:)) CALL xios_inca_send_field("taunat_550",inter_taunat(:)) CALL xios_inca_send_field("SOLUBLE_LOAD" ,colmass_solu_aero(:)) CALL xios_inca_send_field("SOLUBLE_LOAD_PI" ,colmass_solu_aero_pi(:)) CALL xios_inca_send_field("SOLUBLE_LOAD_ANTR",colmass_solu_antro(:)) DO it=1,naero_grp CALL xios_inca_send_field("SWTOAAS_"//mrfname(it) , dforctoaas(:,it) ) CALL xios_inca_send_field("SWTOACS_"//mrfname(it) ,dforctoacs(:,it) ) CALL xios_inca_send_field("SWSRFAS_"//mrfname(it) ,dforcsrfas(:,it) ) CALL xios_inca_send_field("SWSRFCS_"//mrfname(it) ,dforcsrfcs(:,it) ) CALL xios_inca_send_field("FSWTOAAS_"//mrfname(it),swtoaas(:,it)) CALL xios_inca_send_field("FSWTOACS_"//mrfname(it),swtoacs(:,it)) CALL xios_inca_send_field("FSWSRFAS_"//mrfname(it),swsrfas(:,it)) CALL xios_inca_send_field("FSWSRFCS_"//mrfname(it),swsrfcs(:,it)) ENDDO CALL xios_inca_send_field("SWTOAAS_AI" ,iforctoaas(:)) CALL xios_inca_send_field("SWSRFAS_AI" ,iforcsrfas(:)) CALL xios_inca_send_field("FSWTOAAS_AI",swtoaas_ai(:)) CALL xios_inca_send_field("FSWSRFAS_AI",swsrfas_ai(:)) !! CLOUD FORCING CALL xios_inca_send_field("cforcTOA_0" ,cforctoa_0(:)) CALL xios_inca_send_field("cforcSRF_0" ,cforcsrf_0(:)) CALL xios_inca_send_field("DcforcTOA_NAT" ,dcforctoa_nat(:)) CALL xios_inca_send_field("DcforcSRF_NAT" ,dcforcsrf_nat(:)) CALL xios_inca_send_field("DcforcTOA_ANTR",dcforctoa_antr(:)) CALL xios_inca_send_field("DcforcSRF_ANTR",dcforcsrf_antr(:)) CALL xios_inca_send_field("CLOUDfract" ,cldfract(:)) CALL xios_inca_send_field("cRFtoa_nat" ,cRFtoa_nat(:)) CALL xios_inca_send_field("cRFsrf_nat" ,cRFsrf_nat(:)) CALL xios_inca_send_field("cRFtoa_antr" ,cRFtoa_antr(:)) CALL xios_inca_send_field("cRFsrf_antr" ,cRFsrf_antr(:)) !! LMD variables CALL xios_inca_send_field("SWTOAAS_AD",swtoaas_ad(:)) CALL xios_inca_send_field("SWTOACS_AD",swtoacs_ad(:)) CALL xios_inca_send_field("SWSRFAS_AD",swsrfas_ad(:)) CALL xios_inca_send_field("SWSRFCS_AD",swsrfcs_ad(:)) !! 2: Fluxes used for heat CALL xios_inca_send_field("tops" ,tops(:)) CALL xios_inca_send_field("tops0",tops0(:)) CALL xios_inca_send_field("topl" ,topl(:)) CALL xios_inca_send_field("topl0",topl0(:)) !! END FLUXES-FORCING DIAGN ENDIF !! couplage avec orchidee IF (CoupSurfAtm) THEN CALL xios_inca_send_field("maxvegetfrac",maxvegetfrac_fromOrch(:,:) ) CALL xios_inca_send_field("SurfType_frac",surftype_frac(:,:) ) CALL xios_inca_send_field("vegetfrac",vegetfrac_fromOrch(:,:) ) CALL xios_inca_send_field("LAI", lai_fromOrch(:,:)) CALL xios_inca_send_field("snowfromOrch", snow_fromOrch(:)) DO it=1,nb_flux CALL xios_inca_send_field(field_emi_names(it), emiflx_fromOrch(:,:,it)) CALL xios_inca_send_field('tot'//field_emi_names(it), tot_emiflx_fromOrch(:,it)) length = len_trim(field_emi_names(it)) tmp_name = field_emi_names(it) CALL xios_inca_send_field('EmiNoBio_'//TRIM(tmp_name(5:length)), eflux_notfromveg(:,it)) CALL xios_inca_send_field('EmiBio_'//TRIM(tmp_name(5:length)), eflux_veg(:,it)) ENDDO ENDIF #endif END SUBROUTINE OUTFLD_XIOS